@slickgrid-universal/vanilla-force-bundle 3.0.1 → 3.1.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.
@@ -1,21 +1,21 @@
1
1
  (function(Rn,Cl){typeof exports=="object"&&typeof module<"u"?Cl(exports):typeof define=="function"&&define.amd?define(["exports"],Cl):(Rn=typeof globalThis<"u"?globalThis:Rn||self,Cl(Rn.Slicker={}))})(this,function(Rn){"use strict";function Cl(a,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in a)){const o=Object.getOwnPropertyDescriptor(n,r);o&&Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var Ji;(function(a){a.local="local",a.remote="remote"})(Ji||(Ji={}));class Cp{constructor(t){this.rxjs=t}addRxJsResource(t){this.rxjs=t}executeBackendProcessesCallback(t,e,n,r){const o=new Date;e&&n.service.postProcess&&n.service.postProcess(e),e&&(n!=null&&n.internalPostProcess)&&n.internalPostProcess(e),n.postProcess!==void 0&&(e instanceof Object&&(e.metrics={startTime:t,endTime:o,executionTime:o.valueOf()-t.valueOf(),itemCount:r,totalItemCount:r}),n.postProcess(e))}onBackendError(t,e){if(typeof(e==null?void 0:e.onError)=="function")e.onError(t);else throw t}executeBackendCallback(t,e,n,r,o,s){var l;if(t){n&&!n.clearFilterTriggered&&!n.clearSortTriggered&&(s!=null&&s.emitActionChangedCallback)&&s.emitActionChangedCallback.call(this,Ji.remote);const u=t.process(e);if(u instanceof Promise&&u.then)u.then(p=>{var c;this.executeBackendProcessesCallback(r,p,t,o),(c=s==null?void 0:s.successCallback)===null||c===void 0||c.call(this,n)}).catch(p=>{var c;(c=s==null?void 0:s.errorCallback)===null||c===void 0||c.call(this,n),this.onBackendError(p,t)});else if(!((l=this.rxjs)===null||l===void 0)&&l.isObservable(u)){const p=this.rxjs;p.isObservable(s==null?void 0:s.httpCancelRequestSubject)&&(s==null||s.httpCancelRequestSubject.next()),u.pipe(p.takeUntil(p.iif(()=>p.isObservable(s==null?void 0:s.httpCancelRequestSubject),s==null?void 0:s.httpCancelRequestSubject,p.EMPTY))).subscribe(c=>{var f;this.executeBackendProcessesCallback(r,c,t,o),(f=s==null?void 0:s.successCallback)===null||f===void 0||f.call(this,n)},c=>{var f;(f=s==null?void 0:s.errorCallback)===null||f===void 0||f.call(this,n),this.onBackendError(c,t)})}}}refreshBackendDataset(t){var e,n;let r="";const o=t==null?void 0:t.backendServiceApi;if(!o||!o.service||!o.process)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');if(o.service&&(r=o.service.buildQuery()),r&&r!==""){const s=new Date;o.preProcess&&o.preProcess();const l=(n=(e=t==null?void 0:t.pagination)===null||e===void 0?void 0:e.totalItems)!==null&&n!==void 0?n:0;this.executeBackendCallback(o,r,null,s,l)}}}const Gg=Object.freeze(Object.defineProperty({__proto__:null,BackendUtilityService:Cp},Symbol.toStringTag,{value:"Module"}));function Na(a,t){["pop","push","reverse","shift","unshift","splice","sort"].forEach(n=>{a[n]=(...r)=>{const o=Array.prototype[n].apply(a,r);return t.apply(a,[a,r]),o}})}function Kc(a,t,e){let n=a[t];Object.defineProperty(a,t,{configurable:!0,get(){return n},set(r){n=r,e.apply(a,[r,a[t]])}})}const Wg=Object.freeze(Object.defineProperty({__proto__:null,collectionObserver:Na,propertyObserver:Kc},Symbol.toStringTag,{value:"Module"})),$g=a=>a;function Yg(a,t,e=$g,n=()=>{}){const r=a&&a.length?[{pointer:a,offset:0}]:[],o=[];let s;for(;r.length;)for(s=r.pop();s.offset<s.pointer.length;){const l=s.pointer[s.offset],u=n(l),p=t(l);o.push(e(l,s.node,u,s.nodeId)),s.offset+=1,p&&(r.push(s),s={pointer:p,offset:0,node:l,nodeId:u})}return o}var Rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zc(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function La(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var yp={exports:{}};(function(a,t){(function(e,n){a.exports=n()})(Rr,function(){var e;function n(){return e.apply(null,arguments)}function r(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function o(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function s(g,S){return Object.prototype.hasOwnProperty.call(g,S)}function l(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;for(var S in g)if(s(g,S))return;return 1}function u(g){return g===void 0}function p(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function c(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function f(g,S){for(var D=[],H=g.length,ee=0;ee<H;++ee)D.push(S(g[ee],ee));return D}function m(g,S){for(var D in S)s(S,D)&&(g[D]=S[D]);return s(S,"toString")&&(g.toString=S.toString),s(S,"valueOf")&&(g.valueOf=S.valueOf),g}function v(g,S,D,H){return Je(g,S,D,H,!0).utc()}function _(g){return g._pf==null&&(g._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),g._pf}function C(g){if(g._isValid==null){var S=_(g),D=w.call(S.parsedDateParts,function(H){return H!=null}),D=!isNaN(g._d.getTime())&&S.overflow<0&&!S.empty&&!S.invalidEra&&!S.invalidMonth&&!S.invalidWeekday&&!S.weekdayMismatch&&!S.nullInput&&!S.invalidFormat&&!S.userInvalidated&&(!S.meridiem||S.meridiem&&D);if(g._strict&&(D=D&&S.charsLeftOver===0&&S.unusedTokens.length===0&&S.bigHour===void 0),Object.isFrozen!=null&&Object.isFrozen(g))return D;g._isValid=D}return g._isValid}function x(g){var S=v(NaN);return g!=null?m(_(S),g):_(S).userInvalidated=!0,S}var w=Array.prototype.some||function(g){for(var S=Object(this),D=S.length>>>0,H=0;H<D;H++)if(H in S&&g.call(this,S[H],H,S))return!0;return!1},E=n.momentProperties=[],I=!1;function k(g,S){var D,H,ee,xe=E.length;if(u(S._isAMomentObject)||(g._isAMomentObject=S._isAMomentObject),u(S._i)||(g._i=S._i),u(S._f)||(g._f=S._f),u(S._l)||(g._l=S._l),u(S._strict)||(g._strict=S._strict),u(S._tzm)||(g._tzm=S._tzm),u(S._isUTC)||(g._isUTC=S._isUTC),u(S._offset)||(g._offset=S._offset),u(S._pf)||(g._pf=_(S)),u(S._locale)||(g._locale=S._locale),0<xe)for(D=0;D<xe;D++)u(ee=S[H=E[D]])||(g[H]=ee);return g}function F(g){k(this,g),this._d=new Date(g._d!=null?g._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),I===!1&&(I=!0,n.updateOffset(this),I=!1)}function N(g){return g instanceof F||g!=null&&g._isAMomentObject!=null}function V(g){n.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+g)}function Q(g,S){var D=!0;return m(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,g),D){for(var H,ee,xe=[],Ve=arguments.length,qe=0;qe<Ve;qe++){if(H="",typeof arguments[qe]=="object"){for(ee in H+=`
2
2
  [`+qe+"] ",arguments[0])s(arguments[0],ee)&&(H+=ee+": "+arguments[0][ee]+", ");H=H.slice(0,-2)}else H=arguments[qe];xe.push(H)}V(g+`
3
3
  Arguments: `+Array.prototype.slice.call(xe).join("")+`
4
- `+new Error().stack),D=!1}return S.apply(this,arguments)},S)}var L={};function se(g,S){n.deprecationHandler!=null&&n.deprecationHandler(g,S),L[g]||(V(S),L[g]=!0)}function Ce(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function J(g,S){var D,H=m({},g);for(D in S)s(S,D)&&(o(g[D])&&o(S[D])?(H[D]={},m(H[D],g[D]),m(H[D],S[D])):S[D]!=null?H[D]=S[D]:delete H[D]);for(D in g)s(g,D)&&!s(S,D)&&o(g[D])&&(H[D]=m({},H[D]));return H}function z(g){g!=null&&this.set(g)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var P=Object.keys||function(g){var S,D=[];for(S in g)s(g,S)&&D.push(S);return D};function le(g,S,D){var H=""+Math.abs(g);return(0<=g?D?"+":"":"-")+Math.pow(10,Math.max(0,S-H.length)).toString().substr(1)+H}var Ke=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Oe={},ye={};function Re(g,S,D,H){var ee=typeof H=="string"?function(){return this[H]()}:H;g&&(ye[g]=ee),S&&(ye[S[0]]=function(){return le(ee.apply(this,arguments),S[1],S[2])}),D&&(ye[D]=function(){return this.localeData().ordinal(ee.apply(this,arguments),g)})}function ae(g,S){return g.isValid()?(S=he(S,g.localeData()),Oe[S]=Oe[S]||function(D){for(var H,ee=D.match(Ke),xe=0,Ve=ee.length;xe<Ve;xe++)ye[ee[xe]]?ee[xe]=ye[ee[xe]]:ee[xe]=(H=ee[xe]).match(/\[[\s\S]/)?H.replace(/^\[|\]$/g,""):H.replace(/\\/g,"");return function(qe){for(var yt="",ft=0;ft<Ve;ft++)yt+=Ce(ee[ft])?ee[ft].call(qe,D):ee[ft];return yt}}(S),Oe[S](g)):g.localeData().invalidDate()}function he(g,S){var D=5;function H(ee){return S.longDateFormat(ee)||ee}for(Pe.lastIndex=0;0<=D&&Pe.test(g);)g=g.replace(Pe,H),Pe.lastIndex=0,--D;return g}var Ne={};function ze(g,S){var D=g.toLowerCase();Ne[D]=Ne[D+"s"]=Ne[S]=g}function Be(g){return typeof g=="string"?Ne[g]||Ne[g.toLowerCase()]:void 0}function de(g){var S,D,H={};for(D in g)s(g,D)&&(S=Be(D))&&(H[S]=g[D]);return H}var Ee={};function ve(g,S){Ee[g]=S}function He(g){return g%4==0&&g%100!=0||g%400==0}function lt(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ie(S){var S=+S,D=0;return D=S!=0&&isFinite(S)?lt(S):D}function it(g,S){return function(D){return D!=null?(R(this,g,D),n.updateOffset(this,S),this):et(this,g)}}function et(g,S){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+S]():NaN}function R(g,S,D){g.isValid()&&!isNaN(D)&&(S==="FullYear"&&He(g.year())&&g.month()===1&&g.date()===29?(D=Ie(D),g._d["set"+(g._isUTC?"UTC":"")+S](D,g.month(),Li(D,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+S](D))}var te=/\d/,Mt=/\d\d/,ge=/\d{3}/,qi=/\d{4}/,on=/[+-]?\d{6}/,$=/\d\d?/,X=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,Me=/\d{1,3}/,Yn=/\d{1,4}/,Tr=/[+-]?\d{1,6}/,Ue=/\d+/,Se=/[+-]?\d+/,Ye=/Z|[+-]\d\d:?\d\d/gi,pt=/Z|[+-]\d\d(?::?\d\d)?/gi,Ge=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Le(g,S,D){yi[g]=Ce(S)?S:function(H,ee){return H&&D?D:S}}function Xt(g,S){return s(yi,g)?yi[g](S._strict,S._locale):new RegExp(It(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(D,H,ee,xe,Ve){return H||ee||xe||Ve})))}function It(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var yi={},q={};function W(g,S){var D,H,ee=S;for(typeof g=="string"&&(g=[g]),p(S)&&(ee=function(xe,Ve){Ve[S]=Ie(xe)}),H=g.length,D=0;D<H;D++)q[g[D]]=ee}function pe(g,S){W(g,function(D,H,ee,xe){ee._w=ee._w||{},S(D,ee._w,ee,xe)})}var ke,at=0,ot=1,ct=2,Rt=3,Ht=4,Tt=5,Ut=6,Kt=7,Ni=8;function Li(g,S){if(isNaN(g)||isNaN(S))return NaN;var D=(S%(D=12)+D)%D;return g+=(S-D)/12,D==1?He(g)?29:28:31-D%7%2}ke=Array.prototype.indexOf||function(g){for(var S=0;S<this.length;++S)if(this[S]===g)return S;return-1},Re("M",["MM",2],"Mo",function(){return this.month()+1}),Re("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)}),Re("MMMM",0,0,function(g){return this.localeData().months(this,g)}),ze("month","M"),ve("month",8),Le("M",$),Le("MM",$,Mt),Le("MMM",function(g,S){return S.monthsShortRegex(g)}),Le("MMMM",function(g,S){return S.monthsRegex(g)}),W(["M","MM"],function(g,S){S[ot]=Ie(g)-1}),W(["MMM","MMMM"],function(g,S,D,H){H=D._locale.monthsParse(g,H,D._strict),H!=null?S[ot]=H:_(D).invalidMonth=g});var U="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Z="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ce=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,we=Ge,st=Ge;function vt(g,S){var D;if(g.isValid()){if(typeof S=="string"){if(/^\d+$/.test(S))S=Ie(S);else if(!p(S=g.localeData().monthsParse(S)))return}D=Math.min(g.date(),Li(g.year(),S)),g._d["set"+(g._isUTC?"UTC":"")+"Month"](S,D)}}function ht(g){return g!=null?(vt(this,g),n.updateOffset(this,!0),this):et(this,"Month")}function wt(){function g(Ve,qe){return qe.length-Ve.length}for(var S,D=[],H=[],ee=[],xe=0;xe<12;xe++)S=v([2e3,xe]),D.push(this.monthsShort(S,"")),H.push(this.months(S,"")),ee.push(this.months(S,"")),ee.push(this.monthsShort(S,""));for(D.sort(g),H.sort(g),ee.sort(g),xe=0;xe<12;xe++)D[xe]=It(D[xe]),H[xe]=It(H[xe]);for(xe=0;xe<24;xe++)ee[xe]=It(ee[xe]);this._monthsRegex=new RegExp("^("+ee.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+H.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+D.join("|")+")","i")}function Bt(g){return He(g)?366:365}Re("Y",0,0,function(){var g=this.year();return g<=9999?le(g,4):"+"+g}),Re(0,["YY",2],0,function(){return this.year()%100}),Re(0,["YYYY",4],0,"year"),Re(0,["YYYYY",5],0,"year"),Re(0,["YYYYYY",6,!0],0,"year"),ze("year","y"),ve("year",1),Le("Y",Se),Le("YY",$,Mt),Le("YYYY",Yn,qi),Le("YYYYY",Tr,on),Le("YYYYYY",Tr,on),W(["YYYYY","YYYYYY"],at),W("YYYY",function(g,S){S[at]=g.length===2?n.parseTwoDigitYear(g):Ie(g)}),W("YY",function(g,S){S[at]=n.parseTwoDigitYear(g)}),W("Y",function(g,S){S[at]=parseInt(g,10)}),n.parseTwoDigitYear=function(g){return Ie(g)+(68<Ie(g)?1900:2e3)};var xo=it("FullYear",!0);function Et(g,S,D,H,ee,xe,Ve){var qe;return g<100&&0<=g?(qe=new Date(g+400,S,D,H,ee,xe,Ve),isFinite(qe.getFullYear())&&qe.setFullYear(g)):qe=new Date(g,S,D,H,ee,xe,Ve),qe}function _t(g){var S;return g<100&&0<=g?((S=Array.prototype.slice.call(arguments))[0]=g+400,S=new Date(Date.UTC.apply(null,S)),isFinite(S.getUTCFullYear())&&S.setUTCFullYear(g)):S=new Date(Date.UTC.apply(null,arguments)),S}function Zt(g,S,D){return D=7+S-D,D-(7+_t(g,0,D).getUTCDay()-S)%7-1}function Ii(g,Ve,qe,H,ee){var xe,Ve=1+7*(Ve-1)+(7+qe-H)%7+Zt(g,H,ee),qe=Ve<=0?Bt(xe=g-1)+Ve:Ve>Bt(g)?(xe=g+1,Ve-Bt(g)):(xe=g,Ve);return{year:xe,dayOfYear:qe}}function Gi(g,S,D){var H,ee,xe=Zt(g.year(),S,D),xe=Math.floor((g.dayOfYear()-xe-1)/7)+1;return xe<1?H=xe+Qt(ee=g.year()-1,S,D):xe>Qt(g.year(),S,D)?(H=xe-Qt(g.year(),S,D),ee=g.year()+1):(ee=g.year(),H=xe),{week:H,year:ee}}function Qt(g,ee,D){var H=Zt(g,ee,D),ee=Zt(g+1,ee,D);return(Bt(g)-H+ee)/7}Re("w",["ww",2],"wo","week"),Re("W",["WW",2],"Wo","isoWeek"),ze("week","w"),ze("isoWeek","W"),ve("week",5),ve("isoWeek",5),Le("w",$),Le("ww",$,Mt),Le("W",$),Le("WW",$,Mt),pe(["w","ww","W","WW"],function(g,S,D,H){S[H.substr(0,1)]=Ie(g)});function Hi(g,S){return g.slice(S,7).concat(g.slice(0,S))}Re("d",0,"do","day"),Re("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),Re("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),Re("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),Re("e",0,0,"weekday"),Re("E",0,0,"isoWeekday"),ze("day","d"),ze("weekday","e"),ze("isoWeekday","E"),ve("day",11),ve("weekday",11),ve("isoWeekday",11),Le("d",$),Le("e",$),Le("E",$),Le("dd",function(g,S){return S.weekdaysMinRegex(g)}),Le("ddd",function(g,S){return S.weekdaysShortRegex(g)}),Le("dddd",function(g,S){return S.weekdaysRegex(g)}),pe(["dd","ddd","dddd"],function(g,S,D,H){H=D._locale.weekdaysParse(g,H,D._strict),H!=null?S.d=H:_(D).invalidWeekday=g}),pe(["d","e","E"],function(g,S,D,H){S[H]=Ie(g)});var Nn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),pn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ct="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_e=Ge,je=Ge,mt=Ge;function Jt(){function g(ft,zt){return zt.length-ft.length}for(var S,D,H,ee=[],xe=[],Ve=[],qe=[],yt=0;yt<7;yt++)H=v([2e3,1]).day(yt),S=It(this.weekdaysMin(H,"")),D=It(this.weekdaysShort(H,"")),H=It(this.weekdays(H,"")),ee.push(S),xe.push(D),Ve.push(H),qe.push(S),qe.push(D),qe.push(H);ee.sort(g),xe.sort(g),Ve.sort(g),qe.sort(g),this._weekdaysRegex=new RegExp("^("+qe.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+Ve.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+xe.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+ee.join("|")+")","i")}function Mi(){return this.hours()%12||12}function mn(g,S){Re(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),S)})}function pi(g,S){return S._meridiemParse}Re("H",["HH",2],0,"hour"),Re("h",["hh",2],0,Mi),Re("k",["kk",2],0,function(){return this.hours()||24}),Re("hmm",0,0,function(){return""+Mi.apply(this)+le(this.minutes(),2)}),Re("hmmss",0,0,function(){return""+Mi.apply(this)+le(this.minutes(),2)+le(this.seconds(),2)}),Re("Hmm",0,0,function(){return""+this.hours()+le(this.minutes(),2)}),Re("Hmmss",0,0,function(){return""+this.hours()+le(this.minutes(),2)+le(this.seconds(),2)}),mn("a",!0),mn("A",!1),ze("hour","h"),ve("hour",13),Le("a",pi),Le("A",pi),Le("H",$),Le("h",$),Le("k",$),Le("HH",$,Mt),Le("hh",$,Mt),Le("kk",$,Mt),Le("hmm",X),Le("hmmss",ne),Le("Hmm",X),Le("Hmmss",ne),W(["H","HH"],Rt),W(["k","kk"],function(g,S,D){g=Ie(g),S[Rt]=g===24?0:g}),W(["a","A"],function(g,S,D){D._isPm=D._locale.isPM(g),D._meridiem=g}),W(["h","hh"],function(g,S,D){S[Rt]=Ie(g),_(D).bigHour=!0}),W("hmm",function(g,S,D){var H=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H)),_(D).bigHour=!0}),W("hmmss",function(g,S,D){var H=g.length-4,ee=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H,2)),S[Tt]=Ie(g.substr(ee)),_(D).bigHour=!0}),W("Hmm",function(g,S,D){var H=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H))}),W("Hmmss",function(g,S,D){var H=g.length-4,ee=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H,2)),S[Tt]=Ie(g.substr(ee))}),Ge=it("Hours",!0);var Xi,lr={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:U,monthsShort:Z,week:{dow:0,doy:6},weekdays:Nn,weekdaysMin:Ct,weekdaysShort:pn,meridiemParse:/[ap]\.?m?\.?/i},Ei={},nn={};function Lr(g){return g&&g.toLowerCase().replace("_","-")}function go(g){for(var S,D,H,ee,xe=0;xe<g.length;){for(S=(ee=Lr(g[xe]).split("-")).length,D=(D=Lr(g[xe+1]))?D.split("-"):null;0<S;){if(H=Zn(ee.slice(0,S).join("-")))return H;if(D&&D.length>=S&&function(Ve,qe){for(var yt=Math.min(Ve.length,qe.length),ft=0;ft<yt;ft+=1)if(Ve[ft]!==qe[ft])return ft;return yt}(ee,D)>=S-1)break;S--}xe++}return Xi}function Zn(g){var S;if(Ei[g]===void 0&&a&&a.exports&&g.match("^[^/\\\\]*$")!=null)try{S=Xi._abbr,La("./locale/"+g),Qn(S)}catch{Ei[g]=null}return Ei[g]}function Qn(g,S){return g&&((S=u(S)?mr(g):_o(g,S))?Xi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),Xi._abbr}function _o(g,S){if(S===null)return delete Ei[g],null;var D,H=lr;if(S.abbr=g,Ei[g]!=null)se("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),H=Ei[g]._config;else if(S.parentLocale!=null)if(Ei[S.parentLocale]!=null)H=Ei[S.parentLocale]._config;else{if((D=Zn(S.parentLocale))==null)return nn[S.parentLocale]||(nn[S.parentLocale]=[]),nn[S.parentLocale].push({name:g,config:S}),null;H=D._config}return Ei[g]=new z(J(H,S)),nn[g]&&nn[g].forEach(function(ee){_o(ee.name,ee.config)}),Qn(g),Ei[g]}function mr(g){var S;if(!(g=g&&g._locale&&g._locale._abbr?g._locale._abbr:g))return Xi;if(!r(g)){if(S=Zn(g))return S;g=[g]}return go(g)}function ar(g){var S=g._a;return S&&_(g).overflow===-2&&(S=S[ot]<0||11<S[ot]?ot:S[ct]<1||S[ct]>Li(S[at],S[ot])?ct:S[Rt]<0||24<S[Rt]||S[Rt]===24&&(S[Ht]!==0||S[Tt]!==0||S[Ut]!==0)?Rt:S[Ht]<0||59<S[Ht]?Ht:S[Tt]<0||59<S[Tt]?Tt:S[Ut]<0||999<S[Ut]?Ut:-1,_(g)._overflowDayOfYear&&(S<at||ct<S)&&(S=ct),_(g)._overflowWeeks&&S===-1&&(S=Kt),_(g)._overflowWeekday&&S===-1&&(S=Ni),_(g).overflow=S),g}var xr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,zn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ln=/Z|[+-]\d\d(?::?\d\d)?/,ci=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Hn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Jr=/^\/?Date\((-?\d+)/i,bo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Jn(g){var S,D,H,ee,xe,Ve,yt=g._i,qe=xr.exec(yt)||zn.exec(yt),yt=ci.length,ft=Hn.length;if(qe){for(_(g).iso=!0,S=0,D=yt;S<D;S++)if(ci[S][1].exec(qe[1])){ee=ci[S][0],H=ci[S][2]!==!1;break}if(ee==null)g._isValid=!1;else{if(qe[3]){for(S=0,D=ft;S<D;S++)if(Hn[S][1].exec(qe[3])){xe=(qe[2]||" ")+Hn[S][0];break}if(xe==null)return void(g._isValid=!1)}if(H||xe==null){if(qe[4]){if(!Ln.exec(qe[4]))return void(g._isValid=!1);Ve="Z"}g._f=ee+(xe||"")+(Ve||""),be(g)}else g._isValid=!1}}else g._isValid=!1}function vr(g,S,D,H,ee,xe){return g=[function(Ve){Ve=parseInt(Ve,10);{if(Ve<=49)return 2e3+Ve;if(Ve<=999)return 1900+Ve}return Ve}(g),Z.indexOf(S),parseInt(D,10),parseInt(H,10),parseInt(ee,10)],xe&&g.push(parseInt(xe,10)),g}function gr(g){var S,D,H,ee,xe=bo.exec(g._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));xe?(S=vr(xe[4],xe[3],xe[2],xe[5],xe[6],xe[7]),D=xe[1],H=S,ee=g,D&&pn.indexOf(D)!==new Date(H[0],H[1],H[2]).getDay()?(_(ee).weekdayMismatch=!0,ee._isValid=!1):(g._a=S,g._tzm=(D=xe[8],H=xe[9],ee=xe[10],D?vn[D]:H?0:60*(((D=parseInt(ee,10))-(H=D%100))/100)+H),g._d=_t.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),_(g).rfc2822=!0)):g._isValid=!1}function re(g,S,D){return g??S??D}function ue(g){var S,D,H,ee,xe,Ve,qe,yt,ft,zt,Nt,Ki=[];if(!g._d){for(H=g,ee=new Date(n.now()),D=H._useUTC?[ee.getUTCFullYear(),ee.getUTCMonth(),ee.getUTCDate()]:[ee.getFullYear(),ee.getMonth(),ee.getDate()],g._w&&g._a[ct]==null&&g._a[ot]==null&&((ee=(H=g)._w).GG!=null||ee.W!=null||ee.E!=null?(yt=1,ft=4,xe=re(ee.GG,H._a[at],Gi(dt(),1,4).year),Ve=re(ee.W,1),((qe=re(ee.E,1))<1||7<qe)&&(zt=!0)):(yt=H._locale._week.dow,ft=H._locale._week.doy,Nt=Gi(dt(),yt,ft),xe=re(ee.gg,H._a[at],Nt.year),Ve=re(ee.w,Nt.week),ee.d!=null?((qe=ee.d)<0||6<qe)&&(zt=!0):ee.e!=null?(qe=ee.e+yt,(ee.e<0||6<ee.e)&&(zt=!0)):qe=yt),Ve<1||Ve>Qt(xe,yt,ft)?_(H)._overflowWeeks=!0:zt!=null?_(H)._overflowWeekday=!0:(Nt=Ii(xe,Ve,qe,yt,ft),H._a[at]=Nt.year,H._dayOfYear=Nt.dayOfYear)),g._dayOfYear!=null&&(ee=re(g._a[at],D[at]),(g._dayOfYear>Bt(ee)||g._dayOfYear===0)&&(_(g)._overflowDayOfYear=!0),zt=_t(ee,0,g._dayOfYear),g._a[ot]=zt.getUTCMonth(),g._a[ct]=zt.getUTCDate()),S=0;S<3&&g._a[S]==null;++S)g._a[S]=Ki[S]=D[S];for(;S<7;S++)g._a[S]=Ki[S]=g._a[S]==null?S===2?1:0:g._a[S];g._a[Rt]===24&&g._a[Ht]===0&&g._a[Tt]===0&&g._a[Ut]===0&&(g._nextDay=!0,g._a[Rt]=0),g._d=(g._useUTC?_t:Et).apply(null,Ki),xe=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[Rt]=24),g._w&&g._w.d!==void 0&&g._w.d!==xe&&(_(g).weekdayMismatch=!0)}}function be(g){if(g._f===n.ISO_8601)Jn(g);else if(g._f===n.RFC_2822)gr(g);else{g._a=[],_(g).empty=!0;for(var S,D,H,ee,xe,Ve=""+g._i,qe=Ve.length,yt=0,ft=he(g._f,g._locale).match(Ke)||[],zt=ft.length,Nt=0;Nt<zt;Nt++)D=ft[Nt],(S=(Ve.match(Xt(D,g))||[])[0])&&(0<(H=Ve.substr(0,Ve.indexOf(S))).length&&_(g).unusedInput.push(H),Ve=Ve.slice(Ve.indexOf(S)+S.length),yt+=S.length),ye[D]?(S?_(g).empty=!1:_(g).unusedTokens.push(D),H=D,xe=g,(ee=S)!=null&&s(q,H)&&q[H](ee,xe._a,xe,H)):g._strict&&!S&&_(g).unusedTokens.push(D);_(g).charsLeftOver=qe-yt,0<Ve.length&&_(g).unusedInput.push(Ve),g._a[Rt]<=12&&_(g).bigHour===!0&&0<g._a[Rt]&&(_(g).bigHour=void 0),_(g).parsedDateParts=g._a.slice(0),_(g).meridiem=g._meridiem,g._a[Rt]=function(Ki,ln,Zi){return Zi==null?ln:Ki.meridiemHour!=null?Ki.meridiemHour(ln,Zi):Ki.isPM!=null?((Ki=Ki.isPM(Zi))&&ln<12&&(ln+=12),ln=Ki||ln!==12?ln:0):ln}(g._locale,g._a[Rt],g._meridiem),(qe=_(g).era)!==null&&(g._a[at]=g._locale.erasConvertYear(qe,g._a[at])),ue(g),ar(g)}}function We(g){var S,D,H,ee=g._i,xe=g._f;return g._locale=g._locale||mr(g._l),ee===null||xe===void 0&&ee===""?x({nullInput:!0}):(typeof ee=="string"&&(g._i=ee=g._locale.preparse(ee)),N(ee)?new F(ar(ee)):(c(ee)?g._d=ee:r(xe)?function(Ve){var qe,yt,ft,zt,Nt,Ki,ln=!1,Zi=Ve._f.length;if(Zi===0)return _(Ve).invalidFormat=!0,Ve._d=new Date(NaN);for(zt=0;zt<Zi;zt++)Nt=0,Ki=!1,qe=k({},Ve),Ve._useUTC!=null&&(qe._useUTC=Ve._useUTC),qe._f=Ve._f[zt],be(qe),C(qe)&&(Ki=!0),Nt=(Nt+=_(qe).charsLeftOver)+10*_(qe).unusedTokens.length,_(qe).score=Nt,ln?Nt<ft&&(ft=Nt,yt=qe):(ft==null||Nt<ft||Ki)&&(ft=Nt,yt=qe,Ki&&(ln=!0));m(Ve,yt||qe)}(g):xe?be(g):u(xe=(ee=g)._i)?ee._d=new Date(n.now()):c(xe)?ee._d=new Date(xe.valueOf()):typeof xe=="string"?(D=ee,(S=Jr.exec(D._i))!==null?D._d=new Date(+S[1]):(Jn(D),D._isValid===!1&&(delete D._isValid,gr(D),D._isValid===!1&&(delete D._isValid,D._strict?D._isValid=!1:n.createFromInputFallback(D))))):r(xe)?(ee._a=f(xe.slice(0),function(Ve){return parseInt(Ve,10)}),ue(ee)):o(xe)?(S=ee)._d||(H=(D=de(S._i)).day===void 0?D.date:D.day,S._a=f([D.year,D.month,H,D.hour,D.minute,D.second,D.millisecond],function(Ve){return Ve&&parseInt(Ve,10)}),ue(S)):p(xe)?ee._d=new Date(xe):n.createFromInputFallback(ee),C(g)||(g._d=null),g))}function Je(g,S,D,H,ee){var xe={};return S!==!0&&S!==!1||(H=S,S=void 0),D!==!0&&D!==!1||(H=D,D=void 0),(o(g)&&l(g)||r(g)&&g.length===0)&&(g=void 0),xe._isAMomentObject=!0,xe._useUTC=xe._isUTC=ee,xe._l=D,xe._i=g,xe._f=S,xe._strict=H,(ee=new F(ar(We(ee=xe))))._nextDay&&(ee.add(1,"d"),ee._nextDay=void 0),ee}function dt(g,S,D,H){return Je(g,S,D,H,!1)}n.createFromInputFallback=Q("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(g){g._d=new Date(g._i+(g._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){},X=Q("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=dt.apply(null,arguments);return this.isValid()&&g.isValid()?g<this?this:g:x()}),ne=Q("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=dt.apply(null,arguments);return this.isValid()&&g.isValid()?this<g?this:g:x()});function Ot(g,S){var D,H;if(!(S=S.length===1&&r(S[0])?S[0]:S).length)return dt();for(D=S[0],H=1;H<S.length;++H)S[H].isValid()&&!S[H][g](D)||(D=S[H]);return D}var Vt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hi(S){var S=de(S),D=S.year||0,H=S.quarter||0,ee=S.month||0,xe=S.week||S.isoWeek||0,Ve=S.day||0,qe=S.hour||0,yt=S.minute||0,ft=S.second||0,zt=S.millisecond||0;this._isValid=function(Nt){var Ki,ln,Zi=!1,rs=Vt.length;for(Ki in Nt)if(s(Nt,Ki)&&(ke.call(Vt,Ki)===-1||Nt[Ki]!=null&&isNaN(Nt[Ki])))return!1;for(ln=0;ln<rs;++ln)if(Nt[Vt[ln]]){if(Zi)return!1;parseFloat(Nt[Vt[ln]])!==Ie(Nt[Vt[ln]])&&(Zi=!0)}return!0}(S),this._milliseconds=+zt+1e3*ft+6e4*yt+1e3*qe*60*60,this._days=+Ve+7*xe,this._months=+ee+3*H+12*D,this._data={},this._locale=mr(),this._bubble()}function Si(g){return g instanceof hi}function wi(g){return g<0?-1*Math.round(-1*g):Math.round(g)}function yn(g,S){Re(g,0,0,function(){var D=this.utcOffset(),H="+";return D<0&&(D=-D,H="-"),H+le(~~(D/60),2)+S+le(~~D%60,2)})}yn("Z",":"),yn("ZZ",""),Le("Z",pt),Le("ZZ",pt),W(["Z","ZZ"],function(g,S,D){D._useUTC=!0,D._tzm=Gn(pt,g)});var Un=/([\+\-]|\d\d)/gi;function Gn(g,D){var D=(D||"").match(g);return D===null?null:(D=60*(g=((D[D.length-1]||[])+"").match(Un)||["-",0,0])[1]+Ie(g[2]))===0?0:g[0]==="+"?D:-D}function Wn(g,S){var D;return S._isUTC?(S=S.clone(),D=(N(g)||c(g)?g:dt(g)).valueOf()-S.valueOf(),S._d.setTime(S._d.valueOf()+D),n.updateOffset(S,!1),S):dt(g).local()}function eo(g){return-Math.round(g._d.getTimezoneOffset())}function _r(){return!!this.isValid()&&this._isUTC&&this._offset===0}n.updateOffset=function(){};var Co=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Bi=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ai(g,S){var D,H=g,ee=null;return Si(g)?H={ms:g._milliseconds,d:g._days,M:g._months}:p(g)||!isNaN(+g)?(H={},S?H[S]=+g:H.milliseconds=+g):(ee=Co.exec(g))?(D=ee[1]==="-"?-1:1,H={y:0,d:Ie(ee[ct])*D,h:Ie(ee[Rt])*D,m:Ie(ee[Ht])*D,s:Ie(ee[Tt])*D,ms:Ie(wi(1e3*ee[Ut]))*D}):(ee=Bi.exec(g))?(D=ee[1]==="-"?-1:1,H={y:Hr(ee[2],D),M:Hr(ee[3],D),w:Hr(ee[4],D),d:Hr(ee[5],D),h:Hr(ee[6],D),m:Hr(ee[7],D),s:Hr(ee[8],D)}):H==null?H={}:typeof H=="object"&&("from"in H||"to"in H)&&(S=function(xe,Ve){var qe;return!xe.isValid()||!Ve.isValid()?{milliseconds:0,months:0}:(Ve=Wn(Ve,xe),xe.isBefore(Ve)?qe=Ss(xe,Ve):((qe=Ss(Ve,xe)).milliseconds=-qe.milliseconds,qe.months=-qe.months),qe)}(dt(H.from),dt(H.to)),(H={}).ms=S.milliseconds,H.M=S.months),ee=new hi(H),Si(g)&&s(g,"_locale")&&(ee._locale=g._locale),Si(g)&&s(g,"_isValid")&&(ee._isValid=g._isValid),ee}function Hr(g,S){return g=g&&parseFloat(g.replace(",",".")),(isNaN(g)?0:g)*S}function Ss(g,S){var D={};return D.months=S.month()-g.month()+12*(S.year()-g.year()),g.clone().add(D.months,"M").isAfter(S)&&--D.months,D.milliseconds=+S-+g.clone().add(D.months,"M"),D}function yo(g,S){return function(D,H){var ee;return H===null||isNaN(+H)||(se(S,"moment()."+S+"(period, number) is deprecated. Please use moment()."+S+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),ee=D,D=H,H=ee),Js(this,Ai(D,H),g),this}}function Js(g,Ve,D,H){var ee=Ve._milliseconds,xe=wi(Ve._days),Ve=wi(Ve._months);g.isValid()&&(H=H==null||H,Ve&&vt(g,et(g,"Month")+Ve*D),xe&&R(g,"Date",et(g,"Date")+xe*D),ee&&g._d.setTime(g._d.valueOf()+ee*D),H&&n.updateOffset(g,xe||Ve))}Ai.fn=hi.prototype,Ai.invalid=function(){return Ai(NaN)},U=yo(1,"add"),Nn=yo(-1,"subtract");function ws(g){return typeof g=="string"||g instanceof String}function fa(g){return N(g)||c(g)||ws(g)||p(g)||function(S){var D=r(S),H=!1;return D&&(H=S.filter(function(ee){return!p(ee)&&ws(S)}).length===0),D&&H}(g)||function(S){var D,H,ee=o(S)&&!l(S),xe=!1,Ve=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],qe=Ve.length;for(D=0;D<qe;D+=1)H=Ve[D],xe=xe||s(S,H);return ee&&xe}(g)||g==null}function ts(g,ee){if(g.date()<ee.date())return-ts(ee,g);var D=12*(ee.year()-g.year())+(ee.month()-g.month()),H=g.clone().add(D,"months"),ee=ee-H<0?(ee-H)/(H-g.clone().add(D-1,"months")):(ee-H)/(g.clone().add(1+D,"months")-H);return-(D+ee)||0}function xs(g){return g===void 0?this._locale._abbr:((g=mr(g))!=null&&(this._locale=g),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",Ct=Q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function Di(){return this._locale}var _i=126227808e5;function Eo(g,S){return(g%S+S)%S}function So(g,S,D){return g<100&&0<=g?new Date(g+400,S,D)-_i:new Date(g,S,D).valueOf()}function Ts(g,S,D){return g<100&&0<=g?Date.UTC(g+400,S,D)-_i:Date.UTC(g,S,D)}function Dl(g,S){return S.erasAbbrRegex(g)}function el(){for(var g=[],S=[],D=[],H=[],ee=this.eras(),xe=0,Ve=ee.length;xe<Ve;++xe)S.push(It(ee[xe].name)),g.push(It(ee[xe].abbr)),D.push(It(ee[xe].narrow)),H.push(It(ee[xe].name)),H.push(It(ee[xe].abbr)),H.push(It(ee[xe].narrow));this._erasRegex=new RegExp("^("+H.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+S.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+g.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+D.join("|")+")","i")}function is(g,S){Re(0,[g,g.length],0,S)}function Os(g,S,D,H,ee){var xe;return g==null?Gi(this,H,ee).year:(xe=Qt(g,H,ee),function(Ve,qe,yt,ft,zt){return Ve=Ii(Ve,qe,yt,ft,zt),qe=_t(Ve.year,0,Ve.dayOfYear),this.year(qe.getUTCFullYear()),this.month(qe.getUTCMonth()),this.date(qe.getUTCDate()),this}.call(this,g,S=xe<S?xe:S,D,H,ee))}Re("N",0,0,"eraAbbr"),Re("NN",0,0,"eraAbbr"),Re("NNN",0,0,"eraAbbr"),Re("NNNN",0,0,"eraName"),Re("NNNNN",0,0,"eraNarrow"),Re("y",["y",1],"yo","eraYear"),Re("y",["yy",2],0,"eraYear"),Re("y",["yyy",3],0,"eraYear"),Re("y",["yyyy",4],0,"eraYear"),Le("N",Dl),Le("NN",Dl),Le("NNN",Dl),Le("NNNN",function(g,S){return S.erasNameRegex(g)}),Le("NNNNN",function(g,S){return S.erasNarrowRegex(g)}),W(["N","NN","NNN","NNNN","NNNNN"],function(g,S,D,H){H=D._locale.erasParse(g,H,D._strict),H?_(D).era=H:_(D).invalidEra=g}),Le("y",Ue),Le("yy",Ue),Le("yyy",Ue),Le("yyyy",Ue),Le("yo",function(g,S){return S._eraYearOrdinalRegex||Ue}),W(["y","yy","yyy","yyyy"],at),W(["yo"],function(g,S,D,H){var ee;D._locale._eraYearOrdinalRegex&&(ee=g.match(D._locale._eraYearOrdinalRegex)),D._locale.eraYearOrdinalParse?S[at]=D._locale.eraYearOrdinalParse(g,ee):S[at]=parseInt(g,10)}),Re(0,["gg",2],0,function(){return this.weekYear()%100}),Re(0,["GG",2],0,function(){return this.isoWeekYear()%100}),is("gggg","weekYear"),is("ggggg","weekYear"),is("GGGG","isoWeekYear"),is("GGGGG","isoWeekYear"),ze("weekYear","gg"),ze("isoWeekYear","GG"),ve("weekYear",1),ve("isoWeekYear",1),Le("G",Se),Le("g",Se),Le("GG",$,Mt),Le("gg",$,Mt),Le("GGGG",Yn,qi),Le("gggg",Yn,qi),Le("GGGGG",Tr,on),Le("ggggg",Tr,on),pe(["gggg","ggggg","GGGG","GGGGG"],function(g,S,D,H){S[H.substr(0,2)]=Ie(g)}),pe(["gg","GG"],function(g,S,D,H){S[H]=n.parseTwoDigitYear(g)}),Re("Q",0,"Qo","quarter"),ze("quarter","Q"),ve("quarter",7),Le("Q",te),W("Q",function(g,S){S[ot]=3*(Ie(g)-1)}),Re("D",["DD",2],"Do","date"),ze("date","D"),ve("date",9),Le("D",$),Le("DD",$,Mt),Le("Do",function(g,S){return g?S._dayOfMonthOrdinalParse||S._ordinalParse:S._dayOfMonthOrdinalParseLenient}),W(["D","DD"],ct),W("Do",function(g,S){S[ct]=Ie(g.match($)[0])}),Yn=it("Date",!0),Re("DDD",["DDDD",3],"DDDo","dayOfYear"),ze("dayOfYear","DDD"),ve("dayOfYear",4),Le("DDD",Me),Le("DDDD",ge),W(["DDD","DDDD"],function(g,S,D){D._dayOfYear=Ie(g)}),Re("m",["mm",2],0,"minute"),ze("minute","m"),ve("minute",14),Le("m",$),Le("mm",$,Mt),W(["m","mm"],Ht);var At,qi=it("Minutes",!1),Tr=(Re("s",["ss",2],0,"second"),ze("second","s"),ve("second",15),Le("s",$),Le("ss",$,Mt),W(["s","ss"],Tt),it("Seconds",!1));for(Re("S",0,0,function(){return~~(this.millisecond()/100)}),Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Re(0,["SSS",3],0,"millisecond"),Re(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Re(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Re(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Re(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Re(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Re(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ze("millisecond","ms"),ve("millisecond",16),Le("S",Me,te),Le("SS",Me,Mt),Le("SSS",Me,ge),At="SSSS";At.length<=9;At+="S")Le(At,Ue);function Ho(g,S){S[Ut]=Ie(1e3*("0."+g))}for(At="S";At.length<=9;At+="S")W(At,Ho);on=it("Milliseconds",!1),Re("z",0,0,"zoneAbbr"),Re("zz",0,0,"zoneName"),te=F.prototype;function Rl(g){return g}te.add=U,te.calendar=function(D,ee){arguments.length===1&&(arguments[0]?fa(arguments[0])?(D=arguments[0],ee=void 0):function(xe){for(var Ve=o(xe)&&!l(xe),qe=!1,yt=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ft=0;ft<yt.length;ft+=1)qe=qe||s(xe,yt[ft]);return Ve&&qe}(arguments[0])&&(ee=arguments[0],D=void 0):ee=D=void 0);var D=D||dt(),H=Wn(D,this).startOf("day"),H=n.calendarFormat(this,H)||"sameElse",ee=ee&&(Ce(ee[H])?ee[H].call(this,D):ee[H]);return this.format(ee||this.localeData().calendar(H,this,dt(D)))},te.clone=function(){return new F(this)},te.diff=function(g,S,D){var H,ee,xe;if(!this.isValid())return NaN;if(!(H=Wn(g,this)).isValid())return NaN;switch(ee=6e4*(H.utcOffset()-this.utcOffset()),S=Be(S)){case"year":xe=ts(this,H)/12;break;case"month":xe=ts(this,H);break;case"quarter":xe=ts(this,H)/3;break;case"second":xe=(this-H)/1e3;break;case"minute":xe=(this-H)/6e4;break;case"hour":xe=(this-H)/36e5;break;case"day":xe=(this-H-ee)/864e5;break;case"week":xe=(this-H-ee)/6048e5;break;default:xe=this-H}return D?xe:lt(xe)},te.endOf=function(g){var S,D;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?Ts:So,g){case"year":S=D(this.year()+1,0,1)-1;break;case"quarter":S=D(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":S=D(this.year(),this.month()+1,1)-1;break;case"week":S=D(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":S=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":S=D(this.year(),this.month(),this.date()+1)-1;break;case"hour":S=this._d.valueOf(),S+=36e5-Eo(S+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":S=this._d.valueOf(),S+=6e4-Eo(S,6e4)-1;break;case"second":S=this._d.valueOf(),S+=1e3-Eo(S,1e3)-1;break}return this._d.setTime(S),n.updateOffset(this,!0),this},te.format=function(g){return g=g||(this.isUtc()?n.defaultFormatUtc:n.defaultFormat),g=ae(this,g),this.localeData().postformat(g)},te.from=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||dt(g).isValid())?Ai({to:this,from:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.fromNow=function(g){return this.from(dt(),g)},te.to=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||dt(g).isValid())?Ai({from:this,to:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.toNow=function(g){return this.to(dt(),g)},te.get=function(g){return Ce(this[g=Be(g)])?this[g]():this},te.invalidAt=function(){return _(this).overflow},te.isAfter=function(g,S){return g=N(g)?g:dt(g),!(!this.isValid()||!g.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()>g.valueOf():g.valueOf()<this.clone().startOf(S).valueOf())},te.isBefore=function(g,S){return g=N(g)?g:dt(g),!(!this.isValid()||!g.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()<g.valueOf():this.clone().endOf(S).valueOf()<g.valueOf())},te.isBetween=function(g,S,D,H){return g=N(g)?g:dt(g),S=N(S)?S:dt(S),!!(this.isValid()&&g.isValid()&&S.isValid())&&((H=H||"()")[0]==="("?this.isAfter(g,D):!this.isBefore(g,D))&&(H[1]===")"?this.isBefore(S,D):!this.isAfter(S,D))},te.isSame=function(D,S){var D=N(D)?D:dt(D);return!(!this.isValid()||!D.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()===D.valueOf():(D=D.valueOf(),this.clone().startOf(S).valueOf()<=D&&D<=this.clone().endOf(S).valueOf()))},te.isSameOrAfter=function(g,S){return this.isSame(g,S)||this.isAfter(g,S)},te.isSameOrBefore=function(g,S){return this.isSame(g,S)||this.isBefore(g,S)},te.isValid=function(){return C(this)},te.lang=Ct,te.locale=xs,te.localeData=Di,te.max=ne,te.min=X,te.parsingFlags=function(){return m({},_(this))},te.set=function(g,S){if(typeof g=="object")for(var D=function(xe){var Ve,qe=[];for(Ve in xe)s(xe,Ve)&&qe.push({unit:Ve,priority:Ee[Ve]});return qe.sort(function(yt,ft){return yt.priority-ft.priority}),qe}(g=de(g)),H=D.length,ee=0;ee<H;ee++)this[D[ee].unit](g[D[ee].unit]);else if(Ce(this[g=Be(g)]))return this[g](S);return this},te.startOf=function(g){var S,D;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?Ts:So,g){case"year":S=D(this.year(),0,1);break;case"quarter":S=D(this.year(),this.month()-this.month()%3,1);break;case"month":S=D(this.year(),this.month(),1);break;case"week":S=D(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":S=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":S=D(this.year(),this.month(),this.date());break;case"hour":S=this._d.valueOf(),S-=Eo(S+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":S=this._d.valueOf(),S-=Eo(S,6e4);break;case"second":S=this._d.valueOf(),S-=Eo(S,1e3);break}return this._d.setTime(S),n.updateOffset(this,!0),this},te.subtract=Nn,te.toArray=function(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]},te.toObject=function(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}},te.toDate=function(){return new Date(this.valueOf())},te.toISOString=function(g){if(!this.isValid())return null;var S=(g=g!==!0)?this.clone().utc():this;return S.year()<0||9999<S.year()?ae(S,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ce(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",ae(S,"Z")):ae(S,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},te.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g,S="moment",D="";return this.isLocal()||(S=this.utcOffset()===0?"moment.utc":"moment.parseZone",D="Z"),S="["+S+'("]',g=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(S+g+"-MM-DD[T]HH:mm:ss.SSS"+(D+'[")]'))},typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},te.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},te.eraName=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].name;return""},te.eraNarrow=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].narrow;return""},te.eraAbbr=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].abbr;return""},te.eraYear=function(){for(var g,S,D=this.localeData().eras(),H=0,ee=D.length;H<ee;++H)if(g=D[H].since<=D[H].until?1:-1,S=this.clone().startOf("day").valueOf(),D[H].since<=S&&S<=D[H].until||D[H].until<=S&&S<=D[H].since)return(this.year()-n(D[H].since).year())*g+D[H].offset;return this.year()},te.year=xo,te.isLeapYear=function(){return He(this.year())},te.weekYear=function(g){return Os.call(this,g,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},te.isoWeekYear=function(g){return Os.call(this,g,this.isoWeek(),this.isoWeekday(),1,4)},te.quarter=te.quarters=function(g){return g==null?Math.ceil((this.month()+1)/3):this.month(3*(g-1)+this.month()%3)},te.month=ht,te.daysInMonth=function(){return Li(this.year(),this.month())},te.week=te.weeks=function(g){var S=this.localeData().week(this);return g==null?S:this.add(7*(g-S),"d")},te.isoWeek=te.isoWeeks=function(g){var S=Gi(this,1,4).week;return g==null?S:this.add(7*(g-S),"d")},te.weeksInYear=function(){var g=this.localeData()._week;return Qt(this.year(),g.dow,g.doy)},te.weeksInWeekYear=function(){var g=this.localeData()._week;return Qt(this.weekYear(),g.dow,g.doy)},te.isoWeeksInYear=function(){return Qt(this.year(),1,4)},te.isoWeeksInISOWeekYear=function(){return Qt(this.isoWeekYear(),1,4)},te.date=Yn,te.day=te.days=function(g){if(!this.isValid())return g!=null?this:NaN;var S,D,H=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(S=g,D=this.localeData(),g=typeof S!="string"?S:isNaN(S)?typeof(S=D.weekdaysParse(S))=="number"?S:null:parseInt(S,10),this.add(g-H,"d")):H},te.weekday=function(g){if(!this.isValid())return g!=null?this:NaN;var S=(this.day()+7-this.localeData()._week.dow)%7;return g==null?S:this.add(g-S,"d")},te.isoWeekday=function(g){return this.isValid()?g!=null?(S=g,D=this.localeData(),D=typeof S=="string"?D.weekdaysParse(S)%7||7:isNaN(S)?null:S,this.day(this.day()%7?D:D-7)):this.day()||7:g!=null?this:NaN;var S,D},te.dayOfYear=function(g){var S=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?S:this.add(g-S,"d")},te.hour=te.hours=Ge,te.minute=te.minutes=qi,te.second=te.seconds=Tr,te.millisecond=te.milliseconds=on,te.utcOffset=function(g,S,D){var H,ee=this._offset||0;if(!this.isValid())return g!=null?this:NaN;if(g==null)return this._isUTC?ee:eo(this);if(typeof g=="string"){if((g=Gn(pt,g))===null)return this}else Math.abs(g)<16&&!D&&(g*=60);return!this._isUTC&&S&&(H=eo(this)),this._offset=g,this._isUTC=!0,H!=null&&this.add(H,"m"),ee!==g&&(!S||this._changeInProgress?Js(this,Ai(g-ee,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this},te.utc=function(g){return this.utcOffset(0,g)},te.local=function(g){return this._isUTC&&(this.utcOffset(0,g),this._isUTC=!1,g&&this.subtract(eo(this),"m")),this},te.parseZone=function(){var g;return this._tzm!=null?this.utcOffset(this._tzm,!1,!0):typeof this._i=="string"&&((g=Gn(Ye,this._i))!=null?this.utcOffset(g):this.utcOffset(0,!0)),this},te.hasAlignedHourOffset=function(g){return!!this.isValid()&&(g=g?dt(g).utcOffset():0,(this.utcOffset()-g)%60==0)},te.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},te.isLocal=function(){return!!this.isValid()&&!this._isUTC},te.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},te.isUtc=_r,te.isUTC=_r,te.zoneAbbr=function(){return this._isUTC?"UTC":""},te.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},te.dates=Q("dates accessor is deprecated. Use date instead.",Yn),te.months=Q("months accessor is deprecated. Use month instead",ht),te.years=Q("years accessor is deprecated. Use year instead",xo),te.zone=Q("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(g,S){return g!=null?(this.utcOffset(g=typeof g!="string"?-g:g,S),this):-this.utcOffset()}),te.isDSTShifted=Q("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var g,S={};return k(S,this),(S=We(S))._a?(g=(S._isUTC?v:dt)(S._a),this._isDSTShifted=this.isValid()&&0<function(D,H,ee){for(var xe=Math.min(D.length,H.length),Ve=Math.abs(D.length-H.length),qe=0,yt=0;yt<xe;yt++)(ee&&D[yt]!==H[yt]||!ee&&Ie(D[yt])!==Ie(H[yt]))&&qe++;return qe+Ve}(S._a,g.toArray())):this._isDSTShifted=!1,this._isDSTShifted}),Mt=z.prototype;function to(g,S,D,xe){var ee=mr(),xe=v().set(xe,S);return ee[D](xe,g)}function $n(g,S,D){if(p(g)&&(S=g,g=void 0),g=g||"",S!=null)return to(g,S,D,"month");for(var H=[],ee=0;ee<12;ee++)H[ee]=to(g,ee,D,"month");return H}function tl(g,S,D,H){S=(typeof g=="boolean"?p(S)&&(D=S,S=void 0):(S=g,g=!1,p(D=S)&&(D=S,S=void 0)),S||"");var ee,xe=mr(),Ve=g?xe._week.dow:0,qe=[];if(D!=null)return to(S,(D+Ve)%7,H,"day");for(ee=0;ee<7;ee++)qe[ee]=to(S,(ee+Ve)%7,H,"day");return qe}Mt.calendar=function(g,S,D){return Ce(g=this._calendar[g]||this._calendar.sameElse)?g.call(S,D):g},Mt.longDateFormat=function(g){var S=this._longDateFormat[g],D=this._longDateFormat[g.toUpperCase()];return S||!D?S:(this._longDateFormat[g]=D.match(Ke).map(function(H){return H==="MMMM"||H==="MM"||H==="DD"||H==="dddd"?H.slice(1):H}).join(""),this._longDateFormat[g])},Mt.invalidDate=function(){return this._invalidDate},Mt.ordinal=function(g){return this._ordinal.replace("%d",g)},Mt.preparse=Rl,Mt.postformat=Rl,Mt.relativeTime=function(g,S,D,H){var ee=this._relativeTime[D];return Ce(ee)?ee(g,S,D,H):ee.replace(/%d/i,g)},Mt.pastFuture=function(g,S){return Ce(g=this._relativeTime[0<g?"future":"past"])?g(S):g.replace(/%s/i,S)},Mt.set=function(g){var S,D;for(D in g)s(g,D)&&(Ce(S=g[D])?this[D]=S:this["_"+D]=S);this._config=g,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Mt.eras=function(g,S){for(var D,H=this._eras||mr("en")._eras,ee=0,xe=H.length;ee<xe;++ee){switch(typeof H[ee].since){case"string":D=n(H[ee].since).startOf("day"),H[ee].since=D.valueOf();break}switch(typeof H[ee].until){case"undefined":H[ee].until=1/0;break;case"string":D=n(H[ee].until).startOf("day").valueOf(),H[ee].until=D.valueOf();break}}return H},Mt.erasParse=function(g,S,D){var H,ee,xe,Ve,qe,yt=this.eras();for(g=g.toUpperCase(),H=0,ee=yt.length;H<ee;++H)if(xe=yt[H].name.toUpperCase(),Ve=yt[H].abbr.toUpperCase(),qe=yt[H].narrow.toUpperCase(),D)switch(S){case"N":case"NN":case"NNN":if(Ve===g)return yt[H];break;case"NNNN":if(xe===g)return yt[H];break;case"NNNNN":if(qe===g)return yt[H];break}else if(0<=[xe,Ve,qe].indexOf(g))return yt[H]},Mt.erasConvertYear=function(g,S){var D=g.since<=g.until?1:-1;return S===void 0?n(g.since).year():n(g.since).year()+(S-g.offset)*D},Mt.erasAbbrRegex=function(g){return s(this,"_erasAbbrRegex")||el.call(this),g?this._erasAbbrRegex:this._erasRegex},Mt.erasNameRegex=function(g){return s(this,"_erasNameRegex")||el.call(this),g?this._erasNameRegex:this._erasRegex},Mt.erasNarrowRegex=function(g){return s(this,"_erasNarrowRegex")||el.call(this),g?this._erasNarrowRegex:this._erasRegex},Mt.months=function(g,S){return g?(r(this._months)?this._months:this._months[(this._months.isFormat||ce).test(S)?"format":"standalone"])[g.month()]:r(this._months)?this._months:this._months.standalone},Mt.monthsShort=function(g,S){return g?(r(this._monthsShort)?this._monthsShort:this._monthsShort[ce.test(S)?"format":"standalone"])[g.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Mt.monthsParse=function(g,S,D){var H,ee;if(this._monthsParseExact)return function(Nt,Ve,qe){var yt,ft,zt,Nt=Nt.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],yt=0;yt<12;++yt)zt=v([2e3,yt]),this._shortMonthsParse[yt]=this.monthsShort(zt,"").toLocaleLowerCase(),this._longMonthsParse[yt]=this.months(zt,"").toLocaleLowerCase();return qe?Ve==="MMM"?(ft=ke.call(this._shortMonthsParse,Nt))!==-1?ft:null:(ft=ke.call(this._longMonthsParse,Nt))!==-1?ft:null:Ve==="MMM"?(ft=ke.call(this._shortMonthsParse,Nt))!==-1||(ft=ke.call(this._longMonthsParse,Nt))!==-1?ft:null:(ft=ke.call(this._longMonthsParse,Nt))!==-1||(ft=ke.call(this._shortMonthsParse,Nt))!==-1?ft:null}.call(this,g,S,D);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),H=0;H<12;H++)if(ee=v([2e3,H]),D&&!this._longMonthsParse[H]&&(this._longMonthsParse[H]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[H]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),D||this._monthsParse[H]||(ee="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[H]=new RegExp(ee.replace(".",""),"i")),D&&S==="MMMM"&&this._longMonthsParse[H].test(g)||D&&S==="MMM"&&this._shortMonthsParse[H].test(g)||!D&&this._monthsParse[H].test(g))return H},Mt.monthsRegex=function(g){return this._monthsParseExact?(s(this,"_monthsRegex")||wt.call(this),g?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=st),this._monthsStrictRegex&&g?this._monthsStrictRegex:this._monthsRegex)},Mt.monthsShortRegex=function(g){return this._monthsParseExact?(s(this,"_monthsRegex")||wt.call(this),g?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=we),this._monthsShortStrictRegex&&g?this._monthsShortStrictRegex:this._monthsShortRegex)},Mt.week=function(g){return Gi(g,this._week.dow,this._week.doy).week},Mt.firstDayOfYear=function(){return this._week.doy},Mt.firstDayOfWeek=function(){return this._week.dow},Mt.weekdays=function(g,S){return S=r(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(S)?"format":"standalone"],g===!0?Hi(S,this._week.dow):g?S[g.day()]:S},Mt.weekdaysMin=function(g){return g===!0?Hi(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin},Mt.weekdaysShort=function(g){return g===!0?Hi(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort},Mt.weekdaysParse=function(g,S,D){var H,ee;if(this._weekdaysParseExact)return function(Nt,Ve,qe){var yt,ft,zt,Nt=Nt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],yt=0;yt<7;++yt)zt=v([2e3,1]).day(yt),this._minWeekdaysParse[yt]=this.weekdaysMin(zt,"").toLocaleLowerCase(),this._shortWeekdaysParse[yt]=this.weekdaysShort(zt,"").toLocaleLowerCase(),this._weekdaysParse[yt]=this.weekdays(zt,"").toLocaleLowerCase();return qe?Ve==="dddd"?(ft=ke.call(this._weekdaysParse,Nt))!==-1?ft:null:Ve==="ddd"?(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1?ft:null:(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:Ve==="dddd"?(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:Ve==="ddd"?(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:(ft=ke.call(this._minWeekdaysParse,Nt))!==-1||(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1?ft:null}.call(this,g,S,D);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),H=0;H<7;H++)if(ee=v([2e3,1]).day(H),D&&!this._fullWeekdaysParse[H]&&(this._fullWeekdaysParse[H]=new RegExp("^"+this.weekdays(ee,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[H]=new RegExp("^"+this.weekdaysShort(ee,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[H]=new RegExp("^"+this.weekdaysMin(ee,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[H]||(ee="^"+this.weekdays(ee,"")+"|^"+this.weekdaysShort(ee,"")+"|^"+this.weekdaysMin(ee,""),this._weekdaysParse[H]=new RegExp(ee.replace(".",""),"i")),D&&S==="dddd"&&this._fullWeekdaysParse[H].test(g)||D&&S==="ddd"&&this._shortWeekdaysParse[H].test(g)||D&&S==="dd"&&this._minWeekdaysParse[H].test(g)||!D&&this._weekdaysParse[H].test(g))return H},Mt.weekdaysRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=_e),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)},Mt.weekdaysShortRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=je),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Mt.weekdaysMinRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mt),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Mt.isPM=function(g){return(g+"").toLowerCase().charAt(0)==="p"},Mt.meridiem=function(g,S,D){return 11<g?D?"pm":"PM":D?"am":"AM"},Qn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var S=g%10;return g+(Ie(g%100/10)===1?"th":S==1?"st":S==2?"nd":S==3?"rd":"th")}}),n.lang=Q("moment.lang is deprecated. Use moment.locale instead.",Qn),n.langData=Q("moment.langData is deprecated. Use moment.localeData instead.",mr);var Or=Math.abs;function Fl(g,S,D,H){return S=Ai(S,D),g._milliseconds+=H*S._milliseconds,g._days+=H*S._days,g._months+=H*S._months,g._bubble()}function il(g){return g<0?Math.floor(g):Math.ceil(g)}function Pl(g){return 4800*g/146097}function As(g){return 146097*g/4800}function rn(g){return function(){return this.as(g)}}Me=rn("ms"),ge=rn("s"),U=rn("m"),ne=rn("h"),X=rn("d"),Nn=rn("w"),Ge=rn("M"),qi=rn("Q"),Tr=rn("y");function wo(g){return function(){return this.isValid()?this._data[g]:NaN}}var on=wo("milliseconds"),Yn=wo("seconds"),xo=wo("minutes"),Mt=wo("hours"),nl=wo("days"),rl=wo("months"),Wi=wo("years"),Bn=Math.round,To={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function cd(g,S,D,H){var ft=Ai(g).abs(),zt=Bn(ft.as("s")),ee=Bn(ft.as("m")),xe=Bn(ft.as("h")),Ve=Bn(ft.as("d")),qe=Bn(ft.as("M")),yt=Bn(ft.as("w")),ft=Bn(ft.as("y")),zt=(zt<=D.ss?["s",zt]:zt<D.s&&["ss",zt])||ee<=1&&["m"]||ee<D.m&&["mm",ee]||xe<=1&&["h"]||xe<D.h&&["hh",xe]||Ve<=1&&["d"]||Ve<D.d&&["dd",Ve];return(zt=(zt=D.w!=null?zt||yt<=1&&["w"]||yt<D.w&&["ww",yt]:zt)||qe<=1&&["M"]||qe<D.M&&["MM",qe]||ft<=1&&["y"]||["yy",ft])[2]=S,zt[3]=0<+g,zt[4]=H,function(Nt,Ki,ln,Zi,rs){return rs.relativeTime(Ki||1,!!ln,Nt,Zi)}.apply(null,zt)}var ks=Math.abs;function ns(g){return(0<g)-(g<0)||+g}function ol(){if(!this.isValid())return this.localeData().invalidDate();var g,S,D,H,ee,xe,Ve,qe=ks(this._milliseconds)/1e3,yt=ks(this._days),ft=ks(this._months),zt=this.asSeconds();return zt?(g=lt(qe/60),S=lt(g/60),qe%=60,g%=60,D=lt(ft/12),ft%=12,H=qe?qe.toFixed(3).replace(/\.?0+$/,""):"",ee=ns(this._months)!==ns(zt)?"-":"",xe=ns(this._days)!==ns(zt)?"-":"",Ve=ns(this._milliseconds)!==ns(zt)?"-":"",(zt<0?"-":"")+"P"+(D?ee+D+"Y":"")+(ft?ee+ft+"M":"")+(yt?xe+yt+"D":"")+(S||g||qe?"T":"")+(S?Ve+S+"H":"")+(g?Ve+g+"M":"")+(qe?Ve+H+"S":"")):"P0D"}var mi=hi.prototype;return mi.isValid=function(){return this._isValid},mi.abs=function(){var g=this._data;return this._milliseconds=Or(this._milliseconds),this._days=Or(this._days),this._months=Or(this._months),g.milliseconds=Or(g.milliseconds),g.seconds=Or(g.seconds),g.minutes=Or(g.minutes),g.hours=Or(g.hours),g.months=Or(g.months),g.years=Or(g.years),this},mi.add=function(g,S){return Fl(this,g,S,1)},mi.subtract=function(g,S){return Fl(this,g,S,-1)},mi.as=function(g){if(!this.isValid())return NaN;var S,D,H=this._milliseconds;if((g=Be(g))==="month"||g==="quarter"||g==="year")switch(S=this._days+H/864e5,D=this._months+Pl(S),g){case"month":return D;case"quarter":return D/3;case"year":return D/12}else switch(S=this._days+Math.round(As(this._months)),g){case"week":return S/7+H/6048e5;case"day":return S+H/864e5;case"hour":return 24*S+H/36e5;case"minute":return 1440*S+H/6e4;case"second":return 86400*S+H/1e3;case"millisecond":return Math.floor(864e5*S)+H;default:throw new Error("Unknown unit "+g)}},mi.asMilliseconds=Me,mi.asSeconds=ge,mi.asMinutes=U,mi.asHours=ne,mi.asDays=X,mi.asWeeks=Nn,mi.asMonths=Ge,mi.asQuarters=qi,mi.asYears=Tr,mi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Ie(this._months/12):NaN},mi._bubble=function(){var g=this._milliseconds,S=this._days,D=this._months,H=this._data;return 0<=g&&0<=S&&0<=D||g<=0&&S<=0&&D<=0||(g+=864e5*il(As(D)+S),D=S=0),H.milliseconds=g%1e3,g=lt(g/1e3),H.seconds=g%60,g=lt(g/60),H.minutes=g%60,g=lt(g/60),H.hours=g%24,S+=lt(g/24),D+=g=lt(Pl(S)),S-=il(As(g)),g=lt(D/12),D%=12,H.days=S,H.months=D,H.years=g,this},mi.clone=function(){return Ai(this)},mi.get=function(g){return g=Be(g),this.isValid()?this[g+"s"]():NaN},mi.milliseconds=on,mi.seconds=Yn,mi.minutes=xo,mi.hours=Mt,mi.days=nl,mi.weeks=function(){return lt(this.days()/7)},mi.months=rl,mi.years=Wi,mi.humanize=function(g,S){if(!this.isValid())return this.localeData().invalidDate();var D=!1,H=To;return typeof g=="object"&&(S=g,g=!1),typeof g=="boolean"&&(D=g),typeof S=="object"&&(H=Object.assign({},To,S),S.s!=null&&S.ss==null&&(H.ss=S.s-1)),g=this.localeData(),S=cd(this,!D,H,g),D&&(S=g.pastFuture(+this,S)),g.postformat(S)},mi.toISOString=ol,mi.toString=ol,mi.toJSON=ol,mi.locale=xs,mi.localeData=Di,mi.toIsoString=Q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ol),mi.lang=Ct,Re("X",0,0,"unix"),Re("x",0,0,"valueOf"),Le("x",Se),Le("X",/[+-]?\d+(\.\d{1,3})?/),W("X",function(g,S,D){D._d=new Date(1e3*parseFloat(g))}),W("x",function(g,S,D){D._d=new Date(Ie(g))}),n.version="2.29.4",e=dt,n.fn=te,n.min=function(){return Ot("isBefore",[].slice.call(arguments,0))},n.max=function(){return Ot("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=v,n.unix=function(g){return dt(1e3*g)},n.months=function(g,S){return $n(g,S,"months")},n.isDate=c,n.locale=Qn,n.invalid=x,n.duration=Ai,n.isMoment=N,n.weekdays=function(g,S,D){return tl(g,S,D,"weekdays")},n.parseZone=function(){return dt.apply(null,arguments).parseZone()},n.localeData=mr,n.isDuration=Si,n.monthsShort=function(g,S){return $n(g,S,"monthsShort")},n.weekdaysMin=function(g,S,D){return tl(g,S,D,"weekdaysMin")},n.defineLocale=_o,n.updateLocale=function(g,S){var D,H;return S!=null?(H=lr,Ei[g]!=null&&Ei[g].parentLocale!=null?Ei[g].set(J(Ei[g]._config,S)):(S=J(H=(D=Zn(g))!=null?D._config:H,S),D==null&&(S.abbr=g),(H=new z(S)).parentLocale=Ei[g],Ei[g]=H),Qn(g)):Ei[g]!=null&&(Ei[g].parentLocale!=null?(Ei[g]=Ei[g].parentLocale,g===Qn()&&Qn(g)):Ei[g]!=null&&delete Ei[g]),Ei[g]},n.locales=function(){return P(Ei)},n.weekdaysShort=function(g,S,D){return tl(g,S,D,"weekdaysShort")},n.normalizeUnits=Be,n.relativeTimeRounding=function(g){return g===void 0?Bn:typeof g=="function"&&(Bn=g,!0)},n.relativeTimeThreshold=function(g,S){return To[g]!==void 0&&(S===void 0?To[g]:(To[g]=S,g==="s"&&(To.ss=S-1),!0))},n.calendarFormat=function(g,S){return(g=g.diff(S,"days",!0))<-6?"sameElse":g<-1?"lastWeek":g<0?"lastDay":g<1?"sameDay":g<2?"nextDay":g<7?"nextWeek":"sameElse"},n.prototype=te,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})})(yp);var Ep=yp.exports;const Ys=Zc(Ep),ms=Cl({__proto__:null,default:Ys},[Ep]);class Xe{}Xe.locales={TEXT_ALL_SELECTED:"All Selected",TEXT_ALL_X_RECORDS_SELECTED:"All {{x}} records selected",TEXT_APPLY_MASS_UPDATE:"Apply Mass Update",TEXT_APPLY_TO_SELECTION:"Update Selection",TEXT_CANCEL:"Cancel",TEXT_CLEAR_ALL_FILTERS:"Clear all Filters",TEXT_CLEAR_ALL_GROUPING:"Clear all Grouping",TEXT_CLEAR_ALL_SORTING:"Clear all Sorting",TEXT_CLEAR_PINNING:"Unfreeze Columns/Rows",TEXT_CLONE:"Clone",TEXT_COLLAPSE_ALL_GROUPS:"Collapse all Groups",TEXT_CONTAINS:"Contains",TEXT_COLUMNS:"Columns",TEXT_COLUMN_RESIZE_BY_CONTENT:"Resize by Content",TEXT_COMMANDS:"Commands",TEXT_COPY:"Copy",TEXT_DROP_COLUMN_HEADER_TO_GROUP_BY:"Drop a column header here to group by the column",TEXT_EQUALS:"Equals",TEXT_EQUAL_TO:"Equal to",TEXT_ENDS_WITH:"Ends With",TEXT_ERROR_EDITABLE_GRID_REQUIRED:"Your grid must be editable in order to use the Composite Editor Modal.",TEXT_ERROR_ENABLE_CELL_NAVIGATION_REQUIRED:'Composite Editor requires the flag "enableCellNavigation" to be set to True in your Grid Options.',TEXT_ERROR_NO_CHANGES_DETECTED:"Sorry we could not detect any changes.",TEXT_ERROR_NO_EDITOR_FOUND:"We could not find any Editor in your Column Definition.",TEXT_ERROR_NO_RECORD_FOUND:"No records selected for edit or clone operation.",TEXT_ERROR_ROW_NOT_EDITABLE:"Current row is not editable.",TEXT_ERROR_ROW_SELECTION_REQUIRED:"You must select some rows before trying to apply new value(s).",TEXT_EXPAND_ALL_GROUPS:"Expand all Groups",TEXT_EXPORT_TO_CSV:"Export in CSV format",TEXT_EXPORT_TO_TEXT_FORMAT:"Export in Text format (Tab delimited)",TEXT_EXPORT_TO_EXCEL:"Export to Excel",TEXT_EXPORT_TO_TAB_DELIMITED:"Export in Text format (Tab delimited)",TEXT_FORCE_FIT_COLUMNS:"Force fit columns",TEXT_FREEZE_COLUMNS:"Freeze Columns",TEXT_GREATER_THAN:"Greater than",TEXT_GREATER_THAN_OR_EQUAL_TO:"Greater than or equal to",TEXT_GROUP_BY:"Group By",TEXT_HIDE_COLUMN:"Hide Column",TEXT_ITEMS:"items",TEXT_ITEMS_PER_PAGE:"items per page",TEXT_ITEMS_SELECTED:"items selected",TEXT_OF:"of",TEXT_OK:"OK",TEXT_LAST_UPDATE:"Last Update",TEXT_LESS_THAN:"Less than",TEXT_LESS_THAN_OR_EQUAL_TO:"Less than or equal to",TEXT_NOT_CONTAINS:"Not contains",TEXT_NOT_EQUAL_TO:"Not equal to",TEXT_PAGE:"Page",TEXT_RECORDS_SELECTED:"records selected",TEXT_REFRESH_DATASET:"Refresh Dataset",TEXT_REMOVE_FILTER:"Remove Filter",TEXT_REMOVE_SORT:"Remove Sort",TEXT_RESET_INPUT_VALUE:"Reset Input Value",TEXT_RESET_FORM:"Reset Form",TEXT_SAVE:"Save",TEXT_SELECT_ALL:"Select All",TEXT_SYNCHRONOUS_RESIZE:"Synchronous resize",TEXT_SORT_ASCENDING:"Sort Ascending",TEXT_SORT_DESCENDING:"Sort Descending",TEXT_STARTS_WITH:"Starts With",TEXT_TOGGLE_ALL_GROUPS:"Toggle all Groups",TEXT_TOGGLE_FILTER_ROW:"Toggle Filter Row",TEXT_TOGGLE_PRE_HEADER_ROW:"Toggle Pre-Header Row",TEXT_UNFREEZE_COLUMNS:"Unfreeze Columns",TEXT_X_OF_Y_SELECTED:"# of % selected",TEXT_X_OF_Y_MASS_SELECTED:"{{x}} of {{y}} selected"},Xe.treeDataProperties={CHILDREN_PROP:"children",COLLAPSED_PROP:"__collapsed",HAS_CHILDREN_PROP:"__hasChildren",TREE_LEVEL_PROP:"__treeLevel",PARENT_PROP:"__parentId"},Xe.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL=2,Xe.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL=2,Xe.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL=2,Xe.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL=4,Xe.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL=void 0,Xe.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL=void 0,Xe.DEFAULT_NUMBER_DECIMAL_SEPARATOR=".",Xe.DEFAULT_NUMBER_THOUSAND_SEPARATOR="",Xe.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET=!1,Xe.SLIDER_DEFAULT_MIN_VALUE=0,Xe.SLIDER_DEFAULT_MAX_VALUE=100,Xe.SLIDER_DEFAULT_STEP=1,Xe.VALIDATION_REQUIRED_FIELD="Field is required",Xe.VALIDATION_EDITOR_VALID_NUMBER="Please enter a valid number",Xe.VALIDATION_EDITOR_VALID_INTEGER="Please enter a valid integer number",Xe.VALIDATION_EDITOR_INTEGER_BETWEEN="Please enter a valid integer number between {{minValue}} and {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MAX="Please enter a valid integer number that is lower than {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE="Please enter a valid integer number that is lower than or equal to {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MIN="Please enter a valid integer number that is greater than {{minValue}}",Xe.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE="Please enter a valid integer number that is greater than or equal to {{minValue}}",Xe.VALIDATION_EDITOR_NUMBER_BETWEEN="Please enter a valid number between {{minValue}} and {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MAX="Please enter a valid number that is lower than {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE="Please enter a valid number that is lower than or equal to {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MIN="Please enter a valid number that is greater than {{minValue}}",Xe.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE="Please enter a valid number that is greater than or equal to {{minValue}}",Xe.VALIDATION_EDITOR_DECIMAL_BETWEEN="Please enter a valid number with a maximum of {{maxDecimal}} decimals",Xe.VALIDATION_EDITOR_TEXT_LENGTH_BETWEEN="Please make sure your text length is between {{minLength}} and {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH="Please make sure your text is less than {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE="Please make sure your text is less than or equal to {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH="Please make sure your text is more than {{minLength}} character(s)",Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE="Please make sure your text is at least {{minLength}} character(s)";var Qc;(function(a){a[a.camelCase=0]="camelCase",a[a.pascalCase=1]="pascalCase",a[a.snakeCase=2]="snakeCase",a[a.kebabCase=3]="kebabCase"})(Qc||(Qc={}));var vs;(function(a){a.colon=":",a.comma=",",a.equalSign="=",a.pipe="|",a.semicolon=";",a.space=" ",a.tab=" ",a.doubleColon="::",a.doublePipe="||",a.doubleSemicolon=";;"})(vs||(vs={}));var ni;(function(a){a.autoTooltip="autoTooltip",a.cellExternalCopyManager="cellExternalCopyManager",a.cellMenu="cellMenu",a.checkboxSelector="checkboxSelector",a.columnPicker="columnPicker",a.contextMenu="contextMenu",a.customTooltip="customTooltip",a.draggableGrouping="draggableGrouping",a.groupItemMetaProvider="groupItemMetaProvider",a.gridMenu="gridMenu",a.headerButton="headerButton",a.headerMenu="headerMenu",a.rowDetailView="rowDetailView",a.rowMoveManager="rowMoveManager",a.rowSelection="rowSelection"})(ni||(ni={}));const ie={unknown:"unknown",string:"string",boolean:"boolean",integer:"integer",float:"float",number:"number",date:"date",dateIso:"dateIso",dateUtc:"dateUtc",dateTime:"dateTime",dateTimeIso:"dateTimeIso",dateTimeIsoAmPm:"dateTimeIsoAmPm",dateTimeIsoAM_PM:"dateTimeIsoAM_PM",dateTimeShortIso:"dateTimeShortIso",dateEuro:"dateEuro",dateEuroShort:"dateEuroShort",dateTimeShortEuro:"dateTimeShortEuro",dateTimeEuro:"dateTimeEuro",dateTimeEuroAmPm:"dateTimeEuroAmPm",dateTimeEuroAM_PM:"dateTimeEuroAM_PM",dateTimeEuroShort:"dateTimeEuroShort",dateTimeEuroShortAmPm:"dateTimeEuroShortAmPm",dateTimeEuroShortAM_PM:"dateTimeEuroShortAM_PM",dateUs:"dateUs",dateUsShort:"dateUsShort",dateTimeShortUs:"dateTimeShortUs",dateTimeUs:"dateTimeUs",dateTimeUsAmPm:"dateTimeUsAmPm",dateTimeUsAM_PM:"dateTimeUsAM_PM",dateTimeUsShort:"dateTimeUsShort",dateTimeUsShortAmPm:"dateTimeUsShortAmPm",dateTimeUsShortAM_PM:"dateTimeUsShortAM_PM",object:"object",password:"password",text:"text",readonly:"readonly"};var dn;(function(a){a.csv="csv",a.txt="txt",a.xls="xls",a.xlsx="xlsx"})(dn||(dn={}));var Zl;(function(a){a.merge="merge",a.chain="chain"})(Zl||(Zl={}));var Vd;(function(a){a.none="NOA",a.legacyOff="LOF",a.legacyForceFit="LFF",a.ignoreViewport="IGV",a.fitColsToViewport="FCV",a.fitViewportToCols="FVC"})(Vd||(Vd={}));var ur;(function(a){a.columns="columns",a.filter="filter",a.pagination="pagination",a.pinning="pinning",a.rowSelection="rowSelection",a.sorter="sorter",a.treeData="treeData"})(ur||(ur={}));var li;(function(a){a[a.C=67]="C",a[a.V=86]="V",a[a.BACKSPACE=8]="BACKSPACE",a[a.DELETE=46]="DELETE",a[a.DOWN=40]="DOWN",a[a.END=35]="END",a[a.ENTER=13]="ENTER",a[a.ESCAPE=27]="ESCAPE",a[a.HOME=36]="HOME",a[a.INSERT=45]="INSERT",a[a.LEFT=37]="LEFT",a[a.PAGE_DOWN=34]="PAGE_DOWN",a[a.PAGE_UP=33]="PAGE_UP",a[a.RIGHT=39]="RIGHT",a[a.TAB=9]="TAB",a[a.UP=38]="UP",a[a.SPACE=32]="SPACE"})(li||(li={}));var Lt;(function(a){a.empty="",a.contains="Contains",a.notContains="Not_Contains",a.lessThan="LT",a.lessThanOrEqual="LE",a.greaterThan="GT",a.greaterThanOrEqual="GE",a.notEqual="NE",a.equal="EQ",a.endsWith="EndsWith",a.rangeInclusive="RangeInclusive",a.rangeExclusive="RangeExclusive",a.startsWith="StartsWith",a.in="IN",a.notIn="NOT_IN",a.inContains="IN_CONTAINS",a.notInContains="NOT_IN_CONTAINS",a.inCollection="IN_COLLECTION",a.notInCollection="NOT_IN_COLLECTION"})(Lt||(Lt={}));var Io;(function(a){a.asc="asc",a.ASC="ASC",a.desc="desc",a.DESC="DESC"})(Io||(Io={}));var Yi;(function(a){a[a.asc=1]="asc",a[a.desc=-1]="desc",a[a.neutral=0]="neutral"})(Yi||(Yi={}));var gs;(function(a){a.toggleCollapse="toggle-collapse",a.fullExpand="full-expand",a.fullCollapse="full-collapse",a.toggleExpand="toggle-expand"})(gs||(gs={}));const Jc=Object.freeze(Object.defineProperty({__proto__:null,get CaseType(){return Qc},get DelimiterType(){return vs},get EmitterType(){return Ji},get ExtensionName(){return ni},FieldType:ie,get FileType(){return dn},get FilterMultiplePassType(){return Zl},get GridAutosizeColsMode(){return Vd},get GridStateType(){return ur},get KeyCode(){return li},get OperatorType(){return Lt},get SortDirection(){return Io},get SortDirectionNumber(){return Yi},get ToggleStateChangeType(){return gs}},Symbol.toStringTag,{value:"Module"})),jg=Ys||ms;class Ha extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Ha.prototype)}}function Sp(a){let t=!1;return a instanceof Promise?{promise:a.then(e=>{if(t)throw new Ha("Cancelled Promise");return e}),cancel:()=>t=!0}:a}function wp(a,t,e=""){let n=t;if(t instanceof Promise)return t;if(a.isObservable(t)&&(n=a.firstValueFrom(t)),!(n instanceof Promise))throw new Error(`Something went wrong, Slickgrid-Universal ${e} is not able to convert the Observable into a Promise.`);return n}function zd(a,t,e=0){var n;const r=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP;if(Array.isArray(a))for(const o of a)o&&(Array.isArray(o[r])&&o[r].length>0&&(e++,zd(o[r],t,e),e--),o[t.levelPropName]=e)}function xp(a,t){var e,n,r,o,s;const l=(e=t==null?void 0:t.identifierPropName)!==null&&e!==void 0?e:"id",u=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.hasChildrenPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.HAS_CHILDREN_PROP,c=(o=t==null?void 0:t.parentPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.PARENT_PROP,f=(s=t==null?void 0:t.levelPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.TREE_LEVEL_PROP;return t!=null&&t.shouldAddTreeLevelNumber&&zd(a,{childrenPropName:u,levelPropName:f}),Yg(a,v=>v[u],(v,_)=>({[l]:v[l],[c]:_!==void 0?_[l]:null,[p]:!!v[u],...Op(v,u)}))}function Tp(a,t){var e,n,r,o,s;const l=(e=t==null?void 0:t.identifierPropName)!==null&&e!==void 0?e:"id",u=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.parentPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.PARENT_PROP,c=(o=t==null?void 0:t.levelPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.TREE_LEVEL_PROP,f=(s=t==null?void 0:t.collapsedPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.COLLAPSED_PROP,m=a||[],v=[],_={};return m.forEach(C=>_[C[l]]=C),Object.keys(_).forEach(C=>{var x;const w=_[C];if(!(p in w)||w[p]===null||w[p]===void 0||w[p]==="")v.push(w);else if(w[p]in _){const E=_[w[p]];u in E||(E[u]=[]),E[u].push(w),E[f]===void 0&&(E[f]=(x=t==null?void 0:t.initiallyCollapsed)!==null&&x!==void 0?x:!1)}}),zd(v,{childrenPropName:u,levelPropName:c},0),v}function Ud(a,t,e){if(!e)throw new Error('findRecursive requires parameter "childrenPropertyName"');const n=a.find(t),r=a.filter(o=>(o==null?void 0:o.hasOwnProperty(e))&&o[e]);if(n)return n;if(r.length){const o=[];return r.forEach(s=>{s!=null&&s.hasOwnProperty(e)&&o.push(...s[e])}),Ud(o,t,e)}}function js(a,t,e,n=".",r=""){if(isNaN(+a))return a;const o=t===void 0?2:t,s=e===void 0?2:e;let l=String(Math.round(+a*Math.pow(10,s))/Math.pow(10,s));for(l.indexOf(".")<0&&o>0&&(l+=".");l.length-l.indexOf(".")<=o;)l+="0";const u=l.split(".");let p,c;r?p=u.length>=1?_s(u[0],r):void 0:p=u.length>=1?u[0]:l,u.length>1&&(c=u[1]);let f="";return p!==void 0&&c!==void 0?f=`${p}${n}${c}`:p!=null&&(f=p),f}function Sn(a,t,e,n,r="",o="",s=".",l=""){if(isNaN(+a))return a;const u=Math.round(parseFloat(a)*1e6)/1e6;if(u<0){const p=Math.abs(u);if(n){if(!isNaN(t)||!isNaN(e))return`(${r}${js(p,t,e,s,l)}${o})`;const c=_s(`${p}`,l);return`(${r}${c}${o})`}else{if(!isNaN(t)||!isNaN(e))return`-${r}${js(p,t,e,s,l)}${o}`;const c=_s(`${p}`,l);return`-${r}${c}${o}`}}else{if(!isNaN(t)||!isNaN(e))return`${r}${js(a,t,e,s,l)}${o}`;const p=_s(`${a}`,l);return`${r}${p}${o}`}}function Ba(a,t,e){if(typeof a.queryFieldNameGetterFn=="function"){const n=a.queryFieldNameGetterFn(t);(n==null?void 0:n.indexOf("."))>=0?e=_n(t,n):e=t.hasOwnProperty(n)?t[n]:e}return e}function _n(a,t){return!a||!t?a:t.split(".").reduce((e,n)=>e&&e[n],a)}function ao(a){return a&&a.translationNamespace?a.translationNamespace+(a.translationNamespaceSeparator||""):""}function Va(a){return a.outputType||a.type||ie.string}function eh(a){switch(a){case ie.date:case ie.dateTime:case ie.dateIso:case ie.dateTimeIso:case ie.dateTimeShortIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeEuro:case ie.dateTimeShortEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeUs:case ie.dateTimeShortUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:case ie.dateUtc:return!0;default:return!1}}function Fr(a){let t;switch(a){case ie.dateTime:case ie.dateTimeIso:t="YYYY-MM-DD HH:mm:ss";break;case ie.dateTimeIsoAmPm:t="YYYY-MM-DD hh:mm:ss a";break;case ie.dateTimeIsoAM_PM:t="YYYY-MM-DD hh:mm:ss A";break;case ie.dateTimeShortIso:t="YYYY-MM-DD HH:mm";break;case ie.dateEuro:t="DD/MM/YYYY";break;case ie.dateEuroShort:t="D/M/YY";break;case ie.dateTimeEuro:t="DD/MM/YYYY HH:mm:ss";break;case ie.dateTimeShortEuro:t="DD/MM/YYYY HH:mm";break;case ie.dateTimeEuroAmPm:t="DD/MM/YYYY hh:mm:ss a";break;case ie.dateTimeEuroAM_PM:t="DD/MM/YYYY hh:mm:ss A";break;case ie.dateTimeEuroShort:t="D/M/YY H:m:s";break;case ie.dateTimeEuroShortAmPm:t="D/M/YY h:m:s a";break;case ie.dateTimeEuroShortAM_PM:t="D/M/YY h:m:s A";break;case ie.dateUs:t="MM/DD/YYYY";break;case ie.dateUsShort:t="M/D/YY";break;case ie.dateTimeUs:t="MM/DD/YYYY HH:mm:ss";break;case ie.dateTimeUsAmPm:t="MM/DD/YYYY hh:mm:ss a";break;case ie.dateTimeUsAM_PM:t="MM/DD/YYYY hh:mm:ss A";break;case ie.dateTimeUsShort:t="M/D/YY H:m:s";break;case ie.dateTimeUsShortAmPm:t="M/D/YY h:m:s a";break;case ie.dateTimeUsShortAM_PM:t="M/D/YY h:m:s A";break;case ie.dateTimeShortUs:t="MM/DD/YYYY HH:mm";break;case ie.dateUtc:t="YYYY-MM-DDTHH:mm:ss.SSSZ";break;case ie.date:case ie.dateIso:default:t="YYYY-MM-DD";break}return t}function za(a){let t;switch(a){case ie.dateTime:case ie.dateTimeIso:t="Y-m-d H:i:S";break;case ie.dateTimeShortIso:t="Y-m-d H:i";break;case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:t="Y-m-d h:i:S K";break;case ie.dateEuro:t="d/m/Y";break;case ie.dateEuroShort:t="d/m/y";break;case ie.dateTimeEuro:t="d/m/Y H:i:S";break;case ie.dateTimeShortEuro:t="d/m/y H:i";break;case ie.dateTimeEuroAmPm:t="d/m/Y h:i:S K";break;case ie.dateTimeEuroAM_PM:t="d/m/Y h:i:s K";break;case ie.dateTimeEuroShort:t="d/m/y H:i:s";break;case ie.dateTimeEuroShortAmPm:t="d/m/y h:i:s K";break;case ie.dateUs:t="m/d/Y";break;case ie.dateUsShort:t="m/d/y";break;case ie.dateTimeUs:t="m/d/Y H:i:S";break;case ie.dateTimeShortUs:t="m/d/y H:i";break;case ie.dateTimeUsAmPm:t="m/d/Y h:i:S K";break;case ie.dateTimeUsAM_PM:t="m/d/Y h:i:s K";break;case ie.dateTimeUsShort:t="m/d/y H:i:s";break;case ie.dateTimeUsShortAmPm:t="m/d/y h:i:s K";break;case ie.dateUtc:t="Z";break;case ie.date:case ie.dateIso:default:t="Y-m-d";break}return t}function Xg(a){let t;switch(a){case"<":case"LT":t=Lt.lessThan;break;case"<=":case"LE":t=Lt.lessThanOrEqual;break;case">":case"GT":t=Lt.greaterThan;break;case">=":case"GE":t=Lt.greaterThanOrEqual;break;case"<>":case"!=":case"NE":t=Lt.notEqual;break;case"*":case"a*":case"StartsWith":t=Lt.startsWith;break;case"*z":case"EndsWith":t=Lt.endsWith;break;case"=":case"==":case"EQ":t=Lt.equal;break;case"IN":t=Lt.in;break;case"NIN":case"NOT_IN":t=Lt.notIn;break;case"Not_Contains":case"NOT_CONTAINS":t=Lt.notContains;break;case"Contains":case"CONTAINS":default:t=Lt.contains;break}return t}function Ql(a){let t="";switch(a){case Lt.greaterThan:case">":t=">";break;case Lt.greaterThanOrEqual:case">=":t=">=";break;case Lt.lessThan:case"<":t="<";break;case Lt.lessThanOrEqual:case"<=":t="<=";break;case Lt.notEqual:case"<>":t="<>";break;case Lt.equal:case"=":case"==":case"EQ":t="=";break;case Lt.startsWith:case"a*":case"*":t="a*";break;case Lt.endsWith:case"*z":t="*z";break;default:t=a;break}return t}function th(a){let t;if(eh(a))t=Lt.equal;else switch(a){case ie.unknown:case ie.string:case ie.text:case ie.password:case ie.readonly:t=Lt.contains;break;case ie.float:case ie.number:default:t=Lt.equal;break}return t}function Op(a,t){return Object.keys(a).reduce((e,n)=>(n!==t&&(e[n]=a[n]),e),{})}function qg(a,t){let e="";if(typeof a=="string"&&/^[0-9\-\/]*$/.test(a)){const n=decodeURIComponent(a),r=jg(new Date(n));r.isValid()&&r.year().toString().length===4&&(e=t?r.utc().format():r.format())}return e}function _s(a,t=","){if(a!=null){const e=`${a}`,n=e.split(".");return n.length===2?`${n[0].replace(/\B(?=(\d{3})+(?!\d))/g,t)}.${n[1]}`:e.replace(/\B(?=(\d{3})+(?!\d))/g,t)}return a}function bs(a,t,e={}){return Array.isArray(a)?a.find(t)||e:a}function Gd(a){if(Array.isArray(a))for(;a.length>0;){const t=a.pop();t!=null&&t.unsubscribe&&t.unsubscribe()}return a}const Kg=Object.freeze(Object.defineProperty({__proto__:null,CancelledException:Ha,addTreeLevelByMutation:zd,cancellablePromise:Sp,castObservableToPromise:wp,decimalFormatted:js,findItemInTreeStructure:Ud,findOrDefault:bs,flattenToParentChildArray:xp,formatNumber:Sn,getCellValueFromQueryFieldGetter:Ba,getColumnFieldType:Va,getDescendantProperty:_n,getTranslationPrefix:ao,isColumnDateType:eh,mapFlatpickrDateFormatWithFieldType:za,mapMomentDateFormatWithFieldType:Fr,mapOperatorByFieldType:th,mapOperatorToShorthandDesignation:Ql,mapOperatorType:Xg,objectWithoutKey:Op,parseUtcDate:qg,thousandSeparatorFormatted:_s,unflattenParentChildArrayToTree:Tp,unsubscribeAll:Gd},Symbol.toStringTag,{value:"Module"})),Zg=(a,t,e)=>{e==null&&(e=Yi.neutral);let n=0;return a===t?n=0:a===null?n=-1:t===null?n=1:e?n=a<t?-1:1:n=a<t?1:-1,e*n},Qg=(a,t,e,n,r)=>{var o,s;if(!n||!n.dataKey)throw new Error('Sorting a "FieldType.object" requires you to provide the "dataKey" (object property name) of the object so that we can use it to sort correctly');const l=a!=null&&a.hasOwnProperty(n.dataKey)?a[n.dataKey]:a,u=t!=null&&t.hasOwnProperty(n.dataKey)?t[n.dataKey]:t,p=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1;e==null&&(e=Yi.neutral);let c=0;return typeof a!="object"?c=-99e10:typeof t!="object"?c=99e10:l===null||p&&l===void 0?c=-1:u===null||p&&u===void 0?c=1:l===u?c=0:e?c=l<u?-1:1:c=l<u?1:-1,e*c};function Jg(a,t,e="id"){let n=-1;t&&typeof t=="object"&&e in t?n=a.findIndex(r=>r[e]===t[e]):n=a.findIndex(r=>r===t),n<0&&a.push(t)}function Ua(a,t=" "){let e="";for(let n=0;n<a;n++)e+=t;return e}function ih(a,t){return a.filter((e,n)=>t!==n)}function uo(a){const t=()=>{const r={};for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=uo(a[o]));return r},e=()=>a.map(r=>uo(r)),n=Object.prototype.toString.call(a).slice(8,-1).toLowerCase();return n==="object"?t():n==="array"?e():a}function yl(a,...t){if(!t.length)return a;const e=t.shift();if(a=!Ko(a)&&Ko(e)?{}:a,Ko(a)&&Ko(e))for(const n in e)e.hasOwnProperty(n)&&(n in a?typeof a[n]!="object"||typeof e[n]!="object"?a[n]=e[n]:a[n].concat&&e[n].concat?a[n]=a[n].concat(e[n]):a[n]=yl(a[n],e[n]):a[n]=e[n]);return yl(a,...t)}function nh(a,...t){if(!t.length||t[0]===void 0)return a;const e=t.shift();if(a=!Ko(a)&&Ko(e)?{}:a,Ko(a)&&Ko(e))for(const n of Object.keys(e))typeof e[n]=="object"&&e[n]!==null&&nh(a[n],e[n]),(a[n]===null||a[n]===void 0)&&e[n]!==null&&e[n]!==void 0&&(a[n]=e[n]);return nh(a,...t)}function Ap(a){for(const t in a)a.hasOwnProperty(t)&&delete a[t];return a=null,a={},a}function rh(a){return a==null?!0:Object.entries(a).length===0}function Ko(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)}function Wd(a){return a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"}function $d(a){return a!=null&&a!==""}function rr(a,t=!1){return t?a==null||typeof a=="string"?!1:!isNaN(a):a==null||a===""?!1:!isNaN(+a)}function kp(a){return!a||a&&typeof a=="object"&&Object.keys(a).length===0}function Yd(a){return/(true|1)/i.test(a+"")}function Jl(a,t=!1){const e=typeof a.normalize=="function"?a.normalize("NFD").replace(/[\u0300-\u036f]/g,""):a;return t?e.toLowerCase():e}function cr(a,t,e){if(typeof t=="string"&&(t=t.split(".")),t.length>1){const n=t.shift();a&&n!==void 0&&cr(a[n]=$d(a[n])&&(Array.isArray(a[n])||Object.prototype.toString.call(a[n])==="[object Object]")?a[n]:{},t,e)}else a&&t[0]&&(a[t[0]]=e)}function El(a,t=!1){return typeof a=="string"?t?a.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()):a.charAt(0).toUpperCase()+a.slice(1):a}function oh(a){return typeof a=="string"?a.replace(/(?:^\w|[A-Z]|\b\w|[\s+\-_\/])/g,(t,e)=>/[\s+\-_\/]/.test(t)?"":e===0?t.toLowerCase():t.toUpperCase()):a}function Ga(a){return typeof a=="string"?oh(a).replace(/([A-Z])/g,"-$1").toLowerCase():a}function jr(a){if(typeof a=="string"){const t=a.replace(/([A-Z])|(\-)/g," $1").replace(/\s+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}return a}function e_(a){return typeof a=="string"?oh(a).replace(/([A-Z])/g,"_$1").toLowerCase():a}function Ip(a){return Array.isArray(a)&&a.length>0?a.filter((t,e)=>a.indexOf(t)>=e):a}function t_(a,t="id"){if(Array.isArray(a)&&a.length>0){const e=[],n=new Map;for(const r of a)r&&!n.has(r[t])&&(n.set(r[t],!0),e.push({id:r[t],name:r.name}));return e}return a}const i_=Object.freeze(Object.defineProperty({__proto__:null,addToArrayWhenNotExists:Jg,addWhiteSpaces:Ua,arrayRemoveItemByIndex:ih,deepCopy:uo,deepMerge:yl,emptyObject:Ap,hasData:$d,isEmptyObject:rh,isNumber:rr,isObject:Ko,isObjectEmpty:kp,isPrimitiveValue:Wd,objectAssignAndExtend:nh,parseBoolean:Yd,removeAccentFromText:Jl,setDeepValue:cr,titleCase:El,toCamelCase:oh,toKebabCase:Ga,toSentenceCase:jr,toSnakeCase:e_,uniqueArray:Ip,uniqueObjectArray:t_},Symbol.toStringTag,{value:"Module"})),n_=(a,t,e,n,r)=>{var o,s;e==null&&(e=Yi.neutral);let l=0;const u=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1;return a===t?l=0:a===null||u&&a===void 0?l=-1:t===null||u&&t===void 0?l=1:(r!=null&&r.ignoreAccentOnStringFilterAndSort&&(a=Jl(a,!1),t=Jl(t,!1)),e?l=a<t?-1:1:l=a<t?1:-1),e*l},Dp=(a,t,e,n,r)=>{var o,s;const l=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1,u=isNaN(a)||a===""||a===null||l&&a===void 0?-99e10:parseFloat(a),p=isNaN(t)||t===""||t===null||l&&t===void 0?-99e10:parseFloat(t);return e*(u===p?0:u>p?1:-1)},jd=Ys||ms;function Rp(a,t,e,n,r){let o=0;if(a===t)o=0;else{let s=jd(a,n,r),l=jd(t,n,r);s.isValid()||(s=new Date(1001,1,1)),l.isValid()||(l=new Date(1001,1,1)),o=s.valueOf()-l.valueOf()}return e*o}function ji(a){const t=a===ie.date?jd.ISO_8601:Fr(a);return(e,n,r)=>t===jd.ISO_8601?Rp(e,n,r,t,!1):Rp(e,n,r,t,!0)}const Sl={boolean:Zg,date:ji(ie.date),dateIso:ji(ie.dateIso),dateUtc:ji(ie.dateUtc),dateTime:ji(ie.dateTime),dateTimeIso:ji(ie.dateTimeIso),dateTimeIsoAmPm:ji(ie.dateTimeIsoAmPm),dateTimeIsoAM_PM:ji(ie.dateTimeIsoAM_PM),dateTimeShortIso:ji(ie.dateTimeShortIso),dateEuro:ji(ie.dateEuro),dateEuroShort:ji(ie.dateEuroShort),dateTimeShortEuro:ji(ie.dateTimeShortEuro),dateTimeEuro:ji(ie.dateTimeEuro),dateTimeEuroAmPm:ji(ie.dateTimeEuroAmPm),dateTimeEuroAM_PM:ji(ie.dateTimeEuroAM_PM),dateTimeEuroShort:ji(ie.dateTimeEuroShort),dateTimeEuroShortAmPm:ji(ie.dateTimeEuroShortAmPm),dateTimeEuroShortAM_PM:ji(ie.dateTimeEuroShortAM_PM),dateUs:ji(ie.dateUs),dateUsShort:ji(ie.dateUsShort),dateTimeShortUs:ji(ie.dateTimeShortUs),dateTimeUs:ji(ie.dateTimeUs),dateTimeUsAmPm:ji(ie.dateTimeUsAmPm),dateTimeUsAM_PM:ji(ie.dateTimeUsAM_PM),dateTimeUsShort:ji(ie.dateTimeUsShort),dateTimeUsShortAmPm:ji(ie.dateTimeUsShortAmPm),dateTimeUsShortAM_PM:ji(ie.dateTimeUsShortAM_PM),numeric:Dp,objectString:Qg,string:n_};function ea(a,t,e,n,r,o){let s=0;switch(a){case ie.boolean:s=Sl.boolean(t,e,n,r,o);break;case ie.float:case ie.integer:case ie.number:s=Sl.numeric(t,e,n,r,o);break;case ie.date:case ie.dateIso:case ie.dateUtc:case ie.dateTime:case ie.dateTimeIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateTimeShortIso:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeShortEuro:case ie.dateTimeEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeShortUs:case ie.dateTimeUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:s=ji(a).call(this,t,e,n,r,o);break;case ie.object:s=Sl.objectString(t,e,n,r,o);break;case ie.string:case ie.text:case ie.password:case ie.readonly:default:s=Sl.string(t,e,n,r,o);break}return s}const r_=Object.freeze(Object.defineProperty({__proto__:null,sortByFieldType:ea},Symbol.toStringTag,{value:"Module"}));var Do;(function(a){a.camelCase="camelCase",a.kebabCase="kebabCase",a.lowerCase="lowerCase",a.lowerCaseWithoutOnPrefix="lowerCaseWithoutOnPrefix"})(Do||(Do={}));class Fp{get elementSource(){return this._elementSource}set elementSource(t){this._elementSource=t}get subscribedEvents(){return this._subscribedEvents}get subscribedEventNames(){return this._subscribedEvents.map(t=>t.name)}constructor(t){this._subscribedEvents=[],this.eventNamingStyle=Do.camelCase,this._elementSource=t||document.createElement("div")}dispose(){var t;this.unsubscribeAll(),this._subscribedEvents=[],clearTimeout(this._timer),(t=this._elementSource)===null||t===void 0||t.remove(),this._elementSource=null}dispatchCustomEvent(t,e,n=!0,r=!0){var o;const s={bubbles:n,cancelable:r};return e&&(s.detail=e),(o=this._elementSource)===null||o===void 0?void 0:o.dispatchEvent(new CustomEvent(t,s))}getEventNameByNamingConvention(t,e){let n="";switch(this.eventNamingStyle){case Do.camelCase:n=e!==""?`${e}${El(t)}`:t;break;case Do.kebabCase:n=e!==""?`${e}-${Ga(t)}`:Ga(t);break;case Do.lowerCase:n=`${e}${t}`.toLowerCase();break;case Do.lowerCaseWithoutOnPrefix:n=`${e}${t.replace(/^on/,"")}`.toLowerCase();break}return n}publish(t,e,n){const r=this.getEventNameByNamingConvention(t,"");return n?new Promise(o=>{this._timer=setTimeout(()=>o(this.dispatchCustomEvent(r,e,!0,!0)),n)}):this.dispatchCustomEvent(r,e,!0,!0)}subscribe(t,e){const n=this.getEventNameByNamingConvention(t,"");return this._elementSource.addEventListener(n,r=>e.call(null,r.detail)),this._subscribedEvents.push({name:n,listener:e}),{unsubscribe:()=>this.unsubscribe(n,e)}}subscribeEvent(t,e){const n=this.getEventNameByNamingConvention(t,"");return this._elementSource.addEventListener(n,e),this._subscribedEvents.push({name:n,listener:e}),{unsubscribe:()=>this.unsubscribe(n,e)}}unsubscribe(t,e,n=!0){const r=this.getEventNameByNamingConvention(t,"");this._elementSource.removeEventListener(r,e),n&&this.removeSubscribedEventWhenFound(t,e)}unsubscribeAll(t){if(Array.isArray(t)){let e;do e=t.pop(),e!=null&&e.dispose?e.dispose():e!=null&&e.unsubscribe&&e.unsubscribe();while(e)}else{let e=this._subscribedEvents.pop();for(;e;)this.unsubscribe(e.name,e.listener,!1),e=this._subscribedEvents.pop()}}removeSubscribedEventWhenFound(t,e){const n=this._subscribedEvents.findIndex(r=>r.name===t&&r.listener===e);n>=0&&this._subscribedEvents.splice(n,1)}}var Pp={exports:{}};(function(a,t){(function(e,n){a.exports=n()})(Rr,function(){function e(n){var r=document,o=n.container||r.createElement("div");o.id=o.id||"autocomplete-"+F();var s=o.style,l=n.debounceWaitMs||0,u=n.preventSubmit||!1,p=n.disableAutoSelect||!1,c=o.parentElement,f=[],m="",v=2,_=n.showOnFocus,C,x=0,w,E=!1,I=!1;if(n.minLength!==void 0&&(v=n.minLength),!n.input)throw new Error("input undefined");var k=n.input;o.className="autocomplete "+(n.className||""),o.setAttribute("role","listbox"),k.setAttribute("role","combobox"),k.setAttribute("aria-expanded","false"),k.setAttribute("aria-autocomplete","list"),k.setAttribute("aria-controls",o.id),k.setAttribute("aria-owns",o.id),k.setAttribute("aria-activedescendant",""),k.setAttribute("aria-haspopup","listbox"),s.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function N(){var Ie=o.parentNode;Ie&&Ie.removeChild(o)}function V(){w&&window.clearTimeout(w)}function Q(){o.parentNode||(c||r.body).appendChild(o)}function L(){return!!o.parentNode}function se(){x++,f=[],m="",C=void 0,k.setAttribute("aria-activedescendant",""),k.setAttribute("aria-expanded","false"),N()}function Ce(){if(!L())return;k.setAttribute("aria-expanded","true"),s.height="auto",s.width=k.offsetWidth+"px";var Ie=0,it;function et(){var R=r.documentElement,te=R.clientTop||r.body.clientTop||0,ge=R.clientLeft||r.body.clientLeft||0,$=window.pageYOffset||R.scrollTop,X=window.pageXOffset||R.scrollLeft;it=k.getBoundingClientRect();var ne=it.top+k.offsetHeight+$-te,Me=it.left+X-ge;s.top=ne+"px",s.left=Me+"px",Ie=window.innerHeight-(it.top+k.offsetHeight),Ie<0&&(Ie=0),s.top=ne+"px",s.bottom="",s.left=Me+"px",s.maxHeight=Ie+"px"}et(),et(),n.customize&&it&&n.customize(k,it,o,Ie)}function J(){o.innerHTML="",k.setAttribute("aria-activedescendant","");var Ie=function(ge,$,X){var ne=r.createElement("div");return ne.textContent=ge.label||"",ne};n.render&&(Ie=n.render);var it=function(ge,$){var X=r.createElement("div");return X.textContent=ge,X};n.renderGroup&&(it=n.renderGroup);var et=r.createDocumentFragment(),R=F();if(f.forEach(function(ge,$){if(ge.group&&ge.group!==R){R=ge.group;var X=it(ge.group,m);X&&(X.className+=" group",et.appendChild(X))}var ne=Ie(ge,m,$);ne&&(ne.id=o.id+"_"+$,ne.setAttribute("role","option"),ne.addEventListener("click",function(Me){I=!0;try{n.onSelect(ge,k)}finally{I=!1}se(),Me.preventDefault(),Me.stopPropagation()}),ge===C&&(ne.className+=" selected",ne.setAttribute("aria-selected","true"),k.setAttribute("aria-activedescendant",ne.id)),et.appendChild(ne))}),o.appendChild(et),f.length<1)if(n.emptyMsg){var te=r.createElement("div");te.id=o.id+"_"+F(),te.className="empty",te.textContent=n.emptyMsg,o.appendChild(te),k.setAttribute("aria-activedescendant",te.id)}else{se();return}Q(),Ce(),Pe()}function z(){L()&&J()}function P(){z()}function le(Ie){Ie.target!==o?z():Ie.preventDefault()}function Ke(){I||ze(0)}function Pe(){var Ie=o.getElementsByClassName("selected");if(Ie.length>0){var it=Ie[0],et=it.previousElementSibling;if(et&&et.className.indexOf("group")!==-1&&!et.previousElementSibling&&(it=et),it.offsetTop<o.scrollTop)o.scrollTop=it.offsetTop;else{var R=it.offsetTop+it.offsetHeight,te=o.scrollTop+o.offsetHeight;R>te&&(o.scrollTop+=R-te)}}}function Oe(){var Ie=f.indexOf(C);C=Ie===-1?void 0:f[(Ie+f.length-1)%f.length]}function ye(){var Ie=f.indexOf(C);C=f.length<1?void 0:Ie===-1?f[0]:f[(Ie+1)%f.length]}function Re(Ie,it){var et=L();if(it==="Escape")se();else{if(!et||f.length<1)return;it==="ArrowUp"?Oe():ye(),J()}Ie.preventDefault(),et&&Ie.stopPropagation()}function ae(Ie){if(C){I=!0;try{n.onSelect(C,k)}finally{I=!1}se()}u&&Ie.preventDefault()}function he(Ie){var it=Ie.key;switch(it){case"ArrowUp":case"ArrowDown":case"Escape":Re(Ie,it);break;case"Enter":ae(Ie);break}}function Ne(){_&&ze(1)}function ze(Ie){k.value.length>=v||Ie===1?(V(),w=window.setTimeout(function(){return Be(k.value,Ie,k.selectionStart||0)},Ie===0||Ie===2?l:0)):se()}function Be(Ie,it,et){if(!E){var R=++x;n.fetch(Ie,function(te){x===R&&te&&(f=te,m=Ie,C=f.length<1||p?void 0:f[0],J())},it,et)}}function de(Ie){if(n.keyup){n.keyup({event:Ie,fetch:function(){return ze(0)}});return}!L()&&Ie.key==="ArrowDown"&&ze(0)}function Ee(Ie){n.click&&n.click({event:Ie,fetch:function(){return ze(2)}})}function ve(){setTimeout(function(){r.activeElement!==k&&se()},200)}function He(){Be(k.value,3,k.selectionStart||0)}o.addEventListener("mousedown",function(Ie){Ie.stopPropagation(),Ie.preventDefault()}),o.addEventListener("focus",function(){return k.focus()});function lt(){k.removeEventListener("focus",Ne),k.removeEventListener("keyup",de),k.removeEventListener("click",Ee),k.removeEventListener("keydown",he),k.removeEventListener("input",Ke),k.removeEventListener("blur",ve),window.removeEventListener("resize",P),r.removeEventListener("scroll",le,!0),k.removeAttribute("role"),k.removeAttribute("aria-expanded"),k.removeAttribute("aria-autocomplete"),k.removeAttribute("aria-controls"),k.removeAttribute("aria-activedescendant"),k.removeAttribute("aria-owns"),k.removeAttribute("aria-haspopup"),V(),se(),E=!0}return k.addEventListener("keyup",de),k.addEventListener("click",Ee),k.addEventListener("keydown",he),k.addEventListener("input",Ke),k.addEventListener("blur",ve),k.addEventListener("focus",Ne),window.addEventListener("resize",P),r.addEventListener("scroll",le,!0),{destroy:lt,fetch:He}}return e})})(Pp);var Mp=Pp.exports;const sh=Zc(Mp),Xd=Cl({__proto__:null,default:sh},[Mp]);function Np(a,t){const e=t.fetch;e&&(t.fetch=(n,r,o,s)=>{a.classList.add("slick-autocomplete-loading");const l=r;e(n,p=>{l(p),a.classList.remove("slick-autocomplete-loading")},o,s)})}class Fn{constructor(){this._boundedEvents=[]}get boundedEvents(){return this._boundedEvents}dispose(){this.unbindAll(),this._boundedEvents=[]}bind(t,e,n,r){const o=Array.isArray(e)?e:[e];if(t!=null&&t.forEach)t==null||t.forEach(s=>{for(const l of o)s.addEventListener(l,n,r),this._boundedEvents.push({element:s,eventName:l,listener:n})});else for(const s of o)t.addEventListener(s,n,r),this._boundedEvents.push({element:t,eventName:s,listener:n})}unbind(t,e,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e];for(const s of o)for(const l of r)l!=null&&l.removeEventListener&&l.removeEventListener(s,n)}unbindAll(){for(;this._boundedEvents.length>0;){const t=this._boundedEvents.pop(),{element:e,eventName:n,listener:r}=t;this.unbind(e,n,r)}}}class Lp{constructor(t){this.translaterService=t}filterCollection(t,e,n=Zl.chain){let r=[];if(Array.isArray(e)){r=n===Zl.merge?[]:[...t];for(const o of e)if(n===Zl.merge){const s=this.singleFilterCollection(t,o);r=Ip([...r,...s])}else r=this.singleFilterCollection(r,o)}else r=this.singleFilterCollection(t,e);return r}singleFilterCollection(t,e){let n=[];if(e){const r=e.property,o=e.operator||Lt.equal,s=typeof e.value>"u"?"":e.value;switch(o){case Lt.equal:r?n=t.filter(l=>l[r]===s):n=t.filter(l=>l===s);break;case Lt.contains:r?n=t.filter(l=>{var u;return((u=l[r])===null||u===void 0?void 0:u.toString().indexOf(s.toString()))!==-1}):n=t.filter(l=>l!=null&&l.toString().indexOf(s.toString())!==-1);break;case Lt.notContains:r?n=t.filter(l=>{var u;return((u=l[r])===null||u===void 0?void 0:u.toString().indexOf(s.toString()))===-1}):n=t.filter(l=>l!=null&&l.toString().indexOf(s.toString())===-1);break;case Lt.notEqual:default:r?n=t.filter(l=>l[r]!==s):n=t.filter(l=>l!==s)}}return n}sortCollection(t,e,n,r){var o,s,l,u;if(r&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let p=[];if(n){if(Array.isArray(n))p=e.sort((c,f)=>{var m,v,_,C;for(let x=0,w=n.length;x<w;x++){const E=n[x];if(E!=null&&E.property){const I=E.sortDesc?Yi.desc:Yi.asc,k=E.property,F=(v=(m=E==null?void 0:E.fieldType)!==null&&m!==void 0?m:t==null?void 0:t.type)!==null&&v!==void 0?v:ie.string,N=r?((_=this.translaterService)===null||_===void 0?void 0:_.translate)&&this.translaterService.translate(c[k]||" "):c[k],V=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(f[k]||" "):f[k],Q=ea(F,N,V,I,t);if(Q!==Yi.neutral)return Q}}return Yi.neutral});else if(n!=null&&n.property){const c=n.property,f=n.sortDesc?Yi.desc:Yi.asc,m=(s=(o=n==null?void 0:n.fieldType)!==null&&o!==void 0?o:t==null?void 0:t.type)!==null&&s!==void 0?s:ie.string;p=e.sort((v,_)=>{var C,x;const w=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(v[c]||" "):v[c],E=r?((x=this.translaterService)===null||x===void 0?void 0:x.translate)&&this.translaterService.translate(_[c]||" "):_[c],I=ea(m,w,E,f,t);return I!==Yi.neutral?I:Yi.neutral})}else if(n&&!n.property){const c=n.sortDesc?Yi.desc:Yi.asc,f=(u=(l=n==null?void 0:n.fieldType)!==null&&l!==void 0?l:t==null?void 0:t.type)!==null&&u!==void 0?u:ie.string;p=e.sort((m,v)=>{var _,C;const x=r?((_=this.translaterService)===null||_===void 0?void 0:_.translate)&&this.translaterService.translate(m||" "):m,w=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(v||" "):v,E=ea(f,x,w,c,t);return E!==Yi.neutral?E:Yi.neutral})}}return p}}/*! @license DOMPurify 3.0.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.4/LICENSE */const{entries:Hp,setPrototypeOf:Bp,isFrozen:o_,getPrototypeOf:s_,getOwnPropertyDescriptor:l_}=Object;let{freeze:Er,seal:Ro,create:a_}=Object,{apply:lh,construct:ah}=typeof Reflect<"u"&&Reflect;lh||(lh=function(t,e,n){return t.apply(e,n)}),Er||(Er=function(t){return t}),Ro||(Ro=function(t){return t}),ah||(ah=function(t,e){return new t(...e)});const d_=co(Array.prototype.forEach),Vp=co(Array.prototype.pop),Wa=co(Array.prototype.push),qd=co(String.prototype.toLowerCase),dh=co(String.prototype.toString),u_=co(String.prototype.match),Fo=co(String.prototype.replace),c_=co(String.prototype.indexOf),h_=co(String.prototype.trim),Xr=co(RegExp.prototype.test),$a=f_(TypeError);function co(a){return function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lh(a,t,n)}}function f_(a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ah(a,e)}}function ui(a,t,e){var n;e=(n=e)!==null&&n!==void 0?n:qd,Bp&&Bp(a,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=e(o);s!==o&&(o_(t)||(t[r]=s),o=s)}a[o]=!0}return a}function ta(a){const t=a_(null);for(const[e,n]of Hp(a))t[e]=n;return t}function Kd(a,t){for(;a!==null;){const n=l_(a,t);if(n){if(n.get)return co(n.get);if(typeof n.value=="function")return co(n.value)}a=s_(a)}function e(n){return console.warn("fallback value for",n),null}return e}const zp=Er(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uh=Er(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ch=Er(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),p_=Er(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hh=Er(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),m_=Er(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Up=Er(["#text"]),Gp=Er(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),fh=Er(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wp=Er(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zd=Er(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v_=Ro(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g_=Ro(/<%[\w\W]*|[\w\W]*%>/gm),__=Ro(/\${[\w\W]*}/gm),b_=Ro(/^data-[\-\w.\u00B7-\uFFFF]/),C_=Ro(/^aria-[\-\w]+$/),$p=Ro(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),y_=Ro(/^(?:\w+script|data):/i),E_=Ro(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yp=Ro(/^html$/i);var jp=Object.freeze({__proto__:null,MUSTACHE_EXPR:v_,ERB_EXPR:g_,TMPLIT_EXPR:__,DATA_ATTR:b_,ARIA_ATTR:C_,IS_ALLOWED_URI:$p,IS_SCRIPT_OR_DATA:y_,ATTR_WHITESPACE:E_,DOCTYPE_NAME:Yp});const S_=()=>typeof window>"u"?null:window,w_=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Xp(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S_();const t=Ct=>Xp(Ct);if(t.version="3.0.4",t.removed=[],!a||!a.document||a.document.nodeType!==9)return t.isSupported=!1,t;const e=a.document,n=e.currentScript;let{document:r}=a;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:p,NamedNodeMap:c=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:v}=a,_=u.prototype,C=Kd(_,"cloneNode"),x=Kd(_,"nextSibling"),w=Kd(_,"childNodes"),E=Kd(_,"parentNode");if(typeof s=="function"){const Ct=r.createElement("template");Ct.content&&Ct.content.ownerDocument&&(r=Ct.content.ownerDocument)}let I,k="";const{implementation:F,createNodeIterator:N,createDocumentFragment:V,getElementsByTagName:Q}=r,{importNode:L}=e;let se={};t.isSupported=typeof Hp=="function"&&typeof E=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ce,ERB_EXPR:J,TMPLIT_EXPR:z,DATA_ATTR:P,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:Ke,ATTR_WHITESPACE:Pe}=jp;let{IS_ALLOWED_URI:Oe}=jp,ye=null;const Re=ui({},[...zp,...uh,...ch,...hh,...Up]);let ae=null;const he=ui({},[...Gp,...fh,...Wp,...Zd]);let Ne=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ze=null,Be=null,de=!0,Ee=!0,ve=!1,He=!0,lt=!1,Ie=!1,it=!1,et=!1,R=!1,te=!1,ge=!1,$=!0,X=!1;const ne="user-content-";let Me=!0,Ue=!1,Se={},Ye=null;const pt=ui({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Le=ui({},["audio","video","img","source","image","track"]);let Xt=null;const It=ui({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yi="http://www.w3.org/1998/Math/MathML",q="http://www.w3.org/2000/svg",W="http://www.w3.org/1999/xhtml";let pe=W,ke=!1,at=null;const ot=ui({},[yi,q,W],dh);let ct;const Rt=["application/xhtml+xml","text/html"],Ht="text/html";let Tt,Ut=null;const Kt=r.createElement("form"),Ni=function(_e){return _e instanceof RegExp||_e instanceof Function},Li=function(_e){if(!(Ut&&Ut===_e)){if((!_e||typeof _e!="object")&&(_e={}),_e=ta(_e),ct=Rt.indexOf(_e.PARSER_MEDIA_TYPE)===-1?ct=Ht:ct=_e.PARSER_MEDIA_TYPE,Tt=ct==="application/xhtml+xml"?dh:qd,ye="ALLOWED_TAGS"in _e?ui({},_e.ALLOWED_TAGS,Tt):Re,ae="ALLOWED_ATTR"in _e?ui({},_e.ALLOWED_ATTR,Tt):he,at="ALLOWED_NAMESPACES"in _e?ui({},_e.ALLOWED_NAMESPACES,dh):ot,Xt="ADD_URI_SAFE_ATTR"in _e?ui(ta(It),_e.ADD_URI_SAFE_ATTR,Tt):It,Ge="ADD_DATA_URI_TAGS"in _e?ui(ta(Le),_e.ADD_DATA_URI_TAGS,Tt):Le,Ye="FORBID_CONTENTS"in _e?ui({},_e.FORBID_CONTENTS,Tt):pt,ze="FORBID_TAGS"in _e?ui({},_e.FORBID_TAGS,Tt):{},Be="FORBID_ATTR"in _e?ui({},_e.FORBID_ATTR,Tt):{},Se="USE_PROFILES"in _e?_e.USE_PROFILES:!1,de=_e.ALLOW_ARIA_ATTR!==!1,Ee=_e.ALLOW_DATA_ATTR!==!1,ve=_e.ALLOW_UNKNOWN_PROTOCOLS||!1,He=_e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=_e.SAFE_FOR_TEMPLATES||!1,Ie=_e.WHOLE_DOCUMENT||!1,R=_e.RETURN_DOM||!1,te=_e.RETURN_DOM_FRAGMENT||!1,ge=_e.RETURN_TRUSTED_TYPE||!1,et=_e.FORCE_BODY||!1,$=_e.SANITIZE_DOM!==!1,X=_e.SANITIZE_NAMED_PROPS||!1,Me=_e.KEEP_CONTENT!==!1,Ue=_e.IN_PLACE||!1,Oe=_e.ALLOWED_URI_REGEXP||$p,pe=_e.NAMESPACE||W,Ne=_e.CUSTOM_ELEMENT_HANDLING||{},_e.CUSTOM_ELEMENT_HANDLING&&Ni(_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&Ni(_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&typeof _e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ne.allowCustomizedBuiltInElements=_e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),lt&&(Ee=!1),te&&(R=!0),Se&&(ye=ui({},[...Up]),ae=[],Se.html===!0&&(ui(ye,zp),ui(ae,Gp)),Se.svg===!0&&(ui(ye,uh),ui(ae,fh),ui(ae,Zd)),Se.svgFilters===!0&&(ui(ye,ch),ui(ae,fh),ui(ae,Zd)),Se.mathMl===!0&&(ui(ye,hh),ui(ae,Wp),ui(ae,Zd))),_e.ADD_TAGS&&(ye===Re&&(ye=ta(ye)),ui(ye,_e.ADD_TAGS,Tt)),_e.ADD_ATTR&&(ae===he&&(ae=ta(ae)),ui(ae,_e.ADD_ATTR,Tt)),_e.ADD_URI_SAFE_ATTR&&ui(Xt,_e.ADD_URI_SAFE_ATTR,Tt),_e.FORBID_CONTENTS&&(Ye===pt&&(Ye=ta(Ye)),ui(Ye,_e.FORBID_CONTENTS,Tt)),Me&&(ye["#text"]=!0),Ie&&ui(ye,["html","head","body"]),ye.table&&(ui(ye,["tbody"]),delete ze.tbody),_e.TRUSTED_TYPES_POLICY){if(typeof _e.TRUSTED_TYPES_POLICY.createHTML!="function")throw $a('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $a('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=_e.TRUSTED_TYPES_POLICY,k=I.createHTML("")}else I===void 0&&(I=w_(v,n)),I!==null&&typeof k=="string"&&(k=I.createHTML(""));Er&&Er(_e),Ut=_e}},U=ui({},["mi","mo","mn","ms","mtext"]),Z=ui({},["foreignobject","desc","title","annotation-xml"]),ce=ui({},["title","style","font","a","script"]),we=ui({},uh);ui(we,ch),ui(we,p_);const st=ui({},hh);ui(st,m_);const vt=function(_e){let je=E(_e);(!je||!je.tagName)&&(je={namespaceURI:pe,tagName:"template"});const mt=qd(_e.tagName),Jt=qd(je.tagName);return at[_e.namespaceURI]?_e.namespaceURI===q?je.namespaceURI===W?mt==="svg":je.namespaceURI===yi?mt==="svg"&&(Jt==="annotation-xml"||U[Jt]):!!we[mt]:_e.namespaceURI===yi?je.namespaceURI===W?mt==="math":je.namespaceURI===q?mt==="math"&&Z[Jt]:!!st[mt]:_e.namespaceURI===W?je.namespaceURI===q&&!Z[Jt]||je.namespaceURI===yi&&!U[Jt]?!1:!st[mt]&&(ce[mt]||!we[mt]):!!(ct==="application/xhtml+xml"&&at[_e.namespaceURI]):!1},ht=function(_e){Wa(t.removed,{element:_e});try{_e.parentNode.removeChild(_e)}catch{_e.remove()}},wt=function(_e,je){try{Wa(t.removed,{attribute:je.getAttributeNode(_e),from:je})}catch{Wa(t.removed,{attribute:null,from:je})}if(je.removeAttribute(_e),_e==="is"&&!ae[_e])if(R||te)try{ht(je)}catch{}else try{je.setAttribute(_e,"")}catch{}},Bt=function(_e){let je,mt;if(et)_e="<remove></remove>"+_e;else{const mn=u_(_e,/^[\r\n\t ]+/);mt=mn&&mn[0]}ct==="application/xhtml+xml"&&pe===W&&(_e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_e+"</body></html>");const Jt=I?I.createHTML(_e):_e;if(pe===W)try{je=new m().parseFromString(Jt,ct)}catch{}if(!je||!je.documentElement){je=F.createDocument(pe,"template",null);try{je.documentElement.innerHTML=ke?k:Jt}catch{}}const Mi=je.body||je.documentElement;return _e&&mt&&Mi.insertBefore(r.createTextNode(mt),Mi.childNodes[0]||null),pe===W?Q.call(je,Ie?"html":"body")[0]:Ie?je.documentElement:Mi},Et=function(_e){return N.call(_e.ownerDocument||_e,_e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},_t=function(_e){return _e instanceof f&&(typeof _e.nodeName!="string"||typeof _e.textContent!="string"||typeof _e.removeChild!="function"||!(_e.attributes instanceof c)||typeof _e.removeAttribute!="function"||typeof _e.setAttribute!="function"||typeof _e.namespaceURI!="string"||typeof _e.insertBefore!="function"||typeof _e.hasChildNodes!="function")},Zt=function(_e){return typeof l=="object"?_e instanceof l:_e&&typeof _e=="object"&&typeof _e.nodeType=="number"&&typeof _e.nodeName=="string"},Ii=function(_e,je,mt){se[_e]&&d_(se[_e],Jt=>{Jt.call(t,je,mt,Ut)})},Gi=function(_e){let je;if(Ii("beforeSanitizeElements",_e,null),_t(_e))return ht(_e),!0;const mt=Tt(_e.nodeName);if(Ii("uponSanitizeElement",_e,{tagName:mt,allowedTags:ye}),_e.hasChildNodes()&&!Zt(_e.firstElementChild)&&(!Zt(_e.content)||!Zt(_e.content.firstElementChild))&&Xr(/<[/\w]/g,_e.innerHTML)&&Xr(/<[/\w]/g,_e.textContent))return ht(_e),!0;if(!ye[mt]||ze[mt]){if(!ze[mt]&&Hi(mt)&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,mt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(mt)))return!1;if(Me&&!Ye[mt]){const Jt=E(_e)||_e.parentNode,Mi=w(_e)||_e.childNodes;if(Mi&&Jt){const mn=Mi.length;for(let pi=mn-1;pi>=0;--pi)Jt.insertBefore(C(Mi[pi],!0),x(_e))}}return ht(_e),!0}return _e instanceof u&&!vt(_e)||(mt==="noscript"||mt==="noembed"||mt==="noframes")&&Xr(/<\/no(script|embed|frames)/i,_e.innerHTML)?(ht(_e),!0):(lt&&_e.nodeType===3&&(je=_e.textContent,je=Fo(je,Ce," "),je=Fo(je,J," "),je=Fo(je,z," "),_e.textContent!==je&&(Wa(t.removed,{element:_e.cloneNode()}),_e.textContent=je)),Ii("afterSanitizeElements",_e,null),!1)},Qt=function(_e,je,mt){if($&&(je==="id"||je==="name")&&(mt in r||mt in Kt))return!1;if(!(Ee&&!Be[je]&&Xr(P,je))){if(!(de&&Xr(le,je))){if(!ae[je]||Be[je]){if(!(Hi(_e)&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,_e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(_e))&&(Ne.attributeNameCheck instanceof RegExp&&Xr(Ne.attributeNameCheck,je)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(je))||je==="is"&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,mt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(mt))))return!1}else if(!Xt[je]){if(!Xr(Oe,Fo(mt,Pe,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&_e!=="script"&&c_(mt,"data:")===0&&Ge[_e])){if(!(ve&&!Xr(Ke,Fo(mt,Pe,"")))){if(mt)return!1}}}}}}return!0},Hi=function(_e){return _e.indexOf("-")>0},Nn=function(_e){let je,mt,Jt,Mi;Ii("beforeSanitizeAttributes",_e,null);const{attributes:mn}=_e;if(!mn)return;const pi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae};for(Mi=mn.length;Mi--;){je=mn[Mi];const{name:Xi,namespaceURI:lr}=je;if(mt=Xi==="value"?je.value:h_(je.value),Jt=Tt(Xi),pi.attrName=Jt,pi.attrValue=mt,pi.keepAttr=!0,pi.forceKeepAttr=void 0,Ii("uponSanitizeAttribute",_e,pi),mt=pi.attrValue,pi.forceKeepAttr||(wt(Xi,_e),!pi.keepAttr))continue;if(!He&&Xr(/\/>/i,mt)){wt(Xi,_e);continue}lt&&(mt=Fo(mt,Ce," "),mt=Fo(mt,J," "),mt=Fo(mt,z," "));const Ei=Tt(_e.nodeName);if(Qt(Ei,Jt,mt)){if(X&&(Jt==="id"||Jt==="name")&&(wt(Xi,_e),mt=ne+mt),I&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!lr)switch(v.getAttributeType(Ei,Jt)){case"TrustedHTML":{mt=I.createHTML(mt);break}case"TrustedScriptURL":{mt=I.createScriptURL(mt);break}}try{lr?_e.setAttributeNS(lr,Xi,mt):_e.setAttribute(Xi,mt),Vp(t.removed)}catch{}}}Ii("afterSanitizeAttributes",_e,null)},pn=function Ct(_e){let je;const mt=Et(_e);for(Ii("beforeSanitizeShadowDOM",_e,null);je=mt.nextNode();)Ii("uponSanitizeShadowNode",je,null),!Gi(je)&&(je.content instanceof o&&Ct(je.content),Nn(je));Ii("afterSanitizeShadowDOM",_e,null)};return t.sanitize=function(Ct){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je,mt,Jt,Mi;if(ke=!Ct,ke&&(Ct="<!-->"),typeof Ct!="string"&&!Zt(Ct))if(typeof Ct.toString=="function"){if(Ct=Ct.toString(),typeof Ct!="string")throw $a("dirty is not a string, aborting")}else throw $a("toString is not a function");if(!t.isSupported)return Ct;if(it||Li(_e),t.removed=[],typeof Ct=="string"&&(Ue=!1),Ue){if(Ct.nodeName){const Xi=Tt(Ct.nodeName);if(!ye[Xi]||ze[Xi])throw $a("root node is forbidden and cannot be sanitized in-place")}}else if(Ct instanceof l)je=Bt("<!---->"),mt=je.ownerDocument.importNode(Ct,!0),mt.nodeType===1&&mt.nodeName==="BODY"||mt.nodeName==="HTML"?je=mt:je.appendChild(mt);else{if(!R&&!lt&&!Ie&&Ct.indexOf("<")===-1)return I&&ge?I.createHTML(Ct):Ct;if(je=Bt(Ct),!je)return R?null:ge?k:""}je&&et&&ht(je.firstChild);const mn=Et(Ue?Ct:je);for(;Jt=mn.nextNode();)Gi(Jt)||(Jt.content instanceof o&&pn(Jt.content),Nn(Jt));if(Ue)return Ct;if(R){if(te)for(Mi=V.call(je.ownerDocument);je.firstChild;)Mi.appendChild(je.firstChild);else Mi=je;return(ae.shadowroot||ae.shadowrootmode)&&(Mi=L.call(e,Mi,!0)),Mi}let pi=Ie?je.outerHTML:je.innerHTML;return Ie&&ye["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&Xr(Yp,je.ownerDocument.doctype.name)&&(pi="<!DOCTYPE "+je.ownerDocument.doctype.name+`>
4
+ `+new Error().stack),D=!1}return S.apply(this,arguments)},S)}var L={};function se(g,S){n.deprecationHandler!=null&&n.deprecationHandler(g,S),L[g]||(V(S),L[g]=!0)}function Ce(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function J(g,S){var D,H=m({},g);for(D in S)s(S,D)&&(o(g[D])&&o(S[D])?(H[D]={},m(H[D],g[D]),m(H[D],S[D])):S[D]!=null?H[D]=S[D]:delete H[D]);for(D in g)s(g,D)&&!s(S,D)&&o(g[D])&&(H[D]=m({},H[D]));return H}function z(g){g!=null&&this.set(g)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var P=Object.keys||function(g){var S,D=[];for(S in g)s(g,S)&&D.push(S);return D};function le(g,S,D){var H=""+Math.abs(g);return(0<=g?D?"+":"":"-")+Math.pow(10,Math.max(0,S-H.length)).toString().substr(1)+H}var Ke=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Oe={},ye={};function Re(g,S,D,H){var ee=typeof H=="string"?function(){return this[H]()}:H;g&&(ye[g]=ee),S&&(ye[S[0]]=function(){return le(ee.apply(this,arguments),S[1],S[2])}),D&&(ye[D]=function(){return this.localeData().ordinal(ee.apply(this,arguments),g)})}function ae(g,S){return g.isValid()?(S=he(S,g.localeData()),Oe[S]=Oe[S]||function(D){for(var H,ee=D.match(Ke),xe=0,Ve=ee.length;xe<Ve;xe++)ye[ee[xe]]?ee[xe]=ye[ee[xe]]:ee[xe]=(H=ee[xe]).match(/\[[\s\S]/)?H.replace(/^\[|\]$/g,""):H.replace(/\\/g,"");return function(qe){for(var yt="",ft=0;ft<Ve;ft++)yt+=Ce(ee[ft])?ee[ft].call(qe,D):ee[ft];return yt}}(S),Oe[S](g)):g.localeData().invalidDate()}function he(g,S){var D=5;function H(ee){return S.longDateFormat(ee)||ee}for(Pe.lastIndex=0;0<=D&&Pe.test(g);)g=g.replace(Pe,H),Pe.lastIndex=0,--D;return g}var Ne={};function ze(g,S){var D=g.toLowerCase();Ne[D]=Ne[D+"s"]=Ne[S]=g}function Be(g){return typeof g=="string"?Ne[g]||Ne[g.toLowerCase()]:void 0}function de(g){var S,D,H={};for(D in g)s(g,D)&&(S=Be(D))&&(H[S]=g[D]);return H}var Ee={};function ve(g,S){Ee[g]=S}function He(g){return g%4==0&&g%100!=0||g%400==0}function lt(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ie(S){var S=+S,D=0;return D=S!=0&&isFinite(S)?lt(S):D}function it(g,S){return function(D){return D!=null?(R(this,g,D),n.updateOffset(this,S),this):et(this,g)}}function et(g,S){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+S]():NaN}function R(g,S,D){g.isValid()&&!isNaN(D)&&(S==="FullYear"&&He(g.year())&&g.month()===1&&g.date()===29?(D=Ie(D),g._d["set"+(g._isUTC?"UTC":"")+S](D,g.month(),Li(D,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+S](D))}var te=/\d/,Mt=/\d\d/,ge=/\d{3}/,qi=/\d{4}/,on=/[+-]?\d{6}/,$=/\d\d?/,X=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,Me=/\d{1,3}/,Yn=/\d{1,4}/,Tr=/[+-]?\d{1,6}/,Ue=/\d+/,Se=/[+-]?\d+/,Ye=/Z|[+-]\d\d:?\d\d/gi,pt=/Z|[+-]\d\d(?::?\d\d)?/gi,Ge=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Le(g,S,D){yi[g]=Ce(S)?S:function(H,ee){return H&&D?D:S}}function Xt(g,S){return s(yi,g)?yi[g](S._strict,S._locale):new RegExp(It(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(D,H,ee,xe,Ve){return H||ee||xe||Ve})))}function It(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var yi={},q={};function W(g,S){var D,H,ee=S;for(typeof g=="string"&&(g=[g]),p(S)&&(ee=function(xe,Ve){Ve[S]=Ie(xe)}),H=g.length,D=0;D<H;D++)q[g[D]]=ee}function pe(g,S){W(g,function(D,H,ee,xe){ee._w=ee._w||{},S(D,ee._w,ee,xe)})}var ke,at=0,ot=1,ct=2,Rt=3,Ht=4,Tt=5,Ut=6,Kt=7,Ni=8;function Li(g,S){if(isNaN(g)||isNaN(S))return NaN;var D=(S%(D=12)+D)%D;return g+=(S-D)/12,D==1?He(g)?29:28:31-D%7%2}ke=Array.prototype.indexOf||function(g){for(var S=0;S<this.length;++S)if(this[S]===g)return S;return-1},Re("M",["MM",2],"Mo",function(){return this.month()+1}),Re("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)}),Re("MMMM",0,0,function(g){return this.localeData().months(this,g)}),ze("month","M"),ve("month",8),Le("M",$),Le("MM",$,Mt),Le("MMM",function(g,S){return S.monthsShortRegex(g)}),Le("MMMM",function(g,S){return S.monthsRegex(g)}),W(["M","MM"],function(g,S){S[ot]=Ie(g)-1}),W(["MMM","MMMM"],function(g,S,D,H){H=D._locale.monthsParse(g,H,D._strict),H!=null?S[ot]=H:_(D).invalidMonth=g});var U="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Z="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ce=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,we=Ge,st=Ge;function vt(g,S){var D;if(g.isValid()){if(typeof S=="string"){if(/^\d+$/.test(S))S=Ie(S);else if(!p(S=g.localeData().monthsParse(S)))return}D=Math.min(g.date(),Li(g.year(),S)),g._d["set"+(g._isUTC?"UTC":"")+"Month"](S,D)}}function ht(g){return g!=null?(vt(this,g),n.updateOffset(this,!0),this):et(this,"Month")}function wt(){function g(Ve,qe){return qe.length-Ve.length}for(var S,D=[],H=[],ee=[],xe=0;xe<12;xe++)S=v([2e3,xe]),D.push(this.monthsShort(S,"")),H.push(this.months(S,"")),ee.push(this.months(S,"")),ee.push(this.monthsShort(S,""));for(D.sort(g),H.sort(g),ee.sort(g),xe=0;xe<12;xe++)D[xe]=It(D[xe]),H[xe]=It(H[xe]);for(xe=0;xe<24;xe++)ee[xe]=It(ee[xe]);this._monthsRegex=new RegExp("^("+ee.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+H.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+D.join("|")+")","i")}function Bt(g){return He(g)?366:365}Re("Y",0,0,function(){var g=this.year();return g<=9999?le(g,4):"+"+g}),Re(0,["YY",2],0,function(){return this.year()%100}),Re(0,["YYYY",4],0,"year"),Re(0,["YYYYY",5],0,"year"),Re(0,["YYYYYY",6,!0],0,"year"),ze("year","y"),ve("year",1),Le("Y",Se),Le("YY",$,Mt),Le("YYYY",Yn,qi),Le("YYYYY",Tr,on),Le("YYYYYY",Tr,on),W(["YYYYY","YYYYYY"],at),W("YYYY",function(g,S){S[at]=g.length===2?n.parseTwoDigitYear(g):Ie(g)}),W("YY",function(g,S){S[at]=n.parseTwoDigitYear(g)}),W("Y",function(g,S){S[at]=parseInt(g,10)}),n.parseTwoDigitYear=function(g){return Ie(g)+(68<Ie(g)?1900:2e3)};var xo=it("FullYear",!0);function Et(g,S,D,H,ee,xe,Ve){var qe;return g<100&&0<=g?(qe=new Date(g+400,S,D,H,ee,xe,Ve),isFinite(qe.getFullYear())&&qe.setFullYear(g)):qe=new Date(g,S,D,H,ee,xe,Ve),qe}function _t(g){var S;return g<100&&0<=g?((S=Array.prototype.slice.call(arguments))[0]=g+400,S=new Date(Date.UTC.apply(null,S)),isFinite(S.getUTCFullYear())&&S.setUTCFullYear(g)):S=new Date(Date.UTC.apply(null,arguments)),S}function Zt(g,S,D){return D=7+S-D,D-(7+_t(g,0,D).getUTCDay()-S)%7-1}function Ii(g,Ve,qe,H,ee){var xe,Ve=1+7*(Ve-1)+(7+qe-H)%7+Zt(g,H,ee),qe=Ve<=0?Bt(xe=g-1)+Ve:Ve>Bt(g)?(xe=g+1,Ve-Bt(g)):(xe=g,Ve);return{year:xe,dayOfYear:qe}}function Gi(g,S,D){var H,ee,xe=Zt(g.year(),S,D),xe=Math.floor((g.dayOfYear()-xe-1)/7)+1;return xe<1?H=xe+Qt(ee=g.year()-1,S,D):xe>Qt(g.year(),S,D)?(H=xe-Qt(g.year(),S,D),ee=g.year()+1):(ee=g.year(),H=xe),{week:H,year:ee}}function Qt(g,ee,D){var H=Zt(g,ee,D),ee=Zt(g+1,ee,D);return(Bt(g)-H+ee)/7}Re("w",["ww",2],"wo","week"),Re("W",["WW",2],"Wo","isoWeek"),ze("week","w"),ze("isoWeek","W"),ve("week",5),ve("isoWeek",5),Le("w",$),Le("ww",$,Mt),Le("W",$),Le("WW",$,Mt),pe(["w","ww","W","WW"],function(g,S,D,H){S[H.substr(0,1)]=Ie(g)});function Hi(g,S){return g.slice(S,7).concat(g.slice(0,S))}Re("d",0,"do","day"),Re("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),Re("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),Re("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),Re("e",0,0,"weekday"),Re("E",0,0,"isoWeekday"),ze("day","d"),ze("weekday","e"),ze("isoWeekday","E"),ve("day",11),ve("weekday",11),ve("isoWeekday",11),Le("d",$),Le("e",$),Le("E",$),Le("dd",function(g,S){return S.weekdaysMinRegex(g)}),Le("ddd",function(g,S){return S.weekdaysShortRegex(g)}),Le("dddd",function(g,S){return S.weekdaysRegex(g)}),pe(["dd","ddd","dddd"],function(g,S,D,H){H=D._locale.weekdaysParse(g,H,D._strict),H!=null?S.d=H:_(D).invalidWeekday=g}),pe(["d","e","E"],function(g,S,D,H){S[H]=Ie(g)});var Nn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),pn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ct="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_e=Ge,je=Ge,mt=Ge;function Jt(){function g(ft,zt){return zt.length-ft.length}for(var S,D,H,ee=[],xe=[],Ve=[],qe=[],yt=0;yt<7;yt++)H=v([2e3,1]).day(yt),S=It(this.weekdaysMin(H,"")),D=It(this.weekdaysShort(H,"")),H=It(this.weekdays(H,"")),ee.push(S),xe.push(D),Ve.push(H),qe.push(S),qe.push(D),qe.push(H);ee.sort(g),xe.sort(g),Ve.sort(g),qe.sort(g),this._weekdaysRegex=new RegExp("^("+qe.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+Ve.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+xe.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+ee.join("|")+")","i")}function Mi(){return this.hours()%12||12}function mn(g,S){Re(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),S)})}function pi(g,S){return S._meridiemParse}Re("H",["HH",2],0,"hour"),Re("h",["hh",2],0,Mi),Re("k",["kk",2],0,function(){return this.hours()||24}),Re("hmm",0,0,function(){return""+Mi.apply(this)+le(this.minutes(),2)}),Re("hmmss",0,0,function(){return""+Mi.apply(this)+le(this.minutes(),2)+le(this.seconds(),2)}),Re("Hmm",0,0,function(){return""+this.hours()+le(this.minutes(),2)}),Re("Hmmss",0,0,function(){return""+this.hours()+le(this.minutes(),2)+le(this.seconds(),2)}),mn("a",!0),mn("A",!1),ze("hour","h"),ve("hour",13),Le("a",pi),Le("A",pi),Le("H",$),Le("h",$),Le("k",$),Le("HH",$,Mt),Le("hh",$,Mt),Le("kk",$,Mt),Le("hmm",X),Le("hmmss",ne),Le("Hmm",X),Le("Hmmss",ne),W(["H","HH"],Rt),W(["k","kk"],function(g,S,D){g=Ie(g),S[Rt]=g===24?0:g}),W(["a","A"],function(g,S,D){D._isPm=D._locale.isPM(g),D._meridiem=g}),W(["h","hh"],function(g,S,D){S[Rt]=Ie(g),_(D).bigHour=!0}),W("hmm",function(g,S,D){var H=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H)),_(D).bigHour=!0}),W("hmmss",function(g,S,D){var H=g.length-4,ee=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H,2)),S[Tt]=Ie(g.substr(ee)),_(D).bigHour=!0}),W("Hmm",function(g,S,D){var H=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H))}),W("Hmmss",function(g,S,D){var H=g.length-4,ee=g.length-2;S[Rt]=Ie(g.substr(0,H)),S[Ht]=Ie(g.substr(H,2)),S[Tt]=Ie(g.substr(ee))}),Ge=it("Hours",!0);var Xi,lr={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:U,monthsShort:Z,week:{dow:0,doy:6},weekdays:Nn,weekdaysMin:Ct,weekdaysShort:pn,meridiemParse:/[ap]\.?m?\.?/i},Ei={},nn={};function Lr(g){return g&&g.toLowerCase().replace("_","-")}function go(g){for(var S,D,H,ee,xe=0;xe<g.length;){for(S=(ee=Lr(g[xe]).split("-")).length,D=(D=Lr(g[xe+1]))?D.split("-"):null;0<S;){if(H=Zn(ee.slice(0,S).join("-")))return H;if(D&&D.length>=S&&function(Ve,qe){for(var yt=Math.min(Ve.length,qe.length),ft=0;ft<yt;ft+=1)if(Ve[ft]!==qe[ft])return ft;return yt}(ee,D)>=S-1)break;S--}xe++}return Xi}function Zn(g){var S;if(Ei[g]===void 0&&a&&a.exports&&g.match("^[^/\\\\]*$")!=null)try{S=Xi._abbr,La("./locale/"+g),Qn(S)}catch{Ei[g]=null}return Ei[g]}function Qn(g,S){return g&&((S=u(S)?mr(g):_o(g,S))?Xi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),Xi._abbr}function _o(g,S){if(S===null)return delete Ei[g],null;var D,H=lr;if(S.abbr=g,Ei[g]!=null)se("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),H=Ei[g]._config;else if(S.parentLocale!=null)if(Ei[S.parentLocale]!=null)H=Ei[S.parentLocale]._config;else{if((D=Zn(S.parentLocale))==null)return nn[S.parentLocale]||(nn[S.parentLocale]=[]),nn[S.parentLocale].push({name:g,config:S}),null;H=D._config}return Ei[g]=new z(J(H,S)),nn[g]&&nn[g].forEach(function(ee){_o(ee.name,ee.config)}),Qn(g),Ei[g]}function mr(g){var S;if(!(g=g&&g._locale&&g._locale._abbr?g._locale._abbr:g))return Xi;if(!r(g)){if(S=Zn(g))return S;g=[g]}return go(g)}function ar(g){var S=g._a;return S&&_(g).overflow===-2&&(S=S[ot]<0||11<S[ot]?ot:S[ct]<1||S[ct]>Li(S[at],S[ot])?ct:S[Rt]<0||24<S[Rt]||S[Rt]===24&&(S[Ht]!==0||S[Tt]!==0||S[Ut]!==0)?Rt:S[Ht]<0||59<S[Ht]?Ht:S[Tt]<0||59<S[Tt]?Tt:S[Ut]<0||999<S[Ut]?Ut:-1,_(g)._overflowDayOfYear&&(S<at||ct<S)&&(S=ct),_(g)._overflowWeeks&&S===-1&&(S=Kt),_(g)._overflowWeekday&&S===-1&&(S=Ni),_(g).overflow=S),g}var xr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,zn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ln=/Z|[+-]\d\d(?::?\d\d)?/,ci=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Hn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Jr=/^\/?Date\((-?\d+)/i,bo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Jn(g){var S,D,H,ee,xe,Ve,yt=g._i,qe=xr.exec(yt)||zn.exec(yt),yt=ci.length,ft=Hn.length;if(qe){for(_(g).iso=!0,S=0,D=yt;S<D;S++)if(ci[S][1].exec(qe[1])){ee=ci[S][0],H=ci[S][2]!==!1;break}if(ee==null)g._isValid=!1;else{if(qe[3]){for(S=0,D=ft;S<D;S++)if(Hn[S][1].exec(qe[3])){xe=(qe[2]||" ")+Hn[S][0];break}if(xe==null)return void(g._isValid=!1)}if(H||xe==null){if(qe[4]){if(!Ln.exec(qe[4]))return void(g._isValid=!1);Ve="Z"}g._f=ee+(xe||"")+(Ve||""),be(g)}else g._isValid=!1}}else g._isValid=!1}function vr(g,S,D,H,ee,xe){return g=[function(Ve){Ve=parseInt(Ve,10);{if(Ve<=49)return 2e3+Ve;if(Ve<=999)return 1900+Ve}return Ve}(g),Z.indexOf(S),parseInt(D,10),parseInt(H,10),parseInt(ee,10)],xe&&g.push(parseInt(xe,10)),g}function gr(g){var S,D,H,ee,xe=bo.exec(g._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));xe?(S=vr(xe[4],xe[3],xe[2],xe[5],xe[6],xe[7]),D=xe[1],H=S,ee=g,D&&pn.indexOf(D)!==new Date(H[0],H[1],H[2]).getDay()?(_(ee).weekdayMismatch=!0,ee._isValid=!1):(g._a=S,g._tzm=(D=xe[8],H=xe[9],ee=xe[10],D?vn[D]:H?0:60*(((D=parseInt(ee,10))-(H=D%100))/100)+H),g._d=_t.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),_(g).rfc2822=!0)):g._isValid=!1}function re(g,S,D){return g??S??D}function ue(g){var S,D,H,ee,xe,Ve,qe,yt,ft,zt,Nt,Ki=[];if(!g._d){for(H=g,ee=new Date(n.now()),D=H._useUTC?[ee.getUTCFullYear(),ee.getUTCMonth(),ee.getUTCDate()]:[ee.getFullYear(),ee.getMonth(),ee.getDate()],g._w&&g._a[ct]==null&&g._a[ot]==null&&((ee=(H=g)._w).GG!=null||ee.W!=null||ee.E!=null?(yt=1,ft=4,xe=re(ee.GG,H._a[at],Gi(dt(),1,4).year),Ve=re(ee.W,1),((qe=re(ee.E,1))<1||7<qe)&&(zt=!0)):(yt=H._locale._week.dow,ft=H._locale._week.doy,Nt=Gi(dt(),yt,ft),xe=re(ee.gg,H._a[at],Nt.year),Ve=re(ee.w,Nt.week),ee.d!=null?((qe=ee.d)<0||6<qe)&&(zt=!0):ee.e!=null?(qe=ee.e+yt,(ee.e<0||6<ee.e)&&(zt=!0)):qe=yt),Ve<1||Ve>Qt(xe,yt,ft)?_(H)._overflowWeeks=!0:zt!=null?_(H)._overflowWeekday=!0:(Nt=Ii(xe,Ve,qe,yt,ft),H._a[at]=Nt.year,H._dayOfYear=Nt.dayOfYear)),g._dayOfYear!=null&&(ee=re(g._a[at],D[at]),(g._dayOfYear>Bt(ee)||g._dayOfYear===0)&&(_(g)._overflowDayOfYear=!0),zt=_t(ee,0,g._dayOfYear),g._a[ot]=zt.getUTCMonth(),g._a[ct]=zt.getUTCDate()),S=0;S<3&&g._a[S]==null;++S)g._a[S]=Ki[S]=D[S];for(;S<7;S++)g._a[S]=Ki[S]=g._a[S]==null?S===2?1:0:g._a[S];g._a[Rt]===24&&g._a[Ht]===0&&g._a[Tt]===0&&g._a[Ut]===0&&(g._nextDay=!0,g._a[Rt]=0),g._d=(g._useUTC?_t:Et).apply(null,Ki),xe=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[Rt]=24),g._w&&g._w.d!==void 0&&g._w.d!==xe&&(_(g).weekdayMismatch=!0)}}function be(g){if(g._f===n.ISO_8601)Jn(g);else if(g._f===n.RFC_2822)gr(g);else{g._a=[],_(g).empty=!0;for(var S,D,H,ee,xe,Ve=""+g._i,qe=Ve.length,yt=0,ft=he(g._f,g._locale).match(Ke)||[],zt=ft.length,Nt=0;Nt<zt;Nt++)D=ft[Nt],(S=(Ve.match(Xt(D,g))||[])[0])&&(0<(H=Ve.substr(0,Ve.indexOf(S))).length&&_(g).unusedInput.push(H),Ve=Ve.slice(Ve.indexOf(S)+S.length),yt+=S.length),ye[D]?(S?_(g).empty=!1:_(g).unusedTokens.push(D),H=D,xe=g,(ee=S)!=null&&s(q,H)&&q[H](ee,xe._a,xe,H)):g._strict&&!S&&_(g).unusedTokens.push(D);_(g).charsLeftOver=qe-yt,0<Ve.length&&_(g).unusedInput.push(Ve),g._a[Rt]<=12&&_(g).bigHour===!0&&0<g._a[Rt]&&(_(g).bigHour=void 0),_(g).parsedDateParts=g._a.slice(0),_(g).meridiem=g._meridiem,g._a[Rt]=function(Ki,ln,Zi){return Zi==null?ln:Ki.meridiemHour!=null?Ki.meridiemHour(ln,Zi):Ki.isPM!=null?((Ki=Ki.isPM(Zi))&&ln<12&&(ln+=12),ln=Ki||ln!==12?ln:0):ln}(g._locale,g._a[Rt],g._meridiem),(qe=_(g).era)!==null&&(g._a[at]=g._locale.erasConvertYear(qe,g._a[at])),ue(g),ar(g)}}function We(g){var S,D,H,ee=g._i,xe=g._f;return g._locale=g._locale||mr(g._l),ee===null||xe===void 0&&ee===""?x({nullInput:!0}):(typeof ee=="string"&&(g._i=ee=g._locale.preparse(ee)),N(ee)?new F(ar(ee)):(c(ee)?g._d=ee:r(xe)?function(Ve){var qe,yt,ft,zt,Nt,Ki,ln=!1,Zi=Ve._f.length;if(Zi===0)return _(Ve).invalidFormat=!0,Ve._d=new Date(NaN);for(zt=0;zt<Zi;zt++)Nt=0,Ki=!1,qe=k({},Ve),Ve._useUTC!=null&&(qe._useUTC=Ve._useUTC),qe._f=Ve._f[zt],be(qe),C(qe)&&(Ki=!0),Nt=(Nt+=_(qe).charsLeftOver)+10*_(qe).unusedTokens.length,_(qe).score=Nt,ln?Nt<ft&&(ft=Nt,yt=qe):(ft==null||Nt<ft||Ki)&&(ft=Nt,yt=qe,Ki&&(ln=!0));m(Ve,yt||qe)}(g):xe?be(g):u(xe=(ee=g)._i)?ee._d=new Date(n.now()):c(xe)?ee._d=new Date(xe.valueOf()):typeof xe=="string"?(D=ee,(S=Jr.exec(D._i))!==null?D._d=new Date(+S[1]):(Jn(D),D._isValid===!1&&(delete D._isValid,gr(D),D._isValid===!1&&(delete D._isValid,D._strict?D._isValid=!1:n.createFromInputFallback(D))))):r(xe)?(ee._a=f(xe.slice(0),function(Ve){return parseInt(Ve,10)}),ue(ee)):o(xe)?(S=ee)._d||(H=(D=de(S._i)).day===void 0?D.date:D.day,S._a=f([D.year,D.month,H,D.hour,D.minute,D.second,D.millisecond],function(Ve){return Ve&&parseInt(Ve,10)}),ue(S)):p(xe)?ee._d=new Date(xe):n.createFromInputFallback(ee),C(g)||(g._d=null),g))}function Je(g,S,D,H,ee){var xe={};return S!==!0&&S!==!1||(H=S,S=void 0),D!==!0&&D!==!1||(H=D,D=void 0),(o(g)&&l(g)||r(g)&&g.length===0)&&(g=void 0),xe._isAMomentObject=!0,xe._useUTC=xe._isUTC=ee,xe._l=D,xe._i=g,xe._f=S,xe._strict=H,(ee=new F(ar(We(ee=xe))))._nextDay&&(ee.add(1,"d"),ee._nextDay=void 0),ee}function dt(g,S,D,H){return Je(g,S,D,H,!1)}n.createFromInputFallback=Q("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(g){g._d=new Date(g._i+(g._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){},X=Q("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=dt.apply(null,arguments);return this.isValid()&&g.isValid()?g<this?this:g:x()}),ne=Q("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=dt.apply(null,arguments);return this.isValid()&&g.isValid()?this<g?this:g:x()});function Ot(g,S){var D,H;if(!(S=S.length===1&&r(S[0])?S[0]:S).length)return dt();for(D=S[0],H=1;H<S.length;++H)S[H].isValid()&&!S[H][g](D)||(D=S[H]);return D}var Vt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hi(S){var S=de(S),D=S.year||0,H=S.quarter||0,ee=S.month||0,xe=S.week||S.isoWeek||0,Ve=S.day||0,qe=S.hour||0,yt=S.minute||0,ft=S.second||0,zt=S.millisecond||0;this._isValid=function(Nt){var Ki,ln,Zi=!1,rs=Vt.length;for(Ki in Nt)if(s(Nt,Ki)&&(ke.call(Vt,Ki)===-1||Nt[Ki]!=null&&isNaN(Nt[Ki])))return!1;for(ln=0;ln<rs;++ln)if(Nt[Vt[ln]]){if(Zi)return!1;parseFloat(Nt[Vt[ln]])!==Ie(Nt[Vt[ln]])&&(Zi=!0)}return!0}(S),this._milliseconds=+zt+1e3*ft+6e4*yt+1e3*qe*60*60,this._days=+Ve+7*xe,this._months=+ee+3*H+12*D,this._data={},this._locale=mr(),this._bubble()}function Si(g){return g instanceof hi}function wi(g){return g<0?-1*Math.round(-1*g):Math.round(g)}function yn(g,S){Re(g,0,0,function(){var D=this.utcOffset(),H="+";return D<0&&(D=-D,H="-"),H+le(~~(D/60),2)+S+le(~~D%60,2)})}yn("Z",":"),yn("ZZ",""),Le("Z",pt),Le("ZZ",pt),W(["Z","ZZ"],function(g,S,D){D._useUTC=!0,D._tzm=Gn(pt,g)});var Un=/([\+\-]|\d\d)/gi;function Gn(g,D){var D=(D||"").match(g);return D===null?null:(D=60*(g=((D[D.length-1]||[])+"").match(Un)||["-",0,0])[1]+Ie(g[2]))===0?0:g[0]==="+"?D:-D}function Wn(g,S){var D;return S._isUTC?(S=S.clone(),D=(N(g)||c(g)?g:dt(g)).valueOf()-S.valueOf(),S._d.setTime(S._d.valueOf()+D),n.updateOffset(S,!1),S):dt(g).local()}function eo(g){return-Math.round(g._d.getTimezoneOffset())}function _r(){return!!this.isValid()&&this._isUTC&&this._offset===0}n.updateOffset=function(){};var Co=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Bi=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ai(g,S){var D,H=g,ee=null;return Si(g)?H={ms:g._milliseconds,d:g._days,M:g._months}:p(g)||!isNaN(+g)?(H={},S?H[S]=+g:H.milliseconds=+g):(ee=Co.exec(g))?(D=ee[1]==="-"?-1:1,H={y:0,d:Ie(ee[ct])*D,h:Ie(ee[Rt])*D,m:Ie(ee[Ht])*D,s:Ie(ee[Tt])*D,ms:Ie(wi(1e3*ee[Ut]))*D}):(ee=Bi.exec(g))?(D=ee[1]==="-"?-1:1,H={y:Hr(ee[2],D),M:Hr(ee[3],D),w:Hr(ee[4],D),d:Hr(ee[5],D),h:Hr(ee[6],D),m:Hr(ee[7],D),s:Hr(ee[8],D)}):H==null?H={}:typeof H=="object"&&("from"in H||"to"in H)&&(S=function(xe,Ve){var qe;return!xe.isValid()||!Ve.isValid()?{milliseconds:0,months:0}:(Ve=Wn(Ve,xe),xe.isBefore(Ve)?qe=Ss(xe,Ve):((qe=Ss(Ve,xe)).milliseconds=-qe.milliseconds,qe.months=-qe.months),qe)}(dt(H.from),dt(H.to)),(H={}).ms=S.milliseconds,H.M=S.months),ee=new hi(H),Si(g)&&s(g,"_locale")&&(ee._locale=g._locale),Si(g)&&s(g,"_isValid")&&(ee._isValid=g._isValid),ee}function Hr(g,S){return g=g&&parseFloat(g.replace(",",".")),(isNaN(g)?0:g)*S}function Ss(g,S){var D={};return D.months=S.month()-g.month()+12*(S.year()-g.year()),g.clone().add(D.months,"M").isAfter(S)&&--D.months,D.milliseconds=+S-+g.clone().add(D.months,"M"),D}function yo(g,S){return function(D,H){var ee;return H===null||isNaN(+H)||(se(S,"moment()."+S+"(period, number) is deprecated. Please use moment()."+S+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),ee=D,D=H,H=ee),Js(this,Ai(D,H),g),this}}function Js(g,Ve,D,H){var ee=Ve._milliseconds,xe=wi(Ve._days),Ve=wi(Ve._months);g.isValid()&&(H=H==null||H,Ve&&vt(g,et(g,"Month")+Ve*D),xe&&R(g,"Date",et(g,"Date")+xe*D),ee&&g._d.setTime(g._d.valueOf()+ee*D),H&&n.updateOffset(g,xe||Ve))}Ai.fn=hi.prototype,Ai.invalid=function(){return Ai(NaN)},U=yo(1,"add"),Nn=yo(-1,"subtract");function ws(g){return typeof g=="string"||g instanceof String}function fa(g){return N(g)||c(g)||ws(g)||p(g)||function(S){var D=r(S),H=!1;return D&&(H=S.filter(function(ee){return!p(ee)&&ws(S)}).length===0),D&&H}(g)||function(S){var D,H,ee=o(S)&&!l(S),xe=!1,Ve=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],qe=Ve.length;for(D=0;D<qe;D+=1)H=Ve[D],xe=xe||s(S,H);return ee&&xe}(g)||g==null}function ts(g,ee){if(g.date()<ee.date())return-ts(ee,g);var D=12*(ee.year()-g.year())+(ee.month()-g.month()),H=g.clone().add(D,"months"),ee=ee-H<0?(ee-H)/(H-g.clone().add(D-1,"months")):(ee-H)/(g.clone().add(1+D,"months")-H);return-(D+ee)||0}function xs(g){return g===void 0?this._locale._abbr:((g=mr(g))!=null&&(this._locale=g),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",Ct=Q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function Di(){return this._locale}var _i=126227808e5;function Eo(g,S){return(g%S+S)%S}function So(g,S,D){return g<100&&0<=g?new Date(g+400,S,D)-_i:new Date(g,S,D).valueOf()}function Ts(g,S,D){return g<100&&0<=g?Date.UTC(g+400,S,D)-_i:Date.UTC(g,S,D)}function Dl(g,S){return S.erasAbbrRegex(g)}function el(){for(var g=[],S=[],D=[],H=[],ee=this.eras(),xe=0,Ve=ee.length;xe<Ve;++xe)S.push(It(ee[xe].name)),g.push(It(ee[xe].abbr)),D.push(It(ee[xe].narrow)),H.push(It(ee[xe].name)),H.push(It(ee[xe].abbr)),H.push(It(ee[xe].narrow));this._erasRegex=new RegExp("^("+H.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+S.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+g.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+D.join("|")+")","i")}function is(g,S){Re(0,[g,g.length],0,S)}function Os(g,S,D,H,ee){var xe;return g==null?Gi(this,H,ee).year:(xe=Qt(g,H,ee),(function(Ve,qe,yt,ft,zt){return Ve=Ii(Ve,qe,yt,ft,zt),qe=_t(Ve.year,0,Ve.dayOfYear),this.year(qe.getUTCFullYear()),this.month(qe.getUTCMonth()),this.date(qe.getUTCDate()),this}).call(this,g,S=xe<S?xe:S,D,H,ee))}Re("N",0,0,"eraAbbr"),Re("NN",0,0,"eraAbbr"),Re("NNN",0,0,"eraAbbr"),Re("NNNN",0,0,"eraName"),Re("NNNNN",0,0,"eraNarrow"),Re("y",["y",1],"yo","eraYear"),Re("y",["yy",2],0,"eraYear"),Re("y",["yyy",3],0,"eraYear"),Re("y",["yyyy",4],0,"eraYear"),Le("N",Dl),Le("NN",Dl),Le("NNN",Dl),Le("NNNN",function(g,S){return S.erasNameRegex(g)}),Le("NNNNN",function(g,S){return S.erasNarrowRegex(g)}),W(["N","NN","NNN","NNNN","NNNNN"],function(g,S,D,H){H=D._locale.erasParse(g,H,D._strict),H?_(D).era=H:_(D).invalidEra=g}),Le("y",Ue),Le("yy",Ue),Le("yyy",Ue),Le("yyyy",Ue),Le("yo",function(g,S){return S._eraYearOrdinalRegex||Ue}),W(["y","yy","yyy","yyyy"],at),W(["yo"],function(g,S,D,H){var ee;D._locale._eraYearOrdinalRegex&&(ee=g.match(D._locale._eraYearOrdinalRegex)),D._locale.eraYearOrdinalParse?S[at]=D._locale.eraYearOrdinalParse(g,ee):S[at]=parseInt(g,10)}),Re(0,["gg",2],0,function(){return this.weekYear()%100}),Re(0,["GG",2],0,function(){return this.isoWeekYear()%100}),is("gggg","weekYear"),is("ggggg","weekYear"),is("GGGG","isoWeekYear"),is("GGGGG","isoWeekYear"),ze("weekYear","gg"),ze("isoWeekYear","GG"),ve("weekYear",1),ve("isoWeekYear",1),Le("G",Se),Le("g",Se),Le("GG",$,Mt),Le("gg",$,Mt),Le("GGGG",Yn,qi),Le("gggg",Yn,qi),Le("GGGGG",Tr,on),Le("ggggg",Tr,on),pe(["gggg","ggggg","GGGG","GGGGG"],function(g,S,D,H){S[H.substr(0,2)]=Ie(g)}),pe(["gg","GG"],function(g,S,D,H){S[H]=n.parseTwoDigitYear(g)}),Re("Q",0,"Qo","quarter"),ze("quarter","Q"),ve("quarter",7),Le("Q",te),W("Q",function(g,S){S[ot]=3*(Ie(g)-1)}),Re("D",["DD",2],"Do","date"),ze("date","D"),ve("date",9),Le("D",$),Le("DD",$,Mt),Le("Do",function(g,S){return g?S._dayOfMonthOrdinalParse||S._ordinalParse:S._dayOfMonthOrdinalParseLenient}),W(["D","DD"],ct),W("Do",function(g,S){S[ct]=Ie(g.match($)[0])}),Yn=it("Date",!0),Re("DDD",["DDDD",3],"DDDo","dayOfYear"),ze("dayOfYear","DDD"),ve("dayOfYear",4),Le("DDD",Me),Le("DDDD",ge),W(["DDD","DDDD"],function(g,S,D){D._dayOfYear=Ie(g)}),Re("m",["mm",2],0,"minute"),ze("minute","m"),ve("minute",14),Le("m",$),Le("mm",$,Mt),W(["m","mm"],Ht);var At,qi=it("Minutes",!1),Tr=(Re("s",["ss",2],0,"second"),ze("second","s"),ve("second",15),Le("s",$),Le("ss",$,Mt),W(["s","ss"],Tt),it("Seconds",!1));for(Re("S",0,0,function(){return~~(this.millisecond()/100)}),Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Re(0,["SSS",3],0,"millisecond"),Re(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Re(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Re(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Re(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Re(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Re(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ze("millisecond","ms"),ve("millisecond",16),Le("S",Me,te),Le("SS",Me,Mt),Le("SSS",Me,ge),At="SSSS";At.length<=9;At+="S")Le(At,Ue);function Ho(g,S){S[Ut]=Ie(1e3*("0."+g))}for(At="S";At.length<=9;At+="S")W(At,Ho);on=it("Milliseconds",!1),Re("z",0,0,"zoneAbbr"),Re("zz",0,0,"zoneName"),te=F.prototype;function Rl(g){return g}te.add=U,te.calendar=function(D,ee){arguments.length===1&&(arguments[0]?fa(arguments[0])?(D=arguments[0],ee=void 0):function(xe){for(var Ve=o(xe)&&!l(xe),qe=!1,yt=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ft=0;ft<yt.length;ft+=1)qe=qe||s(xe,yt[ft]);return Ve&&qe}(arguments[0])&&(ee=arguments[0],D=void 0):ee=D=void 0);var D=D||dt(),H=Wn(D,this).startOf("day"),H=n.calendarFormat(this,H)||"sameElse",ee=ee&&(Ce(ee[H])?ee[H].call(this,D):ee[H]);return this.format(ee||this.localeData().calendar(H,this,dt(D)))},te.clone=function(){return new F(this)},te.diff=function(g,S,D){var H,ee,xe;if(!this.isValid())return NaN;if(!(H=Wn(g,this)).isValid())return NaN;switch(ee=6e4*(H.utcOffset()-this.utcOffset()),S=Be(S)){case"year":xe=ts(this,H)/12;break;case"month":xe=ts(this,H);break;case"quarter":xe=ts(this,H)/3;break;case"second":xe=(this-H)/1e3;break;case"minute":xe=(this-H)/6e4;break;case"hour":xe=(this-H)/36e5;break;case"day":xe=(this-H-ee)/864e5;break;case"week":xe=(this-H-ee)/6048e5;break;default:xe=this-H}return D?xe:lt(xe)},te.endOf=function(g){var S,D;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?Ts:So,g){case"year":S=D(this.year()+1,0,1)-1;break;case"quarter":S=D(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":S=D(this.year(),this.month()+1,1)-1;break;case"week":S=D(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":S=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":S=D(this.year(),this.month(),this.date()+1)-1;break;case"hour":S=this._d.valueOf(),S+=36e5-Eo(S+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":S=this._d.valueOf(),S+=6e4-Eo(S,6e4)-1;break;case"second":S=this._d.valueOf(),S+=1e3-Eo(S,1e3)-1;break}return this._d.setTime(S),n.updateOffset(this,!0),this},te.format=function(g){return g=g||(this.isUtc()?n.defaultFormatUtc:n.defaultFormat),g=ae(this,g),this.localeData().postformat(g)},te.from=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||dt(g).isValid())?Ai({to:this,from:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.fromNow=function(g){return this.from(dt(),g)},te.to=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||dt(g).isValid())?Ai({from:this,to:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.toNow=function(g){return this.to(dt(),g)},te.get=function(g){return Ce(this[g=Be(g)])?this[g]():this},te.invalidAt=function(){return _(this).overflow},te.isAfter=function(g,S){return g=N(g)?g:dt(g),!(!this.isValid()||!g.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()>g.valueOf():g.valueOf()<this.clone().startOf(S).valueOf())},te.isBefore=function(g,S){return g=N(g)?g:dt(g),!(!this.isValid()||!g.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()<g.valueOf():this.clone().endOf(S).valueOf()<g.valueOf())},te.isBetween=function(g,S,D,H){return g=N(g)?g:dt(g),S=N(S)?S:dt(S),!!(this.isValid()&&g.isValid()&&S.isValid())&&((H=H||"()")[0]==="("?this.isAfter(g,D):!this.isBefore(g,D))&&(H[1]===")"?this.isBefore(S,D):!this.isAfter(S,D))},te.isSame=function(D,S){var D=N(D)?D:dt(D);return!(!this.isValid()||!D.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()===D.valueOf():(D=D.valueOf(),this.clone().startOf(S).valueOf()<=D&&D<=this.clone().endOf(S).valueOf()))},te.isSameOrAfter=function(g,S){return this.isSame(g,S)||this.isAfter(g,S)},te.isSameOrBefore=function(g,S){return this.isSame(g,S)||this.isBefore(g,S)},te.isValid=function(){return C(this)},te.lang=Ct,te.locale=xs,te.localeData=Di,te.max=ne,te.min=X,te.parsingFlags=function(){return m({},_(this))},te.set=function(g,S){if(typeof g=="object")for(var D=function(xe){var Ve,qe=[];for(Ve in xe)s(xe,Ve)&&qe.push({unit:Ve,priority:Ee[Ve]});return qe.sort(function(yt,ft){return yt.priority-ft.priority}),qe}(g=de(g)),H=D.length,ee=0;ee<H;ee++)this[D[ee].unit](g[D[ee].unit]);else if(Ce(this[g=Be(g)]))return this[g](S);return this},te.startOf=function(g){var S,D;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(D=this._isUTC?Ts:So,g){case"year":S=D(this.year(),0,1);break;case"quarter":S=D(this.year(),this.month()-this.month()%3,1);break;case"month":S=D(this.year(),this.month(),1);break;case"week":S=D(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":S=D(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":S=D(this.year(),this.month(),this.date());break;case"hour":S=this._d.valueOf(),S-=Eo(S+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":S=this._d.valueOf(),S-=Eo(S,6e4);break;case"second":S=this._d.valueOf(),S-=Eo(S,1e3);break}return this._d.setTime(S),n.updateOffset(this,!0),this},te.subtract=Nn,te.toArray=function(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]},te.toObject=function(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}},te.toDate=function(){return new Date(this.valueOf())},te.toISOString=function(g){if(!this.isValid())return null;var S=(g=g!==!0)?this.clone().utc():this;return S.year()<0||9999<S.year()?ae(S,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ce(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",ae(S,"Z")):ae(S,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},te.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g,S="moment",D="";return this.isLocal()||(S=this.utcOffset()===0?"moment.utc":"moment.parseZone",D="Z"),S="["+S+'("]',g=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(S+g+"-MM-DD[T]HH:mm:ss.SSS"+(D+'[")]'))},typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},te.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},te.eraName=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].name;return""},te.eraNarrow=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].narrow;return""},te.eraAbbr=function(){for(var g,S=this.localeData().eras(),D=0,H=S.length;D<H;++D)if(g=this.clone().startOf("day").valueOf(),S[D].since<=g&&g<=S[D].until||S[D].until<=g&&g<=S[D].since)return S[D].abbr;return""},te.eraYear=function(){for(var g,S,D=this.localeData().eras(),H=0,ee=D.length;H<ee;++H)if(g=D[H].since<=D[H].until?1:-1,S=this.clone().startOf("day").valueOf(),D[H].since<=S&&S<=D[H].until||D[H].until<=S&&S<=D[H].since)return(this.year()-n(D[H].since).year())*g+D[H].offset;return this.year()},te.year=xo,te.isLeapYear=function(){return He(this.year())},te.weekYear=function(g){return Os.call(this,g,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},te.isoWeekYear=function(g){return Os.call(this,g,this.isoWeek(),this.isoWeekday(),1,4)},te.quarter=te.quarters=function(g){return g==null?Math.ceil((this.month()+1)/3):this.month(3*(g-1)+this.month()%3)},te.month=ht,te.daysInMonth=function(){return Li(this.year(),this.month())},te.week=te.weeks=function(g){var S=this.localeData().week(this);return g==null?S:this.add(7*(g-S),"d")},te.isoWeek=te.isoWeeks=function(g){var S=Gi(this,1,4).week;return g==null?S:this.add(7*(g-S),"d")},te.weeksInYear=function(){var g=this.localeData()._week;return Qt(this.year(),g.dow,g.doy)},te.weeksInWeekYear=function(){var g=this.localeData()._week;return Qt(this.weekYear(),g.dow,g.doy)},te.isoWeeksInYear=function(){return Qt(this.year(),1,4)},te.isoWeeksInISOWeekYear=function(){return Qt(this.isoWeekYear(),1,4)},te.date=Yn,te.day=te.days=function(g){if(!this.isValid())return g!=null?this:NaN;var S,D,H=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(S=g,D=this.localeData(),g=typeof S!="string"?S:isNaN(S)?typeof(S=D.weekdaysParse(S))=="number"?S:null:parseInt(S,10),this.add(g-H,"d")):H},te.weekday=function(g){if(!this.isValid())return g!=null?this:NaN;var S=(this.day()+7-this.localeData()._week.dow)%7;return g==null?S:this.add(g-S,"d")},te.isoWeekday=function(g){return this.isValid()?g!=null?(S=g,D=this.localeData(),D=typeof S=="string"?D.weekdaysParse(S)%7||7:isNaN(S)?null:S,this.day(this.day()%7?D:D-7)):this.day()||7:g!=null?this:NaN;var S,D},te.dayOfYear=function(g){var S=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?S:this.add(g-S,"d")},te.hour=te.hours=Ge,te.minute=te.minutes=qi,te.second=te.seconds=Tr,te.millisecond=te.milliseconds=on,te.utcOffset=function(g,S,D){var H,ee=this._offset||0;if(!this.isValid())return g!=null?this:NaN;if(g==null)return this._isUTC?ee:eo(this);if(typeof g=="string"){if((g=Gn(pt,g))===null)return this}else Math.abs(g)<16&&!D&&(g*=60);return!this._isUTC&&S&&(H=eo(this)),this._offset=g,this._isUTC=!0,H!=null&&this.add(H,"m"),ee!==g&&(!S||this._changeInProgress?Js(this,Ai(g-ee,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this},te.utc=function(g){return this.utcOffset(0,g)},te.local=function(g){return this._isUTC&&(this.utcOffset(0,g),this._isUTC=!1,g&&this.subtract(eo(this),"m")),this},te.parseZone=function(){var g;return this._tzm!=null?this.utcOffset(this._tzm,!1,!0):typeof this._i=="string"&&((g=Gn(Ye,this._i))!=null?this.utcOffset(g):this.utcOffset(0,!0)),this},te.hasAlignedHourOffset=function(g){return!!this.isValid()&&(g=g?dt(g).utcOffset():0,(this.utcOffset()-g)%60==0)},te.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},te.isLocal=function(){return!!this.isValid()&&!this._isUTC},te.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},te.isUtc=_r,te.isUTC=_r,te.zoneAbbr=function(){return this._isUTC?"UTC":""},te.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},te.dates=Q("dates accessor is deprecated. Use date instead.",Yn),te.months=Q("months accessor is deprecated. Use month instead",ht),te.years=Q("years accessor is deprecated. Use year instead",xo),te.zone=Q("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(g,S){return g!=null?(this.utcOffset(g=typeof g!="string"?-g:g,S),this):-this.utcOffset()}),te.isDSTShifted=Q("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var g,S={};return k(S,this),(S=We(S))._a?(g=(S._isUTC?v:dt)(S._a),this._isDSTShifted=this.isValid()&&0<function(D,H,ee){for(var xe=Math.min(D.length,H.length),Ve=Math.abs(D.length-H.length),qe=0,yt=0;yt<xe;yt++)(ee&&D[yt]!==H[yt]||!ee&&Ie(D[yt])!==Ie(H[yt]))&&qe++;return qe+Ve}(S._a,g.toArray())):this._isDSTShifted=!1,this._isDSTShifted}),Mt=z.prototype;function to(g,S,D,xe){var ee=mr(),xe=v().set(xe,S);return ee[D](xe,g)}function $n(g,S,D){if(p(g)&&(S=g,g=void 0),g=g||"",S!=null)return to(g,S,D,"month");for(var H=[],ee=0;ee<12;ee++)H[ee]=to(g,ee,D,"month");return H}function tl(g,S,D,H){S=(typeof g=="boolean"?p(S)&&(D=S,S=void 0):(S=g,g=!1,p(D=S)&&(D=S,S=void 0)),S||"");var ee,xe=mr(),Ve=g?xe._week.dow:0,qe=[];if(D!=null)return to(S,(D+Ve)%7,H,"day");for(ee=0;ee<7;ee++)qe[ee]=to(S,(ee+Ve)%7,H,"day");return qe}Mt.calendar=function(g,S,D){return Ce(g=this._calendar[g]||this._calendar.sameElse)?g.call(S,D):g},Mt.longDateFormat=function(g){var S=this._longDateFormat[g],D=this._longDateFormat[g.toUpperCase()];return S||!D?S:(this._longDateFormat[g]=D.match(Ke).map(function(H){return H==="MMMM"||H==="MM"||H==="DD"||H==="dddd"?H.slice(1):H}).join(""),this._longDateFormat[g])},Mt.invalidDate=function(){return this._invalidDate},Mt.ordinal=function(g){return this._ordinal.replace("%d",g)},Mt.preparse=Rl,Mt.postformat=Rl,Mt.relativeTime=function(g,S,D,H){var ee=this._relativeTime[D];return Ce(ee)?ee(g,S,D,H):ee.replace(/%d/i,g)},Mt.pastFuture=function(g,S){return Ce(g=this._relativeTime[0<g?"future":"past"])?g(S):g.replace(/%s/i,S)},Mt.set=function(g){var S,D;for(D in g)s(g,D)&&(Ce(S=g[D])?this[D]=S:this["_"+D]=S);this._config=g,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Mt.eras=function(g,S){for(var D,H=this._eras||mr("en")._eras,ee=0,xe=H.length;ee<xe;++ee){switch(typeof H[ee].since){case"string":D=n(H[ee].since).startOf("day"),H[ee].since=D.valueOf();break}switch(typeof H[ee].until){case"undefined":H[ee].until=1/0;break;case"string":D=n(H[ee].until).startOf("day").valueOf(),H[ee].until=D.valueOf();break}}return H},Mt.erasParse=function(g,S,D){var H,ee,xe,Ve,qe,yt=this.eras();for(g=g.toUpperCase(),H=0,ee=yt.length;H<ee;++H)if(xe=yt[H].name.toUpperCase(),Ve=yt[H].abbr.toUpperCase(),qe=yt[H].narrow.toUpperCase(),D)switch(S){case"N":case"NN":case"NNN":if(Ve===g)return yt[H];break;case"NNNN":if(xe===g)return yt[H];break;case"NNNNN":if(qe===g)return yt[H];break}else if(0<=[xe,Ve,qe].indexOf(g))return yt[H]},Mt.erasConvertYear=function(g,S){var D=g.since<=g.until?1:-1;return S===void 0?n(g.since).year():n(g.since).year()+(S-g.offset)*D},Mt.erasAbbrRegex=function(g){return s(this,"_erasAbbrRegex")||el.call(this),g?this._erasAbbrRegex:this._erasRegex},Mt.erasNameRegex=function(g){return s(this,"_erasNameRegex")||el.call(this),g?this._erasNameRegex:this._erasRegex},Mt.erasNarrowRegex=function(g){return s(this,"_erasNarrowRegex")||el.call(this),g?this._erasNarrowRegex:this._erasRegex},Mt.months=function(g,S){return g?(r(this._months)?this._months:this._months[(this._months.isFormat||ce).test(S)?"format":"standalone"])[g.month()]:r(this._months)?this._months:this._months.standalone},Mt.monthsShort=function(g,S){return g?(r(this._monthsShort)?this._monthsShort:this._monthsShort[ce.test(S)?"format":"standalone"])[g.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Mt.monthsParse=function(g,S,D){var H,ee;if(this._monthsParseExact)return(function(Nt,Ve,qe){var yt,ft,zt,Nt=Nt.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],yt=0;yt<12;++yt)zt=v([2e3,yt]),this._shortMonthsParse[yt]=this.monthsShort(zt,"").toLocaleLowerCase(),this._longMonthsParse[yt]=this.months(zt,"").toLocaleLowerCase();return qe?Ve==="MMM"?(ft=ke.call(this._shortMonthsParse,Nt))!==-1?ft:null:(ft=ke.call(this._longMonthsParse,Nt))!==-1?ft:null:Ve==="MMM"?(ft=ke.call(this._shortMonthsParse,Nt))!==-1||(ft=ke.call(this._longMonthsParse,Nt))!==-1?ft:null:(ft=ke.call(this._longMonthsParse,Nt))!==-1||(ft=ke.call(this._shortMonthsParse,Nt))!==-1?ft:null}).call(this,g,S,D);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),H=0;H<12;H++)if(ee=v([2e3,H]),D&&!this._longMonthsParse[H]&&(this._longMonthsParse[H]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[H]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),D||this._monthsParse[H]||(ee="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[H]=new RegExp(ee.replace(".",""),"i")),D&&S==="MMMM"&&this._longMonthsParse[H].test(g)||D&&S==="MMM"&&this._shortMonthsParse[H].test(g)||!D&&this._monthsParse[H].test(g))return H},Mt.monthsRegex=function(g){return this._monthsParseExact?(s(this,"_monthsRegex")||wt.call(this),g?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=st),this._monthsStrictRegex&&g?this._monthsStrictRegex:this._monthsRegex)},Mt.monthsShortRegex=function(g){return this._monthsParseExact?(s(this,"_monthsRegex")||wt.call(this),g?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=we),this._monthsShortStrictRegex&&g?this._monthsShortStrictRegex:this._monthsShortRegex)},Mt.week=function(g){return Gi(g,this._week.dow,this._week.doy).week},Mt.firstDayOfYear=function(){return this._week.doy},Mt.firstDayOfWeek=function(){return this._week.dow},Mt.weekdays=function(g,S){return S=r(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(S)?"format":"standalone"],g===!0?Hi(S,this._week.dow):g?S[g.day()]:S},Mt.weekdaysMin=function(g){return g===!0?Hi(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin},Mt.weekdaysShort=function(g){return g===!0?Hi(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort},Mt.weekdaysParse=function(g,S,D){var H,ee;if(this._weekdaysParseExact)return(function(Nt,Ve,qe){var yt,ft,zt,Nt=Nt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],yt=0;yt<7;++yt)zt=v([2e3,1]).day(yt),this._minWeekdaysParse[yt]=this.weekdaysMin(zt,"").toLocaleLowerCase(),this._shortWeekdaysParse[yt]=this.weekdaysShort(zt,"").toLocaleLowerCase(),this._weekdaysParse[yt]=this.weekdays(zt,"").toLocaleLowerCase();return qe?Ve==="dddd"?(ft=ke.call(this._weekdaysParse,Nt))!==-1?ft:null:Ve==="ddd"?(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1?ft:null:(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:Ve==="dddd"?(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:Ve==="ddd"?(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._minWeekdaysParse,Nt))!==-1?ft:null:(ft=ke.call(this._minWeekdaysParse,Nt))!==-1||(ft=ke.call(this._weekdaysParse,Nt))!==-1||(ft=ke.call(this._shortWeekdaysParse,Nt))!==-1?ft:null}).call(this,g,S,D);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),H=0;H<7;H++)if(ee=v([2e3,1]).day(H),D&&!this._fullWeekdaysParse[H]&&(this._fullWeekdaysParse[H]=new RegExp("^"+this.weekdays(ee,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[H]=new RegExp("^"+this.weekdaysShort(ee,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[H]=new RegExp("^"+this.weekdaysMin(ee,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[H]||(ee="^"+this.weekdays(ee,"")+"|^"+this.weekdaysShort(ee,"")+"|^"+this.weekdaysMin(ee,""),this._weekdaysParse[H]=new RegExp(ee.replace(".",""),"i")),D&&S==="dddd"&&this._fullWeekdaysParse[H].test(g)||D&&S==="ddd"&&this._shortWeekdaysParse[H].test(g)||D&&S==="dd"&&this._minWeekdaysParse[H].test(g)||!D&&this._weekdaysParse[H].test(g))return H},Mt.weekdaysRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=_e),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)},Mt.weekdaysShortRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=je),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Mt.weekdaysMinRegex=function(g){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Jt.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mt),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Mt.isPM=function(g){return(g+"").toLowerCase().charAt(0)==="p"},Mt.meridiem=function(g,S,D){return 11<g?D?"pm":"PM":D?"am":"AM"},Qn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var S=g%10;return g+(Ie(g%100/10)===1?"th":S==1?"st":S==2?"nd":S==3?"rd":"th")}}),n.lang=Q("moment.lang is deprecated. Use moment.locale instead.",Qn),n.langData=Q("moment.langData is deprecated. Use moment.localeData instead.",mr);var Or=Math.abs;function Fl(g,S,D,H){return S=Ai(S,D),g._milliseconds+=H*S._milliseconds,g._days+=H*S._days,g._months+=H*S._months,g._bubble()}function il(g){return g<0?Math.floor(g):Math.ceil(g)}function Pl(g){return 4800*g/146097}function As(g){return 146097*g/4800}function rn(g){return function(){return this.as(g)}}Me=rn("ms"),ge=rn("s"),U=rn("m"),ne=rn("h"),X=rn("d"),Nn=rn("w"),Ge=rn("M"),qi=rn("Q"),Tr=rn("y");function wo(g){return function(){return this.isValid()?this._data[g]:NaN}}var on=wo("milliseconds"),Yn=wo("seconds"),xo=wo("minutes"),Mt=wo("hours"),nl=wo("days"),rl=wo("months"),Wi=wo("years"),Bn=Math.round,To={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function cd(g,S,D,H){var ft=Ai(g).abs(),zt=Bn(ft.as("s")),ee=Bn(ft.as("m")),xe=Bn(ft.as("h")),Ve=Bn(ft.as("d")),qe=Bn(ft.as("M")),yt=Bn(ft.as("w")),ft=Bn(ft.as("y")),zt=(zt<=D.ss?["s",zt]:zt<D.s&&["ss",zt])||ee<=1&&["m"]||ee<D.m&&["mm",ee]||xe<=1&&["h"]||xe<D.h&&["hh",xe]||Ve<=1&&["d"]||Ve<D.d&&["dd",Ve];return(zt=(zt=D.w!=null?zt||yt<=1&&["w"]||yt<D.w&&["ww",yt]:zt)||qe<=1&&["M"]||qe<D.M&&["MM",qe]||ft<=1&&["y"]||["yy",ft])[2]=S,zt[3]=0<+g,zt[4]=H,(function(Nt,Ki,ln,Zi,rs){return rs.relativeTime(Ki||1,!!ln,Nt,Zi)}).apply(null,zt)}var ks=Math.abs;function ns(g){return(0<g)-(g<0)||+g}function ol(){if(!this.isValid())return this.localeData().invalidDate();var g,S,D,H,ee,xe,Ve,qe=ks(this._milliseconds)/1e3,yt=ks(this._days),ft=ks(this._months),zt=this.asSeconds();return zt?(g=lt(qe/60),S=lt(g/60),qe%=60,g%=60,D=lt(ft/12),ft%=12,H=qe?qe.toFixed(3).replace(/\.?0+$/,""):"",ee=ns(this._months)!==ns(zt)?"-":"",xe=ns(this._days)!==ns(zt)?"-":"",Ve=ns(this._milliseconds)!==ns(zt)?"-":"",(zt<0?"-":"")+"P"+(D?ee+D+"Y":"")+(ft?ee+ft+"M":"")+(yt?xe+yt+"D":"")+(S||g||qe?"T":"")+(S?Ve+S+"H":"")+(g?Ve+g+"M":"")+(qe?Ve+H+"S":"")):"P0D"}var mi=hi.prototype;return mi.isValid=function(){return this._isValid},mi.abs=function(){var g=this._data;return this._milliseconds=Or(this._milliseconds),this._days=Or(this._days),this._months=Or(this._months),g.milliseconds=Or(g.milliseconds),g.seconds=Or(g.seconds),g.minutes=Or(g.minutes),g.hours=Or(g.hours),g.months=Or(g.months),g.years=Or(g.years),this},mi.add=function(g,S){return Fl(this,g,S,1)},mi.subtract=function(g,S){return Fl(this,g,S,-1)},mi.as=function(g){if(!this.isValid())return NaN;var S,D,H=this._milliseconds;if((g=Be(g))==="month"||g==="quarter"||g==="year")switch(S=this._days+H/864e5,D=this._months+Pl(S),g){case"month":return D;case"quarter":return D/3;case"year":return D/12}else switch(S=this._days+Math.round(As(this._months)),g){case"week":return S/7+H/6048e5;case"day":return S+H/864e5;case"hour":return 24*S+H/36e5;case"minute":return 1440*S+H/6e4;case"second":return 86400*S+H/1e3;case"millisecond":return Math.floor(864e5*S)+H;default:throw new Error("Unknown unit "+g)}},mi.asMilliseconds=Me,mi.asSeconds=ge,mi.asMinutes=U,mi.asHours=ne,mi.asDays=X,mi.asWeeks=Nn,mi.asMonths=Ge,mi.asQuarters=qi,mi.asYears=Tr,mi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Ie(this._months/12):NaN},mi._bubble=function(){var g=this._milliseconds,S=this._days,D=this._months,H=this._data;return 0<=g&&0<=S&&0<=D||g<=0&&S<=0&&D<=0||(g+=864e5*il(As(D)+S),D=S=0),H.milliseconds=g%1e3,g=lt(g/1e3),H.seconds=g%60,g=lt(g/60),H.minutes=g%60,g=lt(g/60),H.hours=g%24,S+=lt(g/24),D+=g=lt(Pl(S)),S-=il(As(g)),g=lt(D/12),D%=12,H.days=S,H.months=D,H.years=g,this},mi.clone=function(){return Ai(this)},mi.get=function(g){return g=Be(g),this.isValid()?this[g+"s"]():NaN},mi.milliseconds=on,mi.seconds=Yn,mi.minutes=xo,mi.hours=Mt,mi.days=nl,mi.weeks=function(){return lt(this.days()/7)},mi.months=rl,mi.years=Wi,mi.humanize=function(g,S){if(!this.isValid())return this.localeData().invalidDate();var D=!1,H=To;return typeof g=="object"&&(S=g,g=!1),typeof g=="boolean"&&(D=g),typeof S=="object"&&(H=Object.assign({},To,S),S.s!=null&&S.ss==null&&(H.ss=S.s-1)),g=this.localeData(),S=cd(this,!D,H,g),D&&(S=g.pastFuture(+this,S)),g.postformat(S)},mi.toISOString=ol,mi.toString=ol,mi.toJSON=ol,mi.locale=xs,mi.localeData=Di,mi.toIsoString=Q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ol),mi.lang=Ct,Re("X",0,0,"unix"),Re("x",0,0,"valueOf"),Le("x",Se),Le("X",/[+-]?\d+(\.\d{1,3})?/),W("X",function(g,S,D){D._d=new Date(1e3*parseFloat(g))}),W("x",function(g,S,D){D._d=new Date(Ie(g))}),n.version="2.29.4",e=dt,n.fn=te,n.min=function(){return Ot("isBefore",[].slice.call(arguments,0))},n.max=function(){return Ot("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=v,n.unix=function(g){return dt(1e3*g)},n.months=function(g,S){return $n(g,S,"months")},n.isDate=c,n.locale=Qn,n.invalid=x,n.duration=Ai,n.isMoment=N,n.weekdays=function(g,S,D){return tl(g,S,D,"weekdays")},n.parseZone=function(){return dt.apply(null,arguments).parseZone()},n.localeData=mr,n.isDuration=Si,n.monthsShort=function(g,S){return $n(g,S,"monthsShort")},n.weekdaysMin=function(g,S,D){return tl(g,S,D,"weekdaysMin")},n.defineLocale=_o,n.updateLocale=function(g,S){var D,H;return S!=null?(H=lr,Ei[g]!=null&&Ei[g].parentLocale!=null?Ei[g].set(J(Ei[g]._config,S)):(S=J(H=(D=Zn(g))!=null?D._config:H,S),D==null&&(S.abbr=g),(H=new z(S)).parentLocale=Ei[g],Ei[g]=H),Qn(g)):Ei[g]!=null&&(Ei[g].parentLocale!=null?(Ei[g]=Ei[g].parentLocale,g===Qn()&&Qn(g)):Ei[g]!=null&&delete Ei[g]),Ei[g]},n.locales=function(){return P(Ei)},n.weekdaysShort=function(g,S,D){return tl(g,S,D,"weekdaysShort")},n.normalizeUnits=Be,n.relativeTimeRounding=function(g){return g===void 0?Bn:typeof g=="function"&&(Bn=g,!0)},n.relativeTimeThreshold=function(g,S){return To[g]!==void 0&&(S===void 0?To[g]:(To[g]=S,g==="s"&&(To.ss=S-1),!0))},n.calendarFormat=function(g,S){return(g=g.diff(S,"days",!0))<-6?"sameElse":g<-1?"lastWeek":g<0?"lastDay":g<1?"sameDay":g<2?"nextDay":g<7?"nextWeek":"sameElse"},n.prototype=te,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})})(yp);var Ep=yp.exports;const Ys=Zc(Ep),ms=Cl({__proto__:null,default:Ys},[Ep]);class Xe{}Xe.locales={TEXT_ALL_SELECTED:"All Selected",TEXT_ALL_X_RECORDS_SELECTED:"All {{x}} records selected",TEXT_APPLY_MASS_UPDATE:"Apply Mass Update",TEXT_APPLY_TO_SELECTION:"Update Selection",TEXT_CANCEL:"Cancel",TEXT_CLEAR_ALL_FILTERS:"Clear all Filters",TEXT_CLEAR_ALL_GROUPING:"Clear all Grouping",TEXT_CLEAR_ALL_SORTING:"Clear all Sorting",TEXT_CLEAR_PINNING:"Unfreeze Columns/Rows",TEXT_CLONE:"Clone",TEXT_COLLAPSE_ALL_GROUPS:"Collapse all Groups",TEXT_CONTAINS:"Contains",TEXT_COLUMNS:"Columns",TEXT_COLUMN_RESIZE_BY_CONTENT:"Resize by Content",TEXT_COMMANDS:"Commands",TEXT_COPY:"Copy",TEXT_DROP_COLUMN_HEADER_TO_GROUP_BY:"Drop a column header here to group by the column",TEXT_EQUALS:"Equals",TEXT_EQUAL_TO:"Equal to",TEXT_ENDS_WITH:"Ends With",TEXT_ERROR_EDITABLE_GRID_REQUIRED:"Your grid must be editable in order to use the Composite Editor Modal.",TEXT_ERROR_ENABLE_CELL_NAVIGATION_REQUIRED:'Composite Editor requires the flag "enableCellNavigation" to be set to True in your Grid Options.',TEXT_ERROR_NO_CHANGES_DETECTED:"Sorry we could not detect any changes.",TEXT_ERROR_NO_EDITOR_FOUND:"We could not find any Editor in your Column Definition.",TEXT_ERROR_NO_RECORD_FOUND:"No records selected for edit or clone operation.",TEXT_ERROR_ROW_NOT_EDITABLE:"Current row is not editable.",TEXT_ERROR_ROW_SELECTION_REQUIRED:"You must select some rows before trying to apply new value(s).",TEXT_EXPAND_ALL_GROUPS:"Expand all Groups",TEXT_EXPORT_TO_CSV:"Export in CSV format",TEXT_EXPORT_TO_TEXT_FORMAT:"Export in Text format (Tab delimited)",TEXT_EXPORT_TO_EXCEL:"Export to Excel",TEXT_EXPORT_TO_TAB_DELIMITED:"Export in Text format (Tab delimited)",TEXT_FORCE_FIT_COLUMNS:"Force fit columns",TEXT_FREEZE_COLUMNS:"Freeze Columns",TEXT_GREATER_THAN:"Greater than",TEXT_GREATER_THAN_OR_EQUAL_TO:"Greater than or equal to",TEXT_GROUP_BY:"Group By",TEXT_HIDE_COLUMN:"Hide Column",TEXT_ITEMS:"items",TEXT_ITEMS_PER_PAGE:"items per page",TEXT_ITEMS_SELECTED:"items selected",TEXT_OF:"of",TEXT_OK:"OK",TEXT_LAST_UPDATE:"Last Update",TEXT_LESS_THAN:"Less than",TEXT_LESS_THAN_OR_EQUAL_TO:"Less than or equal to",TEXT_NOT_CONTAINS:"Not contains",TEXT_NOT_EQUAL_TO:"Not equal to",TEXT_PAGE:"Page",TEXT_RECORDS_SELECTED:"records selected",TEXT_REFRESH_DATASET:"Refresh Dataset",TEXT_REMOVE_FILTER:"Remove Filter",TEXT_REMOVE_SORT:"Remove Sort",TEXT_RESET_INPUT_VALUE:"Reset Input Value",TEXT_RESET_FORM:"Reset Form",TEXT_SAVE:"Save",TEXT_SELECT_ALL:"Select All",TEXT_SYNCHRONOUS_RESIZE:"Synchronous resize",TEXT_SORT_ASCENDING:"Sort Ascending",TEXT_SORT_DESCENDING:"Sort Descending",TEXT_STARTS_WITH:"Starts With",TEXT_TOGGLE_ALL_GROUPS:"Toggle all Groups",TEXT_TOGGLE_FILTER_ROW:"Toggle Filter Row",TEXT_TOGGLE_PRE_HEADER_ROW:"Toggle Pre-Header Row",TEXT_UNFREEZE_COLUMNS:"Unfreeze Columns",TEXT_X_OF_Y_SELECTED:"# of % selected",TEXT_X_OF_Y_MASS_SELECTED:"{{x}} of {{y}} selected"},Xe.treeDataProperties={CHILDREN_PROP:"children",COLLAPSED_PROP:"__collapsed",HAS_CHILDREN_PROP:"__hasChildren",TREE_LEVEL_PROP:"__treeLevel",PARENT_PROP:"__parentId"},Xe.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL=2,Xe.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL=2,Xe.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL=2,Xe.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL=4,Xe.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL=void 0,Xe.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL=void 0,Xe.DEFAULT_NUMBER_DECIMAL_SEPARATOR=".",Xe.DEFAULT_NUMBER_THOUSAND_SEPARATOR="",Xe.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET=!1,Xe.SLIDER_DEFAULT_MIN_VALUE=0,Xe.SLIDER_DEFAULT_MAX_VALUE=100,Xe.SLIDER_DEFAULT_STEP=1,Xe.VALIDATION_REQUIRED_FIELD="Field is required",Xe.VALIDATION_EDITOR_VALID_NUMBER="Please enter a valid number",Xe.VALIDATION_EDITOR_VALID_INTEGER="Please enter a valid integer number",Xe.VALIDATION_EDITOR_INTEGER_BETWEEN="Please enter a valid integer number between {{minValue}} and {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MAX="Please enter a valid integer number that is lower than {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE="Please enter a valid integer number that is lower than or equal to {{maxValue}}",Xe.VALIDATION_EDITOR_INTEGER_MIN="Please enter a valid integer number that is greater than {{minValue}}",Xe.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE="Please enter a valid integer number that is greater than or equal to {{minValue}}",Xe.VALIDATION_EDITOR_NUMBER_BETWEEN="Please enter a valid number between {{minValue}} and {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MAX="Please enter a valid number that is lower than {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE="Please enter a valid number that is lower than or equal to {{maxValue}}",Xe.VALIDATION_EDITOR_NUMBER_MIN="Please enter a valid number that is greater than {{minValue}}",Xe.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE="Please enter a valid number that is greater than or equal to {{minValue}}",Xe.VALIDATION_EDITOR_DECIMAL_BETWEEN="Please enter a valid number with a maximum of {{maxDecimal}} decimals",Xe.VALIDATION_EDITOR_TEXT_LENGTH_BETWEEN="Please make sure your text length is between {{minLength}} and {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH="Please make sure your text is less than {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE="Please make sure your text is less than or equal to {{maxLength}} characters",Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH="Please make sure your text is more than {{minLength}} character(s)",Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE="Please make sure your text is at least {{minLength}} character(s)";var Qc;(function(a){a[a.camelCase=0]="camelCase",a[a.pascalCase=1]="pascalCase",a[a.snakeCase=2]="snakeCase",a[a.kebabCase=3]="kebabCase"})(Qc||(Qc={}));var vs;(function(a){a.colon=":",a.comma=",",a.equalSign="=",a.pipe="|",a.semicolon=";",a.space=" ",a.tab=" ",a.doubleColon="::",a.doublePipe="||",a.doubleSemicolon=";;"})(vs||(vs={}));var ni;(function(a){a.autoTooltip="autoTooltip",a.cellExternalCopyManager="cellExternalCopyManager",a.cellMenu="cellMenu",a.checkboxSelector="checkboxSelector",a.columnPicker="columnPicker",a.contextMenu="contextMenu",a.customTooltip="customTooltip",a.draggableGrouping="draggableGrouping",a.groupItemMetaProvider="groupItemMetaProvider",a.gridMenu="gridMenu",a.headerButton="headerButton",a.headerMenu="headerMenu",a.rowDetailView="rowDetailView",a.rowMoveManager="rowMoveManager",a.rowSelection="rowSelection"})(ni||(ni={}));const ie={unknown:"unknown",string:"string",boolean:"boolean",integer:"integer",float:"float",number:"number",date:"date",dateIso:"dateIso",dateUtc:"dateUtc",dateTime:"dateTime",dateTimeIso:"dateTimeIso",dateTimeIsoAmPm:"dateTimeIsoAmPm",dateTimeIsoAM_PM:"dateTimeIsoAM_PM",dateTimeShortIso:"dateTimeShortIso",dateEuro:"dateEuro",dateEuroShort:"dateEuroShort",dateTimeShortEuro:"dateTimeShortEuro",dateTimeEuro:"dateTimeEuro",dateTimeEuroAmPm:"dateTimeEuroAmPm",dateTimeEuroAM_PM:"dateTimeEuroAM_PM",dateTimeEuroShort:"dateTimeEuroShort",dateTimeEuroShortAmPm:"dateTimeEuroShortAmPm",dateTimeEuroShortAM_PM:"dateTimeEuroShortAM_PM",dateUs:"dateUs",dateUsShort:"dateUsShort",dateTimeShortUs:"dateTimeShortUs",dateTimeUs:"dateTimeUs",dateTimeUsAmPm:"dateTimeUsAmPm",dateTimeUsAM_PM:"dateTimeUsAM_PM",dateTimeUsShort:"dateTimeUsShort",dateTimeUsShortAmPm:"dateTimeUsShortAmPm",dateTimeUsShortAM_PM:"dateTimeUsShortAM_PM",object:"object",password:"password",text:"text",readonly:"readonly"};var dn;(function(a){a.csv="csv",a.txt="txt",a.xls="xls",a.xlsx="xlsx"})(dn||(dn={}));var Zl;(function(a){a.merge="merge",a.chain="chain"})(Zl||(Zl={}));var Vd;(function(a){a.none="NOA",a.legacyOff="LOF",a.legacyForceFit="LFF",a.ignoreViewport="IGV",a.fitColsToViewport="FCV",a.fitViewportToCols="FVC"})(Vd||(Vd={}));var ur;(function(a){a.columns="columns",a.filter="filter",a.pagination="pagination",a.pinning="pinning",a.rowSelection="rowSelection",a.sorter="sorter",a.treeData="treeData"})(ur||(ur={}));var li;(function(a){a[a.C=67]="C",a[a.V=86]="V",a[a.BACKSPACE=8]="BACKSPACE",a[a.DELETE=46]="DELETE",a[a.DOWN=40]="DOWN",a[a.END=35]="END",a[a.ENTER=13]="ENTER",a[a.ESCAPE=27]="ESCAPE",a[a.HOME=36]="HOME",a[a.INSERT=45]="INSERT",a[a.LEFT=37]="LEFT",a[a.PAGE_DOWN=34]="PAGE_DOWN",a[a.PAGE_UP=33]="PAGE_UP",a[a.RIGHT=39]="RIGHT",a[a.TAB=9]="TAB",a[a.UP=38]="UP",a[a.SPACE=32]="SPACE"})(li||(li={}));var Lt;(function(a){a.empty="",a.contains="Contains",a.notContains="Not_Contains",a.lessThan="LT",a.lessThanOrEqual="LE",a.greaterThan="GT",a.greaterThanOrEqual="GE",a.notEqual="NE",a.equal="EQ",a.endsWith="EndsWith",a.rangeInclusive="RangeInclusive",a.rangeExclusive="RangeExclusive",a.startsWith="StartsWith",a.in="IN",a.notIn="NOT_IN",a.inContains="IN_CONTAINS",a.notInContains="NOT_IN_CONTAINS",a.inCollection="IN_COLLECTION",a.notInCollection="NOT_IN_COLLECTION"})(Lt||(Lt={}));var Io;(function(a){a.asc="asc",a.ASC="ASC",a.desc="desc",a.DESC="DESC"})(Io||(Io={}));var Yi;(function(a){a[a.asc=1]="asc",a[a.desc=-1]="desc",a[a.neutral=0]="neutral"})(Yi||(Yi={}));var gs;(function(a){a.toggleCollapse="toggle-collapse",a.fullExpand="full-expand",a.fullCollapse="full-collapse",a.toggleExpand="toggle-expand"})(gs||(gs={}));const Jc=Object.freeze(Object.defineProperty({__proto__:null,get CaseType(){return Qc},get DelimiterType(){return vs},get EmitterType(){return Ji},get ExtensionName(){return ni},FieldType:ie,get FileType(){return dn},get FilterMultiplePassType(){return Zl},get GridAutosizeColsMode(){return Vd},get GridStateType(){return ur},get KeyCode(){return li},get OperatorType(){return Lt},get SortDirection(){return Io},get SortDirectionNumber(){return Yi},get ToggleStateChangeType(){return gs}},Symbol.toStringTag,{value:"Module"})),jg=Ys||ms;class Ha extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Ha.prototype)}}function Sp(a){let t=!1;return a instanceof Promise?{promise:a.then(e=>{if(t)throw new Ha("Cancelled Promise");return e}),cancel:()=>t=!0}:a}function wp(a,t,e=""){let n=t;if(t instanceof Promise)return t;if(a.isObservable(t)&&(n=a.firstValueFrom(t)),!(n instanceof Promise))throw new Error(`Something went wrong, Slickgrid-Universal ${e} is not able to convert the Observable into a Promise.`);return n}function zd(a,t,e=0){var n;const r=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP;if(Array.isArray(a))for(const o of a)o&&(Array.isArray(o[r])&&o[r].length>0&&(e++,zd(o[r],t,e),e--),o[t.levelPropName]=e)}function xp(a,t){var e,n,r,o,s;const l=(e=t==null?void 0:t.identifierPropName)!==null&&e!==void 0?e:"id",u=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.hasChildrenPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.HAS_CHILDREN_PROP,c=(o=t==null?void 0:t.parentPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.PARENT_PROP,f=(s=t==null?void 0:t.levelPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.TREE_LEVEL_PROP;return t!=null&&t.shouldAddTreeLevelNumber&&zd(a,{childrenPropName:u,levelPropName:f}),Yg(a,v=>v[u],(v,_)=>({[l]:v[l],[c]:_!==void 0?_[l]:null,[p]:!!v[u],...Op(v,u)}))}function Tp(a,t){var e,n,r,o,s;const l=(e=t==null?void 0:t.identifierPropName)!==null&&e!==void 0?e:"id",u=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.parentPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.PARENT_PROP,c=(o=t==null?void 0:t.levelPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.TREE_LEVEL_PROP,f=(s=t==null?void 0:t.collapsedPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.COLLAPSED_PROP,m=a||[],v=[],_={};return m.forEach(C=>_[C[l]]=C),Object.keys(_).forEach(C=>{var x;const w=_[C];if(!(p in w)||w[p]===null||w[p]===void 0||w[p]==="")v.push(w);else if(w[p]in _){const E=_[w[p]];u in E||(E[u]=[]),E[u].push(w),E[f]===void 0&&(E[f]=(x=t==null?void 0:t.initiallyCollapsed)!==null&&x!==void 0?x:!1)}}),zd(v,{childrenPropName:u,levelPropName:c},0),v}function Ud(a,t,e){if(!e)throw new Error('findRecursive requires parameter "childrenPropertyName"');const n=a.find(t),r=a.filter(o=>(o==null?void 0:o.hasOwnProperty(e))&&o[e]);if(n)return n;if(r.length){const o=[];return r.forEach(s=>{s!=null&&s.hasOwnProperty(e)&&o.push(...s[e])}),Ud(o,t,e)}}function js(a,t,e,n=".",r=""){if(isNaN(+a))return a;const o=t===void 0?2:t,s=e===void 0?2:e;let l=String(Math.round(+a*Math.pow(10,s))/Math.pow(10,s));for(l.indexOf(".")<0&&o>0&&(l+=".");l.length-l.indexOf(".")<=o;)l+="0";const u=l.split(".");let p,c;r?p=u.length>=1?_s(u[0],r):void 0:p=u.length>=1?u[0]:l,u.length>1&&(c=u[1]);let f="";return p!==void 0&&c!==void 0?f=`${p}${n}${c}`:p!=null&&(f=p),f}function Sn(a,t,e,n,r="",o="",s=".",l=""){if(isNaN(+a))return a;const u=Math.round(parseFloat(a)*1e6)/1e6;if(u<0){const p=Math.abs(u);if(n){if(!isNaN(t)||!isNaN(e))return`(${r}${js(p,t,e,s,l)}${o})`;const c=_s(`${p}`,l);return`(${r}${c}${o})`}else{if(!isNaN(t)||!isNaN(e))return`-${r}${js(p,t,e,s,l)}${o}`;const c=_s(`${p}`,l);return`-${r}${c}${o}`}}else{if(!isNaN(t)||!isNaN(e))return`${r}${js(a,t,e,s,l)}${o}`;const p=_s(`${a}`,l);return`${r}${p}${o}`}}function Ba(a,t,e){if(typeof a.queryFieldNameGetterFn=="function"){const n=a.queryFieldNameGetterFn(t);(n==null?void 0:n.indexOf("."))>=0?e=_n(t,n):e=t.hasOwnProperty(n)?t[n]:e}return e}function _n(a,t){return!a||!t?a:t.split(".").reduce((e,n)=>e&&e[n],a)}function ao(a){return a&&a.translationNamespace?a.translationNamespace+(a.translationNamespaceSeparator||""):""}function Va(a){return a.outputType||a.type||ie.string}function eh(a){switch(a){case ie.date:case ie.dateTime:case ie.dateIso:case ie.dateTimeIso:case ie.dateTimeShortIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeEuro:case ie.dateTimeShortEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeUs:case ie.dateTimeShortUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:case ie.dateUtc:return!0;default:return!1}}function Fr(a){let t;switch(a){case ie.dateTime:case ie.dateTimeIso:t="YYYY-MM-DD HH:mm:ss";break;case ie.dateTimeIsoAmPm:t="YYYY-MM-DD hh:mm:ss a";break;case ie.dateTimeIsoAM_PM:t="YYYY-MM-DD hh:mm:ss A";break;case ie.dateTimeShortIso:t="YYYY-MM-DD HH:mm";break;case ie.dateEuro:t="DD/MM/YYYY";break;case ie.dateEuroShort:t="D/M/YY";break;case ie.dateTimeEuro:t="DD/MM/YYYY HH:mm:ss";break;case ie.dateTimeShortEuro:t="DD/MM/YYYY HH:mm";break;case ie.dateTimeEuroAmPm:t="DD/MM/YYYY hh:mm:ss a";break;case ie.dateTimeEuroAM_PM:t="DD/MM/YYYY hh:mm:ss A";break;case ie.dateTimeEuroShort:t="D/M/YY H:m:s";break;case ie.dateTimeEuroShortAmPm:t="D/M/YY h:m:s a";break;case ie.dateTimeEuroShortAM_PM:t="D/M/YY h:m:s A";break;case ie.dateUs:t="MM/DD/YYYY";break;case ie.dateUsShort:t="M/D/YY";break;case ie.dateTimeUs:t="MM/DD/YYYY HH:mm:ss";break;case ie.dateTimeUsAmPm:t="MM/DD/YYYY hh:mm:ss a";break;case ie.dateTimeUsAM_PM:t="MM/DD/YYYY hh:mm:ss A";break;case ie.dateTimeUsShort:t="M/D/YY H:m:s";break;case ie.dateTimeUsShortAmPm:t="M/D/YY h:m:s a";break;case ie.dateTimeUsShortAM_PM:t="M/D/YY h:m:s A";break;case ie.dateTimeShortUs:t="MM/DD/YYYY HH:mm";break;case ie.dateUtc:t="YYYY-MM-DDTHH:mm:ss.SSSZ";break;case ie.date:case ie.dateIso:default:t="YYYY-MM-DD";break}return t}function za(a){let t;switch(a){case ie.dateTime:case ie.dateTimeIso:t="Y-m-d H:i:S";break;case ie.dateTimeShortIso:t="Y-m-d H:i";break;case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:t="Y-m-d h:i:S K";break;case ie.dateEuro:t="d/m/Y";break;case ie.dateEuroShort:t="d/m/y";break;case ie.dateTimeEuro:t="d/m/Y H:i:S";break;case ie.dateTimeShortEuro:t="d/m/y H:i";break;case ie.dateTimeEuroAmPm:t="d/m/Y h:i:S K";break;case ie.dateTimeEuroAM_PM:t="d/m/Y h:i:s K";break;case ie.dateTimeEuroShort:t="d/m/y H:i:s";break;case ie.dateTimeEuroShortAmPm:t="d/m/y h:i:s K";break;case ie.dateUs:t="m/d/Y";break;case ie.dateUsShort:t="m/d/y";break;case ie.dateTimeUs:t="m/d/Y H:i:S";break;case ie.dateTimeShortUs:t="m/d/y H:i";break;case ie.dateTimeUsAmPm:t="m/d/Y h:i:S K";break;case ie.dateTimeUsAM_PM:t="m/d/Y h:i:s K";break;case ie.dateTimeUsShort:t="m/d/y H:i:s";break;case ie.dateTimeUsShortAmPm:t="m/d/y h:i:s K";break;case ie.dateUtc:t="Z";break;case ie.date:case ie.dateIso:default:t="Y-m-d";break}return t}function Xg(a){let t;switch(a){case"<":case"LT":t=Lt.lessThan;break;case"<=":case"LE":t=Lt.lessThanOrEqual;break;case">":case"GT":t=Lt.greaterThan;break;case">=":case"GE":t=Lt.greaterThanOrEqual;break;case"<>":case"!=":case"NE":t=Lt.notEqual;break;case"*":case"a*":case"StartsWith":t=Lt.startsWith;break;case"*z":case"EndsWith":t=Lt.endsWith;break;case"=":case"==":case"EQ":t=Lt.equal;break;case"IN":t=Lt.in;break;case"NIN":case"NOT_IN":t=Lt.notIn;break;case"Not_Contains":case"NOT_CONTAINS":t=Lt.notContains;break;case"Contains":case"CONTAINS":default:t=Lt.contains;break}return t}function Ql(a){let t="";switch(a){case Lt.greaterThan:case">":t=">";break;case Lt.greaterThanOrEqual:case">=":t=">=";break;case Lt.lessThan:case"<":t="<";break;case Lt.lessThanOrEqual:case"<=":t="<=";break;case Lt.notEqual:case"<>":t="<>";break;case Lt.equal:case"=":case"==":case"EQ":t="=";break;case Lt.startsWith:case"a*":case"*":t="a*";break;case Lt.endsWith:case"*z":t="*z";break;default:t=a;break}return t}function th(a){let t;if(eh(a))t=Lt.equal;else switch(a){case ie.unknown:case ie.string:case ie.text:case ie.password:case ie.readonly:t=Lt.contains;break;case ie.float:case ie.number:default:t=Lt.equal;break}return t}function Op(a,t){return Object.keys(a).reduce((e,n)=>(n!==t&&(e[n]=a[n]),e),{})}function qg(a,t){let e="";if(typeof a=="string"&&/^[0-9\-\/]*$/.test(a)){const n=decodeURIComponent(a),r=jg(new Date(n));r.isValid()&&r.year().toString().length===4&&(e=t?r.utc().format():r.format())}return e}function _s(a,t=","){if(a!=null){const e=`${a}`,n=e.split(".");return n.length===2?`${n[0].replace(/\B(?=(\d{3})+(?!\d))/g,t)}.${n[1]}`:e.replace(/\B(?=(\d{3})+(?!\d))/g,t)}return a}function bs(a,t,e={}){return Array.isArray(a)?a.find(t)||e:a}function Gd(a){if(Array.isArray(a))for(;a.length>0;){const t=a.pop();t!=null&&t.unsubscribe&&t.unsubscribe()}return a}const Kg=Object.freeze(Object.defineProperty({__proto__:null,CancelledException:Ha,addTreeLevelByMutation:zd,cancellablePromise:Sp,castObservableToPromise:wp,decimalFormatted:js,findItemInTreeStructure:Ud,findOrDefault:bs,flattenToParentChildArray:xp,formatNumber:Sn,getCellValueFromQueryFieldGetter:Ba,getColumnFieldType:Va,getDescendantProperty:_n,getTranslationPrefix:ao,isColumnDateType:eh,mapFlatpickrDateFormatWithFieldType:za,mapMomentDateFormatWithFieldType:Fr,mapOperatorByFieldType:th,mapOperatorToShorthandDesignation:Ql,mapOperatorType:Xg,objectWithoutKey:Op,parseUtcDate:qg,thousandSeparatorFormatted:_s,unflattenParentChildArrayToTree:Tp,unsubscribeAll:Gd},Symbol.toStringTag,{value:"Module"})),Zg=(a,t,e)=>{e==null&&(e=Yi.neutral);let n=0;return a===t?n=0:a===null?n=-1:t===null?n=1:e?n=a<t?-1:1:n=a<t?1:-1,e*n},Qg=(a,t,e,n,r)=>{var o,s;if(!n||!n.dataKey)throw new Error('Sorting a "FieldType.object" requires you to provide the "dataKey" (object property name) of the object so that we can use it to sort correctly');const l=a!=null&&a.hasOwnProperty(n.dataKey)?a[n.dataKey]:a,u=t!=null&&t.hasOwnProperty(n.dataKey)?t[n.dataKey]:t,p=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1;e==null&&(e=Yi.neutral);let c=0;return typeof a!="object"?c=-99e10:typeof t!="object"?c=99e10:l===null||p&&l===void 0?c=-1:u===null||p&&u===void 0?c=1:l===u?c=0:e?c=l<u?-1:1:c=l<u?1:-1,e*c};function Jg(a,t,e="id"){let n=-1;t&&typeof t=="object"&&e in t?n=a.findIndex(r=>r[e]===t[e]):n=a.findIndex(r=>r===t),n<0&&a.push(t)}function Ua(a,t=" "){let e="";for(let n=0;n<a;n++)e+=t;return e}function ih(a,t){return a.filter((e,n)=>t!==n)}function uo(a){const t=()=>{const r={};for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=uo(a[o]));return r},e=()=>a.map(r=>uo(r)),n=Object.prototype.toString.call(a).slice(8,-1).toLowerCase();return n==="object"?t():n==="array"?e():a}function yl(a,...t){if(!t.length)return a;const e=t.shift();if(a=!Ko(a)&&Ko(e)?{}:a,Ko(a)&&Ko(e))for(const n in e)e.hasOwnProperty(n)&&(n in a?typeof a[n]!="object"||typeof e[n]!="object"?a[n]=e[n]:a[n].concat&&e[n].concat?a[n]=a[n].concat(e[n]):a[n]=yl(a[n],e[n]):a[n]=e[n]);return yl(a,...t)}function nh(a,...t){if(!t.length||t[0]===void 0)return a;const e=t.shift();if(a=!Ko(a)&&Ko(e)?{}:a,Ko(a)&&Ko(e))for(const n of Object.keys(e))typeof e[n]=="object"&&e[n]!==null&&nh(a[n],e[n]),(a[n]===null||a[n]===void 0)&&e[n]!==null&&e[n]!==void 0&&(a[n]=e[n]);return nh(a,...t)}function Ap(a){for(const t in a)a.hasOwnProperty(t)&&delete a[t];return a=null,a={},a}function rh(a){return a==null?!0:Object.entries(a).length===0}function Ko(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)}function Wd(a){return a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"}function $d(a){return a!=null&&a!==""}function rr(a,t=!1){return t?a==null||typeof a=="string"?!1:!isNaN(a):a==null||a===""?!1:!isNaN(+a)}function kp(a){return!a||a&&typeof a=="object"&&Object.keys(a).length===0}function Yd(a){return/(true|1)/i.test(a+"")}function Jl(a,t=!1){const e=typeof a.normalize=="function"?a.normalize("NFD").replace(/[\u0300-\u036f]/g,""):a;return t?e.toLowerCase():e}function cr(a,t,e){if(typeof t=="string"&&(t=t.split(".")),t.length>1){const n=t.shift();a&&n!==void 0&&cr(a[n]=$d(a[n])&&(Array.isArray(a[n])||Object.prototype.toString.call(a[n])==="[object Object]")?a[n]:{},t,e)}else a&&t[0]&&(a[t[0]]=e)}function El(a,t=!1){return typeof a=="string"?t?a.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()):a.charAt(0).toUpperCase()+a.slice(1):a}function oh(a){return typeof a=="string"?a.replace(/(?:^\w|[A-Z]|\b\w|[\s+\-_\/])/g,(t,e)=>/[\s+\-_\/]/.test(t)?"":e===0?t.toLowerCase():t.toUpperCase()):a}function Ga(a){return typeof a=="string"?oh(a).replace(/([A-Z])/g,"-$1").toLowerCase():a}function jr(a){if(typeof a=="string"){const t=a.replace(/([A-Z])|(\-)/g," $1").replace(/\s+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}return a}function e_(a){return typeof a=="string"?oh(a).replace(/([A-Z])/g,"_$1").toLowerCase():a}function Ip(a){return Array.isArray(a)&&a.length>0?a.filter((t,e)=>a.indexOf(t)>=e):a}function t_(a,t="id"){if(Array.isArray(a)&&a.length>0){const e=[],n=new Map;for(const r of a)r&&!n.has(r[t])&&(n.set(r[t],!0),e.push({id:r[t],name:r.name}));return e}return a}const i_=Object.freeze(Object.defineProperty({__proto__:null,addToArrayWhenNotExists:Jg,addWhiteSpaces:Ua,arrayRemoveItemByIndex:ih,deepCopy:uo,deepMerge:yl,emptyObject:Ap,hasData:$d,isEmptyObject:rh,isNumber:rr,isObject:Ko,isObjectEmpty:kp,isPrimitiveValue:Wd,objectAssignAndExtend:nh,parseBoolean:Yd,removeAccentFromText:Jl,setDeepValue:cr,titleCase:El,toCamelCase:oh,toKebabCase:Ga,toSentenceCase:jr,toSnakeCase:e_,uniqueArray:Ip,uniqueObjectArray:t_},Symbol.toStringTag,{value:"Module"})),n_=(a,t,e,n,r)=>{var o,s;e==null&&(e=Yi.neutral);let l=0;const u=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1;return a===t?l=0:a===null||u&&a===void 0?l=-1:t===null||u&&t===void 0?l=1:(r!=null&&r.ignoreAccentOnStringFilterAndSort&&(a=Jl(a,!1),t=Jl(t,!1)),e?l=a<t?-1:1:l=a<t?1:-1),e*l},Dp=(a,t,e,n,r)=>{var o,s;const l=(s=(o=n==null?void 0:n.valueCouldBeUndefined)!==null&&o!==void 0?o:r==null?void 0:r.cellValueCouldBeUndefined)!==null&&s!==void 0?s:!1,u=isNaN(a)||a===""||a===null||l&&a===void 0?-99e10:parseFloat(a),p=isNaN(t)||t===""||t===null||l&&t===void 0?-99e10:parseFloat(t);return e*(u===p?0:u>p?1:-1)},jd=Ys||ms;function Rp(a,t,e,n,r){let o=0;if(a===t)o=0;else{let s=jd(a,n,r),l=jd(t,n,r);s.isValid()||(s=new Date(1001,1,1)),l.isValid()||(l=new Date(1001,1,1)),o=s.valueOf()-l.valueOf()}return e*o}function ji(a){const t=a===ie.date?jd.ISO_8601:Fr(a);return(e,n,r)=>t===jd.ISO_8601?Rp(e,n,r,t,!1):Rp(e,n,r,t,!0)}const Sl={boolean:Zg,date:ji(ie.date),dateIso:ji(ie.dateIso),dateUtc:ji(ie.dateUtc),dateTime:ji(ie.dateTime),dateTimeIso:ji(ie.dateTimeIso),dateTimeIsoAmPm:ji(ie.dateTimeIsoAmPm),dateTimeIsoAM_PM:ji(ie.dateTimeIsoAM_PM),dateTimeShortIso:ji(ie.dateTimeShortIso),dateEuro:ji(ie.dateEuro),dateEuroShort:ji(ie.dateEuroShort),dateTimeShortEuro:ji(ie.dateTimeShortEuro),dateTimeEuro:ji(ie.dateTimeEuro),dateTimeEuroAmPm:ji(ie.dateTimeEuroAmPm),dateTimeEuroAM_PM:ji(ie.dateTimeEuroAM_PM),dateTimeEuroShort:ji(ie.dateTimeEuroShort),dateTimeEuroShortAmPm:ji(ie.dateTimeEuroShortAmPm),dateTimeEuroShortAM_PM:ji(ie.dateTimeEuroShortAM_PM),dateUs:ji(ie.dateUs),dateUsShort:ji(ie.dateUsShort),dateTimeShortUs:ji(ie.dateTimeShortUs),dateTimeUs:ji(ie.dateTimeUs),dateTimeUsAmPm:ji(ie.dateTimeUsAmPm),dateTimeUsAM_PM:ji(ie.dateTimeUsAM_PM),dateTimeUsShort:ji(ie.dateTimeUsShort),dateTimeUsShortAmPm:ji(ie.dateTimeUsShortAmPm),dateTimeUsShortAM_PM:ji(ie.dateTimeUsShortAM_PM),numeric:Dp,objectString:Qg,string:n_};function ea(a,t,e,n,r,o){let s=0;switch(a){case ie.boolean:s=Sl.boolean(t,e,n,r,o);break;case ie.float:case ie.integer:case ie.number:s=Sl.numeric(t,e,n,r,o);break;case ie.date:case ie.dateIso:case ie.dateUtc:case ie.dateTime:case ie.dateTimeIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateTimeShortIso:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeShortEuro:case ie.dateTimeEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeShortUs:case ie.dateTimeUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:s=ji(a).call(this,t,e,n,r,o);break;case ie.object:s=Sl.objectString(t,e,n,r,o);break;case ie.string:case ie.text:case ie.password:case ie.readonly:default:s=Sl.string(t,e,n,r,o);break}return s}const r_=Object.freeze(Object.defineProperty({__proto__:null,sortByFieldType:ea},Symbol.toStringTag,{value:"Module"}));var Do;(function(a){a.camelCase="camelCase",a.kebabCase="kebabCase",a.lowerCase="lowerCase",a.lowerCaseWithoutOnPrefix="lowerCaseWithoutOnPrefix"})(Do||(Do={}));class Fp{get elementSource(){return this._elementSource}set elementSource(t){this._elementSource=t}get subscribedEvents(){return this._subscribedEvents}get subscribedEventNames(){return this._subscribedEvents.map(t=>t.name)}constructor(t){this._subscribedEvents=[],this.eventNamingStyle=Do.camelCase,this._elementSource=t||document.createElement("div")}dispose(){var t;this.unsubscribeAll(),this._subscribedEvents=[],clearTimeout(this._timer),(t=this._elementSource)===null||t===void 0||t.remove(),this._elementSource=null}dispatchCustomEvent(t,e,n=!0,r=!0){var o;const s={bubbles:n,cancelable:r};return e&&(s.detail=e),(o=this._elementSource)===null||o===void 0?void 0:o.dispatchEvent(new CustomEvent(t,s))}getEventNameByNamingConvention(t,e){let n="";switch(this.eventNamingStyle){case Do.camelCase:n=e!==""?`${e}${El(t)}`:t;break;case Do.kebabCase:n=e!==""?`${e}-${Ga(t)}`:Ga(t);break;case Do.lowerCase:n=`${e}${t}`.toLowerCase();break;case Do.lowerCaseWithoutOnPrefix:n=`${e}${t.replace(/^on/,"")}`.toLowerCase();break}return n}publish(t,e,n){const r=this.getEventNameByNamingConvention(t,"");return n?new Promise(o=>{this._timer=setTimeout(()=>o(this.dispatchCustomEvent(r,e,!0,!0)),n)}):this.dispatchCustomEvent(r,e,!0,!0)}subscribe(t,e){const n=this.getEventNameByNamingConvention(t,"");return this._elementSource.addEventListener(n,r=>e.call(null,r.detail)),this._subscribedEvents.push({name:n,listener:e}),{unsubscribe:()=>this.unsubscribe(n,e)}}subscribeEvent(t,e){const n=this.getEventNameByNamingConvention(t,"");return this._elementSource.addEventListener(n,e),this._subscribedEvents.push({name:n,listener:e}),{unsubscribe:()=>this.unsubscribe(n,e)}}unsubscribe(t,e,n=!0){const r=this.getEventNameByNamingConvention(t,"");this._elementSource.removeEventListener(r,e),n&&this.removeSubscribedEventWhenFound(t,e)}unsubscribeAll(t){if(Array.isArray(t)){let e;do e=t.pop(),e!=null&&e.dispose?e.dispose():e!=null&&e.unsubscribe&&e.unsubscribe();while(e)}else{let e=this._subscribedEvents.pop();for(;e;)this.unsubscribe(e.name,e.listener,!1),e=this._subscribedEvents.pop()}}removeSubscribedEventWhenFound(t,e){const n=this._subscribedEvents.findIndex(r=>r.name===t&&r.listener===e);n>=0&&this._subscribedEvents.splice(n,1)}}var Pp={exports:{}};(function(a,t){(function(e,n){a.exports=n()})(Rr,function(){function e(n){var r=document,o=n.container||r.createElement("div");o.id=o.id||"autocomplete-"+F();var s=o.style,l=n.debounceWaitMs||0,u=n.preventSubmit||!1,p=n.disableAutoSelect||!1,c=o.parentElement,f=[],m="",v=2,_=n.showOnFocus,C,x=0,w,E=!1,I=!1;if(n.minLength!==void 0&&(v=n.minLength),!n.input)throw new Error("input undefined");var k=n.input;o.className="autocomplete "+(n.className||""),o.setAttribute("role","listbox"),k.setAttribute("role","combobox"),k.setAttribute("aria-expanded","false"),k.setAttribute("aria-autocomplete","list"),k.setAttribute("aria-controls",o.id),k.setAttribute("aria-owns",o.id),k.setAttribute("aria-activedescendant",""),k.setAttribute("aria-haspopup","listbox"),s.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function N(){var Ie=o.parentNode;Ie&&Ie.removeChild(o)}function V(){w&&window.clearTimeout(w)}function Q(){o.parentNode||(c||r.body).appendChild(o)}function L(){return!!o.parentNode}function se(){x++,f=[],m="",C=void 0,k.setAttribute("aria-activedescendant",""),k.setAttribute("aria-expanded","false"),N()}function Ce(){if(!L())return;k.setAttribute("aria-expanded","true"),s.height="auto",s.width=k.offsetWidth+"px";var Ie=0,it;function et(){var R=r.documentElement,te=R.clientTop||r.body.clientTop||0,ge=R.clientLeft||r.body.clientLeft||0,$=window.pageYOffset||R.scrollTop,X=window.pageXOffset||R.scrollLeft;it=k.getBoundingClientRect();var ne=it.top+k.offsetHeight+$-te,Me=it.left+X-ge;s.top=ne+"px",s.left=Me+"px",Ie=window.innerHeight-(it.top+k.offsetHeight),Ie<0&&(Ie=0),s.top=ne+"px",s.bottom="",s.left=Me+"px",s.maxHeight=Ie+"px"}et(),et(),n.customize&&it&&n.customize(k,it,o,Ie)}function J(){o.innerHTML="",k.setAttribute("aria-activedescendant","");var Ie=function(ge,$,X){var ne=r.createElement("div");return ne.textContent=ge.label||"",ne};n.render&&(Ie=n.render);var it=function(ge,$){var X=r.createElement("div");return X.textContent=ge,X};n.renderGroup&&(it=n.renderGroup);var et=r.createDocumentFragment(),R=F();if(f.forEach(function(ge,$){if(ge.group&&ge.group!==R){R=ge.group;var X=it(ge.group,m);X&&(X.className+=" group",et.appendChild(X))}var ne=Ie(ge,m,$);ne&&(ne.id=o.id+"_"+$,ne.setAttribute("role","option"),ne.addEventListener("click",function(Me){I=!0;try{n.onSelect(ge,k)}finally{I=!1}se(),Me.preventDefault(),Me.stopPropagation()}),ge===C&&(ne.className+=" selected",ne.setAttribute("aria-selected","true"),k.setAttribute("aria-activedescendant",ne.id)),et.appendChild(ne))}),o.appendChild(et),f.length<1)if(n.emptyMsg){var te=r.createElement("div");te.id=o.id+"_"+F(),te.className="empty",te.textContent=n.emptyMsg,o.appendChild(te),k.setAttribute("aria-activedescendant",te.id)}else{se();return}Q(),Ce(),Pe()}function z(){L()&&J()}function P(){z()}function le(Ie){Ie.target!==o?z():Ie.preventDefault()}function Ke(){I||ze(0)}function Pe(){var Ie=o.getElementsByClassName("selected");if(Ie.length>0){var it=Ie[0],et=it.previousElementSibling;if(et&&et.className.indexOf("group")!==-1&&!et.previousElementSibling&&(it=et),it.offsetTop<o.scrollTop)o.scrollTop=it.offsetTop;else{var R=it.offsetTop+it.offsetHeight,te=o.scrollTop+o.offsetHeight;R>te&&(o.scrollTop+=R-te)}}}function Oe(){var Ie=f.indexOf(C);C=Ie===-1?void 0:f[(Ie+f.length-1)%f.length]}function ye(){var Ie=f.indexOf(C);C=f.length<1?void 0:Ie===-1?f[0]:f[(Ie+1)%f.length]}function Re(Ie,it){var et=L();if(it==="Escape")se();else{if(!et||f.length<1)return;it==="ArrowUp"?Oe():ye(),J()}Ie.preventDefault(),et&&Ie.stopPropagation()}function ae(Ie){if(C){I=!0;try{n.onSelect(C,k)}finally{I=!1}se()}u&&Ie.preventDefault()}function he(Ie){var it=Ie.key;switch(it){case"ArrowUp":case"ArrowDown":case"Escape":Re(Ie,it);break;case"Enter":ae(Ie);break}}function Ne(){_&&ze(1)}function ze(Ie){k.value.length>=v||Ie===1?(V(),w=window.setTimeout(function(){return Be(k.value,Ie,k.selectionStart||0)},Ie===0||Ie===2?l:0)):se()}function Be(Ie,it,et){if(!E){var R=++x;n.fetch(Ie,function(te){x===R&&te&&(f=te,m=Ie,C=f.length<1||p?void 0:f[0],J())},it,et)}}function de(Ie){if(n.keyup){n.keyup({event:Ie,fetch:function(){return ze(0)}});return}!L()&&Ie.key==="ArrowDown"&&ze(0)}function Ee(Ie){n.click&&n.click({event:Ie,fetch:function(){return ze(2)}})}function ve(){setTimeout(function(){r.activeElement!==k&&se()},200)}function He(){Be(k.value,3,k.selectionStart||0)}o.addEventListener("mousedown",function(Ie){Ie.stopPropagation(),Ie.preventDefault()}),o.addEventListener("focus",function(){return k.focus()});function lt(){k.removeEventListener("focus",Ne),k.removeEventListener("keyup",de),k.removeEventListener("click",Ee),k.removeEventListener("keydown",he),k.removeEventListener("input",Ke),k.removeEventListener("blur",ve),window.removeEventListener("resize",P),r.removeEventListener("scroll",le,!0),k.removeAttribute("role"),k.removeAttribute("aria-expanded"),k.removeAttribute("aria-autocomplete"),k.removeAttribute("aria-controls"),k.removeAttribute("aria-activedescendant"),k.removeAttribute("aria-owns"),k.removeAttribute("aria-haspopup"),V(),se(),E=!0}return k.addEventListener("keyup",de),k.addEventListener("click",Ee),k.addEventListener("keydown",he),k.addEventListener("input",Ke),k.addEventListener("blur",ve),k.addEventListener("focus",Ne),window.addEventListener("resize",P),r.addEventListener("scroll",le,!0),{destroy:lt,fetch:He}}return e})})(Pp);var Mp=Pp.exports;const sh=Zc(Mp),Xd=Cl({__proto__:null,default:sh},[Mp]);function Np(a,t){const e=t.fetch;e&&(t.fetch=(n,r,o,s)=>{a.classList.add("slick-autocomplete-loading");const l=r;e(n,p=>{l(p),a.classList.remove("slick-autocomplete-loading")},o,s)})}class Fn{constructor(){this._boundedEvents=[]}get boundedEvents(){return this._boundedEvents}dispose(){this.unbindAll(),this._boundedEvents=[]}bind(t,e,n,r){const o=Array.isArray(e)?e:[e];if(t!=null&&t.forEach)t==null||t.forEach(s=>{for(const l of o)s.addEventListener(l,n,r),this._boundedEvents.push({element:s,eventName:l,listener:n})});else for(const s of o)t.addEventListener(s,n,r),this._boundedEvents.push({element:t,eventName:s,listener:n})}unbind(t,e,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e];for(const s of o)for(const l of r)l!=null&&l.removeEventListener&&l.removeEventListener(s,n)}unbindAll(){for(;this._boundedEvents.length>0;){const t=this._boundedEvents.pop(),{element:e,eventName:n,listener:r}=t;this.unbind(e,n,r)}}}class Lp{constructor(t){this.translaterService=t}filterCollection(t,e,n=Zl.chain){let r=[];if(Array.isArray(e)){r=n===Zl.merge?[]:[...t];for(const o of e)if(n===Zl.merge){const s=this.singleFilterCollection(t,o);r=Ip([...r,...s])}else r=this.singleFilterCollection(r,o)}else r=this.singleFilterCollection(t,e);return r}singleFilterCollection(t,e){let n=[];if(e){const r=e.property,o=e.operator||Lt.equal,s=typeof e.value>"u"?"":e.value;switch(o){case Lt.equal:r?n=t.filter(l=>l[r]===s):n=t.filter(l=>l===s);break;case Lt.contains:r?n=t.filter(l=>{var u;return((u=l[r])===null||u===void 0?void 0:u.toString().indexOf(s.toString()))!==-1}):n=t.filter(l=>l!=null&&l.toString().indexOf(s.toString())!==-1);break;case Lt.notContains:r?n=t.filter(l=>{var u;return((u=l[r])===null||u===void 0?void 0:u.toString().indexOf(s.toString()))===-1}):n=t.filter(l=>l!=null&&l.toString().indexOf(s.toString())===-1);break;case Lt.notEqual:default:r?n=t.filter(l=>l[r]!==s):n=t.filter(l=>l!==s)}}return n}sortCollection(t,e,n,r){var o,s,l,u;if(r&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let p=[];if(n){if(Array.isArray(n))p=e.sort((c,f)=>{var m,v,_,C;for(let x=0,w=n.length;x<w;x++){const E=n[x];if(E!=null&&E.property){const I=E.sortDesc?Yi.desc:Yi.asc,k=E.property,F=(v=(m=E==null?void 0:E.fieldType)!==null&&m!==void 0?m:t==null?void 0:t.type)!==null&&v!==void 0?v:ie.string,N=r?((_=this.translaterService)===null||_===void 0?void 0:_.translate)&&this.translaterService.translate(c[k]||" "):c[k],V=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(f[k]||" "):f[k],Q=ea(F,N,V,I,t);if(Q!==Yi.neutral)return Q}}return Yi.neutral});else if(n!=null&&n.property){const c=n.property,f=n.sortDesc?Yi.desc:Yi.asc,m=(s=(o=n==null?void 0:n.fieldType)!==null&&o!==void 0?o:t==null?void 0:t.type)!==null&&s!==void 0?s:ie.string;p=e.sort((v,_)=>{var C,x;const w=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(v[c]||" "):v[c],E=r?((x=this.translaterService)===null||x===void 0?void 0:x.translate)&&this.translaterService.translate(_[c]||" "):_[c],I=ea(m,w,E,f,t);return I!==Yi.neutral?I:Yi.neutral})}else if(n&&!n.property){const c=n.sortDesc?Yi.desc:Yi.asc,f=(u=(l=n==null?void 0:n.fieldType)!==null&&l!==void 0?l:t==null?void 0:t.type)!==null&&u!==void 0?u:ie.string;p=e.sort((m,v)=>{var _,C;const x=r?((_=this.translaterService)===null||_===void 0?void 0:_.translate)&&this.translaterService.translate(m||" "):m,w=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(v||" "):v,E=ea(f,x,w,c,t);return E!==Yi.neutral?E:Yi.neutral})}}return p}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:Hp,setPrototypeOf:Bp,isFrozen:o_,getPrototypeOf:s_,getOwnPropertyDescriptor:l_}=Object;let{freeze:Er,seal:Ro,create:a_}=Object,{apply:lh,construct:ah}=typeof Reflect<"u"&&Reflect;lh||(lh=function(t,e,n){return t.apply(e,n)}),Er||(Er=function(t){return t}),Ro||(Ro=function(t){return t}),ah||(ah=function(t,e){return new t(...e)});const d_=co(Array.prototype.forEach),Vp=co(Array.prototype.pop),Wa=co(Array.prototype.push),qd=co(String.prototype.toLowerCase),dh=co(String.prototype.toString),u_=co(String.prototype.match),Fo=co(String.prototype.replace),c_=co(String.prototype.indexOf),h_=co(String.prototype.trim),Xr=co(RegExp.prototype.test),$a=f_(TypeError);function co(a){return function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return lh(a,t,n)}}function f_(a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ah(a,e)}}function ui(a,t,e){var n;e=(n=e)!==null&&n!==void 0?n:qd,Bp&&Bp(a,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=e(o);s!==o&&(o_(t)||(t[r]=s),o=s)}a[o]=!0}return a}function ta(a){const t=a_(null);for(const[e,n]of Hp(a))t[e]=n;return t}function Kd(a,t){for(;a!==null;){const n=l_(a,t);if(n){if(n.get)return co(n.get);if(typeof n.value=="function")return co(n.value)}a=s_(a)}function e(n){return console.warn("fallback value for",n),null}return e}const zp=Er(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uh=Er(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ch=Er(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),p_=Er(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hh=Er(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),m_=Er(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Up=Er(["#text"]),Gp=Er(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),fh=Er(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wp=Er(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zd=Er(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v_=Ro(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g_=Ro(/<%[\w\W]*|[\w\W]*%>/gm),__=Ro(/\${[\w\W]*}/gm),b_=Ro(/^data-[\-\w.\u00B7-\uFFFF]/),C_=Ro(/^aria-[\-\w]+$/),$p=Ro(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),y_=Ro(/^(?:\w+script|data):/i),E_=Ro(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yp=Ro(/^html$/i);var jp=Object.freeze({__proto__:null,MUSTACHE_EXPR:v_,ERB_EXPR:g_,TMPLIT_EXPR:__,DATA_ATTR:b_,ARIA_ATTR:C_,IS_ALLOWED_URI:$p,IS_SCRIPT_OR_DATA:y_,ATTR_WHITESPACE:E_,DOCTYPE_NAME:Yp});const S_=()=>typeof window>"u"?null:window,w_=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Xp(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S_();const t=Ct=>Xp(Ct);if(t.version="3.0.5",t.removed=[],!a||!a.document||a.document.nodeType!==9)return t.isSupported=!1,t;const e=a.document,n=e.currentScript;let{document:r}=a;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:p,NamedNodeMap:c=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:v}=a,_=u.prototype,C=Kd(_,"cloneNode"),x=Kd(_,"nextSibling"),w=Kd(_,"childNodes"),E=Kd(_,"parentNode");if(typeof s=="function"){const Ct=r.createElement("template");Ct.content&&Ct.content.ownerDocument&&(r=Ct.content.ownerDocument)}let I,k="";const{implementation:F,createNodeIterator:N,createDocumentFragment:V,getElementsByTagName:Q}=r,{importNode:L}=e;let se={};t.isSupported=typeof Hp=="function"&&typeof E=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ce,ERB_EXPR:J,TMPLIT_EXPR:z,DATA_ATTR:P,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:Ke,ATTR_WHITESPACE:Pe}=jp;let{IS_ALLOWED_URI:Oe}=jp,ye=null;const Re=ui({},[...zp,...uh,...ch,...hh,...Up]);let ae=null;const he=ui({},[...Gp,...fh,...Wp,...Zd]);let Ne=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ze=null,Be=null,de=!0,Ee=!0,ve=!1,He=!0,lt=!1,Ie=!1,it=!1,et=!1,R=!1,te=!1,ge=!1,$=!0,X=!1;const ne="user-content-";let Me=!0,Ue=!1,Se={},Ye=null;const pt=ui({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Le=ui({},["audio","video","img","source","image","track"]);let Xt=null;const It=ui({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yi="http://www.w3.org/1998/Math/MathML",q="http://www.w3.org/2000/svg",W="http://www.w3.org/1999/xhtml";let pe=W,ke=!1,at=null;const ot=ui({},[yi,q,W],dh);let ct;const Rt=["application/xhtml+xml","text/html"],Ht="text/html";let Tt,Ut=null;const Kt=r.createElement("form"),Ni=function(_e){return _e instanceof RegExp||_e instanceof Function},Li=function(_e){if(!(Ut&&Ut===_e)){if((!_e||typeof _e!="object")&&(_e={}),_e=ta(_e),ct=Rt.indexOf(_e.PARSER_MEDIA_TYPE)===-1?ct=Ht:ct=_e.PARSER_MEDIA_TYPE,Tt=ct==="application/xhtml+xml"?dh:qd,ye="ALLOWED_TAGS"in _e?ui({},_e.ALLOWED_TAGS,Tt):Re,ae="ALLOWED_ATTR"in _e?ui({},_e.ALLOWED_ATTR,Tt):he,at="ALLOWED_NAMESPACES"in _e?ui({},_e.ALLOWED_NAMESPACES,dh):ot,Xt="ADD_URI_SAFE_ATTR"in _e?ui(ta(It),_e.ADD_URI_SAFE_ATTR,Tt):It,Ge="ADD_DATA_URI_TAGS"in _e?ui(ta(Le),_e.ADD_DATA_URI_TAGS,Tt):Le,Ye="FORBID_CONTENTS"in _e?ui({},_e.FORBID_CONTENTS,Tt):pt,ze="FORBID_TAGS"in _e?ui({},_e.FORBID_TAGS,Tt):{},Be="FORBID_ATTR"in _e?ui({},_e.FORBID_ATTR,Tt):{},Se="USE_PROFILES"in _e?_e.USE_PROFILES:!1,de=_e.ALLOW_ARIA_ATTR!==!1,Ee=_e.ALLOW_DATA_ATTR!==!1,ve=_e.ALLOW_UNKNOWN_PROTOCOLS||!1,He=_e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=_e.SAFE_FOR_TEMPLATES||!1,Ie=_e.WHOLE_DOCUMENT||!1,R=_e.RETURN_DOM||!1,te=_e.RETURN_DOM_FRAGMENT||!1,ge=_e.RETURN_TRUSTED_TYPE||!1,et=_e.FORCE_BODY||!1,$=_e.SANITIZE_DOM!==!1,X=_e.SANITIZE_NAMED_PROPS||!1,Me=_e.KEEP_CONTENT!==!1,Ue=_e.IN_PLACE||!1,Oe=_e.ALLOWED_URI_REGEXP||$p,pe=_e.NAMESPACE||W,Ne=_e.CUSTOM_ELEMENT_HANDLING||{},_e.CUSTOM_ELEMENT_HANDLING&&Ni(_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&Ni(_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&typeof _e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ne.allowCustomizedBuiltInElements=_e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),lt&&(Ee=!1),te&&(R=!0),Se&&(ye=ui({},[...Up]),ae=[],Se.html===!0&&(ui(ye,zp),ui(ae,Gp)),Se.svg===!0&&(ui(ye,uh),ui(ae,fh),ui(ae,Zd)),Se.svgFilters===!0&&(ui(ye,ch),ui(ae,fh),ui(ae,Zd)),Se.mathMl===!0&&(ui(ye,hh),ui(ae,Wp),ui(ae,Zd))),_e.ADD_TAGS&&(ye===Re&&(ye=ta(ye)),ui(ye,_e.ADD_TAGS,Tt)),_e.ADD_ATTR&&(ae===he&&(ae=ta(ae)),ui(ae,_e.ADD_ATTR,Tt)),_e.ADD_URI_SAFE_ATTR&&ui(Xt,_e.ADD_URI_SAFE_ATTR,Tt),_e.FORBID_CONTENTS&&(Ye===pt&&(Ye=ta(Ye)),ui(Ye,_e.FORBID_CONTENTS,Tt)),Me&&(ye["#text"]=!0),Ie&&ui(ye,["html","head","body"]),ye.table&&(ui(ye,["tbody"]),delete ze.tbody),_e.TRUSTED_TYPES_POLICY){if(typeof _e.TRUSTED_TYPES_POLICY.createHTML!="function")throw $a('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $a('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=_e.TRUSTED_TYPES_POLICY,k=I.createHTML("")}else I===void 0&&(I=w_(v,n)),I!==null&&typeof k=="string"&&(k=I.createHTML(""));Er&&Er(_e),Ut=_e}},U=ui({},["mi","mo","mn","ms","mtext"]),Z=ui({},["foreignobject","desc","title","annotation-xml"]),ce=ui({},["title","style","font","a","script"]),we=ui({},uh);ui(we,ch),ui(we,p_);const st=ui({},hh);ui(st,m_);const vt=function(_e){let je=E(_e);(!je||!je.tagName)&&(je={namespaceURI:pe,tagName:"template"});const mt=qd(_e.tagName),Jt=qd(je.tagName);return at[_e.namespaceURI]?_e.namespaceURI===q?je.namespaceURI===W?mt==="svg":je.namespaceURI===yi?mt==="svg"&&(Jt==="annotation-xml"||U[Jt]):!!we[mt]:_e.namespaceURI===yi?je.namespaceURI===W?mt==="math":je.namespaceURI===q?mt==="math"&&Z[Jt]:!!st[mt]:_e.namespaceURI===W?je.namespaceURI===q&&!Z[Jt]||je.namespaceURI===yi&&!U[Jt]?!1:!st[mt]&&(ce[mt]||!we[mt]):!!(ct==="application/xhtml+xml"&&at[_e.namespaceURI]):!1},ht=function(_e){Wa(t.removed,{element:_e});try{_e.parentNode.removeChild(_e)}catch{_e.remove()}},wt=function(_e,je){try{Wa(t.removed,{attribute:je.getAttributeNode(_e),from:je})}catch{Wa(t.removed,{attribute:null,from:je})}if(je.removeAttribute(_e),_e==="is"&&!ae[_e])if(R||te)try{ht(je)}catch{}else try{je.setAttribute(_e,"")}catch{}},Bt=function(_e){let je,mt;if(et)_e="<remove></remove>"+_e;else{const mn=u_(_e,/^[\r\n\t ]+/);mt=mn&&mn[0]}ct==="application/xhtml+xml"&&pe===W&&(_e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_e+"</body></html>");const Jt=I?I.createHTML(_e):_e;if(pe===W)try{je=new m().parseFromString(Jt,ct)}catch{}if(!je||!je.documentElement){je=F.createDocument(pe,"template",null);try{je.documentElement.innerHTML=ke?k:Jt}catch{}}const Mi=je.body||je.documentElement;return _e&&mt&&Mi.insertBefore(r.createTextNode(mt),Mi.childNodes[0]||null),pe===W?Q.call(je,Ie?"html":"body")[0]:Ie?je.documentElement:Mi},Et=function(_e){return N.call(_e.ownerDocument||_e,_e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},_t=function(_e){return _e instanceof f&&(typeof _e.nodeName!="string"||typeof _e.textContent!="string"||typeof _e.removeChild!="function"||!(_e.attributes instanceof c)||typeof _e.removeAttribute!="function"||typeof _e.setAttribute!="function"||typeof _e.namespaceURI!="string"||typeof _e.insertBefore!="function"||typeof _e.hasChildNodes!="function")},Zt=function(_e){return typeof l=="object"?_e instanceof l:_e&&typeof _e=="object"&&typeof _e.nodeType=="number"&&typeof _e.nodeName=="string"},Ii=function(_e,je,mt){se[_e]&&d_(se[_e],Jt=>{Jt.call(t,je,mt,Ut)})},Gi=function(_e){let je;if(Ii("beforeSanitizeElements",_e,null),_t(_e))return ht(_e),!0;const mt=Tt(_e.nodeName);if(Ii("uponSanitizeElement",_e,{tagName:mt,allowedTags:ye}),_e.hasChildNodes()&&!Zt(_e.firstElementChild)&&(!Zt(_e.content)||!Zt(_e.content.firstElementChild))&&Xr(/<[/\w]/g,_e.innerHTML)&&Xr(/<[/\w]/g,_e.textContent))return ht(_e),!0;if(!ye[mt]||ze[mt]){if(!ze[mt]&&Hi(mt)&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,mt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(mt)))return!1;if(Me&&!Ye[mt]){const Jt=E(_e)||_e.parentNode,Mi=w(_e)||_e.childNodes;if(Mi&&Jt){const mn=Mi.length;for(let pi=mn-1;pi>=0;--pi)Jt.insertBefore(C(Mi[pi],!0),x(_e))}}return ht(_e),!0}return _e instanceof u&&!vt(_e)||(mt==="noscript"||mt==="noembed"||mt==="noframes")&&Xr(/<\/no(script|embed|frames)/i,_e.innerHTML)?(ht(_e),!0):(lt&&_e.nodeType===3&&(je=_e.textContent,je=Fo(je,Ce," "),je=Fo(je,J," "),je=Fo(je,z," "),_e.textContent!==je&&(Wa(t.removed,{element:_e.cloneNode()}),_e.textContent=je)),Ii("afterSanitizeElements",_e,null),!1)},Qt=function(_e,je,mt){if($&&(je==="id"||je==="name")&&(mt in r||mt in Kt))return!1;if(!(Ee&&!Be[je]&&Xr(P,je))){if(!(de&&Xr(le,je))){if(!ae[je]||Be[je]){if(!(Hi(_e)&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,_e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(_e))&&(Ne.attributeNameCheck instanceof RegExp&&Xr(Ne.attributeNameCheck,je)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(je))||je==="is"&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&Xr(Ne.tagNameCheck,mt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(mt))))return!1}else if(!Xt[je]){if(!Xr(Oe,Fo(mt,Pe,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&_e!=="script"&&c_(mt,"data:")===0&&Ge[_e])){if(!(ve&&!Xr(Ke,Fo(mt,Pe,"")))){if(mt)return!1}}}}}}return!0},Hi=function(_e){return _e.indexOf("-")>0},Nn=function(_e){let je,mt,Jt,Mi;Ii("beforeSanitizeAttributes",_e,null);const{attributes:mn}=_e;if(!mn)return;const pi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae};for(Mi=mn.length;Mi--;){je=mn[Mi];const{name:Xi,namespaceURI:lr}=je;if(mt=Xi==="value"?je.value:h_(je.value),Jt=Tt(Xi),pi.attrName=Jt,pi.attrValue=mt,pi.keepAttr=!0,pi.forceKeepAttr=void 0,Ii("uponSanitizeAttribute",_e,pi),mt=pi.attrValue,pi.forceKeepAttr||(wt(Xi,_e),!pi.keepAttr))continue;if(!He&&Xr(/\/>/i,mt)){wt(Xi,_e);continue}lt&&(mt=Fo(mt,Ce," "),mt=Fo(mt,J," "),mt=Fo(mt,z," "));const Ei=Tt(_e.nodeName);if(Qt(Ei,Jt,mt)){if(X&&(Jt==="id"||Jt==="name")&&(wt(Xi,_e),mt=ne+mt),I&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!lr)switch(v.getAttributeType(Ei,Jt)){case"TrustedHTML":{mt=I.createHTML(mt);break}case"TrustedScriptURL":{mt=I.createScriptURL(mt);break}}try{lr?_e.setAttributeNS(lr,Xi,mt):_e.setAttribute(Xi,mt),Vp(t.removed)}catch{}}}Ii("afterSanitizeAttributes",_e,null)},pn=function Ct(_e){let je;const mt=Et(_e);for(Ii("beforeSanitizeShadowDOM",_e,null);je=mt.nextNode();)Ii("uponSanitizeShadowNode",je,null),!Gi(je)&&(je.content instanceof o&&Ct(je.content),Nn(je));Ii("afterSanitizeShadowDOM",_e,null)};return t.sanitize=function(Ct){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je,mt,Jt,Mi;if(ke=!Ct,ke&&(Ct="<!-->"),typeof Ct!="string"&&!Zt(Ct))if(typeof Ct.toString=="function"){if(Ct=Ct.toString(),typeof Ct!="string")throw $a("dirty is not a string, aborting")}else throw $a("toString is not a function");if(!t.isSupported)return Ct;if(it||Li(_e),t.removed=[],typeof Ct=="string"&&(Ue=!1),Ue){if(Ct.nodeName){const Xi=Tt(Ct.nodeName);if(!ye[Xi]||ze[Xi])throw $a("root node is forbidden and cannot be sanitized in-place")}}else if(Ct instanceof l)je=Bt("<!---->"),mt=je.ownerDocument.importNode(Ct,!0),mt.nodeType===1&&mt.nodeName==="BODY"||mt.nodeName==="HTML"?je=mt:je.appendChild(mt);else{if(!R&&!lt&&!Ie&&Ct.indexOf("<")===-1)return I&&ge?I.createHTML(Ct):Ct;if(je=Bt(Ct),!je)return R?null:ge?k:""}je&&et&&ht(je.firstChild);const mn=Et(Ue?Ct:je);for(;Jt=mn.nextNode();)Gi(Jt)||(Jt.content instanceof o&&pn(Jt.content),Nn(Jt));if(Ue)return Ct;if(R){if(te)for(Mi=V.call(je.ownerDocument);je.firstChild;)Mi.appendChild(je.firstChild);else Mi=je;return(ae.shadowroot||ae.shadowrootmode)&&(Mi=L.call(e,Mi,!0)),Mi}let pi=Ie?je.outerHTML:je.innerHTML;return Ie&&ye["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&Xr(Yp,je.ownerDocument.doctype.name)&&(pi="<!DOCTYPE "+je.ownerDocument.doctype.name+`>
5
5
  `+pi),lt&&(pi=Fo(pi,Ce," "),pi=Fo(pi,J," "),pi=Fo(pi,z," ")),I&&ge?I.createHTML(pi):pi},t.setConfig=function(Ct){Li(Ct),it=!0},t.clearConfig=function(){Ut=null,it=!1},t.isValidAttribute=function(Ct,_e,je){Ut||Li({});const mt=Tt(Ct),Jt=Tt(_e);return Qt(mt,Jt,je)},t.addHook=function(Ct,_e){typeof _e=="function"&&(se[Ct]=se[Ct]||[],Wa(se[Ct],_e))},t.removeHook=function(Ct){if(se[Ct])return Vp(se[Ct])},t.removeHooks=function(Ct){se[Ct]&&(se[Ct]=[])},t.removeAllHooks=function(){se={}},t}var qp=Xp();const ph=Object.freeze(Object.defineProperty({__proto__:null,default:qp},Symbol.toStringTag,{value:"Module"}));var mh;const Qd=(mh=ph==null?void 0:qp)!==null&&mh!==void 0?mh:ph;function Kp(a,t,e,n,r=!1,o,s){var l,u,p,c,f,m,v,_,C,x,w,E,I,k,F,N,V,Q;const L=(l=e==null?void 0:e.id)!==null&&l!==void 0?l:"",se=n.getOptions(),Ce=(u=a==="editor"?e==null?void 0:e.internalColumnEditor:e==null?void 0:e.filter)!==null&&u!==void 0?u:{},J=(p=Ce==null?void 0:Ce.collectionOptions)!==null&&p!==void 0?p:{},z=(c=J==null?void 0:J.separatorBetweenTextLabels)!==null&&c!==void 0?c:"",P=(f=Ce==null?void 0:Ce.enableTranslateLabel)!==null&&f!==void 0?f:!1,le=(m=se==null?void 0:se.enableTranslate)!==null&&m!==void 0?m:!1,Ke=(v=Ce==null?void 0:Ce.enableRenderHtml)!==null&&v!==void 0?v:!1,Pe=(_=se==null?void 0:se.sanitizeHtmlOptions)!==null&&_!==void 0?_:{},Oe=(x=(C=Ce==null?void 0:Ce.customStructure)===null||C===void 0?void 0:C.label)!==null&&x!==void 0?x:"label",ye=(E=(w=Ce==null?void 0:Ce.customStructure)===null||w===void 0?void 0:w.labelPrefix)!==null&&E!==void 0?E:"labelPrefix",Re=(k=(I=Ce==null?void 0:Ce.customStructure)===null||I===void 0?void 0:I.labelSuffix)!==null&&k!==void 0?k:"labelSuffix",ae=(N=(F=Ce==null?void 0:Ce.customStructure)===null||F===void 0?void 0:F.optionLabel)!==null&&N!==void 0?N:"value",he=(Q=(V=Ce==null?void 0:Ce.customStructure)===null||V===void 0?void 0:V.value)!==null&&Q!==void 0?Q:"value",Ne=De("select",{className:"ms-filter search-filter"}),ze=a==="filter"?["search-filter",`filter-${L}`]:["select-editor",`editor-${L}`];Ne.classList.add(...ze),Ne.multiple=r;const Be=[];let de=!1;if(Array.isArray(t))if(t.every(Ee=>typeof Ee=="number"||typeof Ee=="string"))for(const Ee of t){const ve={text:Ee,value:Ee};a==="filter"&&Array.isArray(s)&&(ve.selected=s.findIndex(He=>He===Ee)>=0),Be.push(ve),(ve.selected&&r||ve.selected&&!r&&Ee!=="")&&(de=!0)}else t.forEach(Ee=>{if(Ee===void 0||typeof Ee=="object"&&Ee[Oe]===void 0&&Ee.labelKey===void 0)throw new Error("[Slickgrid-Universal] Select Filter/Editor collection with value/label (or value/labelKey when using Locale) is required to populate the Select list, for example:: { filter: model: Filters.multipleSelect, collection: [ { value: '1', label: 'One' } ]')");const ve=Ee.labelKey||Ee[Oe],He=(Ee.labelKey||P&&o)&&ve&&le?o==null?void 0:o.translate(ve||" "):ve;let lt=Ee[ye]||"",Ie=Ee[Re]||"",it=Ee.hasOwnProperty(ae)?Ee[ae]:"";it!=null&&it.toString&&(it=it.toString().replace(/\"/g,"'")),lt=P&&o&&lt&&typeof lt=="string"?o.translate(lt||" "):lt,Ie=P&&o&&Ie&&typeof Ie=="string"?o.translate(Ie||" "):Ie,it=P&&o&&it&&typeof it=="string"?o.translate(it||" "):it;let R=[lt,typeof He=="string"||typeof He=="number"?He.toString():He,Ie].filter($=>$).join(z);const te={text:"",value:""};Ke&&(R=Pn(se,R,Pe)),te.text=R;let ge=Ee[he];ge==null&&(ge=""),a==="filter"&&Array.isArray(s)&&(te.selected=s.findIndex($=>`${$}`==`${Ee[he]}`)>=0),te.value=`${ge??""}`,Be.push(te),(te.selected&&r||te.selected&&!r&&Ee[he]!=="")&&(de=!0)});return{selectElement:Ne,dataCollection:Be,hasFoundSearchTerm:de}}function vh(a){var t,e,n,r;let o=0,s=0,l=0,u=0;const p=(t=window.innerHeight)!==null&&t!==void 0?t:0,c=(e=window.innerWidth)!==null&&e!==void 0?e:0,f=D_(),m=f.top,v=f.left,_=qn(a);if(_){const C=(n=_.top)!==null&&n!==void 0?n:0,x=(r=_.left)!==null&&r!==void 0?r:0;s=C-m,o=p-(C-m),l=x-v,u=c-(x-v)}return{top:s,bottom:o,left:l,right:u}}function De(a,t,e){const n=document.createElement(a);return t&&Object.keys(t).forEach(r=>{const o=t[r];typeof o=="object"?Object.assign(n[r],o):n[r]=t[r]}),e!=null&&e.appendChild&&e.appendChild(n),n}function gh(a){if(a)for(const t of Object.keys(a))Array.isArray(a[t])&&gh(a[t]),a[t]instanceof HTMLElement&&(a[t]=null)}function en(a){if(a!=null&&a.firstChild)for(;a.firstChild;)a.lastChild&&a.removeChild(a.lastChild);return a}function x_(a,t){if(!a||!t)return;const e=a.getBoundingClientRect(),n=t.getBoundingClientRect();return{top:n.top-e.top,right:n.right-e.right,bottom:n.bottom-e.bottom,left:n.left-e.left}}function qn(a){var t;if(!a)return;const e=(t=a==null?void 0:a.getBoundingClientRect)===null||t===void 0?void 0:t.call(a);let n=0,r=0,o=0,s=0;return(e==null?void 0:e.top)!==void 0&&e.left!==void 0&&(n=e.top+window.pageYOffset,r=e.left+window.pageXOffset,s=e.right,o=e.bottom),{top:n,left:r,bottom:o,right:s}}function Zp(a,t){let e=0;if(a){const n=t==="height"?"clientHeight":"clientWidth",r=t==="height"?["top","bottom"]:["left","right"];e=a[n];for(const o of r)e-=parseFloat(T_(a,`padding-${o}`))||0}return e}function T_(a,t){return window.getComputedStyle(a,null).getPropertyValue(t)}function O_(a){let t="";return a!=null&&a.localName&&(t=a!=null&&a.className?`${a.localName}.${Array.from(a.classList).join(".")}`:a.localName),t}function Jd(a,t){if(a)for(const e of t){const n=a.getAttribute(e);if(n)return n}return null}function Xs(a,t="auto"){return(/^[0-9]+$/i.test(`${a}`)?`${+a}px`:a)||t}function A_(a){const t=typeof a=="string"?a:String(a),e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return(t||"").toString().replace(/[&<>"']/g,n=>e[n])}function k_(a){return a.replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(e))}function I_(a,t){const e=a.length;let n=A_(a);if(e<t)for(let r=e;r<t;r++)n+="&nbsp;";return n}function or(a){const t=document.createElement("div");return t.innerHTML=a,t.textContent||t.innerText||""}function Pn(a,t,e){let n=t;return typeof(a==null?void 0:a.sanitizer)=="function"?n=a.sanitizer(t||""):typeof(Qd==null?void 0:Qd.sanitize)=="function"&&(n=(Qd.sanitize(t||"",e||{})||"").toString()),n}function D_(){return{left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0}}class R_{constructor(t,e,n){this.sharedService=t,this.backendUtilities=e,this.translaterService=n}getPickerTitleOutputString(t,e){var n,r,o,s,l,u,p,c,f,m,v,_,C,x,w;if(this.sharedService.gridOptions&&this.sharedService.gridOptions.enableTranslate&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let E="";const I=(r=(n=this.sharedService.gridOptions)===null||n===void 0?void 0:n[e])!==null&&r!==void 0?r:{},k=(s=(o=this.sharedService.gridOptions)===null||o===void 0?void 0:o.enableTranslate)!==null&&s!==void 0?s:!1,F=(u=(l=this.sharedService.gridOptions)===null||l===void 0?void 0:l.locales)!==null&&u!==void 0?u:Xe.locales,N=I==null?void 0:I[t],V=I==null?void 0:I[`${t}Key`],Q=this.sharedService.gridOptions,L=ao(Q);if(V&&(!((p=this.translaterService)===null||p===void 0)&&p.translate))E=this.translaterService.translate(V||" ");else switch(t){case"commandTitle":E=N||k&&((c=this.translaterService)===null||c===void 0?void 0:c.getCurrentLanguage)&&((f=this.translaterService)===null||f===void 0?void 0:f.translate(`${L}COMMANDS`||" "))||(F==null?void 0:F.TEXT_COMMANDS);break;case"columnTitle":E=N||k&&((m=this.translaterService)===null||m===void 0?void 0:m.getCurrentLanguage)&&((v=this.translaterService)===null||v===void 0?void 0:v.translate(`${L}COLUMNS`||" "))||(F==null?void 0:F.TEXT_COLUMNS);break;case"forceFitTitle":E=N||k&&((_=this.translaterService)===null||_===void 0?void 0:_.getCurrentLanguage)&&((C=this.translaterService)===null||C===void 0?void 0:C.translate(`${L}FORCE_FIT_COLUMNS`||" "))||(F==null?void 0:F.TEXT_FORCE_FIT_COLUMNS);break;case"syncResizeTitle":E=N||k&&((x=this.translaterService)===null||x===void 0?void 0:x.getCurrentLanguage)&&((w=this.translaterService)===null||w===void 0?void 0:w.translate(`${L}SYNCHRONOUS_RESIZE`||" "))||(F==null?void 0:F.TEXT_SYNCHRONOUS_RESIZE);break;default:E=N;break}return E}readjustFrozenColumnIndexWhenNeeded(t,e,n){if(t>=0){const r=n.findIndex(o=>o.id===this.sharedService.frozenVisibleColumnId);r>=0&&r!==t&&(this.sharedService.gridOptions.frozenColumn=r,this.sharedService.slickGrid.setOptions({frozenColumn:r})),Array.isArray(n)&&Array.isArray(e)&&n.length!==e.length&&this.sharedService.slickGrid.setColumns(n)}}refreshBackendDataset(t){var e;let n=this.sharedService.gridOptions;t&&(n={...this.sharedService.gridOptions,...t},this.sharedService.gridOptions=n),(e=this.backendUtilities)===null||e===void 0||e.refreshBackendDataset(n)}runOverrideFunctionWhenExists(t,e){return typeof t=="function"?!!t.call(this,e):!0}sortItems(t,e){Array.isArray(t)&&t.sort((n,r)=>n&&r&&n.hasOwnProperty(e)&&r.hasOwnProperty(e)?n[e]-r[e]:0)}translateItems(t,e,n){var r,o;if(Array.isArray(t))for(const s of t)s.hasOwnProperty(e)&&(s[n]=(o=(r=this.translaterService)===null||r===void 0?void 0:r.translate)===null||o===void 0?void 0:o.call(r,s[e]))}translateMenuItemsFromTitleKey(t){for(const e of t)typeof e=="object"&&e.titleKey&&(e.title=this.translateWhenEnabledAndServiceExist(`${e.titleKey}`,`TEXT_${e.titleKey}`))}translateWhenEnabledAndServiceExist(t,e,n){var r,o,s;let l="";const u=(r=this.sharedService)===null||r===void 0?void 0:r.gridOptions,p=(o=u==null?void 0:u.locales)!==null&&o!==void 0?o:Xe.locales;return n?l=n:u.enableTranslate&&(!((s=this.translaterService)===null||s===void 0)&&s.translate)?l=this.translaterService.translate(t||" "):e in p?l=p[e]:l=e,l}}class F_{constructor(t){this._defaults={enableForCells:!0,enableForHeaderCells:!1,maxToolTipLength:void 0,replaceExisting:!0},this.pluginName="AutoTooltips",this._eventHandler=new Slick.EventHandler,this._addonOptions=t}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}init(t){this._addonOptions={...this._defaults,...this.addonOptions},this._grid=t,this._addonOptions.enableForCells&&this._eventHandler.subscribe(this._grid.onMouseEnter,this.handleMouseEnter.bind(this)),this._addonOptions.enableForHeaderCells&&this._eventHandler.subscribe(this._grid.onHeaderMouseEnter,this.handleHeaderMouseEnter.bind(this))}dispose(){var t;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll()}handleMouseEnter(t){var e,n,r,o,s;const l=this._grid.getCellFromEvent(t);if(l){let u=this._grid.getCellNode(l.row,l.cell),p;this._addonOptions&&u&&(!u.title||!((e=this._addonOptions)===null||e===void 0)&&e.replaceExisting)&&(u.clientWidth<u.scrollWidth?(p=(r=(n=u.textContent)===null||n===void 0?void 0:n.trim())!==null&&r!==void 0?r:"",!((o=this._addonOptions)===null||o===void 0)&&o.maxToolTipLength&&p.length>((s=this._addonOptions)===null||s===void 0?void 0:s.maxToolTipLength)&&(p=p.substring(0,this._addonOptions.maxToolTipLength-3)+"...")):p="",u.title=p),u=null}}handleHeaderMouseEnter(t,e){var n;const r=e.column;let o;const s=t.target;s&&(o=s.closest(".slick-header-column"),o&&!(r!=null&&r.toolTip)&&(o.title=s.clientWidth<o.clientWidth&&(n=r==null?void 0:r.name)!==null&&n!==void 0?n:"")),o=null}}class P_{constructor(){this.pluginName="CellExcelCopyManager",this._eventHandler=new Slick.EventHandler,this._bindingEventService=new Fn}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get commandQueue(){return this._commandQueue}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get undoRedoBuffer(){return this._undoRedoBuffer}init(t,e){this._grid=t,this.createUndoRedoBuffer(),this._cellSelectionModel=new B_,this._grid.setSelectionModel(this._cellSelectionModel),this._bindingEventService.bind(document.body,"keydown",this.handleBodyKeyDown.bind(this)),this._addonOptions={...this.getDefaultOptions(),...e},this._cellExternalCopyManagerPlugin=new N_,this._cellExternalCopyManagerPlugin.init(this._grid,this._addonOptions),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onCopyCells,(n,r)=>{this._addonOptions&&typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(n,r)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onCopyCancelled,(n,r)=>{this._addonOptions&&typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(n,r)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onPasteCells,(n,r)=>{this._addonOptions&&typeof this._addonOptions.onPasteCells=="function"&&this._addonOptions.onPasteCells(n,r)})}dispose(){var t,e;this._eventHandler.unsubscribeAll(),this._bindingEventService.unbindAll(),(t=this._cellSelectionModel)===null||t===void 0||t.dispose(),(e=this._cellExternalCopyManagerPlugin)===null||e===void 0||e.dispose()}createUndoRedoBuffer(){let t=0;this._commandQueue=[],this._undoRedoBuffer={queueAndExecuteCommand:e=>{this._commandQueue[t]=e,t++,e.execute()},undo:()=>{if(t===0)return;t--;const e=this._commandQueue[t];e&&Slick.GlobalEditorLock.cancelCurrentEdit()&&e.undo()},redo:()=>{if(t>=this._commandQueue.length)return;const e=this._commandQueue[t];t++,e&&Slick.GlobalEditorLock.cancelCurrentEdit()&&e.execute()}}}getDefaultOptions(){let t=0;return{clipboardCommandHandler:e=>{this._undoRedoBuffer.queueAndExecuteCommand.call(this._undoRedoBuffer,e)},dataItemColumnValueExtractor:(e,n)=>{var r,o;if(!this.gridOptions.editable||!n.editor){const s=n.exportWithFormatter!==void 0?n.exportWithFormatter:(r=this.gridOptions.textExportOptions)===null||r===void 0?void 0:r.exportWithFormatter;if(n.formatter&&s){const l=n.formatter(0,0,e[n.field],n,e,this._grid);if(n.sanitizeDataExport||!((o=this.gridOptions.textExportOptions)===null||o===void 0)&&o.sanitizeDataExport){let u=l;return l&&typeof l=="object"&&l.hasOwnProperty("text")&&(u=l.text),u===null&&(u=""),or(u)}return l}}return null},readOnlyMode:!1,includeHeaderWhenCopying:!1,newRowCreator:e=>{for(let n=0;n<e;n++)this._grid.getData().addItem({id:`newRow_${t++}`})}}}handleBodyKeyDown(t){(t.keyCode||t.code)===90&&(t.ctrlKey||t.metaKey)&&(t.shiftKey?this._undoRedoBuffer.redo():this._undoRedoBuffer.undo())}}const M_=2e3,Qp=100;class N_{constructor(){this._bodyElement=document.body,this._copiedCellStyle="copied",this._copiedCellStyleLayerKey="copy-manager",this._copiedRanges=null,this.pluginName="CellExternalCopyManager",this.onCopyCells=new Slick.Event,this.onCopyCancelled=new Slick.Event,this.onPasteCells=new Slick.Event,this._eventHandler=new Slick.EventHandler}get addonOptions(){return this._addonOptions}get clipCommand(){return this._clipCommand}get eventHandler(){return this._eventHandler}init(t,e){this._grid=t,this._addonOptions={...this._addonOptions,...e},this._copiedCellStyleLayerKey=this._addonOptions.copiedCellStyleLayerKey||"copy-manager",this._copiedCellStyle=this._addonOptions.copiedCellStyle||"copied",this._bodyElement=this._addonOptions.bodyElement||document.body,this._onCopyInit=this._addonOptions.onCopyInit||void 0,this._onCopySuccess=this._addonOptions.onCopySuccess||void 0,this._eventHandler.subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this));const n=t.getSelectionModel();if(!n)throw new Error("Selection model is mandatory for this plugin. Please set a selection model on the grid before adding this plugin: grid.setSelectionModel(new Slick.CellSelectionModel())");this._eventHandler.subscribe(n.onSelectedRangesChanged,()=>{this._grid.getEditorLock().isActive()||this._grid.focus()})}dispose(){this._eventHandler.unsubscribeAll()}clearCopySelection(){this._grid.removeCellCssStyles(this._copiedCellStyleLayerKey)}getHeaderValueForColumn(t){if(typeof this._addonOptions.headerColumnValueExtractor=="function"){const e=this._addonOptions.headerColumnValueExtractor(t);if(e)return e}return t.name}getDataItemValueForColumn(t,e,n){if(typeof this._addonOptions.dataItemColumnValueExtractor=="function"){const o=this._addonOptions.dataItemColumnValueExtractor(t,e);if(o)return o}let r="";if(e)if(e.editor){const o=document.createElement("p"),s=new e.editor({container:o,column:e,event:n,position:{top:0,left:0},grid:this._grid});s.loadValue(t),r=s.serializeValue(),s.destroy(),o.remove()}else r=t[e.field||""];return r}setDataItemValueForColumn(t,e,n){if(!(e!=null&&e.denyPaste)){if(this._addonOptions.dataItemColumnValueSetter)return this._addonOptions.dataItemColumnValueSetter(t,e,n);if(e.editor){const r=document.createElement("div"),o=new e.editor({container:r,column:e,position:{top:0,left:0},grid:this._grid});o.loadValue(t),o.applyValue(t,n),o.destroy(),r.remove()}else t[e.field]=n}}setIncludeHeaderWhenCopying(t){this._addonOptions.includeHeaderWhenCopying=t}createTextBox(t){const e=De("textarea",{value:t,style:{position:"absolute",left:"-1000px",top:`${document.body.scrollTop}px`}},this._bodyElement);return e.select(),e}decodeTabularData(t,e){var n;const r=t.getColumns(),s=e.value.split(/[\n\f\r]/);s[s.length-1]===""&&s.pop();let l=0;const u=[];this._bodyElement.removeChild(e);for(const k of s)u[l++]=k!==""?k.split(" "):[""];const p=this._grid.getActiveCell(),c=(n=this._grid.getSelectionModel())===null||n===void 0?void 0:n.getSelectedRanges(),f=c!=null&&c.length?c[0]:null;let m,v;if(f)m=f.fromRow,v=f.fromCell;else if(p)m=p.row,v=p.cell;else return;let _=!1,C=u.length,x=u.length?u[0].length:0;u.length===1&&u[0].length===1&&f&&(_=!0,C=f.toRow-f.fromRow+1,x=f.toCell-f.fromCell+1);const w=this._grid.getData().length-m;let E=0;if(w<C&&typeof this._addonOptions.newRowCreator=="function"){const k=this._grid.getData();for(E=1;E<=C-w;E++)k.push({});this._grid.setData(k),this._grid.render()}if(m+C>this._grid.getDataLength()&&typeof this._addonOptions.newRowCreator=="function"){const k=m+C-this._grid.getDataLength();this._addonOptions.newRowCreator(k)}this._clipCommand={isClipboardCommand:!0,clippedRange:u,oldValues:[],cellExternalCopyManager:this,_options:this._addonOptions,setDataItemValueForColumn:this.setDataItemValueForColumn,markCopySelection:this.markCopySelection,oneCellToMultiple:_,activeRow:m,activeCell:v,destH:C,destW:x,maxDestY:this._grid.getDataLength(),maxDestX:this._grid.getColumns().length,h:0,w:0,execute:()=>{var k;this._clipCommand.h=0;for(let N=0;N<this._clipCommand.destH;N++){this._clipCommand.oldValues[N]=[],this._clipCommand.w=0,this._clipCommand.h++;for(let V=0;V<this._clipCommand.destW;V++){this._clipCommand.w++;const Q=m+N,L=v+V;if(Q<this._clipCommand.maxDestY&&L<this._clipCommand.maxDestX){const se=this._grid.getDataItem(Q);this._clipCommand.oldValues[N][V]=se[r[L].field],_?this.setDataItemValueForColumn(se,r[L],u[0][0]):this.setDataItemValueForColumn(se,r[L],u[N]?u[N][V]:""),this._grid.updateCell(Q,L),this._grid.onCellChange.notify({row:Q,cell:L,item:se,grid:this._grid,column:{}})}}}const F={fromCell:v,fromRow:m,toCell:v+this._clipCommand.w-1,toRow:m+this._clipCommand.h-1};this.markCopySelection([F]),(k=this._grid.getSelectionModel())===null||k===void 0||k.setSelectedRanges([F]),this.onPasteCells.notify({ranges:[F]})},undo:()=>{var k;for(let N=0;N<this._clipCommand.destH;N++)for(let V=0;V<this._clipCommand.destW;V++){const Q=m+N,L=v+V;if(Q<this._clipCommand.maxDestY&&L<this._clipCommand.maxDestX){const se=this._grid.getDataItem(Q);_?this.setDataItemValueForColumn(se,r[L],this._clipCommand.oldValues[0][0]):this.setDataItemValueForColumn(se,r[L],this._clipCommand.oldValues[N][V]),this._grid.updateCell(Q,L),this._grid.onCellChange.notify({row:Q,cell:L,item:se,grid:this._grid,column:{}})}}const F={fromCell:v,fromRow:m,toCell:v+this._clipCommand.w-1,toRow:m+this._clipCommand.h-1};if(this.markCopySelection([F]),(k=this._grid.getSelectionModel())===null||k===void 0||k.setSelectedRanges([F]),this.onPasteCells.notify({ranges:[F]}),typeof this._addonOptions.onPasteCells=="function"&&this._addonOptions.onPasteCells(new Slick.EventData,{ranges:[F]}),E>1){const N=this._grid.getData();for(;E>1;E--)N.splice(N.length-1,1);this._grid.setData(N),this._grid.render()}}},this._addonOptions.clipboardCommandHandler?this._addonOptions.clipboardCommandHandler(this._clipCommand):this._clipCommand.execute()}handleKeyDown(t){var e,n,r,o,s,l;let u;if(!this._grid.getEditorLock().isActive()||this._grid.getOptions().autoEdit){if((t.which===li.ESCAPE||t.key==="Escape")&&this._copiedRanges&&(t.preventDefault(),this.clearCopySelection(),this.onCopyCancelled.notify({ranges:this._copiedRanges}),typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(t,{ranges:this._copiedRanges}),this._copiedRanges=null),(t.which===li.C||t.key==="c"||t.which===li.INSERT||t.key==="Insert")&&(t.ctrlKey||t.metaKey)&&!t.shiftKey&&(typeof this._onCopyInit=="function"&&this._onCopyInit.call(this),u=(n=(e=this._grid.getSelectionModel())===null||e===void 0?void 0:e.getSelectedRanges())!==null&&n!==void 0?n:[],u.length!==0)){this._copiedRanges=u,this.markCopySelection(u),this.onCopyCells.notify({ranges:u}),typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(t,{ranges:u});const p=this._grid.getColumns();let c="";for(let f=0;f<u.length;f++){const m=u[f],v=[];for(let _=m.fromRow;_<m.toRow+1;_++){const C=[],x=this._grid.getDataItem(_);if(v.length===0&&this._addonOptions.includeHeaderWhenCopying){const w=[];for(let E=m.fromCell;E<m.toCell+1;E++)p[E].name.length>0&&w.push(this.getHeaderValueForColumn(p[E]));v.push(w.join(" "))}for(let w=m.fromCell;w<m.toCell+1;w++)C.push(this.getDataItemValueForColumn(x,p[w],t));v.push(C.join(" "))}c+=v.join(`\r
6
6
  `)+`\r
7
- `}if(window.clipboardData)return window.clipboardData.setData("Text",c),!0;{const f=document.activeElement,m=this.createTextBox(c);if(m.focus(),setTimeout(()=>{this._bodyElement.removeChild(m),f?f.focus():console.log("No element to restore focus to after copy?")},(o=(r=this.addonOptions)===null||r===void 0?void 0:r.clipboardPasteDelay)!==null&&o!==void 0?o:Qp),typeof this._onCopySuccess=="function"){const v=u.length===1?u[0].toRow+1-u[0].fromRow:u.length;this._onCopySuccess(v)}return!1}}if(!this._addonOptions.readOnlyMode&&((t.which===li.V||t.key==="v")&&(t.ctrlKey||t.metaKey)&&!t.shiftKey||(t.which===li.INSERT||t.key==="Insert")&&t.shiftKey&&!t.ctrlKey)){const p=this.createTextBox("");return setTimeout(()=>this.decodeTabularData(this._grid,p),(l=(s=this.addonOptions)===null||s===void 0?void 0:s.clipboardPasteDelay)!==null&&l!==void 0?l:Qp),!1}}}markCopySelection(t){var e;this.clearCopySelection();const n=this._grid.getColumns(),r={};for(const o of t)for(let s=o.fromRow;s<=o.toRow;s++){r[s]={};for(let l=o.fromCell;l<=o.toCell&&l<n.length;l++)r[s][n[l].id]=this._copiedCellStyle}this._grid.setCellCssStyles(this._copiedCellStyleLayerKey,r),clearTimeout(this._clearCopyTI),this._clearCopyTI=setTimeout(()=>this.clearCopySelection(),((e=this.addonOptions)===null||e===void 0?void 0:e.clearCopySelectionDelay)||M_)}}class eu{constructor(t,e,n){this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._addonOptions={},this._camelPluginName="",this._gridUid="",this._menuCssPrefix="",this._menuPluginCssPrefix="",this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler}get addonOptions(){return this._addonOptions}set addonOptions(t){this._addonOptions=t}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get gridUid(){var t,e;return this._gridUid||((e=(t=this.grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get menuElement(){return this._menuElm||document.querySelector(`.${this._menuPluginCssPrefix||this._menuCssPrefix}${this.gridUidSelector}`)}dispose(){var t,e,n,r,o;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),this._bindEventService.unbindAll(),this.pubSubService.unsubscribeAll(),(e=this._commandTitleElm)===null||e===void 0||e.remove(),(n=this._optionTitleElm)===null||n===void 0||n.remove(),(r=this.menuElement)===null||r===void 0||r.remove(),en(this._menuElm),(o=this._menuElm)===null||o===void 0||o.remove()}setOptions(t){this._addonOptions={...this._addonOptions,...t}}populateCommandOrOptionItems(t,e,n,r,o,s){if(o&&r&&e)for(const l of r)this.populateSingleCommandOrOptionItem(t,e,n,l,o,s)}populateCommandOrOptionTitle(t,e,n){var r,o;if(e){const s=(o=(r=this._menuElm)===null||r===void 0?void 0:r.querySelector(`.slick-${t}-header`))!==null&&o!==void 0?o:De("div",{className:`slick-${t}-header`}),l=`${t}Title`;e!=null&&e[l]?(this[`_${t}TitleElm`]=De("span",{className:"slick-menu-title",textContent:e[l]}),s.appendChild(this[`_${t}TitleElm`]),s.classList.add("with-title")):s.classList.add("no-title"),n.appendChild(s)}}populateSingleCommandOrOptionItem(t,e,n,r,o,s){let l=null;if(o&&r&&e){const u=this._camelPluginName==="headerButtons"?"":"-item",p=`${this._menuCssPrefix}${u}`;let c=!0,f=!0;if(typeof r=="object"&&(c=this.extensionUtility.runOverrideFunctionWhenExists(r.itemVisibilityOverride,o),f=this.extensionUtility.runOverrideFunctionWhenExists(r.itemUsabilityOverride,o)),!c)return null;if(typeof r=="object"&&r.itemUsabilityOverride&&(r.disabled=!f),l=De("li",{className:p,role:"menuitem"}),typeof r=="object"&&$d(r[t])&&(l.dataset[t]=r==null?void 0:r[t]),n&&n.appendChild(l),typeof r=="object"&&r.divider||r==="divider")return l.classList.add(`${p}-divider`),l;if(r.disabled&&l.classList.add(`${p}-disabled`),(r.hidden||r.showOnHover)&&l.classList.add(`${p}-hidden`),r.cssClass&&l.classList.add(...r.cssClass.split(" ")),r.tooltip&&(l.title=r.tooltip),this._camelPluginName!=="headerButtons"){const m=De("div",{className:`${this._menuCssPrefix}-icon`});l.appendChild(m),r.iconCssClass?m.classList.add(...r.iconCssClass.split(" ")):m.textContent="◦";const v=De("span",{className:`${this._menuCssPrefix}-content`,textContent:typeof r=="object"&&r.title||""},l);r.textCssClass&&v.classList.add(...r.textCssClass.split(" "))}this._bindEventService.bind(l,"click",m=>s.call(this,m,t,r,o==null?void 0:o.column)),r.handler&&!r.disabled&&this._bindEventService.bind(l,"click",m=>r.handler.call(this,m))}return l}}class Jp extends eu{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._currentCell=-1,this._currentRow=-1}createMenu(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E;(e=this.menuElement)===null||e===void 0||e.remove(),this._menuElm=void 0;const I=this.grid.getCellFromEvent(t);if(I){this._currentCell=(n=I.cell)!==null&&n!==void 0?n:0,this._currentRow=(r=I.row)!==null&&r!==void 0?r:0;const k=this.grid.getColumns()[this._currentCell],F=this.grid.getDataItem(this._currentRow),N=(s=(o=t==null?void 0:t.touches)===null||o===void 0?void 0:o[0])!==null&&s!==void 0?s:t,V=((l=this._addonOptions)===null||l===void 0?void 0:l.commandItems)||[],Q=((u=this._addonOptions)===null||u===void 0?void 0:u.optionItems)||[];let L=!0,se=!0;if(this._camelPluginName==="contextMenu"){if(L=this.checkIsColumnAllowed((c=(p=this._addonOptions)===null||p===void 0?void 0:p.optionShownOverColumnIds)!==null&&c!==void 0?c:[],k.id),se=this.checkIsColumnAllowed((m=(f=this._addonOptions)===null||f===void 0?void 0:f.commandShownOverColumnIds)!==null&&m!==void 0?m:[],k.id),!k||(!se||!V.length)&&(!L||!Q.length)){this.hideMenu();return}}else if(!k||!k.cellMenu||!V.length&&!Q.length)return;const Ce={cell:this._currentCell,row:this._currentRow,grid:this.grid};if(this.closeMenu(t,Ce),typeof t.stopPropagation=="function"&&(this.pubSubService.publish(`on${El(this._camelPluginName)}BeforeMenuShow`,Ce),typeof((v=this.addonOptions)===null||v===void 0?void 0:v.onBeforeMenuShow)=="function"&&this.addonOptions.onBeforeMenuShow(t,Ce)===!1))return;this._menuElm=De("div",{className:`${this._menuPluginCssPrefix||this._menuCssPrefix} ${this.gridUid}`,style:{display:"none",left:`${N.pageX}px`,top:`${N.pageY+5}px`}});const J=isNaN(this.addonOptions.maxHeight)?this.addonOptions.maxHeight:`${(_=this.addonOptions.maxHeight)!==null&&_!==void 0?_:0}px`,z=isNaN(this.addonOptions.maxWidth)?this.addonOptions.maxWidth:`${(C=this.addonOptions.maxWidth)!==null&&C!==void 0?C:0}px`;J&&(this._menuElm.style.maxHeight=J),z&&(this._menuElm.style.maxWidth=z),!((x=this.addonOptions)===null||x===void 0)&&x.width&&(this._menuElm.style.width=Xs((w=this.addonOptions)===null||w===void 0?void 0:w.width));const P=De("button",{ariaLabel:"Close",className:"close",type:"button",innerHTML:"&times;",dataset:{dismiss:this._menuCssPrefix}});if(!this.addonOptions.hideOptionSection&&L&&Q.length>0){const le=De("div",{className:`${this._menuCssPrefix}-option-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("option",this.addonOptions,le),this.addonOptions.hideCloseButton||this.populateCommandOrOptionCloseBtn("option",P,le),this.populateCommandOrOptionItems("option",this.addonOptions,le,Q,{cell:this._currentCell,row:this._currentRow,column:k,dataContext:F,grid:this.grid},this.handleMenuItemCommandClick)}if(!this.addonOptions.hideCommandSection&&se&&V.length>0){const le=De("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("command",this.addonOptions,le),!this.addonOptions.hideCloseButton&&(!L||Q.length===0||this.addonOptions.hideOptionSection)&&this.populateCommandOrOptionCloseBtn("command",P,le),this.populateCommandOrOptionItems("command",this.addonOptions,le,V,{cell:this._currentCell,row:this._currentRow,column:k,dataContext:F,grid:this.grid},this.handleMenuItemCommandClick)}if(this._menuElm.style.display="block",document.body.appendChild(this._menuElm),this.pubSubService.publish(`on${El(this._camelPluginName)}AfterMenuShow`,Ce),typeof((E=this.addonOptions)===null||E===void 0?void 0:E.onAfterMenuShow)=="function"&&this.addonOptions.onAfterMenuShow(t,Ce)===!1)return}return this._menuElm}closeMenu(t,e){var n;if(this.menuElement){if(typeof((n=this.addonOptions)===null||n===void 0?void 0:n.onBeforeMenuClose)=="function"&&this.addonOptions.onBeforeMenuClose(t,e)===!1)return;this.hideMenu()}}hideMenu(){var t;(t=this.menuElement)===null||t===void 0||t.remove(),this._menuElm=null}checkIsColumnAllowed(t,e){return(t==null?void 0:t.length)>0?t.findIndex(n=>n===e)>=0:!0}handleBodyMouseDown(t){var e;(this.menuElement!==t.target&&!(!((e=this.menuElement)===null||e===void 0)&&e.contains(t.target))||t.target.className==="close")&&this.closeMenu(t,{cell:this._currentCell,row:this._currentRow,grid:this.grid})}handleCloseButtonClicked(t){t.defaultPrevented||this.closeMenu(t,{cell:0,row:0,grid:this.grid})}handleMenuItemCommandClick(t,e,n){var r;if((n==null?void 0:n[e])!==void 0&&n!=="divider"&&!n.disabled&&!n.divider&&this._currentCell!==void 0&&this._currentRow!==void 0){if(e==="option"&&!this.grid.getEditorLock().commitCurrentEdit())return;const o=this._currentCell,s=this._currentRow,l=this.grid.getColumns()[this._currentCell],u=this.grid.getDataItem(this._currentRow),p={cell:this._currentCell,row:this._currentRow,grid:this.grid,[e]:n[e],item:n,column:l,dataContext:u},c=e==="command"?"onCommand":"onOptionSelected",f=`${this._camelPluginName}:${c}`;this.pubSubService.publish(f,p),typeof((r=this._addonOptions)===null||r===void 0?void 0:r[c])=="function"&&this._addonOptions[c](t,p),typeof n.action=="function"&&n.action.call(this,t,p),t.defaultPrevented||this.closeMenu(t,{cell:o,row:s,grid:this.grid})}}populateCommandOrOptionCloseBtn(t,e,n){var r;this._bindEventService.bind(e,"click",s=>this.handleCloseButtonClicked(s));const o=(r=n.querySelector(`.slick-${t}-header`))!==null&&r!==void 0?r:De("div",{className:`slick-${t}-header`});o==null||o.appendChild(e),n.appendChild(o),o.classList.add("with-close")}repositionMenu(t){var e,n,r,o,s,l,u,p;if(this._menuElm&&t.target){this._menuElm.style.top="0px",this._menuElm.style.left="0px";const c=(n=(e=t==null?void 0:t.touches)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:t,f=t.target.closest(".slick-cell");let m=f&&this._camelPluginName==="cellMenu"?(o=(r=qn(f))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:0:c.pageX,v=f&&this._camelPluginName==="cellMenu"?(l=(s=qn(f))===null||s===void 0?void 0:s.top)!==null&&l!==void 0?l:0:c.pageY;const _=f.offsetWidth||0,C=((u=this._menuElm)===null||u===void 0?void 0:u.offsetHeight)||0,x=((p=this._menuElm)===null||p===void 0?void 0:p.offsetWidth)||this._addonOptions.width||0,w=this.gridOptions.rowHeight||0,E=+(this._addonOptions.autoAdjustDropOffset||0),I=+(this._addonOptions.autoAlignSideOffset||0);if(this._addonOptions.autoAdjustDrop||this._addonOptions.dropDirection){const k=vh(f).bottom,F=vh(f).top,N=k+E-w,V=F-E+w;(N<C&&V>N?"top":"bottom")==="top"||this._addonOptions.dropDirection==="top"?(this._menuElm.classList.remove("dropdown"),this._menuElm.classList.add("dropup"),v=v-C-E):(this._menuElm.classList.remove("dropup"),this._menuElm.classList.add("dropdown"),v=v+E,this._camelPluginName==="cellMenu"&&(v+=w))}if(this._addonOptions.autoAlignSide||this._addonOptions.dropSide==="left"){const k=this.grid.getGridPosition();(m+ +x>=k.width?"left":"right")==="left"||this._addonOptions.dropSide==="left"?(this._menuElm.classList.remove("dropright"),this._menuElm.classList.add("dropleft"),this._camelPluginName==="cellMenu"?m=m-(+x-_)-I:m=m-+x-I):(this._menuElm.classList.remove("dropleft"),this._menuElm.classList.add("dropright"),m=m+I)}this._menuElm.style.top=`${v}px`,this._menuElm.style.left=`${m}px`}}}class L_ extends Jp{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!0},this.pluginName="CellMenu",this._camelPluginName="cellMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-cell-menu",this.init(n.gridOptions.cellMenu)}init(t){this._addonOptions={...this._defaults,...t},this.sortMenuItems(this.sharedService.allColumns),this._eventHandler.subscribe(this.grid.onClick,this.handleCellClick.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateCellMenu(){var t;const e=(t=this.sharedService)===null||t===void 0?void 0:t.gridOptions,n=this.sharedService.allColumns;e!=null&&e.enableTranslate&&Array.isArray(n)&&n.forEach(r=>{if(r!=null&&r.cellMenu&&(Array.isArray(r.cellMenu.commandItems)||Array.isArray(r.cellMenu.optionItems))){const o=r.cellMenu.commandItems||[],s=r.cellMenu.optionItems||[];r.cellMenu.commandTitleKey&&(r.cellMenu.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.cellMenu.commandTitleKey,"TEXT_COMMANDS")||r.cellMenu.commandTitle),r.cellMenu.optionTitleKey&&(r.cellMenu.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.cellMenu.optionTitleKey,"TEXT_COMMANDS")||r.cellMenu.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(o),this.extensionUtility.translateMenuItemsFromTitleKey(s)}})}handleCellClick(t,e){const n=this.grid.getCellFromEvent(t);if(n){const r=this.grid.getDataItem(n.row),o=this.grid.getColumns()[n.cell];if(o!=null&&o.cellMenu&&t.preventDefault(),this._addonOptions={...this._addonOptions,...o.cellMenu},e=e||{},e.column=o,e.dataContext=r,e.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,e))return;this._menuElm=this.createMenu(t),this._menuElm&&(this.repositionMenu(t),this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.style.display="block"),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}sortMenuItems(t){t.forEach(e=>{var n,r;!((n=e==null?void 0:e.cellMenu)===null||n===void 0)&&n.commandItems&&this.extensionUtility.sortItems(e.cellMenu.commandItems||[],"positionOrder"),!((r=e==null?void 0:e.cellMenu)===null||r===void 0)&&r.optionItems&&this.extensionUtility.sortItems(e.cellMenu.optionItems||[],"positionOrder")})}}class H_{constructor(t,e){this._defaults={selectionCssClass:"slick-range-decorator",selectionCss:{border:"2px dashed red",zIndex:"9999"},offset:{top:-1,left:-1,height:-2,width:-2}},this.pluginName="CellRangeDecorator",this._addonOptions=yl(this._defaults,e),this._grid=t}get addonOptions(){return this._addonOptions}get addonElement(){return this._elem}dispose(){this.hide()}hide(){var t;(t=this._elem)===null||t===void 0||t.remove(),this._elem=null}show(t){var e,n,r,o,s;this._elem||(this._elem=De("div",{className:this._addonOptions.selectionCssClass}),Object.keys(this._addonOptions.selectionCss).forEach(p=>{this._elem.style[p]=this._addonOptions.selectionCss[p]}),this._elem.style.position="absolute",(n=(e=this._grid)===null||e===void 0?void 0:e.getActiveCanvasNode())===null||n===void 0||n.appendChild(this._elem));const l=(r=this._grid)===null||r===void 0?void 0:r.getCellNodeBox(t.fromRow,t.fromCell),u=(o=this._grid)===null||o===void 0?void 0:o.getCellNodeBox(t.toRow,t.toCell);return l&&u&&(!((s=this._addonOptions)===null||s===void 0)&&s.offset)&&(this._elem.style.top=`${l.top+this._addonOptions.offset.top}px`,this._elem.style.left=`${l.left+this._addonOptions.offset.left}px`,this._elem.style.height=`${u.bottom-l.top+this._addonOptions.offset.height}px`,this._elem.style.width=`${u.right-l.left+this._addonOptions.offset.width}px`),this._elem}}class em{constructor(t){this._currentlySelectedRange=null,this._dragging=!1,this._gridUid="",this._columnOffset=0,this._rowOffset=0,this._isRightCanvas=!1,this._isBottomCanvas=!1,this._xDelayForNextCell=0,this._yDelayForNextCell=0,this._viewportHeight=0,this._viewportWidth=0,this._scrollLeft=0,this._scrollTop=0,this._defaults={autoScroll:!0,minIntervalToShowNextCell:30,maxIntervalToShowNextCell:600,accelerateInterval:5,selectionCss:{border:"2px dashed blue"}},this.pluginName="CellRangeSelector",this.onBeforeCellRangeSelected=new Slick.Event,this.onCellRangeSelecting=new Slick.Event,this.onCellRangeSelected=new Slick.Event,this._eventHandler=new Slick.EventHandler,this._addonOptions=yl(this._defaults,t)}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridUid(){var t,e;return this._gridUid||((e=(t=this._grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}init(t){this._grid=t,this._decorator=this._addonOptions.cellDecorator||new H_(t,this._addonOptions),this._canvas=t.getCanvasNode(),this._gridOptions=t.getOptions(),this._gridUid=t.getUID(),this._eventHandler.subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this)).subscribe(this._grid.onScroll,this.handleScroll.bind(this))}destroy(){this.dispose()}dispose(){var t,e;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),en(this._activeCanvas),en(this._canvas),(e=this._decorator)===null||e===void 0||e.dispose(),this.stopIntervalTimer()}getCellDecorator(){return this._decorator}getCurrentRange(){return this._currentlySelectedRange}getMouseOffsetViewport(t,e){var n,r,o,s;const l=(r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t,u=this._activeViewport.scrollLeft,p=this._activeViewport.scrollTop,c=u+this._viewportWidth,f=p+this._viewportHeight,m=qn(this._activeViewport),v=(o=m==null?void 0:m.left)!==null&&o!==void 0?o:0,_=(s=m==null?void 0:m.top)!==null&&s!==void 0?s:0,C=v+this._viewportWidth,x=_+this._viewportHeight,w={e:t,dd:e,viewport:{left:u,top:p,right:c,bottom:f,offset:{left:v,top:_,right:C,bottom:x}},offset:{x:0,y:0},isOutsideViewport:!1};return l.pageX<v?w.offset.x=l.pageX-v:l.pageX>C&&(w.offset.x=l.pageX-C),l.pageY<_?w.offset.y=_-l.pageY:l.pageY>x&&(w.offset.y=x-l.pageY),w.isOutsideViewport=!!w.offset.x||!!w.offset.y,w}stopIntervalTimer(){this._autoScrollTimerId&&(clearInterval(this._autoScrollTimerId),this._autoScrollTimerId=void 0)}handleDrag(t,e){if(!(!this._dragging&&!this._gridOptions.enableRowMoveManager)){if(this._gridOptions.enableRowMoveManager||t.stopImmediatePropagation(),this.addonOptions.autoScroll&&(this._draggingMouseOffset=this.getMouseOffsetViewport(t,e),this._draggingMouseOffset.isOutsideViewport))return this.handleDragOutsideViewport();this.stopIntervalTimer(),this.handleDragTo(t,e)}}handleDragOutsideViewport(){if(this._xDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.x)*this.addonOptions.accelerateInterval,this._yDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.y)*this.addonOptions.accelerateInterval,!this._autoScrollTimerId){let t=0,e=0;this._autoScrollTimerId=setInterval(()=>{let n=!1,r=!1;this._draggingMouseOffset.offset.x?(t+=this.addonOptions.minIntervalToShowNextCell,n=t>=this._xDelayForNextCell):t=0,this._draggingMouseOffset.offset.y?(e+=this.addonOptions.minIntervalToShowNextCell,r=e>=this._yDelayForNextCell):e=0,(n||r)&&(n&&(t=0),r&&(e=0),this.handleDragToNewPosition(n,r))},this.addonOptions.minIntervalToShowNextCell)}}handleDragToNewPosition(t,e){let n=this._draggingMouseOffset.e.pageX,r=this._draggingMouseOffset.e.pageY;const o=this._draggingMouseOffset.offset.x,s=this._draggingMouseOffset.offset.y,l=this._draggingMouseOffset.viewport.offset;t&&o&&(o>0?n=l.right+this._moveDistanceForOneCell.x:n=l.left-this._moveDistanceForOneCell.x),e&&s&&(s>0?r=l.top-this._moveDistanceForOneCell.y:r=l.bottom+this._moveDistanceForOneCell.y),this.handleDragTo({pageX:n,pageY:r},this._draggingMouseOffset.dd)}handleDragTo(t,e){var n,r,o,s,l,u;const p=(r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t,c=this._grid.getCellFromPoint(p.pageX-((s=(o=qn(this._activeCanvas))===null||o===void 0?void 0:o.left)!==null&&s!==void 0?s:0)+this._columnOffset,p.pageY-((u=(l=qn(this._activeCanvas))===null||l===void 0?void 0:l.top)!==null&&u!==void 0?u:0)+this._rowOffset);if(c!==void 0){if(this._gridOptions.frozenColumn>=0&&(!this._isRightCanvas&&c.cell>this._gridOptions.frozenColumn||this._isRightCanvas&&c.cell<=this._gridOptions.frozenColumn)||this._gridOptions.frozenRow>=0&&(!this._isBottomCanvas&&c.row>=this._gridOptions.frozenRow||this._isBottomCanvas&&c.row<this._gridOptions.frozenRow))return;if(this.addonOptions.autoScroll&&this._draggingMouseOffset){const f=this._grid.getCellNodeBox(c.row,c.cell);if(f){const m=this._draggingMouseOffset.viewport;(f.left<m.left||f.right>m.right||f.top<m.top||f.bottom>m.bottom)&&this._grid.scrollCellIntoView(c.row,c.cell)}}if(!this._grid.canCellBeSelected(c.row,c.cell))return;if(e!=null&&e.range){e.range.end=c;const f=new Slick.Range(e.range.start.row,e.range.start.cell,c.row,c.cell);this._decorator.show(f),this.onCellRangeSelecting.notify({range:f})}}}handleDragEnd(t,e){this._dragging&&(this._dragging=!1,t.stopImmediatePropagation(),this.stopIntervalTimer(),this._decorator.hide(),this.onCellRangeSelected.notify({range:new Slick.Range(e.range.start.row,e.range.start.cell,e.range.end.row,e.range.end.cell)}))}handleDragInit(t){var e,n,r,o;this._activeCanvas=this._grid.getActiveCanvasNode(t),this._activeViewport=this._grid.getActiveViewportNode(t);const s=this._grid.getDisplayedScrollbarDimensions();if(this._viewportWidth=this._activeViewport.offsetWidth-s.width,this._viewportHeight=this._activeViewport.offsetHeight-s.height,this._moveDistanceForOneCell={x:this._grid.getAbsoluteColumnMinWidth()/2,y:this._gridOptions.rowHeight/2},this._rowOffset=0,this._columnOffset=0,this._isBottomCanvas=this._activeCanvas.classList.contains("grid-canvas-bottom"),this._gridOptions.frozenRow>-1&&this._isBottomCanvas){const l=`${this.gridUidSelector} .grid-canvas-${this._gridOptions.frozenBottom?"bottom":"top"}`;this._rowOffset=(n=(e=document.querySelector(l))===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0}this._isRightCanvas=this._activeCanvas.classList.contains("grid-canvas-right"),this._gridOptions.frozenColumn>-1&&this._isRightCanvas&&(this._columnOffset=(o=(r=document.querySelector(`${this.gridUidSelector} .grid-canvas-left`))===null||r===void 0?void 0:r.clientWidth)!==null&&o!==void 0?o:0),t.stopImmediatePropagation(),t.preventDefault()}handleDragStart(t,e){var n,r,o,s;const l=this._grid.getCellFromEvent(t);if(l&&this.onBeforeCellRangeSelected.notify(l).getReturnValue()!==!1&&this._grid.canCellBeSelected(l.row,l.cell)&&(this._dragging=!0,t.stopImmediatePropagation()),!this._dragging)return;this._grid.focus();let u=e.startX-((r=(n=qn(this._canvas))===null||n===void 0?void 0:n.left)!==null&&r!==void 0?r:0);this._gridOptions.frozenColumn>=0&&this._isRightCanvas&&(u+=this._scrollLeft);let p=e.startY-((s=(o=qn(this._canvas))===null||o===void 0?void 0:o.top)!==null&&s!==void 0?s:0);this._gridOptions.frozenRow>=0&&this._isBottomCanvas&&(p+=this._scrollTop);const c=this._grid.getCellFromPoint(u,p);return e.range={start:c,end:{}},this._currentlySelectedRange=e.range,this._decorator.show(new Slick.Range(c.row,c.cell))}handleScroll(t,e){this._scrollTop=e.scrollTop,this._scrollLeft=e.scrollLeft}}class B_{constructor(t){this._canvas=null,this._ranges=[],this._defaults={selectActiveCell:!0},this.onSelectedRangesChanged=new Slick.Event,this.pluginName="CellSelectionModel",this._eventHandler=new Slick.EventHandler,t===void 0||t.cellRangeSelector===void 0?this._selector=new em({selectionCss:{border:"2px solid black"}}):this._selector=t.cellRangeSelector,this._addonOptions=t}get addonOptions(){return this._addonOptions}get canvas(){return this._canvas}get cellRangeSelector(){return this._selector}get eventHandler(){return this._eventHandler}init(t){this._grid=t,this._addonOptions={...this._defaults,...this._addonOptions},this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)).subscribe(this._selector.onBeforeCellRangeSelected,this.handleBeforeCellRangeSelected.bind(this)).subscribe(this._selector.onCellRangeSelected,this.handleCellRangeSelected.bind(this)),t.registerPlugin(this._selector),this._canvas=this._grid.getCanvasNode()}destroy(){this.dispose()}dispose(){var t,e;this._canvas=null,this._selector&&(this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this))),this._eventHandler.unsubscribeAll(),(t=this._grid)===null||t===void 0||t.unregisterPlugin(this._selector),(e=this._selector)===null||e===void 0||e.dispose()}getSelectedRanges(){return this._ranges}rangesAreEqual(t,e){let n=t.length!==e.length;if(!n){for(let r=0;r<t.length;r++)if(t[r].fromCell!==e[r].fromCell||t[r].fromRow!==e[r].fromRow||t[r].toCell!==e[r].toCell||t[r].toRow!==e[r].toRow){n=!0;break}}return!n}refreshSelections(){this.setSelectedRanges(this.getSelectedRanges())}removeInvalidRanges(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];this._grid.canCellBeSelected(r.fromRow,r.fromCell)&&this._grid.canCellBeSelected(r.toRow,r.toCell)&&e.push(r)}return e}setSelectedRanges(t,e="SlickCellSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!t||t.length===0))return;const n=!this.rangesAreEqual(this._ranges,t);if(this._ranges=this.removeInvalidRanges(t),n){const r=new Slick.EventData;Object.defineProperty(r,"detail",{writable:!0,configurable:!0,value:{caller:e}}),this.onSelectedRangesChanged.notify(this._ranges,r)}}handleActiveCellChange(t,e){var n,r;!((n=this._addonOptions)===null||n===void 0)&&n.selectActiveCell&&e.row!==null&&e.cell!==null?this.setSelectedRanges([new Slick.Range(e.row,e.cell)]):!((r=this._addonOptions)===null||r===void 0)&&r.selectActiveCell||this.setSelectedRanges([])}handleBeforeCellRangeSelected(t){if(this._grid.getEditorLock().isActive())return t.stopPropagation(),!1}handleCellRangeSelected(t,e){this._grid.setActiveCell(e.range.fromRow,e.range.fromCell,!1,!1,!0),this.setSelectedRanges([e.range])}handleKeyDown(t){let e,n;const r=this._grid.getActiveCell(),o=t.ctrlKey||t.metaKey;if(r&&t.shiftKey&&!o&&!t.altKey&&(t.which===li.LEFT||t.key==="ArrowLeft"||t.which===li.RIGHT||t.key==="ArrowRight"||t.which===li.UP||t.key==="ArrowUp"||t.which===li.DOWN||t.key==="ArrowDown")&&(e=this.getSelectedRanges().slice(),e.length||e.push(new Slick.Range(r.row,r.cell)),n=e.pop(),typeof(n==null?void 0:n.contains)=="function")){n.contains(r.row,r.cell)||(n=new Slick.Range(r.row,r.cell));let s=n.toRow-n.fromRow,l=n.toCell-n.fromCell;const u=r.row===n.fromRow?1:-1,p=r.cell===n.fromCell?1:-1;t.which===li.LEFT||t.key==="ArrowLeft"?l-=p:t.which===li.RIGHT||t.key==="ArrowRight"?l+=p:t.which===li.UP||t.key==="ArrowUp"?s-=u:(t.which===li.DOWN||t.key==="ArrowDown")&&(s+=u);const c=new Slick.Range(r.row,r.cell,r.row+u*s,r.cell+p*l);if(this.removeInvalidRanges([c]).length){e.push(c);const f=u>0?c.toRow:c.fromRow,m=p>0?c.toCell:c.fromCell;this._grid.scrollRowIntoView(f),this._grid.scrollCellIntoView(f,m,!1)}else e.push(n);this.setSelectedRanges(e),t.preventDefault(),t.stopPropagation()}}}class _h{constructor(t){this._ranges=[],this._defaults={autoScrollWhenDrag:!0,cellRangeSelector:void 0,dragToSelect:!1,selectActiveRow:!0},this.pluginName="RowSelectionModel",this.onSelectedRangesChanged=new Slick.Event,this._eventHandler=new Slick.EventHandler,this._addonOptions={...this._defaults,...t}}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){return this._grid.getOptions()}init(t){this._grid=t,this._addonOptions={...this._defaults,...this._addonOptions},this._selector=this.addonOptions.cellRangeSelector,!this._selector&&this._addonOptions.dragToSelect&&(this._selector=new em({selectionCss:{border:"none"},autoScroll:this._addonOptions.autoScrollWhenDrag}),this.addonOptions.cellRangeSelector=this._selector),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onClick,this.handleClick.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)),this._selector&&(this._grid.registerPlugin(this._selector),this._selector.onCellRangeSelecting.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.subscribe(this.handleBeforeCellRangeSelected.bind(this)))}destroy(){this.dispose()}dispose(){this._eventHandler.unsubscribeAll(),this.disposeSelector()}disposeSelector(){var t,e;this._selector&&(this._selector.onCellRangeSelecting.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._grid.unregisterPlugin(this._selector),(t=this._selector)===null||t===void 0||t.destroy(),(e=this._selector)===null||e===void 0||e.dispose())}getCellRangeSelector(){return this._selector}getSelectedRanges(){return this._ranges}getSelectedRows(){return this.rangesToRows(this._ranges)}refreshSelections(){this.setSelectedRows(this.getSelectedRows())}setSelectedRows(t){this.setSelectedRanges(this.rowsToRanges(t),"SlickRowSelectionModel.setSelectedRows")}setSelectedRanges(t,e="SlickRowSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!t||t.length===0))return;this._ranges=t;const n=new Slick.EventData;Object.defineProperty(n,"detail",{writable:!0,configurable:!0,value:{caller:e}}),this.onSelectedRangesChanged.notify(this._ranges,n)}getRowsRange(t,e){let n;const r=[];for(n=t;n<=e;n++)r.push(n);for(n=e;n<t;n++)r.push(n);return r}handleBeforeCellRangeSelected(t,e){var n;let r=!1;if(this.gridOptions.enableRowMoveManager&&(r=(n=this.isHandlerColumn(e.cell))!==null&&n!==void 0?n:!1),this._grid.getEditorLock().isActive()||r)return t.stopPropagation(),!1;this._grid.setActiveCell(e.row,e.cell)}handleCellRangeSelected(t,e){if(!this.gridOptions.multiSelect||!this.addonOptions.selectActiveRow)return!1;this.setSelectedRanges([new Slick.Range(e.range.fromRow,0,e.range.toRow,this._grid.getColumns().length-1)])}handleActiveCellChange(t,e){this._addonOptions.selectActiveRow&&e.row!==null&&this.setSelectedRanges([new Slick.Range(e.row,0,e.row,this._grid.getColumns().length-1)])}handleClick(t){const e=this._grid.getCellFromEvent(t);if(!e||!this._grid.canCellBeActive(e.row,e.cell)||!this.gridOptions.multiSelect||!t.ctrlKey&&!t.shiftKey&&!t.metaKey)return!1;let n=this.rangesToRows(this._ranges);const r=n.indexOf(e.row);if(r===-1&&(t.ctrlKey||t.metaKey))n.push(e.row),this._grid.setActiveCell(e.row,e.cell);else if(r!==-1&&(t.ctrlKey||t.metaKey))n=n.filter(s=>s!==e.row),this._grid.setActiveCell(e.row,e.cell);else if(n.length&&t.shiftKey){const s=n.pop(),l=Math.min(e.row,s),u=Math.max(e.row,s);n=[];for(let p=l;p<=u;p++)p!==s&&n.push(p);n.push(s),this._grid.setActiveCell(e.row,e.cell)}const o=this.rowsToRanges(n);return this.setSelectedRanges(o),t.stopImmediatePropagation(),!0}handleKeyDown(t){const e=this._grid.getActiveCell();if(this.gridOptions.multiSelect&&e&&t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.which===li.UP||t.key==="ArrowUp"||t.which===li.DOWN||t.key==="ArrowDown")){let n=this.getSelectedRows();n.sort((l,u)=>l-u),n.length||(n=[e.row]);let r,o=n[0],s=n[n.length-1];if(t.which===li.DOWN||t.key==="ArrowDown"?r=e.row<s||o===s?++s:++o:r=e.row<s?--s:--o,r>=0&&r<this._grid.getDataLength()){this._grid.scrollRowIntoView(r);const l=this.rowsToRanges(this.getRowsRange(o,s));this.setSelectedRanges(l)}t.preventDefault(),t.stopPropagation()}}isHandlerColumn(t){const n=this._grid.getColumns()[t].behavior||"";return/move|selectAndMove/.test(n)}rangesToRows(t){const e=[];for(let n=0;n<t.length;n++)for(let r=t[n].fromRow;r<=t[n].toRow;r++)e.push(r);return e}rowsToRanges(t){const e=[],n=this._grid.getColumns().length-1;for(const r of t)e.push(new Slick.Range(r,0,r,n));return e}}class tm{constructor(t,e){this.pubSubService=t,this.pluginName="CheckboxSelectColumn",this._defaults={columnId:"_checkbox_selector",cssClass:null,field:"_checkbox_selector",hideSelectAllCheckbox:!1,toolTip:"Select/Deselect All",width:30,applySelectOnAllPages:!0,hideInColumnTitleRow:!1,hideInFilterHeaderRow:!0},this._addonOptions=this._defaults,this._checkboxColumnCellIndex=null,this._isSelectAllChecked=!1,this._isUsingDataView=!1,this._selectedRowsLookup={},this._selectAll_UID=this.createUID(),this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this._addonOptions={...this._defaults,...e}}get addonOptions(){return this._addonOptions}get headerRowNode(){return this._headerRowNode}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get selectAllUid(){return this._selectAll_UID}set selectedRowsLookup(t){this._selectedRowsLookup=t}init(t){this._grid=t,this._isUsingDataView=!Array.isArray(t.getData()),this._isUsingDataView&&(this._dataView=t.getData()),this.gridOptions.backendServiceApi&&(this._addonOptions.applySelectOnAllPages=!1),this._eventHandler.subscribe(t.onSelectedRowsChanged,this.handleSelectedRowsChanged.bind(this)).subscribe(t.onClick,this.handleClick.bind(this)).subscribe(t.onKeyDown,this.handleKeyDown.bind(this)),this._isUsingDataView&&this._dataView&&this._addonOptions.applySelectOnAllPages&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,this.handleDataViewSelectedIdsChanged.bind(this)).subscribe(this._dataView.onPagingInfoChanged,this.handleDataViewSelectedIdsChanged.bind(this)),this._addonOptions.hideInFilterHeaderRow||this.addCheckboxToFilterHeaderRow(t),this._addonOptions.hideInColumnTitleRow||this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this)),(!this._rowSelectionModel||!this._grid.getSelectionModel())&&(this._rowSelectionModel=new _h(this.gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionModel)),this.gridOptions.preselectedRows&&this._rowSelectionModel&&this._grid.getSelectionModel()&&setTimeout(()=>this.selectRows(this.gridOptions.preselectedRows||[])),typeof this._addonOptions.selectableOverride=="function"&&this.selectableOverride(this._addonOptions.selectableOverride)}dispose(){this._bindEventService.unbindAll(),this._eventHandler.unsubscribeAll()}create(t,e){var n,r;if(this._addonOptions={...this._defaults,...e.checkboxSelector},Array.isArray(t)&&e){const o=this.getColumnDefinition();if(!t.some(s=>s.id===o.id)){const s=(r=(n=e==null?void 0:e.checkboxSelector)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:0;s>0?t.splice(s,0,o):t.unshift(o),this.pubSubService.publish("onPluginColumnsChanged",{columns:t,pluginName:this.pluginName})}}return this}getOptions(){return this._addonOptions}setOptions(t){var e;if(this._addonOptions={...this._addonOptions,...t},this._addonOptions.hideSelectAllCheckbox)this.hideSelectAllFromColumnHeaderTitleRow(),this.hideSelectAllFromColumnHeaderFilterRow();else if(this._addonOptions.hideInColumnTitleRow?this.hideSelectAllFromColumnHeaderTitleRow():(this.renderSelectAllCheckbox(this._isSelectAllChecked),this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this))),this._addonOptions.hideInFilterHeaderRow)this.hideSelectAllFromColumnHeaderFilterRow();else{const n=(e=this.headerRowNode)===null||e===void 0?void 0:e.querySelector("#filter-checkbox-selectall-container");if(n){n.style.display="flex",n.ariaChecked=String(this._isSelectAllChecked);const r=n.querySelector('input[type="checkbox"]');r&&(r.ariaChecked=String(this._isSelectAllChecked),r.checked=this._isSelectAllChecked)}}}deSelectRows(t){const e=[];for(const n of t)this._selectedRowsLookup[n]&&(e[e.length]=n);this._grid.setSelectedRows(this._grid.getSelectedRows().filter(n=>e.indexOf(n)<0),"SlickCheckboxSelectColumn.deSelectRows")}selectRows(t){var e;const n=[];for(const o of t)this._selectedRowsLookup[o]&&(n[n.length]=o);const r=(e=this._grid.getSelectedRows())===null||e===void 0?void 0:e.concat(n);this._grid.setSelectedRows(r)}getColumnDefinition(){var t,e;const n=String((e=(t=this._addonOptions)===null||t===void 0?void 0:t.columnId)!==null&&e!==void 0?e:this._defaults.columnId);return{id:n,name:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":`<input id="header-selector${this._selectAll_UID}" type="checkbox"><label for="header-selector${this._selectAll_UID}"></label>`,toolTip:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":this._addonOptions.toolTip,field:n,cssClass:this._addonOptions.cssClass,excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,hideSelectAllCheckbox:this._addonOptions.hideSelectAllCheckbox,resizable:!1,sortable:!1,width:this._addonOptions.width||30,formatter:this.checkboxSelectionFormatter.bind(this)}}hideSelectAllFromColumnHeaderTitleRow(){this._grid.updateColumnHeader(this._addonOptions.columnId||"","","")}hideSelectAllFromColumnHeaderFilterRow(){var t;const e=(t=this.headerRowNode)===null||t===void 0?void 0:t.querySelector("#filter-checkbox-selectall-container");e&&(e.style.display="none")}toggleRowSelection(t){this.toggleRowSelectionWithEvent(null,t)}toggleRowSelectionWithEvent(t,e){const n=this._grid.getDataItem(e);if(!this.checkSelectableOverride(e,n,this._grid))return;const r=this._grid.getSelectedRows();this._addonOptions.onRowToggleStart&&this._addonOptions.onRowToggleStart(t,{row:e,previousSelectedRows:r});const o=this._selectedRowsLookup[e]?this._grid.getSelectedRows().filter(s=>s!==e):this._grid.getSelectedRows().concat(e);this._grid.setSelectedRows(o,"click.toggle"),this._grid.setActiveCell(e,this.getCheckboxColumnCellIndex()),this._addonOptions.onRowToggleEnd&&this._addonOptions.onRowToggleEnd(t,{row:e,previousSelectedRows:r})}selectableOverride(t){this._selectableOverride=t}addCheckboxToFilterHeaderRow(t){this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{if(n.column.field===(this._addonOptions.field||"_checkbox_selector")){en(n.node);const r=De("span",{id:"filter-checkbox-selectall-container",ariaChecked:"false"});r.appendChild(De("input",{type:"checkbox",id:`header-filter-selector${this._selectAll_UID}`})),r.appendChild(De("label",{htmlFor:`header-filter-selector${this._selectAll_UID}`})),n.node.appendChild(r),this._headerRowNode=n.node,this._bindEventService.bind(r,"click",o=>this.handleHeaderClick(o,n))}})}checkboxSelectionFormatter(t,e,n,r,o,s){if(o&&this.checkSelectableOverride(t,o,s)){const l=this.createUID()+t;return`<input id="selector${l}" type="checkbox" ${this._selectedRowsLookup[t]?'checked="checked" aria-checked="true"':'aria-checked="false"'}><label for="selector${l}"></label>`}return null}checkSelectableOverride(t,e,n){return typeof this._selectableOverride=="function"?this._selectableOverride(t,e,n):!0}createUID(){return Math.round(1e7*Math.random())}getCheckboxColumnCellIndex(){if(this._checkboxColumnCellIndex===null){this._checkboxColumnCellIndex=0;const t=this._grid.getColumns();for(let e=0;e<t.length;e++)t[e].id===this._addonOptions.columnId&&(this._checkboxColumnCellIndex=e)}return this._checkboxColumnCellIndex}handleDataViewSelectedIdsChanged(){var t;const e=this._dataView.getAllSelectedFilteredIds(),n=this._dataView.getFilteredItems();let r=0;if(typeof this._selectableOverride=="function"&&e.length>0)for(let o=0;o<this._dataView.getItemCount();o++){const s=this._dataView.getItemByIdx(o),l=this._dataView.getIdPropertyName(),u=s[l];n.findIndex(c=>c[l]===u)>=0&&!this.checkSelectableOverride(o,s,this._grid)&&r++}if(this._isSelectAllChecked=e.length+r>=n.length,!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow){const o=(t=this.headerRowNode)===null||t===void 0?void 0:t.querySelector(`#header-filter-selector${this._selectAll_UID}`);o&&(o.ariaChecked=String(this._isSelectAllChecked),o.checked=this._isSelectAllChecked)}}handleClick(t,e){if(this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&t.target.type==="checkbox"){if(t.target.ariaChecked=String(t.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){t.preventDefault(),t.stopImmediatePropagation();return}this.toggleRowSelectionWithEvent(t,e.row),t.stopPropagation(),t.stopImmediatePropagation()}}handleHeaderClick(t,e){if(e.column.id===this._addonOptions.columnId&&t.target.type==="checkbox"){if(t.target.ariaChecked=String(t.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){t.preventDefault(),t.stopImmediatePropagation();return}let n=t.target.checked;const r=n?"click.selectAll":"click.unselectAll",o=this._grid.getSelectedRows();this._addonOptions.onSelectAllToggleStart&&this._addonOptions.onSelectAllToggleStart(t,{previousSelectedRows:o,caller:r});let s=[];if(n){const l=[];for(let u=0;u<this._grid.getDataLength();u++){const p=this._grid.getDataItem(u);!p.__group&&!p.__groupTotals&&this.checkSelectableOverride(u,p,this._grid)&&l.push(u)}s=l,n=!0}if(this._isUsingDataView&&this._dataView&&this._addonOptions.applySelectOnAllPages){const l=[],u=this._dataView.getFilteredItems();for(let p=0;p<u.length;p++){const c=u[p];this.checkSelectableOverride(p,c,this._grid)&&l.push(c[this._dataView.getIdPropertyName()])}this._dataView.setSelectedIds(l,{isRowBeingAdded:n})}this._grid.setSelectedRows(s,r),this._addonOptions.onSelectAllToggleEnd&&this._addonOptions.onSelectAllToggleEnd(t,{rows:s,previousSelectedRows:o,caller:r}),t.stopPropagation(),t.stopImmediatePropagation()}}handleKeyDown(t,e){(t.which===li.SPACE||t.key===" ")&&this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&((!this._grid.getEditorLock().isActive()||this._grid.getEditorLock().commitCurrentEdit())&&this.toggleRowSelectionWithEvent(t,e.row),t.preventDefault(),t.stopImmediatePropagation())}handleSelectedRowsChanged(){var t,e;const n=this._grid.getSelectedRows(),r={};let o=0,s=0,l=0,u=0;if(typeof this._selectableOverride=="function")for(l=0;l<this._grid.getDataLength();l++){const c=this._grid.getDataItem(l);this.checkSelectableOverride(s,c,this._grid)||u++}const p=[];for(s=0;s<n.length;s++){o=n[s];const c=this._grid.getDataItem(o);this.checkSelectableOverride(s,c,this._grid)?(r[o]=!0,r[o]!==this._selectedRowsLookup[o]&&(this._grid.invalidateRow(o),delete this._selectedRowsLookup[o])):p.push(o)}for(const c in this._selectedRowsLookup)c!==void 0&&this._grid.invalidateRow(+c);if(this._selectedRowsLookup=r,this._grid.render(),this._isSelectAllChecked=((t=n==null?void 0:n.length)!==null&&t!==void 0?t:0)+u>=this._grid.getDataLength(),(!this._isUsingDataView||!this._addonOptions.applySelectOnAllPages)&&(!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow)){const c=(e=this.headerRowNode)===null||e===void 0?void 0:e.querySelector(`#header-filter-selector${this._selectAll_UID}`);c&&(c.ariaChecked=String(this._isSelectAllChecked),c.checked=this._isSelectAllChecked)}if(p.length>0){for(const c of p){const f=n.indexOf(c);n.splice(f,1)}this._grid.setSelectedRows(n,"click.toggle")}}renderSelectAllCheckbox(t){const e=t?' checked="checked" aria-checked="true"':' aria-checked="false"';this._grid.updateColumnHeader(this._addonOptions.columnId||"",`<input id="header-selector${this._selectAll_UID}" type="checkbox"${e}><label for="header-selector${this._selectAll_UID}"></label>`,this._addonOptions.toolTip)}}class im extends eu{constructor(t,e,n,r,o){var s,l,u,p;super(t,n,r),this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this._areVisibleColumnDifferent=!1,this._columns=[],this._columnCheckboxes=[],this._gridMenuOptions=null,this._headerElm=null,this._isMenuOpen=!1,this.onAfterMenuShow=new Slick.Event,this.onBeforeMenuShow=new Slick.Event,this.onMenuClose=new Slick.Event,this.onCommand=new Slick.Event,this.onColumnsChanged=new Slick.Event,this._defaults={dropSide:"left",showButton:!0,hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",marginBottom:15,menuWidth:18,minHeight:250,contentMinWidth:0,resizeOnShowHeaderRow:!1,syncResizeTitle:"Synchronous resize",headerColumnValueExtractor:c=>c.name},this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-grid-menu",this._camelPluginName="gridMenu",this._columns=(s=this.sharedService.allColumns)!==null&&s!==void 0?s:[],this._gridUid=(p=(u=(l=this.grid)===null||l===void 0?void 0:l.getUID)===null||u===void 0?void 0:u.call(l))!==null&&p!==void 0?p:"",this.initEventHandlers(),this.init()}get addonOptions(){return this._gridMenuOptions||{}}get columns(){return this._columns}set columns(t){this._columns=t}get gridOptions(){return this.grid.getOptions()||{}}initEventHandlers(){this._eventHandler.subscribe(this.grid.onColumnsReordered,tu.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeDestroy,this.dispose.bind(this)),this._eventHandler.subscribe(this.grid.onSetOptions,(t,e)=>{if(e&&e.optionsBefore&&e.optionsAfter){const n=e.optionsBefore.frozenColumn>=0&&e.optionsAfter.frozenColumn===-1,r=e.optionsBefore.frozenColumn===-1&&e.optionsAfter.frozenColumn>=0;(n||r)&&this.recreateGridMenu()}})}init(){var t;this._gridUid=(t=this.grid.getUID())!==null&&t!==void 0?t:"",this._userOriginalGridMenu={...this.sharedService.gridOptions.gridMenu},this._gridMenuOptions={...this._defaults,...this.getDefaultGridMenuOptions(),...this.sharedService.gridOptions.gridMenu},this.sharedService.gridOptions.gridMenu=this._gridMenuOptions;const e=this._userOriginalGridMenu.commandItems,n=this._userOriginalGridMenu&&Array.isArray(e)?e:[];this._gridMenuOptions.commandItems=[...n,...this.addGridMenuCustomCommands(n)],this.extensionUtility.translateMenuItemsFromTitleKey(this._gridMenuOptions.commandItems||[]),this.extensionUtility.sortItems(this._gridMenuOptions.commandItems,"positionOrder"),this._gridMenuOptions.commandItems=this._gridMenuOptions.commandItems,this.createGridMenu()}dispose(){this.deleteMenu(),super.dispose()}deleteMenu(){var t,e,n;this._bindEventService.unbindAll();const r=document.querySelector(`div.slick-grid-menu.${this._gridUid}`);r&&(r.style.display="none"),this._headerElm&&(this._headerElm.style.width="100%"),(t=this._gridMenuButtonElm)===null||t===void 0||t.remove(),(e=this._menuElm)===null||e===void 0||e.remove(),(n=this._commandMenuElm)===null||n===void 0||n.remove()}createColumnPickerContainer(){this._menuElm&&(rm.call(this,this._menuElm),this._listElm=De("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",om.bind(this)))}createGridMenu(){var t,e,n,r,o,s;this._gridUid=(e=(t=this._gridUid)!==null&&t!==void 0?t:this.grid.getUID())!==null&&e!==void 0?e:"";const l=this._gridUid?`.${this._gridUid}`:"",u=((n=this._gridMenuOptions)===null||n===void 0?void 0:n.menuWidth)||this._defaults.menuWidth,p=this.gridOptions.hasOwnProperty("frozenColumn")&&this.gridOptions.frozenColumn>=0?"right":"left";if(this._headerElm=document.querySelector(`${l} .slick-header-${p}`),this._headerElm&&this._gridMenuOptions){if(this._headerElm.style.width=`calc(100% - ${u}px)`,((r=this._gridMenuOptions.resizeOnShowHeaderRow)!==null&&r!==void 0?r:this._defaults.resizeOnShowHeaderRow)&&this.gridOptions.showHeaderRow){const m=document.querySelector(`${l} .slick-headerrow`);m&&(m.style.width=`calc(100% - ${u}px)`)}((o=this._gridMenuOptions.showButton)!==null&&o!==void 0?o:this._defaults.showButton)&&(this._gridMenuButtonElm=De("button",{className:"slick-grid-menu-button",ariaLabel:"Grid Menu"}),!((s=this._gridMenuOptions)===null||s===void 0)&&s.iconCssClass&&this._gridMenuButtonElm.classList.add(...this._gridMenuOptions.iconCssClass.split(" ")),this._headerElm.parentElement.insertBefore(this._gridMenuButtonElm,this._headerElm.parentElement.firstChild),this._bindEventService.bind(this._gridMenuButtonElm,"click",this.showGridMenu.bind(this))),this.sharedService.gridOptions.gridMenu={...this._defaults,...this._gridMenuOptions},this.translateTitleLabels(this._gridMenuOptions),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this._menuElm=De("div",{role:"menu",className:`slick-grid-menu ${this._gridUid}`,style:{display:"none"}}),this._commandMenuElm=De("div",{className:"slick-menu-command-list",role:"menu"},this._menuElm),this.recreateCommandList(this._gridMenuOptions,{grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()}),this.createColumnPickerContainer(),document.body.appendChild(this._menuElm),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this))}}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}hideMenu(t){var e,n,r,o;if(((n=(e=this._menuElm)===null||e===void 0?void 0:e.style)===null||n===void 0?void 0:n.display)==="block"){const s={grid:this.grid,menu:this._menuElm,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};if(this.pubSubService.publish("onGridMenuMenuClose",s),typeof((r=this._gridMenuOptions)===null||r===void 0?void 0:r.onMenuClose)=="function"&&this._gridMenuOptions.onMenuClose(t,s)===!1||this.onMenuClose.notify(s,null,this).getReturnValue()===!1)return;if(this._menuElm.style.display="none",this._menuElm.setAttribute("aria-expanded","false"),this._isMenuOpen=!1,typeof((o=this.grid)===null||o===void 0?void 0:o.autosizeColumns)=="function"){const l=this.grid.getUID()||"";this._areVisibleColumnDifferent&&l&&document.querySelector(`.${l}`)!==null&&(this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this._areVisibleColumnDifferent=!1)}}}recreateGridMenu(){this.deleteMenu(),this.init()}repositionMenu(t,e,n=!0){var r,o,s,l,u,p,c,f,m,v;const _=(o=(r=t==null?void 0:t.touches)===null||r===void 0?void 0:r[0])!==null&&o!==void 0?o:t;if(this._menuElm){let C=t.target.nodeName==="BUTTON"?t.target:t.target.querySelector("button");C||(C=t.target.parentElement),this._menuElm.style.display="block",this._menuElm.style.opacity="0";const x=qn(C),w=getComputedStyle(C),E=parseInt((s=w==null?void 0:w.width)!==null&&s!==void 0?s:(l=this._defaults)===null||l===void 0?void 0:l.menuWidth,10),I=(p=(u=this._menuElm)===null||u===void 0?void 0:u.offsetWidth)!==null&&p!==void 0?p:0,k=(f=(c=e==null?void 0:e.contentMinWidth)!==null&&c!==void 0?c:this._defaults.contentMinWidth)!==null&&f!==void 0?f:0,F=(k>I?k:I)||0,N=(m=x==null?void 0:x.top)!==null&&m!==void 0?m:0,V=(v=x==null?void 0:x.right)!==null&&v!==void 0?v:0,Q=((e==null?void 0:e.marginBottom)!==void 0?e.marginBottom:this._defaults.marginBottom)||0,L=(e==null?void 0:e.dropSide)==="right"?V-E:V-F;this._menuElm.style.top=`${N+C.offsetHeight}px`,this._menuElm.style.left=`${L}px`,e.dropSide==="left"?(this._menuElm.classList.remove("dropright"),this._menuElm.classList.add("dropleft")):(this._menuElm.classList.remove("dropleft"),this._menuElm.classList.add("dropright")),this._menuElm.appendChild(this._listElm),k>0&&(this._menuElm.style.minWidth=`${k}px`),this._menuElm.style.minHeight=Xs(e.minHeight,""),(e==null?void 0:e.height)!==void 0?this._menuElm.style.height=Xs(e.height,""):this._menuElm.style.maxHeight=Xs(e.maxHeight,`${window.innerHeight-_.clientY-Q}px`),this._menuElm.style.display="block",n&&(this._menuElm.style.opacity="1"),this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.appendChild(this._listElm),this._isMenuOpen=!0}}showGridMenu(t,e){if(t.preventDefault(),en(this._listElm),en(this._commandMenuElm),this._gridMenuOptions){const n={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()},r={...this._gridMenuOptions,...e};if(this.recreateCommandList(r,n),tu.call(this),this._columnCheckboxes=[],r&&!this.extensionUtility.runOverrideFunctionWhenExists(r.menuUsabilityOverride,n)||typeof t.stopPropagation=="function"&&(this.pubSubService.publish("onGridMenuBeforeMenuShow",n),typeof(r==null?void 0:r.onBeforeMenuShow)=="function"&&r.onBeforeMenuShow(t,n)===!1||this.onBeforeMenuShow.notify(n,null,this).getReturnValue()===!1))return;sm.call(this,r),this.repositionMenu(t,r,!1),this.repositionMenu(t,r,!0),this.pubSubService.publish("onGridMenuAfterMenuShow",n),typeof(r==null?void 0:r.onAfterMenuShow)=="function"&&r.onAfterMenuShow(t,n),this.onAfterMenuShow.notify(n,null,this)}}updateAllTitles(t){var e,n,r,o;!((e=this._commandTitleElm)===null||e===void 0)&&e.textContent&&t.commandTitle&&(this._commandTitleElm.textContent=!((r=(n=this._gridMenuOptions)===null||n===void 0?void 0:n.commandItems)===null||r===void 0)&&r.length?t.commandTitle:"",this._gridMenuOptions.commandTitle=this._commandTitleElm.textContent),!((o=this._columnTitleElm)===null||o===void 0)&&o.textContent&&t.columnTitle&&(this._columnTitleElm.textContent=t.columnTitle,this._gridMenuOptions.columnTitle=t.columnTitle)}translateGridMenu(){var t;if(this.sharedService.gridOptions.gridMenu){this.sharedService.gridOptions.gridMenu.commandItems=[],this.sharedService.gridOptions.gridMenu.commandTitle="",this.sharedService.gridOptions.gridMenu.columnTitle="",this.sharedService.gridOptions.gridMenu.forceFitTitle="",this.sharedService.gridOptions.gridMenu.syncResizeTitle="";const e=this._userOriginalGridMenu&&Array.isArray(this._userOriginalGridMenu.commandItems)?this._userOriginalGridMenu.commandItems:[];this.sharedService.gridOptions.gridMenu.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(((t=this._gridMenuOptions)===null||t===void 0?void 0:t.commandItems)||[]),this.extensionUtility.sortItems(this.sharedService.gridOptions.gridMenu.commandItems,"positionOrder"),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this.translateTitleLabels(this._gridMenuOptions),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.updateAllTitles(this.sharedService.gridOptions.gridMenu)}}translateTitleLabels(t){t&&(t.commandTitle=this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"),t.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),t.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),t.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"))}addGridMenuCustomCommands(t){var e,n,r,o,s,l,u,p,c,f,m,v,_;const C=this.gridOptions.backendServiceApi||null,x=[],w=this.gridOptions,E=ao(w),I=(e=this._gridMenuOptions)===null||e===void 0?void 0:e.commandLabels;if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearFrozenColumnsCommand){const F="clear-pinning";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearFrozenColumnsCommand||"fa fa-times",titleKey:`${E}${(n=I==null?void 0:I.clearFrozenColumnsCommandKey)!==null&&n!==void 0?n:"CLEAR_PINNING"}`,disabled:!1,command:F,positionOrder:52})}if(this.gridOptions&&this.gridOptions.enableFiltering&&!this.sharedService.hideHeaderRowAfterPageLoad){if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearAllFiltersCommand){const F="clear-filter";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearAllFiltersCommand||"fa fa-filter text-danger",titleKey:`${E}${(r=I==null?void 0:I.clearAllFiltersCommandKey)!==null&&r!==void 0?r:"CLEAR_ALL_FILTERS"}`,disabled:!1,command:F,positionOrder:50})}if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideToggleFilterCommand){const F="toggle-filter";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconToggleFilterCommand||"fa fa-random",titleKey:`${E}${(o=I==null?void 0:I.toggleFilterCommandKey)!==null&&o!==void 0?o:"TOGGLE_FILTER_ROW"}`,disabled:!1,command:F,positionOrder:53})}if(C&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideRefreshDatasetCommand){const F="refresh-dataset";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconRefreshDatasetCommand||"fa fa-refresh",titleKey:`${E}${(s=I==null?void 0:I.refreshDatasetCommandKey)!==null&&s!==void 0?s:"REFRESH_DATASET"}`,disabled:!1,command:F,positionOrder:57})}}if(this.gridOptions.showPreHeaderPanel&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideTogglePreHeaderCommand){const F="toggle-preheader";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconTogglePreHeaderCommand||"fa fa-random",titleKey:`${E}${(l=I==null?void 0:I.togglePreHeaderCommandKey)!==null&&l!==void 0?l:"TOGGLE_PRE_HEADER_ROW"}`,disabled:!1,command:F,positionOrder:53})}if(this.gridOptions.enableSorting&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearAllSortingCommand){const F="clear-sorting";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearAllSortingCommand||"fa fa-unsorted text-danger",titleKey:`${E}${(u=I==null?void 0:I.clearAllSortingCommandKey)!==null&&u!==void 0?u:"CLEAR_ALL_SORTING"}`,disabled:!1,command:F,positionOrder:51})}if(!((p=this.gridOptions)===null||p===void 0)&&p.enableTextExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportCsvCommand){const F="export-csv";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportCsvCommand||"fa fa-download",titleKey:`${E}${(c=I==null?void 0:I.exportCsvCommandKey)!==null&&c!==void 0?c:"EXPORT_TO_CSV"}`,disabled:!1,command:F,positionOrder:54})}if(this.gridOptions&&this.gridOptions.enableExcelExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportExcelCommand){const F="export-excel";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportExcelCommand||"fa fa-file-excel-o text-success",titleKey:`${E}${(f=I==null?void 0:I.exportExcelCommandKey)!==null&&f!==void 0?f:"EXPORT_TO_EXCEL"}`,disabled:!1,command:F,positionOrder:55})}if(!((m=this.gridOptions)===null||m===void 0)&&m.enableTextExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportTextDelimitedCommand){const F="export-text-delimited";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportTextDelimitedCommand||"fa fa-download",titleKey:`${E}${(v=I==null?void 0:I.exportTextDelimitedCommandKey)!==null&&v!==void 0?v:"EXPORT_TO_TAB_DELIMITED"}`,disabled:!1,command:F,positionOrder:56})}const k=((_=this._gridMenuOptions)===null||_===void 0?void 0:_.commandItems)||[];return this.gridOptions&&this._gridMenuOptions&&(Array.isArray(x)&&x.length>0||Array.isArray(k)&&k.length>0)&&(this._gridMenuOptions.commandTitle=this._gridMenuOptions.commandTitle||this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu")),x}executeGridMenuInternalCustomCommands(t,e){var n,r,o,s,l;const u=((n=this.sharedService)===null||n===void 0?void 0:n.externalRegisteredResources)||[];if(e!=null&&e.command)switch(e.command){case"clear-pinning":const p=[...this.sharedService.visibleColumns],c={frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1};this.grid.setOptions(c),this.sharedService.gridOptions.frozenColumn=c.frozenColumn,this.sharedService.gridOptions.frozenRow=c.frozenRow,this.sharedService.gridOptions.frozenBottom=c.frozenBottom,this.sharedService.gridOptions.enableMouseWheelScrollHandler=c.enableMouseWheelScrollHandler,Array.isArray(p)&&this.grid.setColumns(p),this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this.pubSubService.publish("onGridMenuClearAllPinning");break;case"clear-filter":this.filterService.clearFilters(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllFilters");break;case"clear-sorting":this.sortService.clearSorting(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllSorting");break;case"export-csv":const m=u.find(w=>w.className==="TextExportService");m!=null&&m.exportToFile?m.exportToFile({delimiter:vs.comma,format:dn.csv}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };");break;case"export-excel":const v=u.find(w=>w.className==="ExcelExportService");v!=null&&v.exportToExcel?v.exportToExcel():console.error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Grid Menu. Example:: this.gridOptions = { enableExcelExport: true, registerExternalResources: [new ExcelExportService()] };");break;case"export-text-delimited":const _=u.find(w=>w.className==="TextExportService");_!=null&&_.exportToFile?_.exportToFile({delimiter:vs.tab,format:dn.txt}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };");break;case"toggle-filter":let C=(o=(r=this.gridOptions)===null||r===void 0?void 0:r.showHeaderRow)!==null&&o!==void 0?o:!1;C=!C,this.grid.setHeaderRowVisibility(C),C===!0&&(this.grid.setColumns(this.sharedService.columnDefinitions),this.grid.scrollColumnIntoView(0));break;case"toggle-preheader":const x=(l=(s=this.gridOptions)===null||s===void 0?void 0:s.showPreHeaderPanel)!==null&&l!==void 0?l:!1;this.grid.setPreHeaderPanelVisibility(!x);break;case"refresh-dataset":this.extensionUtility.refreshBackendDataset();break}}getDefaultGridMenuOptions(){return{commandTitle:void 0,columnTitle:this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),forceFitTitle:this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),syncResizeTitle:this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"),iconCssClass:"fa fa-bars",menuWidth:18,commandItems:[],hideClearAllFiltersCommand:!1,hideRefreshDatasetCommand:!1,hideToggleFilterCommand:!1}}handleBodyMouseDown(t){var e;(this._menuElm!==t.target&&!(!((e=this._menuElm)===null||e===void 0)&&e.contains(t.target))&&this._isMenuOpen||t.target.className==="close")&&this.hideMenu(t)}handleMenuItemCommandClick(t,e,n){var r,o;if(n==="divider"||n.command&&(n.disabled||n.divider))return!1;const s={grid:this.grid,command:n.command,item:n,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};this.executeGridMenuInternalCustomCommands(t,s),this.pubSubService.publish("onGridMenuCommand",s),typeof((r=this._gridMenuOptions)===null||r===void 0?void 0:r.onCommand)=="function"&&this._gridMenuOptions.onCommand(t,s),this.onCommand.notify(s,null,this),typeof n.action=="function"&&n.action.call(this,t,s),!(!((o=this._gridMenuOptions)===null||o===void 0)&&o.leaveOpen)&&!t.defaultPrevented&&this.hideMenu(t),t.preventDefault(),t.stopPropagation()}recreateCommandList(t,e){var n;this.populateCommandOrOptionTitle("command",t,this._commandMenuElm);const r=(n=this._commandMenuElm.querySelector(".slick-command-header"))!==null&&n!==void 0?n:De("div",{className:"slick-command-header"});r.classList.add("with-close"),nm.call(this,r),this._commandMenuElm.appendChild(r),this.populateCommandOrOptionItems("command",t,this._commandMenuElm,(t==null?void 0:t.commandItems)||[],e,this.handleMenuItemCommandClick)}}function nm(a){const e=De("button",{type:"button",className:"close",ariaLabel:"Close",innerHTML:"&times;",dataset:{dismiss:this instanceof bh?"slick-column-picker":"slick-grid-menu"}});a.appendChild(e)}function rm(a){var t,e,n;const r=this;!((t=r.addonOptions)===null||t===void 0)&&t.columnTitle&&(r._columnTitleElm=De("div",{className:"slick-menu-title",textContent:(n=(e=r.addonOptions)===null||e===void 0?void 0:e.columnTitle)!==null&&n!==void 0?n:r._defaults.columnTitle},a))}function om(a){var t,e;const n=this,r=n instanceof bh?"columnPicker":"gridMenu";if(a.target.dataset.option==="autoresize"){const o=n.getVisibleColumns();a.target.ariaChecked=String(a.target.checked);const s=a.target.checked;n.grid.setOptions({forceFitColumns:s}),n.grid.setColumns(o);return}if(a.target.dataset.option==="syncresize"){a.target.ariaChecked=String(a.target.checked),n.grid.setOptions({syncColumnCellResize:!!a.target.checked});return}if(a.target.type==="checkbox"){n._areVisibleColumnDifferent=!0,a.target.ariaChecked=String(a.target.checked);const o=a.target.checked,s=a.target.dataset.columnid||"",l=[];if(n._columnCheckboxes.forEach((c,f)=>{c.checked&&l.push(n.columns[f])}),!l.length){a.target.checked=!0;return}if(n.grid.setColumns(l),(!n.sharedService.visibleColumns||Array.isArray(l)&&l.length!==n.sharedService.visibleColumns.length)&&(n.sharedService.visibleColumns=l),n.gridOptions.enableRowSelection&&o){const c=n.grid.getSelectedRows();n.grid.setSelectedRows(c)}const u=(t=n.gridOptions.frozenColumn)!==null&&t!==void 0?t:-1;u>=0&&n.extensionUtility.readjustFrozenColumnIndexWhenNeeded(u,n.columns,l);const p={columnId:s,showing:o,allColumns:n.columns,visibleColumns:l,columns:l,grid:n.grid};n.pubSubService.publish(`on${El(r)}ColumnsChanged`,p),typeof((e=n.addonOptions)===null||e===void 0?void 0:e.onColumnsChanged)=="function"&&n.addonOptions.onColumnsChanged(a,p),n.onColumnsChanged.notify(p,null,n)}}function sm(a){var t,e;const n=this,r=n instanceof im?"gridmenu-":"";for(const o of n.columns){const s=o.id,l=document.createElement("li");o.excludeFromColumnPicker&&(l.className="hidden");const u=De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-${s}`,dataset:{columnid:`${s}`}});n.grid.getColumnIndex(s)>=0&&(u.ariaChecked="true",u.checked=!0),l.appendChild(u),n._columnCheckboxes.push(u);const f=(typeof(a==null?void 0:a.headerColumnValueExtractor)=="function"?a.headerColumnValueExtractor:n._defaults.headerColumnValueExtractor)(o,n.gridOptions);l.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-${s}`,innerHTML:Pn(n.gridOptions,f)})),n._listElm.appendChild(l)}if((!a.hideForceFitButton||!a.hideSyncResizeButton)&&n._listElm.appendChild(document.createElement("hr")),!(a!=null&&a.hideForceFitButton)){const o=document.createElement("li");o.appendChild(De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-forcefit`,ariaChecked:String(n.gridOptions.forceFitColumns),checked:n.gridOptions.forceFitColumns,dataset:{option:"autoresize"}})),o.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-forcefit`,textContent:(t=a==null?void 0:a.forceFitTitle)!==null&&t!==void 0?t:""})),n._listElm.appendChild(o)}if(!(a!=null&&a.hideSyncResizeButton)){const o=document.createElement("li");o.appendChild(De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-syncresize`,ariaChecked:String(n.gridOptions.syncColumnCellResize),checked:n.gridOptions.syncColumnCellResize,dataset:{option:"syncresize"}})),o.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-syncresize`,textContent:(e=a==null?void 0:a.syncResizeTitle)!==null&&e!==void 0?e:""})),n._listElm.appendChild(o)}}function tu(){const a=this,t=a.grid.getColumns().slice(0),e=new Array(a.columns.length);for(let n=0;n<e.length;n++)a.grid.getColumnIndex(a.columns[n].id)===void 0?e[n]=a.columns[n]:e[n]=t.shift();a._columns=e}class bh{constructor(t,e,n){var r,o,s,l;this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._areVisibleColumnDifferent=!1,this._columns=[],this._gridUid="",this._columnCheckboxes=[],this.onColumnsChanged=new Slick.Event,this._defaults={hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",minHeight:200,syncResizeTitle:"Synchronous resize",headerColumnValueExtractor:u=>u.name},this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this._columns=(r=this.sharedService.allColumns)!==null&&r!==void 0?r:[],this._gridUid=(l=(s=(o=this.grid)===null||o===void 0?void 0:o.getUID)===null||s===void 0?void 0:s.call(o))!==null&&l!==void 0?l:"",this.init()}get addonOptions(){return this.gridOptions.columnPicker||{}}get eventHandler(){return this._eventHandler}get columns(){return this._columns}set columns(t){this._columns=t}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get grid(){return this.sharedService.slickGrid}get menuElement(){return this._menuElm}init(){var t;this._gridUid=(t=this.grid.getUID())!==null&&t!==void 0?t:"",this.gridOptions.columnPicker={...this._defaults,...this.gridOptions.columnPicker},this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker"),this._eventHandler.subscribe(this.grid.onHeaderContextMenu,this.handleHeaderContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onColumnsReordered,tu.bind(this)),this._menuElm=De("div",{ariaExpanded:"false",className:`slick-column-picker ${this._gridUid}`,role:"menu",style:{display:"none"}}),rm.call(this,this._menuElm),nm.call(this,this._menuElm),this._listElm=De("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",om.bind(this)),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this)),document.body.appendChild(this._menuElm)}dispose(){var t,e,n,r;this._eventHandler.unsubscribeAll(),this._bindEventService.unbindAll(),(e=(t=this._listElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t),(r=(n=this._menuElm)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n)}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}translateColumnPicker(){this.addonOptions&&(this.addonOptions.columnTitle="",this.addonOptions.forceFitTitle="",this.addonOptions.syncResizeTitle="",this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker")),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.addonOptions&&this.updateAllTitles(this.addonOptions)}handleBodyMouseDown(t){(this._menuElm!==t.target&&!this._menuElm.contains(t.target)||t.target.className==="close")&&(this._menuElm.setAttribute("aria-expanded","false"),this._menuElm.style.display="none")}handleHeaderContextMenu(t){t.preventDefault(),en(this._listElm),tu.call(this),this._columnCheckboxes=[],sm.call(this,this.addonOptions),this.repositionMenu(t)}repositionMenu(t){var e,n;const r=(n=(e=t==null?void 0:t.touches)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:t;this._menuElm.style.top=`${r.pageY-10}px`,this._menuElm.style.left=`${r.pageX-10}px`,this._menuElm.style.minHeight=Xs(this.addonOptions.minHeight,""),this._menuElm.style.maxHeight=Xs(this.addonOptions.maxHeight,`${window.innerHeight-r.clientY}px`),this._menuElm.style.display="block",this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.appendChild(this._listElm)}updateAllTitles(t){var e;!((e=this._columnTitleElm)===null||e===void 0)&&e.textContent&&t.columnTitle&&(this._columnTitleElm.textContent=t.columnTitle)}}const iu=(a,t,e,n,r,o)=>{const s=n.params||{};if(!s.formatters||!Array.isArray(s.formatters))throw new Error(`The multiple formatter requires the "formatters" to be provided as a column params.
7
+ `}if(window.clipboardData)return window.clipboardData.setData("Text",c),!0;{const f=document.activeElement,m=this.createTextBox(c);if(m.focus(),setTimeout(()=>{this._bodyElement.removeChild(m),f?f.focus():console.log("No element to restore focus to after copy?")},(o=(r=this.addonOptions)===null||r===void 0?void 0:r.clipboardPasteDelay)!==null&&o!==void 0?o:Qp),typeof this._onCopySuccess=="function"){const v=u.length===1?u[0].toRow+1-u[0].fromRow:u.length;this._onCopySuccess(v)}return!1}}if(!this._addonOptions.readOnlyMode&&((t.which===li.V||t.key==="v")&&(t.ctrlKey||t.metaKey)&&!t.shiftKey||(t.which===li.INSERT||t.key==="Insert")&&t.shiftKey&&!t.ctrlKey)){const p=this.createTextBox("");return setTimeout(()=>this.decodeTabularData(this._grid,p),(l=(s=this.addonOptions)===null||s===void 0?void 0:s.clipboardPasteDelay)!==null&&l!==void 0?l:Qp),!1}}}markCopySelection(t){var e;this.clearCopySelection();const n=this._grid.getColumns(),r={};for(const o of t)for(let s=o.fromRow;s<=o.toRow;s++){r[s]={};for(let l=o.fromCell;l<=o.toCell&&l<n.length;l++)r[s][n[l].id]=this._copiedCellStyle}this._grid.setCellCssStyles(this._copiedCellStyleLayerKey,r),clearTimeout(this._clearCopyTI),this._clearCopyTI=setTimeout(()=>this.clearCopySelection(),((e=this.addonOptions)===null||e===void 0?void 0:e.clearCopySelectionDelay)||M_)}}class eu{constructor(t,e,n){this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._addonOptions={},this._camelPluginName="",this._gridUid="",this._menuCssPrefix="",this._menuPluginCssPrefix="",this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler}get addonOptions(){return this._addonOptions}set addonOptions(t){this._addonOptions=t}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get gridUid(){var t,e;return this._gridUid||((e=(t=this.grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get menuElement(){return this._menuElm||document.querySelector(`.${this._menuPluginCssPrefix||this._menuCssPrefix}${this.gridUidSelector}`)}dispose(){var t,e,n,r,o;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),this._bindEventService.unbindAll(),this.pubSubService.unsubscribeAll(),(e=this._commandTitleElm)===null||e===void 0||e.remove(),(n=this._optionTitleElm)===null||n===void 0||n.remove(),(r=this.menuElement)===null||r===void 0||r.remove(),en(this._menuElm),(o=this._menuElm)===null||o===void 0||o.remove()}setOptions(t){this._addonOptions={...this._addonOptions,...t}}populateCommandOrOptionItems(t,e,n,r,o,s){if(o&&r&&e)for(const l of r)this.populateSingleCommandOrOptionItem(t,e,n,l,o,s)}populateCommandOrOptionTitle(t,e,n){var r,o;if(e){const s=(o=(r=this._menuElm)===null||r===void 0?void 0:r.querySelector(`.slick-${t}-header`))!==null&&o!==void 0?o:De("div",{className:`slick-${t}-header`}),l=`${t}Title`;e!=null&&e[l]?(this[`_${t}TitleElm`]=De("span",{className:"slick-menu-title",textContent:e[l]}),s.appendChild(this[`_${t}TitleElm`]),s.classList.add("with-title")):s.classList.add("no-title"),n.appendChild(s)}}populateSingleCommandOrOptionItem(t,e,n,r,o,s){let l=null;if(o&&r&&e){const u=this._camelPluginName==="headerButtons"?"":"-item",p=`${this._menuCssPrefix}${u}`;let c=!0,f=!0;if(typeof r=="object"&&(c=this.extensionUtility.runOverrideFunctionWhenExists(r.itemVisibilityOverride,o),f=this.extensionUtility.runOverrideFunctionWhenExists(r.itemUsabilityOverride,o)),!c)return null;if(typeof r=="object"&&r.itemUsabilityOverride&&(r.disabled=!f),l=De("li",{className:p,role:"menuitem"}),typeof r=="object"&&$d(r[t])&&(l.dataset[t]=r==null?void 0:r[t]),n&&n.appendChild(l),typeof r=="object"&&r.divider||r==="divider")return l.classList.add(`${p}-divider`),l;if(r.disabled&&l.classList.add(`${p}-disabled`),(r.hidden||r.showOnHover)&&l.classList.add(`${p}-hidden`),r.cssClass&&l.classList.add(...r.cssClass.split(" ")),r.tooltip&&(l.title=r.tooltip),this._camelPluginName!=="headerButtons"){const m=De("div",{className:`${this._menuCssPrefix}-icon`});l.appendChild(m),r.iconCssClass?m.classList.add(...r.iconCssClass.split(" ")):m.textContent="◦";const v=De("span",{className:`${this._menuCssPrefix}-content`,textContent:typeof r=="object"&&r.title||""},l);r.textCssClass&&v.classList.add(...r.textCssClass.split(" "))}this._bindEventService.bind(l,"click",m=>s.call(this,m,t,r,o==null?void 0:o.column)),r.handler&&!r.disabled&&this._bindEventService.bind(l,"click",m=>r.handler.call(this,m))}return l}}class Jp extends eu{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._currentCell=-1,this._currentRow=-1}createMenu(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E;(e=this.menuElement)===null||e===void 0||e.remove(),this._menuElm=void 0;const I=this.grid.getCellFromEvent(t);if(I){this._currentCell=(n=I.cell)!==null&&n!==void 0?n:0,this._currentRow=(r=I.row)!==null&&r!==void 0?r:0;const k=this.grid.getColumns()[this._currentCell],F=this.grid.getDataItem(this._currentRow),N=(s=(o=t==null?void 0:t.touches)===null||o===void 0?void 0:o[0])!==null&&s!==void 0?s:t,V=((l=this._addonOptions)===null||l===void 0?void 0:l.commandItems)||[],Q=((u=this._addonOptions)===null||u===void 0?void 0:u.optionItems)||[];let L=!0,se=!0;if(this._camelPluginName==="contextMenu"){if(L=this.checkIsColumnAllowed((c=(p=this._addonOptions)===null||p===void 0?void 0:p.optionShownOverColumnIds)!==null&&c!==void 0?c:[],k.id),se=this.checkIsColumnAllowed((m=(f=this._addonOptions)===null||f===void 0?void 0:f.commandShownOverColumnIds)!==null&&m!==void 0?m:[],k.id),!k||(!se||!V.length)&&(!L||!Q.length)){this.hideMenu();return}}else if(!k||!k.cellMenu||!V.length&&!Q.length)return;const Ce={cell:this._currentCell,row:this._currentRow,grid:this.grid};if(this.closeMenu(t,Ce),typeof t.stopPropagation=="function"&&(this.pubSubService.publish(`on${El(this._camelPluginName)}BeforeMenuShow`,Ce),typeof((v=this.addonOptions)===null||v===void 0?void 0:v.onBeforeMenuShow)=="function"&&this.addonOptions.onBeforeMenuShow(t,Ce)===!1))return;this._menuElm=De("div",{className:`${this._menuPluginCssPrefix||this._menuCssPrefix} ${this.gridUid}`,style:{display:"none",left:`${N.pageX}px`,top:`${N.pageY+5}px`}});const J=isNaN(this.addonOptions.maxHeight)?this.addonOptions.maxHeight:`${(_=this.addonOptions.maxHeight)!==null&&_!==void 0?_:0}px`,z=isNaN(this.addonOptions.maxWidth)?this.addonOptions.maxWidth:`${(C=this.addonOptions.maxWidth)!==null&&C!==void 0?C:0}px`;J&&(this._menuElm.style.maxHeight=J),z&&(this._menuElm.style.maxWidth=z),!((x=this.addonOptions)===null||x===void 0)&&x.width&&(this._menuElm.style.width=Xs((w=this.addonOptions)===null||w===void 0?void 0:w.width));const P=De("button",{ariaLabel:"Close",className:"close",type:"button",innerHTML:"&times;",dataset:{dismiss:this._menuCssPrefix}});if(!this.addonOptions.hideOptionSection&&L&&Q.length>0){const le=De("div",{className:`${this._menuCssPrefix}-option-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("option",this.addonOptions,le),this.addonOptions.hideCloseButton||this.populateCommandOrOptionCloseBtn("option",P,le),this.populateCommandOrOptionItems("option",this.addonOptions,le,Q,{cell:this._currentCell,row:this._currentRow,column:k,dataContext:F,grid:this.grid},this.handleMenuItemCommandClick)}if(!this.addonOptions.hideCommandSection&&se&&V.length>0){const le=De("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("command",this.addonOptions,le),!this.addonOptions.hideCloseButton&&(!L||Q.length===0||this.addonOptions.hideOptionSection)&&this.populateCommandOrOptionCloseBtn("command",P,le),this.populateCommandOrOptionItems("command",this.addonOptions,le,V,{cell:this._currentCell,row:this._currentRow,column:k,dataContext:F,grid:this.grid},this.handleMenuItemCommandClick)}if(this._menuElm.style.display="block",document.body.appendChild(this._menuElm),this.pubSubService.publish(`on${El(this._camelPluginName)}AfterMenuShow`,Ce),typeof((E=this.addonOptions)===null||E===void 0?void 0:E.onAfterMenuShow)=="function"&&this.addonOptions.onAfterMenuShow(t,Ce)===!1)return}return this._menuElm}closeMenu(t,e){var n;if(this.menuElement){if(typeof((n=this.addonOptions)===null||n===void 0?void 0:n.onBeforeMenuClose)=="function"&&this.addonOptions.onBeforeMenuClose(t,e)===!1)return;this.hideMenu()}}hideMenu(){var t;(t=this.menuElement)===null||t===void 0||t.remove(),this._menuElm=null}checkIsColumnAllowed(t,e){return(t==null?void 0:t.length)>0?t.findIndex(n=>n===e)>=0:!0}handleBodyMouseDown(t){var e;(this.menuElement!==t.target&&!(!((e=this.menuElement)===null||e===void 0)&&e.contains(t.target))||t.target.className==="close")&&this.closeMenu(t,{cell:this._currentCell,row:this._currentRow,grid:this.grid})}handleCloseButtonClicked(t){t.defaultPrevented||this.closeMenu(t,{cell:0,row:0,grid:this.grid})}handleMenuItemCommandClick(t,e,n){var r;if((n==null?void 0:n[e])!==void 0&&n!=="divider"&&!n.disabled&&!n.divider&&this._currentCell!==void 0&&this._currentRow!==void 0){if(e==="option"&&!this.grid.getEditorLock().commitCurrentEdit())return;const o=this._currentCell,s=this._currentRow,l=this.grid.getColumns()[this._currentCell],u=this.grid.getDataItem(this._currentRow),p={cell:this._currentCell,row:this._currentRow,grid:this.grid,[e]:n[e],item:n,column:l,dataContext:u},c=e==="command"?"onCommand":"onOptionSelected",f=`${this._camelPluginName}:${c}`;this.pubSubService.publish(f,p),typeof((r=this._addonOptions)===null||r===void 0?void 0:r[c])=="function"&&this._addonOptions[c](t,p),typeof n.action=="function"&&n.action.call(this,t,p),t.defaultPrevented||this.closeMenu(t,{cell:o,row:s,grid:this.grid})}}populateCommandOrOptionCloseBtn(t,e,n){var r;this._bindEventService.bind(e,"click",s=>this.handleCloseButtonClicked(s));const o=(r=n.querySelector(`.slick-${t}-header`))!==null&&r!==void 0?r:De("div",{className:`slick-${t}-header`});o==null||o.appendChild(e),n.appendChild(o),o.classList.add("with-close")}repositionMenu(t){var e,n,r,o,s,l,u,p;if(this._menuElm&&t.target){this._menuElm.style.top="0px",this._menuElm.style.left="0px";const c=(n=(e=t==null?void 0:t.touches)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:t,f=t.target.closest(".slick-cell");let m=f&&this._camelPluginName==="cellMenu"?(o=(r=qn(f))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:0:c.pageX,v=f&&this._camelPluginName==="cellMenu"?(l=(s=qn(f))===null||s===void 0?void 0:s.top)!==null&&l!==void 0?l:0:c.pageY;const _=f.offsetWidth||0,C=((u=this._menuElm)===null||u===void 0?void 0:u.offsetHeight)||0,x=((p=this._menuElm)===null||p===void 0?void 0:p.offsetWidth)||this._addonOptions.width||0,w=this.gridOptions.rowHeight||0,E=+(this._addonOptions.autoAdjustDropOffset||0),I=+(this._addonOptions.autoAlignSideOffset||0);if(this._addonOptions.autoAdjustDrop||this._addonOptions.dropDirection){const k=vh(f).bottom,F=vh(f).top,N=k+E-w,V=F-E+w;(N<C&&V>N?"top":"bottom")==="top"||this._addonOptions.dropDirection==="top"?(this._menuElm.classList.remove("dropdown"),this._menuElm.classList.add("dropup"),v=v-C-E):(this._menuElm.classList.remove("dropup"),this._menuElm.classList.add("dropdown"),v=v+E,this._camelPluginName==="cellMenu"&&(v+=w))}if(this._addonOptions.autoAlignSide||this._addonOptions.dropSide==="left"){const k=this.grid.getGridPosition();(m+ +x>=k.width?"left":"right")==="left"||this._addonOptions.dropSide==="left"?(this._menuElm.classList.remove("dropright"),this._menuElm.classList.add("dropleft"),this._camelPluginName==="cellMenu"?m=m-(+x-_)-I:m=m-+x-I):(this._menuElm.classList.remove("dropleft"),this._menuElm.classList.add("dropright"),m=m+I)}this._menuElm.style.top=`${v}px`,this._menuElm.style.left=`${m}px`}}}class L_ extends Jp{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!0},this.pluginName="CellMenu",this._camelPluginName="cellMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-cell-menu",this.init(n.gridOptions.cellMenu)}init(t){this._addonOptions={...this._defaults,...t},this.sortMenuItems(this.sharedService.allColumns),this._eventHandler.subscribe(this.grid.onClick,this.handleCellClick.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateCellMenu(){var t;const e=(t=this.sharedService)===null||t===void 0?void 0:t.gridOptions,n=this.sharedService.allColumns;e!=null&&e.enableTranslate&&Array.isArray(n)&&n.forEach(r=>{if(r!=null&&r.cellMenu&&(Array.isArray(r.cellMenu.commandItems)||Array.isArray(r.cellMenu.optionItems))){const o=r.cellMenu.commandItems||[],s=r.cellMenu.optionItems||[];r.cellMenu.commandTitleKey&&(r.cellMenu.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.cellMenu.commandTitleKey,"TEXT_COMMANDS")||r.cellMenu.commandTitle),r.cellMenu.optionTitleKey&&(r.cellMenu.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.cellMenu.optionTitleKey,"TEXT_COMMANDS")||r.cellMenu.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(o),this.extensionUtility.translateMenuItemsFromTitleKey(s)}})}handleCellClick(t,e){const n=this.grid.getCellFromEvent(t);if(n){const r=this.grid.getDataItem(n.row),o=this.grid.getColumns()[n.cell];if(o!=null&&o.cellMenu&&t.preventDefault(),this._addonOptions={...this._addonOptions,...o.cellMenu},e=e||{},e.column=o,e.dataContext=r,e.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,e))return;this._menuElm=this.createMenu(t),this._menuElm&&(this.repositionMenu(t),this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.style.display="block"),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}sortMenuItems(t){t.forEach(e=>{var n,r;!((n=e==null?void 0:e.cellMenu)===null||n===void 0)&&n.commandItems&&this.extensionUtility.sortItems(e.cellMenu.commandItems||[],"positionOrder"),!((r=e==null?void 0:e.cellMenu)===null||r===void 0)&&r.optionItems&&this.extensionUtility.sortItems(e.cellMenu.optionItems||[],"positionOrder")})}}class H_{constructor(t,e){this.grid=t,this.pluginName="CellRangeDecorator",this._defaults={selectionCssClass:"slick-range-decorator",selectionCss:{border:"2px dashed red",zIndex:"9999"},offset:{top:-1,left:-1,height:-2,width:-2}},this._addonOptions=yl(this._defaults,e)}get addonOptions(){return this._addonOptions}get addonElement(){return this._elem}dispose(){this.hide()}hide(){var t;(t=this._elem)===null||t===void 0||t.remove(),this._elem=null}show(t){var e,n;this._elem||(this._elem=De("div",{className:this._addonOptions.selectionCssClass}),Object.keys(this._addonOptions.selectionCss).forEach(s=>{this._elem.style[s]=this._addonOptions.selectionCss[s]}),this._elem.style.position="absolute",(e=this.grid.getActiveCanvasNode())===null||e===void 0||e.appendChild(this._elem));const r=this.grid.getCellNodeBox(t.fromRow,t.fromCell),o=this.grid.getCellNodeBox(t.toRow,t.toCell);return r&&o&&(!((n=this._addonOptions)===null||n===void 0)&&n.offset)&&(this._elem.style.top=`${r.top+this._addonOptions.offset.top}px`,this._elem.style.left=`${r.left+this._addonOptions.offset.left}px`,this._elem.style.height=`${o.bottom-r.top+this._addonOptions.offset.height}px`,this._elem.style.width=`${o.right-r.left+this._addonOptions.offset.width}px`),this._elem}}class em{constructor(t){this._currentlySelectedRange=null,this._dragging=!1,this._gridUid="",this._columnOffset=0,this._rowOffset=0,this._isRightCanvas=!1,this._isBottomCanvas=!1,this._xDelayForNextCell=0,this._yDelayForNextCell=0,this._viewportHeight=0,this._viewportWidth=0,this._isRowMoveRegistered=!1,this._scrollLeft=0,this._scrollTop=0,this._defaults={autoScroll:!0,minIntervalToShowNextCell:30,maxIntervalToShowNextCell:600,accelerateInterval:5,selectionCss:{border:"2px dashed blue"}},this.pluginName="CellRangeSelector",this.onBeforeCellRangeSelected=new Slick.Event,this.onCellRangeSelecting=new Slick.Event,this.onCellRangeSelected=new Slick.Event,this._eventHandler=new Slick.EventHandler,this._addonOptions=yl(this._defaults,t)}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridUid(){var t,e;return this._gridUid||((e=(t=this._grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}init(t){this._grid=t,this._decorator=this._addonOptions.cellDecorator||new H_(t,this._addonOptions),this._canvas=t.getCanvasNode(),this._gridOptions=t.getOptions(),this._gridUid=t.getUID(),this._eventHandler.subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this)).subscribe(this._grid.onScroll,this.handleScroll.bind(this))}destroy(){this.dispose()}dispose(){var t,e;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),en(this._activeCanvas),en(this._canvas),(e=this._decorator)===null||e===void 0||e.dispose(),this.stopIntervalTimer()}getCellDecorator(){return this._decorator}getCurrentRange(){return this._currentlySelectedRange}getMouseOffsetViewport(t,e){var n,r,o,s;const l=(r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t,u=this._activeViewport.scrollLeft,p=this._activeViewport.scrollTop,c=u+this._viewportWidth,f=p+this._viewportHeight,m=qn(this._activeViewport),v=(o=m==null?void 0:m.left)!==null&&o!==void 0?o:0,_=(s=m==null?void 0:m.top)!==null&&s!==void 0?s:0,C=v+this._viewportWidth,x=_+this._viewportHeight,w={e:t,dd:e,viewport:{left:u,top:p,right:c,bottom:f,offset:{left:v,top:_,right:C,bottom:x}},offset:{x:0,y:0},isOutsideViewport:!1};return l.pageX<v?w.offset.x=l.pageX-v:l.pageX>C&&(w.offset.x=l.pageX-C),l.pageY<_?w.offset.y=_-l.pageY:l.pageY>x&&(w.offset.y=x-l.pageY),w.isOutsideViewport=!!w.offset.x||!!w.offset.y,w}stopIntervalTimer(){this._autoScrollTimerId&&(clearInterval(this._autoScrollTimerId),this._autoScrollTimerId=void 0)}handleDrag(t,e){if(!(!this._dragging&&!this._gridOptions.enableRowMoveManager)){if(this._gridOptions.enableRowMoveManager||t.stopImmediatePropagation(),this.addonOptions.autoScroll&&(this._draggingMouseOffset=this.getMouseOffsetViewport(t,e),this._draggingMouseOffset.isOutsideViewport))return this.handleDragOutsideViewport();this.stopIntervalTimer(),this.handleDragTo(t,e)}}handleDragOutsideViewport(){if(this._xDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.x)*this.addonOptions.accelerateInterval,this._yDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.y)*this.addonOptions.accelerateInterval,!this._autoScrollTimerId){let t=0,e=0;this._autoScrollTimerId=setInterval(()=>{let n=!1,r=!1;this._draggingMouseOffset.offset.x?(t+=this.addonOptions.minIntervalToShowNextCell,n=t>=this._xDelayForNextCell):t=0,this._draggingMouseOffset.offset.y?(e+=this.addonOptions.minIntervalToShowNextCell,r=e>=this._yDelayForNextCell):e=0,(n||r)&&(n&&(t=0),r&&(e=0),this.handleDragToNewPosition(n,r))},this.addonOptions.minIntervalToShowNextCell)}}handleDragToNewPosition(t,e){let n=this._draggingMouseOffset.e.pageX,r=this._draggingMouseOffset.e.pageY;const o=this._draggingMouseOffset.offset.x,s=this._draggingMouseOffset.offset.y,l=this._draggingMouseOffset.viewport.offset;t&&o&&(o>0?n=l.right+this._moveDistanceForOneCell.x:n=l.left-this._moveDistanceForOneCell.x),e&&s&&(s>0?r=l.top-this._moveDistanceForOneCell.y:r=l.bottom+this._moveDistanceForOneCell.y),this.handleDragTo({pageX:n,pageY:r},this._draggingMouseOffset.dd)}handleDragTo(t,e){var n,r,o,s,l,u;const p=(r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t,c=this._grid.getCellFromPoint(p.pageX-((s=(o=qn(this._activeCanvas))===null||o===void 0?void 0:o.left)!==null&&s!==void 0?s:0)+this._columnOffset,p.pageY-((u=(l=qn(this._activeCanvas))===null||l===void 0?void 0:l.top)!==null&&u!==void 0?u:0)+this._rowOffset);if(c!==void 0){if(this._gridOptions.frozenColumn>=0&&(!this._isRightCanvas&&c.cell>this._gridOptions.frozenColumn||this._isRightCanvas&&c.cell<=this._gridOptions.frozenColumn)||this._gridOptions.frozenRow>=0&&(!this._isBottomCanvas&&c.row>=this._gridOptions.frozenRow||this._isBottomCanvas&&c.row<this._gridOptions.frozenRow))return;if(this.addonOptions.autoScroll&&this._draggingMouseOffset){const f=this._grid.getCellNodeBox(c.row,c.cell);if(f){const m=this._draggingMouseOffset.viewport;(f.left<m.left||f.right>m.right||f.top<m.top||f.bottom>m.bottom)&&this._grid.scrollCellIntoView(c.row,c.cell)}}if(!this._grid.canCellBeSelected(c.row,c.cell))return;if(e!=null&&e.range){e.range.end=c;const f=new Slick.Range(e.range.start.row,e.range.start.cell,c.row,c.cell);this._decorator.show(f),this.onCellRangeSelecting.notify({range:f})}}}handleDragEnd(t,e){this._dragging&&(this._dragging=!1,t.stopImmediatePropagation(),this.stopIntervalTimer(),this._decorator.hide(),this.onCellRangeSelected.notify({range:new Slick.Range(e.range.start.row,e.range.start.cell,e.range.end.row,e.range.end.cell)}))}handleDragInit(t){var e,n,r,o;this._activeCanvas=this._grid.getActiveCanvasNode(t),this._activeViewport=this._grid.getActiveViewportNode(t);const s=this._grid.getDisplayedScrollbarDimensions();if(this._viewportWidth=this._activeViewport.offsetWidth-s.width,this._viewportHeight=this._activeViewport.offsetHeight-s.height,this._moveDistanceForOneCell={x:this._grid.getAbsoluteColumnMinWidth()/2,y:this._gridOptions.rowHeight/2},this._rowOffset=0,this._columnOffset=0,this._isBottomCanvas=this._activeCanvas.classList.contains("grid-canvas-bottom"),this._gridOptions.frozenRow>-1&&this._isBottomCanvas){const l=`${this.gridUidSelector} .grid-canvas-${this._gridOptions.frozenBottom?"bottom":"top"}`;this._rowOffset=(n=(e=document.querySelector(l))===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0}this._isRightCanvas=this._activeCanvas.classList.contains("grid-canvas-right"),this._gridOptions.frozenColumn>-1&&this._isRightCanvas&&(this._columnOffset=(o=(r=document.querySelector(`${this.gridUidSelector} .grid-canvas-left`))===null||r===void 0?void 0:r.clientWidth)!==null&&o!==void 0?o:0),t.stopImmediatePropagation(),t.preventDefault()}handleDragStart(t,e){var n,r,o,s;const l=this._grid.getCellFromEvent(t);if(l&&this.onBeforeCellRangeSelected.notify(l).getReturnValue()!==!1&&this._grid.canCellBeSelected(l.row,l.cell)&&(this._dragging=!0,t.stopImmediatePropagation()),!this._dragging)return;this._grid.focus();let u=e.startX-((r=(n=qn(this._canvas))===null||n===void 0?void 0:n.left)!==null&&r!==void 0?r:0);this._gridOptions.frozenColumn>=0&&this._isRightCanvas&&(u+=this._scrollLeft);let p=e.startY-((s=(o=qn(this._canvas))===null||o===void 0?void 0:o.top)!==null&&s!==void 0?s:0);this._gridOptions.frozenRow>=0&&this._isBottomCanvas&&(p+=this._scrollTop);const c=this._grid.getCellFromPoint(u,p);return e.range={start:c,end:{}},this._currentlySelectedRange=e.range,this._decorator.show(new Slick.Range(c.row,c.cell))}handleScroll(t,e){this._scrollTop=e.scrollTop,this._scrollLeft=e.scrollLeft}}class B_{constructor(t){this._canvas=null,this._ranges=[],this._defaults={selectActiveCell:!0},this.onSelectedRangesChanged=new Slick.Event,this.pluginName="CellSelectionModel",this._eventHandler=new Slick.EventHandler,t===void 0||t.cellRangeSelector===void 0?this._selector=new em({selectionCss:{border:"2px solid black"}}):this._selector=t.cellRangeSelector,this._addonOptions=t}get addonOptions(){return this._addonOptions}get canvas(){return this._canvas}get cellRangeSelector(){return this._selector}get eventHandler(){return this._eventHandler}init(t){this._grid=t,this._addonOptions={...this._defaults,...this._addonOptions},this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)).subscribe(this._selector.onBeforeCellRangeSelected,this.handleBeforeCellRangeSelected.bind(this)).subscribe(this._selector.onCellRangeSelected,this.handleCellRangeSelected.bind(this)),t.registerPlugin(this._selector),this._canvas=this._grid.getCanvasNode()}destroy(){this.dispose()}dispose(){var t,e;this._canvas=null,this._selector&&(this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this))),this._eventHandler.unsubscribeAll(),(t=this._grid)===null||t===void 0||t.unregisterPlugin(this._selector),(e=this._selector)===null||e===void 0||e.dispose()}getSelectedRanges(){return this._ranges}rangesAreEqual(t,e){let n=t.length!==e.length;if(!n){for(let r=0;r<t.length;r++)if(t[r].fromCell!==e[r].fromCell||t[r].fromRow!==e[r].fromRow||t[r].toCell!==e[r].toCell||t[r].toRow!==e[r].toRow){n=!0;break}}return!n}refreshSelections(){this.setSelectedRanges(this.getSelectedRanges())}removeInvalidRanges(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];this._grid.canCellBeSelected(r.fromRow,r.fromCell)&&this._grid.canCellBeSelected(r.toRow,r.toCell)&&e.push(r)}return e}setSelectedRanges(t,e="SlickCellSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!t||t.length===0))return;const n=!this.rangesAreEqual(this._ranges,t);if(this._ranges=this.removeInvalidRanges(t),n){const r=new Slick.EventData;Object.defineProperty(r,"detail",{writable:!0,configurable:!0,value:{caller:e}}),this.onSelectedRangesChanged.notify(this._ranges,r)}}handleActiveCellChange(t,e){var n,r;!((n=this._addonOptions)===null||n===void 0)&&n.selectActiveCell&&e.row!==null&&e.cell!==null?this.setSelectedRanges([new Slick.Range(e.row,e.cell)]):!((r=this._addonOptions)===null||r===void 0)&&r.selectActiveCell||this.setSelectedRanges([])}handleBeforeCellRangeSelected(t){if(this._grid.getEditorLock().isActive())return t.stopPropagation(),!1}handleCellRangeSelected(t,e){this._grid.setActiveCell(e.range.fromRow,e.range.fromCell,!1,!1,!0),this.setSelectedRanges([e.range])}handleKeyDown(t){let e,n;const r=this._grid.getActiveCell(),o=t.ctrlKey||t.metaKey;if(r&&t.shiftKey&&!o&&!t.altKey&&(t.which===li.LEFT||t.key==="ArrowLeft"||t.which===li.RIGHT||t.key==="ArrowRight"||t.which===li.UP||t.key==="ArrowUp"||t.which===li.DOWN||t.key==="ArrowDown")&&(e=this.getSelectedRanges().slice(),e.length||e.push(new Slick.Range(r.row,r.cell)),n=e.pop(),typeof(n==null?void 0:n.contains)=="function")){n.contains(r.row,r.cell)||(n=new Slick.Range(r.row,r.cell));let s=n.toRow-n.fromRow,l=n.toCell-n.fromCell;const u=r.row===n.fromRow?1:-1,p=r.cell===n.fromCell?1:-1;t.which===li.LEFT||t.key==="ArrowLeft"?l-=p:t.which===li.RIGHT||t.key==="ArrowRight"?l+=p:t.which===li.UP||t.key==="ArrowUp"?s-=u:(t.which===li.DOWN||t.key==="ArrowDown")&&(s+=u);const c=new Slick.Range(r.row,r.cell,r.row+u*s,r.cell+p*l);if(this.removeInvalidRanges([c]).length){e.push(c);const f=u>0?c.toRow:c.fromRow,m=p>0?c.toCell:c.fromCell;this._grid.scrollRowIntoView(f),this._grid.scrollCellIntoView(f,m,!1)}else e.push(n);this.setSelectedRanges(e),t.preventDefault(),t.stopPropagation()}}}class _h{constructor(t){this._ranges=[],this._defaults={autoScrollWhenDrag:!0,cellRangeSelector:void 0,dragToSelect:!1,selectActiveRow:!0},this.pluginName="RowSelectionModel",this.onSelectedRangesChanged=new Slick.Event,this._eventHandler=new Slick.EventHandler,this._addonOptions={...this._defaults,...t}}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){return this._grid.getOptions()}init(t){this._grid=t,this._addonOptions={...this._defaults,...this._addonOptions},this._selector=this.addonOptions.cellRangeSelector,!this._selector&&this._addonOptions.dragToSelect&&(this._selector=new em({selectionCss:{border:"none"},autoScroll:this._addonOptions.autoScrollWhenDrag}),this.addonOptions.cellRangeSelector=this._selector),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onClick,this.handleClick.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)),this._selector&&(this._grid.registerPlugin(this._selector),this._selector.onCellRangeSelecting.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.subscribe(this.handleBeforeCellRangeSelected.bind(this)))}destroy(){this.dispose()}dispose(){this._eventHandler.unsubscribeAll(),this.disposeSelector()}disposeSelector(){var t,e;this._selector&&(this._selector.onCellRangeSelecting.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._grid.unregisterPlugin(this._selector),(t=this._selector)===null||t===void 0||t.destroy(),(e=this._selector)===null||e===void 0||e.dispose())}getCellRangeSelector(){return this._selector}getSelectedRanges(){return this._ranges}getSelectedRows(){return this.rangesToRows(this._ranges)}refreshSelections(){this.setSelectedRows(this.getSelectedRows())}setSelectedRows(t){this.setSelectedRanges(this.rowsToRanges(t),"SlickRowSelectionModel.setSelectedRows")}setSelectedRanges(t,e="SlickRowSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!t||t.length===0))return;this._ranges=t;const n=new Slick.EventData;Object.defineProperty(n,"detail",{writable:!0,configurable:!0,value:{caller:e}}),this.onSelectedRangesChanged.notify(this._ranges,n)}getRowsRange(t,e){let n;const r=[];for(n=t;n<=e;n++)r.push(n);for(n=e;n<t;n++)r.push(n);return r}handleBeforeCellRangeSelected(t,e){var n;let r=!1;if(this.gridOptions.enableRowMoveManager&&(r=(n=this.isHandlerColumn(e.cell))!==null&&n!==void 0?n:!1),this._grid.getEditorLock().isActive()||r)return t.stopPropagation(),!1;this._grid.setActiveCell(e.row,e.cell)}handleCellRangeSelected(t,e){if(!this.gridOptions.multiSelect||!this.addonOptions.selectActiveRow)return!1;this.setSelectedRanges([new Slick.Range(e.range.fromRow,0,e.range.toRow,this._grid.getColumns().length-1)])}handleActiveCellChange(t,e){this._addonOptions.selectActiveRow&&e.row!==null&&this.setSelectedRanges([new Slick.Range(e.row,0,e.row,this._grid.getColumns().length-1)])}handleClick(t){const e=this._grid.getCellFromEvent(t);if(!e||!this._grid.canCellBeActive(e.row,e.cell)||!this.gridOptions.multiSelect||!t.ctrlKey&&!t.shiftKey&&!t.metaKey)return!1;let n=this.rangesToRows(this._ranges);const r=n.indexOf(e.row);if(r===-1&&(t.ctrlKey||t.metaKey))n.push(e.row),this._grid.setActiveCell(e.row,e.cell);else if(r!==-1&&(t.ctrlKey||t.metaKey))n=n.filter(s=>s!==e.row),this._grid.setActiveCell(e.row,e.cell);else if(n.length&&t.shiftKey){const s=n.pop(),l=Math.min(e.row,s),u=Math.max(e.row,s);n=[];for(let p=l;p<=u;p++)p!==s&&n.push(p);n.push(s),this._grid.setActiveCell(e.row,e.cell)}const o=this.rowsToRanges(n);return this.setSelectedRanges(o),t.stopImmediatePropagation(),!0}handleKeyDown(t){const e=this._grid.getActiveCell();if(this.gridOptions.multiSelect&&e&&t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.which===li.UP||t.key==="ArrowUp"||t.which===li.DOWN||t.key==="ArrowDown")){let n=this.getSelectedRows();n.sort((l,u)=>l-u),n.length||(n=[e.row]);let r,o=n[0],s=n[n.length-1];if(t.which===li.DOWN||t.key==="ArrowDown"?r=e.row<s||o===s?++s:++o:r=e.row<s?--s:--o,r>=0&&r<this._grid.getDataLength()){this._grid.scrollRowIntoView(r);const l=this.rowsToRanges(this.getRowsRange(o,s));this.setSelectedRanges(l)}t.preventDefault(),t.stopPropagation()}}isHandlerColumn(t){const n=this._grid.getColumns()[t].behavior||"";return/move|selectAndMove/.test(n)}rangesToRows(t){const e=[];for(let n=0;n<t.length;n++)for(let r=t[n].fromRow;r<=t[n].toRow;r++)e.push(r);return e}rowsToRanges(t){const e=[],n=this._grid.getColumns().length-1;for(const r of t)e.push(new Slick.Range(r,0,r,n));return e}}class tm{constructor(t,e){this.pubSubService=t,this.pluginName="CheckboxSelectColumn",this._defaults={columnId:"_checkbox_selector",cssClass:null,field:"_checkbox_selector",hideSelectAllCheckbox:!1,toolTip:"Select/Deselect All",width:30,applySelectOnAllPages:!0,hideInColumnTitleRow:!1,hideInFilterHeaderRow:!0},this._addonOptions=this._defaults,this._checkboxColumnCellIndex=null,this._isSelectAllChecked=!1,this._isUsingDataView=!1,this._selectedRowsLookup={},this._selectAll_UID=this.createUID(),this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this._addonOptions={...this._defaults,...e}}get addonOptions(){return this._addonOptions}get headerRowNode(){return this._headerRowNode}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get selectAllUid(){return this._selectAll_UID}set selectedRowsLookup(t){this._selectedRowsLookup=t}init(t){this._grid=t,this._isUsingDataView=!Array.isArray(t.getData()),this._isUsingDataView&&(this._dataView=t.getData()),this.gridOptions.backendServiceApi&&(this._addonOptions.applySelectOnAllPages=!1),this._eventHandler.subscribe(t.onSelectedRowsChanged,this.handleSelectedRowsChanged.bind(this)).subscribe(t.onClick,this.handleClick.bind(this)).subscribe(t.onKeyDown,this.handleKeyDown.bind(this)),this._isUsingDataView&&this._dataView&&this._addonOptions.applySelectOnAllPages&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,this.handleDataViewSelectedIdsChanged.bind(this)).subscribe(this._dataView.onPagingInfoChanged,this.handleDataViewSelectedIdsChanged.bind(this)),this._addonOptions.hideInFilterHeaderRow||this.addCheckboxToFilterHeaderRow(t),this._addonOptions.hideInColumnTitleRow||this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this)),(!this._rowSelectionModel||!this._grid.getSelectionModel())&&(this._rowSelectionModel=new _h(this.gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionModel)),this.gridOptions.preselectedRows&&this._rowSelectionModel&&this._grid.getSelectionModel()&&setTimeout(()=>this.selectRows(this.gridOptions.preselectedRows||[])),typeof this._addonOptions.selectableOverride=="function"&&this.selectableOverride(this._addonOptions.selectableOverride)}dispose(){this._bindEventService.unbindAll(),this._eventHandler.unsubscribeAll()}create(t,e){var n,r;if(this._addonOptions={...this._defaults,...e.checkboxSelector},Array.isArray(t)&&e){const o=this.getColumnDefinition();if(!t.some(s=>s.id===o.id)){const s=(r=(n=e==null?void 0:e.checkboxSelector)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:0;s>0?t.splice(s,0,o):t.unshift(o),this.pubSubService.publish("onPluginColumnsChanged",{columns:t,pluginName:this.pluginName})}}return this}getOptions(){return this._addonOptions}setOptions(t){var e;if(this._addonOptions={...this._addonOptions,...t},this._addonOptions.hideSelectAllCheckbox)this.hideSelectAllFromColumnHeaderTitleRow(),this.hideSelectAllFromColumnHeaderFilterRow();else if(this._addonOptions.hideInColumnTitleRow?this.hideSelectAllFromColumnHeaderTitleRow():(this.renderSelectAllCheckbox(this._isSelectAllChecked),this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this))),this._addonOptions.hideInFilterHeaderRow)this.hideSelectAllFromColumnHeaderFilterRow();else{const n=(e=this.headerRowNode)===null||e===void 0?void 0:e.querySelector("#filter-checkbox-selectall-container");if(n){n.style.display="flex",n.ariaChecked=String(this._isSelectAllChecked);const r=n.querySelector('input[type="checkbox"]');r&&(r.ariaChecked=String(this._isSelectAllChecked),r.checked=this._isSelectAllChecked)}}}deSelectRows(t){const e=[];for(const n of t)this._selectedRowsLookup[n]&&(e[e.length]=n);this._grid.setSelectedRows(this._grid.getSelectedRows().filter(n=>e.indexOf(n)<0),"SlickCheckboxSelectColumn.deSelectRows")}selectRows(t){var e;const n=[];for(const o of t)this._selectedRowsLookup[o]&&(n[n.length]=o);const r=(e=this._grid.getSelectedRows())===null||e===void 0?void 0:e.concat(n);this._grid.setSelectedRows(r)}getColumnDefinition(){var t,e;const n=String((e=(t=this._addonOptions)===null||t===void 0?void 0:t.columnId)!==null&&e!==void 0?e:this._defaults.columnId);return{id:n,name:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":`<input id="header-selector${this._selectAll_UID}" type="checkbox"><label for="header-selector${this._selectAll_UID}"></label>`,toolTip:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":this._addonOptions.toolTip,field:n,cssClass:this._addonOptions.cssClass,excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,hideSelectAllCheckbox:this._addonOptions.hideSelectAllCheckbox,resizable:!1,sortable:!1,width:this._addonOptions.width||30,formatter:this.checkboxSelectionFormatter.bind(this)}}hideSelectAllFromColumnHeaderTitleRow(){this._grid.updateColumnHeader(this._addonOptions.columnId||"","","")}hideSelectAllFromColumnHeaderFilterRow(){var t;const e=(t=this.headerRowNode)===null||t===void 0?void 0:t.querySelector("#filter-checkbox-selectall-container");e&&(e.style.display="none")}toggleRowSelection(t){this.toggleRowSelectionWithEvent(null,t)}toggleRowSelectionWithEvent(t,e){const n=this._grid.getDataItem(e);if(!this.checkSelectableOverride(e,n,this._grid))return;const r=this._grid.getSelectedRows();this._addonOptions.onRowToggleStart&&this._addonOptions.onRowToggleStart(t,{row:e,previousSelectedRows:r});const o=this._selectedRowsLookup[e]?this._grid.getSelectedRows().filter(s=>s!==e):this._grid.getSelectedRows().concat(e);this._grid.setSelectedRows(o,"click.toggle"),this._grid.setActiveCell(e,this.getCheckboxColumnCellIndex()),this._addonOptions.onRowToggleEnd&&this._addonOptions.onRowToggleEnd(t,{row:e,previousSelectedRows:r})}selectableOverride(t){this._selectableOverride=t}addCheckboxToFilterHeaderRow(t){this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{if(n.column.field===(this._addonOptions.field||"_checkbox_selector")){en(n.node);const r=De("span",{id:"filter-checkbox-selectall-container",ariaChecked:"false"});r.appendChild(De("input",{type:"checkbox",id:`header-filter-selector${this._selectAll_UID}`})),r.appendChild(De("label",{htmlFor:`header-filter-selector${this._selectAll_UID}`})),n.node.appendChild(r),this._headerRowNode=n.node,this._bindEventService.bind(r,"click",o=>this.handleHeaderClick(o,n))}})}checkboxSelectionFormatter(t,e,n,r,o,s){if(o&&this.checkSelectableOverride(t,o,s)){const l=this.createUID()+t;return`<input id="selector${l}" type="checkbox" ${this._selectedRowsLookup[t]?'checked="checked" aria-checked="true"':'aria-checked="false"'}><label for="selector${l}"></label>`}return null}checkSelectableOverride(t,e,n){return typeof this._selectableOverride=="function"?this._selectableOverride(t,e,n):!0}createUID(){return Math.round(1e7*Math.random())}getCheckboxColumnCellIndex(){if(this._checkboxColumnCellIndex===null){this._checkboxColumnCellIndex=0;const t=this._grid.getColumns();for(let e=0;e<t.length;e++)t[e].id===this._addonOptions.columnId&&(this._checkboxColumnCellIndex=e)}return this._checkboxColumnCellIndex}handleDataViewSelectedIdsChanged(){var t;const e=this._dataView.getAllSelectedFilteredIds(),n=this._dataView.getFilteredItems();let r=0;if(typeof this._selectableOverride=="function"&&e.length>0)for(let o=0;o<this._dataView.getItemCount();o++){const s=this._dataView.getItemByIdx(o),l=this._dataView.getIdPropertyName(),u=s[l];n.findIndex(c=>c[l]===u)>=0&&!this.checkSelectableOverride(o,s,this._grid)&&r++}if(this._isSelectAllChecked=e.length+r>=n.length,!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow){const o=(t=this.headerRowNode)===null||t===void 0?void 0:t.querySelector(`#header-filter-selector${this._selectAll_UID}`);o&&(o.ariaChecked=String(this._isSelectAllChecked),o.checked=this._isSelectAllChecked)}}handleClick(t,e){if(this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&t.target.type==="checkbox"){if(t.target.ariaChecked=String(t.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){t.preventDefault(),t.stopImmediatePropagation();return}this.toggleRowSelectionWithEvent(t,e.row),t.stopPropagation(),t.stopImmediatePropagation()}}handleHeaderClick(t,e){if(e.column.id===this._addonOptions.columnId&&t.target.type==="checkbox"){if(t.target.ariaChecked=String(t.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){t.preventDefault(),t.stopImmediatePropagation();return}let n=t.target.checked;const r=n?"click.selectAll":"click.unselectAll",o=this._grid.getSelectedRows();this._addonOptions.onSelectAllToggleStart&&this._addonOptions.onSelectAllToggleStart(t,{previousSelectedRows:o,caller:r});let s=[];if(n){const l=[];for(let u=0;u<this._grid.getDataLength();u++){const p=this._grid.getDataItem(u);!p.__group&&!p.__groupTotals&&this.checkSelectableOverride(u,p,this._grid)&&l.push(u)}s=l,n=!0}if(this._isUsingDataView&&this._dataView&&this._addonOptions.applySelectOnAllPages){const l=[],u=this._dataView.getFilteredItems();for(let p=0;p<u.length;p++){const c=u[p];this.checkSelectableOverride(p,c,this._grid)&&l.push(c[this._dataView.getIdPropertyName()])}this._dataView.setSelectedIds(l,{isRowBeingAdded:n})}this._grid.setSelectedRows(s,r),this._addonOptions.onSelectAllToggleEnd&&this._addonOptions.onSelectAllToggleEnd(t,{rows:s,previousSelectedRows:o,caller:r}),t.stopPropagation(),t.stopImmediatePropagation()}}handleKeyDown(t,e){(t.which===li.SPACE||t.key===" ")&&this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&((!this._grid.getEditorLock().isActive()||this._grid.getEditorLock().commitCurrentEdit())&&this.toggleRowSelectionWithEvent(t,e.row),t.preventDefault(),t.stopImmediatePropagation())}handleSelectedRowsChanged(){var t,e;const n=this._grid.getSelectedRows(),r={};let o=0,s=0,l=0,u=0;if(typeof this._selectableOverride=="function")for(l=0;l<this._grid.getDataLength();l++){const c=this._grid.getDataItem(l);this.checkSelectableOverride(s,c,this._grid)||u++}const p=[];for(s=0;s<n.length;s++){o=n[s];const c=this._grid.getDataItem(o);this.checkSelectableOverride(s,c,this._grid)?(r[o]=!0,r[o]!==this._selectedRowsLookup[o]&&(this._grid.invalidateRow(o),delete this._selectedRowsLookup[o])):p.push(o)}for(const c in this._selectedRowsLookup)c!==void 0&&this._grid.invalidateRow(+c);if(this._selectedRowsLookup=r,this._grid.render(),this._isSelectAllChecked=((t=n==null?void 0:n.length)!==null&&t!==void 0?t:0)+u>=this._grid.getDataLength(),(!this._isUsingDataView||!this._addonOptions.applySelectOnAllPages)&&(!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow)){const c=(e=this.headerRowNode)===null||e===void 0?void 0:e.querySelector(`#header-filter-selector${this._selectAll_UID}`);c&&(c.ariaChecked=String(this._isSelectAllChecked),c.checked=this._isSelectAllChecked)}if(p.length>0){for(const c of p){const f=n.indexOf(c);n.splice(f,1)}this._grid.setSelectedRows(n,"click.toggle")}}renderSelectAllCheckbox(t){const e=t?' checked="checked" aria-checked="true"':' aria-checked="false"';this._grid.updateColumnHeader(this._addonOptions.columnId||"",`<input id="header-selector${this._selectAll_UID}" type="checkbox"${e}><label for="header-selector${this._selectAll_UID}"></label>`,this._addonOptions.toolTip)}}class im extends eu{constructor(t,e,n,r,o){var s,l,u,p;super(t,n,r),this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this._areVisibleColumnDifferent=!1,this._columns=[],this._columnCheckboxes=[],this._gridMenuOptions=null,this._headerElm=null,this._isMenuOpen=!1,this.onAfterMenuShow=new Slick.Event,this.onBeforeMenuShow=new Slick.Event,this.onMenuClose=new Slick.Event,this.onCommand=new Slick.Event,this.onColumnsChanged=new Slick.Event,this._defaults={dropSide:"left",showButton:!0,hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",marginBottom:15,menuWidth:18,minHeight:250,contentMinWidth:0,resizeOnShowHeaderRow:!1,syncResizeTitle:"Synchronous resize",headerColumnValueExtractor:c=>c.name},this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-grid-menu",this._camelPluginName="gridMenu",this._columns=(s=this.sharedService.allColumns)!==null&&s!==void 0?s:[],this._gridUid=(p=(u=(l=this.grid)===null||l===void 0?void 0:l.getUID)===null||u===void 0?void 0:u.call(l))!==null&&p!==void 0?p:"",this.initEventHandlers(),this.init()}get addonOptions(){return this._gridMenuOptions||{}}get columns(){return this._columns}set columns(t){this._columns=t}get gridOptions(){return this.grid.getOptions()||{}}initEventHandlers(){this._eventHandler.subscribe(this.grid.onColumnsReordered,tu.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeDestroy,this.dispose.bind(this)),this._eventHandler.subscribe(this.grid.onSetOptions,(t,e)=>{if(e&&e.optionsBefore&&e.optionsAfter){const n=e.optionsBefore.frozenColumn>=0&&e.optionsAfter.frozenColumn===-1,r=e.optionsBefore.frozenColumn===-1&&e.optionsAfter.frozenColumn>=0;(n||r)&&this.recreateGridMenu()}})}init(){var t;this._gridUid=(t=this.grid.getUID())!==null&&t!==void 0?t:"",this._userOriginalGridMenu={...this.sharedService.gridOptions.gridMenu},this._gridMenuOptions={...this._defaults,...this.getDefaultGridMenuOptions(),...this.sharedService.gridOptions.gridMenu},this.sharedService.gridOptions.gridMenu=this._gridMenuOptions;const e=this._userOriginalGridMenu.commandItems,n=this._userOriginalGridMenu&&Array.isArray(e)?e:[];this._gridMenuOptions.commandItems=[...n,...this.addGridMenuCustomCommands(n)],this.extensionUtility.translateMenuItemsFromTitleKey(this._gridMenuOptions.commandItems||[]),this.extensionUtility.sortItems(this._gridMenuOptions.commandItems,"positionOrder"),this._gridMenuOptions.commandItems=this._gridMenuOptions.commandItems,this.createGridMenu()}dispose(){this.deleteMenu(),super.dispose()}deleteMenu(){var t,e,n;this._bindEventService.unbindAll();const r=document.querySelector(`div.slick-grid-menu.${this._gridUid}`);r&&(r.style.display="none"),this._headerElm&&(this._headerElm.style.width="100%"),(t=this._gridMenuButtonElm)===null||t===void 0||t.remove(),(e=this._menuElm)===null||e===void 0||e.remove(),(n=this._commandMenuElm)===null||n===void 0||n.remove()}createColumnPickerContainer(){this._menuElm&&(rm.call(this,this._menuElm),this._listElm=De("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",om.bind(this)))}createGridMenu(){var t,e,n,r,o,s;this._gridUid=(e=(t=this._gridUid)!==null&&t!==void 0?t:this.grid.getUID())!==null&&e!==void 0?e:"";const l=this._gridUid?`.${this._gridUid}`:"",u=((n=this._gridMenuOptions)===null||n===void 0?void 0:n.menuWidth)||this._defaults.menuWidth,p=this.gridOptions.hasOwnProperty("frozenColumn")&&this.gridOptions.frozenColumn>=0?"right":"left";if(this._headerElm=document.querySelector(`${l} .slick-header-${p}`),this._headerElm&&this._gridMenuOptions){if(this._headerElm.style.width=`calc(100% - ${u}px)`,((r=this._gridMenuOptions.resizeOnShowHeaderRow)!==null&&r!==void 0?r:this._defaults.resizeOnShowHeaderRow)&&this.gridOptions.showHeaderRow){const m=document.querySelector(`${l} .slick-headerrow`);m&&(m.style.width=`calc(100% - ${u}px)`)}((o=this._gridMenuOptions.showButton)!==null&&o!==void 0?o:this._defaults.showButton)&&(this._gridMenuButtonElm=De("button",{className:"slick-grid-menu-button",ariaLabel:"Grid Menu"}),!((s=this._gridMenuOptions)===null||s===void 0)&&s.iconCssClass&&this._gridMenuButtonElm.classList.add(...this._gridMenuOptions.iconCssClass.split(" ")),this._headerElm.parentElement.insertBefore(this._gridMenuButtonElm,this._headerElm.parentElement.firstChild),this._bindEventService.bind(this._gridMenuButtonElm,"click",this.showGridMenu.bind(this))),this.sharedService.gridOptions.gridMenu={...this._defaults,...this._gridMenuOptions},this.translateTitleLabels(this._gridMenuOptions),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this._menuElm=De("div",{role:"menu",className:`slick-grid-menu ${this._gridUid}`,style:{display:"none"}}),this._commandMenuElm=De("div",{className:"slick-menu-command-list",role:"menu"},this._menuElm),this.recreateCommandList(this._gridMenuOptions,{grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()}),this.createColumnPickerContainer(),document.body.appendChild(this._menuElm),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this))}}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}hideMenu(t){var e,n,r,o;if(((n=(e=this._menuElm)===null||e===void 0?void 0:e.style)===null||n===void 0?void 0:n.display)==="block"){const s={grid:this.grid,menu:this._menuElm,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};if(this.pubSubService.publish("onGridMenuMenuClose",s),typeof((r=this._gridMenuOptions)===null||r===void 0?void 0:r.onMenuClose)=="function"&&this._gridMenuOptions.onMenuClose(t,s)===!1||this.onMenuClose.notify(s,null,this).getReturnValue()===!1)return;if(this._menuElm.style.display="none",this._menuElm.setAttribute("aria-expanded","false"),this._isMenuOpen=!1,typeof((o=this.grid)===null||o===void 0?void 0:o.autosizeColumns)=="function"){const l=this.grid.getUID()||"";this._areVisibleColumnDifferent&&l&&document.querySelector(`.${l}`)!==null&&(this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this._areVisibleColumnDifferent=!1)}}}recreateGridMenu(){this.deleteMenu(),this.init()}repositionMenu(t,e,n=!0){var r,o,s,l,u,p,c,f,m,v;const _=(o=(r=t==null?void 0:t.touches)===null||r===void 0?void 0:r[0])!==null&&o!==void 0?o:t;if(this._menuElm){let C=t.target.nodeName==="BUTTON"?t.target:t.target.querySelector("button");C||(C=t.target.parentElement),this._menuElm.style.display="block",this._menuElm.style.opacity="0";const x=qn(C),w=getComputedStyle(C),E=parseInt((s=w==null?void 0:w.width)!==null&&s!==void 0?s:(l=this._defaults)===null||l===void 0?void 0:l.menuWidth,10),I=(p=(u=this._menuElm)===null||u===void 0?void 0:u.offsetWidth)!==null&&p!==void 0?p:0,k=(f=(c=e==null?void 0:e.contentMinWidth)!==null&&c!==void 0?c:this._defaults.contentMinWidth)!==null&&f!==void 0?f:0,F=(k>I?k:I)||0,N=(m=x==null?void 0:x.top)!==null&&m!==void 0?m:0,V=(v=x==null?void 0:x.right)!==null&&v!==void 0?v:0,Q=((e==null?void 0:e.marginBottom)!==void 0?e.marginBottom:this._defaults.marginBottom)||0,L=(e==null?void 0:e.dropSide)==="right"?V-E:V-F;this._menuElm.style.top=`${N+C.offsetHeight}px`,this._menuElm.style.left=`${L}px`,e.dropSide==="left"?(this._menuElm.classList.remove("dropright"),this._menuElm.classList.add("dropleft")):(this._menuElm.classList.remove("dropleft"),this._menuElm.classList.add("dropright")),this._menuElm.appendChild(this._listElm),k>0&&(this._menuElm.style.minWidth=`${k}px`),this._menuElm.style.minHeight=Xs(e.minHeight,""),(e==null?void 0:e.height)!==void 0?this._menuElm.style.height=Xs(e.height,""):this._menuElm.style.maxHeight=Xs(e.maxHeight,`${window.innerHeight-_.clientY-Q}px`),this._menuElm.style.display="block",n&&(this._menuElm.style.opacity="1"),this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.appendChild(this._listElm),this._isMenuOpen=!0}}showGridMenu(t,e){if(t.preventDefault(),en(this._listElm),en(this._commandMenuElm),this._gridMenuOptions){const n={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()},r={...this._gridMenuOptions,...e};if(this.recreateCommandList(r,n),tu.call(this),this._columnCheckboxes=[],r&&!this.extensionUtility.runOverrideFunctionWhenExists(r.menuUsabilityOverride,n)||typeof t.stopPropagation=="function"&&(this.pubSubService.publish("onGridMenuBeforeMenuShow",n),typeof(r==null?void 0:r.onBeforeMenuShow)=="function"&&r.onBeforeMenuShow(t,n)===!1||this.onBeforeMenuShow.notify(n,null,this).getReturnValue()===!1))return;sm.call(this,r),this.repositionMenu(t,r,!1),this.repositionMenu(t,r,!0),this.pubSubService.publish("onGridMenuAfterMenuShow",n),typeof(r==null?void 0:r.onAfterMenuShow)=="function"&&r.onAfterMenuShow(t,n),this.onAfterMenuShow.notify(n,null,this)}}updateAllTitles(t){var e,n,r,o;!((e=this._commandTitleElm)===null||e===void 0)&&e.textContent&&t.commandTitle&&(this._commandTitleElm.textContent=!((r=(n=this._gridMenuOptions)===null||n===void 0?void 0:n.commandItems)===null||r===void 0)&&r.length?t.commandTitle:"",this._gridMenuOptions.commandTitle=this._commandTitleElm.textContent),!((o=this._columnTitleElm)===null||o===void 0)&&o.textContent&&t.columnTitle&&(this._columnTitleElm.textContent=t.columnTitle,this._gridMenuOptions.columnTitle=t.columnTitle)}translateGridMenu(){var t;if(this.sharedService.gridOptions.gridMenu){this.sharedService.gridOptions.gridMenu.commandItems=[],this.sharedService.gridOptions.gridMenu.commandTitle="",this.sharedService.gridOptions.gridMenu.columnTitle="",this.sharedService.gridOptions.gridMenu.forceFitTitle="",this.sharedService.gridOptions.gridMenu.syncResizeTitle="";const e=this._userOriginalGridMenu&&Array.isArray(this._userOriginalGridMenu.commandItems)?this._userOriginalGridMenu.commandItems:[];this.sharedService.gridOptions.gridMenu.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(((t=this._gridMenuOptions)===null||t===void 0?void 0:t.commandItems)||[]),this.extensionUtility.sortItems(this.sharedService.gridOptions.gridMenu.commandItems,"positionOrder"),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this.translateTitleLabels(this._gridMenuOptions),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.updateAllTitles(this.sharedService.gridOptions.gridMenu)}}translateTitleLabels(t){t&&(t.commandTitle=this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"),t.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),t.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),t.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"))}addGridMenuCustomCommands(t){var e,n,r,o,s,l,u,p,c,f,m,v,_;const C=this.gridOptions.backendServiceApi||null,x=[],w=this.gridOptions,E=ao(w),I=(e=this._gridMenuOptions)===null||e===void 0?void 0:e.commandLabels;if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearFrozenColumnsCommand){const F="clear-pinning";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearFrozenColumnsCommand||"fa fa-times",titleKey:`${E}${(n=I==null?void 0:I.clearFrozenColumnsCommandKey)!==null&&n!==void 0?n:"CLEAR_PINNING"}`,disabled:!1,command:F,positionOrder:52})}if(this.gridOptions&&this.gridOptions.enableFiltering&&!this.sharedService.hideHeaderRowAfterPageLoad){if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearAllFiltersCommand){const F="clear-filter";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearAllFiltersCommand||"fa fa-filter text-danger",titleKey:`${E}${(r=I==null?void 0:I.clearAllFiltersCommandKey)!==null&&r!==void 0?r:"CLEAR_ALL_FILTERS"}`,disabled:!1,command:F,positionOrder:50})}if(this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideToggleFilterCommand){const F="toggle-filter";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconToggleFilterCommand||"fa fa-random",titleKey:`${E}${(o=I==null?void 0:I.toggleFilterCommandKey)!==null&&o!==void 0?o:"TOGGLE_FILTER_ROW"}`,disabled:!1,command:F,positionOrder:53})}if(C&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideRefreshDatasetCommand){const F="refresh-dataset";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconRefreshDatasetCommand||"fa fa-refresh",titleKey:`${E}${(s=I==null?void 0:I.refreshDatasetCommandKey)!==null&&s!==void 0?s:"REFRESH_DATASET"}`,disabled:!1,command:F,positionOrder:57})}}if(this.gridOptions.showPreHeaderPanel&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideTogglePreHeaderCommand){const F="toggle-preheader";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconTogglePreHeaderCommand||"fa fa-random",titleKey:`${E}${(l=I==null?void 0:I.togglePreHeaderCommandKey)!==null&&l!==void 0?l:"TOGGLE_PRE_HEADER_ROW"}`,disabled:!1,command:F,positionOrder:53})}if(this.gridOptions.enableSorting&&this.gridOptions&&this._gridMenuOptions&&!this._gridMenuOptions.hideClearAllSortingCommand){const F="clear-sorting";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconClearAllSortingCommand||"fa fa-unsorted text-danger",titleKey:`${E}${(u=I==null?void 0:I.clearAllSortingCommandKey)!==null&&u!==void 0?u:"CLEAR_ALL_SORTING"}`,disabled:!1,command:F,positionOrder:51})}if(!((p=this.gridOptions)===null||p===void 0)&&p.enableTextExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportCsvCommand){const F="export-csv";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportCsvCommand||"fa fa-download",titleKey:`${E}${(c=I==null?void 0:I.exportCsvCommandKey)!==null&&c!==void 0?c:"EXPORT_TO_CSV"}`,disabled:!1,command:F,positionOrder:54})}if(this.gridOptions&&this.gridOptions.enableExcelExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportExcelCommand){const F="export-excel";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportExcelCommand||"fa fa-file-excel-o text-success",titleKey:`${E}${(f=I==null?void 0:I.exportExcelCommandKey)!==null&&f!==void 0?f:"EXPORT_TO_EXCEL"}`,disabled:!1,command:F,positionOrder:55})}if(!((m=this.gridOptions)===null||m===void 0)&&m.enableTextExport&&this._gridMenuOptions&&!this._gridMenuOptions.hideExportTextDelimitedCommand){const F="export-text-delimited";t.some(N=>N!=="divider"&&N.hasOwnProperty("command")&&N.command===F)||x.push({iconCssClass:this._gridMenuOptions.iconExportTextDelimitedCommand||"fa fa-download",titleKey:`${E}${(v=I==null?void 0:I.exportTextDelimitedCommandKey)!==null&&v!==void 0?v:"EXPORT_TO_TAB_DELIMITED"}`,disabled:!1,command:F,positionOrder:56})}const k=((_=this._gridMenuOptions)===null||_===void 0?void 0:_.commandItems)||[];return this.gridOptions&&this._gridMenuOptions&&(Array.isArray(x)&&x.length>0||Array.isArray(k)&&k.length>0)&&(this._gridMenuOptions.commandTitle=this._gridMenuOptions.commandTitle||this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu")),x}executeGridMenuInternalCustomCommands(t,e){var n,r,o,s,l;const u=((n=this.sharedService)===null||n===void 0?void 0:n.externalRegisteredResources)||[];if(e!=null&&e.command)switch(e.command){case"clear-pinning":const p=[...this.sharedService.visibleColumns],c={frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1};this.grid.setOptions(c),this.sharedService.gridOptions.frozenColumn=c.frozenColumn,this.sharedService.gridOptions.frozenRow=c.frozenRow,this.sharedService.gridOptions.frozenBottom=c.frozenBottom,this.sharedService.gridOptions.enableMouseWheelScrollHandler=c.enableMouseWheelScrollHandler,Array.isArray(p)&&this.grid.setColumns(p),this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this.pubSubService.publish("onGridMenuClearAllPinning");break;case"clear-filter":this.filterService.clearFilters(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllFilters");break;case"clear-sorting":this.sortService.clearSorting(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllSorting");break;case"export-csv":const m=u.find(w=>w.className==="TextExportService");m!=null&&m.exportToFile?m.exportToFile({delimiter:vs.comma,format:dn.csv}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };");break;case"export-excel":const v=u.find(w=>w.className==="ExcelExportService");v!=null&&v.exportToExcel?v.exportToExcel():console.error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Grid Menu. Example:: this.gridOptions = { enableExcelExport: true, registerExternalResources: [new ExcelExportService()] };");break;case"export-text-delimited":const _=u.find(w=>w.className==="TextExportService");_!=null&&_.exportToFile?_.exportToFile({delimiter:vs.tab,format:dn.txt}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };");break;case"toggle-filter":let C=(o=(r=this.gridOptions)===null||r===void 0?void 0:r.showHeaderRow)!==null&&o!==void 0?o:!1;C=!C,this.grid.setHeaderRowVisibility(C),C===!0&&(this.grid.setColumns(this.sharedService.columnDefinitions),this.grid.scrollColumnIntoView(0));break;case"toggle-preheader":const x=(l=(s=this.gridOptions)===null||s===void 0?void 0:s.showPreHeaderPanel)!==null&&l!==void 0?l:!1;this.grid.setPreHeaderPanelVisibility(!x);break;case"refresh-dataset":this.extensionUtility.refreshBackendDataset();break}}getDefaultGridMenuOptions(){return{commandTitle:void 0,columnTitle:this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),forceFitTitle:this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),syncResizeTitle:this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"),iconCssClass:"fa fa-bars",menuWidth:18,commandItems:[],hideClearAllFiltersCommand:!1,hideRefreshDatasetCommand:!1,hideToggleFilterCommand:!1}}handleBodyMouseDown(t){var e;(this._menuElm!==t.target&&!(!((e=this._menuElm)===null||e===void 0)&&e.contains(t.target))&&this._isMenuOpen||t.target.className==="close")&&this.hideMenu(t)}handleMenuItemCommandClick(t,e,n){var r,o;if(n==="divider"||n.command&&(n.disabled||n.divider))return!1;const s={grid:this.grid,command:n.command,item:n,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};this.executeGridMenuInternalCustomCommands(t,s),this.pubSubService.publish("onGridMenuCommand",s),typeof((r=this._gridMenuOptions)===null||r===void 0?void 0:r.onCommand)=="function"&&this._gridMenuOptions.onCommand(t,s),this.onCommand.notify(s,null,this),typeof n.action=="function"&&n.action.call(this,t,s),!(!((o=this._gridMenuOptions)===null||o===void 0)&&o.leaveOpen)&&!t.defaultPrevented&&this.hideMenu(t),t.preventDefault(),t.stopPropagation()}recreateCommandList(t,e){var n;this.populateCommandOrOptionTitle("command",t,this._commandMenuElm);const r=(n=this._commandMenuElm.querySelector(".slick-command-header"))!==null&&n!==void 0?n:De("div",{className:"slick-command-header"});r.classList.add("with-close"),nm.call(this,r),this._commandMenuElm.appendChild(r),this.populateCommandOrOptionItems("command",t,this._commandMenuElm,(t==null?void 0:t.commandItems)||[],e,this.handleMenuItemCommandClick)}}function nm(a){const e=De("button",{type:"button",className:"close",ariaLabel:"Close",innerHTML:"&times;",dataset:{dismiss:this instanceof bh?"slick-column-picker":"slick-grid-menu"}});a.appendChild(e)}function rm(a){var t,e,n;const r=this;!((t=r.addonOptions)===null||t===void 0)&&t.columnTitle&&(r._columnTitleElm=De("div",{className:"slick-menu-title",textContent:(n=(e=r.addonOptions)===null||e===void 0?void 0:e.columnTitle)!==null&&n!==void 0?n:r._defaults.columnTitle},a))}function om(a){var t,e;const n=this,r=n instanceof bh?"columnPicker":"gridMenu";if(a.target.dataset.option==="autoresize"){const o=n.getVisibleColumns();a.target.ariaChecked=String(a.target.checked);const s=a.target.checked;n.grid.setOptions({forceFitColumns:s}),n.grid.setColumns(o);return}if(a.target.dataset.option==="syncresize"){a.target.ariaChecked=String(a.target.checked),n.grid.setOptions({syncColumnCellResize:!!a.target.checked});return}if(a.target.type==="checkbox"){n._areVisibleColumnDifferent=!0,a.target.ariaChecked=String(a.target.checked);const o=a.target.checked,s=a.target.dataset.columnid||"",l=[];if(n._columnCheckboxes.forEach((c,f)=>{c.checked&&l.push(n.columns[f])}),!l.length){a.target.checked=!0;return}if(n.grid.setColumns(l),(!n.sharedService.visibleColumns||Array.isArray(l)&&l.length!==n.sharedService.visibleColumns.length)&&(n.sharedService.visibleColumns=l),n.gridOptions.enableRowSelection&&o){const c=n.grid.getSelectedRows();n.grid.setSelectedRows(c)}const u=(t=n.gridOptions.frozenColumn)!==null&&t!==void 0?t:-1;u>=0&&n.extensionUtility.readjustFrozenColumnIndexWhenNeeded(u,n.columns,l);const p={columnId:s,showing:o,allColumns:n.columns,visibleColumns:l,columns:l,grid:n.grid};n.pubSubService.publish(`on${El(r)}ColumnsChanged`,p),typeof((e=n.addonOptions)===null||e===void 0?void 0:e.onColumnsChanged)=="function"&&n.addonOptions.onColumnsChanged(a,p),n.onColumnsChanged.notify(p,null,n)}}function sm(a){var t,e;const n=this,r=n instanceof im?"gridmenu-":"";for(const o of n.columns){const s=o.id,l=document.createElement("li");o.excludeFromColumnPicker&&(l.className="hidden");const u=De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-${s}`,dataset:{columnid:`${s}`}});n.grid.getColumnIndex(s)>=0&&(u.ariaChecked="true",u.checked=!0),l.appendChild(u),n._columnCheckboxes.push(u);const f=(typeof(a==null?void 0:a.headerColumnValueExtractor)=="function"?a.headerColumnValueExtractor:n._defaults.headerColumnValueExtractor)(o,n.gridOptions);l.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-${s}`,innerHTML:Pn(n.gridOptions,f)})),n._listElm.appendChild(l)}if((!a.hideForceFitButton||!a.hideSyncResizeButton)&&n._listElm.appendChild(document.createElement("hr")),!(a!=null&&a.hideForceFitButton)){const o=document.createElement("li");o.appendChild(De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-forcefit`,ariaChecked:String(n.gridOptions.forceFitColumns),checked:n.gridOptions.forceFitColumns,dataset:{option:"autoresize"}})),o.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-forcefit`,textContent:(t=a==null?void 0:a.forceFitTitle)!==null&&t!==void 0?t:""})),n._listElm.appendChild(o)}if(!(a!=null&&a.hideSyncResizeButton)){const o=document.createElement("li");o.appendChild(De("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-syncresize`,ariaChecked:String(n.gridOptions.syncColumnCellResize),checked:n.gridOptions.syncColumnCellResize,dataset:{option:"syncresize"}})),o.appendChild(De("label",{htmlFor:`${n._gridUid}-${r}colpicker-syncresize`,textContent:(e=a==null?void 0:a.syncResizeTitle)!==null&&e!==void 0?e:""})),n._listElm.appendChild(o)}}function tu(){const a=this,t=a.grid.getColumns().slice(0),e=new Array(a.columns.length);for(let n=0;n<e.length;n++)a.grid.getColumnIndex(a.columns[n].id)===void 0?e[n]=a.columns[n]:e[n]=t.shift();a._columns=e}class bh{constructor(t,e,n){var r,o,s,l;this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._areVisibleColumnDifferent=!1,this._columns=[],this._gridUid="",this._columnCheckboxes=[],this.onColumnsChanged=new Slick.Event,this._defaults={hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",minHeight:200,syncResizeTitle:"Synchronous resize",headerColumnValueExtractor:u=>u.name},this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this._columns=(r=this.sharedService.allColumns)!==null&&r!==void 0?r:[],this._gridUid=(l=(s=(o=this.grid)===null||o===void 0?void 0:o.getUID)===null||s===void 0?void 0:s.call(o))!==null&&l!==void 0?l:"",this.init()}get addonOptions(){return this.gridOptions.columnPicker||{}}get eventHandler(){return this._eventHandler}get columns(){return this._columns}set columns(t){this._columns=t}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get grid(){return this.sharedService.slickGrid}get menuElement(){return this._menuElm}init(){var t;this._gridUid=(t=this.grid.getUID())!==null&&t!==void 0?t:"",this.gridOptions.columnPicker={...this._defaults,...this.gridOptions.columnPicker},this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker"),this._eventHandler.subscribe(this.grid.onHeaderContextMenu,this.handleHeaderContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onColumnsReordered,tu.bind(this)),this._menuElm=De("div",{ariaExpanded:"false",className:`slick-column-picker ${this._gridUid}`,role:"menu",style:{display:"none"}}),rm.call(this,this._menuElm),nm.call(this,this._menuElm),this._listElm=De("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",om.bind(this)),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this)),document.body.appendChild(this._menuElm)}dispose(){var t,e,n,r;this._eventHandler.unsubscribeAll(),this._bindEventService.unbindAll(),(e=(t=this._listElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t),(r=(n=this._menuElm)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n)}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}translateColumnPicker(){this.addonOptions&&(this.addonOptions.columnTitle="",this.addonOptions.forceFitTitle="",this.addonOptions.syncResizeTitle="",this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker")),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.addonOptions&&this.updateAllTitles(this.addonOptions)}handleBodyMouseDown(t){(this._menuElm!==t.target&&!this._menuElm.contains(t.target)||t.target.className==="close")&&(this._menuElm.setAttribute("aria-expanded","false"),this._menuElm.style.display="none")}handleHeaderContextMenu(t){t.preventDefault(),en(this._listElm),tu.call(this),this._columnCheckboxes=[],sm.call(this,this.addonOptions),this.repositionMenu(t)}repositionMenu(t){var e,n;const r=(n=(e=t==null?void 0:t.touches)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:t;this._menuElm.style.top=`${r.pageY-10}px`,this._menuElm.style.left=`${r.pageX-10}px`,this._menuElm.style.minHeight=Xs(this.addonOptions.minHeight,""),this._menuElm.style.maxHeight=Xs(this.addonOptions.maxHeight,`${window.innerHeight-r.clientY}px`),this._menuElm.style.display="block",this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.appendChild(this._listElm)}updateAllTitles(t){var e;!((e=this._columnTitleElm)===null||e===void 0)&&e.textContent&&t.columnTitle&&(this._columnTitleElm.textContent=t.columnTitle)}}const iu=(a,t,e,n,r,o)=>{const s=n.params||{};if(!s.formatters||!Array.isArray(s.formatters))throw new Error(`The multiple formatter requires the "formatters" to be provided as a column params.
8
8
  For example: this.columnDefinitions = [{ id: title, field: title, formatter: Formatters.multiple, params: { formatters: [Formatters.lowercase, Formatters.uppercase] }`);const l=s.formatters;let u=e;for(const p of l)u=p(a,t,u,n,r,o);return u},Ch=Ys||ms;function lm(a,t){if(Array.isArray(a)){for(const e of a)if(e.editor)if(e.formatter&&e.formatter!==iu&&e.formatter!==t){const n=e.formatter;e.formatter=iu,e.params={...e.params,formatters:[n,t]}}else e.formatter&&e.formatter===iu&&e.params?e.params.formatters.findIndex(n=>n===t)===-1&&(e.params.formatters=[...e.params.formatters,t]):e.formatter=t}}function un(a,t,e,n){let r,o,s="",l="";switch(e){case"currency":r=Xe.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL,o=Xe.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL;break;case"decimal":r=Xe.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL,o=Xe.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL;break;case"percent":r=Xe.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL,o=Xe.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL;break}const u=t&&typeof t.getOptions=="function"?t.getOptions():{},p=Zo("minDecimal",a,u,r),c=Zo("maxDecimal",a,u,o),f=Zo("decimalSeparator",a,u,Xe.DEFAULT_NUMBER_DECIMAL_SEPARATOR),m=Zo("thousandSeparator",a,u,Xe.DEFAULT_NUMBER_THOUSAND_SEPARATOR),v=Zo("displayNegativeNumberWithParentheses",a,u,Xe.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET),_=Zo("currencyPrefix",a,u,""),C=Zo("currencySuffix",a,u,"");return n==="cell"&&(s=Zo("numberPrefix",a,u,""),l=Zo("numberSuffix",a,u,"")),{minDecimal:p,maxDecimal:c,decimalSeparator:f,thousandSeparator:m,wrapNegativeNumber:v,currencyPrefix:_,currencySuffix:C,numberPrefix:s,numberSuffix:l}}function Zo(a,t,e,n){var r;const o=t&&t.params;return o&&o.hasOwnProperty(a)?o[a]:!((r=e==null?void 0:e.formatterOptions)===null||r===void 0)&&r.hasOwnProperty(a)?e.formatterOptions[a]:n}function cn(a,t){const e=Fr(a);return(n,r,o,s,l,u)=>{var p,c,f,m,v;const _=u&&typeof u.getOptions=="function"?u.getOptions():{},C=(c=(p=_==null?void 0:_.formatterOptions)===null||p===void 0?void 0:p.dateSeparator)!==null&&c!==void 0?c:t,x=(f=s==null?void 0:s.type)!==null&&f!==void 0?f:ie.date,w=Fr(x),E=(v=(m=s==null?void 0:s.params)===null||m===void 0?void 0:m.parseDateAsUtc)!==null&&v!==void 0?v:!1,I=Ch(o,w,!1).isValid();let k=o;if(o&&I&&(k=E?Ch.utc(o).format(e):Ch(o).format(e)),k&&C!==t){const F=new RegExp(t,"ig");k=k.replace(F,C)}return k}}function yh(a,t,e,n,r,o){let s=!1;e!=null&&e.hasOwnProperty("exportWithFormatter")?s=!!e.exportWithFormatter:o!=null&&o.hasOwnProperty("exportWithFormatter")&&(s=!!o.exportWithFormatter);let l;n&&e.exportCustomFormatter?l=e.exportCustomFormatter:s&&e.formatter&&(l=e.formatter);const u=nu(l,a,t,e,n,r);return o!=null&&o.sanitizeDataExport&&typeof u=="string"?or(u):u}function nu(a,t,e,n,r,o){let s="",u=n.field||n.id||"";if(typeof n.field=="string"&&n.field.indexOf(".")>0){const c=n.field.split(".");u=c.length>0?c[0]:n.field}const p=r!=null&&r.hasOwnProperty(u)?r[u]:null;if(typeof a=="function"){const c=a(t,e,p,n,r,o);s=c,c&&typeof c=="object"&&c.hasOwnProperty("text")&&(s=c.text),s==null&&(s="")}else s=r!=null&&r.hasOwnProperty(u)?p:"",s==null&&(s="");return typeof s=="object"&&!(s instanceof Date)&&Object.entries(s).length===0&&(s=""),s}class V_ extends Jp{constructor(t,e,n,r){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this.treeDataService=r,this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!1,optionShownOverColumnIds:[],commandShownOverColumnIds:[]},this.pluginName="ContextMenu",this._camelPluginName="contextMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-context-menu",this.init(n.gridOptions.contextMenu)}init(t){this._addonOptions={...this._defaults,...t};const e=this._addonOptions&&Array.isArray(this._addonOptions.commandItems)?this._addonOptions.commandItems:[];this._addonOptions.commandItems=[...e,...this.addMenuCustomCommands(e)],this._addonOptions={...this._addonOptions},this.sharedService.gridOptions.contextMenu=this._addonOptions,this.sortMenuItems(),this._eventHandler.subscribe(this.grid.onContextMenu,this.handleClick.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateContextMenu(){var t,e;const n=(e=(t=this.sharedService)===null||t===void 0?void 0:t.gridOptions)!==null&&e!==void 0?e:{},r=this.sharedService.gridOptions.contextMenu;if(r&&(n!=null&&n.enableTranslate)){const o=r.commandItems||[],s=r.optionItems||[];r.commandTitleKey&&(r.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.commandTitleKey,"TEXT_COMMANDS")||r.commandTitle),r.optionTitleKey&&(r.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(r.optionTitleKey,"TEXT_COMMANDS")||r.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(o),this.extensionUtility.translateMenuItemsFromTitleKey(s)}}handleClick(t,e){const n=this.grid.getCellFromEvent(t);if(n){const r=this.grid.getDataItem(n.row),o=this.grid.getColumns()[n.cell];if(e=e||{},e.cell=n.cell,e.row=n.row,e.column=o,e.dataContext=r,e.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,e))return;this._menuElm=this.createMenu(t),this._menuElm&&t.preventDefault(),this._menuElm&&(this.repositionMenu(t),this._menuElm.setAttribute("aria-expanded","true"),this._menuElm.style.display="block"),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}addMenuCustomCommands(t){var e;const n=[],r=this.sharedService&&this.sharedService.gridOptions||{},o=r==null?void 0:r.contextMenu,s=(e=this.sharedService)===null||e===void 0?void 0:e.dataView,l=ao(r);if(o&&!o.hideCopyCellValueCommand){const u="copy";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconCopyCellValueCommand||"fa fa-clone",titleKey:`${l}COPY`,disabled:!1,command:u,positionOrder:50,action:(p,c)=>{this.copyToClipboard(c)},itemUsabilityOverride:p=>{const c=p==null?void 0:p.column,f=p==null?void 0:p.dataContext;if(typeof c.queryFieldNameGetterFn=="function"){const m=Ba(c,f,"");if(m!==""&&m!==void 0)return!0}else if(c&&f.hasOwnProperty(c.field))return f[c.field]!==""&&f[c.field]!==null&&f[c.field]!==void 0;return!1}})}if(r!=null&&r.enableTextExport&&o&&!o.hideExportCsvCommand){const u="export-csv";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconExportCsvCommand||"fa fa-download",titleKey:`${l}EXPORT_TO_CSV`,disabled:!1,command:u,positionOrder:51,action:()=>{var p;const f=(((p=this.sharedService)===null||p===void 0?void 0:p.externalRegisteredResources)||[]).find(m=>m.className==="TextExportService");if(f!=null&&f.exportToFile)f.exportToFile({delimiter:vs.comma,format:dn.csv});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };")}})}if(r&&r.enableExcelExport&&o&&!o.hideExportExcelCommand){const u="export-excel";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconExportExcelCommand||"fa fa-file-excel-o text-success",titleKey:`${l}EXPORT_TO_EXCEL`,disabled:!1,command:u,positionOrder:52,action:()=>{var p;const f=(((p=this.sharedService)===null||p===void 0?void 0:p.externalRegisteredResources)||[]).find(m=>m.className==="ExcelExportService");if(f!=null&&f.exportToExcel)f.exportToExcel();else throw new Error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Context Menu. Example:: this.gridOptions = { enableExcelExport: true, registerExternalResources: [new ExcelExportService()] };")}})}if(r!=null&&r.enableTextExport&&o&&!o.hideExportTextDelimitedCommand){const u="export-text-delimited";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconExportTextDelimitedCommand||"fa fa-download",titleKey:`${l}EXPORT_TO_TAB_DELIMITED`,disabled:!1,command:u,positionOrder:53,action:()=>{var p;const f=(((p=this.sharedService)===null||p===void 0?void 0:p.externalRegisteredResources)||[]).find(m=>m.className==="TextExportService");if(f!=null&&f.exportToFile)f.exportToFile({delimiter:vs.tab,format:dn.txt});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, registerExternalResources: [new TextExportService()] };")}})}if(r&&(r.enableGrouping||r.enableDraggableGrouping||r.enableTreeData)){if(o&&!o.hideCopyCellValueCommand&&n.push({divider:!0,command:"",positionOrder:54}),r&&!r.enableTreeData&&o&&!o.hideClearAllGrouping){const u="clear-grouping";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconClearGroupingCommand||"fa fa-times",titleKey:`${l}CLEAR_ALL_GROUPING`,disabled:!1,command:u,positionOrder:55,action:()=>{s.setGrouping([]),this.pubSubService.publish("onContextMenuClearGrouping")},itemUsabilityOverride:()=>{const p=s&&s.getGrouping&&s.getGrouping();return Array.isArray(p)&&p.length>0}})}if(r&&o&&!o.hideCollapseAllGroups){const u="collapse-all-groups";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconCollapseAllGroupsCommand||"fa fa-compress",titleKey:`${l}COLLAPSE_ALL_GROUPS`,disabled:!1,command:u,positionOrder:56,action:()=>{r.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!0):s.collapseAllGroups(),this.pubSubService.publish("onContextMenuCollapseAllGroups")},itemUsabilityOverride:()=>{if(r.enableTreeData)return!0;const p=s&&s.getGrouping&&s.getGrouping();return Array.isArray(p)&&p.length>0}})}if(r&&o&&!o.hideExpandAllGroups){const u="expand-all-groups";t.some(p=>p!=="divider"&&p.hasOwnProperty("command")&&p.command===u)||n.push({iconCssClass:o.iconExpandAllGroupsCommand||"fa fa-expand",titleKey:`${l}EXPAND_ALL_GROUPS`,disabled:!1,command:u,positionOrder:57,action:()=>{r.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!1):s.expandAllGroups(),this.pubSubService.publish("onContextMenuExpandAllGroups")},itemUsabilityOverride:()=>{if(r.enableTreeData)return!0;const p=s&&s.getGrouping&&s.getGrouping();return Array.isArray(p)&&p.length>0}})}}return this.extensionUtility.translateMenuItemsFromTitleKey(n),n}copyToClipboard(t){var e,n,r,o,s;try{if(t&&t.grid&&t.command){const l=(n=(e=this.sharedService)===null||e===void 0?void 0:e.gridOptions)!==null&&n!==void 0?n:{},u=(r=t==null?void 0:t.cell)!==null&&r!==void 0?r:0,p=(o=t==null?void 0:t.row)!==null&&o!==void 0?o:0,c=t==null?void 0:t.column,f=t==null?void 0:t.dataContext,m=(s=this.sharedService)===null||s===void 0?void 0:s.slickGrid,v=l&&(l.excelExportOptions||l.textExportOptions);let _=yh(p,u,c,f,m,v);typeof c.queryFieldNameGetterFn=="function"&&(_=Ba(c,f,""));let C=_;typeof _=="string"&&(C=_.replace(/^([·|⮞|⮟]\s*)|([·|⮞|⮟])\s*/gi,"").replace(/[\u00b7|\u034f]/gi,"").trim());const x=document.createElement("textarea");x&&document.body&&(x.style.position="absolute",x.style.opacity="0",x.value=C,document.body.appendChild(x),x.select(),document.execCommand("copy",!1,C)&&x.remove())}}catch{}}sortMenuItems(){var t,e;const n=(e=(t=this.sharedService)===null||t===void 0?void 0:t.gridOptions)===null||e===void 0?void 0:e.contextMenu;n&&(this.extensionUtility.sortItems(n.commandItems||[],"positionOrder"),this.extensionUtility.sortItems(n.optionItems||[],"positionOrder"))}}/**!
9
9
  * Sortable 1.15.0
10
10
  * @author RubaXa <trash@rubaxa.org>
11
11
  * @author owenm <owen23355@gmail.com>
12
12
  * @license MIT
13
13
  */function am(a,t){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),e.push.apply(e,n)}return e}function Qo(a){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?am(Object(e),!0).forEach(function(n){z_(a,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):am(Object(e)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(e,n))})}return a}function ru(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ru=function(t){return typeof t}:ru=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(a)}function z_(a,t,e){return t in a?Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[t]=e,a}function ho(){return ho=Object.assign||function(a){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n])}return a},ho.apply(this,arguments)}function U_(a,t){if(a==null)return{};var e={},n=Object.keys(a),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(e[r]=a[r]);return e}function G_(a,t){if(a==null)return{};var e=U_(a,t),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(a);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(e[n]=a[n])}return e}function W_(a){return $_(a)||Y_(a)||j_(a)||X_()}function $_(a){if(Array.isArray(a))return Eh(a)}function Y_(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function j_(a,t){if(a){if(typeof a=="string")return Eh(a,t);var e=Object.prototype.toString.call(a).slice(8,-1);if(e==="Object"&&a.constructor&&(e=a.constructor.name),e==="Map"||e==="Set")return Array.from(a);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Eh(a,t)}}function Eh(a,t){(t==null||t>a.length)&&(t=a.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=a[e];return n}function X_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var q_="1.15.0";function Cs(a){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(a)}var ys=Cs(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ya=Cs(/Edge/i),dm=Cs(/firefox/i),ja=Cs(/safari/i)&&!Cs(/chrome/i)&&!Cs(/android/i),um=Cs(/iP(ad|od|hone)/i),cm=Cs(/chrome/i)&&Cs(/android/i),hm={capture:!1,passive:!1};function Ci(a,t,e){a.addEventListener(t,e,!ys&&hm)}function gi(a,t,e){a.removeEventListener(t,e,!ys&&hm)}function ou(a,t){if(t){if(t[0]===">"&&(t=t.substring(1)),a)try{if(a.matches)return a.matches(t);if(a.msMatchesSelector)return a.msMatchesSelector(t);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(t)}catch{return!1}return!1}}function K_(a){return a.host&&a!==document&&a.host.nodeType?a.host:a.parentNode}function Po(a,t,e,n){if(a){e=e||document;do{if(t!=null&&(t[0]===">"?a.parentNode===e&&ou(a,t):ou(a,t))||n&&a===e)return a;if(a===e)break}while(a=K_(a))}return null}var fm=/\s+/g;function bn(a,t,e){if(a&&t)if(a.classList)a.classList[e?"add":"remove"](t);else{var n=(" "+a.className+" ").replace(fm," ").replace(" "+t+" "," ");a.className=(n+(e?" "+t:"")).replace(fm," ")}}function Ft(a,t,e){var n=a&&a.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(a,""):a.currentStyle&&(e=a.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function wl(a,t){var e="";if(typeof a=="string")e=a;else do{var n=Ft(a,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(a=a.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function pm(a,t,e){if(a){var n=a.getElementsByTagName(t),r=0,o=n.length;if(e)for(;r<o;r++)e(n[r],r);return n}return[]}function Jo(){var a=document.scrollingElement;return a||document.documentElement}function hn(a,t,e,n,r){if(!(!a.getBoundingClientRect&&a!==window)){var o,s,l,u,p,c,f;if(a!==window&&a.parentNode&&a!==Jo()?(o=a.getBoundingClientRect(),s=o.top,l=o.left,u=o.bottom,p=o.right,c=o.height,f=o.width):(s=0,l=0,u=window.innerHeight,p=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(t||e)&&a!==window&&(r=r||a.parentNode,!ys))do if(r&&r.getBoundingClientRect&&(Ft(r,"transform")!=="none"||e&&Ft(r,"position")!=="static")){var m=r.getBoundingClientRect();s-=m.top+parseInt(Ft(r,"border-top-width")),l-=m.left+parseInt(Ft(r,"border-left-width")),u=s+o.height,p=l+o.width;break}while(r=r.parentNode);if(n&&a!==window){var v=wl(r||a),_=v&&v.a,C=v&&v.d;v&&(s/=C,l/=_,f/=_,c/=C,u=s+c,p=l+f)}return{top:s,left:l,bottom:u,right:p,width:f,height:c}}}function mm(a,t,e){for(var n=qs(a,!0),r=hn(a)[t];n;){var o=hn(n)[e],s=void 0;if(e==="top"||e==="left"?s=r>=o:s=r<=o,!s)return n;if(n===Jo())break;n=qs(n,!1)}return!1}function ia(a,t,e,n){for(var r=0,o=0,s=a.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==Gt.ghost&&(n||s[o]!==Gt.dragged)&&Po(s[o],e.draggable,a,!1)){if(r===t)return s[o];r++}o++}return null}function Sh(a,t){for(var e=a.lastElementChild;e&&(e===Gt.ghost||Ft(e,"display")==="none"||t&&!ou(e,t));)e=e.previousElementSibling;return e||null}function wn(a,t){var e=0;if(!a||!a.parentNode)return-1;for(;a=a.previousElementSibling;)a.nodeName.toUpperCase()!=="TEMPLATE"&&a!==Gt.clone&&(!t||ou(a,t))&&e++;return e}function vm(a){var t=0,e=0,n=Jo();if(a)do{var r=wl(a),o=r.a,s=r.d;t+=a.scrollLeft*o,e+=a.scrollTop*s}while(a!==n&&(a=a.parentNode));return[t,e]}function Z_(a,t){for(var e in a)if(a.hasOwnProperty(e)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===a[e][n])return Number(e)}return-1}function qs(a,t){if(!a||!a.getBoundingClientRect)return Jo();var e=a,n=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var r=Ft(e);if(e.clientWidth<e.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return Jo();if(n||t)return e;n=!0}}while(e=e.parentNode);return Jo()}function Q_(a,t){if(a&&t)for(var e in t)t.hasOwnProperty(e)&&(a[e]=t[e]);return a}function wh(a,t){return Math.round(a.top)===Math.round(t.top)&&Math.round(a.left)===Math.round(t.left)&&Math.round(a.height)===Math.round(t.height)&&Math.round(a.width)===Math.round(t.width)}var Xa;function gm(a,t){return function(){if(!Xa){var e=arguments,n=this;e.length===1?a.call(n,e[0]):a.apply(n,e),Xa=setTimeout(function(){Xa=void 0},t)}}}function J_(){clearTimeout(Xa),Xa=void 0}function _m(a,t,e){a.scrollLeft+=t,a.scrollTop+=e}function xh(a){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(a).cloneNode(!0):e?e(a).clone(!0)[0]:a.cloneNode(!0)}function bm(a,t){Ft(a,"position","absolute"),Ft(a,"top",t.top),Ft(a,"left",t.left),Ft(a,"width",t.width),Ft(a,"height",t.height)}function Th(a){Ft(a,"position",""),Ft(a,"top",""),Ft(a,"left",""),Ft(a,"width",""),Ft(a,"height","")}var hr="Sortable"+new Date().getTime();function e0(){var a=[],t;return{captureAnimationState:function(){if(a=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(Ft(r,"display")==="none"||r===Gt.ghost)){a.push({target:r,rect:hn(r)});var o=Qo({},a[a.length-1].rect);if(r.thisAnimationDuration){var s=wl(r,!0);s&&(o.top-=s.f,o.left-=s.e)}r.fromRect=o}})}},addAnimationState:function(n){a.push(n)},removeAnimationState:function(n){a.splice(Z_(a,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var o=!1,s=0;a.forEach(function(l){var u=0,p=l.target,c=p.fromRect,f=hn(p),m=p.prevFromRect,v=p.prevToRect,_=l.rect,C=wl(p,!0);C&&(f.top-=C.f,f.left-=C.e),p.toRect=f,p.thisAnimationDuration&&wh(m,f)&&!wh(c,f)&&(_.top-f.top)/(_.left-f.left)===(c.top-f.top)/(c.left-f.left)&&(u=i0(_,m,v,r.options)),wh(f,c)||(p.prevFromRect=c,p.prevToRect=f,u||(u=r.options.animation),r.animate(p,_,f,u)),u&&(o=!0,s=Math.max(s,u),clearTimeout(p.animationResetTimer),p.animationResetTimer=setTimeout(function(){p.animationTime=0,p.prevFromRect=null,p.fromRect=null,p.prevToRect=null,p.thisAnimationDuration=null},u),p.thisAnimationDuration=u)}),clearTimeout(t),o?t=setTimeout(function(){typeof n=="function"&&n()},s):typeof n=="function"&&n(),a=[]},animate:function(n,r,o,s){if(s){Ft(n,"transition",""),Ft(n,"transform","");var l=wl(this.el),u=l&&l.a,p=l&&l.d,c=(r.left-o.left)/(u||1),f=(r.top-o.top)/(p||1);n.animatingX=!!c,n.animatingY=!!f,Ft(n,"transform","translate3d("+c+"px,"+f+"px,0)"),this.forRepaintDummy=t0(n),Ft(n,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),Ft(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){Ft(n,"transition",""),Ft(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},s)}}}}function t0(a){return a.offsetWidth}function i0(a,t,e,n){return Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*n.animation}var na=[],Oh={initializeByDefault:!0},qa={mount:function(t){for(var e in Oh)Oh.hasOwnProperty(e)&&!(e in t)&&(t[e]=Oh[e]);na.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),na.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=t+"Global";na.forEach(function(s){e[s.pluginName]&&(e[s.pluginName][o]&&e[s.pluginName][o](Qo({sortable:e},n)),e.options[s.pluginName]&&e[s.pluginName][t]&&e[s.pluginName][t](Qo({sortable:e},n)))})},initializePlugins:function(t,e,n,r){na.forEach(function(l){var u=l.pluginName;if(!(!t.options[u]&&!l.initializeByDefault)){var p=new l(t,e,t.options);p.sortable=t,p.options=t.options,t[u]=p,ho(n,p.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);typeof s<"u"&&(t.options[o]=s)}},getEventProperties:function(t,e){var n={};return na.forEach(function(r){typeof r.eventProperties=="function"&&ho(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return na.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(r=o.optionListeners[e].call(t[o.pluginName],n))}),r}};function Ka(a){var t=a.sortable,e=a.rootEl,n=a.name,r=a.targetEl,o=a.cloneEl,s=a.toEl,l=a.fromEl,u=a.oldIndex,p=a.newIndex,c=a.oldDraggableIndex,f=a.newDraggableIndex,m=a.originalEvent,v=a.putSortable,_=a.extraEventProperties;if(t=t||e&&e[hr],!!t){var C,x=t.options,w="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ys&&!Ya?C=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent(n,!0,!0)),C.to=s||e,C.from=l||e,C.item=r||e,C.clone=o,C.oldIndex=u,C.newIndex=p,C.oldDraggableIndex=c,C.newDraggableIndex=f,C.originalEvent=m,C.pullMode=v?v.lastPutMode:void 0;var E=Qo(Qo({},_),qa.getEventProperties(n,t));for(var I in E)C[I]=E[I];e&&e.dispatchEvent(C),x[w]&&x[w].call(t,C)}}var n0=["evt"],Pr=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,o=G_(n,n0);qa.pluginEvent.bind(Gt)(t,e,Qo({dragEl:bt,parentEl:xn,ghostEl:si,rootEl:fn,nextEl:xl,lastDownEl:su,cloneEl:Cn,cloneHidden:Ks,dragStarted:Qa,putSortable:sr,activeSortable:Gt.active,originalEvent:r,oldIndex:ra,oldDraggableIndex:Za,newIndex:qr,newDraggableIndex:Zs,hideGhostForTarget:Tm,unhideGhostForTarget:Om,cloneNowHidden:function(){Ks=!0},cloneNowShown:function(){Ks=!1},dispatchSortableEvent:function(l){Sr({sortable:e,name:l,originalEvent:r})}},o))};function Sr(a){Ka(Qo({putSortable:sr,cloneEl:Cn,targetEl:bt,rootEl:fn,oldIndex:ra,oldDraggableIndex:Za,newIndex:qr,newDraggableIndex:Zs},a))}var bt,xn,si,fn,xl,su,Cn,Ks,ra,qr,Za,Zs,lu,sr,oa=!1,au=!1,du=[],Tl,Mo,Ah,kh,Cm,ym,Qa,sa,Ja,ed=!1,uu=!1,cu,fr,Ih=[],Dh=!1,hu=[],fu=typeof document<"u",pu=um,Em=Ya||ys?"cssFloat":"float",r0=fu&&!cm&&!um&&"draggable"in document.createElement("div"),Sm=function(){if(fu){if(ys)return!1;var a=document.createElement("x");return a.style.cssText="pointer-events:auto",a.style.pointerEvents==="auto"}}(),wm=function(t,e){var n=Ft(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=ia(t,0,e),s=ia(t,1,e),l=o&&Ft(o),u=s&&Ft(s),p=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+hn(o).width,c=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+hn(s).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return s&&(u.clear==="both"||u.clear===f)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||p>=r&&n[Em]==="none"||s&&n[Em]==="none"&&p+c>r)?"vertical":"horizontal"},o0=function(t,e,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,s=n?t.width:t.height,l=n?e.left:e.top,u=n?e.right:e.bottom,p=n?e.width:e.height;return r===l||o===u||r+s/2===l+p/2},s0=function(t,e){var n;return du.some(function(r){var o=r[hr].options.emptyInsertThreshold;if(!(!o||Sh(r))){var s=hn(r),l=t>=s.left-o&&t<=s.right+o,u=e>=s.top-o&&e<=s.bottom+o;if(l&&u)return n=r}}),n},xm=function(t){function e(o,s){return function(l,u,p,c){var f=l.options.group.name&&u.options.group.name&&l.options.group.name===u.options.group.name;if(o==null&&(s||f))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return e(o(l,u,p,c),s)(l,u,p,c);var m=(s?l:u).options.group.name;return o===!0||typeof o=="string"&&o===m||o.join&&o.indexOf(m)>-1}}var n={},r=t.group;(!r||ru(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=e(r.pull,!0),n.checkPut=e(r.put),n.revertClone=r.revertClone,t.group=n},Tm=function(){!Sm&&si&&Ft(si,"display","none")},Om=function(){!Sm&&si&&Ft(si,"display","")};fu&&!cm&&document.addEventListener("click",function(a){if(au)return a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.stopImmediatePropagation&&a.stopImmediatePropagation(),au=!1,!1},!0);var Ol=function(t){if(bt){t=t.touches?t.touches[0]:t;var e=s0(t.clientX,t.clientY);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[hr]._onDragOver(n)}}},l0=function(t){bt&&bt.parentNode[hr]._isOutsideThisEl(t.target)};function Gt(a,t){if(!(a&&a.nodeType&&a.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(a));this.el=a,this.options=t=ho({},t),a[hr]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(a.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return wm(a,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,l){s.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Gt.supportPointer!==!1&&"PointerEvent"in window&&!ja,emptyInsertThreshold:5};qa.initializePlugins(this,a,e);for(var n in e)!(n in t)&&(t[n]=e[n]);xm(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:r0,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ci(a,"pointerdown",this._onTapStart):(Ci(a,"mousedown",this._onTapStart),Ci(a,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ci(a,"dragover",this),Ci(a,"dragenter",this)),du.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),ho(this,e0())}Gt.prototype={constructor:Gt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(sa=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,bt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,o=r.preventOnFilter,s=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(l||t).target,p=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,c=r.filter;if(m0(n),!bt&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!p.isContentEditable&&!(!this.nativeDraggable&&ja&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=Po(u,r.draggable,n,!1),!(u&&u.animated)&&su!==u)){if(ra=wn(u),Za=wn(u,r.draggable),typeof c=="function"){if(c.call(this,t,u,this)){Sr({sortable:e,rootEl:p,name:"filter",targetEl:u,toEl:n,fromEl:n}),Pr("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=Po(p,f.trim(),n,!1),f)return Sr({sortable:e,rootEl:f,name:"filter",targetEl:u,fromEl:n,toEl:n}),Pr("filter",e,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!Po(p,r.handle,n,!1)||this._prepareDragStart(t,l,u)}}},_prepareDragStart:function(t,e,n){var r=this,o=r.el,s=r.options,l=o.ownerDocument,u;if(n&&!bt&&n.parentNode===o){var p=hn(n);if(fn=o,bt=n,xn=bt.parentNode,xl=bt.nextSibling,su=n,lu=s.group,Gt.dragged=bt,Tl={target:bt,clientX:(e||t).clientX,clientY:(e||t).clientY},Cm=Tl.clientX-p.left,ym=Tl.clientY-p.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,bt.style["will-change"]="all",u=function(){if(Pr("delayEnded",r,{evt:t}),Gt.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!dm&&r.nativeDraggable&&(bt.draggable=!0),r._triggerDragStart(t,e),Sr({sortable:r,name:"choose",originalEvent:t}),bn(bt,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){pm(bt,c.trim(),Rh)}),Ci(l,"dragover",Ol),Ci(l,"mousemove",Ol),Ci(l,"touchmove",Ol),Ci(l,"mouseup",r._onDrop),Ci(l,"touchend",r._onDrop),Ci(l,"touchcancel",r._onDrop),dm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,bt.draggable=!0),Pr("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ya||ys))){if(Gt.eventCanceled){this._onDrop();return}Ci(l,"mouseup",r._disableDelayedDrag),Ci(l,"touchend",r._disableDelayedDrag),Ci(l,"touchcancel",r._disableDelayedDrag),Ci(l,"mousemove",r._delayedDragTouchMoveHandler),Ci(l,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&Ci(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(u,s.delay)}else u()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){bt&&Rh(bt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;gi(t,"mouseup",this._disableDelayedDrag),gi(t,"touchend",this._disableDelayedDrag),gi(t,"touchcancel",this._disableDelayedDrag),gi(t,"mousemove",this._delayedDragTouchMoveHandler),gi(t,"touchmove",this._delayedDragTouchMoveHandler),gi(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Ci(document,"pointermove",this._onTouchMove):e?Ci(document,"touchmove",this._onTouchMove):Ci(document,"mousemove",this._onTouchMove):(Ci(bt,"dragend",this),Ci(fn,"dragstart",this._onDragStart));try{document.selection?vu(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(oa=!1,fn&&bt){Pr("dragStarted",this,{evt:e}),this.nativeDraggable&&Ci(document,"dragover",l0);var n=this.options;!t&&bn(bt,n.dragClass,!1),bn(bt,n.ghostClass,!0),Gt.active=this,t&&this._appendGhost(),Sr({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Mo){this._lastX=Mo.clientX,this._lastY=Mo.clientY,Tm();for(var t=document.elementFromPoint(Mo.clientX,Mo.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Mo.clientX,Mo.clientY),t!==e);)e=t;if(bt.parentNode[hr]._isOutsideThisEl(t),e)do{if(e[hr]){var n=void 0;if(n=e[hr]._onDragOver({clientX:Mo.clientX,clientY:Mo.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Om()}},_onTouchMove:function(t){if(Tl){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=si&&wl(si,!0),l=si&&s&&s.a,u=si&&s&&s.d,p=pu&&fr&&vm(fr),c=(o.clientX-Tl.clientX+r.x)/(l||1)+(p?p[0]-Ih[0]:0)/(l||1),f=(o.clientY-Tl.clientY+r.y)/(u||1)+(p?p[1]-Ih[1]:0)/(u||1);if(!Gt.active&&!oa){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(si){s?(s.e+=c-(Ah||0),s.f+=f-(kh||0)):s={a:1,b:0,c:0,d:1,e:c,f};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");Ft(si,"webkitTransform",m),Ft(si,"mozTransform",m),Ft(si,"msTransform",m),Ft(si,"transform",m),Ah=c,kh=f,Mo=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!si){var t=this.options.fallbackOnBody?document.body:fn,e=hn(bt,!0,pu,!0,t),n=this.options;if(pu){for(fr=t;Ft(fr,"position")==="static"&&Ft(fr,"transform")==="none"&&fr!==document;)fr=fr.parentNode;fr!==document.body&&fr!==document.documentElement?(fr===document&&(fr=Jo()),e.top+=fr.scrollTop,e.left+=fr.scrollLeft):fr=Jo(),Ih=vm(fr)}si=bt.cloneNode(!0),bn(si,n.ghostClass,!1),bn(si,n.fallbackClass,!0),bn(si,n.dragClass,!0),Ft(si,"transition",""),Ft(si,"transform",""),Ft(si,"box-sizing","border-box"),Ft(si,"margin",0),Ft(si,"top",e.top),Ft(si,"left",e.left),Ft(si,"width",e.width),Ft(si,"height",e.height),Ft(si,"opacity","0.8"),Ft(si,"position",pu?"absolute":"fixed"),Ft(si,"zIndex","100000"),Ft(si,"pointerEvents","none"),Gt.ghost=si,t.appendChild(si),Ft(si,"transform-origin",Cm/parseInt(si.style.width)*100+"% "+ym/parseInt(si.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,o=n.options;if(Pr("dragStart",this,{evt:t}),Gt.eventCanceled){this._onDrop();return}Pr("setupClone",this),Gt.eventCanceled||(Cn=xh(bt),Cn.removeAttribute("id"),Cn.draggable=!1,Cn.style["will-change"]="",this._hideClone(),bn(Cn,this.options.chosenClass,!1),Gt.clone=Cn),n.cloneId=vu(function(){Pr("clone",n),!Gt.eventCanceled&&(n.options.removeCloneOnHide||fn.insertBefore(Cn,bt),n._hideClone(),Sr({sortable:n,name:"clone"}))}),!e&&bn(bt,o.dragClass,!0),e?(au=!0,n._loopId=setInterval(n._emulateDragOver,50)):(gi(document,"mouseup",n._onDrop),gi(document,"touchend",n._onDrop),gi(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,bt)),Ci(document,"drop",n),Ft(bt,"transform","translateZ(0)")),oa=!0,n._dragStartId=vu(n._dragStarted.bind(n,e,t)),Ci(document,"selectstart",n),Qa=!0,ja&&Ft(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,r,o,s,l=this.options,u=l.group,p=Gt.active,c=lu===u,f=l.sort,m=sr||p,v,_=this,C=!1;if(Dh)return;function x(Oe,ye){Pr(Oe,_,Qo({evt:t,isOwner:c,axis:v?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:f,fromSortable:m,target:n,completed:E,onMove:function(ae,he){return mu(fn,e,bt,r,ae,hn(ae),t,he)},changed:I},ye))}function w(){x("dragOverAnimationCapture"),_.captureAnimationState(),_!==m&&m.captureAnimationState()}function E(Oe){return x("dragOverCompleted",{insertion:Oe}),Oe&&(c?p._hideClone():p._showClone(_),_!==m&&(bn(bt,sr?sr.options.ghostClass:p.options.ghostClass,!1),bn(bt,l.ghostClass,!0)),sr!==_&&_!==Gt.active?sr=_:_===Gt.active&&sr&&(sr=null),m===_&&(_._ignoreWhileAnimating=n),_.animateAll(function(){x("dragOverAnimationComplete"),_._ignoreWhileAnimating=null}),_!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(n===bt&&!bt.animated||n===e&&!n.animated)&&(sa=null),!l.dragoverBubble&&!t.rootEl&&n!==document&&(bt.parentNode[hr]._isOutsideThisEl(t.target),!Oe&&Ol(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),C=!0}function I(){qr=wn(bt),Zs=wn(bt,l.draggable),Sr({sortable:_,name:"change",toEl:e,newIndex:qr,newDraggableIndex:Zs,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=Po(n,l.draggable,e,!0),x("dragOver"),Gt.eventCanceled)return C;if(bt.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||_._ignoreWhileAnimating===n)return E(!1);if(au=!1,p&&!l.disabled&&(c?f||(s=xn!==fn):sr===this||(this.lastPutMode=lu.checkPull(this,p,bt,t))&&u.checkPut(this,p,bt,t))){if(v=this._getDirection(t,n)==="vertical",r=hn(bt),x("dragOverValid"),Gt.eventCanceled)return C;if(s)return xn=fn,w(),this._hideClone(),x("revert"),Gt.eventCanceled||(xl?fn.insertBefore(bt,xl):fn.appendChild(bt)),E(!0);var k=Sh(e,l.draggable);if(!k||c0(t,v,this)&&!k.animated){if(k===bt)return E(!1);if(k&&e===t.target&&(n=k),n&&(o=hn(n)),mu(fn,e,bt,r,n,o,t,!!n)!==!1)return w(),k&&k.nextSibling?e.insertBefore(bt,k.nextSibling):e.appendChild(bt),xn=e,I(),E(!0)}else if(k&&u0(t,v,this)){var F=ia(e,0,l,!0);if(F===bt)return E(!1);if(n=F,o=hn(n),mu(fn,e,bt,r,n,o,t,!1)!==!1)return w(),e.insertBefore(bt,F),xn=e,I(),E(!0)}else if(n.parentNode===e){o=hn(n);var N=0,V,Q=bt.parentNode!==e,L=!o0(bt.animated&&bt.toRect||r,n.animated&&n.toRect||o,v),se=v?"top":"left",Ce=mm(n,"top","top")||mm(bt,"top","top"),J=Ce?Ce.scrollTop:void 0;sa!==n&&(V=o[se],ed=!1,uu=!L&&l.invertSwap||Q),N=h0(t,n,o,v,L?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,uu,sa===n);var z;if(N!==0){var P=wn(bt);do P-=N,z=xn.children[P];while(z&&(Ft(z,"display")==="none"||z===si))}if(N===0||z===n)return E(!1);sa=n,Ja=N;var le=n.nextElementSibling,Ke=!1;Ke=N===1;var Pe=mu(fn,e,bt,r,n,o,t,Ke);if(Pe!==!1)return(Pe===1||Pe===-1)&&(Ke=Pe===1),Dh=!0,setTimeout(d0,30),w(),Ke&&!le?e.appendChild(bt):n.parentNode.insertBefore(bt,Ke?le:n),Ce&&_m(Ce,0,J-Ce.scrollTop),xn=bt.parentNode,V!==void 0&&!uu&&(cu=Math.abs(V-hn(n)[se])),I(),E(!0)}if(e.contains(bt))return E(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){gi(document,"mousemove",this._onTouchMove),gi(document,"touchmove",this._onTouchMove),gi(document,"pointermove",this._onTouchMove),gi(document,"dragover",Ol),gi(document,"mousemove",Ol),gi(document,"touchmove",Ol)},_offUpEvents:function(){var t=this.el.ownerDocument;gi(t,"mouseup",this._onDrop),gi(t,"touchend",this._onDrop),gi(t,"pointerup",this._onDrop),gi(t,"touchcancel",this._onDrop),gi(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(qr=wn(bt),Zs=wn(bt,n.draggable),Pr("drop",this,{evt:t}),xn=bt&&bt.parentNode,qr=wn(bt),Zs=wn(bt,n.draggable),Gt.eventCanceled){this._nulling();return}oa=!1,uu=!1,ed=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Fh(this.cloneId),Fh(this._dragStartId),this.nativeDraggable&&(gi(document,"drop",this),gi(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ja&&Ft(document.body,"user-select",""),Ft(bt,"transform",""),t&&(Qa&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),si&&si.parentNode&&si.parentNode.removeChild(si),(fn===xn||sr&&sr.lastPutMode!=="clone")&&Cn&&Cn.parentNode&&Cn.parentNode.removeChild(Cn),bt&&(this.nativeDraggable&&gi(bt,"dragend",this),Rh(bt),bt.style["will-change"]="",Qa&&!oa&&bn(bt,sr?sr.options.ghostClass:this.options.ghostClass,!1),bn(bt,this.options.chosenClass,!1),Sr({sortable:this,name:"unchoose",toEl:xn,newIndex:null,newDraggableIndex:null,originalEvent:t}),fn!==xn?(qr>=0&&(Sr({rootEl:xn,name:"add",toEl:xn,fromEl:fn,originalEvent:t}),Sr({sortable:this,name:"remove",toEl:xn,originalEvent:t}),Sr({rootEl:xn,name:"sort",toEl:xn,fromEl:fn,originalEvent:t}),Sr({sortable:this,name:"sort",toEl:xn,originalEvent:t})),sr&&sr.save()):qr!==ra&&qr>=0&&(Sr({sortable:this,name:"update",toEl:xn,originalEvent:t}),Sr({sortable:this,name:"sort",toEl:xn,originalEvent:t})),Gt.active&&((qr==null||qr===-1)&&(qr=ra,Zs=Za),Sr({sortable:this,name:"end",toEl:xn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Pr("nulling",this),fn=bt=xn=si=xl=Cn=su=Ks=Tl=Mo=Qa=qr=Zs=ra=Za=sa=Ja=sr=lu=Gt.dragged=Gt.ghost=Gt.clone=Gt.active=null,hu.forEach(function(t){t.checked=!0}),hu.length=Ah=kh=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":bt&&(this._onDragOver(t),a0(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,r=0,o=n.length,s=this.options;r<o;r++)e=n[r],Po(e,s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||p0(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(o,s){var l=r.children[s];Po(l,this.options.draggable,r,!1)&&(n[o]=l)},this),e&&this.captureAnimationState(),t.forEach(function(o){n[o]&&(r.removeChild(n[o]),r.appendChild(n[o]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Po(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var r=qa.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&xm(n)},destroy:function(){Pr("destroy",this);var t=this.el;t[hr]=null,gi(t,"mousedown",this._onTapStart),gi(t,"touchstart",this._onTapStart),gi(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(gi(t,"dragover",this),gi(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),du.splice(du.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ks){if(Pr("hideClone",this),Gt.eventCanceled)return;Ft(Cn,"display","none"),this.options.removeCloneOnHide&&Cn.parentNode&&Cn.parentNode.removeChild(Cn),Ks=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ks){if(Pr("showClone",this),Gt.eventCanceled)return;bt.parentNode==fn&&!this.options.group.revertClone?fn.insertBefore(Cn,bt):xl?fn.insertBefore(Cn,xl):fn.appendChild(Cn),this.options.group.revertClone&&this.animate(bt,Cn),Ft(Cn,"display",""),Ks=!1}}};function a0(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.cancelable&&a.preventDefault()}function mu(a,t,e,n,r,o,s,l){var u,p=a[hr],c=p.options.onMove,f;return window.CustomEvent&&!ys&&!Ya?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=t,u.from=a,u.dragged=e,u.draggedRect=n,u.related=r||t,u.relatedRect=o||hn(t),u.willInsertAfter=l,u.originalEvent=s,a.dispatchEvent(u),c&&(f=c.call(p,u,s)),f}function Rh(a){a.draggable=!1}function d0(){Dh=!1}function u0(a,t,e){var n=hn(ia(e.el,0,e.options,!0)),r=10;return t?a.clientX<n.left-r||a.clientY<n.top&&a.clientX<n.right:a.clientY<n.top-r||a.clientY<n.bottom&&a.clientX<n.left}function c0(a,t,e){var n=hn(Sh(e.el,e.options.draggable)),r=10;return t?a.clientX>n.right+r||a.clientX<=n.right&&a.clientY>n.bottom&&a.clientX>=n.left:a.clientX>n.right&&a.clientY>n.top||a.clientX<=n.right&&a.clientY>n.bottom+r}function h0(a,t,e,n,r,o,s,l){var u=n?a.clientY:a.clientX,p=n?e.height:e.width,c=n?e.top:e.left,f=n?e.bottom:e.right,m=!1;if(!s){if(l&&cu<p*r){if(!ed&&(Ja===1?u>c+p*o/2:u<f-p*o/2)&&(ed=!0),ed)m=!0;else if(Ja===1?u<c+cu:u>f-cu)return-Ja}else if(u>c+p*(1-r)/2&&u<f-p*(1-r)/2)return f0(t)}return m=m||s,m&&(u<c+p*o/2||u>f-p*o/2)?u>c+p/2?1:-1:0}function f0(a){return wn(bt)<wn(a)?1:-1}function p0(a){for(var t=a.tagName+a.className+a.src+a.href+a.textContent,e=t.length,n=0;e--;)n+=t.charCodeAt(e);return n.toString(36)}function m0(a){hu.length=0;for(var t=a.getElementsByTagName("input"),e=t.length;e--;){var n=t[e];n.checked&&hu.push(n)}}function vu(a){return setTimeout(a,0)}function Fh(a){return clearTimeout(a)}fu&&Ci(document,"touchmove",function(a){(Gt.active||oa)&&a.cancelable&&a.preventDefault()}),Gt.utils={on:Ci,off:gi,css:Ft,find:pm,is:function(t,e){return!!Po(t,e,t,!1)},extend:Q_,throttle:gm,closest:Po,toggleClass:bn,clone:xh,index:wn,nextTick:vu,cancelNextTick:Fh,detectDirection:wm,getChild:ia},Gt.get=function(a){return a[hr]},Gt.mount=function(){for(var a=arguments.length,t=new Array(a),e=0;e<a;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(Gt.utils=Qo(Qo({},Gt.utils),n.utils)),qa.mount(n)})},Gt.create=function(a,t){return new Gt(a,t)},Gt.version=q_;var Mn=[],td,Ph,Mh=!1,Nh,Lh,gu,id;function v0(){function a(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return a.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?Ci(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ci(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Ci(document,"touchmove",this._handleFallbackAutoScroll):Ci(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?gi(document,"dragover",this._handleAutoScroll):(gi(document,"pointermove",this._handleFallbackAutoScroll),gi(document,"touchmove",this._handleFallbackAutoScroll),gi(document,"mousemove",this._handleFallbackAutoScroll)),Am(),_u(),J_()},nulling:function(){gu=Ph=td=Mh=id=Nh=Lh=null,Mn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var r=this,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,l=document.elementFromPoint(o,s);if(gu=e,n||this.options.forceAutoScrollFallback||Ya||ys||ja){Hh(e,this.options,l,n);var u=qs(l,!0);Mh&&(!id||o!==Nh||s!==Lh)&&(id&&Am(),id=setInterval(function(){var p=qs(document.elementFromPoint(o,s),!0);p!==u&&(u=p,_u()),Hh(e,r.options,p,n)},10),Nh=o,Lh=s)}else{if(!this.options.bubbleScroll||qs(l,!0)===Jo()){_u();return}Hh(e,this.options,qs(l,!1),!1)}}},ho(a,{pluginName:"scroll",initializeByDefault:!0})}function _u(){Mn.forEach(function(a){clearInterval(a.pid)}),Mn=[]}function Am(){clearInterval(id)}var Hh=gm(function(a,t,e,n){if(t.scroll){var r=(a.touches?a.touches[0]:a).clientX,o=(a.touches?a.touches[0]:a).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,u=Jo(),p=!1,c;Ph!==e&&(Ph=e,_u(),td=t.scroll,c=t.scrollFn,td===!0&&(td=qs(e,!0)));var f=0,m=td;do{var v=m,_=hn(v),C=_.top,x=_.bottom,w=_.left,E=_.right,I=_.width,k=_.height,F=void 0,N=void 0,V=v.scrollWidth,Q=v.scrollHeight,L=Ft(v),se=v.scrollLeft,Ce=v.scrollTop;v===u?(F=I<V&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),N=k<Q&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(F=I<V&&(L.overflowX==="auto"||L.overflowX==="scroll"),N=k<Q&&(L.overflowY==="auto"||L.overflowY==="scroll"));var J=F&&(Math.abs(E-r)<=s&&se+I<V)-(Math.abs(w-r)<=s&&!!se),z=N&&(Math.abs(x-o)<=s&&Ce+k<Q)-(Math.abs(C-o)<=s&&!!Ce);if(!Mn[f])for(var P=0;P<=f;P++)Mn[P]||(Mn[P]={});(Mn[f].vx!=J||Mn[f].vy!=z||Mn[f].el!==v)&&(Mn[f].el=v,Mn[f].vx=J,Mn[f].vy=z,clearInterval(Mn[f].pid),(J!=0||z!=0)&&(p=!0,Mn[f].pid=setInterval(function(){n&&this.layer===0&&Gt.active._onTouchMove(gu);var le=Mn[this.layer].vy?Mn[this.layer].vy*l:0,Ke=Mn[this.layer].vx?Mn[this.layer].vx*l:0;typeof c=="function"&&c.call(Gt.dragged.parentNode[hr],Ke,le,a,gu,Mn[this.layer].el)!=="continue"||_m(Mn[this.layer].el,Ke,le)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&m!==u&&(m=qs(m,!1)));Mh=p}},30),km=function(t){var e=t.originalEvent,n=t.putSortable,r=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,l=t.hideGhostForTarget,u=t.unhideGhostForTarget;if(e){var p=n||o;l();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,f=document.elementFromPoint(c.clientX,c.clientY);u(),p&&!p.el.contains(f)&&(s("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function Bh(){}Bh.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=ia(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(e,r):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:km},ho(Bh,{pluginName:"revertOnSpill"});function Vh(){}Vh.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,r=n||this.sortable;r.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),r.animateAll()},drop:km},ho(Vh,{pluginName:"removeOnSpill"});var fo;function g0(){function a(){this.defaults={swapClass:"sortable-swap-highlight"}}return a.prototype={dragStart:function(e){var n=e.dragEl;fo=n},dragOverValid:function(e){var n=e.completed,r=e.target,o=e.onMove,s=e.activeSortable,l=e.changed,u=e.cancel;if(s.options.swap){var p=this.sortable.el,c=this.options;if(r&&r!==p){var f=fo;o(r)!==!1?(bn(r,c.swapClass,!0),fo=r):fo=null,f&&f!==fo&&bn(f,c.swapClass,!1)}l(),n(!0),u()}},drop:function(e){var n=e.activeSortable,r=e.putSortable,o=e.dragEl,s=r||this.sortable,l=this.options;fo&&bn(fo,l.swapClass,!1),fo&&(l.swap||r&&r.options.swap)&&o!==fo&&(s.captureAnimationState(),s!==n&&n.captureAnimationState(),_0(o,fo),s.animateAll(),s!==n&&n.animateAll())},nulling:function(){fo=null}},ho(a,{pluginName:"swap",eventProperties:function(){return{swapItem:fo}}})}function _0(a,t){var e=a.parentNode,n=t.parentNode,r,o;!e||!n||e.isEqualNode(t)||n.isEqualNode(a)||(r=wn(a),o=wn(t),e.isEqualNode(n)&&r<o&&o++,e.insertBefore(t,e.children[r]),n.insertBefore(a,n.children[o]))}var ti=[],Kr=[],nd,No,rd=!1,Mr=!1,la=!1,tn,od,bu;function b0(){function a(t){for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?Ci(document,"pointerup",this._deselectMultiDrag):(Ci(document,"mouseup",this._deselectMultiDrag),Ci(document,"touchend",this._deselectMultiDrag))),Ci(document,"keydown",this._checkKeyDown),Ci(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(r,o){var s="";ti.length&&No===t?ti.forEach(function(l,u){s+=(u?", ":"")+l.textContent}):s=o.textContent,r.setData("Text",s)}}}return a.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var n=e.dragEl;tn=n},delayEnded:function(){this.isMultiDrag=~ti.indexOf(tn)},setupClone:function(e){var n=e.sortable,r=e.cancel;if(this.isMultiDrag){for(var o=0;o<ti.length;o++)Kr.push(xh(ti[o])),Kr[o].sortableIndex=ti[o].sortableIndex,Kr[o].draggable=!1,Kr[o].style["will-change"]="",bn(Kr[o],this.options.selectedClass,!1),ti[o]===tn&&bn(Kr[o],this.options.chosenClass,!1);n._hideClone(),r()}},clone:function(e){var n=e.sortable,r=e.rootEl,o=e.dispatchSortableEvent,s=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ti.length&&No===n&&(Im(!0,r),o("clone"),s()))},showClone:function(e){var n=e.cloneNowShown,r=e.rootEl,o=e.cancel;this.isMultiDrag&&(Im(!1,r),Kr.forEach(function(s){Ft(s,"display","")}),n(),bu=!1,o())},hideClone:function(e){var n=this;e.sortable;var r=e.cloneNowHidden,o=e.cancel;this.isMultiDrag&&(Kr.forEach(function(s){Ft(s,"display","none"),n.options.removeCloneOnHide&&s.parentNode&&s.parentNode.removeChild(s)}),r(),bu=!0,o())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&No&&No.multiDrag._deselectMultiDrag(),ti.forEach(function(n){n.sortableIndex=wn(n)}),ti=ti.sort(function(n,r){return n.sortableIndex-r.sortableIndex}),la=!0},dragStarted:function(e){var n=this,r=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(r.captureAnimationState(),this.options.animation)){ti.forEach(function(s){s!==tn&&Ft(s,"position","absolute")});var o=hn(tn,!1,!0,!0);ti.forEach(function(s){s!==tn&&bm(s,o)}),Mr=!0,rd=!0}r.animateAll(function(){Mr=!1,rd=!1,n.options.animation&&ti.forEach(function(s){Th(s)}),n.options.sort&&Cu()})}},dragOver:function(e){var n=e.target,r=e.completed,o=e.cancel;Mr&&~ti.indexOf(n)&&(r(!1),o())},revert:function(e){var n=e.fromSortable,r=e.rootEl,o=e.sortable,s=e.dragRect;ti.length>1&&(ti.forEach(function(l){o.addAnimationState({target:l,rect:Mr?hn(l):s}),Th(l),l.fromRect=s,n.removeAnimationState(l)}),Mr=!1,C0(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(e){var n=e.sortable,r=e.isOwner,o=e.insertion,s=e.activeSortable,l=e.parentEl,u=e.putSortable,p=this.options;if(o){if(r&&s._hideClone(),rd=!1,p.animation&&ti.length>1&&(Mr||!r&&!s.options.sort&&!u)){var c=hn(tn,!1,!0,!0);ti.forEach(function(m){m!==tn&&(bm(m,c),l.appendChild(m))}),Mr=!0}if(!r)if(Mr||Cu(),ti.length>1){var f=bu;s._showClone(n),s.options.animation&&!bu&&f&&Kr.forEach(function(m){s.addAnimationState({target:m,rect:od}),m.fromRect=od,m.thisAnimationDuration=null})}else s._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,r=e.isOwner,o=e.activeSortable;if(ti.forEach(function(l){l.thisAnimationDuration=null}),o.options.animation&&!r&&o.multiDrag.isMultiDrag){od=ho({},n);var s=wl(tn,!0);od.top-=s.f,od.left-=s.e}},dragOverAnimationComplete:function(){Mr&&(Mr=!1,Cu())},drop:function(e){var n=e.originalEvent,r=e.rootEl,o=e.parentEl,s=e.sortable,l=e.dispatchSortableEvent,u=e.oldIndex,p=e.putSortable,c=p||this.sortable;if(n){var f=this.options,m=o.children;if(!la)if(f.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),bn(tn,f.selectedClass,!~ti.indexOf(tn)),~ti.indexOf(tn))ti.splice(ti.indexOf(tn),1),nd=null,Ka({sortable:s,rootEl:r,name:"deselect",targetEl:tn,originalEvent:n});else{if(ti.push(tn),Ka({sortable:s,rootEl:r,name:"select",targetEl:tn,originalEvent:n}),n.shiftKey&&nd&&s.el.contains(nd)){var v=wn(nd),_=wn(tn);if(~v&&~_&&v!==_){var C,x;for(_>v?(x=v,C=_):(x=_,C=v+1);x<C;x++)~ti.indexOf(m[x])||(bn(m[x],f.selectedClass,!0),ti.push(m[x]),Ka({sortable:s,rootEl:r,name:"select",targetEl:m[x],originalEvent:n}))}}else nd=tn;No=c}if(la&&this.isMultiDrag){if(Mr=!1,(o[hr].options.sort||o!==r)&&ti.length>1){var w=hn(tn),E=wn(tn,":not(."+this.options.selectedClass+")");if(!rd&&f.animation&&(tn.thisAnimationDuration=null),c.captureAnimationState(),!rd&&(f.animation&&(tn.fromRect=w,ti.forEach(function(k){if(k.thisAnimationDuration=null,k!==tn){var F=Mr?hn(k):w;k.fromRect=F,c.addAnimationState({target:k,rect:F})}})),Cu(),ti.forEach(function(k){m[E]?o.insertBefore(k,m[E]):o.appendChild(k),E++}),u===wn(tn))){var I=!1;ti.forEach(function(k){if(k.sortableIndex!==wn(k)){I=!0;return}}),I&&l("update")}ti.forEach(function(k){Th(k)}),c.animateAll()}No=c}(r===o||p&&p.lastPutMode!=="clone")&&Kr.forEach(function(k){k.parentNode&&k.parentNode.removeChild(k)})}},nullingGlobal:function(){this.isMultiDrag=la=!1,Kr.length=0},destroyGlobal:function(){this._deselectMultiDrag(),gi(document,"pointerup",this._deselectMultiDrag),gi(document,"mouseup",this._deselectMultiDrag),gi(document,"touchend",this._deselectMultiDrag),gi(document,"keydown",this._checkKeyDown),gi(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof la<"u"&&la)&&No===this.sortable&&!(e&&Po(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;ti.length;){var n=ti[0];bn(n,this.options.selectedClass,!1),ti.shift(),Ka({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},ho(a,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[hr];!n||!n.options.multiDrag||~ti.indexOf(e)||(No&&No!==n&&(No.multiDrag._deselectMultiDrag(),No=n),bn(e,n.options.selectedClass,!0),ti.push(e))},deselect:function(e){var n=e.parentNode[hr],r=ti.indexOf(e);!n||!n.options.multiDrag||!~r||(bn(e,n.options.selectedClass,!1),ti.splice(r,1))}},eventProperties:function(){var e=this,n=[],r=[];return ti.forEach(function(o){n.push({multiDragElement:o,index:o.sortableIndex});var s;Mr&&o!==tn?s=-1:Mr?s=wn(o,":not(."+e.options.selectedClass+")"):s=wn(o),r.push({multiDragElement:o,index:s})}),{items:W_(ti),clones:[].concat(Kr),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function C0(a,t){ti.forEach(function(e,n){var r=t.children[e.sortableIndex+(a?Number(n):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function Im(a,t){Kr.forEach(function(e,n){var r=t.children[e.sortableIndex+(a?Number(n):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function Cu(){ti.forEach(function(a){a!==tn&&a.parentNode&&a.parentNode.removeChild(a)})}Gt.mount(new v0),Gt.mount(Vh,Bh);const aa=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:b0,Sortable:Gt,Swap:g0,default:Gt},Symbol.toStringTag,{value:"Module"}));var zh;const yu=(zh=aa==null?void 0:Gt)!==null&&zh!==void 0?zh:aa;class y0{constructor(t,e,n){this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._gridColumns=[],this._gridUid="",this._reorderedColumns=[],this._subscriptions=[],this._defaults={dropPlaceHolderText:"Drop a column header here to group by the column",hideGroupSortIcons:!1,hideToggleAllButton:!1,toggleAllButtonText:"",toggleAllPlaceholderText:"Toggle all Groups"},this.columnsGroupBy=[],this.pluginName="DraggableGrouping",this._bindingEventService=new Fn,this._eventHandler=new Slick.EventHandler,this.onGroupChanged=new Slick.Event}get addonOptions(){return this._addonOptions}get dataView(){var t,e,n;return(n=(e=(t=this.grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get dropboxElement(){return this._dropzoneElm}get droppableInstance(){return this._droppableInstance}get sortableLeftInstance(){return this._sortableLeftInstance}get sortableRightInstance(){return this._sortableRightInstance}get eventHandler(){return this._eventHandler}get grid(){var t,e;return(e=(t=this._grid)!==null&&t!==void 0?t:this.sharedService.slickGrid)!==null&&e!==void 0?e:{}}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get gridUid(){var t,e;return this._gridUid||((e=(t=this.grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}init(t,e){var n,r,o,s,l,u;if(this._addonOptions={...this._defaults,...e},this._grid=t,t){if(this._gridUid=t.getUID(),this._gridColumns=t.getColumns(),this._dropzoneElm=t.getPreHeaderPanel(),this._dropzoneElm.classList.add("slick-dropzone"),!this._addonOptions.hideToggleAllButton){this._groupToggler=De("div",{className:"slick-group-toggle-all",title:(n=this._addonOptions.toggleAllPlaceholderText)!==null&&n!==void 0?n:"",style:{display:"none"}});const p=De("span",{className:"slick-group-toggle-all-icon"},this._groupToggler);this.gridOptions.enableTranslate&&this._addonOptions.toggleAllButtonTextKey&&(this._addonOptions.toggleAllButtonText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllButtonTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this.gridOptions.enableTranslate&&this._addonOptions.toggleAllPlaceholderTextKey&&(this._addonOptions.toggleAllPlaceholderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllPlaceholderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._groupToggler.title=(r=this._addonOptions.toggleAllPlaceholderText)!==null&&r!==void 0?r:"",this._addonOptions.toggleAllButtonText&&this._groupToggler.appendChild(De("span",{className:"slick-group-toggle-all-text",textContent:this._addonOptions.toggleAllButtonText||""})),this._dropzoneElm.appendChild(this._groupToggler),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuCollapseAllGroups",()=>this.toggleGroupToggler(p,!0,!1)),this.pubSubService.subscribe("onContextMenuExpandAllGroups",()=>this.toggleGroupToggler(p,!1,!1)))}this._dropzonePlaceholderElm=De("div",{className:"slick-draggable-dropzone-placeholder"},this._dropzoneElm),this.gridOptions.enableTranslate&&(!((o=this._addonOptions)===null||o===void 0)&&o.dropPlaceHolderTextKey)&&(this._addonOptions.dropPlaceHolderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.dropPlaceHolderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._dropzonePlaceholderElm.textContent=(u=(l=(s=this._addonOptions)===null||s===void 0?void 0:s.dropPlaceHolderText)!==null&&l!==void 0?l:this._defaults.dropPlaceHolderText)!==null&&u!==void 0?u:"",this.setupColumnDropbox(),this._eventHandler.subscribe(t.onHeaderCellRendered,(p,c)=>{var f;const m=c.node;if(!rh((f=c.column)===null||f===void 0?void 0:f.grouping)&&m&&(m.style.cursor="pointer",this._addonOptions.groupIconCssClass)){const v=De("span",{className:"slick-column-groupable"},m);this._addonOptions.groupIconCssClass&&v.classList.add(...this._addonOptions.groupIconCssClass.split(" "))}}),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuClearGrouping",()=>this.clearDroppedGroups()));for(const p of this._gridColumns){const c=p.field;t.updateColumnHeader(c)}}return this}dispose(){this.destroySortableInstances(),this.onGroupChanged.unsubscribe(),this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._bindingEventService.unbindAll(),en(document.querySelector(`.${this.gridUid} .slick-preheader-panel`))}clearDroppedGroups(){this.columnsGroupBy=[],this.updateGroupBy("clear-all");const t=this._dropzoneElm.querySelectorAll(".slick-dropped-grouping");for(const e of Array.from(t)){const n=this._dropzoneElm.querySelector(".slick-groupby-remove");n==null||n.remove(),e==null||e.remove()}this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")}destroySortableInstances(){var t,e,n,r;!((t=this._sortableLeftInstance)===null||t===void 0)&&t.el&&((e=this._sortableLeftInstance)===null||e===void 0||e.destroy()),!((n=this._sortableRightInstance)===null||n===void 0)&&n.el&&((r=this._sortableRightInstance)===null||r===void 0||r.destroy())}setAddonOptions(t){this._addonOptions={...this._addonOptions,...t}}setColumns(t){this._gridColumns=t}setDroppedGroups(t){this._dropzonePlaceholderElm.style.display="none";const e=Array.isArray(t)?t:[t];for(const n of e){const r=this.grid.getHeaderColumn(n);this.handleGroupByDrop(this._dropzoneElm,r)}}setupColumnReorder(t,e,n,r,o,s,l,u,p){this.destroySortableInstances();const c=t.getPreHeaderPanel(),f=c.querySelector(".slick-draggable-dropzone-placeholder"),m=c.querySelector(".slick-group-toggle-all"),v={animation:50,chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dataIdAttr:"data-id",group:{name:"shared",pull:"clone",put:!1},revertClone:!0,onStart:()=>{f&&(f.style.display="inline-block"),c.querySelectorAll(".slick-dropped-grouping").forEach(C=>C.style.display="none"),m&&(m.style.display="none")},onEnd:_=>{var C,x,w,E,I;c==null||c.classList.remove("slick-dropzone-hover"),(C=f==null?void 0:f.parentElement)===null||C===void 0||C.classList.remove("slick-dropzone-placeholder-hover");const k=c.querySelectorAll(".slick-dropped-grouping");if(k.forEach(Q=>Q.style.display="flex"),k.length&&(f&&(f.style.display="none"),m&&(m.style.display="inline-block")),!t.getEditorLock().commitCurrentEdit())return;const F=(w=(x=this.sortableLeftInstance)===null||x===void 0?void 0:x.toArray())!==null&&w!==void 0?w:[];if(e.length>1){const Q=(I=(E=this._sortableRightInstance)===null||E===void 0?void 0:E.toArray())!==null&&I!==void 0?I:[];for(const L of Q)F.push(L)}const N=[],V=t.getColumns();for(const Q of F)N.push(V[l(Q)]);r(N),p(t.onColumnsReordered,{grid:t}),_.stopPropagation(),o()}};return this._sortableLeftInstance=yu.create(document.querySelector(`.${t.getUID()} .slick-header-columns.slick-header-columns-left`),v),this._sortableRightInstance=yu.create(document.querySelector(`.${t.getUID()} .slick-header-columns.slick-header-columns-right`),v),{sortableLeftInstance:this._sortableLeftInstance,sortableRightInstance:this._sortableRightInstance}}addColumnGroupBy(t){this.columnsGroupBy.push(t),this.updateGroupBy("add-group")}addGroupByRemoveClickHandler(t,e,n,r){this._bindingEventService.bind(e,"click",()=>{const o=this._bindingEventService.boundedEvents.filter(s=>s.element===e);for(const s of o)this._bindingEventService.unbind(s.element,"click",s.listener);this.removeGroupBy(t,n,r)})}addGroupSortClickHandler(t,e){const{grouping:n,type:r}=t;this._bindingEventService.bind(e,"click",()=>{if(this.toggleGroupAll(t,!1),n){const o=n.sortAsc?Yi.desc:Yi.asc;n.comparer=(s,l)=>ea(r||"text",s.value,l.value,o,t,this.gridOptions),this.getGroupBySortIcon(e,!n.sortAsc),this.updateGroupBy("sort-group"),n.sortAsc=!n.sortAsc,this.grid.invalidate()}})}getGroupBySortIcon(t,e=!0){var n,r,o,s;e?this._addonOptions.sortAscIconCssClass?(t.classList.remove(...(r=(n=this._addonOptions.sortDescIconCssClass)===null||n===void 0?void 0:n.split(" "))!==null&&r!==void 0?r:""),t.classList.add(...this._addonOptions.sortAscIconCssClass.split(" "))):(t.classList.add("slick-groupby-sort-asc-icon"),t.classList.remove("slick-groupby-sort-desc-icon")):this._addonOptions.sortDescIconCssClass?(t.classList.remove(...(s=(o=this._addonOptions.sortAscIconCssClass)===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:""),t.classList.add(...this._addonOptions.sortDescIconCssClass.split(" "))):this._addonOptions.sortDescIconCssClass||(t.classList.add("slick-groupby-sort-desc-icon"),t.classList.remove("slick-groupby-sort-asc-icon"))}handleGroupByDrop(t,e){var n,r,o;const s=(n=e.getAttribute("data-id"))===null||n===void 0?void 0:n.replace(this._gridUid,"");let l=!0;for(const u of this.columnsGroupBy)u.id===s&&(l=!1);if(l){for(const u of this._gridColumns)if(u.id===s&&u.grouping&&!rh(u.grouping)){const p=e.querySelector(".slick-column-name"),c=De("div",{id:`${this._gridUid}_${u.id}_entry`,className:"slick-dropped-grouping",dataset:{id:`${u.id}`}});De("div",{className:"slick-dropped-grouping-title",style:{display:"inline-flex"},textContent:p?p.textContent:e.textContent},c);const f=De("div",{className:"slick-groupby-remove"});this._addonOptions.deleteIconCssClass&&f.classList.add(...this._addonOptions.deleteIconCssClass.split(" ")),this._addonOptions.deleteIconCssClass||f.classList.add("slick-groupby-remove-icon");let m;((r=this._addonOptions)===null||r===void 0?void 0:r.hideGroupSortIcons)!==!0&&u.sortable&&(((o=u.grouping)===null||o===void 0?void 0:o.sortAsc)===void 0&&(u.grouping.sortAsc=!0),m=De("div",{className:"slick-groupby-sort"},c),this.getGroupBySortIcon(m,u.grouping.sortAsc)),c.appendChild(f),c.appendChild(document.createElement("div")),t.appendChild(c),this._groupToggler&&this.columnsGroupBy.length===0&&this.toggleGroupAll(u),this.addColumnGroupBy(u),this.addGroupByRemoveClickHandler(u.id,f,e,c),m&&this.addGroupSortClickHandler(u,m)}this._groupToggler&&this.columnsGroupBy.length>0&&(this._groupToggler.style.display="inline-block")}}toggleGroupAll({grouping:t},e){var n;const r=(n=this._groupToggler)===null||n===void 0?void 0:n.querySelector(".slick-group-toggle-all-icon");e===!0||t!=null&&t.collapsed?(r==null||r.classList.add("collapsed"),r==null||r.classList.remove("expanded")):(r==null||r.classList.add("expanded"),r==null||r.classList.remove("collapsed"))}removeFromArray(t,e){if(Array.isArray(t)){const n=t.findIndex(r=>r.id===e.id);n>=0&&t.splice(n,1)}return t}removeGroupBy(t,e,n){n.remove();const r=[];this._gridColumns.forEach(o=>r[o.id]=o),this.removeFromArray(this.columnsGroupBy,r[t]),this.columnsGroupBy.length===0&&(this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")),this.updateGroupBy("remove-group")}addDragOverDropzoneListeners(){const t=this._dropzoneElm.querySelector(".slick-draggable-dropzone-placeholder");t&&this._dropzoneElm&&(this._bindingEventService.bind(t,"dragover",e=>e.preventDefault),this._bindingEventService.bind(t,"dragenter",()=>this._dropzoneElm.classList.add("slick-dropzone-hover")),this._bindingEventService.bind(t,"dragleave",()=>this._dropzoneElm.classList.remove("slick-dropzone-hover")))}setupColumnDropbox(){const t=this._dropzoneElm;this._droppableInstance=yu.create(t,{group:"shared",ghostClass:"slick-droppable-sortitem-hover",draggable:".slick-dropped-grouping",dragoverBubble:!0,onAdd:e=>{var n,r;const o=e.item;!((n=o.getAttribute("id"))===null||n===void 0)&&n.replace(this._gridUid,"")&&this.handleGroupByDrop(t,yu.utils.clone(e.item)),(r=o.parentNode)===null||r===void 0||r.removeChild(o)},onUpdate:()=>{var e,n;const r=(n=(e=this._droppableInstance)===null||e===void 0?void 0:e.toArray())!==null&&n!==void 0?n:[],o=[];for(const s of r)for(const l of this.columnsGroupBy)if(l.id===s){o.push(l);break}this.columnsGroupBy=o,this.updateGroupBy("sort-group")}}),this.addDragOverDropzoneListeners(),this._groupToggler&&this._bindingEventService.bind(this._groupToggler,"click",e=>{const n=e.target.classList.contains("slick-group-toggle-all-icon")?e.target:e.currentTarget.querySelector(".slick-group-toggle-all-icon");this.toggleGroupToggler(n,n==null?void 0:n.classList.contains("expanded"))})}toggleGroupToggler(t,e=!0,n=!0){t&&(e===!0?(t.classList.add("collapsed"),t.classList.remove("expanded"),n&&this.dataView.collapseAllGroups()):(t.classList.remove("collapsed"),t.classList.add("expanded"),n&&this.dataView.expandAllGroups()))}updateGroupBy(t){if(this.columnsGroupBy.length===0){this.dataView.setGrouping([]),this._dropzonePlaceholderElm.style.display="inline-block",this.triggerOnGroupChangedEvent({caller:t,groupColumns:[]});return}const e=[];this.columnsGroupBy.forEach(n=>e.push(n.grouping)),this.dataView.setGrouping(e),this._dropzonePlaceholderElm.style.display="none",this.triggerOnGroupChangedEvent({caller:t,groupColumns:e})}triggerOnGroupChangedEvent(t){this._addonOptions&&typeof this._addonOptions.onGroupChanged=="function"&&this._addonOptions.onGroupChanged(new Slick.EventData,t),this.onGroupChanged.notify(t)}}class Dm{constructor(){this._defaults={groupCssClass:"slick-group",groupTitleCssClass:"slick-group-title",totalsCssClass:"slick-group-totals",groupFocusable:!0,indentation:15,totalsFocusable:!1,toggleCssClass:"slick-group-toggle",toggleExpandedCssClass:"expanded",toggleCollapsedCssClass:"collapsed",enableExpandCollapse:!0,groupFormatter:this.defaultGroupCellFormatter.bind(this),totalsFormatter:this.defaultTotalsCellFormatter.bind(this),includeHeaderTotals:!1},this._eventHandler=new Slick.EventHandler,this._options=this._defaults}get eventHandler(){return this._eventHandler}get dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get grid(){return this._grid}init(t,e){this._grid=t,this._options={...this._defaults,...e},this._eventHandler.subscribe(t.onClick,this.handleGridClick.bind(this)),this._eventHandler.subscribe(t.onKeyDown,this.handleGridKeyDown.bind(this))}dispose(){var t;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll()}getOptions(){return this._options}setOptions(t){this._options={...this._options,...t}}getGroupRowMetadata(t){return{selectable:!1,focusable:this._options.groupFocusable,cssClasses:`${this._options.groupCssClass} slick-group-level-${(t==null?void 0:t.level)||0}`,formatter:this._options.includeHeaderTotals&&this._options.totalsFormatter,columns:{0:{colspan:this._options.includeHeaderTotals?"1":"*",formatter:this._options.groupFormatter,editor:null}}}}getTotalsRowMetadata(t){var e;return{selectable:!1,focusable:this._options.totalsFocusable,cssClasses:`${this._options.totalsCssClass} slick-group-level-${((e=t==null?void 0:t.group)===null||e===void 0?void 0:e.level)||0}`,formatter:this._options.totalsFormatter,editor:null}}defaultGroupCellFormatter(t,e,n,r,o){var s,l;if(!this._options.enableExpandCollapse)return o.title;const u=o.level||0,p=(l=(s=this._options)===null||s===void 0?void 0:s.indentation)!==null&&l!==void 0?l:15,c=`${u*p}px`,f=o.collapsed?this._options.toggleCollapsedCssClass:this._options.toggleExpandedCssClass;return`<span class="${this._options.toggleCssClass} ${f}" aria-expanded="${!o.collapsed}" style="margin-left: ${c}"></span><span class="${this._options.groupTitleCssClass}" level="${u}">${o.title||""}</span>`}defaultTotalsCellFormatter(t,e,n,r,o,s){var l,u;return(u=(l=r==null?void 0:r.groupTotalsFormatter)===null||l===void 0?void 0:l.call(r,o,r,s))!==null&&u!==void 0?u:""}handleGridClick(t,e){const n=t.target,r=this.grid.getDataItem(e.row);r instanceof Slick.Group&&n.classList.contains(this._options.toggleCssClass||"")&&(this.handleDataViewExpandOrCollapse(r),t.stopImmediatePropagation(),t.preventDefault())}handleGridKeyDown(t){if(this._options.enableExpandCollapse&&t.keyCode===li.SPACE){const e=this.grid.getActiveCell();if(e){const n=this.grid.getDataItem(e.row);n instanceof Slick.Group&&(this.handleDataViewExpandOrCollapse(n),t.stopImmediatePropagation(),t.preventDefault())}}}handleDataViewExpandOrCollapse(t){const e=this.grid.getRenderedRange();this.dataView.setRefreshHints({ignoreDiffsBefore:e.top,ignoreDiffsAfter:e.bottom+1}),t.collapsed?this.dataView.expandGroup(t.groupingKey):this.dataView.collapseGroup(t.groupingKey)}}class E0 extends eu{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._buttonElms=[],this._defaults={buttonCssClass:"slick-header-button"},this.pluginName="HeaderButtons",this._menuCssPrefix="slick-header-button",this._camelPluginName="headerButtons",this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this.init(n.gridOptions.headerButton)}get addonOptions(){return this._addonOptions}set addonOptions(t){this._addonOptions=t}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}init(t){this._addonOptions={...this._defaults,...t},this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns())}dispose(){super.dispose(),this._buttonElms.forEach(t=>t.remove())}handleHeaderCellRendered(t,e){var n;const r=e.column;if(!((n=r.header)===null||n===void 0)&&n.buttons&&Array.isArray(r.header.buttons)){let o=r.header.buttons.length;for(;o--;){const s=r.header.buttons[o],l=this.populateSingleCommandOrOptionItem("command",this.addonOptions,null,s,e,this.handleButtonClick.bind(this));l&&(this._buttonElms.push(l),e.node.appendChild(l))}}}handleBeforeHeaderCellDestroy(t,e){var n,r,o;if(!((n=e.column.header)===null||n===void 0)&&n.buttons&&(!((r=this._addonOptions)===null||r===void 0)&&r.buttonCssClass)){const l=(((o=this._addonOptions)===null||o===void 0?void 0:o.buttonCssClass)||"").replace(/(\s+)/g,".");l&&e.node.querySelectorAll(`.${l}`).forEach(u=>u.remove())}}handleButtonClick(t,e,n,r){var o;if(n.command&&!n.disabled){const s=n.command||"",l={grid:this.grid,column:r,button:n};s&&(l.command=s),typeof n.action=="function"&&!n.disabled&&n.action.call(this,t,l),s!==null&&!n.disabled&&(!((o=this._addonOptions)===null||o===void 0)&&o.onCommand)&&(this.pubSubService.publish("onHeaderButtonCommand",l),this._addonOptions.onCommand(t,l),r!=null&&r.id&&this.grid.updateColumnHeader(r.id))}t.preventDefault(),t.stopPropagation()}}class S0 extends eu{constructor(t,e,n,r,o){super(t,n,r),this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this._defaults={autoAlign:!0,autoAlignOffset:0,buttonCssClass:null,buttonImage:null,minWidth:100,hideColumnHideCommand:!1,hideSortCommands:!1,title:""},this.pluginName="HeaderMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-header-menu",this._camelPluginName="headerMenu",this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(this.sharedService.columnDefinitions),this.init(r.gridOptions.headerMenu)}init(t){this._addonOptions={...this._defaults,...t},this._eventHandler.subscribe(this.grid.onBeforeSetColumns,(e,n)=>{this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(n.newColumns)}),this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns()),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}dispose(){var t;super.dispose(),this._menuElm=this._menuElm||document.body.querySelector(`.slick-header-menu${this.gridUidSelector}`),(t=this._menuElm)===null||t===void 0||t.remove(),this._activeHeaderColumnElm=void 0}hideColumn(t){var e,n,r;if(!((n=(e=this.sharedService)===null||e===void 0?void 0:e.slickGrid)===null||n===void 0)&&n.getColumnIndex){const o=this.sharedService.slickGrid.getColumnIndex(t.id),s=this.sharedService.slickGrid.getColumns(),l=(r=this.sharedService.gridOptions.frozenColumn)!==null&&r!==void 0?r:-1;l>=0&&l>=o&&(this.sharedService.gridOptions.frozenColumn=l-1,this.sharedService.slickGrid.setOptions({frozenColumn:this.sharedService.gridOptions.frozenColumn}));const u=ih(s,o);this.sharedService.visibleColumns=u,this.sharedService.slickGrid.setColumns(u),this.pubSubService.publish("onHeaderMenuHideColumns",{columns:u,hiddenColumn:t})}}hideMenu(){var t,e;(t=this._menuElm)===null||t===void 0||t.remove(),this._menuElm=void 0,(e=this._activeHeaderColumnElm)===null||e===void 0||e.classList.remove("slick-header-column-active")}showMenu(t,e,n){var r,o,s;const l={grid:this.grid,column:e,menu:n};typeof t.stopPropagation=="function"&&(this.pubSubService.publish("onHeaderMenuBeforeMenuShow",l),typeof((r=this.addonOptions)===null||r===void 0?void 0:r.onBeforeMenuShow)=="function"&&((o=this.addonOptions)===null||o===void 0?void 0:o.onBeforeMenuShow(t,l))===!1)||(this._menuElm||(this._menuElm=De("div",{ariaExpanded:"true",className:"slick-header-menu",role:"menu",style:{minWidth:`${this.addonOptions.minWidth}px`}}),(s=this.grid.getContainerNode())===null||s===void 0||s.appendChild(this._menuElm)),en(this._menuElm),this.populateHeaderMenuCommandList(t,n,l))}translateHeaderMenu(){var t;!((t=this.sharedService.gridOptions)===null||t===void 0)&&t.headerMenu&&this.resetHeaderMenuTranslations(this.sharedService.visibleColumns)}handleHeaderCellRendered(t,e){var n;const r=e.column,o=(n=r.header)===null||n===void 0?void 0:n.menu;if(o&&e.node){if(!this.extensionUtility.runOverrideFunctionWhenExists(this.addonOptions.menuUsabilityOverride,e))return;const s=De("div",{className:"slick-header-menu-button",ariaLabel:"Header Menu"},e.node);this.addonOptions.buttonCssClass&&s.classList.add(...this.addonOptions.buttonCssClass.split(" ")),this.addonOptions.tooltip&&(s.title=this.addonOptions.tooltip),this._bindEventService.bind(s,"click",l=>this.showMenu(l,r,o))}}handleBeforeHeaderCellDestroy(t,e){var n;!((n=e.column.header)===null||n===void 0)&&n.menu&&e.node.querySelectorAll(".slick-header-menu-button").forEach(o=>o.remove())}handleBodyMouseDown(t){var e;(this._menuElm!==t.target&&!(!((e=this._menuElm)===null||e===void 0)&&e.contains(t.target))||t.target.className==="close")&&this.hideMenu()}handleMenuItemCommandClick(t,e,n,r){var o;if(n==="divider"||n.command&&(n.disabled||n.divider))return!1;const s={grid:this.grid,command:n.command,column:r,item:n};this.executeHeaderMenuInternalCommands(t,s),this.pubSubService.publish("onHeaderMenuCommand",s),typeof((o=this.addonOptions)===null||o===void 0?void 0:o.onCommand)=="function"&&this.addonOptions.onCommand(t,s),typeof n.action=="function"&&n.action.call(this,t,s),t.defaultPrevented||this.hideMenu(),t.preventDefault(),t.stopPropagation()}addHeaderMenuCustomCommands(t){const e=this.sharedService.gridOptions,n=e.headerMenu||{},r=ao(e);return Array.isArray(t)&&e.enableHeaderMenu&&t.forEach(o=>{var s,l,u;if(o&&!o.excludeFromHeaderMenu){o.header?o.header.menu||(o.header.menu={items:[]}):o.header={menu:{items:[]}};const p=(u=(l=(s=o==null?void 0:o.header)===null||s===void 0?void 0:s.menu)===null||l===void 0?void 0:l.items)!==null&&u!==void 0?u:[];let c=!1;n&&!n.hideFreezeColumnsCommand&&(c=!0,p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="freeze-columns")||p.push({iconCssClass:n.iconFreezeColumns||"fa fa-thumb-tack",titleKey:`${r}FREEZE_COLUMNS`,command:"freeze-columns",positionOrder:47})),n&&!n.hideColumnResizeByContentCommand&&this.sharedService.gridOptions.enableColumnResizeOnDoubleClick&&(c=!0,p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="column-resize-by-content")||p.push({iconCssClass:n.iconColumnResizeByContentCommand||"fa fa-arrows-h",titleKey:`${r}COLUMN_RESIZE_BY_CONTENT`,command:"column-resize-by-content",positionOrder:48})),c&&!p.some(f=>f!=="divider"&&f.positionOrder===49)&&p.push({divider:!0,command:"",positionOrder:49}),e.enableSorting&&o.sortable&&n&&!n.hideSortCommands&&(p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="sort-asc")||p.push({iconCssClass:n.iconSortAscCommand||"fa fa-sort-asc",titleKey:`${r}SORT_ASCENDING`,command:"sort-asc",positionOrder:50}),p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="sort-desc")||p.push({iconCssClass:n.iconSortDescCommand||"fa fa-sort-desc",titleKey:`${r}SORT_DESCENDING`,command:"sort-desc",positionOrder:51}),p.some(f=>f!=="divider"&&f.positionOrder===52)||p.push({divider:!0,command:"",positionOrder:52}),!n.hideClearSortCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="clear-sort")&&p.push({iconCssClass:n.iconClearSortCommand||"fa fa-unsorted",titleKey:`${r}REMOVE_SORT`,command:"clear-sort",positionOrder:54})),e.enableFiltering&&o.filterable&&n&&!n.hideFilterCommand&&!n.hideClearFilterCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="clear-filter")&&p.push({iconCssClass:n.iconClearFilterCommand||"fa fa-filter",titleKey:`${r}REMOVE_FILTER`,command:"clear-filter",positionOrder:53}),n&&!n.hideColumnHideCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="hide-column")&&p.push({iconCssClass:n.iconColumnHideCommand||"fa fa-times",titleKey:`${r}HIDE_COLUMN`,command:"hide-column",positionOrder:55}),this.extensionUtility.translateMenuItemsFromTitleKey(p),this.extensionUtility.sortItems(p,"positionOrder")}}),n}clearColumnFilter(t,e){e!=null&&e.column&&this.filterService.clearFilterByColumnId(t,e.column.id)}clearColumnSort(t,e){e!=null&&e.column&&this.sharedService&&this.sortService.clearSortByColumnId(t,e.column.id)}executeHeaderMenuInternalCommands(t,e){var n;if(e!=null&&e.command)switch(e.command){case"hide-column":this.hideColumn(e.column),!((n=this.sharedService.gridOptions)===null||n===void 0)&&n.enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"clear-filter":this.clearColumnFilter(t,e);break;case"clear-sort":this.clearColumnSort(t,e);break;case"column-resize-by-content":this.pubSubService.publish("onHeaderMenuColumnResizeByContent",{columnId:e.column.id});break;case"freeze-columns":const r=[...this.sharedService.visibleColumns],s={frozenColumn:r.findIndex(c=>c.id===e.column.id),enableMouseWheelScrollHandler:!0},l=this.sharedService.slickGrid.getColumns();this.sharedService.slickGrid.setOptions(s,!1,!0),this.sharedService.gridOptions.frozenColumn=s.frozenColumn,this.sharedService.gridOptions.enableMouseWheelScrollHandler=s.enableMouseWheelScrollHandler,this.sharedService.frozenVisibleColumnId=e.column.id,this.sharedService.hasColumnsReordered||Array.isArray(r)&&Array.isArray(this.sharedService.allColumns)&&r.length!==this.sharedService.allColumns.length?this.sharedService.slickGrid.setColumns(r):this.sharedService.slickGrid.setColumns(l),this.sharedService.slickGrid.getOptions().enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"sort-asc":case"sort-desc":const p=e.command==="sort-asc";this.sortColumn(t,e,p);break}}populateHeaderMenuCommandList(t,e,n){var r,o;this.populateCommandOrOptionItems("command",this.addonOptions,this._menuElm,e.items,n,this.handleMenuItemCommandClick),this.repositionMenu(t),this.pubSubService.publish("onHeaderMenuAfterMenuShow",n),!(typeof((r=this.addonOptions)===null||r===void 0?void 0:r.onAfterMenuShow)=="function"&&((o=this.addonOptions)===null||o===void 0?void 0:o.onAfterMenuShow(t,n))===!1)&&(t.preventDefault(),t.stopPropagation())}repositionMenu(t){var e,n,r,o,s,l,u,p;const c=t.target;if(this._menuElm&&c.classList.contains("slick-header-menu-button")){const f=x_(this.sharedService.gridContainerElement,c);let m=(e=f==null?void 0:f.left)!==null&&e!==void 0?e:0;if(this.addonOptions.autoAlign){const v=this.grid.getGridPosition();v!=null&&v.width&&m+((n=this._menuElm.clientWidth)!==null&&n!==void 0?n:0)>=v.width&&(m=m+c.clientWidth-this._menuElm.clientWidth+((o=(r=this.addonOptions)===null||r===void 0?void 0:r.autoAlignOffset)!==null&&o!==void 0?o:0))}this._menuElm.style.top=`${((s=f==null?void 0:f.top)!==null&&s!==void 0?s:0)+((u=(l=this.addonOptions)===null||l===void 0?void 0:l.menuOffsetTop)!==null&&u!==void 0?u:0)+c.clientHeight}px`,this._menuElm.style.left=`${m}px`,this._activeHeaderColumnElm=this._menuElm.closest(".slick-header-column"),(p=this._activeHeaderColumnElm)===null||p===void 0||p.classList.add("slick-header-column-active")}}resetHeaderMenuTranslations(t){t.forEach(e=>{var n,r;if(!((r=(n=e==null?void 0:e.header)===null||n===void 0?void 0:n.menu)===null||r===void 0)&&r.items&&!e.excludeFromHeaderMenu){const o=e.header.menu.items||[];this.extensionUtility.translateMenuItemsFromTitleKey(o)}})}sortColumn(t,e,n=!0){if(e!=null&&e.column){const r=e.column,o=this.sharedService.gridOptions.multiColumnSort?this.sortService.getCurrentColumnSorts(r.id+""):[];let s=Ji.local;o.push({columnId:r.id,sortCol:r,sortAsc:n}),this.sharedService.gridOptions.backendServiceApi?(this.sortService.onBackendSortChanged(t,{multiColumnSort:!0,sortCols:o,grid:this.sharedService.slickGrid}),s=Ji.remote):this.sharedService.dataView?(this.sortService.onLocalSortChanged(this.sharedService.slickGrid,o),s=Ji.local):e.grid.onSort.notify(o);const l=o.map(u=>{var p,c,f;return{columnId:(c=(p=u==null?void 0:u.sortCol)===null||p===void 0?void 0:p.id)!==null&&c!==void 0?c:"",sortAsc:(f=u==null?void 0:u.sortAsc)!==null&&f!==void 0?f:!0}});if(this.sharedService.slickGrid.setSortColumns(l),s){const u=[];l.forEach(p=>{u.push({columnId:`${p.columnId}`,direction:p.sortAsc?"ASC":"DESC"})}),this.sortService.emitSortChanged(s,u)}}}}class Rm{constructor(t){this.pubSubService=t,this._dragging=!1,this._handler=new Slick.EventHandler,this._defaults={autoScroll:!0,columnId:"_move",cssClass:"slick-row-move-column",cancelEditOnDrag:!1,disableRowSelection:!1,hideRowMoveShadow:!0,rowMoveShadowMarginTop:0,rowMoveShadowMarginLeft:0,rowMoveShadowOpacity:.9,rowMoveShadowScale:.75,singleRowMove:!1,width:40},this.onBeforeMoveRows=new Slick.Event,this.onMoveRows=new Slick.Event,this.pluginName="RowMoveManager",this._eventHandler=new Slick.EventHandler}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}init(t,e){var n;this._addonOptions={...this._defaults,...e},this._grid=t,this._canvas=this._grid.getCanvasNode(),typeof((n=this._addonOptions)===null||n===void 0?void 0:n.usabilityOverride)=="function"&&this.usabilityOverride(this._addonOptions.usabilityOverride),this._eventHandler.subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this))}dispose(){var t;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll()}create(t,e){var n,r;if(this._addonOptions={...this._defaults,...e.rowMoveManager},Array.isArray(t)&&e){const o=this.getColumnDefinition();if(!t.some(s=>s.id===o.id)){const s=Array.isArray(t)&&t.find(p=>(p==null?void 0:p.behavior)==="selectAndMove"),l=s||o,u=(r=(n=e==null?void 0:e.rowMoveManager)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:0;u>0?t.splice(u,0,l):t.unshift(l),this.pubSubService.publish("onPluginColumnsChanged",{columns:t,pluginName:this.pluginName})}}return this}getColumnDefinition(){var t,e;const n=String((e=(t=this._addonOptions)===null||t===void 0?void 0:t.columnId)!==null&&e!==void 0?e:this._defaults.columnId);return{id:n,name:"",behavior:"selectAndMove",cssClass:this._addonOptions.cssClass,excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,field:n,resizable:!1,selectable:!1,width:this._addonOptions.width||40,formatter:this.moveIconFormatter.bind(this)}}usabilityOverride(t){this._usabilityOverride=t}setOptions(t){this._addonOptions={...this._addonOptions,...t}}handleDragInit(t){t.stopImmediatePropagation()}handleDragEnd(t,e){var n,r,o;if(this._dragging&&(this._dragging=!1,t.stopImmediatePropagation(),(n=e.guide)===null||n===void 0||n.remove(),(r=e.selectionProxy)===null||r===void 0||r.remove(),(o=e.clonedSlickRow)===null||o===void 0||o.remove(),e.canMove)){const s={grid:this._grid,rows:e.selectedRows,insertBefore:e.insertBefore};typeof this._addonOptions.onMoveRows=="function"&&this._addonOptions.onMoveRows(t,s),this.onMoveRows.notify(s)}}handleDrag(t,e){var n,r,o,s,l,u;if(this._dragging){t.stopImmediatePropagation();const c=((r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t).pageY-((s=(o=qn(this._canvas))===null||o===void 0?void 0:o.top)!==null&&s!==void 0?s:0);e.selectionProxy.style.top=`${c-5}px`,e.selectionProxy.style.display="block",e.clonedSlickRow&&(e.clonedSlickRow.style.top=`${c-6}px`,e.clonedSlickRow.style.display="block");const f=Math.max(0,Math.min(Math.round(c/(this.gridOptions.rowHeight||0)),this._grid.getDataLength()));if(f!==e.insertBefore){const m={grid:this._grid,rows:e.selectedRows,insertBefore:f};if(((u=(l=this._addonOptions)===null||l===void 0?void 0:l.onBeforeMoveRows)===null||u===void 0?void 0:u.call(l,t,m))===!1||this.onBeforeMoveRows.notify(m).getReturnValue()===!1?e.canMove=!1:e.canMove=!0,this._usabilityOverride&&e.canMove){const v=this._grid.getDataItem(f);e.canMove=this.checkUsabilityOverride(f,v,this._grid)}e.canMove?e.guide.style.top=`${f*(this.gridOptions.rowHeight||0)}px`:e.guide.style.top="-1000px",e.insertBefore=f}}}handleDragStart(t,e){var n,r,o,s,l,u,p;const c=this._grid.getCellFromEvent(t)||{cell:-1,row:-1},f=c.row,m=this._grid.getDataItem(f);if(this.checkUsabilityOverride(f,m,this._grid)){if(this._addonOptions.cancelEditOnDrag&&this._grid.getEditorLock().isActive()&&this._grid.getEditorLock().cancelCurrentEdit(),this._grid.getEditorLock().isActive()||!/move|selectAndMove/.test(this._grid.getColumns()[c.cell].behavior||""))return!1;if(this._dragging=!0,t.stopImmediatePropagation(),!this.addonOptions.hideRowMoveShadow){const C=(n=this._grid.getCellNode(c.row,c.cell))===null||n===void 0?void 0:n.closest(".slick-row");C&&(e.clonedSlickRow=C.cloneNode(!0),e.clonedSlickRow.classList.add("slick-reorder-shadow-row"),e.clonedSlickRow.style.display="none",e.clonedSlickRow.style.marginLeft=Xs((r=this._addonOptions)===null||r===void 0?void 0:r.rowMoveShadowMarginLeft,"0px"),e.clonedSlickRow.style.marginTop=Xs((o=this._addonOptions)===null||o===void 0?void 0:o.rowMoveShadowMarginTop,"0px"),e.clonedSlickRow.style.opacity=`${(l=(s=this._addonOptions)===null||s===void 0?void 0:s.rowMoveShadowOpacity)!==null&&l!==void 0?l:.95}`,e.clonedSlickRow.style.transform=`scale(${(p=(u=this.addonOptions)===null||u===void 0?void 0:u.rowMoveShadowScale)!==null&&p!==void 0?p:.75})`,this._canvas.appendChild(e.clonedSlickRow))}let v=this._addonOptions.singleRowMove?[c.row]:this._grid.getSelectedRows();(v.length===0||!v.some(C=>C===c.row))&&(v=[c.row],this._addonOptions.disableRowSelection||this._grid.setSelectedRows(v));const _=this.gridOptions.rowHeight;e.selectedRows=v,e.selectionProxy=De("div",{className:"slick-reorder-proxy",style:{display:"none",position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,height:`${_*v.length}px`}},this._canvas),e.guide=De("div",{className:"slick-reorder-guide",style:{position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,top:"-1000px"}},this._canvas),e.insertBefore=-1}}checkUsabilityOverride(t,e,n){return typeof this._usabilityOverride=="function"?this._usabilityOverride(t,e,n):!0}moveIconFormatter(t,e,n,r,o,s){return this.checkUsabilityOverride(t,o,s)?{addClasses:"cell-reorder dnd",text:""}:""}}class w0{get extensionList(){return this._extensionList}get gridOptions(){return this.sharedService.gridOptions||{}}constructor(t,e,n,r,o,s,l){this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this.treeDataService=s,this.translaterService=l,this._extensionCreatedList={},this._extensionList={}}dispose(){var t;this.sharedService.visibleColumns=[];for(const e of Object.keys(this._extensionList))if(this._extensionList.hasOwnProperty(e)){const n=this._extensionList[e];!((t=n==null?void 0:n.instance)===null||t===void 0)&&t.dispose&&n.instance.dispose()}for(const e of Object.keys(this._extensionList))delete this._extensionList[e];this._cellMenuPlugin=null,this._cellExcelCopyManagerPlugin=null,this._checkboxSelectColumn=null,this._contextMenuPlugin=null,this._columnPickerControl=null,this._draggleGroupingPlugin=null,this._gridMenuControl=null,this._groupItemMetadataProviderService=null,this._headerMenuPlugin=null,this._rowMoveManagerPlugin=null,this._rowSelectionModel=null,this._extensionCreatedList=null,this._extensionList=null}addExtensionToList(t,e){this._extensionList[t]=e}getAllColumns(){return this.sharedService.allColumns||[]}getVisibleColumns(){return this.sharedService.visibleColumns||[]}getCreatedExtensionByName(t){var e;if(!((e=this._extensionCreatedList)===null||e===void 0)&&e.hasOwnProperty(t))return this._extensionCreatedList[t]}getExtensionByName(t){var e;return(e=this._extensionList)===null||e===void 0?void 0:e[t]}getExtensionInstanceByName(t){var e;return(e=this.getExtensionByName(t))===null||e===void 0?void 0:e.instance}autoResizeColumns(){this.sharedService.slickGrid.autosizeColumns()}bindDifferentExtensions(){var t,e,n,r,o,s,l,u,p,c,f;if(this.gridOptions){if(this.gridOptions.enableTranslate&&this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.gridOptions.enableAutoTooltip){const m=new F_((t=this.gridOptions)===null||t===void 0?void 0:t.autoTooltipOptions);this.sharedService.slickGrid.registerPlugin(m),this._extensionList[ni.autoTooltip]={name:ni.autoTooltip,instance:m}}if(this.gridOptions.enableExcelCopyBuffer&&(this._cellExcelCopyManagerPlugin=new P_,this._cellExcelCopyManagerPlugin.init(this.sharedService.slickGrid,this.sharedService.gridOptions.excelCopyBufferOptions),!((e=this.gridOptions.excelCopyBufferOptions)===null||e===void 0)&&e.onExtensionRegistered&&this.gridOptions.excelCopyBufferOptions.onExtensionRegistered(this._cellExcelCopyManagerPlugin),this._extensionList[ni.cellExternalCopyManager]={name:ni.cellExternalCopyManager,instance:this._cellExcelCopyManagerPlugin}),this.gridOptions.enableCellMenu&&(this._cellMenuPlugin=new L_(this.extensionUtility,this.pubSubService,this.sharedService),!((n=this.gridOptions.cellMenu)===null||n===void 0)&&n.onExtensionRegistered&&this.gridOptions.cellMenu.onExtensionRegistered(this._cellMenuPlugin),this._extensionList[ni.cellMenu]={name:ni.cellMenu,instance:this._cellMenuPlugin}),!this._rowSelectionModel&&(this.gridOptions.enableRowSelection||this.gridOptions.enableCheckboxSelector||this.gridOptions.enableRowDetailView||this.gridOptions.enableRowMoveManager)){if(!this._rowSelectionModel||!this.sharedService.slickGrid.getSelectionModel()){const m=(r=this.gridOptions.rowSelectionOptions)!==null&&r!==void 0?r:{};this.gridOptions.enableRowMoveManager&&((o=this.gridOptions.rowMoveManager)===null||o===void 0?void 0:o.dragToSelect)!==!1&&(m.dragToSelect=!0),this._rowSelectionModel=new _h(m),this.sharedService.slickGrid.setSelectionModel(this._rowSelectionModel)}this._extensionList[ni.rowSelection]={name:ni.rowSelection,instance:this._rowSelectionModel}}if(this.gridOptions.enableCheckboxSelector){this._checkboxSelectColumn=this._checkboxSelectColumn||new tm(this.pubSubService,this.gridOptions.checkboxSelector),this._checkboxSelectColumn.init(this.sharedService.slickGrid);const m=this.getCreatedExtensionByName(ni.checkboxSelector);m&&m.instance&&(this._extensionList[ni.checkboxSelector]={name:ni.checkboxSelector,instance:this._checkboxSelectColumn})}if(this.gridOptions.enableColumnPicker&&(this._columnPickerControl=new bh(this.extensionUtility,this.pubSubService,this.sharedService),!((s=this.gridOptions.columnPicker)===null||s===void 0)&&s.onExtensionRegistered&&this.gridOptions.columnPicker.onExtensionRegistered(this._columnPickerControl),this._extensionList[ni.columnPicker]={name:ni.columnPicker,instance:this._columnPickerControl}),this.gridOptions.enableContextMenu&&(this._contextMenuPlugin=new V_(this.extensionUtility,this.pubSubService,this.sharedService,this.treeDataService),!((l=this.gridOptions.contextMenu)===null||l===void 0)&&l.onExtensionRegistered&&this.gridOptions.contextMenu.onExtensionRegistered(this._contextMenuPlugin),this._extensionList[ni.contextMenu]={name:ni.contextMenu,instance:this._contextMenuPlugin}),this.gridOptions.enableDraggableGrouping&&(this._draggleGroupingPlugin&&(this._draggleGroupingPlugin.init(this.sharedService.slickGrid,this.gridOptions.draggableGrouping),!((u=this.gridOptions.draggableGrouping)===null||u===void 0)&&u.onExtensionRegistered&&this.gridOptions.draggableGrouping.onExtensionRegistered(this._draggleGroupingPlugin),this._extensionList[ni.contextMenu]={name:ni.contextMenu,instance:this._draggleGroupingPlugin}),this._extensionList[ni.draggableGrouping]={name:ni.draggableGrouping,instance:this._draggleGroupingPlugin}),this.gridOptions.enableGridMenu&&(this._gridMenuControl=new im(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),!((p=this.gridOptions.gridMenu)===null||p===void 0)&&p.onExtensionRegistered&&this.gridOptions.gridMenu.onExtensionRegistered(this._gridMenuControl),this._extensionList[ni.gridMenu]={name:ni.gridMenu,instance:this._gridMenuControl}),(this.gridOptions.enableDraggableGrouping||this.gridOptions.enableGrouping)&&(this._groupItemMetadataProviderService=this._groupItemMetadataProviderService?this._groupItemMetadataProviderService:new Dm,this._groupItemMetadataProviderService.init(this.sharedService.slickGrid),this._extensionList[ni.groupItemMetaProvider]={name:ni.groupItemMetaProvider,instance:this._groupItemMetadataProviderService}),this.gridOptions.enableHeaderButton){const m=new E0(this.extensionUtility,this.pubSubService,this.sharedService);!((c=this.gridOptions.headerButton)===null||c===void 0)&&c.onExtensionRegistered&&this.gridOptions.headerButton.onExtensionRegistered(m),this._extensionList[ni.headerButton]={name:ni.headerButton,instance:m}}if(this.gridOptions.enableHeaderMenu&&(this._headerMenuPlugin=new S0(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),!((f=this.gridOptions.headerMenu)===null||f===void 0)&&f.onExtensionRegistered&&this.gridOptions.headerMenu.onExtensionRegistered(this._headerMenuPlugin),this._extensionList[ni.headerMenu]={name:ni.headerMenu,instance:this._headerMenuPlugin}),this.gridOptions.enableRowMoveManager){this._rowMoveManagerPlugin=this._rowMoveManagerPlugin||new Rm(this.pubSubService),this._rowMoveManagerPlugin.init(this.sharedService.slickGrid,this.gridOptions.rowMoveManager);const m=this.getCreatedExtensionByName(ni.rowMoveManager);(m==null?void 0:m.instance)&&(this._extensionList[ni.rowMoveManager]={name:ni.rowMoveManager,instance:this._rowMoveManagerPlugin})}}}createExtensionsBeforeGridCreation(t,e){var n,r,o,s;const l=[];e.enableCheckboxSelector&&(this.getCreatedExtensionByName(ni.checkboxSelector)||(this._checkboxSelectColumn=new tm(this.pubSubService,this.sharedService.gridOptions.checkboxSelector),l.push({name:ni.checkboxSelector,extension:this._checkboxSelectColumn,columnIndexPosition:(r=(n=e==null?void 0:e.checkboxSelector)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:l.length}))),e.enableRowMoveManager&&(this.getCreatedExtensionByName(ni.rowMoveManager)||(this._rowMoveManagerPlugin=new Rm(this.pubSubService),l.push({name:ni.rowMoveManager,extension:this._rowMoveManagerPlugin,columnIndexPosition:(s=(o=e==null?void 0:e.rowMoveManager)===null||o===void 0?void 0:o.columnIndexPosition)!==null&&s!==void 0?s:l.length}))),this.createExtensionByTheirColumnIndex(l,t,e),e.enableDraggableGrouping&&(this.getCreatedExtensionByName(ni.draggableGrouping)||(this._draggleGroupingPlugin=new y0(this.extensionUtility,this.pubSubService,this.sharedService),this._draggleGroupingPlugin&&(e.enableColumnReorder=this._draggleGroupingPlugin.setupColumnReorder.bind(this._draggleGroupingPlugin),this._extensionCreatedList[ni.draggableGrouping]={name:ni.draggableGrouping,instance:this._draggleGroupingPlugin})))}hideColumn(t){var e,n;if(typeof((n=(e=this.sharedService)===null||e===void 0?void 0:e.slickGrid)===null||n===void 0?void 0:n.getColumns)=="function"){const r=this.sharedService.slickGrid.getColumnIndex(t.id);this.sharedService.visibleColumns=this.removeColumnByIndex(this.sharedService.slickGrid.getColumns(),r),this.sharedService.slickGrid.setColumns(this.sharedService.visibleColumns)}}refreshBackendDataset(t){this.extensionUtility.refreshBackendDataset(t)}removeColumnByIndex(t,e){return Array.isArray(t)?t.filter((n,r)=>e!==r):t}translateAllExtensions(){this.translateCellMenu(),this.translateColumnHeaders(),this.translateColumnPicker(),this.translateContextMenu(),this.translateGridMenu(),this.translateHeaderMenu()}translateCellMenu(){var t,e;(e=(t=this._cellMenuPlugin)===null||t===void 0?void 0:t.translateCellMenu)===null||e===void 0||e.call(t)}translateColumnPicker(){var t;!((t=this._columnPickerControl)===null||t===void 0)&&t.translateColumnPicker&&this._columnPickerControl.translateColumnPicker()}translateContextMenu(){var t,e;(e=(t=this._contextMenuPlugin)===null||t===void 0?void 0:t.translateContextMenu)===null||e===void 0||e.call(t)}translateGridMenu(){var t,e;(e=(t=this._gridMenuControl)===null||t===void 0?void 0:t.translateGridMenu)===null||e===void 0||e.call(t)}translateHeaderMenu(){var t,e;(e=(t=this._headerMenuPlugin)===null||t===void 0?void 0:t.translateHeaderMenu)===null||e===void 0||e.call(t)}translateColumnHeaders(t,e){var n,r,o;if(this.sharedService&&this.gridOptions&&this.gridOptions.enableTranslate&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');t&&(!((n=this.translaterService)===null||n===void 0)&&n.use)&&this.translaterService.use(t);let s=e;s||(s=this.sharedService.columnDefinitions),this.translateItems(s,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.renderColumnHeaders(s,Array.isArray(e)),(o=(r=this._gridMenuControl)===null||r===void 0?void 0:r.translateGridMenu)===null||o===void 0||o.call(r)}renderColumnHeaders(t,e=!1){var n;let r=t;r||(r=this.sharedService.columnDefinitions),Array.isArray(r)&&this.sharedService.slickGrid&&this.sharedService.slickGrid.setColumns&&((r.length>this.sharedService.allColumns.length||e)&&(this.sharedService.allColumns=r),this.sharedService.slickGrid.setColumns(r)),this.gridOptions.enableColumnPicker&&this._columnPickerControl&&(this._columnPickerControl.columns=this.sharedService.allColumns),this.gridOptions.enableGridMenu&&this._gridMenuControl&&(this._gridMenuControl.columns=(n=this.sharedService.allColumns)!==null&&n!==void 0?n:[],this._gridMenuControl.recreateGridMenu())}createExtensionByTheirColumnIndex(t,e,n){t.sort((r,o)=>r.columnIndexPosition-o.columnIndexPosition),t.forEach(r=>{const o=r.extension.create(e,n);o&&(this._extensionCreatedList[r.name]={name:r.name,instance:o})})}translateItems(t,e,n){var r,o,s;if(!((r=this.gridOptions)===null||r===void 0)&&r.enableTranslate&&!(!((o=this.translaterService)===null||o===void 0)&&o.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');if(Array.isArray(t))for(const l of t)l[e]&&(l[n]=(s=this.translaterService)===null||s===void 0?void 0:s.translate(l[e]))}}var Fm=Object.prototype.hasOwnProperty;function es(a,t){var e,n;if(a===t)return!0;if(a&&t&&(e=a.constructor)===t.constructor){if(e===Date)return a.getTime()===t.getTime();if(e===RegExp)return a.toString()===t.toString();if(e===Array){if((n=a.length)===t.length)for(;n--&&es(a[n],t[n]););return n===-1}if(!e||typeof a=="object"){n=0;for(e in a)if(Fm.call(a,e)&&++n&&!Fm.call(t,e)||!(e in t)||!es(a[e],t[e]))return!1;return Object.keys(t).length===n}}return a!==a&&t!==t}function Pm(a,t,e){if(e&&(a!=null&&a.hasOwnProperty(e)||t!=null&&t.hasOwnProperty(e)))return a[e]===t||a===t[e]||a[e]===t[e];for(const n in a)if(a.hasOwnProperty(n)&&a[n]!==t[n])return!1;return!0}function x0(a){switch(a&&a.toUpperCase()||""){case"IN":case"NIN":case"NOT_IN":case"IN_CONTAINS":case"NIN_CONTAINS":case"NOT_IN_CONTAINS":case"IN_COLLECTION":case"NOT_IN_COLLECTION":return!0;default:return!1}}const Es=(a,t,e)=>{switch(a.toUpperCase()){case"<":case"LT":return t<e;case"<=":case"LE":return t<=e;case">":case"GT":return t>e;case">=":case"GE":return t>=e;case"!=":case"<>":case"NE":return t!==e;case"=":case"==":case"EQ":return t===e;case"IN":return e&&Array.isArray(e)?e.includes(t):!1;case"NIN":case"NOT_IN":return e&&Array.isArray(e)?!e.includes(t):!1;case"IN_CONTAINS":return e&&Array.isArray(e)&&typeof t=="string"?e.some(n=>t.split(/[,]+/).map(r=>r.trim()).includes(n)):!1;case"NIN_CONTAINS":case"NOT_IN_CONTAINS":return e&&Array.isArray(e)&&typeof t=="string"?!e.some(n=>t.split(/[,]+/).map(r=>r.trim()).includes(n)):!1;case"IN_COLLECTION":return t&&e&&Array.isArray(t)&&Array.isArray(e)?e.some(n=>t.includes(n)):!1;case"NOT_IN_COLLECTION":return t&&e&&Array.isArray(t)&&Array.isArray(e)?!e.some(n=>t.includes(n)):!1}return!0},Mm=(a,t)=>{var e;let[n,r]=t;if(n===void 0&&!a.operator)return!0;a.cellValue=a.cellValue===void 0||a.cellValue===null?"":a.cellValue.toString();const o=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(a.cellValue,!0):a.cellValue.toLowerCase();if(typeof n=="string"&&(n=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(n,!0):n.toLowerCase()),typeof r=="string"&&(r=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(r,!0):r.toLowerCase()),n!==void 0&&r!==void 0){let l=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;l!==Lt.rangeInclusive&&l!==Lt.rangeExclusive&&(l=a.defaultFilterRangeOperator);const u=l===Lt.rangeInclusive,p=Uh(u?">=":">",o,n,a.searchInputLastChar),c=Uh(u?"<=":"<",o,r,a.searchInputLastChar);return p&&c}return Uh(a.operator,o,n,a.searchInputLastChar)};function T0(a){const t="",e=Array.isArray(a)&&a||[t],n=[];let r,o;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split("..");r=`${Array.isArray(s)?s[0]:""}`,o=`${Array.isArray(s)?s[1]:""}`}else{const s=Array.isArray(a)&&a.length>0?a[0]:"";r=s==null?"":`${s}`}return r!==void 0&&o!==void 0?n.push(r,o):r!==void 0&&n.push(r),n}function Uh(a,t,e,n){return a==="*"||a===Lt.endsWith||a==="*z"?t.endsWith(e):a===""&&n==="*"||a===Lt.startsWith||a==="a*"?t.startsWith(e):a===""||a===Lt.contains?t.indexOf(e)>-1:a==="<>"||a===Lt.notContains?t.indexOf(e)===-1:Es(a||"==",t,e)}const O0=(a,t)=>{if(t===void 0&&!a.operator)return!0;switch((a.operator||"").toUpperCase()){case"!=":case"<>":case"NE":return!Pm(a.cellValue,t,a.dataKey);case"=":case"==":case"EQ":default:return Pm(a.cellValue,t,a.dataKey)}};function A0(a){return(Array.isArray(a)&&a.length>0?a[0]:"")||""}const Nm=(a,t)=>{var e;const n=parseFloat(a.cellValue),[r,o]=t;if(r===void 0&&!a.operator)return!0;if(r!==void 0&&o!==void 0){let s=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;s!==Lt.rangeInclusive&&s!==Lt.rangeExclusive&&(s=a.defaultFilterRangeOperator);const l=s===Lt.rangeInclusive,u=Es(l?">=":">",n,+r),p=Es(l?"<=":"<",n,+o);return u&&p}return Es(a.operator||"==",n,+r)};function k0(a){const e=Array.isArray(a)&&a||[0],n=[];let r,o;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split("..");r=parseFloat(Array.isArray(s)?s[0]:""),o=parseFloat(Array.isArray(s)?s[1]:"")}else r=parseFloat(e[0]);return rr(r,!0)&&rr(o,!0)?n.push(r,o):rr(r,!0)&&n.push(r),n}const Lm=(a,t)=>Yd(a.cellValue)===Yd(t);function I0(a){const t=Array.isArray(a)&&a[0]||!1;return Yd(t)}const Hm=a=>{const t=a.operator;let e;return Array.isArray(a.cellValue)&&(t==="IN_COLLECTION"||t==="NOT_IN_COLLECTION")?e=a.cellValue.length?a.cellValue.map(n=>`${n}`):[]:e=a.cellValue===void 0||a.cellValue===null?"":`${a.cellValue}`,Es(t||"IN",e,a.searchTerms||[])},Eu=Ys||ms;function D0(a,t){var e;const n=a&&(a.filterSearchType||a.fieldType)||ie.dateIso,r=Fr(n),[o,s]=t,l=Eu(a.cellValue,r,!0);if(!o&&!s||!l.isValid())return!1;const u=r.toLowerCase().includes("h")?l.valueOf():l.clone().startOf("day").valueOf();if(o&&s){let c=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;c!==Lt.rangeInclusive&&c!==Lt.rangeExclusive&&(c=a.defaultFilterRangeOperator);const f=c===Lt.rangeInclusive,m=Es(f?">=":">",u,o.valueOf()),v=Es(f?"<=":"<",u,s.valueOf());return m&&v}const p=r.toLowerCase().includes("h")?o.valueOf():o.clone().startOf("day").valueOf();return Es(a.operator||"==",u,p)}function R0(a,t){const e=Array.isArray(a)&&a||[],n=t||ie.dateIso,r=Fr(n),o=[];if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split(".."),l=Array.isArray(s)&&s[0]||"",u=Array.isArray(s)&&s[1]||"",p=Eu(l,r,!0),c=Eu(u,r,!0);if(!p.isValid()||!c.isValid())return[];o.push(p,c)}else{const s=Eu(e[0],r,!0);if(!s.isValid())return[];o.push(s)}return o}const F0=(a,t)=>{if(x0(a.operator))return Hm(a);switch(Bm(a.filterSearchType||a.fieldType)){case"boolean":return Lm(a,t);case"date":return D0(a,t||[]);case"number":return Nm(a,t||[]);case"object":return O0(a,t);case"string":default:return Mm(a,t||[])}};function Su(a,t){const e=Bm(t);let n;switch(e){case"boolean":n=I0(a);break;case"date":n=R0(a,t);break;case"number":n=k0(a);break;case"object":n=A0(a);break;case"string":n=T0(a);break}return n}function Bm(a){switch(a){case ie.boolean:return"boolean";case ie.date:case ie.dateIso:case ie.dateUtc:case ie.dateTime:case ie.dateTimeIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateTimeShortIso:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeShortEuro:case ie.dateTimeEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeShortUs:case ie.dateTimeUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:return"date";case ie.integer:case ie.float:case ie.number:return"number";case ie.object:return"object";case ie.string:case ie.text:case ie.password:case ie.readonly:default:return"string"}}const Vm={executeFilterConditionTest:F0,booleanFilter:Lm,collectionSearchFilter:Hm,numberFilter:Nm,stringFilter:Mm,testFilter:Es};class P0{constructor(t,e,n,r,o){this.filterFactory=t,this.pubSubService=e,this.sharedService=n,this.backendUtilities=r,this.rxjs=o,this._isFilterFirstRender=!0,this._firstColumnIdRendered="",this._filtersMetadata=[],this._columnFilters={},this._isTreePresetExecuted=!1,this._previousFilters=[],this._onSearchChange=new Slick.Event,this._eventHandler=new Slick.EventHandler,this.rxjs&&(this.httpCancelRequests$=this.rxjs.createSubject())}get eventHandler(){return this._eventHandler}get isFilterFirstRender(){return this._isFilterFirstRender}get onSearchChange(){return this._onSearchChange}get _gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get _columnDefinitions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getColumns)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:[]}get _dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}addRxJsResource(t){this.rxjs=t}init(t){this._grid=t,this._gridOptions&&this._gridOptions.enableTreeData&&this._gridOptions.treeDataOptions&&this._grid.setSortColumns([{columnId:this._gridOptions.treeDataOptions.columnId,sortAsc:!0}])}dispose(){var t;this._eventHandler.unsubscribeAll(),this.httpCancelRequests$&&(!((t=this.rxjs)===null||t===void 0)&&t.isObservable(this.httpCancelRequests$))&&(this.httpCancelRequests$.next(),this.httpCancelRequests$.complete()),this.disposeColumnFilters(),this._onSearchChange=null}disposeColumnFilters(){if(this.removeAllColumnFiltersProperties(),Array.isArray(this._filtersMetadata)){let t=this._filtersMetadata.pop();for(;t;)t==null||t.destroy(),t=this._filtersMetadata.pop()}}bindBackendOnFilter(t){this._filtersMetadata=[],this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{n.column.id===this._firstColumnIdRendered&&(this._isFilterFirstRender=!1),this.addFilterTemplateToHeaderRow(n,this._isFilterFirstRender),this._firstColumnIdRendered===""&&(this._firstColumnIdRendered=n.column.id)}),this.subscribeToOnHeaderRowCellRendered(t),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,this.onBackendFilterChange.bind(this))}bindLocalOnFilter(t){this._filtersMetadata=[],this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid,dataView:this._dataView}),this._dataView.setFilter(this.customLocalFilter.bind(this)),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,async(e,n)=>{var r,o;const s=(r=n==null?void 0:n.clearFilterTriggered)!==null&&r!==void 0?r:!1;s||await this.emitFilterChanged(Ji.local,!0),((o=this._gridOptions)===null||o===void 0?void 0:o.enableTreeData)===!0&&(this._tmpPreFilteredData=this.preFilterTreeData(this._dataView.getItems(),this._columnFilters)),n.columnId!==null&&this._dataView.refresh(),s||await this.emitFilterChanged(Ji.local),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)}),this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{this.addFilterTemplateToHeaderRow(n)}),this.subscribeToOnHeaderRowCellRendered(t)}async clearFilterByColumnId(t,e){var n,r;await this.pubSubService.publish("onBeforeFilterClear",{columnId:e},0);const o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.backendServiceApi)!==null&&r!==void 0?r:!1,s=o?Ji.remote:Ji.local,l=Object.keys(this._columnFilters);let u;Array.isArray(l)&&(u=l.find(c=>c===`${e}`));const p=this._filtersMetadata.find(c=>c.columnDef.id===e);return p!=null&&p.clear&&p.clear(!0),o&&u!==void 0&&this.onBackendFilterChange(t,{grid:this._grid,columnFilters:this._columnFilters}),await this.emitFilterChanged(s),!0}async clearFilters(t=!0){var e,n,r,o,s;t&&await this.pubSubService.publish("onBeforeFilterClear",!0,0),this._filtersMetadata.forEach(u=>{u!=null&&u.clear&&u.clear(!1)}),this.removeAllColumnFiltersProperties(),Array.isArray(this._columnDefinitions)&&this._columnDefinitions.forEach(u=>{var p;!((p=u.filter)===null||p===void 0)&&p.searchTerms&&delete u.filter.searchTerms}),this._dataView&&this._grid&&(this._dataView.refresh(),this._grid.invalidate());const l=(e=this._gridOptions)===null||e===void 0?void 0:e.backendServiceApi;if(l&&t){const u={clearFilterTriggered:!0,shouldTriggerQuery:t,grid:this._grid,columnFilters:this._columnFilters},c=l.service.processOnFilterChanged(void 0,u),f=(o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.pagination)===null||r===void 0?void 0:r.totalItems)!==null&&o!==void 0?o:0;(s=this.backendUtilities)===null||s===void 0||s.executeBackendCallback(l,c,u,new Date,f,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:m=>this._previousFilters=this.extractBasicFilterDetails(m.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this)})}else this._previousFilters=this.extractBasicFilterDetails(this._columnFilters);t&&this.pubSubService.publish("onFilterCleared",!0)}customLocalFilter(t,e){var n,r,o,s,l,u;const p=e==null?void 0:e.grid,c=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.enableTreeData)!==null&&r!==void 0?r:!1,f=(o=e==null?void 0:e.columnFilters)!==null&&o!==void 0?o:{};let m;if(c&&this._gridOptions&&this._gridOptions.treeDataOptions){m=this._gridOptions.treeDataOptions;const v=(s=m.collapsedPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.COLLAPSED_PROP,_=(l=m.parentPropName)!==null&&l!==void 0?l:Xe.treeDataProperties.PARENT_PROP,C=(u=this._gridOptions.datasetIdPropertyName)!==null&&u!==void 0?u:"id";if(t[_]!==null){let x=this._dataView.getItemById(t[_]);for(;x;){if(x[v])return!1;x=this._dataView.getItemById(x[_])}}if(this._tmpPreFilteredData instanceof Set)return this._tmpPreFilteredData.has(t[C])}else if(typeof f=="object")for(const v of Object.keys(f)){const _=f[v],C=this.preProcessFilterConditionOnDataContext(t,_,p);if(typeof C=="boolean")return C;let x=_==null?void 0:_.parsedSearchTerms;if(x===void 0&&(x=Su(_.searchTerms,_.columnDef.type||ie.string),x!==void 0&&(_.parsedSearchTerms=x)),!Vm.executeFilterConditionTest(C,x))return!1}return!0}parseFormInputFilterConditions(t,e){var n,r,o,s;const l=uo(t)||[];let u=Array.isArray(l)&&l.length===1?l[0]:"";const p=e.columnDef,c=(o=(r=(n=p.filter)===null||n===void 0?void 0:n.type)!==null&&r!==void 0?r:p.type)!==null&&o!==void 0?o:ie.string;let f=null;c!==ie.object&&(u=u==null?"":`${u}`,f=((s=p.autoParseInputFilterOperator)!==null&&s!==void 0?s:this._gridOptions.autoParseInputFilterOperator)!==!1?u.match(/^([<>!=\*]{0,2})(.*[^<>!=\*])?([\*]?)$/):[u,"",u,""]);let m=(f==null?void 0:f[1])||e.operator;const v=(f==null?void 0:f[2])||"",_=(f==null?void 0:f[3])||(m==="*z"?"*":"");return typeof u=="string"&&(u=u.replace("'","''"),m==="*"||m==="*z"?m=Lt.endsWith:(m==="a*"||_==="*")&&(m=Lt.startsWith)),Array.isArray(f)&&f.length>=1&&Array.isArray(l)&&l.length===1&&(l[0]=v),{dataKey:p.dataKey,fieldType:c,searchTerms:l||[],operator:m,searchInputLastChar:_,filterSearchType:p.filterSearchType,defaultFilterRangeOperator:this._gridOptions.defaultFilterRangeOperator}}preProcessFilterConditionOnDataContext(t,e,n){var r,o,s,l,u,p;const c=e.columnDef,f=e.columnId;let m=n.getColumnIndex(f);if(!c&&this.sharedService&&Array.isArray(this.sharedService.allColumns)&&(m=this.sharedService.allColumns.findIndex(E=>E.field===f)),!c)return!0;if(this._gridOptions.enableRowDetailView){const E=this._gridOptions.rowDetailView&&this._gridOptions.rowDetailView.keyPrefix||"__";t[`${E}isPadding`]&&t[`${E}parent`]&&(t=t[`${E}parent`])}let v=((r=c.filter)===null||r===void 0?void 0:r.queryField)||c.queryFieldFilter||c.queryField||c.field||"";typeof c.queryFieldNameGetterFn=="function"&&(v=c.queryFieldNameGetterFn(t));const _=(l=(s=(o=c.filter)===null||o===void 0?void 0:o.type)!==null&&s!==void 0?s:c.type)!==null&&l!==void 0?l:ie.string;let C=t[v];(v==null?void 0:v.indexOf("."))>=0&&(C=_n(t,v));const x=e.operator,w=e.searchTerms||[];if(!w||Array.isArray(w)&&(w.length===0||w.length===1&&x===w[0]))return!0;if(w&&Array.isArray(w)&&_!==ie.object)for(let E=0,I=w.length;E<I;E++)w[E]=(w[E]===void 0||w[E]===null?"":w[E])+"";if(((u=c==null?void 0:c.params)===null||u===void 0?void 0:u.useFormatterOuputToFilter)===!0){const E=n.getData(),I=this._gridOptions.datasetIdPropertyName||"id",k=E&&typeof E.getIdxById=="function"?E.getIdxById(t[I]):0,F=c&&typeof c.formatter=="function"?c.formatter(k||0,m,C,c,t,this._grid):"";C=or(F)}return typeof C=="number"&&(C=C.toString()),{dataKey:c.dataKey,fieldType:_,searchTerms:w,cellValue:C,operator:x,searchInputLastChar:e.searchInputLastChar,filterSearchType:c.filterSearchType,ignoreAccentOnStringFilterAndSort:(p=this._gridOptions.ignoreAccentOnStringFilterAndSort)!==null&&p!==void 0?p:!1,defaultFilterRangeOperator:this._gridOptions.defaultFilterRangeOperator}}preFilterTreeData(t,e){var n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E,I,k,F;const N=(n=this._gridOptions)===null||n===void 0?void 0:n.treeDataOptions,V=(r=N==null?void 0:N.collapsedPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.COLLAPSED_PROP,Q=(o=N==null?void 0:N.parentPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.PARENT_PROP,L=(s=N==null?void 0:N.hasChildrenPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.HAS_CHILDREN_PROP,se=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.datasetIdPropertyName)!==null&&u!==void 0?u:"id",Ce=(c=(p=this._gridOptions.presets)===null||p===void 0?void 0:p.treeData)===null||c===void 0?void 0:c.toggledItems,J=(m=(f=this._gridOptions.treeDataOptions)===null||f===void 0?void 0:f.initiallyCollapsed)!==null&&m!==void 0?m:!1,z=(v=this._gridOptions.treeDataOptions)===null||v===void 0?void 0:v.columnId,P=(_=this._gridOptions.treeDataOptions)===null||_===void 0?void 0:_.excludeChildrenWhenFilteringTree,le=!P&&((C=this._gridOptions.treeDataOptions)===null||C===void 0?void 0:C.autoApproveParentItemWhenTreeColumnIsValid)===!0,Ke={},Pe=new Set,Oe=new Map;if(Array.isArray(t)){for(const ye of t)Ke[ye[se]]=ye,delete Ke[ye[se]].__used;for(const ye of Object.keys(e)){const Re=e[ye],ae=Re!=null&&Re.searchTerms?uo(Re.searchTerms):[],he=this.parseFormInputFilterConditions(ae,Re),Ne=Re.columnDef,ze=(E=(w=(x=Ne==null?void 0:Ne.filter)===null||x===void 0?void 0:x.type)!==null&&w!==void 0?w:Ne==null?void 0:Ne.type)!==null&&E!==void 0?E:ie.string,Be=Su(he.searchTerms,ze);Be!==void 0&&(Re.parsedSearchTerms=Be)}for(const ye of t){const Re=ye[L];let ae=!0;for(const he of Object.keys(e)){const Ne=e[he],ze=this.preProcessFilterConditionOnDataContext(ye,Ne,this._grid);if(ze){const Be=Ne==null?void 0:Ne.parsedSearchTerms,de=typeof ze=="boolean"?ze:Vm.executeFilterConditionTest(ze,Be);if(de&&le&&Re&&Ne.columnId===z){Oe.set(ye[se],!0);break}if(de||!P&&Oe.get(ye[Q])===!0){if(Re&&Ne.columnId===z&&Oe.set(ye[se],!0),de||!P&&Ne.columnId===z)continue}else Re&&Oe.get(ye[Q])!==!0&&Ne.columnId!==z&&Oe.set(ye[se],!1)}ae=!1}if(ae){Pe.add(ye[se]);let he=(I=Ke[ye[Q]])!==null&&I!==void 0?I:!1;const Ne=!J;for(!this._isTreePresetExecuted&&Array.isArray(Ce)&&Ce.some(ze=>ze.itemId===he.id&&ze.isCollapsed===Ne)&&(he[V]=Ne);he;)(k=he.__used)!==null&&k!==void 0||Pe.add(he[se]),Ke[he[se]].__used=!0,he=(F=Ke[he[Q]])!==null&&F!==void 0?F:!1}}}return this._isTreePresetExecuted=!0,Pe}getColumnFilters(){return this._columnFilters}getPreviousFilters(){return this._previousFilters}getFiltersMetadata(){return this._filtersMetadata}getCurrentLocalFilters(){var t,e;const n=[];if(this._columnFilters)for(const r of Object.keys(this._columnFilters)){const o=this._columnFilters[r],s={columnId:r||""},l=this.sharedService.allColumns.find(p=>p.id===s.columnId),u=(e=(t=l==null?void 0:l.filter)===null||t===void 0?void 0:t.emptySearchTermReturnAllValues)!==null&&e!==void 0?e:!0;o!=null&&o.searchTerms&&(s.searchTerms=o.searchTerms),o.operator&&(s.operator=o.operator),o.targetSelector&&(s.targetSelector=o.targetSelector),Array.isArray(s.searchTerms)&&s.searchTerms.length>0&&(!u||s.searchTerms[0]!=="")&&n.push(s)}return n}emitFilterChanged(t,e=!1){var n;const r=e?"onBeforeFilterChange":"onFilterChanged";if(t===Ji.remote&&(!((n=this._gridOptions)===null||n===void 0)&&n.backendServiceApi)){let o=[];const s=this._gridOptions.backendServiceApi.service;return s!=null&&s.getCurrentFilters&&(o=s.getCurrentFilters()),this.pubSubService.publish(r,o)}else if(t===Ji.local)return this.pubSubService.publish(r,this.getCurrentLocalFilters())}async onBackendFilterChange(t,e){var n,r,o,s;const l=e==null?void 0:e.shouldTriggerQuery;if(l&&await this.emitFilterChanged(Ji.remote,!0),!e||!e.grid)throw new Error('Something went wrong when trying to bind the "onBackendFilterChange(event, args)" function, it seems that "args" is not populated correctly');const u=this._gridOptions.backendServiceApi;if(!u||!u.process||!u.service)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');const p=new Date;if(u.preProcess&&u.preProcess(),l){const c=await u.service.processOnFilterChanged(t,e),f=(o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.pagination)===null||r===void 0?void 0:r.totalItems)!==null&&o!==void 0?o:0;(s=this.backendUtilities)===null||s===void 0||s.executeBackendCallback(u,c,e,p,f,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:m=>this._previousFilters=this.extractBasicFilterDetails(m.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this),httpCancelRequestSubject:this.httpCancelRequests$})}}populateColumnFilterSearchTermPresets(t){var e;return Array.isArray(t)&&(this._columnDefinitions.forEach(n=>{var r;!((r=n.filter)===null||r===void 0)&&r.searchTerms&&delete n.filter.searchTerms;const o=t.find(s=>s.columnId===n.id);o&&Array.isArray(o==null?void 0:o.searchTerms)&&(n.filter=n.filter||{},n.filter.operator=o.operator||n.filter.operator||"",n.filter.searchTerms=o.searchTerms)}),!((e=this._gridOptions)===null||e===void 0)&&e.enableTreeData&&this.refreshTreeDataFilters(),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)),this._columnDefinitions}refreshTreeDataFilters(t){var e,n,r,o;const s=(r=t??((n=(e=this._dataView)===null||e===void 0?void 0:e.getItems)===null||n===void 0?void 0:n.call(e)))!==null&&r!==void 0?r:[];this._dataView&&(!((o=this._gridOptions)===null||o===void 0)&&o.enableTreeData)&&s.length>0?(this._tmpPreFilteredData=this.preFilterTreeData(s,this._columnFilters),this._dataView.refresh()):s.length===0&&Array.isArray(this.sharedService.hierarchicalDataset)&&this.sharedService.hierarchicalDataset.length>0&&setTimeout(()=>this.refreshTreeDataFilters())}disableFilterFunctionality(t=!0,e=!0){const r=!this._gridOptions.enableFiltering;r!==t&&(e&&t&&this.clearFilters(),this.disableAllFilteringCommands(t),this._grid.setOptions({enableFiltering:r},!1,!0),this._grid.setHeaderRowVisibility(r),this._gridOptions.enableFiltering=!t,this.sharedService.gridOptions=this._gridOptions,this._grid.setColumns(this.sharedService.columnDefinitions))}resetToPreviousSearchFilters(){this.updateFilters(this._previousFilters,!1,!1,!1)}toggleFilterFunctionality(t=!0){const e=this._gridOptions.enableFiltering;this.disableFilterFunctionality(e,t)}toggleHeaderFilterRow(){var t,e;let n=(e=(t=this._gridOptions)===null||t===void 0?void 0:t.showHeaderRow)!==null&&e!==void 0?e:!1;n=!n,this._grid.setHeaderRowVisibility(n),n===!0&&this._grid.setColumns(this.sharedService.columnDefinitions)}setSortColumnIcons(t){this._grid&&Array.isArray(t)&&this._grid.setSortColumns(t)}async updateFilters(t,e=!0,n=!0,r=!1){var o,s;if(!this._filtersMetadata||this._filtersMetadata.length===0||!this._gridOptions||!this._gridOptions.enableFiltering)throw new Error('[Slickgrid-Universal] in order to use "updateFilters" method, you need to have Filterable Columns defined in your grid and "enableFiltering" set in your Grid Options');if(Array.isArray(t)){this.clearFilters(!1),t.forEach(p=>{var c;const f=this._filtersMetadata.find(m=>p.columnId===m.columnDef.id);if(p&&f){const m=p.operator||f.defaultOperator;this.updateColumnFilters(p.searchTerms,f.columnDef,m),f.setValues(p.searchTerms||[],m),(r||!((c=this._gridOptions)===null||c===void 0)&&c.enableTreeData)&&this.callbackSearchEvent(void 0,{columnDef:f.columnDef,operator:m,searchTerms:p.searchTerms,shouldTriggerQuery:!0,forceOnSearchChangeEvent:!0})}});const l=(o=this._gridOptions)===null||o===void 0?void 0:o.backendServiceApi,u=l?Ji.remote:Ji.local;if(e&&await this.emitFilterChanged(u,!0),this._dataView.refresh(),l){const p=l==null?void 0:l.service;p!=null&&p.updateFilters&&(p.updateFilters(t,!0),n&&((s=this.backendUtilities)===null||s===void 0||s.refreshBackendDataset(this._gridOptions)))}e&&await this.emitFilterChanged(u)}return!0}async updateSingleFilter(t,e=!0,n=!0){var r,o,s,l,u,p;const c=this.sharedService.allColumns.find(f=>f.id===t.columnId);if(c&&t.columnId){this._columnFilters={};const f=(o=(r=c.filter)===null||r===void 0?void 0:r.emptySearchTermReturnAllValues)!==null&&o!==void 0?o:!0;Array.isArray(t.searchTerms)&&(t.searchTerms.length>1||t.searchTerms.length===1&&(!f||t.searchTerms[0]!==""))&&(this._columnFilters[t.columnId]={columnId:t.columnId,operator:t.operator,searchTerms:t.searchTerms,columnDef:c,type:(s=c.type)!==null&&s!==void 0?s:ie.string});const m=(l=this._gridOptions)===null||l===void 0?void 0:l.backendServiceApi,v=m?Ji.remote:Ji.local;if(e&&await this.emitFilterChanged(v,!0),m){const _=m==null?void 0:m.service;_!=null&&_.updateFilters&&(_.updateFilters(this._columnFilters,!0),n&&((u=this.backendUtilities)===null||u===void 0||u.refreshBackendDataset(this._gridOptions)))}else this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid}),!((p=this._gridOptions)===null||p===void 0)&&p.enableTreeData&&this.refreshTreeDataFilters(),this._dataView.refresh();e&&await this.emitFilterChanged(v)}return!0}drawFilterTemplate(t,e){var n;let r;if(typeof e=="string"){if(r=document.querySelector(e),r===null)return null}else r=e;const o=typeof t=="string"?this.sharedService.allColumns.find(l=>l.id===t):t;if(((n=o==null?void 0:o.id)!==null&&n!==void 0?n:"")!=="selector"&&(o!=null&&o.filterable)){let l,u;const p=this.filterFactory.createFilter(o.filter);u=o&&o.filter&&o.filter.operator||p&&p.operator,this._columnFilters[o.id]?(l=this._columnFilters[o.id].searchTerms||void 0,u=this._columnFilters[o.id].operator||void 0):o.filter&&(l=o.filter.searchTerms||void 0,this.updateColumnFilters(l,o,u));const c={grid:this._grid,operator:u,searchTerms:l,columnDef:o,filterContainerElm:r,callback:this.callbackSearchEvent.bind(this)};return p&&(p.init(c),l&&p.setValues&&p.setValues(l,u)),p}return null}addFilterTemplateToHeaderRow(t,e=!0){var n;const r=t.column,o=(n=r==null?void 0:r.id)!==null&&n!==void 0?n:"";if(o!=="selector"&&(r!=null&&r.filterable)){let s,l;const u=this.filterFactory.createFilter(r.filter);l=r&&r.filter&&r.filter.operator||u&&u.operator,this._columnFilters[r.id]?(s=this._columnFilters[r.id].searchTerms||void 0,l=this._columnFilters[r.id].operator||void 0):r.filter&&(s=r.filter.searchTerms||void 0,this.updateColumnFilters(s,r,l));const p={grid:this._grid,operator:l,searchTerms:s,columnDef:r,filterContainerElm:this._grid.getHeaderRowColumn(o),callback:this.callbackSearchEvent.bind(this)};if(u){u.init(p,e);const c=this._filtersMetadata.findIndex(f=>u.columnDef.id===f.columnDef.id);c===-1?this._filtersMetadata.push(u):this._filtersMetadata[c]=u,s&&u.setValues&&u.setValues(s,l)}}}callbackSearchEvent(t,e){var n,r,o,s,l,u;if(e){const p=t!=null&&t.target?t.target.value:void 0,c=e.searchTerms&&Array.isArray(e.searchTerms)?e.searchTerms:p?[p]:void 0,f=e.columnDef||null,m=(n=f==null?void 0:f.id)!==null&&n!==void 0?n:"",v=(s=(o=(r=f==null?void 0:f.filter)===null||r===void 0?void 0:r.type)!==null&&o!==void 0?o:f==null?void 0:f.type)!==null&&s!==void 0?s:ie.string,_=e.operator||void 0,C=c&&Array.isArray(c),x=C&&c&&c.length,w={...this._columnFilters},E=(u=(l=f.filter)===null||l===void 0?void 0:l.emptySearchTermReturnAllValues)!==null&&u!==void 0?u:!0;let I;if(f&&m)if(!C||x===0||x===1&&Array.isArray(c)&&E&&c[0]==="")delete this._columnFilters[m];else{const V=`${m}`,Q={columnId:V,columnDef:f,parsedSearchTerms:[],type:v,targetSelector:O_(t==null?void 0:t.target)},L=this.parseFormInputFilterConditions(c,Q);Q.operator=_||L.operator||th(v),I=Su(L.searchTerms,v),I!==void 0&&(Q.parsedSearchTerms=I),Q.searchTerms=L.searchTerms||[],this._columnFilters[V]=Q}const k=t&&typeof t.isPropagationStopped!="function"?Slick.Utils.extend({},new Slick.EventData,t):t,F=t==null?void 0:t.key,N=t==null?void 0:t.keyCode;if(this._onSearchChange&&(e.forceOnSearchChangeEvent||F==="Enter"||N===li.ENTER||!es(w,this._columnFilters))){const V={clearFilterTriggered:e.clearFilterTriggered,shouldTriggerQuery:e.shouldTriggerQuery,columnId:m,columnDef:f,columnFilters:this._columnFilters,operator:_||th(v),searchTerms:c,parsedSearchTerms:I,grid:this._grid,target:t==null?void 0:t.target};this.pubSubService.publish("onBeforeSearchChange",V)===!1?this._gridOptions.resetFilterSearchValueAfterOnBeforeCancellation&&this.resetToPreviousSearchFilters():this._onSearchChange.notify(V,k)}}}disableAllFilteringCommands(t=!0){var e,n;const r=this._grid.getColumns();r.forEach(s=>{var l;!((l=s==null?void 0:s.header)===null||l===void 0)&&l.menu&&s.header.menu.items.forEach(u=>{u&&typeof u!="string"&&u.command==="clear-filter"&&(u.hidden=t)})});const o=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.gridMenu)===null||n===void 0?void 0:n.commandItems;return o&&o.forEach(s=>{if(s&&typeof s!="string"){const l=s.command;(l==="clear-filter"||l==="toggle-filter")&&(s.hidden=t)}}),r}extractBasicFilterDetails(t){const e=[];if(t&&typeof t=="object")for(const n of Object.keys(t)){const{operator:r,searchTerms:o}=t[`${n}`];e.push({columnId:n,operator:r,searchTerms:o})}return e}removeAllColumnFiltersProperties(){if(typeof this._columnFilters=="object")for(const t in this._columnFilters)t&&this._columnFilters[t]&&delete this._columnFilters[t]}subscribeToOnHeaderRowCellRendered(t){this._eventHandler.subscribe(t.onBeforeHeaderRowCellDestroy,(e,n)=>{var r;const o=this._filtersMetadata.find(s=>s.columnDef.id===n.column.id);(r=o==null?void 0:o.destroy)===null||r===void 0||r.call(o)})}updateColumnFilters(t,e,n){var r,o,s;const l=(s=(o=(r=e.filter)===null||r===void 0?void 0:r.type)!==null&&o!==void 0?o:e.type)!==null&&s!==void 0?s:ie.string,u=Su(t,l);t&&e&&(this._columnFilters[e.id]={columnId:e.id,columnDef:e,searchTerms:t,operator:n,parsedSearchTerms:u,type:l})}}let zm;const wu={skipError:!1,triggerEvent:!0},sd={highlightRow:!0,position:"top",resortGrid:!1,selectRow:!1,skipError:!1,triggerEvent:!0},Gh={highlightRow:!1,selectRow:!1,scrollRowIntoView:!1,skipError:!1,triggerEvent:!0},Um={autoResizeColumns:!0,triggerEvent:!0,hideFromColumnPicker:!1,hideFromGridMenu:!1};class M0{constructor(t,e,n,r,o,s,l){this.gridStateService=t,this.filterService=e,this.pubSubService=n,this.paginationService=r,this.sharedService=o,this.sortService=s,this.treeDataService=l}get _dataView(){var t;return((t=this._grid)===null||t===void 0?void 0:t.getData)&&this._grid.getData()}get _gridOptions(){var t;return!((t=this._grid)===null||t===void 0)&&t.getOptions?this._grid.getOptions():{}}dispose(){var t;(t=this._rowSelectionPlugin)===null||t===void 0||t.dispose()}init(t){this._grid=t}clearAllFiltersAndSorts(){this.sortService&&this.sortService.clearSorting&&this.sortService.clearSorting(!1),this.filterService&&this.filterService.clearFilters&&this.filterService.clearFilters()}clearPinning(t=!0){const e=[...this.sharedService.visibleColumns];this.sharedService.slickGrid.setOptions({frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1}),t&&Array.isArray(e)&&this.sharedService.slickGrid.setColumns(e)}setPinning(t,e=!0,n=!1,r=!0){kp(t)?this.clearPinning():(this.sharedService.slickGrid.setOptions(t,n,r),this.sharedService.gridOptions={...this.sharedService.gridOptions,...t}),e&&this.sharedService.slickGrid.autosizeColumns()}getAllColumnDefinitions(){return this.sharedService.allColumns}getVisibleColumnDefinitions(){return this.sharedService.visibleColumns}getColumnFromEventArguments(t){if(!t||!t.grid||!t.grid.getColumns||!t.grid.getDataItem)throw new Error("[Slickgrid-Universal] To get the column definition and data, we need to have these arguments passed as objects (row, cell, grid)");return{row:t.row,cell:t.cell,columnDef:t.grid.getColumns()[t.cell],dataContext:t.grid.getDataItem(t.row),dataView:this._dataView,grid:this._grid}}getDataItemByRowNumber(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error(`[Slickgrid-Universal] We could not find SlickGrid Grid object or it's "getDataItem" method`);return this._grid.getDataItem(t)}getItemRowMetadataToHighlight(t){return e=>{const n=this._dataView.getItem(e);let r={cssClasses:""};return typeof t=="function"&&(r=t(e)),r||(r={cssClasses:""}),n&&n._dirty&&(r.cssClasses=(r&&r.cssClasses||"")+" dirty"),n&&n.rowClass&&r&&(r.cssClasses+=` ${n.rowClass}`,r.cssClasses+=` row${e}`),r}}getDataItemByRowIndex(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');return this._grid.getDataItem(t)}getDataItemByRowIndexes(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');const e=[];return Array.isArray(t)&&t.forEach(n=>{e.push(this._grid.getDataItem(n))}),e}getSelectedRows(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');return this._grid.getSelectedRows()}getSelectedRowsDataItem(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');const t=this._grid.getSelectedRows();return this.getDataItemByRowIndexes(t)}hideColumnById(t,e){if(e={...Um,...e},this._grid&&this._grid.getColumns&&this._grid.setColumns){const n=this._grid.getColumns(),r=n.findIndex(o=>o.id===t);if(r>=0){const o=ih(n,r);this.sharedService.visibleColumns=o,this._grid.setColumns(o);const s=this.sharedService.allColumns.findIndex(l=>l.id===t);return s&&(e!=null&&e.hideFromColumnPicker&&(this.sharedService.allColumns[s].excludeFromColumnPicker=!0),e!=null&&e.hideFromGridMenu&&(this.sharedService.allColumns[s].excludeFromGridMenu=!0)),e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:o}),r}}return-1}hideColumnByIds(t,e){if(e={...Um,...e},Array.isArray(t)){for(const n of t)this.hideColumnById(n,{...e,triggerEvent:!1,autoResizeColumns:!1});e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:this.sharedService.visibleColumns})}}highlightRow(t,e=1500,n=300){this._grid.getSelectionModel()||(this._rowSelectionPlugin=new _h(this._gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionPlugin)),Array.isArray(t)?t.forEach(r=>this.highlightRowByMetadata(r,e,n)):this.highlightRowByMetadata(t,e,n)}highlightRowByMetadata(t,e=1500,n=300){this._dataView.getItemMetadata=this.getItemRowMetadataToHighlight(this._dataView.getItemMetadata);const r=this._dataView.getItem(t),o=this._gridOptions.datasetIdPropertyName||"id";(r==null?void 0:r[o])!==void 0&&(r.rowClass="highlight",this._dataView.updateItem(r[o],r),this.renderGrid(),clearTimeout(zm),zm=setTimeout(()=>{r.rowClass="highlight-end",this._dataView.updateItem(r[o],r),this.renderGrid()},n),setTimeout(()=>{(r==null?void 0:r[o])!==void 0&&(delete r.rowClass,this._dataView.getIdxById(r[o])!==void 0&&(this._dataView.updateItem(r[o],r),this.renderGrid()))},e+n))}setSelectedRow(t){var e;!((e=this._grid)===null||e===void 0)&&e.setSelectedRows&&this._grid.setSelectedRows([t])}setSelectedRows(t){var e;!((e=this._grid)===null||e===void 0)&&e.setSelectedRows&&this._grid.setSelectedRows(t)}renderGrid(){this._grid&&typeof this._grid.invalidate=="function"&&(this._grid.invalidate(),this._grid.render())}resetGrid(t){var e,n,r;if(this.clearPinning(!1),this._grid){const o=this.sharedService.allColumns||[];Array.isArray(o)&&o.length>0&&(this._grid.setColumns(o),!((e=this._gridOptions)===null||e===void 0)&&e.enableAutoSizeColumns&&this._grid.autosizeColumns(),this.gridStateService.resetColumns(t))}typeof((n=this.filterService)===null||n===void 0?void 0:n.clearFilters)=="function"&&this.filterService.clearFilters(),typeof((r=this.sortService)===null||r===void 0?void 0:r.clearSorting)=="function"&&this.sortService.clearSorting()}addItem(t,e){var n,r,o,s,l;const u={...sd,...e};if(!(u!=null&&u.skipError)&&(!this._grid||!this._gridOptions||!this._dataView))throw new Error("[Slickgrid-Universal] We could not find SlickGrid Grid, DataView objects");const p=this._gridOptions.datasetIdPropertyName||"id";if(!(u!=null&&u.skipError)&&(!t||!t.hasOwnProperty(p)))throw new Error(`[Slickgrid-Universal] Adding an item requires the item to include an "${p}" property`);if(!((n=this._gridOptions)===null||n===void 0)&&n.enableTreeData&&(e==null?void 0:e.position)==="top")throw new Error('[Slickgrid-Universal] Please note that `addItem({ position: "top" })` is not supported when used with Tree Data because of the extra complexity.');const c=(r=u==null?void 0:u.position)!==null&&r!==void 0?r:"top";c==="bottom"||!((o=this._gridOptions)===null||o===void 0)&&o.enableTreeData?this._dataView.addItem(t):this._dataView.insertItem(0,t);let f=0;const m=(s=t==null?void 0:t[p])!==null&&s!==void 0?s:"";return!((l=this._gridOptions)===null||l===void 0)&&l.enableTreeData?(this.invalidateHierarchicalDataset(),f=this._dataView.getRowById(m),this._grid.scrollRowIntoView(f??0,!1)):u.resortGrid?(this._dataView.reSort(),f=this._dataView.getRowById(m)):(f=c==="bottom"?this._dataView.getRowById(m):0,this._grid.scrollRowIntoView(f??0)),u.highlightRow&&f!==void 0&&this.highlightRow(f),f!==void 0&&u.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(f),u.triggerEvent&&this.pubSubService.publish("onItemAdded",t),!(this._gridOptions&&this._gridOptions.backendServiceApi)&&this._gridOptions.enablePagination&&(c==="top"?this.paginationService.goToFirstPage():this.paginationService.goToLastPage()),f}addItems(t,e){var n,r,o,s,l,u;e={...sd,...e};const p=this._gridOptions.datasetIdPropertyName||"id",c=(n=e==null?void 0:e.position)!==null&&n!==void 0?n:"top",f=[];if(Array.isArray(t))this._dataView.beginUpdate(!0),c==="bottom"||!((r=this._gridOptions)===null||r===void 0)&&r.enableTreeData?this._dataView.addItems(t):this._dataView.insertItems(0,t),this._dataView.endUpdate();else return[this.addItem(t,e)||0];if(!((o=this._gridOptions)===null||o===void 0)&&o.enableTreeData){this.invalidateHierarchicalDataset();const m=(l=(s=t[0])===null||s===void 0?void 0:s[p])!==null&&l!==void 0?l:"",v=this._dataView.getRowById(m);this._grid.scrollRowIntoView(v??0,!1)}else e.resortGrid&&this._dataView.reSort();return c==="bottom"&&!(!((u=this._gridOptions)===null||u===void 0)&&u.enableTreeData)?this._grid.navigateBottom():this._grid.navigateTop(),t.forEach(m=>f.push(this._dataView.getRowById(m[p]))),e.highlightRow&&this.highlightRow(f),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(f),e.triggerEvent&&this.pubSubService.publish("onItemAdded",t),f}deleteItem(t,e){e={...wu,...e};const n=this._gridOptions.datasetIdPropertyName||"id";if(!(e!=null&&e.skipError)&&(!t||!t.hasOwnProperty(n)))throw new Error(`[Slickgrid-Universal] Deleting an item requires the item to include an "${n}" property`);return this.deleteItemById(t[n],e)}deleteItems(t,e){e={...wu,...e};const n=this._gridOptions.datasetIdPropertyName||"id";if(!Array.isArray(t))return this.deleteItem(t,e),[t[n]];this._dataView.beginUpdate(!0);const r=[];return t.forEach(o=>{(o==null?void 0:o[n])!==void 0&&r.push(o[n])}),this._dataView.deleteItems(r),this._dataView.endUpdate(),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),r}deleteItemById(t,e){if(e={...wu,...e},!(e!=null&&e.skipError)&&t==null)throw new Error('[Slickgrid-Universal] Cannot delete a row without a valid "id"');return!(this.gridStateService&&this.gridStateService.needToPreserveRowSelection()||!1)&&this._grid&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows([]),this._dataView.deleteItem(t),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),t}deleteItemByIds(t,e){if(e={...wu,...e},Array.isArray(t)){this._dataView.beginUpdate(!0);for(let n=0;n<t.length;n++)t[n]!==null&&this.deleteItemById(t[n],{triggerEvent:!1});return this._dataView.endUpdate(),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),t}return[]}updateItem(t,e){e={...Gh,...e};const n=this._gridOptions.datasetIdPropertyName||"id",r=!t||!t.hasOwnProperty(n)?void 0:t[n];if(!(e!=null&&e.skipError)&&r===void 0)throw new Error(`[Slickgrid-Universal] Calling Update of an item requires the item to include an "${n}" property`);return this.updateItemById(r,t,e)}updateItems(t,e){var n;e={...Gh,...e};const r=this._gridOptions.datasetIdPropertyName||"id";if(!Array.isArray(t))return[this.updateItem(t,e)];this._dataView.beginUpdate(!0);const o=[],s=[];return t.forEach(l=>{const u=!l||!l.hasOwnProperty(r)?void 0:l[r];if(s.push(u),this._dataView.getIdxById(u)!==void 0){const p=this._dataView.getRowById(u);p!==void 0&&(o.push(p),this._grid.updateRow(p))}}),this._dataView.updateItems(s,t),this._dataView.endUpdate(),!((n=this._gridOptions)===null||n===void 0)&&n.enableTreeData&&this.invalidateHierarchicalDataset(),e.highlightRow&&this.highlightRow(o),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(o),e.triggerEvent&&this.pubSubService.publish("onItemUpdated",t),o}updateItemById(t,e,n){var r;if(n={...Gh,...n},!(n!=null&&n.skipError)&&t===void 0)throw new Error('[Slickgrid-Universal] Cannot update a row without a valid "id"');const o=this._dataView.getRowById(t);if(!(n!=null&&n.skipError)&&!e&&!this._gridOptions.enablePagination)throw new Error(`[Slickgrid-Universal] The item to update in the grid was not found with id: ${t}`);return this._dataView.getIdxById(t)!==void 0&&(this._dataView.updateItem(t,e),o!==void 0&&this._grid.updateRow(o),!((r=this._gridOptions)===null||r===void 0)&&r.enableTreeData&&this.invalidateHierarchicalDataset(),n.scrollRowIntoView&&o!==void 0&&this._grid.scrollRowIntoView(o),n.highlightRow&&o!==void 0&&this.highlightRow(o),o!==void 0&&n.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(o),n.triggerEvent&&this.pubSubService.publish("onItemUpdated",e)),o}upsertItem(t,e){e={...sd,...e};const n=this._gridOptions.datasetIdPropertyName||"id",r=!t||!t.hasOwnProperty(n)?void 0:t[n];if(!(e!=null&&e.skipError)&&r===void 0)throw new Error(`[Slickgrid-Universal] Calling Upsert of an item requires the item to include an "${n}" property`);return this.upsertItemById(r,t,e)}upsertItems(t,e){if(e={...sd,...e},!Array.isArray(t))return[this.upsertItem(t,e)];this._dataView.beginUpdate(!0);const n=[];t.forEach(o=>{n.push(this.upsertItem(o,{...e,highlightRow:!1,resortGrid:!1,selectRow:!1,triggerEvent:!1}))}),this._dataView.endUpdate();const r=n.map(o=>o.added!==void 0?o.added:o.updated);if(e.highlightRow&&this.highlightRow(r),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(r),e.triggerEvent){this.pubSubService.publish("onItemUpserted",t);const o=n.filter(l=>l.added!==void 0);Array.isArray(o)&&o.length>0&&this.pubSubService.publish("onItemAdded",o);const s=n.filter(l=>l.updated!==void 0);Array.isArray(s)&&s.length>0&&this.pubSubService.publish("onItemUpdated",s)}return n}upsertItemById(t,e,n){let r=!1;if(n={...sd,...n},!(n!=null&&n.skipError)&&t===void 0&&!this.hasRowSelectionEnabled())throw new Error('[Slickgrid-Universal] Calling Upsert of an item requires the item to include a valid and unique "id" property');let o,s;return this._dataView.getRowById(t)===void 0?(o=this.addItem(e,n),r=!0):(s=this.updateItem(e,{highlightRow:n.highlightRow,selectRow:n.selectRow,triggerEvent:n.triggerEvent}),r=!1),n.triggerEvent&&(this.pubSubService.publish("onItemUpserted",e),r?this.pubSubService.publish("onItemAdded",e):this.pubSubService.publish("onItemUpdated",e)),{added:o,updated:s}}invalidateHierarchicalDataset(t){var e;if(!((e=this._gridOptions)===null||e===void 0)&&e.enableTreeData&&this.treeDataService){const n=t??this._dataView.getItems(),r=this.treeDataService.convertFlatParentChildToTreeDatasetAndSort(n||[],this.sharedService.allColumns,this._gridOptions);this.sharedService.hierarchicalDataset=r.hierarchical,this.filterService.refreshTreeDataFilters(t),this._dataView.setItems(r.flat)}}hasRowSelectionEnabled(){const t=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&t}}class N0{get eventHandler(){return this._eventHandler}constructor(){this._eventHandler=new Slick.EventHandler}dispose(){this._eventHandler.unsubscribeAll()}bindOnBeforeEditCell(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onBeforeEditCell,(r,o)=>{if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const s=t.getColumns()[o.cell];if(typeof s.onBeforeEditCell=="function"){const l={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:s,dataContext:t.getDataItem(o.row)};s.onBeforeEditCell(r,l)}})}bindOnCellChange(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onCellChange,(r,o)=>{if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const s=t.getColumns()[o.cell];if(typeof s.onCellChange=="function"){const l={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:s,dataContext:t.getDataItem(o.row)};s.onCellChange(r,l)}})}bindOnClick(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onClick,(r,o)=>{var s;if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const l=(s=t.getColumns)===null||s===void 0?void 0:s.call(t)[o.cell];if(typeof l.onCellClick=="function"){const u={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:l,dataContext:t.getDataItem(o.row)};l.onCellClick(r,u)}})}}class L0{constructor(t,e,n,r,o,s){this.extensionService=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this.treeDataService=s,this._eventHandler=new Slick.EventHandler,this._columns=[],this._subscriptions=[],this._selectedRowIndexes=[],this._selectedRowDataContextIds=[],this._wasRecheckedAfterPageChange=!0}get _dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get _gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get selectedRowDataContextIds(){return this._selectedRowDataContextIds}set selectedRowDataContextIds(t){this._selectedRowDataContextIds=t}init(t){this._grid=t,this.subscribeToAllGridChanges(t)}dispose(){this._columns=[],this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}changeColumnsArrangement(t,e=!0,n=!1){var r,o,s,l,u,p,c,f,m;if(Array.isArray(t)&&t.length>0){const v=this.getAssociatedGridColumns(this._grid,t);if(v&&Array.isArray(v)&&v.length>0){if(Array.isArray(this.sharedService.allColumns)){const _=[];if(this._gridOptions.enableCheckboxSelector){const C=(s=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.checkboxSelector)===null||o===void 0?void 0:o.columnIndexPosition)!==null&&s!==void 0?s:0;_.push({columnId:"_checkbox_selector",columnIndexPosition:C})}if(this._gridOptions.enableRowDetailView){const C=(p=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.rowDetailView)===null||u===void 0?void 0:u.columnIndexPosition)!==null&&p!==void 0?p:0;_.push({columnId:"_detail_selector",columnIndexPosition:C})}if(this._gridOptions.enableRowMoveManager){const C=(m=(f=(c=this._gridOptions)===null||c===void 0?void 0:c.rowMoveManager)===null||f===void 0?void 0:f.columnIndexPosition)!==null&&m!==void 0?m:0;_.push({columnId:"_move",columnIndexPosition:C})}this.addColumnDynamicWhenFeatureEnabled(_,this.sharedService.allColumns,v)}v.forEach(_=>_.originalWidth=_.width||_.originalWidth),this._grid.setColumns(v),this.sharedService.visibleColumns=v,e?this._grid.autosizeColumns():(n||this._gridOptions.enableAutoResizeColumnsByCellContent&&!this._gridOptions.autosizeColumnsByCellContentOnFirstLoad)&&this.pubSubService.publish("onFullResizeByContentRequested",{caller:"GridStateService"})}}}getCurrentGridState(){var t;const{frozenColumn:e,frozenRow:n,frozenBottom:r}=this.sharedService.gridOptions,o={columns:this.getCurrentColumns(),filters:this.getCurrentFilters(),sorters:this.getCurrentSorters(),pinning:{frozenColumn:e,frozenRow:n,frozenBottom:r}},s=this.getCurrentPagination();if(s&&(o.pagination=s),this.hasRowSelectionEnabled()){const l=this.getCurrentRowSelections();l&&(o.rowSelection=l)}if(!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData){const l=this.getCurrentTreeDataToggleState();l&&(o.treeData=l)}return o}getColumns(){return this._columns}getAssociatedCurrentColumns(t){const e=[];return t&&Array.isArray(t)&&t.forEach(n=>{n!=null&&n.id&&e.push({columnId:n.id,cssClass:n.cssClass||"",headerCssClass:n.headerCssClass||"",width:n.width||0})}),e}getAssociatedGridColumns(t,e){const n=[],r=this.sharedService.allColumns||t.getColumns();return e&&Array.isArray(e)&&e.forEach(o=>{const s=r.find(l=>l.id===o.columnId);s!=null&&s.id&&n.push({...s,cssClass:o.cssClass||s.cssClass,headerCssClass:o.headerCssClass||s.headerCssClass,width:o.width})}),this._columns=n,n}getCurrentColumns(){return this.getAssociatedCurrentColumns(this._grid.getColumns()||[])}getCurrentFilters(){var t,e;if(!((t=this._gridOptions)===null||t===void 0)&&t.backendServiceApi){const n=this._gridOptions.backendServiceApi.service;if(n!=null&&n.getCurrentFilters)return n.getCurrentFilters()}else if(!((e=this.filterService)===null||e===void 0)&&e.getCurrentLocalFilters)return this.filterService.getCurrentLocalFilters();return null}getCurrentPagination(){var t;if(!((t=this._gridOptions)===null||t===void 0)&&t.enablePagination)if(this._gridOptions.backendServiceApi){const e=this._gridOptions.backendServiceApi.service;if(e!=null&&e.getCurrentPagination)return e.getCurrentPagination()}else return this.sharedService.currentPagination;return null}getCurrentRowSelections(){return this._grid&&this._dataView&&this.hasRowSelectionEnabled()?{gridRowIndexes:this._grid.getSelectedRows()||[],dataContextIds:this._dataView.getAllSelectedIds()||[],filteredDataContextIds:this._dataView.getAllSelectedFilteredIds()||[]}:null}getCurrentSorters(){var t,e;if(!((t=this._gridOptions)===null||t===void 0)&&t.backendServiceApi){const n=this._gridOptions.backendServiceApi.service;if(n!=null&&n.getCurrentSorters)return n.getCurrentSorters()}else if(!((e=this.sortService)===null||e===void 0)&&e.getCurrentLocalSorters)return this.sortService.getCurrentLocalSorters();return null}getCurrentTreeDataToggleState(){var t;return!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData&&this.treeDataService?this.treeDataService.getCurrentToggleState():null}needToPreserveRowSelection(){var t;let e=!1;if(!((t=this._gridOptions)===null||t===void 0)&&t.dataView&&this._gridOptions.dataView.hasOwnProperty("syncGridSelection")){const n=this._gridOptions.dataView.syncGridSelection;typeof n=="boolean"?e=this._gridOptions.dataView.syncGridSelection:typeof n=="object"&&(e=n.preserveHidden||n.preserveHiddenOnSelectionChange),e&&this._gridOptions.backendServiceApi&&this._gridOptions.dataView.hasOwnProperty("syncGridSelectionWithBackendService")&&(e=this._gridOptions.dataView.syncGridSelectionWithBackendService)}return e}resetColumns(t){const e=t||this._columns,n=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:n,type:ur.columns},gridState:this.getCurrentGridState()})}resetToOriginalColumns(t=!0){this._grid.setColumns(this.sharedService.allColumns),this.sharedService.visibleColumns=this.sharedService.allColumns,t&&this._grid.autosizeColumns()}resetRowSelectionWhenRequired(){var t,e;if(!this.needToPreserveRowSelection()&&(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)){const n=(e=(t=this.extensionService)===null||t===void 0?void 0:t.getExtensionByName)===null||e===void 0?void 0:e.call(t,ni.rowSelection);n!=null&&n.instance&&this._grid.setSelectedRows([])}}subscribeToAllGridChanges(t){this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:ur.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.sorter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:ur.sorter},gridState:this.getCurrentGridState()})})),this.bindExtensionAddonEventToGridStateChange(ni.columnPicker,"onColumnsChanged"),this.bindExtensionAddonEventToGridStateChange(ni.gridMenu,"onColumnsChanged"),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsReordered",t),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsResized",t),this.bindSlickGridOnSetOptionsEventToGridStateChange(t),(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,(e,n)=>{const r=(this._selectedRowIndexes||[]).slice(),o=(this.selectedRowDataContextIds||[]).slice();if(this.selectedRowDataContextIds=n.filteredIds,this._selectedRowIndexes=n.rows,!es(this.selectedRowDataContextIds,o)||!es(this._selectedRowIndexes,r)){const s={gridRowIndexes:this._selectedRowIndexes||[],dataContextIds:n.selectedRowIds,filteredDataContextIds:n.filteredIds};this.pubSubService.publish("onGridStateChanged",{change:{newValues:s,type:ur.rowSelection},gridState:this.getCurrentGridState()})}}),this._subscriptions.push(this.pubSubService.subscribe("onHeaderMenuHideColumns",e=>{const n=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:n,type:ur.columns},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeItemToggled",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.treeData},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeFullToggleEnd",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.treeData},gridState:this.getCurrentGridState()})}))}addColumnDynamicWhenFeatureEnabled(t,e,n){t.sort((r,o)=>r.columnIndexPosition-o.columnIndexPosition),t.forEach(r=>{const o=e.findIndex(l=>l.id===r.columnId),s=n.findIndex(l=>l.id===r.columnId);if(o>=0&&s===-1){const l=e[o];o===0?n.unshift(l):n.splice(o,0,l)}})}bindExtensionAddonEventToGridStateChange(t,e){var n,r,o;const s=(r=(n=this.extensionService)===null||n===void 0?void 0:n.getExtensionByName)===null||r===void 0?void 0:r.call(n,t),l=(o=s==null?void 0:s.instance)===null||o===void 0?void 0:o[e];l&&typeof l.subscribe=="function"&&this._eventHandler.subscribe(l,(u,p)=>{const c=p==null?void 0:p.columns,f=this.getAssociatedCurrentColumns(c);this.pubSubService.publish("onGridStateChanged",{change:{newValues:f,type:ur.columns},gridState:this.getCurrentGridState()})})}bindSlickGridColumnChangeEventToGridStateChange(t,e){const n=e==null?void 0:e[t];n&&typeof n.subscribe=="function"&&this._eventHandler.subscribe(n,()=>{const r=e.getColumns(),o=this.getAssociatedCurrentColumns(r);this.pubSubService.publish("onGridStateChanged",{change:{newValues:o,type:ur.columns},gridState:this.getCurrentGridState()})})}bindSlickGridOnSetOptionsEventToGridStateChange(t){const e=t.onSetOptions;this._eventHandler.subscribe(e,(n,r)=>{const{frozenBottom:o,frozenColumn:s,frozenRow:l}=r.optionsBefore,{frozenBottom:u,frozenColumn:p,frozenRow:c}=r.optionsAfter;if(o!==u||s!==p||l!==c){const f={frozenBottom:u,frozenColumn:p,frozenRow:c},m=this.getCurrentGridState();this.pubSubService.publish("onGridStateChanged",{change:{newValues:f,type:ur.pinning},gridState:m})}})}hasRowSelectionEnabled(){const t=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&t}}class H0{constructor(t,e){this.extensionUtility=t,this.pubSubService=e,this._subscriptions=[],this._eventHandler=new Slick.EventHandler}get _dataView(){var t;return((t=this._grid)===null||t===void 0?void 0:t.getData)&&this._grid.getData()}get eventHandler(){return this._eventHandler}get _gridOptions(){var t;return!((t=this._grid)===null||t===void 0)&&t.getOptions?this._grid.getOptions():{}}get _columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}init(t){if(this._grid=t,t&&this._gridOptions&&this._gridOptions.createPreHeaderPanel){this._gridOptions.enableTranslate&&this.translateGroupingAndColSpan(),this._eventHandler.subscribe(t.onSort,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onRendered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onAutosizeColumns,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onColumnsResized,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onColumnsReordered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(this._dataView.onRowCountChanged,()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this._subscriptions.push(this.pubSubService.subscribe("onColumnPickerColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onHeaderMenuHideColumns",()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this.pubSubService.subscribe("onGridMenuColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onGridMenuMenuClose",()=>this.renderPreHeaderRowGroupingTitles()));const e=t.getPluginByName("Resizer");e!=null&&e.onGridAfterResize&&this._eventHandler.subscribe(e.onGridAfterResize,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onSetOptions,(n,r)=>{var o,s;((o=r==null?void 0:r.optionsBefore)===null||o===void 0?void 0:o.frozenColumn)!==((s=r==null?void 0:r.optionsAfter)===null||s===void 0?void 0:s.frozenColumn)&&this.delayRenderPreHeaderRowGroupingTitles(0)}),this.delayRenderPreHeaderRowGroupingTitles(75)}}dispose(){this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}delayRenderPreHeaderRowGroupingTitles(t=0){setTimeout(()=>this.renderPreHeaderRowGroupingTitles(),t)}renderPreHeaderRowGroupingTitles(){var t;if(this._gridOptions&&this._gridOptions.frozenColumn!==void 0&&this._gridOptions.frozenColumn>=0){let e=this._grid.getPreHeaderPanelLeft();this.renderHeaderGroups(e,0,this._gridOptions.frozenColumn+1),e=this._grid.getPreHeaderPanelRight(),this.renderHeaderGroups(e,((t=this._gridOptions)===null||t===void 0?void 0:t.frozenColumn)+1,this._columnDefinitions.length)}else{const e=this._grid.getPreHeaderPanel();this.renderHeaderGroups(e,0,this._columnDefinitions.length)}}renderHeaderGroups(t,e,n){var r,o,s;en(t),t.className="slick-header-columns",t.style.left="-1000px",t.style.width=`${this._grid.getHeadersWidth()}px`,t.parentElement&&t.parentElement.classList.add("slick-header");const l=this._grid.getHeaderColumnWidthDiff();let u,p=null,c="",f=0;const m=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.frozenHeaderWidthCalcDifferential)!==null&&o!==void 0?o:0,v=((s=this._gridOptions)===null||s===void 0?void 0:s.frozenColumn)!==void 0&&this._gridOptions.frozenColumn>=0;for(let _=e;_<n;_++)u=this._columnDefinitions[_],u&&(c===u.columnGroup&&_>0?(f+=u.width||0,p!=null&&p.style&&(p.style.width=`${f-l-m}px`)):(f=u.width||0,p=De("div",{className:`ui-state-default slick-header-column ${v?"frozen":""}`,style:{width:`${f-l}px`}}),De("span",{className:"slick-column-name",textContent:u.columnGroup||""},p),t.appendChild(p)),c=u.columnGroup||"")}translateGroupingAndColSpan(){const t=this._grid.getColumns();this.extensionUtility.translateItems(t,"columnGroupKey","columnGroup"),this._grid.setColumns(t),this.renderPreHeaderRowGroupingTitles()}}class B0{constructor(t,e,n,r){this.pubSubService=t,this.sharedService=e,this.backendUtilities=n,this.rxjs=r,this._eventHandler=new Slick.EventHandler,this._initialized=!1,this._isLocalGrid=!0,this._dataFrom=1,this._dataTo=1,this._itemsPerPage=0,this._pageCount=1,this._pageNumber=1,this._totalItems=0,this._availablePageSizes=[],this._subscriptions=[]}get dataView(){var t,e,n;return(n=(e=(t=this.grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}set paginationOptions(t){this._paginationOptions=t}get paginationOptions(){return this._paginationOptions}get availablePageSizes(){return this._availablePageSizes}get dataFrom(){return this._dataFrom}get dataTo(){return this._dataTo}get itemsPerPage(){return this._itemsPerPage}get pageCount(){return this._pageCount}get pageNumber(){return this._pageNumber}get totalItems(){return this._totalItems}set totalItems(t){this._totalItems=t,this._initialized&&this.refreshPagination()}addRxJsResource(t){this.rxjs=t}init(t,e,n){if(this._availablePageSizes=e.pageSizes,this.grid=t,this._backendServiceApi=n,this._paginationOptions=e,this._isLocalGrid=!n,this._pageNumber=e.pageNumber||1,n&&(!n.service||!n.process))throw new Error('BackendServiceApi requires the following 2 properties "process" and "service" to be defined.');this._isLocalGrid&&this.dataView&&(this._eventHandler.subscribe(this.dataView.onPagingInfoChanged,(o,s)=>{this._totalItems!==s.totalRows&&(this.updateTotalItems(s.totalRows),this._previousPagination={pageNumber:s.pageNum,pageSize:s.pageSize,pageSizes:this.availablePageSizes,totalItems:s.totalRows})}),setTimeout(()=>{this.dataView&&(this.dataView.setRefreshHints({isFilterUnchanged:!0}),this.dataView.setPagingOptions({pageSize:this.paginationOptions.pageSize,pageNum:this._pageNumber-1}))})),this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",()=>this.resetPagination())),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>this.resetPagination())),this.dataView&&(this._subscriptions.push(this.pubSubService.subscribe("onItemAdded",o=>this.processOnItemAddedOrRemoved(o,!0))),this._subscriptions.push(this.pubSubService.subscribe("onItemDeleted",o=>this.processOnItemAddedOrRemoved(o,!1)))),this.refreshPagination(!1,!1,!0);const r=this.getFullPagination();this._previousPagination={pageNumber:r.pageNumber,pageSize:r.pageSize,pageSizes:r.pageSizes,totalItems:this.totalItems},this._initialized=!0}dispose(){this._initialized=!1,this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}getCurrentPagination(){return{pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes}}getFullPagination(){return{pageCount:this._pageCount,pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes,totalItems:this._totalItems,dataFrom:this._dataFrom,dataTo:this._dataTo}}getCurrentPageNumber(){return this._pageNumber}getCurrentItemPerPage(){return this._itemsPerPage}changeItemPerPage(t,e,n=!0){return this._pageNumber=1,this._pageCount=Math.ceil(this._totalItems/t),this._itemsPerPage=t,n?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination())}goToFirstPage(t,e=!0){return this._pageNumber=1,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())}goToLastPage(t,e=!0){return this._pageNumber=this._pageCount||1,e?this.processOnPageChanged(this._pageNumber||1,t):Promise.resolve(this.getFullPagination())}goToNextPage(t,e=!0){return this._pageNumber<this._pageCount?(this._pageNumber++,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())):Promise.resolve(!1)}goToPageNumber(t,e,n=!0){const r=this._pageNumber;return t<1?this._pageNumber=1:t>this._pageCount?this._pageNumber=this._pageCount:this._pageNumber=t,this._pageNumber!==r?n?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination()):Promise.resolve(!1)}goToPreviousPage(t,e=!0){return this._pageNumber>1?(this._pageNumber--,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())):Promise.resolve(!1)}refreshPagination(t=!1,e=!0,n=!1){var r,o,s;const l={...this.getFullPagination()};if(this._paginationOptions){const p=this._paginationOptions;this._itemsPerPage||(this._isLocalGrid?this._itemsPerPage=p.pageSize:this._itemsPerPage=+(!((s=(o=(r=this._backendServiceApi)===null||r===void 0?void 0:r.options)===null||o===void 0?void 0:o.paginationOptions)===null||s===void 0)&&s.first?this._backendServiceApi.options.paginationOptions.first:p.pageSize)),(t||this._totalItems!==p.totalItems)&&(t?(this._pageNumber=1,this.paginationOptions.pageNumber=1):!this._initialized&&p.pageNumber&&p.pageNumber>1&&(this._pageNumber=p.pageNumber||1),this._pageNumber===1&&this._backendServiceApi&&this._backendServiceApi.service.resetPaginationOptions()),this._availablePageSizes=p.pageSizes,!this._totalItems&&p.totalItems&&(this._totalItems=p.totalItems),this.recalculateFromToIndexes()}this._pageCount=Math.ceil(this._totalItems/this._itemsPerPage),this.sharedService.currentPagination=this.getCurrentPagination(),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),e&&!es(l,this.getFullPagination())&&this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),n&&!es(l,this.getFullPagination())&&this.pubSubService.publish("onPaginationPresetsInitialized",this.getFullPagination());const u=this.getFullPagination();this._previousPagination={pageNumber:u.pageNumber,pageSize:u.pageSize,pageSizes:u.pageSizes,totalItems:this.totalItems}}resetPagination(t=!0){var e,n;this._isLocalGrid&&this.dataView&&(!((n=(e=this.sharedService)===null||e===void 0?void 0:e.gridOptions)===null||n===void 0)&&n.enablePagination)&&this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:0}),this.refreshPagination(!0,t)}togglePaginationVisibility(t){var e;if(this.grid&&(!((e=this.sharedService)===null||e===void 0)&&e.gridOptions)){const n=t!==void 0?t:!this.sharedService.gridOptions.enablePagination;if(n&&this.goToFirstPage(),this._isLocalGrid&&this.dataView){const r=t?this._itemsPerPage:0;this.dataView.setPagingOptions({pageSize:r,pageNum:0})}this.sharedService.gridOptions.enablePagination=n,this.pubSubService.publish("onPaginationVisibilityChanged",{visible:n})}}processOnPageChanged(t,e){return this.pubSubService.publish("onBeforePaginationChange",this.getFullPagination())===!1?(this.resetToPreviousPagination(),Promise.resolve(this.getFullPagination())):new Promise((n,r)=>{var o,s,l;if(this.recalculateFromToIndexes(),this._isLocalGrid&&this.dataView)this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:t-1}),this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),n(this.getFullPagination());else{const u=+this._itemsPerPage,p=new Date;if(!((o=this._backendServiceApi)===null||o===void 0)&&o.preProcess&&this._backendServiceApi.preProcess(),!((s=this._backendServiceApi)===null||s===void 0)&&s.process){const c=this._backendServiceApi.service.processOnPaginationChanged(e,{newPage:t,pageSize:u}),f=this._backendServiceApi.process(c);f instanceof Promise?f.then(m=>{var v;(v=this.backendUtilities)===null||v===void 0||v.executeBackendProcessesCallback(p,m,this._backendServiceApi,this._totalItems);const _=this.getFullPagination();this._previousPagination={pageNumber:_.pageNumber,pageSize:_.pageSize,pageSizes:_.pageSizes,totalItems:this.totalItems},n(this.getFullPagination())}).catch(m=>{var v,_,C;this.resetToPreviousPagination(),(v=this.backendUtilities)===null||v===void 0||v.onBackendError(m,this._backendServiceApi),(!(!((_=this._backendServiceApi)===null||_===void 0)&&_.onError)||!(!((C=this.backendUtilities)===null||C===void 0)&&C.onBackendError))&&r(f)}):!((l=this.rxjs)===null||l===void 0)&&l.isObservable(f)&&this._subscriptions.push(f.subscribe(m=>{var v;const _=this.getFullPagination();this._previousPagination={pageNumber:_.pageNumber,pageSize:_.pageSize,pageSizes:_.pageSizes,totalItems:this.totalItems},n((v=this.backendUtilities)===null||v===void 0?void 0:v.executeBackendProcessesCallback(p,m,this._backendServiceApi,this._totalItems))},m=>{var v,_,C;this.resetToPreviousPagination(),(v=this.backendUtilities)===null||v===void 0||v.onBackendError(m,this._backendServiceApi),(!(!((_=this._backendServiceApi)===null||_===void 0)&&_.onError)||!(!((C=this.backendUtilities)===null||C===void 0)&&C.onBackendError))&&r(f)})),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),this.pubSubService.publish("onPaginationChanged",this.getFullPagination())}}})}recalculateFromToIndexes(){this._totalItems===0?(this._dataFrom=0,this._dataTo=1,this._pageNumber=0):(this._dataFrom=this._pageNumber>1?this._pageNumber*this._itemsPerPage-this._itemsPerPage+1:1,this._dataTo=this._totalItems<this._itemsPerPage?this._totalItems:(this._pageNumber||1)*this._itemsPerPage,this._dataTo>this._totalItems&&(this._dataTo=this._totalItems)),this._pageNumber=this._totalItems>0&&this._pageNumber===0?1:this._pageNumber,this._dataTo>this._totalItems?this._dataTo=this._totalItems:this._totalItems<this._itemsPerPage&&(this._dataTo=this._totalItems)}resetToPreviousPagination(){var t,e,n,r,o,s,l,u,p,c,f,m,v;const _=((t=this._previousPagination)===null||t===void 0?void 0:t.pageNumber)!==this.getFullPagination().pageNumber,C=((e=this._previousPagination)===null||e===void 0?void 0:e.pageSize)!==this.getFullPagination().pageSize;C&&this.changeItemPerPage((r=(n=this._previousPagination)===null||n===void 0?void 0:n.pageSize)!==null&&r!==void 0?r:0,null,!1),_&&this.goToPageNumber((s=(o=this._previousPagination)===null||o===void 0?void 0:o.pageNumber)!==null&&s!==void 0?s:0,null,!1),(_||C)&&(this.refreshPagination(),(p=(u=(l=this._backendServiceApi)===null||l===void 0?void 0:l.service)===null||u===void 0?void 0:u.updatePagination)===null||p===void 0||p.call(u,(f=(c=this._previousPagination)===null||c===void 0?void 0:c.pageNumber)!==null&&f!==void 0?f:0,(v=(m=this._previousPagination)===null||m===void 0?void 0:m.pageSize)!==null&&v!==void 0?v:0))}updateTotalItems(t,e=!1){this._totalItems=t,this._paginationOptions&&(this._paginationOptions.totalItems=t,this.refreshPagination(!1,e))}processOnItemAddedOrRemoved(t,e=!0){if(t!==null){const n=this._dataTo,r=Array.isArray(t)?t.length:1,o=e?+r:-r;this._totalItems+=o,this.recalculateFromToIndexes(),this._dataTo=n+o,this.pubSubService.publish("onPaginationChanged",this.getFullPagination())}}}const V0=20,z0=25,U0=35,G0=180,W0=300,$0=200;class Y0{get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get dataView(){var t;return(t=this._grid)===null||t===void 0?void 0:t.getData()}get gridUid(){var t,e;return(e=(t=this._grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:""}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get intervalRetryDelay(){return this._intervalRetryDelay}set intervalRetryDelay(t){this._intervalRetryDelay=t}get resizeByContentOptions(){var t,e;return(e=(t=this.gridOptions)===null||t===void 0?void 0:t.resizeByContentOptions)!==null&&e!==void 0?e:{}}constructor(t){this.pubSubService=t,this._intervalRetryDelay=$0,this._isStopResizeIntervalRequested=!1,this._hasResizedByContentAtLeastOnce=!1,this._totalColumnsWidthByContent=0,this._resizePaused=!1,this._subscriptions=[],this._eventHandler=new Slick.EventHandler,this._bindingEventService=new Fn}dispose(){var t,e;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._intervalId&&clearInterval(this._intervalId),clearTimeout(this._timer),((e=this.gridOptions.autoResize)===null||e===void 0?void 0:e.resizeDetection)==="container"&&this._resizeObserver&&this._resizeObserver.disconnect(),this._bindingEventService.unbindAll()}init(t,e){var n,r,o,s,l,u,p,c;if(!t||!this.gridOptions||!e)throw new Error(`
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var q_="1.15.0";function Cs(a){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(a)}var ys=Cs(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ya=Cs(/Edge/i),dm=Cs(/firefox/i),ja=Cs(/safari/i)&&!Cs(/chrome/i)&&!Cs(/android/i),um=Cs(/iP(ad|od|hone)/i),cm=Cs(/chrome/i)&&Cs(/android/i),hm={capture:!1,passive:!1};function Ci(a,t,e){a.addEventListener(t,e,!ys&&hm)}function gi(a,t,e){a.removeEventListener(t,e,!ys&&hm)}function ou(a,t){if(t){if(t[0]===">"&&(t=t.substring(1)),a)try{if(a.matches)return a.matches(t);if(a.msMatchesSelector)return a.msMatchesSelector(t);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(t)}catch{return!1}return!1}}function K_(a){return a.host&&a!==document&&a.host.nodeType?a.host:a.parentNode}function Po(a,t,e,n){if(a){e=e||document;do{if(t!=null&&(t[0]===">"?a.parentNode===e&&ou(a,t):ou(a,t))||n&&a===e)return a;if(a===e)break}while(a=K_(a))}return null}var fm=/\s+/g;function bn(a,t,e){if(a&&t)if(a.classList)a.classList[e?"add":"remove"](t);else{var n=(" "+a.className+" ").replace(fm," ").replace(" "+t+" "," ");a.className=(n+(e?" "+t:"")).replace(fm," ")}}function Ft(a,t,e){var n=a&&a.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(a,""):a.currentStyle&&(e=a.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function wl(a,t){var e="";if(typeof a=="string")e=a;else do{var n=Ft(a,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(a=a.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function pm(a,t,e){if(a){var n=a.getElementsByTagName(t),r=0,o=n.length;if(e)for(;r<o;r++)e(n[r],r);return n}return[]}function Jo(){var a=document.scrollingElement;return a||document.documentElement}function hn(a,t,e,n,r){if(!(!a.getBoundingClientRect&&a!==window)){var o,s,l,u,p,c,f;if(a!==window&&a.parentNode&&a!==Jo()?(o=a.getBoundingClientRect(),s=o.top,l=o.left,u=o.bottom,p=o.right,c=o.height,f=o.width):(s=0,l=0,u=window.innerHeight,p=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(t||e)&&a!==window&&(r=r||a.parentNode,!ys))do if(r&&r.getBoundingClientRect&&(Ft(r,"transform")!=="none"||e&&Ft(r,"position")!=="static")){var m=r.getBoundingClientRect();s-=m.top+parseInt(Ft(r,"border-top-width")),l-=m.left+parseInt(Ft(r,"border-left-width")),u=s+o.height,p=l+o.width;break}while(r=r.parentNode);if(n&&a!==window){var v=wl(r||a),_=v&&v.a,C=v&&v.d;v&&(s/=C,l/=_,f/=_,c/=C,u=s+c,p=l+f)}return{top:s,left:l,bottom:u,right:p,width:f,height:c}}}function mm(a,t,e){for(var n=qs(a,!0),r=hn(a)[t];n;){var o=hn(n)[e],s=void 0;if(e==="top"||e==="left"?s=r>=o:s=r<=o,!s)return n;if(n===Jo())break;n=qs(n,!1)}return!1}function ia(a,t,e,n){for(var r=0,o=0,s=a.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==Gt.ghost&&(n||s[o]!==Gt.dragged)&&Po(s[o],e.draggable,a,!1)){if(r===t)return s[o];r++}o++}return null}function Sh(a,t){for(var e=a.lastElementChild;e&&(e===Gt.ghost||Ft(e,"display")==="none"||t&&!ou(e,t));)e=e.previousElementSibling;return e||null}function wn(a,t){var e=0;if(!a||!a.parentNode)return-1;for(;a=a.previousElementSibling;)a.nodeName.toUpperCase()!=="TEMPLATE"&&a!==Gt.clone&&(!t||ou(a,t))&&e++;return e}function vm(a){var t=0,e=0,n=Jo();if(a)do{var r=wl(a),o=r.a,s=r.d;t+=a.scrollLeft*o,e+=a.scrollTop*s}while(a!==n&&(a=a.parentNode));return[t,e]}function Z_(a,t){for(var e in a)if(a.hasOwnProperty(e)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===a[e][n])return Number(e)}return-1}function qs(a,t){if(!a||!a.getBoundingClientRect)return Jo();var e=a,n=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var r=Ft(e);if(e.clientWidth<e.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return Jo();if(n||t)return e;n=!0}}while(e=e.parentNode);return Jo()}function Q_(a,t){if(a&&t)for(var e in t)t.hasOwnProperty(e)&&(a[e]=t[e]);return a}function wh(a,t){return Math.round(a.top)===Math.round(t.top)&&Math.round(a.left)===Math.round(t.left)&&Math.round(a.height)===Math.round(t.height)&&Math.round(a.width)===Math.round(t.width)}var Xa;function gm(a,t){return function(){if(!Xa){var e=arguments,n=this;e.length===1?a.call(n,e[0]):a.apply(n,e),Xa=setTimeout(function(){Xa=void 0},t)}}}function J_(){clearTimeout(Xa),Xa=void 0}function _m(a,t,e){a.scrollLeft+=t,a.scrollTop+=e}function xh(a){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(a).cloneNode(!0):e?e(a).clone(!0)[0]:a.cloneNode(!0)}function bm(a,t){Ft(a,"position","absolute"),Ft(a,"top",t.top),Ft(a,"left",t.left),Ft(a,"width",t.width),Ft(a,"height",t.height)}function Th(a){Ft(a,"position",""),Ft(a,"top",""),Ft(a,"left",""),Ft(a,"width",""),Ft(a,"height","")}var hr="Sortable"+new Date().getTime();function e0(){var a=[],t;return{captureAnimationState:function(){if(a=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(Ft(r,"display")==="none"||r===Gt.ghost)){a.push({target:r,rect:hn(r)});var o=Qo({},a[a.length-1].rect);if(r.thisAnimationDuration){var s=wl(r,!0);s&&(o.top-=s.f,o.left-=s.e)}r.fromRect=o}})}},addAnimationState:function(n){a.push(n)},removeAnimationState:function(n){a.splice(Z_(a,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var o=!1,s=0;a.forEach(function(l){var u=0,p=l.target,c=p.fromRect,f=hn(p),m=p.prevFromRect,v=p.prevToRect,_=l.rect,C=wl(p,!0);C&&(f.top-=C.f,f.left-=C.e),p.toRect=f,p.thisAnimationDuration&&wh(m,f)&&!wh(c,f)&&(_.top-f.top)/(_.left-f.left)===(c.top-f.top)/(c.left-f.left)&&(u=i0(_,m,v,r.options)),wh(f,c)||(p.prevFromRect=c,p.prevToRect=f,u||(u=r.options.animation),r.animate(p,_,f,u)),u&&(o=!0,s=Math.max(s,u),clearTimeout(p.animationResetTimer),p.animationResetTimer=setTimeout(function(){p.animationTime=0,p.prevFromRect=null,p.fromRect=null,p.prevToRect=null,p.thisAnimationDuration=null},u),p.thisAnimationDuration=u)}),clearTimeout(t),o?t=setTimeout(function(){typeof n=="function"&&n()},s):typeof n=="function"&&n(),a=[]},animate:function(n,r,o,s){if(s){Ft(n,"transition",""),Ft(n,"transform","");var l=wl(this.el),u=l&&l.a,p=l&&l.d,c=(r.left-o.left)/(u||1),f=(r.top-o.top)/(p||1);n.animatingX=!!c,n.animatingY=!!f,Ft(n,"transform","translate3d("+c+"px,"+f+"px,0)"),this.forRepaintDummy=t0(n),Ft(n,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),Ft(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){Ft(n,"transition",""),Ft(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},s)}}}}function t0(a){return a.offsetWidth}function i0(a,t,e,n){return Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*n.animation}var na=[],Oh={initializeByDefault:!0},qa={mount:function(t){for(var e in Oh)Oh.hasOwnProperty(e)&&!(e in t)&&(t[e]=Oh[e]);na.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),na.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=t+"Global";na.forEach(function(s){e[s.pluginName]&&(e[s.pluginName][o]&&e[s.pluginName][o](Qo({sortable:e},n)),e.options[s.pluginName]&&e[s.pluginName][t]&&e[s.pluginName][t](Qo({sortable:e},n)))})},initializePlugins:function(t,e,n,r){na.forEach(function(l){var u=l.pluginName;if(!(!t.options[u]&&!l.initializeByDefault)){var p=new l(t,e,t.options);p.sortable=t,p.options=t.options,t[u]=p,ho(n,p.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);typeof s<"u"&&(t.options[o]=s)}},getEventProperties:function(t,e){var n={};return na.forEach(function(r){typeof r.eventProperties=="function"&&ho(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return na.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(r=o.optionListeners[e].call(t[o.pluginName],n))}),r}};function Ka(a){var t=a.sortable,e=a.rootEl,n=a.name,r=a.targetEl,o=a.cloneEl,s=a.toEl,l=a.fromEl,u=a.oldIndex,p=a.newIndex,c=a.oldDraggableIndex,f=a.newDraggableIndex,m=a.originalEvent,v=a.putSortable,_=a.extraEventProperties;if(t=t||e&&e[hr],!!t){var C,x=t.options,w="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ys&&!Ya?C=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent(n,!0,!0)),C.to=s||e,C.from=l||e,C.item=r||e,C.clone=o,C.oldIndex=u,C.newIndex=p,C.oldDraggableIndex=c,C.newDraggableIndex=f,C.originalEvent=m,C.pullMode=v?v.lastPutMode:void 0;var E=Qo(Qo({},_),qa.getEventProperties(n,t));for(var I in E)C[I]=E[I];e&&e.dispatchEvent(C),x[w]&&x[w].call(t,C)}}var n0=["evt"],Pr=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,o=G_(n,n0);qa.pluginEvent.bind(Gt)(t,e,Qo({dragEl:bt,parentEl:xn,ghostEl:si,rootEl:fn,nextEl:xl,lastDownEl:su,cloneEl:Cn,cloneHidden:Ks,dragStarted:Qa,putSortable:sr,activeSortable:Gt.active,originalEvent:r,oldIndex:ra,oldDraggableIndex:Za,newIndex:qr,newDraggableIndex:Zs,hideGhostForTarget:Tm,unhideGhostForTarget:Om,cloneNowHidden:function(){Ks=!0},cloneNowShown:function(){Ks=!1},dispatchSortableEvent:function(l){Sr({sortable:e,name:l,originalEvent:r})}},o))};function Sr(a){Ka(Qo({putSortable:sr,cloneEl:Cn,targetEl:bt,rootEl:fn,oldIndex:ra,oldDraggableIndex:Za,newIndex:qr,newDraggableIndex:Zs},a))}var bt,xn,si,fn,xl,su,Cn,Ks,ra,qr,Za,Zs,lu,sr,oa=!1,au=!1,du=[],Tl,Mo,Ah,kh,Cm,ym,Qa,sa,Ja,ed=!1,uu=!1,cu,fr,Ih=[],Dh=!1,hu=[],fu=typeof document<"u",pu=um,Em=Ya||ys?"cssFloat":"float",r0=fu&&!cm&&!um&&"draggable"in document.createElement("div"),Sm=function(){if(fu){if(ys)return!1;var a=document.createElement("x");return a.style.cssText="pointer-events:auto",a.style.pointerEvents==="auto"}}(),wm=function(t,e){var n=Ft(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=ia(t,0,e),s=ia(t,1,e),l=o&&Ft(o),u=s&&Ft(s),p=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+hn(o).width,c=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+hn(s).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return s&&(u.clear==="both"||u.clear===f)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||p>=r&&n[Em]==="none"||s&&n[Em]==="none"&&p+c>r)?"vertical":"horizontal"},o0=function(t,e,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,s=n?t.width:t.height,l=n?e.left:e.top,u=n?e.right:e.bottom,p=n?e.width:e.height;return r===l||o===u||r+s/2===l+p/2},s0=function(t,e){var n;return du.some(function(r){var o=r[hr].options.emptyInsertThreshold;if(!(!o||Sh(r))){var s=hn(r),l=t>=s.left-o&&t<=s.right+o,u=e>=s.top-o&&e<=s.bottom+o;if(l&&u)return n=r}}),n},xm=function(t){function e(o,s){return function(l,u,p,c){var f=l.options.group.name&&u.options.group.name&&l.options.group.name===u.options.group.name;if(o==null&&(s||f))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return e(o(l,u,p,c),s)(l,u,p,c);var m=(s?l:u).options.group.name;return o===!0||typeof o=="string"&&o===m||o.join&&o.indexOf(m)>-1}}var n={},r=t.group;(!r||ru(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=e(r.pull,!0),n.checkPut=e(r.put),n.revertClone=r.revertClone,t.group=n},Tm=function(){!Sm&&si&&Ft(si,"display","none")},Om=function(){!Sm&&si&&Ft(si,"display","")};fu&&!cm&&document.addEventListener("click",function(a){if(au)return a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.stopImmediatePropagation&&a.stopImmediatePropagation(),au=!1,!1},!0);var Ol=function(t){if(bt){t=t.touches?t.touches[0]:t;var e=s0(t.clientX,t.clientY);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[hr]._onDragOver(n)}}},l0=function(t){bt&&bt.parentNode[hr]._isOutsideThisEl(t.target)};function Gt(a,t){if(!(a&&a.nodeType&&a.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(a));this.el=a,this.options=t=ho({},t),a[hr]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(a.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return wm(a,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,l){s.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Gt.supportPointer!==!1&&"PointerEvent"in window&&!ja,emptyInsertThreshold:5};qa.initializePlugins(this,a,e);for(var n in e)!(n in t)&&(t[n]=e[n]);xm(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:r0,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ci(a,"pointerdown",this._onTapStart):(Ci(a,"mousedown",this._onTapStart),Ci(a,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ci(a,"dragover",this),Ci(a,"dragenter",this)),du.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),ho(this,e0())}Gt.prototype={constructor:Gt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(sa=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,bt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,o=r.preventOnFilter,s=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(l||t).target,p=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,c=r.filter;if(m0(n),!bt&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!p.isContentEditable&&!(!this.nativeDraggable&&ja&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=Po(u,r.draggable,n,!1),!(u&&u.animated)&&su!==u)){if(ra=wn(u),Za=wn(u,r.draggable),typeof c=="function"){if(c.call(this,t,u,this)){Sr({sortable:e,rootEl:p,name:"filter",targetEl:u,toEl:n,fromEl:n}),Pr("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=Po(p,f.trim(),n,!1),f)return Sr({sortable:e,rootEl:f,name:"filter",targetEl:u,fromEl:n,toEl:n}),Pr("filter",e,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!Po(p,r.handle,n,!1)||this._prepareDragStart(t,l,u)}}},_prepareDragStart:function(t,e,n){var r=this,o=r.el,s=r.options,l=o.ownerDocument,u;if(n&&!bt&&n.parentNode===o){var p=hn(n);if(fn=o,bt=n,xn=bt.parentNode,xl=bt.nextSibling,su=n,lu=s.group,Gt.dragged=bt,Tl={target:bt,clientX:(e||t).clientX,clientY:(e||t).clientY},Cm=Tl.clientX-p.left,ym=Tl.clientY-p.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,bt.style["will-change"]="all",u=function(){if(Pr("delayEnded",r,{evt:t}),Gt.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!dm&&r.nativeDraggable&&(bt.draggable=!0),r._triggerDragStart(t,e),Sr({sortable:r,name:"choose",originalEvent:t}),bn(bt,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){pm(bt,c.trim(),Rh)}),Ci(l,"dragover",Ol),Ci(l,"mousemove",Ol),Ci(l,"touchmove",Ol),Ci(l,"mouseup",r._onDrop),Ci(l,"touchend",r._onDrop),Ci(l,"touchcancel",r._onDrop),dm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,bt.draggable=!0),Pr("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ya||ys))){if(Gt.eventCanceled){this._onDrop();return}Ci(l,"mouseup",r._disableDelayedDrag),Ci(l,"touchend",r._disableDelayedDrag),Ci(l,"touchcancel",r._disableDelayedDrag),Ci(l,"mousemove",r._delayedDragTouchMoveHandler),Ci(l,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&Ci(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(u,s.delay)}else u()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){bt&&Rh(bt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;gi(t,"mouseup",this._disableDelayedDrag),gi(t,"touchend",this._disableDelayedDrag),gi(t,"touchcancel",this._disableDelayedDrag),gi(t,"mousemove",this._delayedDragTouchMoveHandler),gi(t,"touchmove",this._delayedDragTouchMoveHandler),gi(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Ci(document,"pointermove",this._onTouchMove):e?Ci(document,"touchmove",this._onTouchMove):Ci(document,"mousemove",this._onTouchMove):(Ci(bt,"dragend",this),Ci(fn,"dragstart",this._onDragStart));try{document.selection?vu(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(oa=!1,fn&&bt){Pr("dragStarted",this,{evt:e}),this.nativeDraggable&&Ci(document,"dragover",l0);var n=this.options;!t&&bn(bt,n.dragClass,!1),bn(bt,n.ghostClass,!0),Gt.active=this,t&&this._appendGhost(),Sr({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Mo){this._lastX=Mo.clientX,this._lastY=Mo.clientY,Tm();for(var t=document.elementFromPoint(Mo.clientX,Mo.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Mo.clientX,Mo.clientY),t!==e);)e=t;if(bt.parentNode[hr]._isOutsideThisEl(t),e)do{if(e[hr]){var n=void 0;if(n=e[hr]._onDragOver({clientX:Mo.clientX,clientY:Mo.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Om()}},_onTouchMove:function(t){if(Tl){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=si&&wl(si,!0),l=si&&s&&s.a,u=si&&s&&s.d,p=pu&&fr&&vm(fr),c=(o.clientX-Tl.clientX+r.x)/(l||1)+(p?p[0]-Ih[0]:0)/(l||1),f=(o.clientY-Tl.clientY+r.y)/(u||1)+(p?p[1]-Ih[1]:0)/(u||1);if(!Gt.active&&!oa){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(si){s?(s.e+=c-(Ah||0),s.f+=f-(kh||0)):s={a:1,b:0,c:0,d:1,e:c,f};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");Ft(si,"webkitTransform",m),Ft(si,"mozTransform",m),Ft(si,"msTransform",m),Ft(si,"transform",m),Ah=c,kh=f,Mo=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!si){var t=this.options.fallbackOnBody?document.body:fn,e=hn(bt,!0,pu,!0,t),n=this.options;if(pu){for(fr=t;Ft(fr,"position")==="static"&&Ft(fr,"transform")==="none"&&fr!==document;)fr=fr.parentNode;fr!==document.body&&fr!==document.documentElement?(fr===document&&(fr=Jo()),e.top+=fr.scrollTop,e.left+=fr.scrollLeft):fr=Jo(),Ih=vm(fr)}si=bt.cloneNode(!0),bn(si,n.ghostClass,!1),bn(si,n.fallbackClass,!0),bn(si,n.dragClass,!0),Ft(si,"transition",""),Ft(si,"transform",""),Ft(si,"box-sizing","border-box"),Ft(si,"margin",0),Ft(si,"top",e.top),Ft(si,"left",e.left),Ft(si,"width",e.width),Ft(si,"height",e.height),Ft(si,"opacity","0.8"),Ft(si,"position",pu?"absolute":"fixed"),Ft(si,"zIndex","100000"),Ft(si,"pointerEvents","none"),Gt.ghost=si,t.appendChild(si),Ft(si,"transform-origin",Cm/parseInt(si.style.width)*100+"% "+ym/parseInt(si.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,o=n.options;if(Pr("dragStart",this,{evt:t}),Gt.eventCanceled){this._onDrop();return}Pr("setupClone",this),Gt.eventCanceled||(Cn=xh(bt),Cn.removeAttribute("id"),Cn.draggable=!1,Cn.style["will-change"]="",this._hideClone(),bn(Cn,this.options.chosenClass,!1),Gt.clone=Cn),n.cloneId=vu(function(){Pr("clone",n),!Gt.eventCanceled&&(n.options.removeCloneOnHide||fn.insertBefore(Cn,bt),n._hideClone(),Sr({sortable:n,name:"clone"}))}),!e&&bn(bt,o.dragClass,!0),e?(au=!0,n._loopId=setInterval(n._emulateDragOver,50)):(gi(document,"mouseup",n._onDrop),gi(document,"touchend",n._onDrop),gi(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,bt)),Ci(document,"drop",n),Ft(bt,"transform","translateZ(0)")),oa=!0,n._dragStartId=vu(n._dragStarted.bind(n,e,t)),Ci(document,"selectstart",n),Qa=!0,ja&&Ft(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,r,o,s,l=this.options,u=l.group,p=Gt.active,c=lu===u,f=l.sort,m=sr||p,v,_=this,C=!1;if(Dh)return;function x(Oe,ye){Pr(Oe,_,Qo({evt:t,isOwner:c,axis:v?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:f,fromSortable:m,target:n,completed:E,onMove:function(ae,he){return mu(fn,e,bt,r,ae,hn(ae),t,he)},changed:I},ye))}function w(){x("dragOverAnimationCapture"),_.captureAnimationState(),_!==m&&m.captureAnimationState()}function E(Oe){return x("dragOverCompleted",{insertion:Oe}),Oe&&(c?p._hideClone():p._showClone(_),_!==m&&(bn(bt,sr?sr.options.ghostClass:p.options.ghostClass,!1),bn(bt,l.ghostClass,!0)),sr!==_&&_!==Gt.active?sr=_:_===Gt.active&&sr&&(sr=null),m===_&&(_._ignoreWhileAnimating=n),_.animateAll(function(){x("dragOverAnimationComplete"),_._ignoreWhileAnimating=null}),_!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(n===bt&&!bt.animated||n===e&&!n.animated)&&(sa=null),!l.dragoverBubble&&!t.rootEl&&n!==document&&(bt.parentNode[hr]._isOutsideThisEl(t.target),!Oe&&Ol(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),C=!0}function I(){qr=wn(bt),Zs=wn(bt,l.draggable),Sr({sortable:_,name:"change",toEl:e,newIndex:qr,newDraggableIndex:Zs,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=Po(n,l.draggable,e,!0),x("dragOver"),Gt.eventCanceled)return C;if(bt.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||_._ignoreWhileAnimating===n)return E(!1);if(au=!1,p&&!l.disabled&&(c?f||(s=xn!==fn):sr===this||(this.lastPutMode=lu.checkPull(this,p,bt,t))&&u.checkPut(this,p,bt,t))){if(v=this._getDirection(t,n)==="vertical",r=hn(bt),x("dragOverValid"),Gt.eventCanceled)return C;if(s)return xn=fn,w(),this._hideClone(),x("revert"),Gt.eventCanceled||(xl?fn.insertBefore(bt,xl):fn.appendChild(bt)),E(!0);var k=Sh(e,l.draggable);if(!k||c0(t,v,this)&&!k.animated){if(k===bt)return E(!1);if(k&&e===t.target&&(n=k),n&&(o=hn(n)),mu(fn,e,bt,r,n,o,t,!!n)!==!1)return w(),k&&k.nextSibling?e.insertBefore(bt,k.nextSibling):e.appendChild(bt),xn=e,I(),E(!0)}else if(k&&u0(t,v,this)){var F=ia(e,0,l,!0);if(F===bt)return E(!1);if(n=F,o=hn(n),mu(fn,e,bt,r,n,o,t,!1)!==!1)return w(),e.insertBefore(bt,F),xn=e,I(),E(!0)}else if(n.parentNode===e){o=hn(n);var N=0,V,Q=bt.parentNode!==e,L=!o0(bt.animated&&bt.toRect||r,n.animated&&n.toRect||o,v),se=v?"top":"left",Ce=mm(n,"top","top")||mm(bt,"top","top"),J=Ce?Ce.scrollTop:void 0;sa!==n&&(V=o[se],ed=!1,uu=!L&&l.invertSwap||Q),N=h0(t,n,o,v,L?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,uu,sa===n);var z;if(N!==0){var P=wn(bt);do P-=N,z=xn.children[P];while(z&&(Ft(z,"display")==="none"||z===si))}if(N===0||z===n)return E(!1);sa=n,Ja=N;var le=n.nextElementSibling,Ke=!1;Ke=N===1;var Pe=mu(fn,e,bt,r,n,o,t,Ke);if(Pe!==!1)return(Pe===1||Pe===-1)&&(Ke=Pe===1),Dh=!0,setTimeout(d0,30),w(),Ke&&!le?e.appendChild(bt):n.parentNode.insertBefore(bt,Ke?le:n),Ce&&_m(Ce,0,J-Ce.scrollTop),xn=bt.parentNode,V!==void 0&&!uu&&(cu=Math.abs(V-hn(n)[se])),I(),E(!0)}if(e.contains(bt))return E(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){gi(document,"mousemove",this._onTouchMove),gi(document,"touchmove",this._onTouchMove),gi(document,"pointermove",this._onTouchMove),gi(document,"dragover",Ol),gi(document,"mousemove",Ol),gi(document,"touchmove",Ol)},_offUpEvents:function(){var t=this.el.ownerDocument;gi(t,"mouseup",this._onDrop),gi(t,"touchend",this._onDrop),gi(t,"pointerup",this._onDrop),gi(t,"touchcancel",this._onDrop),gi(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(qr=wn(bt),Zs=wn(bt,n.draggable),Pr("drop",this,{evt:t}),xn=bt&&bt.parentNode,qr=wn(bt),Zs=wn(bt,n.draggable),Gt.eventCanceled){this._nulling();return}oa=!1,uu=!1,ed=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Fh(this.cloneId),Fh(this._dragStartId),this.nativeDraggable&&(gi(document,"drop",this),gi(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ja&&Ft(document.body,"user-select",""),Ft(bt,"transform",""),t&&(Qa&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),si&&si.parentNode&&si.parentNode.removeChild(si),(fn===xn||sr&&sr.lastPutMode!=="clone")&&Cn&&Cn.parentNode&&Cn.parentNode.removeChild(Cn),bt&&(this.nativeDraggable&&gi(bt,"dragend",this),Rh(bt),bt.style["will-change"]="",Qa&&!oa&&bn(bt,sr?sr.options.ghostClass:this.options.ghostClass,!1),bn(bt,this.options.chosenClass,!1),Sr({sortable:this,name:"unchoose",toEl:xn,newIndex:null,newDraggableIndex:null,originalEvent:t}),fn!==xn?(qr>=0&&(Sr({rootEl:xn,name:"add",toEl:xn,fromEl:fn,originalEvent:t}),Sr({sortable:this,name:"remove",toEl:xn,originalEvent:t}),Sr({rootEl:xn,name:"sort",toEl:xn,fromEl:fn,originalEvent:t}),Sr({sortable:this,name:"sort",toEl:xn,originalEvent:t})),sr&&sr.save()):qr!==ra&&qr>=0&&(Sr({sortable:this,name:"update",toEl:xn,originalEvent:t}),Sr({sortable:this,name:"sort",toEl:xn,originalEvent:t})),Gt.active&&((qr==null||qr===-1)&&(qr=ra,Zs=Za),Sr({sortable:this,name:"end",toEl:xn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Pr("nulling",this),fn=bt=xn=si=xl=Cn=su=Ks=Tl=Mo=Qa=qr=Zs=ra=Za=sa=Ja=sr=lu=Gt.dragged=Gt.ghost=Gt.clone=Gt.active=null,hu.forEach(function(t){t.checked=!0}),hu.length=Ah=kh=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":bt&&(this._onDragOver(t),a0(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,r=0,o=n.length,s=this.options;r<o;r++)e=n[r],Po(e,s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||p0(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(o,s){var l=r.children[s];Po(l,this.options.draggable,r,!1)&&(n[o]=l)},this),e&&this.captureAnimationState(),t.forEach(function(o){n[o]&&(r.removeChild(n[o]),r.appendChild(n[o]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Po(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var r=qa.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&xm(n)},destroy:function(){Pr("destroy",this);var t=this.el;t[hr]=null,gi(t,"mousedown",this._onTapStart),gi(t,"touchstart",this._onTapStart),gi(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(gi(t,"dragover",this),gi(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),du.splice(du.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ks){if(Pr("hideClone",this),Gt.eventCanceled)return;Ft(Cn,"display","none"),this.options.removeCloneOnHide&&Cn.parentNode&&Cn.parentNode.removeChild(Cn),Ks=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ks){if(Pr("showClone",this),Gt.eventCanceled)return;bt.parentNode==fn&&!this.options.group.revertClone?fn.insertBefore(Cn,bt):xl?fn.insertBefore(Cn,xl):fn.appendChild(Cn),this.options.group.revertClone&&this.animate(bt,Cn),Ft(Cn,"display",""),Ks=!1}}};function a0(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.cancelable&&a.preventDefault()}function mu(a,t,e,n,r,o,s,l){var u,p=a[hr],c=p.options.onMove,f;return window.CustomEvent&&!ys&&!Ya?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=t,u.from=a,u.dragged=e,u.draggedRect=n,u.related=r||t,u.relatedRect=o||hn(t),u.willInsertAfter=l,u.originalEvent=s,a.dispatchEvent(u),c&&(f=c.call(p,u,s)),f}function Rh(a){a.draggable=!1}function d0(){Dh=!1}function u0(a,t,e){var n=hn(ia(e.el,0,e.options,!0)),r=10;return t?a.clientX<n.left-r||a.clientY<n.top&&a.clientX<n.right:a.clientY<n.top-r||a.clientY<n.bottom&&a.clientX<n.left}function c0(a,t,e){var n=hn(Sh(e.el,e.options.draggable)),r=10;return t?a.clientX>n.right+r||a.clientX<=n.right&&a.clientY>n.bottom&&a.clientX>=n.left:a.clientX>n.right&&a.clientY>n.top||a.clientX<=n.right&&a.clientY>n.bottom+r}function h0(a,t,e,n,r,o,s,l){var u=n?a.clientY:a.clientX,p=n?e.height:e.width,c=n?e.top:e.left,f=n?e.bottom:e.right,m=!1;if(!s){if(l&&cu<p*r){if(!ed&&(Ja===1?u>c+p*o/2:u<f-p*o/2)&&(ed=!0),ed)m=!0;else if(Ja===1?u<c+cu:u>f-cu)return-Ja}else if(u>c+p*(1-r)/2&&u<f-p*(1-r)/2)return f0(t)}return m=m||s,m&&(u<c+p*o/2||u>f-p*o/2)?u>c+p/2?1:-1:0}function f0(a){return wn(bt)<wn(a)?1:-1}function p0(a){for(var t=a.tagName+a.className+a.src+a.href+a.textContent,e=t.length,n=0;e--;)n+=t.charCodeAt(e);return n.toString(36)}function m0(a){hu.length=0;for(var t=a.getElementsByTagName("input"),e=t.length;e--;){var n=t[e];n.checked&&hu.push(n)}}function vu(a){return setTimeout(a,0)}function Fh(a){return clearTimeout(a)}fu&&Ci(document,"touchmove",function(a){(Gt.active||oa)&&a.cancelable&&a.preventDefault()}),Gt.utils={on:Ci,off:gi,css:Ft,find:pm,is:function(t,e){return!!Po(t,e,t,!1)},extend:Q_,throttle:gm,closest:Po,toggleClass:bn,clone:xh,index:wn,nextTick:vu,cancelNextTick:Fh,detectDirection:wm,getChild:ia},Gt.get=function(a){return a[hr]},Gt.mount=function(){for(var a=arguments.length,t=new Array(a),e=0;e<a;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(Gt.utils=Qo(Qo({},Gt.utils),n.utils)),qa.mount(n)})},Gt.create=function(a,t){return new Gt(a,t)},Gt.version=q_;var Mn=[],td,Ph,Mh=!1,Nh,Lh,gu,id;function v0(){function a(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return a.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?Ci(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ci(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Ci(document,"touchmove",this._handleFallbackAutoScroll):Ci(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?gi(document,"dragover",this._handleAutoScroll):(gi(document,"pointermove",this._handleFallbackAutoScroll),gi(document,"touchmove",this._handleFallbackAutoScroll),gi(document,"mousemove",this._handleFallbackAutoScroll)),Am(),_u(),J_()},nulling:function(){gu=Ph=td=Mh=id=Nh=Lh=null,Mn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var r=this,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,l=document.elementFromPoint(o,s);if(gu=e,n||this.options.forceAutoScrollFallback||Ya||ys||ja){Hh(e,this.options,l,n);var u=qs(l,!0);Mh&&(!id||o!==Nh||s!==Lh)&&(id&&Am(),id=setInterval(function(){var p=qs(document.elementFromPoint(o,s),!0);p!==u&&(u=p,_u()),Hh(e,r.options,p,n)},10),Nh=o,Lh=s)}else{if(!this.options.bubbleScroll||qs(l,!0)===Jo()){_u();return}Hh(e,this.options,qs(l,!1),!1)}}},ho(a,{pluginName:"scroll",initializeByDefault:!0})}function _u(){Mn.forEach(function(a){clearInterval(a.pid)}),Mn=[]}function Am(){clearInterval(id)}var Hh=gm(function(a,t,e,n){if(t.scroll){var r=(a.touches?a.touches[0]:a).clientX,o=(a.touches?a.touches[0]:a).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,u=Jo(),p=!1,c;Ph!==e&&(Ph=e,_u(),td=t.scroll,c=t.scrollFn,td===!0&&(td=qs(e,!0)));var f=0,m=td;do{var v=m,_=hn(v),C=_.top,x=_.bottom,w=_.left,E=_.right,I=_.width,k=_.height,F=void 0,N=void 0,V=v.scrollWidth,Q=v.scrollHeight,L=Ft(v),se=v.scrollLeft,Ce=v.scrollTop;v===u?(F=I<V&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),N=k<Q&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(F=I<V&&(L.overflowX==="auto"||L.overflowX==="scroll"),N=k<Q&&(L.overflowY==="auto"||L.overflowY==="scroll"));var J=F&&(Math.abs(E-r)<=s&&se+I<V)-(Math.abs(w-r)<=s&&!!se),z=N&&(Math.abs(x-o)<=s&&Ce+k<Q)-(Math.abs(C-o)<=s&&!!Ce);if(!Mn[f])for(var P=0;P<=f;P++)Mn[P]||(Mn[P]={});(Mn[f].vx!=J||Mn[f].vy!=z||Mn[f].el!==v)&&(Mn[f].el=v,Mn[f].vx=J,Mn[f].vy=z,clearInterval(Mn[f].pid),(J!=0||z!=0)&&(p=!0,Mn[f].pid=setInterval((function(){n&&this.layer===0&&Gt.active._onTouchMove(gu);var le=Mn[this.layer].vy?Mn[this.layer].vy*l:0,Ke=Mn[this.layer].vx?Mn[this.layer].vx*l:0;typeof c=="function"&&c.call(Gt.dragged.parentNode[hr],Ke,le,a,gu,Mn[this.layer].el)!=="continue"||_m(Mn[this.layer].el,Ke,le)}).bind({layer:f}),24))),f++}while(t.bubbleScroll&&m!==u&&(m=qs(m,!1)));Mh=p}},30),km=function(t){var e=t.originalEvent,n=t.putSortable,r=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,l=t.hideGhostForTarget,u=t.unhideGhostForTarget;if(e){var p=n||o;l();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,f=document.elementFromPoint(c.clientX,c.clientY);u(),p&&!p.el.contains(f)&&(s("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function Bh(){}Bh.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=ia(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(e,r):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:km},ho(Bh,{pluginName:"revertOnSpill"});function Vh(){}Vh.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,r=n||this.sortable;r.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),r.animateAll()},drop:km},ho(Vh,{pluginName:"removeOnSpill"});var fo;function g0(){function a(){this.defaults={swapClass:"sortable-swap-highlight"}}return a.prototype={dragStart:function(e){var n=e.dragEl;fo=n},dragOverValid:function(e){var n=e.completed,r=e.target,o=e.onMove,s=e.activeSortable,l=e.changed,u=e.cancel;if(s.options.swap){var p=this.sortable.el,c=this.options;if(r&&r!==p){var f=fo;o(r)!==!1?(bn(r,c.swapClass,!0),fo=r):fo=null,f&&f!==fo&&bn(f,c.swapClass,!1)}l(),n(!0),u()}},drop:function(e){var n=e.activeSortable,r=e.putSortable,o=e.dragEl,s=r||this.sortable,l=this.options;fo&&bn(fo,l.swapClass,!1),fo&&(l.swap||r&&r.options.swap)&&o!==fo&&(s.captureAnimationState(),s!==n&&n.captureAnimationState(),_0(o,fo),s.animateAll(),s!==n&&n.animateAll())},nulling:function(){fo=null}},ho(a,{pluginName:"swap",eventProperties:function(){return{swapItem:fo}}})}function _0(a,t){var e=a.parentNode,n=t.parentNode,r,o;!e||!n||e.isEqualNode(t)||n.isEqualNode(a)||(r=wn(a),o=wn(t),e.isEqualNode(n)&&r<o&&o++,e.insertBefore(t,e.children[r]),n.insertBefore(a,n.children[o]))}var ti=[],Kr=[],nd,No,rd=!1,Mr=!1,la=!1,tn,od,bu;function b0(){function a(t){for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?Ci(document,"pointerup",this._deselectMultiDrag):(Ci(document,"mouseup",this._deselectMultiDrag),Ci(document,"touchend",this._deselectMultiDrag))),Ci(document,"keydown",this._checkKeyDown),Ci(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(r,o){var s="";ti.length&&No===t?ti.forEach(function(l,u){s+=(u?", ":"")+l.textContent}):s=o.textContent,r.setData("Text",s)}}}return a.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var n=e.dragEl;tn=n},delayEnded:function(){this.isMultiDrag=~ti.indexOf(tn)},setupClone:function(e){var n=e.sortable,r=e.cancel;if(this.isMultiDrag){for(var o=0;o<ti.length;o++)Kr.push(xh(ti[o])),Kr[o].sortableIndex=ti[o].sortableIndex,Kr[o].draggable=!1,Kr[o].style["will-change"]="",bn(Kr[o],this.options.selectedClass,!1),ti[o]===tn&&bn(Kr[o],this.options.chosenClass,!1);n._hideClone(),r()}},clone:function(e){var n=e.sortable,r=e.rootEl,o=e.dispatchSortableEvent,s=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ti.length&&No===n&&(Im(!0,r),o("clone"),s()))},showClone:function(e){var n=e.cloneNowShown,r=e.rootEl,o=e.cancel;this.isMultiDrag&&(Im(!1,r),Kr.forEach(function(s){Ft(s,"display","")}),n(),bu=!1,o())},hideClone:function(e){var n=this;e.sortable;var r=e.cloneNowHidden,o=e.cancel;this.isMultiDrag&&(Kr.forEach(function(s){Ft(s,"display","none"),n.options.removeCloneOnHide&&s.parentNode&&s.parentNode.removeChild(s)}),r(),bu=!0,o())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&No&&No.multiDrag._deselectMultiDrag(),ti.forEach(function(n){n.sortableIndex=wn(n)}),ti=ti.sort(function(n,r){return n.sortableIndex-r.sortableIndex}),la=!0},dragStarted:function(e){var n=this,r=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(r.captureAnimationState(),this.options.animation)){ti.forEach(function(s){s!==tn&&Ft(s,"position","absolute")});var o=hn(tn,!1,!0,!0);ti.forEach(function(s){s!==tn&&bm(s,o)}),Mr=!0,rd=!0}r.animateAll(function(){Mr=!1,rd=!1,n.options.animation&&ti.forEach(function(s){Th(s)}),n.options.sort&&Cu()})}},dragOver:function(e){var n=e.target,r=e.completed,o=e.cancel;Mr&&~ti.indexOf(n)&&(r(!1),o())},revert:function(e){var n=e.fromSortable,r=e.rootEl,o=e.sortable,s=e.dragRect;ti.length>1&&(ti.forEach(function(l){o.addAnimationState({target:l,rect:Mr?hn(l):s}),Th(l),l.fromRect=s,n.removeAnimationState(l)}),Mr=!1,C0(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(e){var n=e.sortable,r=e.isOwner,o=e.insertion,s=e.activeSortable,l=e.parentEl,u=e.putSortable,p=this.options;if(o){if(r&&s._hideClone(),rd=!1,p.animation&&ti.length>1&&(Mr||!r&&!s.options.sort&&!u)){var c=hn(tn,!1,!0,!0);ti.forEach(function(m){m!==tn&&(bm(m,c),l.appendChild(m))}),Mr=!0}if(!r)if(Mr||Cu(),ti.length>1){var f=bu;s._showClone(n),s.options.animation&&!bu&&f&&Kr.forEach(function(m){s.addAnimationState({target:m,rect:od}),m.fromRect=od,m.thisAnimationDuration=null})}else s._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,r=e.isOwner,o=e.activeSortable;if(ti.forEach(function(l){l.thisAnimationDuration=null}),o.options.animation&&!r&&o.multiDrag.isMultiDrag){od=ho({},n);var s=wl(tn,!0);od.top-=s.f,od.left-=s.e}},dragOverAnimationComplete:function(){Mr&&(Mr=!1,Cu())},drop:function(e){var n=e.originalEvent,r=e.rootEl,o=e.parentEl,s=e.sortable,l=e.dispatchSortableEvent,u=e.oldIndex,p=e.putSortable,c=p||this.sortable;if(n){var f=this.options,m=o.children;if(!la)if(f.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),bn(tn,f.selectedClass,!~ti.indexOf(tn)),~ti.indexOf(tn))ti.splice(ti.indexOf(tn),1),nd=null,Ka({sortable:s,rootEl:r,name:"deselect",targetEl:tn,originalEvent:n});else{if(ti.push(tn),Ka({sortable:s,rootEl:r,name:"select",targetEl:tn,originalEvent:n}),n.shiftKey&&nd&&s.el.contains(nd)){var v=wn(nd),_=wn(tn);if(~v&&~_&&v!==_){var C,x;for(_>v?(x=v,C=_):(x=_,C=v+1);x<C;x++)~ti.indexOf(m[x])||(bn(m[x],f.selectedClass,!0),ti.push(m[x]),Ka({sortable:s,rootEl:r,name:"select",targetEl:m[x],originalEvent:n}))}}else nd=tn;No=c}if(la&&this.isMultiDrag){if(Mr=!1,(o[hr].options.sort||o!==r)&&ti.length>1){var w=hn(tn),E=wn(tn,":not(."+this.options.selectedClass+")");if(!rd&&f.animation&&(tn.thisAnimationDuration=null),c.captureAnimationState(),!rd&&(f.animation&&(tn.fromRect=w,ti.forEach(function(k){if(k.thisAnimationDuration=null,k!==tn){var F=Mr?hn(k):w;k.fromRect=F,c.addAnimationState({target:k,rect:F})}})),Cu(),ti.forEach(function(k){m[E]?o.insertBefore(k,m[E]):o.appendChild(k),E++}),u===wn(tn))){var I=!1;ti.forEach(function(k){if(k.sortableIndex!==wn(k)){I=!0;return}}),I&&l("update")}ti.forEach(function(k){Th(k)}),c.animateAll()}No=c}(r===o||p&&p.lastPutMode!=="clone")&&Kr.forEach(function(k){k.parentNode&&k.parentNode.removeChild(k)})}},nullingGlobal:function(){this.isMultiDrag=la=!1,Kr.length=0},destroyGlobal:function(){this._deselectMultiDrag(),gi(document,"pointerup",this._deselectMultiDrag),gi(document,"mouseup",this._deselectMultiDrag),gi(document,"touchend",this._deselectMultiDrag),gi(document,"keydown",this._checkKeyDown),gi(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof la<"u"&&la)&&No===this.sortable&&!(e&&Po(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;ti.length;){var n=ti[0];bn(n,this.options.selectedClass,!1),ti.shift(),Ka({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},ho(a,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[hr];!n||!n.options.multiDrag||~ti.indexOf(e)||(No&&No!==n&&(No.multiDrag._deselectMultiDrag(),No=n),bn(e,n.options.selectedClass,!0),ti.push(e))},deselect:function(e){var n=e.parentNode[hr],r=ti.indexOf(e);!n||!n.options.multiDrag||!~r||(bn(e,n.options.selectedClass,!1),ti.splice(r,1))}},eventProperties:function(){var e=this,n=[],r=[];return ti.forEach(function(o){n.push({multiDragElement:o,index:o.sortableIndex});var s;Mr&&o!==tn?s=-1:Mr?s=wn(o,":not(."+e.options.selectedClass+")"):s=wn(o),r.push({multiDragElement:o,index:s})}),{items:W_(ti),clones:[].concat(Kr),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function C0(a,t){ti.forEach(function(e,n){var r=t.children[e.sortableIndex+(a?Number(n):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function Im(a,t){Kr.forEach(function(e,n){var r=t.children[e.sortableIndex+(a?Number(n):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function Cu(){ti.forEach(function(a){a!==tn&&a.parentNode&&a.parentNode.removeChild(a)})}Gt.mount(new v0),Gt.mount(Vh,Bh);const aa=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:b0,Sortable:Gt,Swap:g0,default:Gt},Symbol.toStringTag,{value:"Module"}));var zh;const yu=(zh=aa==null?void 0:Gt)!==null&&zh!==void 0?zh:aa;class y0{constructor(t,e,n){this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._gridColumns=[],this._gridUid="",this._reorderedColumns=[],this._subscriptions=[],this._defaults={dropPlaceHolderText:"Drop a column header here to group by the column",hideGroupSortIcons:!1,hideToggleAllButton:!1,toggleAllButtonText:"",toggleAllPlaceholderText:"Toggle all Groups"},this.columnsGroupBy=[],this.pluginName="DraggableGrouping",this._bindingEventService=new Fn,this._eventHandler=new Slick.EventHandler,this.onGroupChanged=new Slick.Event}get addonOptions(){return this._addonOptions}get dataView(){var t,e,n;return(n=(e=(t=this.grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get dropboxElement(){return this._dropzoneElm}get droppableInstance(){return this._droppableInstance}get sortableLeftInstance(){return this._sortableLeftInstance}get sortableRightInstance(){return this._sortableRightInstance}get eventHandler(){return this._eventHandler}get grid(){var t,e;return(e=(t=this._grid)!==null&&t!==void 0?t:this.sharedService.slickGrid)!==null&&e!==void 0?e:{}}get gridOptions(){var t;return(t=this.sharedService.gridOptions)!==null&&t!==void 0?t:{}}get gridUid(){var t,e;return this._gridUid||((e=(t=this.grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:"")}init(t,e){var n,r,o,s,l,u;if(this._addonOptions={...this._defaults,...e},this._grid=t,t){if(this._gridUid=t.getUID(),this._gridColumns=t.getColumns(),this._dropzoneElm=t.getPreHeaderPanel(),this._dropzoneElm.classList.add("slick-dropzone"),!this._addonOptions.hideToggleAllButton){this._groupToggler=De("div",{className:"slick-group-toggle-all",title:(n=this._addonOptions.toggleAllPlaceholderText)!==null&&n!==void 0?n:"",style:{display:"none"}});const p=De("span",{className:"slick-group-toggle-all-icon"},this._groupToggler);this.gridOptions.enableTranslate&&this._addonOptions.toggleAllButtonTextKey&&(this._addonOptions.toggleAllButtonText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllButtonTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this.gridOptions.enableTranslate&&this._addonOptions.toggleAllPlaceholderTextKey&&(this._addonOptions.toggleAllPlaceholderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllPlaceholderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._groupToggler.title=(r=this._addonOptions.toggleAllPlaceholderText)!==null&&r!==void 0?r:"",this._addonOptions.toggleAllButtonText&&this._groupToggler.appendChild(De("span",{className:"slick-group-toggle-all-text",textContent:this._addonOptions.toggleAllButtonText||""})),this._dropzoneElm.appendChild(this._groupToggler),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuCollapseAllGroups",()=>this.toggleGroupToggler(p,!0,!1)),this.pubSubService.subscribe("onContextMenuExpandAllGroups",()=>this.toggleGroupToggler(p,!1,!1)))}this._dropzonePlaceholderElm=De("div",{className:"slick-draggable-dropzone-placeholder"},this._dropzoneElm),this.gridOptions.enableTranslate&&(!((o=this._addonOptions)===null||o===void 0)&&o.dropPlaceHolderTextKey)&&(this._addonOptions.dropPlaceHolderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.dropPlaceHolderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._dropzonePlaceholderElm.textContent=(u=(l=(s=this._addonOptions)===null||s===void 0?void 0:s.dropPlaceHolderText)!==null&&l!==void 0?l:this._defaults.dropPlaceHolderText)!==null&&u!==void 0?u:"",this.setupColumnDropbox(),this._eventHandler.subscribe(t.onHeaderCellRendered,(p,c)=>{var f;const m=c.node;if(!rh((f=c.column)===null||f===void 0?void 0:f.grouping)&&m&&(m.style.cursor="pointer",this._addonOptions.groupIconCssClass)){const v=De("span",{className:"slick-column-groupable"},m);this._addonOptions.groupIconCssClass&&v.classList.add(...this._addonOptions.groupIconCssClass.split(" "))}}),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuClearGrouping",()=>this.clearDroppedGroups()));for(const p of this._gridColumns){const c=p.field;t.updateColumnHeader(c)}}return this}dispose(){this.destroySortableInstances(),this.onGroupChanged.unsubscribe(),this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._bindingEventService.unbindAll(),en(document.querySelector(`.${this.gridUid} .slick-preheader-panel`))}clearDroppedGroups(){this.columnsGroupBy=[],this.updateGroupBy("clear-all");const t=this._dropzoneElm.querySelectorAll(".slick-dropped-grouping");for(const e of Array.from(t)){const n=this._dropzoneElm.querySelector(".slick-groupby-remove");n==null||n.remove(),e==null||e.remove()}this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")}destroySortableInstances(){var t,e,n,r;!((t=this._sortableLeftInstance)===null||t===void 0)&&t.el&&((e=this._sortableLeftInstance)===null||e===void 0||e.destroy()),!((n=this._sortableRightInstance)===null||n===void 0)&&n.el&&((r=this._sortableRightInstance)===null||r===void 0||r.destroy())}setAddonOptions(t){this._addonOptions={...this._addonOptions,...t}}setColumns(t){this._gridColumns=t}setDroppedGroups(t){this._dropzonePlaceholderElm.style.display="none";const e=Array.isArray(t)?t:[t];for(const n of e){const r=this.grid.getHeaderColumn(n);this.handleGroupByDrop(this._dropzoneElm,r)}}setupColumnReorder(t,e,n,r,o,s,l,u,p){this.destroySortableInstances();const c=t.getPreHeaderPanel(),f=c.querySelector(".slick-draggable-dropzone-placeholder"),m=c.querySelector(".slick-group-toggle-all"),v={animation:50,chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dataIdAttr:"data-id",group:{name:"shared",pull:"clone",put:!1},revertClone:!0,onStart:()=>{f&&(f.style.display="inline-block"),c.querySelectorAll(".slick-dropped-grouping").forEach(C=>C.style.display="none"),m&&(m.style.display="none")},onEnd:_=>{var C,x,w,E,I;c==null||c.classList.remove("slick-dropzone-hover"),(C=f==null?void 0:f.parentElement)===null||C===void 0||C.classList.remove("slick-dropzone-placeholder-hover");const k=c.querySelectorAll(".slick-dropped-grouping");if(k.forEach(Q=>Q.style.display="flex"),k.length&&(f&&(f.style.display="none"),m&&(m.style.display="inline-block")),!t.getEditorLock().commitCurrentEdit())return;const F=(w=(x=this.sortableLeftInstance)===null||x===void 0?void 0:x.toArray())!==null&&w!==void 0?w:[];if(e.length>1){const Q=(I=(E=this._sortableRightInstance)===null||E===void 0?void 0:E.toArray())!==null&&I!==void 0?I:[];for(const L of Q)F.push(L)}const N=[],V=t.getColumns();for(const Q of F)N.push(V[l(Q)]);r(N),p(t.onColumnsReordered,{grid:t}),_.stopPropagation(),o()}};return this._sortableLeftInstance=yu.create(document.querySelector(`.${t.getUID()} .slick-header-columns.slick-header-columns-left`),v),this._sortableRightInstance=yu.create(document.querySelector(`.${t.getUID()} .slick-header-columns.slick-header-columns-right`),v),{sortableLeftInstance:this._sortableLeftInstance,sortableRightInstance:this._sortableRightInstance}}addColumnGroupBy(t){this.columnsGroupBy.push(t),this.updateGroupBy("add-group")}addGroupByRemoveClickHandler(t,e,n,r){this._bindingEventService.bind(e,"click",()=>{const o=this._bindingEventService.boundedEvents.filter(s=>s.element===e);for(const s of o)this._bindingEventService.unbind(s.element,"click",s.listener);this.removeGroupBy(t,n,r)})}addGroupSortClickHandler(t,e){const{grouping:n,type:r}=t;this._bindingEventService.bind(e,"click",()=>{if(this.toggleGroupAll(t,!1),n){const o=n.sortAsc?Yi.desc:Yi.asc;n.comparer=(s,l)=>ea(r||"text",s.value,l.value,o,t,this.gridOptions),this.getGroupBySortIcon(e,!n.sortAsc),this.updateGroupBy("sort-group"),n.sortAsc=!n.sortAsc,this.grid.invalidate()}})}getGroupBySortIcon(t,e=!0){var n,r,o,s;e?this._addonOptions.sortAscIconCssClass?(t.classList.remove(...(r=(n=this._addonOptions.sortDescIconCssClass)===null||n===void 0?void 0:n.split(" "))!==null&&r!==void 0?r:""),t.classList.add(...this._addonOptions.sortAscIconCssClass.split(" "))):(t.classList.add("slick-groupby-sort-asc-icon"),t.classList.remove("slick-groupby-sort-desc-icon")):this._addonOptions.sortDescIconCssClass?(t.classList.remove(...(s=(o=this._addonOptions.sortAscIconCssClass)===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:""),t.classList.add(...this._addonOptions.sortDescIconCssClass.split(" "))):this._addonOptions.sortDescIconCssClass||(t.classList.add("slick-groupby-sort-desc-icon"),t.classList.remove("slick-groupby-sort-asc-icon"))}handleGroupByDrop(t,e){var n,r,o;const s=(n=e.getAttribute("data-id"))===null||n===void 0?void 0:n.replace(this._gridUid,"");let l=!0;for(const u of this.columnsGroupBy)u.id===s&&(l=!1);if(l){for(const u of this._gridColumns)if(u.id===s&&u.grouping&&!rh(u.grouping)){const p=e.querySelector(".slick-column-name"),c=De("div",{id:`${this._gridUid}_${u.id}_entry`,className:"slick-dropped-grouping",dataset:{id:`${u.id}`}});De("div",{className:"slick-dropped-grouping-title",style:{display:"inline-flex"},textContent:p?p.textContent:e.textContent},c);const f=De("div",{className:"slick-groupby-remove"});this._addonOptions.deleteIconCssClass&&f.classList.add(...this._addonOptions.deleteIconCssClass.split(" ")),this._addonOptions.deleteIconCssClass||f.classList.add("slick-groupby-remove-icon");let m;((r=this._addonOptions)===null||r===void 0?void 0:r.hideGroupSortIcons)!==!0&&u.sortable&&(((o=u.grouping)===null||o===void 0?void 0:o.sortAsc)===void 0&&(u.grouping.sortAsc=!0),m=De("div",{className:"slick-groupby-sort"},c),this.getGroupBySortIcon(m,u.grouping.sortAsc)),c.appendChild(f),c.appendChild(document.createElement("div")),t.appendChild(c),this._groupToggler&&this.columnsGroupBy.length===0&&this.toggleGroupAll(u),this.addColumnGroupBy(u),this.addGroupByRemoveClickHandler(u.id,f,e,c),m&&this.addGroupSortClickHandler(u,m)}this._groupToggler&&this.columnsGroupBy.length>0&&(this._groupToggler.style.display="inline-block")}}toggleGroupAll({grouping:t},e){var n;const r=(n=this._groupToggler)===null||n===void 0?void 0:n.querySelector(".slick-group-toggle-all-icon");e===!0||t!=null&&t.collapsed?(r==null||r.classList.add("collapsed"),r==null||r.classList.remove("expanded")):(r==null||r.classList.add("expanded"),r==null||r.classList.remove("collapsed"))}removeFromArray(t,e){if(Array.isArray(t)){const n=t.findIndex(r=>r.id===e.id);n>=0&&t.splice(n,1)}return t}removeGroupBy(t,e,n){n.remove();const r=[];this._gridColumns.forEach(o=>r[o.id]=o),this.removeFromArray(this.columnsGroupBy,r[t]),this.columnsGroupBy.length===0&&(this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")),this.updateGroupBy("remove-group")}addDragOverDropzoneListeners(){const t=this._dropzoneElm.querySelector(".slick-draggable-dropzone-placeholder");t&&this._dropzoneElm&&(this._bindingEventService.bind(t,"dragover",e=>e.preventDefault()),this._bindingEventService.bind(t,"dragenter",()=>this._dropzoneElm.classList.add("slick-dropzone-hover")),this._bindingEventService.bind(t,"dragleave",()=>this._dropzoneElm.classList.remove("slick-dropzone-hover")))}setupColumnDropbox(){const t=this._dropzoneElm;this._droppableInstance=yu.create(t,{group:"shared",ghostClass:"slick-droppable-sortitem-hover",draggable:".slick-dropped-grouping",dragoverBubble:!0,onAdd:e=>{var n,r;const o=e.item;!((n=o.getAttribute("id"))===null||n===void 0)&&n.replace(this._gridUid,"")&&this.handleGroupByDrop(t,yu.utils.clone(e.item)),(r=o.parentNode)===null||r===void 0||r.removeChild(o)},onUpdate:()=>{var e,n;const r=(n=(e=this._droppableInstance)===null||e===void 0?void 0:e.toArray())!==null&&n!==void 0?n:[],o=[];for(const s of r)for(const l of this.columnsGroupBy)if(l.id===s){o.push(l);break}this.columnsGroupBy=o,this.updateGroupBy("sort-group")}}),this.addDragOverDropzoneListeners(),this._groupToggler&&this._bindingEventService.bind(this._groupToggler,"click",e=>{const n=e.target.classList.contains("slick-group-toggle-all-icon")?e.target:e.currentTarget.querySelector(".slick-group-toggle-all-icon");this.toggleGroupToggler(n,n==null?void 0:n.classList.contains("expanded"))})}toggleGroupToggler(t,e=!0,n=!0){t&&(e===!0?(t.classList.add("collapsed"),t.classList.remove("expanded"),n&&this.dataView.collapseAllGroups()):(t.classList.remove("collapsed"),t.classList.add("expanded"),n&&this.dataView.expandAllGroups()))}updateGroupBy(t){if(this.columnsGroupBy.length===0){this.dataView.setGrouping([]),this._dropzonePlaceholderElm.style.display="inline-block",this.triggerOnGroupChangedEvent({caller:t,groupColumns:[]});return}const e=[];this.columnsGroupBy.forEach(n=>e.push(n.grouping)),this.dataView.setGrouping(e),this._dropzonePlaceholderElm.style.display="none",this.triggerOnGroupChangedEvent({caller:t,groupColumns:e})}triggerOnGroupChangedEvent(t){this._addonOptions&&typeof this._addonOptions.onGroupChanged=="function"&&this._addonOptions.onGroupChanged(new Slick.EventData,t),this.onGroupChanged.notify(t)}}class Dm{constructor(){this._defaults={groupCssClass:"slick-group",groupTitleCssClass:"slick-group-title",totalsCssClass:"slick-group-totals",groupFocusable:!0,indentation:15,totalsFocusable:!1,toggleCssClass:"slick-group-toggle",toggleExpandedCssClass:"expanded",toggleCollapsedCssClass:"collapsed",enableExpandCollapse:!0,groupFormatter:this.defaultGroupCellFormatter.bind(this),totalsFormatter:this.defaultTotalsCellFormatter.bind(this),includeHeaderTotals:!1},this._eventHandler=new Slick.EventHandler,this._options=this._defaults}get eventHandler(){return this._eventHandler}get dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get grid(){return this._grid}init(t,e){this._grid=t,this._options={...this._defaults,...e},this._eventHandler.subscribe(t.onClick,this.handleGridClick.bind(this)),this._eventHandler.subscribe(t.onKeyDown,this.handleGridKeyDown.bind(this))}dispose(){var t;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll()}getOptions(){return this._options}setOptions(t){this._options={...this._options,...t}}getGroupRowMetadata(t){return{selectable:!1,focusable:this._options.groupFocusable,cssClasses:`${this._options.groupCssClass} slick-group-level-${(t==null?void 0:t.level)||0}`,formatter:this._options.includeHeaderTotals&&this._options.totalsFormatter,columns:{0:{colspan:this._options.includeHeaderTotals?"1":"*",formatter:this._options.groupFormatter,editor:null}}}}getTotalsRowMetadata(t){var e;return{selectable:!1,focusable:this._options.totalsFocusable,cssClasses:`${this._options.totalsCssClass} slick-group-level-${((e=t==null?void 0:t.group)===null||e===void 0?void 0:e.level)||0}`,formatter:this._options.totalsFormatter,editor:null}}defaultGroupCellFormatter(t,e,n,r,o){var s,l;if(!this._options.enableExpandCollapse)return o.title;const u=o.level||0,p=(l=(s=this._options)===null||s===void 0?void 0:s.indentation)!==null&&l!==void 0?l:15,c=`${u*p}px`,f=o.collapsed?this._options.toggleCollapsedCssClass:this._options.toggleExpandedCssClass;return`<span class="${this._options.toggleCssClass} ${f}" aria-expanded="${!o.collapsed}" style="margin-left: ${c}"></span><span class="${this._options.groupTitleCssClass}" level="${u}">${o.title||""}</span>`}defaultTotalsCellFormatter(t,e,n,r,o,s){var l,u;return(u=(l=r==null?void 0:r.groupTotalsFormatter)===null||l===void 0?void 0:l.call(r,o,r,s))!==null&&u!==void 0?u:""}handleGridClick(t,e){const n=t.target,r=this.grid.getDataItem(e.row);r instanceof Slick.Group&&n.classList.contains(this._options.toggleCssClass||"")&&(this.handleDataViewExpandOrCollapse(r),t.stopImmediatePropagation(),t.preventDefault())}handleGridKeyDown(t){if(this._options.enableExpandCollapse&&t.keyCode===li.SPACE){const e=this.grid.getActiveCell();if(e){const n=this.grid.getDataItem(e.row);n instanceof Slick.Group&&(this.handleDataViewExpandOrCollapse(n),t.stopImmediatePropagation(),t.preventDefault())}}}handleDataViewExpandOrCollapse(t){const e=this.grid.getRenderedRange();this.dataView.setRefreshHints({ignoreDiffsBefore:e.top,ignoreDiffsAfter:e.bottom+1}),t.collapsed?this.dataView.expandGroup(t.groupingKey):this.dataView.collapseGroup(t.groupingKey)}}class E0 extends eu{constructor(t,e,n){super(t,e,n),this.extensionUtility=t,this.pubSubService=e,this.sharedService=n,this._buttonElms=[],this._defaults={buttonCssClass:"slick-header-button"},this.pluginName="HeaderButtons",this._menuCssPrefix="slick-header-button",this._camelPluginName="headerButtons",this._bindEventService=new Fn,this._eventHandler=new Slick.EventHandler,this.init(n.gridOptions.headerButton)}get addonOptions(){return this._addonOptions}set addonOptions(t){this._addonOptions=t}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}init(t){this._addonOptions={...this._defaults,...t},this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns())}dispose(){super.dispose(),this._buttonElms.forEach(t=>t.remove())}handleHeaderCellRendered(t,e){var n;const r=e.column;if(!((n=r.header)===null||n===void 0)&&n.buttons&&Array.isArray(r.header.buttons)){let o=r.header.buttons.length;for(;o--;){const s=r.header.buttons[o],l=this.populateSingleCommandOrOptionItem("command",this.addonOptions,null,s,e,this.handleButtonClick.bind(this));l&&(this._buttonElms.push(l),e.node.appendChild(l))}}}handleBeforeHeaderCellDestroy(t,e){var n,r,o;if(!((n=e.column.header)===null||n===void 0)&&n.buttons&&(!((r=this._addonOptions)===null||r===void 0)&&r.buttonCssClass)){const l=(((o=this._addonOptions)===null||o===void 0?void 0:o.buttonCssClass)||"").replace(/(\s+)/g,".");l&&e.node.querySelectorAll(`.${l}`).forEach(u=>u.remove())}}handleButtonClick(t,e,n,r){var o;if(n.command&&!n.disabled){const s=n.command||"",l={grid:this.grid,column:r,button:n};s&&(l.command=s),typeof n.action=="function"&&!n.disabled&&n.action.call(this,t,l),s!==null&&!n.disabled&&(!((o=this._addonOptions)===null||o===void 0)&&o.onCommand)&&(this.pubSubService.publish("onHeaderButtonCommand",l),this._addonOptions.onCommand(t,l),r!=null&&r.id&&this.grid.updateColumnHeader(r.id))}t.preventDefault(),t.stopPropagation()}}class S0 extends eu{constructor(t,e,n,r,o){super(t,n,r),this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this._defaults={autoAlign:!0,autoAlignOffset:0,buttonCssClass:null,buttonImage:null,minWidth:100,hideColumnHideCommand:!1,hideSortCommands:!1,title:""},this.pluginName="HeaderMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-header-menu",this._camelPluginName="headerMenu",this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(this.sharedService.columnDefinitions),this.init(r.gridOptions.headerMenu)}init(t){this._addonOptions={...this._defaults,...t},this._eventHandler.subscribe(this.grid.onBeforeSetColumns,(e,n)=>{this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(n.newColumns)}),this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns()),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}dispose(){var t;super.dispose(),this._menuElm=this._menuElm||document.body.querySelector(`.slick-header-menu${this.gridUidSelector}`),(t=this._menuElm)===null||t===void 0||t.remove(),this._activeHeaderColumnElm=void 0}hideColumn(t){var e,n,r;if(!((n=(e=this.sharedService)===null||e===void 0?void 0:e.slickGrid)===null||n===void 0)&&n.getColumnIndex){const o=this.sharedService.slickGrid.getColumnIndex(t.id),s=this.sharedService.slickGrid.getColumns(),l=(r=this.sharedService.gridOptions.frozenColumn)!==null&&r!==void 0?r:-1;l>=0&&l>=o&&(this.sharedService.gridOptions.frozenColumn=l-1,this.sharedService.slickGrid.setOptions({frozenColumn:this.sharedService.gridOptions.frozenColumn}));const u=ih(s,o);this.sharedService.visibleColumns=u,this.sharedService.slickGrid.setColumns(u),this.pubSubService.publish("onHeaderMenuHideColumns",{columns:u,hiddenColumn:t})}}hideMenu(){var t,e;(t=this._menuElm)===null||t===void 0||t.remove(),this._menuElm=void 0,(e=this._activeHeaderColumnElm)===null||e===void 0||e.classList.remove("slick-header-column-active")}showMenu(t,e,n){var r,o,s;const l={grid:this.grid,column:e,menu:n};typeof t.stopPropagation=="function"&&(this.pubSubService.publish("onHeaderMenuBeforeMenuShow",l),typeof((r=this.addonOptions)===null||r===void 0?void 0:r.onBeforeMenuShow)=="function"&&((o=this.addonOptions)===null||o===void 0?void 0:o.onBeforeMenuShow(t,l))===!1)||(this._menuElm||(this._menuElm=De("div",{ariaExpanded:"true",className:"slick-header-menu",role:"menu",style:{minWidth:`${this.addonOptions.minWidth}px`}}),(s=this.grid.getContainerNode())===null||s===void 0||s.appendChild(this._menuElm)),en(this._menuElm),this.populateHeaderMenuCommandList(t,n,l))}translateHeaderMenu(){var t;!((t=this.sharedService.gridOptions)===null||t===void 0)&&t.headerMenu&&this.resetHeaderMenuTranslations(this.sharedService.visibleColumns)}handleHeaderCellRendered(t,e){var n;const r=e.column,o=(n=r.header)===null||n===void 0?void 0:n.menu;if(o&&e.node){if(!this.extensionUtility.runOverrideFunctionWhenExists(this.addonOptions.menuUsabilityOverride,e))return;const s=De("div",{className:"slick-header-menu-button",ariaLabel:"Header Menu"},e.node);this.addonOptions.buttonCssClass&&s.classList.add(...this.addonOptions.buttonCssClass.split(" ")),this.addonOptions.tooltip&&(s.title=this.addonOptions.tooltip),this._bindEventService.bind(s,"click",l=>this.showMenu(l,r,o))}}handleBeforeHeaderCellDestroy(t,e){var n;!((n=e.column.header)===null||n===void 0)&&n.menu&&e.node.querySelectorAll(".slick-header-menu-button").forEach(o=>o.remove())}handleBodyMouseDown(t){var e;(this._menuElm!==t.target&&!(!((e=this._menuElm)===null||e===void 0)&&e.contains(t.target))||t.target.className==="close")&&this.hideMenu()}handleMenuItemCommandClick(t,e,n,r){var o;if(n==="divider"||n.command&&(n.disabled||n.divider))return!1;const s={grid:this.grid,command:n.command,column:r,item:n};this.executeHeaderMenuInternalCommands(t,s),this.pubSubService.publish("onHeaderMenuCommand",s),typeof((o=this.addonOptions)===null||o===void 0?void 0:o.onCommand)=="function"&&this.addonOptions.onCommand(t,s),typeof n.action=="function"&&n.action.call(this,t,s),t.defaultPrevented||this.hideMenu(),t.preventDefault(),t.stopPropagation()}addHeaderMenuCustomCommands(t){const e=this.sharedService.gridOptions,n=e.headerMenu||{},r=ao(e);return Array.isArray(t)&&e.enableHeaderMenu&&t.forEach(o=>{var s,l,u;if(o&&!o.excludeFromHeaderMenu){o.header?o.header.menu||(o.header.menu={items:[]}):o.header={menu:{items:[]}};const p=(u=(l=(s=o==null?void 0:o.header)===null||s===void 0?void 0:s.menu)===null||l===void 0?void 0:l.items)!==null&&u!==void 0?u:[];let c=!1;n&&!n.hideFreezeColumnsCommand&&(c=!0,p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="freeze-columns")||p.push({iconCssClass:n.iconFreezeColumns||"fa fa-thumb-tack",titleKey:`${r}FREEZE_COLUMNS`,command:"freeze-columns",positionOrder:47})),n&&!n.hideColumnResizeByContentCommand&&this.sharedService.gridOptions.enableColumnResizeOnDoubleClick&&(c=!0,p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="column-resize-by-content")||p.push({iconCssClass:n.iconColumnResizeByContentCommand||"fa fa-arrows-h",titleKey:`${r}COLUMN_RESIZE_BY_CONTENT`,command:"column-resize-by-content",positionOrder:48})),c&&!p.some(f=>f!=="divider"&&f.positionOrder===49)&&p.push({divider:!0,command:"",positionOrder:49}),e.enableSorting&&o.sortable&&n&&!n.hideSortCommands&&(p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="sort-asc")||p.push({iconCssClass:n.iconSortAscCommand||"fa fa-sort-asc",titleKey:`${r}SORT_ASCENDING`,command:"sort-asc",positionOrder:50}),p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="sort-desc")||p.push({iconCssClass:n.iconSortDescCommand||"fa fa-sort-desc",titleKey:`${r}SORT_DESCENDING`,command:"sort-desc",positionOrder:51}),p.some(f=>f!=="divider"&&f.positionOrder===52)||p.push({divider:!0,command:"",positionOrder:52}),!n.hideClearSortCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="clear-sort")&&p.push({iconCssClass:n.iconClearSortCommand||"fa fa-unsorted",titleKey:`${r}REMOVE_SORT`,command:"clear-sort",positionOrder:54})),e.enableFiltering&&o.filterable&&n&&!n.hideFilterCommand&&!n.hideClearFilterCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="clear-filter")&&p.push({iconCssClass:n.iconClearFilterCommand||"fa fa-filter",titleKey:`${r}REMOVE_FILTER`,command:"clear-filter",positionOrder:53}),n&&!n.hideColumnHideCommand&&!p.some(f=>f!=="divider"&&(f==null?void 0:f.command)==="hide-column")&&p.push({iconCssClass:n.iconColumnHideCommand||"fa fa-times",titleKey:`${r}HIDE_COLUMN`,command:"hide-column",positionOrder:55}),this.extensionUtility.translateMenuItemsFromTitleKey(p),this.extensionUtility.sortItems(p,"positionOrder")}}),n}clearColumnFilter(t,e){e!=null&&e.column&&this.filterService.clearFilterByColumnId(t,e.column.id)}clearColumnSort(t,e){e!=null&&e.column&&this.sharedService&&this.sortService.clearSortByColumnId(t,e.column.id)}executeHeaderMenuInternalCommands(t,e){var n;if(e!=null&&e.command)switch(e.command){case"hide-column":this.hideColumn(e.column),!((n=this.sharedService.gridOptions)===null||n===void 0)&&n.enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"clear-filter":this.clearColumnFilter(t,e);break;case"clear-sort":this.clearColumnSort(t,e);break;case"column-resize-by-content":this.pubSubService.publish("onHeaderMenuColumnResizeByContent",{columnId:e.column.id});break;case"freeze-columns":const r=[...this.sharedService.visibleColumns],s={frozenColumn:r.findIndex(c=>c.id===e.column.id),enableMouseWheelScrollHandler:!0},l=this.sharedService.slickGrid.getColumns();this.sharedService.slickGrid.setOptions(s,!1,!0),this.sharedService.gridOptions.frozenColumn=s.frozenColumn,this.sharedService.gridOptions.enableMouseWheelScrollHandler=s.enableMouseWheelScrollHandler,this.sharedService.frozenVisibleColumnId=e.column.id,this.sharedService.hasColumnsReordered||Array.isArray(r)&&Array.isArray(this.sharedService.allColumns)&&r.length!==this.sharedService.allColumns.length?this.sharedService.slickGrid.setColumns(r):this.sharedService.slickGrid.setColumns(l),this.sharedService.slickGrid.getOptions().enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"sort-asc":case"sort-desc":const p=e.command==="sort-asc";this.sortColumn(t,e,p);break}}populateHeaderMenuCommandList(t,e,n){var r,o;this.populateCommandOrOptionItems("command",this.addonOptions,this._menuElm,e.items,n,this.handleMenuItemCommandClick),this.repositionMenu(t),this.pubSubService.publish("onHeaderMenuAfterMenuShow",n),!(typeof((r=this.addonOptions)===null||r===void 0?void 0:r.onAfterMenuShow)=="function"&&((o=this.addonOptions)===null||o===void 0?void 0:o.onAfterMenuShow(t,n))===!1)&&(t.preventDefault(),t.stopPropagation())}repositionMenu(t){var e,n,r,o,s,l,u,p;const c=t.target;if(this._menuElm&&c.classList.contains("slick-header-menu-button")){const f=x_(this.sharedService.gridContainerElement,c);let m=(e=f==null?void 0:f.left)!==null&&e!==void 0?e:0;if(this.addonOptions.autoAlign){const v=this.grid.getGridPosition();v!=null&&v.width&&m+((n=this._menuElm.clientWidth)!==null&&n!==void 0?n:0)>=v.width&&(m=m+c.clientWidth-this._menuElm.clientWidth+((o=(r=this.addonOptions)===null||r===void 0?void 0:r.autoAlignOffset)!==null&&o!==void 0?o:0))}this._menuElm.style.top=`${((s=f==null?void 0:f.top)!==null&&s!==void 0?s:0)+((u=(l=this.addonOptions)===null||l===void 0?void 0:l.menuOffsetTop)!==null&&u!==void 0?u:0)+c.clientHeight}px`,this._menuElm.style.left=`${m}px`,this._activeHeaderColumnElm=this._menuElm.closest(".slick-header-column"),(p=this._activeHeaderColumnElm)===null||p===void 0||p.classList.add("slick-header-column-active")}}resetHeaderMenuTranslations(t){t.forEach(e=>{var n,r;if(!((r=(n=e==null?void 0:e.header)===null||n===void 0?void 0:n.menu)===null||r===void 0)&&r.items&&!e.excludeFromHeaderMenu){const o=e.header.menu.items||[];this.extensionUtility.translateMenuItemsFromTitleKey(o)}})}sortColumn(t,e,n=!0){if(e!=null&&e.column){const r=e.column,o=this.sharedService.gridOptions.multiColumnSort?this.sortService.getCurrentColumnSorts(r.id+""):[];let s=Ji.local;o.push({columnId:r.id,sortCol:r,sortAsc:n}),this.sharedService.gridOptions.backendServiceApi?(this.sortService.onBackendSortChanged(t,{multiColumnSort:!0,sortCols:o,grid:this.sharedService.slickGrid}),s=Ji.remote):this.sharedService.dataView?(this.sortService.onLocalSortChanged(this.sharedService.slickGrid,o),s=Ji.local):e.grid.onSort.notify(o);const l=o.map(u=>{var p,c,f;return{columnId:(c=(p=u==null?void 0:u.sortCol)===null||p===void 0?void 0:p.id)!==null&&c!==void 0?c:"",sortAsc:(f=u==null?void 0:u.sortAsc)!==null&&f!==void 0?f:!0}});if(this.sharedService.slickGrid.setSortColumns(l),s){const u=[];l.forEach(p=>{u.push({columnId:`${p.columnId}`,direction:p.sortAsc?"ASC":"DESC"})}),this.sortService.emitSortChanged(s,u)}}}}class Rm{constructor(t){this.pubSubService=t,this._dragging=!1,this._handler=new Slick.EventHandler,this._defaults={autoScroll:!0,columnId:"_move",cssClass:"slick-row-move-column",cancelEditOnDrag:!1,disableRowSelection:!1,hideRowMoveShadow:!0,rowMoveShadowMarginTop:0,rowMoveShadowMarginLeft:0,rowMoveShadowOpacity:.9,rowMoveShadowScale:.75,singleRowMove:!1,width:40},this.onBeforeMoveRows=new Slick.Event,this.onMoveRows=new Slick.Event,this.pluginName="RowMoveManager",this._eventHandler=new Slick.EventHandler}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}init(t,e){var n;this._addonOptions={...this._defaults,...e},this._grid=t,this._canvas=this._grid.getCanvasNode(),typeof((n=this._addonOptions)===null||n===void 0?void 0:n.usabilityOverride)=="function"&&this.usabilityOverride(this._addonOptions.usabilityOverride),this._eventHandler.subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this))}dispose(){var t;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll()}create(t,e){var n,r;if(this._addonOptions={...this._defaults,...e.rowMoveManager},Array.isArray(t)&&e){const o=this.getColumnDefinition();if(!t.some(s=>s.id===o.id)){const s=Array.isArray(t)&&t.find(p=>(p==null?void 0:p.behavior)==="selectAndMove"),l=s||o,u=(r=(n=e==null?void 0:e.rowMoveManager)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:0;u>0?t.splice(u,0,l):t.unshift(l),this.pubSubService.publish("onPluginColumnsChanged",{columns:t,pluginName:this.pluginName})}}return this}getColumnDefinition(){var t,e;const n=String((e=(t=this._addonOptions)===null||t===void 0?void 0:t.columnId)!==null&&e!==void 0?e:this._defaults.columnId);return{id:n,name:"",behavior:"selectAndMove",excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,field:n,resizable:!1,selectable:!1,width:this._addonOptions.width||40,formatter:this.moveIconFormatter.bind(this)}}usabilityOverride(t){this._usabilityOverride=t}setOptions(t){this._addonOptions={...this._addonOptions,...t}}handleDragInit(t){t.stopImmediatePropagation()}handleDragEnd(t,e){var n,r,o;if(this._dragging&&(this._dragging=!1,t.stopImmediatePropagation(),(n=e.guide)===null||n===void 0||n.remove(),(r=e.selectionProxy)===null||r===void 0||r.remove(),(o=e.clonedSlickRow)===null||o===void 0||o.remove(),e.canMove)){const s={grid:this._grid,rows:e.selectedRows,insertBefore:e.insertBefore};typeof this._addonOptions.onMoveRows=="function"&&this._addonOptions.onMoveRows(t,s),this.onMoveRows.notify(s)}}handleDrag(t,e){var n,r,o,s,l,u;if(this._dragging){t.stopImmediatePropagation();const c=((r=(n=t==null?void 0:t.touches)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:t).pageY-((s=(o=qn(this._canvas))===null||o===void 0?void 0:o.top)!==null&&s!==void 0?s:0);e.selectionProxy.style.top=`${c-5}px`,e.selectionProxy.style.display="block",e.clonedSlickRow&&(e.clonedSlickRow.style.top=`${c-6}px`,e.clonedSlickRow.style.display="block");const f=Math.max(0,Math.min(Math.round(c/(this.gridOptions.rowHeight||0)),this._grid.getDataLength()));if(f!==e.insertBefore){const m={grid:this._grid,rows:e.selectedRows,insertBefore:f};if(((u=(l=this._addonOptions)===null||l===void 0?void 0:l.onBeforeMoveRows)===null||u===void 0?void 0:u.call(l,t,m))===!1||this.onBeforeMoveRows.notify(m).getReturnValue()===!1?e.canMove=!1:e.canMove=!0,this._usabilityOverride&&e.canMove){const v=this._grid.getDataItem(f);e.canMove=this.checkUsabilityOverride(f,v,this._grid)}e.canMove?e.guide.style.top=`${f*(this.gridOptions.rowHeight||0)}px`:e.guide.style.top="-1000px",e.insertBefore=f}}}handleDragStart(t,e){var n,r,o,s,l,u,p;const c=this._grid.getCellFromEvent(t)||{cell:-1,row:-1},f=c.row,m=this._grid.getDataItem(f);if(this.checkUsabilityOverride(f,m,this._grid)){if(this._addonOptions.cancelEditOnDrag&&this._grid.getEditorLock().isActive()&&this._grid.getEditorLock().cancelCurrentEdit(),this._grid.getEditorLock().isActive()||!/move|selectAndMove/.test(this._grid.getColumns()[c.cell].behavior||""))return!1;if(this._dragging=!0,t.stopImmediatePropagation(),!this.addonOptions.hideRowMoveShadow){const C=(n=this._grid.getCellNode(c.row,c.cell))===null||n===void 0?void 0:n.closest(".slick-row");C&&(e.clonedSlickRow=C.cloneNode(!0),e.clonedSlickRow.classList.add("slick-reorder-shadow-row"),e.clonedSlickRow.style.display="none",e.clonedSlickRow.style.marginLeft=Xs((r=this._addonOptions)===null||r===void 0?void 0:r.rowMoveShadowMarginLeft,"0px"),e.clonedSlickRow.style.marginTop=Xs((o=this._addonOptions)===null||o===void 0?void 0:o.rowMoveShadowMarginTop,"0px"),e.clonedSlickRow.style.opacity=`${(l=(s=this._addonOptions)===null||s===void 0?void 0:s.rowMoveShadowOpacity)!==null&&l!==void 0?l:.95}`,e.clonedSlickRow.style.transform=`scale(${(p=(u=this.addonOptions)===null||u===void 0?void 0:u.rowMoveShadowScale)!==null&&p!==void 0?p:.75})`,this._canvas.appendChild(e.clonedSlickRow))}let v=this._addonOptions.singleRowMove?[c.row]:this._grid.getSelectedRows();(v.length===0||!v.some(C=>C===c.row))&&(v=[c.row],this._addonOptions.disableRowSelection||this._grid.setSelectedRows(v));const _=this.gridOptions.rowHeight;e.selectedRows=v,e.selectionProxy=De("div",{className:"slick-reorder-proxy",style:{display:"none",position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,height:`${_*v.length}px`}},this._canvas),e.guide=De("div",{className:"slick-reorder-guide",style:{position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,top:"-1000px"}},this._canvas),e.insertBefore=-1}}checkUsabilityOverride(t,e,n){return typeof this._usabilityOverride=="function"?this._usabilityOverride(t,e,n):!0}moveIconFormatter(t,e,n,r,o,s){return this.checkUsabilityOverride(t,o,s)?{addClasses:`cell-reorder dnd ${this._addonOptions.cssClass||""}`,text:""}:""}}class w0{get extensionList(){return this._extensionList}get gridOptions(){return this.sharedService.gridOptions||{}}constructor(t,e,n,r,o,s,l){this.extensionUtility=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this.treeDataService=s,this.translaterService=l,this._extensionCreatedList={},this._extensionList={}}dispose(){var t;this.sharedService.visibleColumns=[];for(const e of Object.keys(this._extensionList))if(this._extensionList.hasOwnProperty(e)){const n=this._extensionList[e];!((t=n==null?void 0:n.instance)===null||t===void 0)&&t.dispose&&n.instance.dispose()}for(const e of Object.keys(this._extensionList))delete this._extensionList[e];this._cellMenuPlugin=null,this._cellExcelCopyManagerPlugin=null,this._checkboxSelectColumn=null,this._contextMenuPlugin=null,this._columnPickerControl=null,this._draggleGroupingPlugin=null,this._gridMenuControl=null,this._groupItemMetadataProviderService=null,this._headerMenuPlugin=null,this._rowMoveManagerPlugin=null,this._rowSelectionModel=null,this._extensionCreatedList=null,this._extensionList=null}addExtensionToList(t,e){this._extensionList[t]=e}getAllColumns(){return this.sharedService.allColumns||[]}getVisibleColumns(){return this.sharedService.visibleColumns||[]}getCreatedExtensionByName(t){var e;if(!((e=this._extensionCreatedList)===null||e===void 0)&&e.hasOwnProperty(t))return this._extensionCreatedList[t]}getExtensionByName(t){var e;return(e=this._extensionList)===null||e===void 0?void 0:e[t]}getExtensionInstanceByName(t){var e;return(e=this.getExtensionByName(t))===null||e===void 0?void 0:e.instance}autoResizeColumns(){this.sharedService.slickGrid.autosizeColumns()}bindDifferentExtensions(){var t,e,n,r,o,s,l,u,p,c,f;if(this.gridOptions){if(this.gridOptions.enableTranslate&&this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.gridOptions.enableAutoTooltip){const m=new F_((t=this.gridOptions)===null||t===void 0?void 0:t.autoTooltipOptions);this.sharedService.slickGrid.registerPlugin(m),this._extensionList[ni.autoTooltip]={name:ni.autoTooltip,instance:m}}if(this.gridOptions.enableExcelCopyBuffer&&(this._cellExcelCopyManagerPlugin=new P_,this._cellExcelCopyManagerPlugin.init(this.sharedService.slickGrid,this.sharedService.gridOptions.excelCopyBufferOptions),!((e=this.gridOptions.excelCopyBufferOptions)===null||e===void 0)&&e.onExtensionRegistered&&this.gridOptions.excelCopyBufferOptions.onExtensionRegistered(this._cellExcelCopyManagerPlugin),this._extensionList[ni.cellExternalCopyManager]={name:ni.cellExternalCopyManager,instance:this._cellExcelCopyManagerPlugin}),this.gridOptions.enableCellMenu&&(this._cellMenuPlugin=new L_(this.extensionUtility,this.pubSubService,this.sharedService),!((n=this.gridOptions.cellMenu)===null||n===void 0)&&n.onExtensionRegistered&&this.gridOptions.cellMenu.onExtensionRegistered(this._cellMenuPlugin),this._extensionList[ni.cellMenu]={name:ni.cellMenu,instance:this._cellMenuPlugin}),!this._rowSelectionModel&&(this.gridOptions.enableRowSelection||this.gridOptions.enableCheckboxSelector||this.gridOptions.enableRowDetailView||this.gridOptions.enableRowMoveManager)){if(!this._rowSelectionModel||!this.sharedService.slickGrid.getSelectionModel()){const m=(r=this.gridOptions.rowSelectionOptions)!==null&&r!==void 0?r:{};this.gridOptions.enableRowMoveManager&&((o=this.gridOptions.rowMoveManager)===null||o===void 0?void 0:o.dragToSelect)!==!1&&(m.dragToSelect=!0),this._rowSelectionModel=new _h(m),this.sharedService.slickGrid.setSelectionModel(this._rowSelectionModel)}this._extensionList[ni.rowSelection]={name:ni.rowSelection,instance:this._rowSelectionModel}}if(this.gridOptions.enableCheckboxSelector){this._checkboxSelectColumn=this._checkboxSelectColumn||new tm(this.pubSubService,this.gridOptions.checkboxSelector),this._checkboxSelectColumn.init(this.sharedService.slickGrid);const m=this.getCreatedExtensionByName(ni.checkboxSelector);m&&m.instance&&(this._extensionList[ni.checkboxSelector]={name:ni.checkboxSelector,instance:this._checkboxSelectColumn})}if(this.gridOptions.enableColumnPicker&&(this._columnPickerControl=new bh(this.extensionUtility,this.pubSubService,this.sharedService),!((s=this.gridOptions.columnPicker)===null||s===void 0)&&s.onExtensionRegistered&&this.gridOptions.columnPicker.onExtensionRegistered(this._columnPickerControl),this._extensionList[ni.columnPicker]={name:ni.columnPicker,instance:this._columnPickerControl}),this.gridOptions.enableContextMenu&&(this._contextMenuPlugin=new V_(this.extensionUtility,this.pubSubService,this.sharedService,this.treeDataService),!((l=this.gridOptions.contextMenu)===null||l===void 0)&&l.onExtensionRegistered&&this.gridOptions.contextMenu.onExtensionRegistered(this._contextMenuPlugin),this._extensionList[ni.contextMenu]={name:ni.contextMenu,instance:this._contextMenuPlugin}),this.gridOptions.enableDraggableGrouping&&(this._draggleGroupingPlugin&&(this._draggleGroupingPlugin.init(this.sharedService.slickGrid,this.gridOptions.draggableGrouping),!((u=this.gridOptions.draggableGrouping)===null||u===void 0)&&u.onExtensionRegistered&&this.gridOptions.draggableGrouping.onExtensionRegistered(this._draggleGroupingPlugin),this._extensionList[ni.contextMenu]={name:ni.contextMenu,instance:this._draggleGroupingPlugin}),this._extensionList[ni.draggableGrouping]={name:ni.draggableGrouping,instance:this._draggleGroupingPlugin}),this.gridOptions.enableGridMenu&&(this._gridMenuControl=new im(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),!((p=this.gridOptions.gridMenu)===null||p===void 0)&&p.onExtensionRegistered&&this.gridOptions.gridMenu.onExtensionRegistered(this._gridMenuControl),this._extensionList[ni.gridMenu]={name:ni.gridMenu,instance:this._gridMenuControl}),(this.gridOptions.enableDraggableGrouping||this.gridOptions.enableGrouping)&&(this._groupItemMetadataProviderService=this._groupItemMetadataProviderService?this._groupItemMetadataProviderService:new Dm,this._groupItemMetadataProviderService.init(this.sharedService.slickGrid),this._extensionList[ni.groupItemMetaProvider]={name:ni.groupItemMetaProvider,instance:this._groupItemMetadataProviderService}),this.gridOptions.enableHeaderButton){const m=new E0(this.extensionUtility,this.pubSubService,this.sharedService);!((c=this.gridOptions.headerButton)===null||c===void 0)&&c.onExtensionRegistered&&this.gridOptions.headerButton.onExtensionRegistered(m),this._extensionList[ni.headerButton]={name:ni.headerButton,instance:m}}if(this.gridOptions.enableHeaderMenu&&(this._headerMenuPlugin=new S0(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),!((f=this.gridOptions.headerMenu)===null||f===void 0)&&f.onExtensionRegistered&&this.gridOptions.headerMenu.onExtensionRegistered(this._headerMenuPlugin),this._extensionList[ni.headerMenu]={name:ni.headerMenu,instance:this._headerMenuPlugin}),this.gridOptions.enableRowMoveManager){this._rowMoveManagerPlugin=this._rowMoveManagerPlugin||new Rm(this.pubSubService),this._rowMoveManagerPlugin.init(this.sharedService.slickGrid,this.gridOptions.rowMoveManager);const m=this.getCreatedExtensionByName(ni.rowMoveManager);(m==null?void 0:m.instance)&&(this._extensionList[ni.rowMoveManager]={name:ni.rowMoveManager,instance:this._rowMoveManagerPlugin})}}}createExtensionsBeforeGridCreation(t,e){var n,r,o,s;const l=[];e.enableCheckboxSelector&&(this.getCreatedExtensionByName(ni.checkboxSelector)||(this._checkboxSelectColumn=new tm(this.pubSubService,this.sharedService.gridOptions.checkboxSelector),l.push({name:ni.checkboxSelector,extension:this._checkboxSelectColumn,columnIndexPosition:(r=(n=e==null?void 0:e.checkboxSelector)===null||n===void 0?void 0:n.columnIndexPosition)!==null&&r!==void 0?r:l.length}))),e.enableRowMoveManager&&(this.getCreatedExtensionByName(ni.rowMoveManager)||(this._rowMoveManagerPlugin=new Rm(this.pubSubService),l.push({name:ni.rowMoveManager,extension:this._rowMoveManagerPlugin,columnIndexPosition:(s=(o=e==null?void 0:e.rowMoveManager)===null||o===void 0?void 0:o.columnIndexPosition)!==null&&s!==void 0?s:l.length}))),this.createExtensionByTheirColumnIndex(l,t,e),e.enableDraggableGrouping&&(this.getCreatedExtensionByName(ni.draggableGrouping)||(this._draggleGroupingPlugin=new y0(this.extensionUtility,this.pubSubService,this.sharedService),this._draggleGroupingPlugin&&(e.enableColumnReorder=this._draggleGroupingPlugin.setupColumnReorder.bind(this._draggleGroupingPlugin),this._extensionCreatedList[ni.draggableGrouping]={name:ni.draggableGrouping,instance:this._draggleGroupingPlugin})))}hideColumn(t){var e,n;if(typeof((n=(e=this.sharedService)===null||e===void 0?void 0:e.slickGrid)===null||n===void 0?void 0:n.getColumns)=="function"){const r=this.sharedService.slickGrid.getColumnIndex(t.id);this.sharedService.visibleColumns=this.removeColumnByIndex(this.sharedService.slickGrid.getColumns(),r),this.sharedService.slickGrid.setColumns(this.sharedService.visibleColumns)}}refreshBackendDataset(t){this.extensionUtility.refreshBackendDataset(t)}removeColumnByIndex(t,e){return Array.isArray(t)?t.filter((n,r)=>e!==r):t}translateAllExtensions(){this.translateCellMenu(),this.translateColumnHeaders(),this.translateColumnPicker(),this.translateContextMenu(),this.translateGridMenu(),this.translateHeaderMenu()}translateCellMenu(){var t,e;(e=(t=this._cellMenuPlugin)===null||t===void 0?void 0:t.translateCellMenu)===null||e===void 0||e.call(t)}translateColumnPicker(){var t;!((t=this._columnPickerControl)===null||t===void 0)&&t.translateColumnPicker&&this._columnPickerControl.translateColumnPicker()}translateContextMenu(){var t,e;(e=(t=this._contextMenuPlugin)===null||t===void 0?void 0:t.translateContextMenu)===null||e===void 0||e.call(t)}translateGridMenu(){var t,e;(e=(t=this._gridMenuControl)===null||t===void 0?void 0:t.translateGridMenu)===null||e===void 0||e.call(t)}translateHeaderMenu(){var t,e;(e=(t=this._headerMenuPlugin)===null||t===void 0?void 0:t.translateHeaderMenu)===null||e===void 0||e.call(t)}translateColumnHeaders(t,e){var n,r,o;if(this.sharedService&&this.gridOptions&&this.gridOptions.enableTranslate&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');t&&(!((n=this.translaterService)===null||n===void 0)&&n.use)&&this.translaterService.use(t);let s=e;s||(s=this.sharedService.columnDefinitions),this.translateItems(s,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.renderColumnHeaders(s,Array.isArray(e)),(o=(r=this._gridMenuControl)===null||r===void 0?void 0:r.translateGridMenu)===null||o===void 0||o.call(r)}renderColumnHeaders(t,e=!1){var n;let r=t;r||(r=this.sharedService.columnDefinitions),Array.isArray(r)&&this.sharedService.slickGrid&&this.sharedService.slickGrid.setColumns&&((r.length>this.sharedService.allColumns.length||e)&&(this.sharedService.allColumns=r),this.sharedService.slickGrid.setColumns(r)),this.gridOptions.enableColumnPicker&&this._columnPickerControl&&(this._columnPickerControl.columns=this.sharedService.allColumns),this.gridOptions.enableGridMenu&&this._gridMenuControl&&(this._gridMenuControl.columns=(n=this.sharedService.allColumns)!==null&&n!==void 0?n:[],this._gridMenuControl.recreateGridMenu())}createExtensionByTheirColumnIndex(t,e,n){t.sort((r,o)=>r.columnIndexPosition-o.columnIndexPosition),t.forEach(r=>{const o=r.extension.create(e,n);o&&(this._extensionCreatedList[r.name]={name:r.name,instance:o})})}translateItems(t,e,n){var r,o,s;if(!((r=this.gridOptions)===null||r===void 0)&&r.enableTranslate&&!(!((o=this.translaterService)===null||o===void 0)&&o.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');if(Array.isArray(t))for(const l of t)l[e]&&(l[n]=(s=this.translaterService)===null||s===void 0?void 0:s.translate(l[e]))}}var Fm=Object.prototype.hasOwnProperty;function es(a,t){var e,n;if(a===t)return!0;if(a&&t&&(e=a.constructor)===t.constructor){if(e===Date)return a.getTime()===t.getTime();if(e===RegExp)return a.toString()===t.toString();if(e===Array){if((n=a.length)===t.length)for(;n--&&es(a[n],t[n]););return n===-1}if(!e||typeof a=="object"){n=0;for(e in a)if(Fm.call(a,e)&&++n&&!Fm.call(t,e)||!(e in t)||!es(a[e],t[e]))return!1;return Object.keys(t).length===n}}return a!==a&&t!==t}function Pm(a,t,e){if(e&&(a!=null&&a.hasOwnProperty(e)||t!=null&&t.hasOwnProperty(e)))return a[e]===t||a===t[e]||a[e]===t[e];for(const n in a)if(a.hasOwnProperty(n)&&a[n]!==t[n])return!1;return!0}function x0(a){switch(a&&a.toUpperCase()||""){case"IN":case"NIN":case"NOT_IN":case"IN_CONTAINS":case"NIN_CONTAINS":case"NOT_IN_CONTAINS":case"IN_COLLECTION":case"NOT_IN_COLLECTION":return!0;default:return!1}}const Es=(a,t,e)=>{switch(a.toUpperCase()){case"<":case"LT":return t<e;case"<=":case"LE":return t<=e;case">":case"GT":return t>e;case">=":case"GE":return t>=e;case"!=":case"<>":case"NE":return t!==e;case"=":case"==":case"EQ":return t===e;case"IN":return e&&Array.isArray(e)?e.includes(t):!1;case"NIN":case"NOT_IN":return e&&Array.isArray(e)?!e.includes(t):!1;case"IN_CONTAINS":return e&&Array.isArray(e)&&typeof t=="string"?e.some(n=>t.split(/[,]+/).map(r=>r.trim()).includes(n)):!1;case"NIN_CONTAINS":case"NOT_IN_CONTAINS":return e&&Array.isArray(e)&&typeof t=="string"?!e.some(n=>t.split(/[,]+/).map(r=>r.trim()).includes(n)):!1;case"IN_COLLECTION":return t&&e&&Array.isArray(t)&&Array.isArray(e)?e.some(n=>t.includes(n)):!1;case"NOT_IN_COLLECTION":return t&&e&&Array.isArray(t)&&Array.isArray(e)?!e.some(n=>t.includes(n)):!1}return!0},Mm=(a,t)=>{var e;let[n,r]=t;if(n===void 0&&!a.operator)return!0;a.cellValue=a.cellValue===void 0||a.cellValue===null?"":a.cellValue.toString();const o=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(a.cellValue,!0):a.cellValue.toLowerCase();if(typeof n=="string"&&(n=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(n,!0):n.toLowerCase()),typeof r=="string"&&(r=a!=null&&a.ignoreAccentOnStringFilterAndSort?Jl(r,!0):r.toLowerCase()),n!==void 0&&r!==void 0){let l=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;l!==Lt.rangeInclusive&&l!==Lt.rangeExclusive&&(l=a.defaultFilterRangeOperator);const u=l===Lt.rangeInclusive,p=Uh(u?">=":">",o,n,a.searchInputLastChar),c=Uh(u?"<=":"<",o,r,a.searchInputLastChar);return p&&c}return Uh(a.operator,o,n,a.searchInputLastChar)};function T0(a){const t="",e=Array.isArray(a)&&a||[t],n=[];let r,o;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split("..");r=`${Array.isArray(s)?s[0]:""}`,o=`${Array.isArray(s)?s[1]:""}`}else{const s=Array.isArray(a)&&a.length>0?a[0]:"";r=s==null?"":`${s}`}return r!==void 0&&o!==void 0?n.push(r,o):r!==void 0&&n.push(r),n}function Uh(a,t,e,n){return a==="*"||a===Lt.endsWith||a==="*z"?t.endsWith(e):a===""&&n==="*"||a===Lt.startsWith||a==="a*"?t.startsWith(e):a===""||a===Lt.contains?t.indexOf(e)>-1:a==="<>"||a===Lt.notContains?t.indexOf(e)===-1:Es(a||"==",t,e)}const O0=(a,t)=>{if(t===void 0&&!a.operator)return!0;switch((a.operator||"").toUpperCase()){case"!=":case"<>":case"NE":return!Pm(a.cellValue,t,a.dataKey);case"=":case"==":case"EQ":default:return Pm(a.cellValue,t,a.dataKey)}};function A0(a){return(Array.isArray(a)&&a.length>0?a[0]:"")||""}const Nm=(a,t)=>{var e;const n=parseFloat(a.cellValue),[r,o]=t;if(r===void 0&&!a.operator)return!0;if(r!==void 0&&o!==void 0){let s=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;s!==Lt.rangeInclusive&&s!==Lt.rangeExclusive&&(s=a.defaultFilterRangeOperator);const l=s===Lt.rangeInclusive,u=Es(l?">=":">",n,+r),p=Es(l?"<=":"<",n,+o);return u&&p}return Es(a.operator||"==",n,+r)};function k0(a){const e=Array.isArray(a)&&a||[0],n=[];let r,o;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split("..");r=parseFloat(Array.isArray(s)?s[0]:""),o=parseFloat(Array.isArray(s)?s[1]:"")}else r=parseFloat(e[0]);return rr(r,!0)&&rr(o,!0)?n.push(r,o):rr(r,!0)&&n.push(r),n}const Lm=(a,t)=>Yd(a.cellValue)===Yd(t);function I0(a){const t=Array.isArray(a)&&a[0]||!1;return Yd(t)}const Hm=a=>{const t=a.operator;let e;return Array.isArray(a.cellValue)&&(t==="IN_COLLECTION"||t==="NOT_IN_COLLECTION")?e=a.cellValue.length?a.cellValue.map(n=>`${n}`):[]:e=a.cellValue===void 0||a.cellValue===null?"":`${a.cellValue}`,Es(t||"IN",e,a.searchTerms||[])},Eu=Ys||ms;function D0(a,t){var e;const n=a&&(a.filterSearchType||a.fieldType)||ie.dateIso,r=Fr(n),[o,s]=t,l=Eu(a.cellValue,r,!0);if(!o&&!s||!l.isValid())return!1;const u=r.toLowerCase().includes("h")?l.valueOf():l.clone().startOf("day").valueOf();if(o&&s){let c=(e=a==null?void 0:a.operator)!==null&&e!==void 0?e:a.defaultFilterRangeOperator;c!==Lt.rangeInclusive&&c!==Lt.rangeExclusive&&(c=a.defaultFilterRangeOperator);const f=c===Lt.rangeInclusive,m=Es(f?">=":">",u,o.valueOf()),v=Es(f?"<=":"<",u,s.valueOf());return m&&v}const p=r.toLowerCase().includes("h")?o.valueOf():o.clone().startOf("day").valueOf();return Es(a.operator||"==",u,p)}function R0(a,t){const e=Array.isArray(a)&&a||[],n=t||ie.dateIso,r=Fr(n),o=[];if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const s=e.length===2?e:e[0].split(".."),l=Array.isArray(s)&&s[0]||"",u=Array.isArray(s)&&s[1]||"",p=Eu(l,r,!0),c=Eu(u,r,!0);if(!p.isValid()||!c.isValid())return[];o.push(p,c)}else{const s=Eu(e[0],r,!0);if(!s.isValid())return[];o.push(s)}return o}const F0=(a,t)=>{if(x0(a.operator))return Hm(a);switch(Bm(a.filterSearchType||a.fieldType)){case"boolean":return Lm(a,t);case"date":return D0(a,t||[]);case"number":return Nm(a,t||[]);case"object":return O0(a,t);case"string":default:return Mm(a,t||[])}};function Su(a,t){const e=Bm(t);let n;switch(e){case"boolean":n=I0(a);break;case"date":n=R0(a,t);break;case"number":n=k0(a);break;case"object":n=A0(a);break;case"string":n=T0(a);break}return n}function Bm(a){switch(a){case ie.boolean:return"boolean";case ie.date:case ie.dateIso:case ie.dateUtc:case ie.dateTime:case ie.dateTimeIso:case ie.dateTimeIsoAmPm:case ie.dateTimeIsoAM_PM:case ie.dateTimeShortIso:case ie.dateEuro:case ie.dateEuroShort:case ie.dateTimeShortEuro:case ie.dateTimeEuro:case ie.dateTimeEuroAmPm:case ie.dateTimeEuroAM_PM:case ie.dateTimeEuroShort:case ie.dateTimeEuroShortAmPm:case ie.dateTimeEuroShortAM_PM:case ie.dateUs:case ie.dateUsShort:case ie.dateTimeShortUs:case ie.dateTimeUs:case ie.dateTimeUsAmPm:case ie.dateTimeUsAM_PM:case ie.dateTimeUsShort:case ie.dateTimeUsShortAmPm:case ie.dateTimeUsShortAM_PM:return"date";case ie.integer:case ie.float:case ie.number:return"number";case ie.object:return"object";case ie.string:case ie.text:case ie.password:case ie.readonly:default:return"string"}}const Vm={executeFilterConditionTest:F0,booleanFilter:Lm,collectionSearchFilter:Hm,numberFilter:Nm,stringFilter:Mm,testFilter:Es};class P0{constructor(t,e,n,r,o){this.filterFactory=t,this.pubSubService=e,this.sharedService=n,this.backendUtilities=r,this.rxjs=o,this._isFilterFirstRender=!0,this._firstColumnIdRendered="",this._filtersMetadata=[],this._columnFilters={},this._isTreePresetExecuted=!1,this._previousFilters=[],this._onSearchChange=new Slick.Event,this._eventHandler=new Slick.EventHandler,this.rxjs&&(this.httpCancelRequests$=this.rxjs.createSubject())}get eventHandler(){return this._eventHandler}get isFilterFirstRender(){return this._isFilterFirstRender}get onSearchChange(){return this._onSearchChange}get _gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get _columnDefinitions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getColumns)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:[]}get _dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}addRxJsResource(t){this.rxjs=t}init(t){this._grid=t,this._gridOptions&&this._gridOptions.enableTreeData&&this._gridOptions.treeDataOptions&&this._grid.setSortColumns([{columnId:this._gridOptions.treeDataOptions.columnId,sortAsc:!0}])}dispose(){var t;this._eventHandler.unsubscribeAll(),this.httpCancelRequests$&&(!((t=this.rxjs)===null||t===void 0)&&t.isObservable(this.httpCancelRequests$))&&(this.httpCancelRequests$.next(),this.httpCancelRequests$.complete()),this.disposeColumnFilters(),this._onSearchChange=null}disposeColumnFilters(){if(this.removeAllColumnFiltersProperties(),Array.isArray(this._filtersMetadata)){let t=this._filtersMetadata.pop();for(;t;)t==null||t.destroy(),t=this._filtersMetadata.pop()}}bindBackendOnFilter(t){this._filtersMetadata=[],this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{n.column.id===this._firstColumnIdRendered&&(this._isFilterFirstRender=!1),this.addFilterTemplateToHeaderRow(n,this._isFilterFirstRender),this._firstColumnIdRendered===""&&(this._firstColumnIdRendered=n.column.id)}),this.subscribeToOnHeaderRowCellRendered(t),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,this.onBackendFilterChange.bind(this))}bindLocalOnFilter(t){this._filtersMetadata=[],this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid,dataView:this._dataView}),this._dataView.setFilter(this.customLocalFilter.bind(this)),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,async(e,n)=>{var r,o;const s=(r=n==null?void 0:n.clearFilterTriggered)!==null&&r!==void 0?r:!1;s||await this.emitFilterChanged(Ji.local,!0),((o=this._gridOptions)===null||o===void 0?void 0:o.enableTreeData)===!0&&(this._tmpPreFilteredData=this.preFilterTreeData(this._dataView.getItems(),this._columnFilters)),n.columnId!==null&&this._dataView.refresh(),s||await this.emitFilterChanged(Ji.local),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)}),this._eventHandler.subscribe(t.onHeaderRowCellRendered,(e,n)=>{this.addFilterTemplateToHeaderRow(n)}),this.subscribeToOnHeaderRowCellRendered(t)}async clearFilterByColumnId(t,e){var n,r;await this.pubSubService.publish("onBeforeFilterClear",{columnId:e},0);const o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.backendServiceApi)!==null&&r!==void 0?r:!1,s=o?Ji.remote:Ji.local,l=Object.keys(this._columnFilters);let u;Array.isArray(l)&&(u=l.find(c=>c===`${e}`));const p=this._filtersMetadata.find(c=>c.columnDef.id===e);return p!=null&&p.clear&&p.clear(!0),o&&u!==void 0&&this.onBackendFilterChange(t,{grid:this._grid,columnFilters:this._columnFilters}),await this.emitFilterChanged(s),!0}async clearFilters(t=!0){var e,n,r,o,s;t&&await this.pubSubService.publish("onBeforeFilterClear",!0,0),this._filtersMetadata.forEach(u=>{u!=null&&u.clear&&u.clear(!1)}),this.removeAllColumnFiltersProperties(),Array.isArray(this._columnDefinitions)&&this._columnDefinitions.forEach(u=>{var p;!((p=u.filter)===null||p===void 0)&&p.searchTerms&&delete u.filter.searchTerms}),this._dataView&&this._grid&&(this._dataView.refresh(),this._grid.invalidate());const l=(e=this._gridOptions)===null||e===void 0?void 0:e.backendServiceApi;if(l&&t){const u={clearFilterTriggered:!0,shouldTriggerQuery:t,grid:this._grid,columnFilters:this._columnFilters},c=l.service.processOnFilterChanged(void 0,u),f=(o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.pagination)===null||r===void 0?void 0:r.totalItems)!==null&&o!==void 0?o:0;(s=this.backendUtilities)===null||s===void 0||s.executeBackendCallback(l,c,u,new Date,f,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:m=>this._previousFilters=this.extractBasicFilterDetails(m.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this)})}else this._previousFilters=this.extractBasicFilterDetails(this._columnFilters);t&&this.pubSubService.publish("onFilterCleared",!0)}customLocalFilter(t,e){var n,r,o,s,l,u;const p=e==null?void 0:e.grid,c=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.enableTreeData)!==null&&r!==void 0?r:!1,f=(o=e==null?void 0:e.columnFilters)!==null&&o!==void 0?o:{};let m;if(c&&this._gridOptions&&this._gridOptions.treeDataOptions){m=this._gridOptions.treeDataOptions;const v=(s=m.collapsedPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.COLLAPSED_PROP,_=(l=m.parentPropName)!==null&&l!==void 0?l:Xe.treeDataProperties.PARENT_PROP,C=(u=this._gridOptions.datasetIdPropertyName)!==null&&u!==void 0?u:"id";if(t[_]!==null){let x=this._dataView.getItemById(t[_]);for(;x;){if(x[v])return!1;x=this._dataView.getItemById(x[_])}}if(this._tmpPreFilteredData instanceof Set)return this._tmpPreFilteredData.has(t[C])}else if(typeof f=="object")for(const v of Object.keys(f)){const _=f[v],C=this.preProcessFilterConditionOnDataContext(t,_,p);if(typeof C=="boolean")return C;let x=_==null?void 0:_.parsedSearchTerms;if(x===void 0&&(x=Su(_.searchTerms,_.columnDef.type||ie.string),x!==void 0&&(_.parsedSearchTerms=x)),!Vm.executeFilterConditionTest(C,x))return!1}return!0}parseFormInputFilterConditions(t,e){var n,r,o,s;const l=uo(t)||[];let u=Array.isArray(l)&&l.length===1?l[0]:"";const p=e.columnDef,c=(o=(r=(n=p.filter)===null||n===void 0?void 0:n.type)!==null&&r!==void 0?r:p.type)!==null&&o!==void 0?o:ie.string;let f=null;c!==ie.object&&(u=u==null?"":`${u}`,f=((s=p.autoParseInputFilterOperator)!==null&&s!==void 0?s:this._gridOptions.autoParseInputFilterOperator)!==!1?u.match(/^([<>!=\*]{0,2})(.*[^<>!=\*])?([\*]?)$/):[u,"",u,""]);let m=(f==null?void 0:f[1])||e.operator;const v=(f==null?void 0:f[2])||"",_=(f==null?void 0:f[3])||(m==="*z"?"*":"");return typeof u=="string"&&(u=u.replace("'","''"),m==="*"||m==="*z"?m=Lt.endsWith:(m==="a*"||_==="*")&&(m=Lt.startsWith)),Array.isArray(f)&&f.length>=1&&Array.isArray(l)&&l.length===1&&(l[0]=v),{dataKey:p.dataKey,fieldType:c,searchTerms:l||[],operator:m,searchInputLastChar:_,filterSearchType:p.filterSearchType,defaultFilterRangeOperator:this._gridOptions.defaultFilterRangeOperator}}preProcessFilterConditionOnDataContext(t,e,n){var r,o,s,l,u,p;const c=e.columnDef,f=e.columnId;let m=n.getColumnIndex(f);if(!c&&this.sharedService&&Array.isArray(this.sharedService.allColumns)&&(m=this.sharedService.allColumns.findIndex(E=>E.field===f)),!c)return!0;if(this._gridOptions.enableRowDetailView){const E=this._gridOptions.rowDetailView&&this._gridOptions.rowDetailView.keyPrefix||"__";t[`${E}isPadding`]&&t[`${E}parent`]&&(t=t[`${E}parent`])}let v=((r=c.filter)===null||r===void 0?void 0:r.queryField)||c.queryFieldFilter||c.queryField||c.field||"";typeof c.queryFieldNameGetterFn=="function"&&(v=c.queryFieldNameGetterFn(t));const _=(l=(s=(o=c.filter)===null||o===void 0?void 0:o.type)!==null&&s!==void 0?s:c.type)!==null&&l!==void 0?l:ie.string;let C=t[v];(v==null?void 0:v.indexOf("."))>=0&&(C=_n(t,v));const x=e.operator,w=e.searchTerms||[];if(!w||Array.isArray(w)&&(w.length===0||w.length===1&&x===w[0]))return!0;if(w&&Array.isArray(w)&&_!==ie.object)for(let E=0,I=w.length;E<I;E++)w[E]=(w[E]===void 0||w[E]===null?"":w[E])+"";if(((u=c==null?void 0:c.params)===null||u===void 0?void 0:u.useFormatterOuputToFilter)===!0){const E=n.getData(),I=this._gridOptions.datasetIdPropertyName||"id",k=E&&typeof E.getIdxById=="function"?E.getIdxById(t[I]):0,F=c&&typeof c.formatter=="function"?c.formatter(k||0,m,C,c,t,this._grid):"";C=or(F)}return typeof C=="number"&&(C=C.toString()),{dataKey:c.dataKey,fieldType:_,searchTerms:w,cellValue:C,operator:x,searchInputLastChar:e.searchInputLastChar,filterSearchType:c.filterSearchType,ignoreAccentOnStringFilterAndSort:(p=this._gridOptions.ignoreAccentOnStringFilterAndSort)!==null&&p!==void 0?p:!1,defaultFilterRangeOperator:this._gridOptions.defaultFilterRangeOperator}}preFilterTreeData(t,e){var n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E,I,k,F;const N=(n=this._gridOptions)===null||n===void 0?void 0:n.treeDataOptions,V=(r=N==null?void 0:N.collapsedPropName)!==null&&r!==void 0?r:Xe.treeDataProperties.COLLAPSED_PROP,Q=(o=N==null?void 0:N.parentPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.PARENT_PROP,L=(s=N==null?void 0:N.hasChildrenPropName)!==null&&s!==void 0?s:Xe.treeDataProperties.HAS_CHILDREN_PROP,se=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.datasetIdPropertyName)!==null&&u!==void 0?u:"id",Ce=(c=(p=this._gridOptions.presets)===null||p===void 0?void 0:p.treeData)===null||c===void 0?void 0:c.toggledItems,J=(m=(f=this._gridOptions.treeDataOptions)===null||f===void 0?void 0:f.initiallyCollapsed)!==null&&m!==void 0?m:!1,z=(v=this._gridOptions.treeDataOptions)===null||v===void 0?void 0:v.columnId,P=(_=this._gridOptions.treeDataOptions)===null||_===void 0?void 0:_.excludeChildrenWhenFilteringTree,le=!P&&((C=this._gridOptions.treeDataOptions)===null||C===void 0?void 0:C.autoApproveParentItemWhenTreeColumnIsValid)===!0,Ke={},Pe=new Set,Oe=new Map;if(Array.isArray(t)){for(const ye of t)Ke[ye[se]]=ye,delete Ke[ye[se]].__used;for(const ye of Object.keys(e)){const Re=e[ye],ae=Re!=null&&Re.searchTerms?uo(Re.searchTerms):[],he=this.parseFormInputFilterConditions(ae,Re),Ne=Re.columnDef,ze=(E=(w=(x=Ne==null?void 0:Ne.filter)===null||x===void 0?void 0:x.type)!==null&&w!==void 0?w:Ne==null?void 0:Ne.type)!==null&&E!==void 0?E:ie.string,Be=Su(he.searchTerms,ze);Be!==void 0&&(Re.parsedSearchTerms=Be)}for(const ye of t){const Re=ye[L];let ae=!0;for(const he of Object.keys(e)){const Ne=e[he],ze=this.preProcessFilterConditionOnDataContext(ye,Ne,this._grid);if(ze){const Be=Ne==null?void 0:Ne.parsedSearchTerms,de=typeof ze=="boolean"?ze:Vm.executeFilterConditionTest(ze,Be);if(de&&le&&Re&&Ne.columnId===z){Oe.set(ye[se],!0);break}if(de||!P&&Oe.get(ye[Q])===!0){if(Re&&Ne.columnId===z&&Oe.set(ye[se],!0),de||!P&&Ne.columnId===z)continue}else Re&&Oe.get(ye[Q])!==!0&&Ne.columnId!==z&&Oe.set(ye[se],!1)}ae=!1}if(ae){Pe.add(ye[se]);let he=(I=Ke[ye[Q]])!==null&&I!==void 0?I:!1;const Ne=!J;for(!this._isTreePresetExecuted&&Array.isArray(Ce)&&Ce.some(ze=>ze.itemId===he.id&&ze.isCollapsed===Ne)&&(he[V]=Ne);he;)(k=he.__used)!==null&&k!==void 0||Pe.add(he[se]),Ke[he[se]].__used=!0,he=(F=Ke[he[Q]])!==null&&F!==void 0?F:!1}}}return this._isTreePresetExecuted=!0,Pe}getColumnFilters(){return this._columnFilters}getPreviousFilters(){return this._previousFilters}getFiltersMetadata(){return this._filtersMetadata}getCurrentLocalFilters(){var t,e;const n=[];if(this._columnFilters)for(const r of Object.keys(this._columnFilters)){const o=this._columnFilters[r],s={columnId:r||""},l=this.sharedService.allColumns.find(p=>p.id===s.columnId),u=(e=(t=l==null?void 0:l.filter)===null||t===void 0?void 0:t.emptySearchTermReturnAllValues)!==null&&e!==void 0?e:!0;o!=null&&o.searchTerms&&(s.searchTerms=o.searchTerms),o.operator&&(s.operator=o.operator),o.targetSelector&&(s.targetSelector=o.targetSelector),Array.isArray(s.searchTerms)&&s.searchTerms.length>0&&(!u||s.searchTerms[0]!=="")&&n.push(s)}return n}emitFilterChanged(t,e=!1){var n;const r=e?"onBeforeFilterChange":"onFilterChanged";if(t===Ji.remote&&(!((n=this._gridOptions)===null||n===void 0)&&n.backendServiceApi)){let o=[];const s=this._gridOptions.backendServiceApi.service;return s!=null&&s.getCurrentFilters&&(o=s.getCurrentFilters()),this.pubSubService.publish(r,o)}else if(t===Ji.local)return this.pubSubService.publish(r,this.getCurrentLocalFilters())}async onBackendFilterChange(t,e){var n,r,o,s;const l=e==null?void 0:e.shouldTriggerQuery;if(l&&await this.emitFilterChanged(Ji.remote,!0),!e||!e.grid)throw new Error('Something went wrong when trying to bind the "onBackendFilterChange(event, args)" function, it seems that "args" is not populated correctly');const u=this._gridOptions.backendServiceApi;if(!u||!u.process||!u.service)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');const p=new Date;if(u.preProcess&&u.preProcess(),l){const c=await u.service.processOnFilterChanged(t,e),f=(o=(r=(n=this._gridOptions)===null||n===void 0?void 0:n.pagination)===null||r===void 0?void 0:r.totalItems)!==null&&o!==void 0?o:0;(s=this.backendUtilities)===null||s===void 0||s.executeBackendCallback(u,c,e,p,f,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:m=>this._previousFilters=this.extractBasicFilterDetails(m.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this),httpCancelRequestSubject:this.httpCancelRequests$})}}populateColumnFilterSearchTermPresets(t){var e;return Array.isArray(t)&&(this._columnDefinitions.forEach(n=>{var r;!((r=n.filter)===null||r===void 0)&&r.searchTerms&&delete n.filter.searchTerms;const o=t.find(s=>s.columnId===n.id);o&&Array.isArray(o==null?void 0:o.searchTerms)&&(n.filter=n.filter||{},n.filter.operator=o.operator||n.filter.operator||"",n.filter.searchTerms=o.searchTerms)}),!((e=this._gridOptions)===null||e===void 0)&&e.enableTreeData&&this.refreshTreeDataFilters(),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)),this._columnDefinitions}refreshTreeDataFilters(t){var e,n,r,o;const s=(r=t??((n=(e=this._dataView)===null||e===void 0?void 0:e.getItems)===null||n===void 0?void 0:n.call(e)))!==null&&r!==void 0?r:[];this._dataView&&(!((o=this._gridOptions)===null||o===void 0)&&o.enableTreeData)&&s.length>0?(this._tmpPreFilteredData=this.preFilterTreeData(s,this._columnFilters),this._dataView.refresh()):s.length===0&&Array.isArray(this.sharedService.hierarchicalDataset)&&this.sharedService.hierarchicalDataset.length>0&&setTimeout(()=>this.refreshTreeDataFilters())}disableFilterFunctionality(t=!0,e=!0){const r=!this._gridOptions.enableFiltering;r!==t&&(e&&t&&this.clearFilters(),this.disableAllFilteringCommands(t),this._grid.setOptions({enableFiltering:r},!1,!0),this._grid.setHeaderRowVisibility(r),this._gridOptions.enableFiltering=!t,this.sharedService.gridOptions=this._gridOptions,this._grid.setColumns(this.sharedService.columnDefinitions))}resetToPreviousSearchFilters(){this.updateFilters(this._previousFilters,!1,!1,!1)}toggleFilterFunctionality(t=!0){const e=this._gridOptions.enableFiltering;this.disableFilterFunctionality(e,t)}toggleHeaderFilterRow(){var t,e;let n=(e=(t=this._gridOptions)===null||t===void 0?void 0:t.showHeaderRow)!==null&&e!==void 0?e:!1;n=!n,this._grid.setHeaderRowVisibility(n),n===!0&&this._grid.setColumns(this.sharedService.columnDefinitions)}setSortColumnIcons(t){this._grid&&Array.isArray(t)&&this._grid.setSortColumns(t)}async updateFilters(t,e=!0,n=!0,r=!1){var o,s;if(!this._filtersMetadata||this._filtersMetadata.length===0||!this._gridOptions||!this._gridOptions.enableFiltering)throw new Error('[Slickgrid-Universal] in order to use "updateFilters" method, you need to have Filterable Columns defined in your grid and "enableFiltering" set in your Grid Options');if(Array.isArray(t)){this.clearFilters(!1),t.forEach(p=>{var c;const f=this._filtersMetadata.find(m=>p.columnId===m.columnDef.id);if(p&&f){const m=p.operator||f.defaultOperator;this.updateColumnFilters(p.searchTerms,f.columnDef,m),f.setValues(p.searchTerms||[],m),(r||!((c=this._gridOptions)===null||c===void 0)&&c.enableTreeData)&&this.callbackSearchEvent(void 0,{columnDef:f.columnDef,operator:m,searchTerms:p.searchTerms,shouldTriggerQuery:!0,forceOnSearchChangeEvent:!0})}});const l=(o=this._gridOptions)===null||o===void 0?void 0:o.backendServiceApi,u=l?Ji.remote:Ji.local;if(e&&await this.emitFilterChanged(u,!0),this._dataView.refresh(),l){const p=l==null?void 0:l.service;p!=null&&p.updateFilters&&(p.updateFilters(t,!0),n&&((s=this.backendUtilities)===null||s===void 0||s.refreshBackendDataset(this._gridOptions)))}e&&await this.emitFilterChanged(u)}return!0}async updateSingleFilter(t,e=!0,n=!0){var r,o,s,l,u,p;const c=this.sharedService.allColumns.find(f=>f.id===t.columnId);if(c&&t.columnId){this._columnFilters={};const f=(o=(r=c.filter)===null||r===void 0?void 0:r.emptySearchTermReturnAllValues)!==null&&o!==void 0?o:!0;Array.isArray(t.searchTerms)&&(t.searchTerms.length>1||t.searchTerms.length===1&&(!f||t.searchTerms[0]!==""))&&(this._columnFilters[t.columnId]={columnId:t.columnId,operator:t.operator,searchTerms:t.searchTerms,columnDef:c,type:(s=c.type)!==null&&s!==void 0?s:ie.string});const m=(l=this._gridOptions)===null||l===void 0?void 0:l.backendServiceApi,v=m?Ji.remote:Ji.local;if(e&&await this.emitFilterChanged(v,!0),m){const _=m==null?void 0:m.service;_!=null&&_.updateFilters&&(_.updateFilters(this._columnFilters,!0),n&&((u=this.backendUtilities)===null||u===void 0||u.refreshBackendDataset(this._gridOptions)))}else this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid}),!((p=this._gridOptions)===null||p===void 0)&&p.enableTreeData&&this.refreshTreeDataFilters(),this._dataView.refresh();e&&await this.emitFilterChanged(v)}return!0}drawFilterTemplate(t,e){var n;let r;if(typeof e=="string"){if(r=document.querySelector(e),r===null)return null}else r=e;const o=typeof t=="string"?this.sharedService.allColumns.find(l=>l.id===t):t;if(((n=o==null?void 0:o.id)!==null&&n!==void 0?n:"")!=="selector"&&(o!=null&&o.filterable)){let l,u;const p=this.filterFactory.createFilter(o.filter);u=o&&o.filter&&o.filter.operator||p&&p.operator,this._columnFilters[o.id]?(l=this._columnFilters[o.id].searchTerms||void 0,u=this._columnFilters[o.id].operator||void 0):o.filter&&(l=o.filter.searchTerms||void 0,this.updateColumnFilters(l,o,u));const c={grid:this._grid,operator:u,searchTerms:l,columnDef:o,filterContainerElm:r,callback:this.callbackSearchEvent.bind(this)};return p&&(p.init(c),l&&p.setValues&&p.setValues(l,u)),p}return null}addFilterTemplateToHeaderRow(t,e=!0){var n;const r=t.column,o=(n=r==null?void 0:r.id)!==null&&n!==void 0?n:"";if(o!=="selector"&&(r!=null&&r.filterable)){let s,l;const u=this.filterFactory.createFilter(r.filter);l=r&&r.filter&&r.filter.operator||u&&u.operator,this._columnFilters[r.id]?(s=this._columnFilters[r.id].searchTerms||void 0,l=this._columnFilters[r.id].operator||void 0):r.filter&&(s=r.filter.searchTerms||void 0,this.updateColumnFilters(s,r,l));const p={grid:this._grid,operator:l,searchTerms:s,columnDef:r,filterContainerElm:this._grid.getHeaderRowColumn(o),callback:this.callbackSearchEvent.bind(this)};if(u){u.init(p,e);const c=this._filtersMetadata.findIndex(f=>u.columnDef.id===f.columnDef.id);c===-1?this._filtersMetadata.push(u):this._filtersMetadata[c]=u,s&&u.setValues&&u.setValues(s,l)}}}callbackSearchEvent(t,e){var n,r,o,s,l,u;if(e){const p=t!=null&&t.target?t.target.value:void 0,c=e.searchTerms&&Array.isArray(e.searchTerms)?e.searchTerms:p?[p]:void 0,f=e.columnDef||null,m=(n=f==null?void 0:f.id)!==null&&n!==void 0?n:"",v=(s=(o=(r=f==null?void 0:f.filter)===null||r===void 0?void 0:r.type)!==null&&o!==void 0?o:f==null?void 0:f.type)!==null&&s!==void 0?s:ie.string,_=e.operator||void 0,C=c&&Array.isArray(c),x=C&&c&&c.length,w={...this._columnFilters},E=(u=(l=f.filter)===null||l===void 0?void 0:l.emptySearchTermReturnAllValues)!==null&&u!==void 0?u:!0;let I;if(f&&m)if(!C||x===0||x===1&&Array.isArray(c)&&E&&c[0]==="")delete this._columnFilters[m];else{const V=`${m}`,Q={columnId:V,columnDef:f,parsedSearchTerms:[],type:v,targetSelector:O_(t==null?void 0:t.target)},L=this.parseFormInputFilterConditions(c,Q);Q.operator=_||L.operator||th(v),I=Su(L.searchTerms,v),I!==void 0&&(Q.parsedSearchTerms=I),Q.searchTerms=L.searchTerms||[],this._columnFilters[V]=Q}const k=t&&typeof t.isPropagationStopped!="function"?Slick.Utils.extend({},new Slick.EventData,t):t,F=t==null?void 0:t.key,N=t==null?void 0:t.keyCode;if(this._onSearchChange&&(e.forceOnSearchChangeEvent||F==="Enter"||N===li.ENTER||!es(w,this._columnFilters))){const V={clearFilterTriggered:e.clearFilterTriggered,shouldTriggerQuery:e.shouldTriggerQuery,columnId:m,columnDef:f,columnFilters:this._columnFilters,operator:_||th(v),searchTerms:c,parsedSearchTerms:I,grid:this._grid,target:t==null?void 0:t.target};this.pubSubService.publish("onBeforeSearchChange",V)===!1?this._gridOptions.resetFilterSearchValueAfterOnBeforeCancellation&&this.resetToPreviousSearchFilters():this._onSearchChange.notify(V,k)}}}disableAllFilteringCommands(t=!0){var e,n;const r=this._grid.getColumns();r.forEach(s=>{var l;!((l=s==null?void 0:s.header)===null||l===void 0)&&l.menu&&s.header.menu.items.forEach(u=>{u&&typeof u!="string"&&u.command==="clear-filter"&&(u.hidden=t)})});const o=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.gridMenu)===null||n===void 0?void 0:n.commandItems;return o&&o.forEach(s=>{if(s&&typeof s!="string"){const l=s.command;(l==="clear-filter"||l==="toggle-filter")&&(s.hidden=t)}}),r}extractBasicFilterDetails(t){const e=[];if(t&&typeof t=="object")for(const n of Object.keys(t)){const{operator:r,searchTerms:o}=t[`${n}`];e.push({columnId:n,operator:r,searchTerms:o})}return e}removeAllColumnFiltersProperties(){if(typeof this._columnFilters=="object")for(const t in this._columnFilters)t&&this._columnFilters[t]&&delete this._columnFilters[t]}subscribeToOnHeaderRowCellRendered(t){this._eventHandler.subscribe(t.onBeforeHeaderRowCellDestroy,(e,n)=>{var r;const o=this._filtersMetadata.find(s=>s.columnDef.id===n.column.id);(r=o==null?void 0:o.destroy)===null||r===void 0||r.call(o)})}updateColumnFilters(t,e,n){var r,o,s;const l=(s=(o=(r=e.filter)===null||r===void 0?void 0:r.type)!==null&&o!==void 0?o:e.type)!==null&&s!==void 0?s:ie.string,u=Su(t,l);t&&e&&(this._columnFilters[e.id]={columnId:e.id,columnDef:e,searchTerms:t,operator:n,parsedSearchTerms:u,type:l})}}let zm;const wu={skipError:!1,triggerEvent:!0},sd={highlightRow:!0,resortGrid:!1,selectRow:!1,scrollRowIntoView:!0,skipError:!1,triggerEvent:!0},Gh={highlightRow:!1,selectRow:!1,scrollRowIntoView:!1,skipError:!1,triggerEvent:!0},Um={autoResizeColumns:!0,triggerEvent:!0,hideFromColumnPicker:!1,hideFromGridMenu:!1};class M0{constructor(t,e,n,r,o,s,l){this.gridStateService=t,this.filterService=e,this.pubSubService=n,this.paginationService=r,this.sharedService=o,this.sortService=s,this.treeDataService=l}get _dataView(){var t;return((t=this._grid)===null||t===void 0?void 0:t.getData)&&this._grid.getData()}get _gridOptions(){var t;return!((t=this._grid)===null||t===void 0)&&t.getOptions?this._grid.getOptions():{}}dispose(){var t;(t=this._rowSelectionPlugin)===null||t===void 0||t.dispose()}init(t){this._grid=t}clearAllFiltersAndSorts(){this.sortService&&this.sortService.clearSorting&&this.sortService.clearSorting(!1),this.filterService&&this.filterService.clearFilters&&this.filterService.clearFilters()}clearPinning(t=!0){const e=[...this.sharedService.visibleColumns];this.sharedService.slickGrid.setOptions({frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1}),t&&Array.isArray(e)&&this.sharedService.slickGrid.setColumns(e)}setPinning(t,e=!0,n=!1,r=!0){kp(t)?this.clearPinning():(this.sharedService.slickGrid.setOptions(t,n,r),this.sharedService.gridOptions={...this.sharedService.gridOptions,...t}),e&&this.sharedService.slickGrid.autosizeColumns()}getAllColumnDefinitions(){return this.sharedService.allColumns}getVisibleColumnDefinitions(){return this.sharedService.visibleColumns}getColumnFromEventArguments(t){if(!t||!t.grid||!t.grid.getColumns||!t.grid.getDataItem)throw new Error("[Slickgrid-Universal] To get the column definition and data, we need to have these arguments passed as objects (row, cell, grid)");return{row:t.row,cell:t.cell,columnDef:t.grid.getColumns()[t.cell],dataContext:t.grid.getDataItem(t.row),dataView:this._dataView,grid:this._grid}}getDataItemByRowNumber(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error(`[Slickgrid-Universal] We could not find SlickGrid Grid object or it's "getDataItem" method`);return this._grid.getDataItem(t)}getItemRowMetadataToHighlight(t){return e=>{const n=this._dataView.getItem(e);let r={cssClasses:""};return typeof t=="function"&&(r=t(e)),r||(r={cssClasses:""}),n&&n._dirty&&(r.cssClasses=(r&&r.cssClasses||"")+" dirty"),n&&n.rowClass&&r&&(r.cssClasses+=` ${n.rowClass}`,r.cssClasses+=` row${e}`),r}}getDataItemByRowIndex(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');return this._grid.getDataItem(t)}getDataItemByRowIndexes(t){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');const e=[];return Array.isArray(t)&&t.forEach(n=>{e.push(this._grid.getDataItem(n))}),e}getSelectedRows(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');return this._grid.getSelectedRows()}getSelectedRowsDataItem(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');const t=this._grid.getSelectedRows();return this.getDataItemByRowIndexes(t)}hideColumnById(t,e){if(e={...Um,...e},this._grid&&this._grid.getColumns&&this._grid.setColumns){const n=this._grid.getColumns(),r=n.findIndex(o=>o.id===t);if(r>=0){const o=ih(n,r);this.sharedService.visibleColumns=o,this._grid.setColumns(o);const s=this.sharedService.allColumns.findIndex(l=>l.id===t);return s&&(e!=null&&e.hideFromColumnPicker&&(this.sharedService.allColumns[s].excludeFromColumnPicker=!0),e!=null&&e.hideFromGridMenu&&(this.sharedService.allColumns[s].excludeFromGridMenu=!0)),e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:o}),r}}return-1}hideColumnByIds(t,e){if(e={...Um,...e},Array.isArray(t)){for(const n of t)this.hideColumnById(n,{...e,triggerEvent:!1,autoResizeColumns:!1});e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:this.sharedService.visibleColumns})}}highlightRow(t,e=1500,n=300){this._grid.getSelectionModel()||(this._rowSelectionPlugin=new _h(this._gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionPlugin)),Array.isArray(t)?t.forEach(r=>this.highlightRowByMetadata(r,e,n)):this.highlightRowByMetadata(t,e,n)}highlightRowByMetadata(t,e=1500,n=300){this._dataView.getItemMetadata=this.getItemRowMetadataToHighlight(this._dataView.getItemMetadata);const r=this._dataView.getItem(t),o=this._gridOptions.datasetIdPropertyName||"id";(r==null?void 0:r[o])!==void 0&&(r.rowClass="highlight",this._dataView.updateItem(r[o],r),this.renderGrid(),clearTimeout(zm),zm=setTimeout(()=>{r.rowClass="highlight-end",this._dataView.updateItem(r[o],r),this.renderGrid()},n),setTimeout(()=>{(r==null?void 0:r[o])!==void 0&&(delete r.rowClass,this._dataView.getIdxById(r[o])!==void 0&&(this._dataView.updateItem(r[o],r),this.renderGrid()))},e+n))}setSelectedRow(t){var e;!((e=this._grid)===null||e===void 0)&&e.setSelectedRows&&this._grid.setSelectedRows([t])}setSelectedRows(t){var e;!((e=this._grid)===null||e===void 0)&&e.setSelectedRows&&this._grid.setSelectedRows(t)}renderGrid(){this._grid&&typeof this._grid.invalidate=="function"&&(this._grid.invalidate(),this._grid.render())}resetGrid(t){var e,n,r;if(this.clearPinning(!1),this._grid){const o=this.sharedService.allColumns||[];Array.isArray(o)&&o.length>0&&(this._grid.setColumns(o),!((e=this._gridOptions)===null||e===void 0)&&e.enableAutoSizeColumns&&this._grid.autosizeColumns(),this.gridStateService.resetColumns(t))}typeof((n=this.filterService)===null||n===void 0?void 0:n.clearFilters)=="function"&&this.filterService.clearFilters(),typeof((r=this.sortService)===null||r===void 0?void 0:r.clearSorting)=="function"&&this.sortService.clearSorting()}addItem(t,e){var n,r,o,s,l;const u={...sd,...e};if(!(u!=null&&u.skipError)&&(!this._grid||!this._gridOptions||!this._dataView))throw new Error("[Slickgrid-Universal] We could not find SlickGrid Grid, DataView objects");const p=this._gridOptions.datasetIdPropertyName||"id";if(!(u!=null&&u.skipError)&&(!t||!t.hasOwnProperty(p)))throw new Error(`[Slickgrid-Universal] Adding an item requires the item to include an "${p}" property`);if(!((n=this._gridOptions)===null||n===void 0)&&n.enableTreeData&&(e==null?void 0:e.position)==="top")throw new Error('[Slickgrid-Universal] Please note that `addItem({ position: "top" })` is not supported when used with Tree Data because of the extra complexity.');const c=u==null?void 0:u.position;c==="bottom"||!((r=this._gridOptions)===null||r===void 0)&&r.enableTreeData?this._dataView.addItem(t):this._dataView.insertItem(0,t);let f=0;const m=(o=t==null?void 0:t[p])!==null&&o!==void 0?o:"";return!((s=this._gridOptions)===null||s===void 0)&&s.enableTreeData?(this.invalidateHierarchicalDataset(),f=this._dataView.getRowById(m),u.scrollRowIntoView&&this._grid.scrollRowIntoView(f??0,!1)):u.resortGrid?(this._dataView.reSort(),f=this._dataView.getRowById(m)):(f=c==="bottom"?this._dataView.getRowById(m):0,u.scrollRowIntoView&&this._grid.scrollRowIntoView(f??0)),u.highlightRow&&f!==void 0&&this.highlightRow(f),f!==void 0&&u.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(f),u.triggerEvent&&this.pubSubService.publish("onItemAdded",t),!(!((l=this._gridOptions)===null||l===void 0)&&l.backendServiceApi)&&this._gridOptions.enablePagination&&(c==="bottom"?this.paginationService.goToLastPage():this.paginationService.goToFirstPage()),f}addItems(t,e){var n,r,o,s,l;const u={...sd,...e},p=this._gridOptions.datasetIdPropertyName||"id",c=u==null?void 0:u.position,f=[];if(Array.isArray(t))this._dataView.beginUpdate(!0),c==="bottom"||!((n=this._gridOptions)===null||n===void 0)&&n.enableTreeData?this._dataView.addItems(t):this._dataView.insertItems(0,t),this._dataView.endUpdate();else return[this.addItem(t,u)||0];if(!((r=this._gridOptions)===null||r===void 0)&&r.enableTreeData){this.invalidateHierarchicalDataset();const m=(s=(o=t[0])===null||o===void 0?void 0:o[p])!==null&&s!==void 0?s:"",v=this._dataView.getRowById(m);u.scrollRowIntoView&&this._grid.scrollRowIntoView(v??0,!1)}else u.resortGrid&&this._dataView.reSort();return c&&u.scrollRowIntoView&&!(!((l=this._gridOptions)===null||l===void 0)&&l.enableTreeData)&&(c==="bottom"?this._grid.navigateBottom():this._grid.navigateTop()),t.forEach(m=>f.push(this._dataView.getRowById(m[p]))),u.highlightRow&&this.highlightRow(f),u.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(f),u.triggerEvent&&this.pubSubService.publish("onItemAdded",t),f}deleteItem(t,e){e={...wu,...e};const n=this._gridOptions.datasetIdPropertyName||"id";if(!(e!=null&&e.skipError)&&(!t||!t.hasOwnProperty(n)))throw new Error(`[Slickgrid-Universal] Deleting an item requires the item to include an "${n}" property`);return this.deleteItemById(t[n],e)}deleteItems(t,e){e={...wu,...e};const n=this._gridOptions.datasetIdPropertyName||"id";if(!Array.isArray(t))return this.deleteItem(t,e),[t[n]];this._dataView.beginUpdate(!0);const r=[];return t.forEach(o=>{(o==null?void 0:o[n])!==void 0&&r.push(o[n])}),this._dataView.deleteItems(r),this._dataView.endUpdate(),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),r}deleteItemById(t,e){if(e={...wu,...e},!(e!=null&&e.skipError)&&t==null)throw new Error('[Slickgrid-Universal] Cannot delete a row without a valid "id"');return!(this.gridStateService&&this.gridStateService.needToPreserveRowSelection()||!1)&&this._grid&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows([]),this._dataView.deleteItem(t),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),t}deleteItemByIds(t,e){if(e={...wu,...e},Array.isArray(t)){this._dataView.beginUpdate(!0);for(let n=0;n<t.length;n++)t[n]!==null&&this.deleteItemById(t[n],{triggerEvent:!1});return this._dataView.endUpdate(),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",t),t}return[]}updateItem(t,e){e={...Gh,...e};const n=this._gridOptions.datasetIdPropertyName||"id",r=!t||!t.hasOwnProperty(n)?void 0:t[n];if(!(e!=null&&e.skipError)&&r===void 0)throw new Error(`[Slickgrid-Universal] Calling Update of an item requires the item to include an "${n}" property`);return this.updateItemById(r,t,e)}updateItems(t,e){var n;e={...Gh,...e};const r=this._gridOptions.datasetIdPropertyName||"id";if(!Array.isArray(t))return[this.updateItem(t,e)];this._dataView.beginUpdate(!0);const o=[],s=[];return t.forEach(l=>{const u=!l||!l.hasOwnProperty(r)?void 0:l[r];if(s.push(u),this._dataView.getIdxById(u)!==void 0){const p=this._dataView.getRowById(u);p!==void 0&&(o.push(p),this._grid.updateRow(p))}}),this._dataView.updateItems(s,t),this._dataView.endUpdate(),!((n=this._gridOptions)===null||n===void 0)&&n.enableTreeData&&this.invalidateHierarchicalDataset(),e.highlightRow&&this.highlightRow(o),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(o),e.triggerEvent&&this.pubSubService.publish("onItemUpdated",t),o}updateItemById(t,e,n){var r;if(n={...Gh,...n},!(n!=null&&n.skipError)&&t===void 0)throw new Error('[Slickgrid-Universal] Cannot update a row without a valid "id"');const o=this._dataView.getRowById(t);if(!(n!=null&&n.skipError)&&!e&&!this._gridOptions.enablePagination)throw new Error(`[Slickgrid-Universal] The item to update in the grid was not found with id: ${t}`);return this._dataView.getIdxById(t)!==void 0&&(this._dataView.updateItem(t,e),o!==void 0&&this._grid.updateRow(o),!((r=this._gridOptions)===null||r===void 0)&&r.enableTreeData&&this.invalidateHierarchicalDataset(),n.scrollRowIntoView&&o!==void 0&&this._grid.scrollRowIntoView(o),n.highlightRow&&o!==void 0&&this.highlightRow(o),o!==void 0&&n.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(o),n.triggerEvent&&this.pubSubService.publish("onItemUpdated",e)),o}upsertItem(t,e){e={...sd,...e};const n=this._gridOptions.datasetIdPropertyName||"id",r=!t||!t.hasOwnProperty(n)?void 0:t[n];if(!(e!=null&&e.skipError)&&r===void 0)throw new Error(`[Slickgrid-Universal] Calling Upsert of an item requires the item to include an "${n}" property`);return this.upsertItemById(r,t,e)}upsertItems(t,e){if(e={...sd,...e},!Array.isArray(t))return[this.upsertItem(t,e)];this._dataView.beginUpdate(!0);const n=[];t.forEach(o=>{n.push(this.upsertItem(o,{...e,highlightRow:!1,resortGrid:!1,selectRow:!1,triggerEvent:!1}))}),this._dataView.endUpdate();const r=n.map(o=>o.added!==void 0?o.added:o.updated);if(e.highlightRow&&this.highlightRow(r),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(r),e.triggerEvent){this.pubSubService.publish("onItemUpserted",t);const o=n.filter(l=>l.added!==void 0);Array.isArray(o)&&o.length>0&&this.pubSubService.publish("onItemAdded",o);const s=n.filter(l=>l.updated!==void 0);Array.isArray(s)&&s.length>0&&this.pubSubService.publish("onItemUpdated",s)}return n}upsertItemById(t,e,n){let r=!1;if(n={...sd,...n},!(n!=null&&n.skipError)&&t===void 0&&!this.hasRowSelectionEnabled())throw new Error('[Slickgrid-Universal] Calling Upsert of an item requires the item to include a valid and unique "id" property');let o,s;return this._dataView.getRowById(t)===void 0?(o=this.addItem(e,n),r=!0):(s=this.updateItem(e,{highlightRow:n.highlightRow,selectRow:n.selectRow,triggerEvent:n.triggerEvent}),r=!1),n.triggerEvent&&(this.pubSubService.publish("onItemUpserted",e),r?this.pubSubService.publish("onItemAdded",e):this.pubSubService.publish("onItemUpdated",e)),{added:o,updated:s}}invalidateHierarchicalDataset(t){var e;if(!((e=this._gridOptions)===null||e===void 0)&&e.enableTreeData&&this.treeDataService){const n=t??this._dataView.getItems(),r=this.treeDataService.convertFlatParentChildToTreeDatasetAndSort(n||[],this.sharedService.allColumns,this._gridOptions);this.sharedService.hierarchicalDataset=r.hierarchical,this.filterService.refreshTreeDataFilters(t),this._dataView.setItems(r.flat)}}hasRowSelectionEnabled(){const t=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&t}}class N0{get eventHandler(){return this._eventHandler}constructor(){this._eventHandler=new Slick.EventHandler}dispose(){this._eventHandler.unsubscribeAll()}bindOnBeforeEditCell(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onBeforeEditCell,(r,o)=>{if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const s=t.getColumns()[o.cell];if(typeof s.onBeforeEditCell=="function"){const l={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:s,dataContext:t.getDataItem(o.row)};s.onBeforeEditCell(r,l)}})}bindOnCellChange(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onCellChange,(r,o)=>{if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const s=t.getColumns()[o.cell];if(typeof s.onCellChange=="function"){const l={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:s,dataContext:t.getDataItem(o.row)};s.onCellChange(r,l)}})}bindOnClick(t){var e;const n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t);this._eventHandler.subscribe(t.onClick,(r,o)=>{var s;if(!r||!o||!t||o.cell===void 0||!t.getColumns||!t.getDataItem)return;const l=(s=t.getColumns)===null||s===void 0?void 0:s.call(t)[o.cell];if(typeof l.onCellClick=="function"){const u={row:o.row,cell:o.cell,dataView:n,grid:t,columnDef:l,dataContext:t.getDataItem(o.row)};l.onCellClick(r,u)}})}}class L0{constructor(t,e,n,r,o,s){this.extensionService=t,this.filterService=e,this.pubSubService=n,this.sharedService=r,this.sortService=o,this.treeDataService=s,this._eventHandler=new Slick.EventHandler,this._columns=[],this._subscriptions=[],this._selectedRowIndexes=[],this._selectedRowDataContextIds=[],this._wasRecheckedAfterPageChange=!0}get _dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get _gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get selectedRowDataContextIds(){return this._selectedRowDataContextIds}set selectedRowDataContextIds(t){this._selectedRowDataContextIds=t}init(t){this._grid=t,this.subscribeToAllGridChanges(t)}dispose(){this._columns=[],this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}changeColumnsArrangement(t,e=!0,n=!1){var r,o,s,l,u,p,c,f,m;if(Array.isArray(t)&&t.length>0){const v=this.getAssociatedGridColumns(this._grid,t);if(v&&Array.isArray(v)&&v.length>0){if(Array.isArray(this.sharedService.allColumns)){const _=[];if(this._gridOptions.enableCheckboxSelector){const C=(s=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.checkboxSelector)===null||o===void 0?void 0:o.columnIndexPosition)!==null&&s!==void 0?s:0;_.push({columnId:"_checkbox_selector",columnIndexPosition:C})}if(this._gridOptions.enableRowDetailView){const C=(p=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.rowDetailView)===null||u===void 0?void 0:u.columnIndexPosition)!==null&&p!==void 0?p:0;_.push({columnId:"_detail_selector",columnIndexPosition:C})}if(this._gridOptions.enableRowMoveManager){const C=(m=(f=(c=this._gridOptions)===null||c===void 0?void 0:c.rowMoveManager)===null||f===void 0?void 0:f.columnIndexPosition)!==null&&m!==void 0?m:0;_.push({columnId:"_move",columnIndexPosition:C})}this.addColumnDynamicWhenFeatureEnabled(_,this.sharedService.allColumns,v)}v.forEach(_=>_.originalWidth=_.width||_.originalWidth),this._grid.setColumns(v),this.sharedService.visibleColumns=v,e?this._grid.autosizeColumns():(n||this._gridOptions.enableAutoResizeColumnsByCellContent&&!this._gridOptions.autosizeColumnsByCellContentOnFirstLoad)&&this.pubSubService.publish("onFullResizeByContentRequested",{caller:"GridStateService"})}}}getCurrentGridState(){var t;const{frozenColumn:e,frozenRow:n,frozenBottom:r}=this.sharedService.gridOptions,o={columns:this.getCurrentColumns(),filters:this.getCurrentFilters(),sorters:this.getCurrentSorters(),pinning:{frozenColumn:e,frozenRow:n,frozenBottom:r}},s=this.getCurrentPagination();if(s&&(o.pagination=s),this.hasRowSelectionEnabled()){const l=this.getCurrentRowSelections();l&&(o.rowSelection=l)}if(!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData){const l=this.getCurrentTreeDataToggleState();l&&(o.treeData=l)}return o}getColumns(){return this._columns}getAssociatedCurrentColumns(t){const e=[];return t&&Array.isArray(t)&&t.forEach(n=>{n!=null&&n.id&&e.push({columnId:n.id,cssClass:n.cssClass||"",headerCssClass:n.headerCssClass||"",width:n.width||0})}),e}getAssociatedGridColumns(t,e){const n=[],r=this.sharedService.allColumns||t.getColumns();return e&&Array.isArray(e)&&e.forEach(o=>{const s=r.find(l=>l.id===o.columnId);s!=null&&s.id&&n.push({...s,cssClass:o.cssClass||s.cssClass,headerCssClass:o.headerCssClass||s.headerCssClass,width:o.width})}),this._columns=n,n}getCurrentColumns(){return this.getAssociatedCurrentColumns(this._grid.getColumns()||[])}getCurrentFilters(){var t,e;if(!((t=this._gridOptions)===null||t===void 0)&&t.backendServiceApi){const n=this._gridOptions.backendServiceApi.service;if(n!=null&&n.getCurrentFilters)return n.getCurrentFilters()}else if(!((e=this.filterService)===null||e===void 0)&&e.getCurrentLocalFilters)return this.filterService.getCurrentLocalFilters();return null}getCurrentPagination(){var t;if(!((t=this._gridOptions)===null||t===void 0)&&t.enablePagination)if(this._gridOptions.backendServiceApi){const e=this._gridOptions.backendServiceApi.service;if(e!=null&&e.getCurrentPagination)return e.getCurrentPagination()}else return this.sharedService.currentPagination;return null}getCurrentRowSelections(){return this._grid&&this._dataView&&this.hasRowSelectionEnabled()?{gridRowIndexes:this._grid.getSelectedRows()||[],dataContextIds:this._dataView.getAllSelectedIds()||[],filteredDataContextIds:this._dataView.getAllSelectedFilteredIds()||[]}:null}getCurrentSorters(){var t,e;if(!((t=this._gridOptions)===null||t===void 0)&&t.backendServiceApi){const n=this._gridOptions.backendServiceApi.service;if(n!=null&&n.getCurrentSorters)return n.getCurrentSorters()}else if(!((e=this.sortService)===null||e===void 0)&&e.getCurrentLocalSorters)return this.sortService.getCurrentLocalSorters();return null}getCurrentTreeDataToggleState(){var t;return!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData&&this.treeDataService?this.treeDataService.getCurrentToggleState():null}needToPreserveRowSelection(){var t;let e=!1;if(!((t=this._gridOptions)===null||t===void 0)&&t.dataView&&this._gridOptions.dataView.hasOwnProperty("syncGridSelection")){const n=this._gridOptions.dataView.syncGridSelection;typeof n=="boolean"?e=this._gridOptions.dataView.syncGridSelection:typeof n=="object"&&(e=n.preserveHidden||n.preserveHiddenOnSelectionChange),e&&this._gridOptions.backendServiceApi&&this._gridOptions.dataView.hasOwnProperty("syncGridSelectionWithBackendService")&&(e=this._gridOptions.dataView.syncGridSelectionWithBackendService)}return e}resetColumns(t){const e=t||this._columns,n=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:n,type:ur.columns},gridState:this.getCurrentGridState()})}resetToOriginalColumns(t=!0){this._grid.setColumns(this.sharedService.allColumns),this.sharedService.visibleColumns=this.sharedService.allColumns,t&&this._grid.autosizeColumns()}resetRowSelectionWhenRequired(){var t,e;if(!this.needToPreserveRowSelection()&&(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)){const n=(e=(t=this.extensionService)===null||t===void 0?void 0:t.getExtensionByName)===null||e===void 0?void 0:e.call(t,ni.rowSelection);n!=null&&n.instance&&this._grid.setSelectedRows([])}}subscribeToAllGridChanges(t){this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:ur.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.sorter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:ur.sorter},gridState:this.getCurrentGridState()})})),this.bindExtensionAddonEventToGridStateChange(ni.columnPicker,"onColumnsChanged"),this.bindExtensionAddonEventToGridStateChange(ni.gridMenu,"onColumnsChanged"),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsReordered",t),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsResized",t),this.bindSlickGridOnSetOptionsEventToGridStateChange(t),(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,(e,n)=>{const r=(this._selectedRowIndexes||[]).slice(),o=(this.selectedRowDataContextIds||[]).slice();if(this.selectedRowDataContextIds=n.filteredIds,this._selectedRowIndexes=n.rows,!es(this.selectedRowDataContextIds,o)||!es(this._selectedRowIndexes,r)){const s={gridRowIndexes:this._selectedRowIndexes||[],dataContextIds:n.selectedRowIds,filteredDataContextIds:n.filteredIds};this.pubSubService.publish("onGridStateChanged",{change:{newValues:s,type:ur.rowSelection},gridState:this.getCurrentGridState()})}}),this._subscriptions.push(this.pubSubService.subscribe("onHeaderMenuHideColumns",e=>{const n=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:n,type:ur.columns},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeItemToggled",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.treeData},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeFullToggleEnd",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:ur.treeData},gridState:this.getCurrentGridState()})}))}addColumnDynamicWhenFeatureEnabled(t,e,n){t.sort((r,o)=>r.columnIndexPosition-o.columnIndexPosition),t.forEach(r=>{const o=e.findIndex(l=>l.id===r.columnId),s=n.findIndex(l=>l.id===r.columnId);if(o>=0&&s===-1){const l=e[o];o===0?n.unshift(l):n.splice(o,0,l)}})}bindExtensionAddonEventToGridStateChange(t,e){var n,r,o;const s=(r=(n=this.extensionService)===null||n===void 0?void 0:n.getExtensionByName)===null||r===void 0?void 0:r.call(n,t),l=(o=s==null?void 0:s.instance)===null||o===void 0?void 0:o[e];l&&typeof l.subscribe=="function"&&this._eventHandler.subscribe(l,(u,p)=>{const c=p==null?void 0:p.columns,f=this.getAssociatedCurrentColumns(c);this.pubSubService.publish("onGridStateChanged",{change:{newValues:f,type:ur.columns},gridState:this.getCurrentGridState()})})}bindSlickGridColumnChangeEventToGridStateChange(t,e){const n=e==null?void 0:e[t];n&&typeof n.subscribe=="function"&&this._eventHandler.subscribe(n,()=>{const r=e.getColumns(),o=this.getAssociatedCurrentColumns(r);this.pubSubService.publish("onGridStateChanged",{change:{newValues:o,type:ur.columns},gridState:this.getCurrentGridState()})})}bindSlickGridOnSetOptionsEventToGridStateChange(t){const e=t.onSetOptions;this._eventHandler.subscribe(e,(n,r)=>{const{frozenBottom:o,frozenColumn:s,frozenRow:l}=r.optionsBefore,{frozenBottom:u,frozenColumn:p,frozenRow:c}=r.optionsAfter;if(o!==u||s!==p||l!==c){const f={frozenBottom:u,frozenColumn:p,frozenRow:c},m=this.getCurrentGridState();this.pubSubService.publish("onGridStateChanged",{change:{newValues:f,type:ur.pinning},gridState:m})}})}hasRowSelectionEnabled(){const t=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&t}}class H0{constructor(t,e){this.extensionUtility=t,this.pubSubService=e,this._subscriptions=[],this._eventHandler=new Slick.EventHandler}get _dataView(){var t;return((t=this._grid)===null||t===void 0?void 0:t.getData)&&this._grid.getData()}get eventHandler(){return this._eventHandler}get _gridOptions(){var t;return!((t=this._grid)===null||t===void 0)&&t.getOptions?this._grid.getOptions():{}}get _columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}init(t){if(this._grid=t,t&&this._gridOptions&&this._gridOptions.createPreHeaderPanel){this._gridOptions.enableTranslate&&this.translateGroupingAndColSpan(),this._eventHandler.subscribe(t.onSort,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onRendered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onAutosizeColumns,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onColumnsResized,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onColumnsReordered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(this._dataView.onRowCountChanged,()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this._subscriptions.push(this.pubSubService.subscribe("onColumnPickerColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onHeaderMenuHideColumns",()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this.pubSubService.subscribe("onGridMenuColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onGridMenuMenuClose",()=>this.renderPreHeaderRowGroupingTitles()));const e=t.getPluginByName("Resizer");e!=null&&e.onGridAfterResize&&this._eventHandler.subscribe(e.onGridAfterResize,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(t.onSetOptions,(n,r)=>{var o,s;((o=r==null?void 0:r.optionsBefore)===null||o===void 0?void 0:o.frozenColumn)!==((s=r==null?void 0:r.optionsAfter)===null||s===void 0?void 0:s.frozenColumn)&&this.delayRenderPreHeaderRowGroupingTitles(0)}),this.delayRenderPreHeaderRowGroupingTitles(75)}}dispose(){this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}delayRenderPreHeaderRowGroupingTitles(t=0){setTimeout(()=>this.renderPreHeaderRowGroupingTitles(),t)}renderPreHeaderRowGroupingTitles(){var t;if(this._gridOptions&&this._gridOptions.frozenColumn!==void 0&&this._gridOptions.frozenColumn>=0){let e=this._grid.getPreHeaderPanelLeft();this.renderHeaderGroups(e,0,this._gridOptions.frozenColumn+1),e=this._grid.getPreHeaderPanelRight(),this.renderHeaderGroups(e,((t=this._gridOptions)===null||t===void 0?void 0:t.frozenColumn)+1,this._columnDefinitions.length)}else{const e=this._grid.getPreHeaderPanel();this.renderHeaderGroups(e,0,this._columnDefinitions.length)}}renderHeaderGroups(t,e,n){var r,o,s;en(t),t.className="slick-header-columns",t.style.left="-1000px",t.style.width=`${this._grid.getHeadersWidth()}px`,t.parentElement&&t.parentElement.classList.add("slick-header");const l=this._grid.getHeaderColumnWidthDiff();let u,p=null,c="",f=0;const m=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.frozenHeaderWidthCalcDifferential)!==null&&o!==void 0?o:0,v=((s=this._gridOptions)===null||s===void 0?void 0:s.frozenColumn)!==void 0&&this._gridOptions.frozenColumn>=0;for(let _=e;_<n;_++)u=this._columnDefinitions[_],u&&(c===u.columnGroup&&_>0?(f+=u.width||0,p!=null&&p.style&&(p.style.width=`${f-l-m}px`)):(f=u.width||0,p=De("div",{className:`ui-state-default slick-header-column ${v?"frozen":""}`,style:{width:`${f-l}px`}}),De("span",{className:"slick-column-name",textContent:u.columnGroup||""},p),t.appendChild(p)),c=u.columnGroup||"")}translateGroupingAndColSpan(){const t=this._grid.getColumns();this.extensionUtility.translateItems(t,"columnGroupKey","columnGroup"),this._grid.setColumns(t),this.renderPreHeaderRowGroupingTitles()}}class B0{constructor(t,e,n,r){this.pubSubService=t,this.sharedService=e,this.backendUtilities=n,this.rxjs=r,this._eventHandler=new Slick.EventHandler,this._initialized=!1,this._isLocalGrid=!0,this._dataFrom=1,this._dataTo=1,this._itemsPerPage=0,this._pageCount=1,this._pageNumber=1,this._totalItems=0,this._availablePageSizes=[],this._subscriptions=[]}get dataView(){var t,e,n;return(n=(e=(t=this.grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}set paginationOptions(t){this._paginationOptions=t}get paginationOptions(){return this._paginationOptions}get availablePageSizes(){return this._availablePageSizes}get dataFrom(){return this._dataFrom}get dataTo(){return this._dataTo}get itemsPerPage(){return this._itemsPerPage}get pageCount(){return this._pageCount}get pageNumber(){return this._pageNumber}get totalItems(){return this._totalItems}set totalItems(t){this._totalItems=t,this._initialized&&this.refreshPagination()}addRxJsResource(t){this.rxjs=t}init(t,e,n){if(this._availablePageSizes=e.pageSizes,this.grid=t,this._backendServiceApi=n,this._paginationOptions=e,this._isLocalGrid=!n,this._pageNumber=e.pageNumber||1,n&&(!n.service||!n.process))throw new Error('BackendServiceApi requires the following 2 properties "process" and "service" to be defined.');this._isLocalGrid&&this.dataView&&(this._eventHandler.subscribe(this.dataView.onPagingInfoChanged,(o,s)=>{this._totalItems!==s.totalRows&&(this.updateTotalItems(s.totalRows),this._previousPagination={pageNumber:s.pageNum,pageSize:s.pageSize,pageSizes:this.availablePageSizes,totalItems:s.totalRows})}),setTimeout(()=>{this.dataView&&(this.dataView.setRefreshHints({isFilterUnchanged:!0}),this.dataView.setPagingOptions({pageSize:this.paginationOptions.pageSize,pageNum:this._pageNumber-1}))})),this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",()=>this.resetPagination())),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>this.resetPagination())),this.dataView&&(this._subscriptions.push(this.pubSubService.subscribe("onItemAdded",o=>this.processOnItemAddedOrRemoved(o,!0))),this._subscriptions.push(this.pubSubService.subscribe("onItemDeleted",o=>this.processOnItemAddedOrRemoved(o,!1)))),this.refreshPagination(!1,!1,!0);const r=this.getFullPagination();this._previousPagination={pageNumber:r.pageNumber,pageSize:r.pageSize,pageSizes:r.pageSizes,totalItems:this.totalItems},this._initialized=!0}dispose(){this._initialized=!1,this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}getCurrentPagination(){return{pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes}}getFullPagination(){return{pageCount:this._pageCount,pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes,totalItems:this._totalItems,dataFrom:this._dataFrom,dataTo:this._dataTo}}getCurrentPageNumber(){return this._pageNumber}getCurrentItemPerPage(){return this._itemsPerPage}changeItemPerPage(t,e,n=!0){return this._pageNumber=1,this._pageCount=Math.ceil(this._totalItems/t),this._itemsPerPage=t,n?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination())}goToFirstPage(t,e=!0){return this._pageNumber=1,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())}goToLastPage(t,e=!0){return this._pageNumber=this._pageCount||1,e?this.processOnPageChanged(this._pageNumber||1,t):Promise.resolve(this.getFullPagination())}goToNextPage(t,e=!0){return this._pageNumber<this._pageCount?(this._pageNumber++,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())):Promise.resolve(!1)}goToPageNumber(t,e,n=!0){const r=this._pageNumber;return t<1?this._pageNumber=1:t>this._pageCount?this._pageNumber=this._pageCount:this._pageNumber=t,this._pageNumber!==r?n?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination()):Promise.resolve(!1)}goToPreviousPage(t,e=!0){return this._pageNumber>1?(this._pageNumber--,e?this.processOnPageChanged(this._pageNumber,t):Promise.resolve(this.getFullPagination())):Promise.resolve(!1)}refreshPagination(t=!1,e=!0,n=!1){var r,o,s;const l={...this.getFullPagination()};if(this._paginationOptions){const p=this._paginationOptions;this._itemsPerPage||(this._isLocalGrid?this._itemsPerPage=p.pageSize:this._itemsPerPage=+(!((s=(o=(r=this._backendServiceApi)===null||r===void 0?void 0:r.options)===null||o===void 0?void 0:o.paginationOptions)===null||s===void 0)&&s.first?this._backendServiceApi.options.paginationOptions.first:p.pageSize)),(t||this._totalItems!==p.totalItems)&&(t?(this._pageNumber=1,this.paginationOptions.pageNumber=1):!this._initialized&&p.pageNumber&&p.pageNumber>1&&(this._pageNumber=p.pageNumber||1),this._pageNumber===1&&this._backendServiceApi&&this._backendServiceApi.service.resetPaginationOptions()),this._availablePageSizes=p.pageSizes,!this._totalItems&&p.totalItems&&(this._totalItems=p.totalItems),this.recalculateFromToIndexes()}this._pageCount=Math.ceil(this._totalItems/this._itemsPerPage),this.sharedService.currentPagination=this.getCurrentPagination(),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),e&&!es(l,this.getFullPagination())&&this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),n&&!es(l,this.getFullPagination())&&this.pubSubService.publish("onPaginationPresetsInitialized",this.getFullPagination());const u=this.getFullPagination();this._previousPagination={pageNumber:u.pageNumber,pageSize:u.pageSize,pageSizes:u.pageSizes,totalItems:this.totalItems}}resetPagination(t=!0){var e,n;this._isLocalGrid&&this.dataView&&(!((n=(e=this.sharedService)===null||e===void 0?void 0:e.gridOptions)===null||n===void 0)&&n.enablePagination)&&this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:0}),this.refreshPagination(!0,t)}togglePaginationVisibility(t){var e;if(this.grid&&(!((e=this.sharedService)===null||e===void 0)&&e.gridOptions)){const n=t!==void 0?t:!this.sharedService.gridOptions.enablePagination;if(n&&this.goToFirstPage(),this._isLocalGrid&&this.dataView){const r=t?this._itemsPerPage:0;this.dataView.setPagingOptions({pageSize:r,pageNum:0})}this.sharedService.gridOptions.enablePagination=n,this.pubSubService.publish("onPaginationVisibilityChanged",{visible:n})}}processOnPageChanged(t,e){return this.pubSubService.publish("onBeforePaginationChange",this.getFullPagination())===!1?(this.resetToPreviousPagination(),Promise.resolve(this.getFullPagination())):new Promise((n,r)=>{var o,s,l;if(this.recalculateFromToIndexes(),this._isLocalGrid&&this.dataView)this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:t-1}),this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),n(this.getFullPagination());else{const u=+this._itemsPerPage,p=new Date;if(!((o=this._backendServiceApi)===null||o===void 0)&&o.preProcess&&this._backendServiceApi.preProcess(),!((s=this._backendServiceApi)===null||s===void 0)&&s.process){const c=this._backendServiceApi.service.processOnPaginationChanged(e,{newPage:t,pageSize:u}),f=this._backendServiceApi.process(c);f instanceof Promise?f.then(m=>{var v;(v=this.backendUtilities)===null||v===void 0||v.executeBackendProcessesCallback(p,m,this._backendServiceApi,this._totalItems);const _=this.getFullPagination();this._previousPagination={pageNumber:_.pageNumber,pageSize:_.pageSize,pageSizes:_.pageSizes,totalItems:this.totalItems},n(this.getFullPagination())}).catch(m=>{var v,_,C;this.resetToPreviousPagination(),(v=this.backendUtilities)===null||v===void 0||v.onBackendError(m,this._backendServiceApi),(!(!((_=this._backendServiceApi)===null||_===void 0)&&_.onError)||!(!((C=this.backendUtilities)===null||C===void 0)&&C.onBackendError))&&r(f)}):!((l=this.rxjs)===null||l===void 0)&&l.isObservable(f)&&this._subscriptions.push(f.subscribe(m=>{var v;const _=this.getFullPagination();this._previousPagination={pageNumber:_.pageNumber,pageSize:_.pageSize,pageSizes:_.pageSizes,totalItems:this.totalItems},n((v=this.backendUtilities)===null||v===void 0?void 0:v.executeBackendProcessesCallback(p,m,this._backendServiceApi,this._totalItems))},m=>{var v,_,C;this.resetToPreviousPagination(),(v=this.backendUtilities)===null||v===void 0||v.onBackendError(m,this._backendServiceApi),(!(!((_=this._backendServiceApi)===null||_===void 0)&&_.onError)||!(!((C=this.backendUtilities)===null||C===void 0)&&C.onBackendError))&&r(f)})),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),this.pubSubService.publish("onPaginationChanged",this.getFullPagination())}}})}recalculateFromToIndexes(){this._totalItems===0?(this._dataFrom=0,this._dataTo=1,this._pageNumber=0):(this._dataFrom=this._pageNumber>1?this._pageNumber*this._itemsPerPage-this._itemsPerPage+1:1,this._dataTo=this._totalItems<this._itemsPerPage?this._totalItems:(this._pageNumber||1)*this._itemsPerPage,this._dataTo>this._totalItems&&(this._dataTo=this._totalItems)),this._pageNumber=this._totalItems>0&&this._pageNumber===0?1:this._pageNumber,this._dataTo>this._totalItems?this._dataTo=this._totalItems:this._totalItems<this._itemsPerPage&&(this._dataTo=this._totalItems)}resetToPreviousPagination(){var t,e,n,r,o,s,l,u,p,c,f,m,v;const _=((t=this._previousPagination)===null||t===void 0?void 0:t.pageNumber)!==this.getFullPagination().pageNumber,C=((e=this._previousPagination)===null||e===void 0?void 0:e.pageSize)!==this.getFullPagination().pageSize;C&&this.changeItemPerPage((r=(n=this._previousPagination)===null||n===void 0?void 0:n.pageSize)!==null&&r!==void 0?r:0,null,!1),_&&this.goToPageNumber((s=(o=this._previousPagination)===null||o===void 0?void 0:o.pageNumber)!==null&&s!==void 0?s:0,null,!1),(_||C)&&(this.refreshPagination(),(p=(u=(l=this._backendServiceApi)===null||l===void 0?void 0:l.service)===null||u===void 0?void 0:u.updatePagination)===null||p===void 0||p.call(u,(f=(c=this._previousPagination)===null||c===void 0?void 0:c.pageNumber)!==null&&f!==void 0?f:0,(v=(m=this._previousPagination)===null||m===void 0?void 0:m.pageSize)!==null&&v!==void 0?v:0))}updateTotalItems(t,e=!1){this._totalItems=t,this._paginationOptions&&(this._paginationOptions.totalItems=t,this.refreshPagination(!1,e))}processOnItemAddedOrRemoved(t,e=!0){if(t!==null){const n=this._dataTo,r=Array.isArray(t)?t.length:1,o=e?+r:-r;this._totalItems+=o,this.recalculateFromToIndexes(),this._dataTo=n+o,this.pubSubService.publish("onPaginationChanged",this.getFullPagination())}}}const V0=20,z0=25,U0=35,G0=180,W0=300,$0=200;class Y0{get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get dataView(){var t;return(t=this._grid)===null||t===void 0?void 0:t.getData()}get gridUid(){var t,e;return(e=(t=this._grid)===null||t===void 0?void 0:t.getUID())!==null&&e!==void 0?e:""}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get intervalRetryDelay(){return this._intervalRetryDelay}set intervalRetryDelay(t){this._intervalRetryDelay=t}get resizeByContentOptions(){var t,e;return(e=(t=this.gridOptions)===null||t===void 0?void 0:t.resizeByContentOptions)!==null&&e!==void 0?e:{}}constructor(t){this.pubSubService=t,this._intervalRetryDelay=$0,this._isStopResizeIntervalRequested=!1,this._hasResizedByContentAtLeastOnce=!1,this._totalColumnsWidthByContent=0,this._resizePaused=!1,this._subscriptions=[],this._eventHandler=new Slick.EventHandler,this._bindingEventService=new Fn}dispose(){var t,e;(t=this._eventHandler)===null||t===void 0||t.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._intervalId&&clearInterval(this._intervalId),clearTimeout(this._timer),((e=this.gridOptions.autoResize)===null||e===void 0?void 0:e.resizeDetection)==="container"&&this._resizeObserver&&this._resizeObserver.disconnect(),this._bindingEventService.unbindAll()}init(t,e){var n,r,o,s,l,u,p,c;if(!t||!this.gridOptions||!e)throw new Error(`
15
15
  [Slickgrid-Universal] Resizer Service requires a valid Grid object and DOM Element Container to be provided.
16
16
  You can fix this by setting your gridOption to use "enableAutoResize" or create an instance of the ResizerService by calling bindAutoResizeDataGrid() once.`);this._grid=t,this._gridContainerElm=e;const f=!((n=this.gridOptions)===null||n===void 0)&&n.gridHeight||!((r=this.gridOptions)===null||r===void 0)&&r.gridWidth?{height:(o=this.gridOptions)===null||o===void 0?void 0:o.gridHeight,width:(s=this.gridOptions)===null||s===void 0?void 0:s.gridWidth}:void 0;this._autoResizeOptions=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.autoResize)!==null&&u!==void 0?u:{container:"grid1",bottomPadding:0},f!=null&&f.width&&(e!=null&&e.style)&&(e.style.width=typeof f.width=="string"?f.width:`${f.width}px`),this._gridDomElm=(p=t==null?void 0:t.getContainerNode)===null||p===void 0?void 0:p.call(t),typeof this._autoResizeOptions.container=="string"?this._pageContainerElm=typeof this._autoResizeOptions.container=="string"?document.querySelector(this._autoResizeOptions.container):this._autoResizeOptions.container:this._pageContainerElm=this._autoResizeOptions.container,f&&(this._fixedHeight=f.height,this._fixedWidth=f.width),this.gridOptions&&this.gridOptions.enableAutoResize&&this.bindAutoResizeDataGrid(),this.gridOptions.autoResize&&this._subscriptions.push(this.pubSubService.subscribe("onFullResizeByContentRequested",()=>this.resizeColumnsByCellContent(!0))),!((c=this.gridOptions)===null||c===void 0)&&c.enableColumnResizeOnDoubleClick&&(this._subscriptions.push(this.pubSubService.subscribe("onHeaderMenuColumnResizeByContent",m=>{this.handleSingleColumnResizeByContent(m.columnId)})),this._eventHandler.subscribe(this._grid.onColumnsResizeDblClick,(m,v)=>{this.handleSingleColumnResizeByContent(v.triggeredByColumn)}))}bindAutoResizeDataGrid(t){var e;if(((e=this.gridOptions.autoResize)===null||e===void 0?void 0:e.resizeDetection)==="container"){if(!this._pageContainerElm||!this._pageContainerElm)throw new Error(`
17
17
  [Slickgrid-Universal] Resizer Service requires a container when gridOption.autoResize.resizeDetection="container"
18
- You can fix this by setting your gridOption.autoResize.container`);this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>this.resizeObserverCallback())),this._resizeObserver.observe(this._pageContainerElm)}else{if(this._gridDomElm===void 0||qn(this._gridDomElm)===void 0)return null;this.resizeGrid().then(()=>this.resizeGridWhenStylingIsBrokenUntilCorrected()).catch(n=>console.log("Error:",n)),this.resizeGrid(10,t),this._bindingEventService.bind(window,"resize",this.handleResizeGrid.bind(this,t))}}handleResizeGrid(t){this.pubSubService.publish("onGridBeforeResize"),this._resizePaused||(this.resizeGrid(0,t),this.resizeGrid(0,t))}resizeObserverCallback(){this._resizePaused||this.resizeGrid()}calculateGridNewDimensions(t){var e,n,r,o,s,l,u;const p=(e=t==null?void 0:t.autoResize)!==null&&e!==void 0?e:{},c=qn(this._gridDomElm);if(!window||this._pageContainerElm===void 0||c===void 0)return null;let f=(p==null?void 0:p.bottomPadding)!==void 0?p.bottomPadding:V0;if(f&&t.enablePagination&&(f+=U0),f&&t.showCustomFooter){const N=(o=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.customFooterOptions)===null||r===void 0?void 0:r.footerHeight)!==null&&o!==void 0?o:z0;f+=parseInt(`${N}`,10)}let m=0,v=0;p.calculateAvailableSizeBy==="container"?m=Zp(this._pageContainerElm,"height")||0:(m=window.innerHeight||0,v=(s=c==null?void 0:c.top)!==null&&s!==void 0?s:0);const _=m-v-f,C=Zp(this._pageContainerElm,"width")||window.innerWidth||0,x=p==null?void 0:p.maxHeight,w=(l=p==null?void 0:p.minHeight)!==null&&l!==void 0?l:G0,E=p==null?void 0:p.maxWidth,I=(u=p==null?void 0:p.minWidth)!==null&&u!==void 0?u:W0;let k=_,F=p!=null&&p.rightPadding?C-p.rightPadding:C;return k<w&&(k=w),x&&k>x&&(k=x),F<I&&(F=I),E&&F>E&&(F=E),{height:this._fixedHeight||k,width:this._fixedWidth||F}}getLastResizeDimensions(){return this._lastDimensions}pauseResizer(t){this._resizePaused=t}resizeGrid(t,e){return new Promise(n=>{t=t||0,t>0?(clearTimeout(this._timer),this._timer=setTimeout(()=>n(this.resizeGridCallback(e)),t)):n(this.resizeGridCallback(e))})}resizeGridCallback(t){var e,n;const r=this.resizeGridWithDimensions(t);return this.pubSubService.publish("onGridAfterResize",r),this.gridOptions.enableAutoResizeColumnsByCellContent&&(!(!((e=this._lastDimensions)===null||e===void 0)&&e.width)||(r==null?void 0:r.width)!==((n=this._lastDimensions)===null||n===void 0?void 0:n.width))&&this.resizeColumnsByCellContent(!1),this._lastDimensions=r,r}resizeGridWithDimensions(t){var e,n,r,o;const s=this.calculateGridNewDimensions(this.gridOptions);if((t||s)&&this._gridDomElm){const l=t!=null&&t.height?t.height:s==null?void 0:s.height,u=t!=null&&t.width?t.width:s==null?void 0:s.width;this.gridOptions.autoHeight||(this._gridDomElm.style.height=`${l}px`),this._gridDomElm.style.width=`${u}px`,this._gridContainerElm&&(this._gridContainerElm.style.width=`${u}px`),new RegExp("MSIE [6-8]").exec(navigator.userAgent)===null&&(!((e=this._grid)===null||e===void 0)&&e.resizeCanvas)&&this._gridContainerElm&&this._grid.resizeCanvas(),!((n=this.gridOptions)===null||n===void 0)&&n.enableAutoSizeColumns&&this._grid.autosizeColumns?this.gridUid&&document.querySelector(this.gridUidSelector)&&this._grid.autosizeColumns():this.gridOptions.enableAutoResizeColumnsByCellContent&&(!(!((r=this._lastDimensions)===null||r===void 0)&&r.width)||u!==((o=this._lastDimensions)===null||o===void 0?void 0:o.width))&&this.resizeColumnsByCellContent(!1),this._lastDimensions={height:l||0,width:u||0}}return this._lastDimensions}requestStopOfAutoFixResizeGrid(t=!0){this._isStopResizeIntervalRequested=t}resizeColumnsByCellContent(t=!1){var e,n,r,o,s,l,u;const p=this._grid.getColumns(),c=this.dataView.getItems(),f={};let m=!1,v=0;const _=(n=(e=this._gridContainerElm)===null||e===void 0?void 0:e.offsetWidth)!==null&&n!==void 0?n:0;if(!Array.isArray(c)||c.length===0||!t&&this._totalColumnsWidthByContent>0&&this._totalColumnsWidthByContent<_){this._grid.autosizeColumns();return}if(this._hasResizedByContentAtLeastOnce&&(!((r=this.gridOptions)===null||r===void 0)&&r.resizeByContentOnlyOnFirstLoad)&&!t)return;if(this.pubSubService.publish("onBeforeResizeByContent",void 0,0),this._totalColumnsWidthByContent===0||t){for(const w of p)f[w.id]=(s=(o=w.originalWidth)!==null&&o!==void 0?o:w.minWidth)!==null&&s!==void 0?s:0;v=this.calculateCellWidthByReadingDataset(p,f,this.resizeByContentOptions.maxItemToInspectCellContentWidth);let x=0;for(const w of p){const E=(u=(l=w.resizeAlwaysRecalculateWidth)!==null&&l!==void 0?l:this.resizeByContentOptions.alwaysRecalculateColumnWidth)!==null&&u!==void 0?u:!1;w.originalWidth&&!E?w.width=w.originalWidth:f[w.id]!==void 0&&(w.rerenderOnResize&&(m=!0),this.applyNewCalculatedColumnWidthByReference(w,f[w.id])),x+=w.width||0,this._totalColumnsWidthByContent=x}}this._grid.setColumns(p),this._hasResizedByContentAtLeastOnce=!0;const C={};for(const x of p)C[x.id]=x.width;this._totalColumnsWidthByContent>_?this._grid.reRenderColumns(m):this._grid.autosizeColumns(),this.pubSubService.publish("onAfterResizeByContent",{readItemCount:v,calculateColumnWidths:C})}calculateCellWidthByReadingDataset(t,e,n=1e3,r){const o=Array.isArray(t)?t:[t],s=this.dataView.getItems();let l=0;for(const[u,p]of s.entries()){if(u>n)break;Array.isArray(o)&&typeof e=="object"&&o.forEach((c,f)=>{const m=this.calculateCellWidthByContent(p,c,u,r??f,e[c.id]);m!==void 0&&(e[c.id]=m)}),l=u+1}return l}calculateCellWidthByContent(t,e,n,r,o){var s,l;const u=(s=this.resizeByContentOptions.cellCharWidthInPx)!==null&&s!==void 0?s:7;if(!e.originalWidth){const p=(l=e==null?void 0:e.resizeCharWidthInPx)!==null&&l!==void 0?l:u,c=nu(e==null?void 0:e.formatter,n,r,e,t,this._grid),f=or(c),m=Math.ceil(f.length*p),v=e.resizeMaxWidthThreshold;e&&(o===void 0||m>o)&&(o=v!==void 0&&m>v?v:e.maxWidth!==void 0&&m>e.maxWidth?e.maxWidth:m)}return o}applyNewCalculatedColumnWidthByReference(t,e){var n,r,o,s,l,u,p;const c=(n=this.resizeByContentOptions.cellPaddingWidthInPx)!==null&&n!==void 0?n:6,f=(r=this.resizeByContentOptions.formatterPaddingWidthInPx)!==null&&r!==void 0?r:6,m=(l=(s=(o=t==null?void 0:t.filter)===null||o===void 0?void 0:o.type)!==null&&s!==void 0?s:t==null?void 0:t.type)!==null&&l!==void 0?l:ie.string;let v=e;const _=(p=(u=t==null?void 0:t.resizeCalcWidthRatio)!==null&&u!==void 0?u:this.resizeByContentOptions.defaultRatioForStringType)!==null&&p!==void 0?p:.9;v*=m==="string"?_:1,v+=c,t.resizeExtraWidthPadding&&(v+=t.resizeExtraWidthPadding),t.editor&&this.gridOptions.editable&&(v+=f),t.maxWidth!==void 0&&v>t.maxWidth&&(v=t.maxWidth),t.resizeMaxWidthThreshold!==void 0&&v>t.resizeMaxWidthThreshold&&(v=t.resizeMaxWidthThreshold),v=Math.ceil(v),(t.originalWidth===void 0||t.resizeAlwaysRecalculateWidth===!0||this.resizeByContentOptions.alwaysRecalculateColumnWidth===!0)&&(t.width=this.readjustNewColumnWidthWhenOverLimit(t,v))}handleSingleColumnResizeByContent(t){var e,n,r;const o=this._grid.getColumns(),s=o.findIndex(l=>l.id===t);if(s>=0){const l=o[s],u={[t]:(n=(e=l.originalWidth)!==null&&e!==void 0?e:l.minWidth)!==null&&n!==void 0?n:0};l.originalWidth=void 0,this.calculateCellWidthByReadingDataset(l,u,this.resizeByContentOptions.maxItemToInspectSingleColumnWidthByContent,s),this.applyNewCalculatedColumnWidthByReference(l,u[t]),this._grid.reRenderColumns((r=l==null?void 0:l.rerenderOnResize)!==null&&r!==void 0?r:!1)}}readjustNewColumnWidthWhenOverLimit(t,e){var n,r,o,s,l,u,p,c;const f=(n=this.gridOptions.frozenColumn)!==null&&n!==void 0?n:-1,m=(r=this._grid.getColumns().findIndex(_=>_.id===t.id))!==null&&r!==void 0?r:0;let v=e;if(f>=0&&m<=f){const _=Array.from(this._grid.getViewports());if(_){const C=(s=(o=_.find(k=>k.classList.contains("slick-viewport-left")))===null||o===void 0?void 0:o.clientWidth)!==null&&s!==void 0?s:0,x=(u=(l=_.find(k=>k.classList.contains("slick-viewport-right")))===null||l===void 0?void 0:l.clientWidth)!==null&&u!==void 0?u:0,w=C+x,E=C-((p=t.width)!==null&&p!==void 0?p:0);if(E+e>w){const k=(c=this.resizeByContentOptions.widthToRemoveFromExceededWidthReadjustment)!==null&&c!==void 0?c:50;v=C-E+x-k}}}return Math.ceil(v)}checkIsGridShown(){var t,e;return!!((e=(t=document.querySelector(`${this.gridUidSelector}`))===null||t===void 0?void 0:t.offsetParent)!==null&&e!==void 0&&e)}resizeGridWhenStylingIsBrokenUntilCorrected(){var t,e,n,r;const o=(e=(t=this.gridOptions)===null||t===void 0?void 0:t.autoFixResizeTimeout)!==null&&e!==void 0?e:18e3,s=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.autoFixResizeRequiredGoodCount)!==null&&r!==void 0?r:5,l=this._gridContainerElm.querySelector(`${this.gridUidSelector} .slick-header`),u=this._gridContainerElm.querySelector(`${this.gridUidSelector} .slick-viewport`);let p=0,c=0;if(l&&u&&this.gridOptions.autoFixResizeWhenBrokenStyleDetected){const f=this.dataView.getItemCount(),m=this._grid.getColumns()||[];this._intervalId=setInterval(async()=>{var v,_,C,x,w,E;const k=qn(l);let F=(v=k==null?void 0:k.top)!==null&&v!==void 0?v:0;this.gridOptions&&this.gridOptions.enableFiltering&&this.gridOptions.headerRowHeight&&(F+=this.gridOptions.headerRowHeight),this.gridOptions&&this.gridOptions.createPreHeaderPanel&&this.gridOptions.showPreHeaderPanel&&this.gridOptions.preHeaderPanelHeight&&(F+=this.gridOptions.preHeaderPanelHeight),F+=44;const N=qn(u),V=(_=N==null?void 0:N.top)!==null&&_!==void 0?_:0,Q=qn(this._gridContainerElm);let L=(k==null?void 0:k.top)===0||F-V>2||(Q==null?void 0:Q.left)===0&&(Q==null?void 0:Q.top)===0;const se=(E=(w=(x=(C=this._grid).getRenderedRange)===null||x===void 0?void 0:x.call(C))===null||w===void 0?void 0:w.rightPx)!==null&&E!==void 0?E:0;!L&&f>0&&se===0&&m.length>1&&(L=!0),this._isStopResizeIntervalRequested&&(L=!1,p=o),this.checkIsGridShown()&&(L||(Q==null?void 0:Q.left)===0||(Q==null?void 0:Q.top)===0)&&(await this.resizeGrid(),this.checkIsGridShown()&&(L=!1)),this.checkIsGridShown()&&c++,this.checkIsGridShown()&&!L&&(c>=s||p++>=o)&&clearInterval(this._intervalId)},this.intervalRetryDelay)}}}class j0{constructor(){this._hasColumnsReordered=!1,this._hideHeaderRowAfterPageLoad=!1}get allColumns(){return this._allColumns}set allColumns(t){this._allColumns=t}get columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}get currentPagination(){return this._currentPagination}set currentPagination(t){this._currentPagination=t}get dataView(){return this._dataView}set dataView(t){this._dataView=t}get frozenVisibleColumnId(){return this._frozenVisibleColumnId}set frozenVisibleColumnId(t){this._frozenVisibleColumnId=t}get hasColumnsReordered(){return this._hasColumnsReordered}set hasColumnsReordered(t){this._hasColumnsReordered=t}get slickGrid(){return this._grid}set slickGrid(t){this._grid=t}get gridContainerElement(){return this._gridContainerElm}set gridContainerElement(t){this._gridContainerElm=t}get gridOptions(){var t;return this._gridOptions||((t=this._grid)===null||t===void 0?void 0:t.getOptions())||{}}set gridOptions(t){this._gridOptions=t}get groupItemMetadataProvider(){return this._groupItemMetadataProvider}set groupItemMetadataProvider(t){this._groupItemMetadataProvider=t}get hideHeaderRowAfterPageLoad(){return this._hideHeaderRowAfterPageLoad}set hideHeaderRowAfterPageLoad(t){this._hideHeaderRowAfterPageLoad=t}get externalRegisteredResources(){return this._externalRegisteredResources}set externalRegisteredResources(t){this._externalRegisteredResources=t}get visibleColumns(){return this._visibleColumns}set visibleColumns(t){this._visibleColumns=t}get hierarchicalDataset(){return this._hierarchicalDataset}set hierarchicalDataset(t){this._hierarchicalDataset=t}}class X0{constructor(t,e,n,r){this.sharedService=t,this.pubSubService=e,this.backendUtilities=n,this.rxjs=r,this._currentLocalSorters=[],this._isBackendGrid=!1,this._eventHandler=new Slick.EventHandler,this.rxjs&&(this.httpCancelRequests$=this.rxjs.createSubject())}get eventHandler(){return this._eventHandler}get _gridOptions(){return this._grid&&this._grid.getOptions?this._grid.getOptions():{}}get _columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}dispose(){var t,e;!((t=this._eventHandler)===null||t===void 0)&&t.unsubscribeAll&&this._eventHandler.unsubscribeAll(),this.httpCancelRequests$&&(!((e=this.rxjs)===null||e===void 0)&&e.isObservable(this.httpCancelRequests$))&&(this.httpCancelRequests$.next(),this.httpCancelRequests$.complete())}addRxJsResource(t){this.rxjs=t}bindBackendOnSort(t){var e,n;this._isBackendGrid=!0,this._grid=t,this._dataView=(n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{},this._eventHandler.subscribe(t.onSort,this.onBackendSortChanged.bind(this))}bindLocalOnSort(t){this._isBackendGrid=!1,this._grid=t,this._dataView=t.getData(),this.processTreeDataInitialSort(),this._eventHandler.subscribe(t.onSort,this.handleLocalOnSort.bind(this))}handleLocalOnSort(t,e){const n=e.multiColumnSort?e.sortCols:new Array({columnId:e.sortCol.id,sortAsc:e.sortAsc,sortCol:e.sortCol});this._currentLocalSorters=[],Array.isArray(n)&&n.forEach(r=>{r.sortCol&&this._currentLocalSorters.push({columnId:r.sortCol.id,direction:r.sortAsc?Io.ASC:Io.DESC})}),this.onLocalSortChanged(this._grid,n),this.emitSortChanged(Ji.local)}clearSortByColumnId(t,e){var n,r;const o=this.getCurrentColumnSorts(),s=this.getCurrentColumnSorts(`${e}`);if(Array.isArray(o)&&Array.isArray(s)&&o.length!==s.length){if(this._gridOptions.backendServiceApi)this.onBackendSortChanged(t,{multiColumnSort:!0,sortCols:s,grid:this._grid});else if(this._dataView)this.onLocalSortChanged(this._grid,s,!0,!0);else{const p=((r=(n=this._gridOptions)===null||n===void 0?void 0:n.multiColumnSort)!==null&&r!==void 0?r:!1)?s:s[0];this._grid.onSort.notify(p)}const l=s.map(u=>({columnId:u&&u.sortCol&&u.sortCol.id,sortAsc:u&&u.sortAsc,sortCol:u&&u.sortCol}));this._grid.setSortColumns(l)}Array.isArray(s)&&s.length===0&&this.sortLocalGridByDefaultSortFieldId()}clearSorting(t=!0){var e,n;if(this._grid&&this._gridOptions&&this._dataView){if(this._grid.setSortColumns([]),t)this._isBackendGrid?this.onBackendSortChanged(void 0,{grid:this._grid,multiColumnSort:!0,sortCols:[],clearSortTriggered:!0}):this._columnDefinitions&&Array.isArray(this._columnDefinitions)&&this._columnDefinitions.length>0&&this.sortLocalGridByDefaultSortFieldId();else if(this._isBackendGrid){const r=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.backendServiceApi)===null||n===void 0?void 0:n.service;r!=null&&r.clearSorters&&r.clearSorters()}}this._currentLocalSorters=[],this.pubSubService.publish("onSortCleared",!0)}disableSortFunctionality(t=!0,e=!0){const r=!this._gridOptions.enableSorting;this._gridOptions.enableSorting=r;let o;t?(e&&this.clearSorting(),this._eventHandler.unsubscribeAll(),o=this.disableAllSortingCommands(!0)):(o=this.disableAllSortingCommands(!1),this._eventHandler.subscribe(this._grid.onSort,(s,l)=>this.handleLocalOnSort(s,l))),this._grid.setOptions({enableSorting:this._gridOptions.enableSorting},!1,!0),this.sharedService.gridOptions=this._gridOptions,this._grid.setColumns(o)}toggleSortFunctionality(t=!0){const e=this._gridOptions.enableSorting;this.disableSortFunctionality(e,t)}emitSortChanged(t,e){var n;if(t===Ji.remote&&(!((n=this._gridOptions)===null||n===void 0)&&n.backendServiceApi)){let r=[];const o=this._gridOptions.backendServiceApi.service;o!=null&&o.getCurrentSorters&&(r=o.getCurrentSorters()),this.pubSubService.publish("onSortChanged",r)}else t===Ji.local&&(e&&(this._currentLocalSorters=e),this.pubSubService.publish("onSortChanged",this.getCurrentLocalSorters()))}getCurrentLocalSorters(){return this._currentLocalSorters}getCurrentColumnSorts(t){if(this._grid){const e=this._grid.getSortColumns();if(Array.isArray(e))return e.reduce((r,o)=>(o&&(!t||o.columnId!==t)&&r.push({columnId:o.columnId||"",sortCol:this._columnDefinitions[this._grid.getColumnIndex(o.columnId||"")],sortAsc:o.sortAsc}),r),[])}return[]}loadGridSorters(t){this._currentLocalSorters=[];const e=[];return Array.isArray(t)&&((this._gridOptions.multiColumnSort?t:t.slice(0,1)).forEach(r=>{const o=this._columnDefinitions.find(s=>s.id===r.columnId);o&&(e.push({columnId:o.id,sortAsc:r.direction.toUpperCase()===Io.ASC,sortCol:o}),this._currentLocalSorters.push({columnId:o.id+"",direction:r.direction.toUpperCase()}))}),this.onLocalSortChanged(this._grid,e),this._grid.setSortColumns(e.map(r=>({columnId:r.columnId,sortAsc:r.sortAsc})))),e}processTreeDataInitialSort(){var t,e,n;if(!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData&&this._gridOptions.treeDataOptions){const r=this._gridOptions.treeDataOptions,o=this._columnDefinitions.find(s=>s.id===r.columnId);if(o){let s=Io.ASC,l={columnId:r.columnId,sortCol:o,sortAsc:!0};if(!((e=r==null?void 0:r.initialSort)===null||e===void 0)&&e.columnId){const u=r.initialSort.columnId,p=this._columnDefinitions.find(c=>c.id===u);s=(r.initialSort.direction||Io.ASC).toUpperCase(),l={columnId:u,sortCol:p,sortAsc:s===Io.ASC}}l!=null&&l.columnId&&(!((n=this.sharedService)===null||n===void 0)&&n.hierarchicalDataset)&&this.updateSorting([{columnId:l.columnId||"",direction:s}])}}}onBackendSortChanged(t,e){var n,r;if(!e||!e.grid)throw new Error('Something went wrong when trying to bind the "onBackendSortChanged(event, args)" function, it seems that "args" is not populated correctly');const o=e.grid&&e.grid.getOptions?e.grid.getOptions():{},s=o.backendServiceApi;if(!s||!s.process||!s.service)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');const l=new Date;s.preProcess&&s.preProcess();const u=s.service.processOnSortChanged(t,e),p=((n=o==null?void 0:o.pagination)===null||n===void 0?void 0:n.totalItems)||0;(r=this.backendUtilities)===null||r===void 0||r.executeBackendCallback(s,u,e,l,p,{emitActionChangedCallback:this.emitSortChanged.bind(this),errorCallback:()=>{var c,f,m;this._grid.setSortColumns(e.previousSortColumns||[]);const v=(c=e.previousSortColumns)===null||c===void 0?void 0:c.map(_=>({columnId:_.columnId,sortAsc:_.sortAsc,sortCol:this._columnDefinitions.find(C=>C.id===_.columnId)}));(m=(f=s==null?void 0:s.service)===null||f===void 0?void 0:f.updateSorters)===null||m===void 0||m.call(f,v||[])},httpCancelRequestSubject:this.httpCancelRequests$})}async onLocalSortChanged(t,e,n=!1,r=!1){var o,s,l,u,p;const c=(s=(o=this._gridOptions)===null||o===void 0?void 0:o.datasetIdPropertyName)!==null&&s!==void 0?s:"id",f=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.enableTreeData)!==null&&u!==void 0?u:!1,m=(p=t.getData)===null||p===void 0?void 0:p.call(t);if(await this.pubSubService.publish("onBeforeSortChange",{sortColumns:e},0),t&&m){if(n&&!f&&m.reSort(),f&&this.sharedService&&Array.isArray(this.sharedService.hierarchicalDataset)){const v=this.sortHierarchicalDataset(this.sharedService.hierarchicalDataset,e);this._dataView.setItems(v.flat,c),this._dataView.onRowCountChanged.notify({previous:this._dataView.getFilteredItemCount(),current:this._dataView.getLength(),itemCount:this._dataView.getItemCount(),dataView:this._dataView,callingOnRowsChanged:!0})}else m.sort(this.sortComparers.bind(this,e));t.invalidate(),r&&this.emitSortChanged(Ji.local,e.map(v=>{var _,C;return{columnId:(C=(_=v.sortCol)===null||_===void 0?void 0:_.id)!==null&&C!==void 0?C:"id",direction:v.sortAsc?Io.ASC:Io.DESC}}))}}sortHierarchicalDataset(t,e,n=!1){var r,o,s,l,u,p;this.sortTreeData(t,e);const c=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.datasetIdPropertyName)!==null&&o!==void 0?o:"id",f=(l=(s=this._gridOptions)===null||s===void 0?void 0:s.treeDataOptions)!==null&&l!==void 0?l:{columnId:""},m={...f,identifierPropName:(u=f.identifierPropName)!==null&&u!==void 0?u:c,shouldAddTreeLevelNumber:!0},v=xp(t,m);if(n){this._currentLocalSorters=[];for(const C of e)this._currentLocalSorters.push({columnId:C.columnId,direction:C.sortAsc?"ASC":"DESC"});const _=!((p=this._gridOptions)===null||p===void 0)&&p.backendServiceApi?Ji.remote:Ji.local;this.emitSortChanged(_)}return{hierarchical:t,flat:v}}sortLocalGridByDefaultSortFieldId(){const t=this._gridOptions&&this._gridOptions.defaultColumnSortFieldId||this._gridOptions.datasetIdPropertyName||"id",e={id:t,field:t};this.onLocalSortChanged(this._grid,new Array({columnId:e.id,sortAsc:!0,sortCol:e,clearSortTriggered:!0}),!1,!0)}sortComparers(t,e,n){if(Array.isArray(t))for(const r of t){const o=this.sortComparer(r,e,n);if(o!==void 0)return o}return Yi.neutral}sortComparer(t,e,n,r){if(t!=null&&t.sortCol){const o=t.sortCol,s=t.sortAsc?Yi.asc:Yi.desc;let l=r||o.queryFieldSorter||o.queryField||o.field,u=l;const p=o.type||ie.string;typeof o.queryFieldNameGetterFn=="function"&&(l=o.queryFieldNameGetterFn(e),u=o.queryFieldNameGetterFn(n));let c=e[l],f=n[u];if(l&&l.indexOf(".")>=0&&(c=_n(e,l)),u&&u.indexOf(".")>=0&&(f=_n(n,u)),o.sortComparer){const m=o.sortComparer(c,f,s,o,this._gridOptions);if(m!==Yi.neutral)return m}else{const m=ea(p,c,f,s,o,this._gridOptions);if(m!==Yi.neutral)return m}}}sortTreeData(t,e){if(Array.isArray(e))for(const n of e)this.sortTreeChildren(t,n,0)}sortTreeChildren(t,e,n){var r,o;const s=(r=this._gridOptions)===null||r===void 0?void 0:r.treeDataOptions,l=(o=s==null?void 0:s.childrenPropName)!==null&&o!==void 0?o:"children";t.sort((u,p)=>{var c;return(c=this.sortComparer(e,u,p))!==null&&c!==void 0?c:Yi.neutral});for(const u of t)u&&u.hasOwnProperty(l)&&Array.isArray(u[l])&&(n++,this.sortTreeChildren(u[l],e,n),n--)}updateSorting(t,e=!0,n=!0){var r,o;if(!this._gridOptions||!this._gridOptions.enableSorting)throw new Error('[Slickgrid-Universal] in order to use "updateSorting" method, you need to have Sortable Columns defined in your grid and "enableSorting" set in your Grid Options');if(Array.isArray(t)){const s=(r=this._gridOptions)===null||r===void 0?void 0:r.backendServiceApi;if(s){const l=s==null?void 0:s.service;l!=null&&l.updateSorters&&(l.updateSorters(void 0,t),n&&((o=this.backendUtilities)===null||o===void 0||o.refreshBackendDataset(this._gridOptions)))}else this.loadGridSorters(t);if(e){const l=s?Ji.remote:Ji.local;this.emitSortChanged(l)}}}disableAllSortingCommands(t=!0){var e,n;const r=this._grid.getColumns();r.forEach(s=>{var l;typeof s.sortable!==void 0&&(s.sortable=!t),!((l=s==null?void 0:s.header)===null||l===void 0)&&l.menu&&s.header.menu.items.forEach(u=>{if(u&&typeof u!="string"){const p=u.command;(p==="sort-asc"||p==="sort-desc"||p==="clear-sort")&&(u.hidden=t)}})});const o=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.gridMenu)===null||n===void 0?void 0:n.commandItems;return o&&o.forEach(s=>{s&&typeof s!="string"&&s.command==="clear-sorting"&&(s.hidden=t)}),r}}class q0{constructor(t,e,n){this.pubSubService=t,this.sharedService=e,this.sortService=n,this._isLastFullToggleCollapsed=!1,this._currentToggledItems=[],this._subscriptions=[],this._eventHandler=new Slick.EventHandler}set currentToggledItems(t){this._currentToggledItems=t}get dataset(){var t;return(t=this.dataView)===null||t===void 0?void 0:t.getItems()}get datasetHierarchical(){return this.sharedService.hierarchicalDataset}get dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get treeDataOptions(){return this.gridOptions.treeDataOptions}dispose(){this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}init(t){var e,n,r,o,s,l,u,p,c,f,m;if(this._grid=t,this._isLastFullToggleCollapsed=(r=(n=(e=this.gridOptions)===null||e===void 0?void 0:e.treeDataOptions)===null||n===void 0?void 0:n.initiallyCollapsed)!==null&&r!==void 0?r:!1,this._currentToggledItems=(l=(s=(o=this.gridOptions.presets)===null||o===void 0?void 0:o.treeData)===null||s===void 0?void 0:s.toggledItems)!==null&&l!==void 0?l:[],this._lastToggleStateChange={type:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},!((u=this.gridOptions)===null||u===void 0)&&u.enableTreeData){if(!((p=this.gridOptions)===null||p===void 0)&&p.multiColumnSort)throw new Error('[Slickgrid-Universal] It looks like you are trying to use Tree Data with multi-column sorting, unfortunately it is not supported because of its complexity, you can disable it via "multiColumnSort: false" grid option and/or help in providing support for this feature.');if(!(!((c=this.gridOptions)===null||c===void 0)&&c.enableFiltering))throw new Error('[Slickgrid-Universal] It looks like you are trying to use Tree Data without using the filtering option, unfortunately that is not possible with Tree Data since it relies heavily on the filters to expand/collapse the tree. You need to enable it via "enableFiltering: true"');if(!((f=this.gridOptions)===null||f===void 0)&&f.backendServiceApi||!((m=this.gridOptions)===null||m===void 0)&&m.enablePagination)throw new Error("[Slickgrid-Universal] It looks like you are trying to use Tree Data with Pagination and/or a Backend Service (OData, GraphQL) but unfortunately that is simply not supported because of its complexity.");if(!this.gridOptions.treeDataOptions||!this.gridOptions.treeDataOptions.columnId)throw new Error('[Slickgrid-Universal] When enabling tree data, you must also provide the "treeDataOption" property in your Grid Options with "childrenPropName" or "parentPropName" (depending if your array is hierarchical or flat) for the Tree Data to work properly.')}this._eventHandler.subscribe(t.onClick,this.handleOnCellClick.bind(this)),this._subscriptions.push(this.pubSubService.subscribe("onGridMenuClearAllSorting",this.clearSorting.bind(this)))}applyToggledItemStateChanges(t,e,n=!0,r=!1){if(Array.isArray(t)){const o=this.getTreeDataOptionPropName("collapsedPropName"),s=this.getTreeDataOptionPropName("hasChildrenPropName");this.dataView.beginUpdate(!0);const u=(e??this._lastToggleStateChange.previousFullToggleType)==="full-collapse";e&&(this._lastToggleStateChange.previousFullToggleType=e),n&&(this.dataView.getItems()||[]).forEach(p=>{p[s]&&(p[o]=u)}),this.dynamicallyToggleItemState(t,r)}}dynamicallyToggleItemState(t,e=!0){if(Array.isArray(t)){this.dataView.beginUpdate(!0);for(const n of t){const r=this.dataView.getItemById(n.itemId);if(this.updateToggledItem(r,n.isCollapsed),e){const o=this._currentToggledItems.findIndex(s=>s.itemId===n.itemId);o>=0?this._currentToggledItems[o].isCollapsed=n.isCollapsed:this._currentToggledItems.push({itemId:n.itemId,isCollapsed:n.isCollapsed}),this.pubSubService.publish("onTreeItemToggled",{...this._lastToggleStateChange,fromItemId:n.itemId,toggledItems:this._currentToggledItems,type:n.isCollapsed?gs.toggleCollapse:gs.toggleExpand})}}this.dataView.endUpdate(),this.dataView.refresh()}}getCurrentToggleState(){return this._lastToggleStateChange}getInitialSort(t,e){var n,r,o;const s=e==null?void 0:e.treeDataOptions,l=(n=s==null?void 0:s.initialSort)!==null&&n!==void 0?n:{columnId:(r=s==null?void 0:s.columnId)!==null&&r!==void 0?r:"",direction:"ASC"},u=t.find(p=>p.id===l.columnId);return{columnId:l.columnId,sortAsc:((o=l==null?void 0:l.direction)===null||o===void 0?void 0:o.toUpperCase())!=="DESC",sortCol:u}}getItemCount(t){if(t!==void 0){const e=this.getTreeDataOptionPropName("levelPropName");return this.dataView.getItems().filter(n=>n[e]===t).length}return this.dataView.getItemCount()}getToggledItems(){return this._currentToggledItems}getTreeDataOptionPropName(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C;let x="";switch(t){case"childrenPropName":x=(n=(e=this.treeDataOptions)===null||e===void 0?void 0:e.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP;break;case"collapsedPropName":x=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.collapsedPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.COLLAPSED_PROP;break;case"hasChildrenPropName":x=(l=(s=this.treeDataOptions)===null||s===void 0?void 0:s.hasChildrenPropName)!==null&&l!==void 0?l:Xe.treeDataProperties.HAS_CHILDREN_PROP;break;case"identifierPropName":x=(f=(p=(u=this.treeDataOptions)===null||u===void 0?void 0:u.identifierPropName)!==null&&p!==void 0?p:(c=this.gridOptions)===null||c===void 0?void 0:c.datasetIdPropertyName)!==null&&f!==void 0?f:"id";break;case"levelPropName":x=(v=(m=this.treeDataOptions)===null||m===void 0?void 0:m.levelPropName)!==null&&v!==void 0?v:Xe.treeDataProperties.TREE_LEVEL_PROP;break;case"parentPropName":x=(C=(_=this.treeDataOptions)===null||_===void 0?void 0:_.parentPropName)!==null&&C!==void 0?C:Xe.treeDataProperties.PARENT_PROP;break}return x}clearSorting(){const t=this.getInitialSort(this.sharedService.columnDefinitions,this.sharedService.gridOptions);this.sortService.loadGridSorters([{columnId:t.columnId,direction:t.sortAsc?"ASC":"DESC"}])}convertFlatParentChildToTreeDatasetAndSort(t,e,n){var r;const o=this.convertFlatParentChildToTreeDataset(t,n),s=this.getInitialSort(e,n),l=this.sortService.sortHierarchicalDataset(o,[s],!0);return(r=this._grid)===null||r===void 0||r.setSortColumns([s]),l}convertFlatParentChildToTreeDataset(t,e){var n,r,o;const s=(n=e==null?void 0:e.datasetIdPropertyName)!==null&&n!==void 0?n:"id",l=(r=e==null?void 0:e.treeDataOptions)!==null&&r!==void 0?r:{columnId:"id"},u={...l,identifierPropName:(o=l.identifierPropName)!==null&&o!==void 0?o:s,initiallyCollapsed:this._isLastFullToggleCollapsed};return Tp(t,u)}sortHierarchicalDataset(t,e){const n=e??this.getInitialSort(this.sharedService.allColumns,this.gridOptions),r=Array.isArray(n)?n:[n];return this.sortService.sortHierarchicalDataset(t,r)}async toggleTreeDataCollapse(t,e=!0){var n;if(!((n=this.gridOptions)===null||n===void 0)&&n.enableTreeData){const o=this.getTreeDataOptionPropName("hasChildrenPropName");e&&await this.pubSubService.publish("onTreeFullToggleStart",{collapsing:t}),this.dataView.beginUpdate(!0),(this.dataView.getItems()||[]).forEach(s=>{s[o]&&this.updateToggledItem(s,t)}),this.dataView.endUpdate(),this.dataView.refresh(),this._isLastFullToggleCollapsed=t}const r=t?gs.fullCollapse:gs.fullExpand;this._lastToggleStateChange={type:r,previousFullToggleType:r,toggledItems:null},e&&this.pubSubService.publish("onTreeFullToggleEnd",this._lastToggleStateChange)}handleOnCellClick(t,e){var n;if(t&&e){const r=t.target||{},o=(n=this.gridOptions.datasetIdPropertyName)!==null&&n!==void 0?n:"id",s=this.getTreeDataOptionPropName("collapsedPropName"),l=this.getTreeDataOptionPropName("childrenPropName");if(typeof(r==null?void 0:r.className)=="string"&&(r.className.indexOf("toggle")>=0||!1)){const p=this.dataView.getItem(e.row);if(p){p[s]=!p[s];const c=p[s],f=p[o],m=this._currentToggledItems.findIndex(C=>C.itemId===f);m>=0?this._currentToggledItems[m].isCollapsed=c:this._currentToggledItems.push({itemId:f,isCollapsed:c}),this.dataView.updateItem(f,p);const v=C=>C[o]===f,_=Ud(this.sharedService.hierarchicalDataset||[],v,l);_&&(_[s]=c),this._grid.invalidate(),this._lastToggleStateChange={type:c?gs.toggleCollapse:gs.toggleExpand,previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},this.pubSubService.publish("onTreeItemToggled",{...this._lastToggleStateChange,fromItemId:f})}t.stopImmediatePropagation()}}}updateToggledItem(t,e){var n,r;const o=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.datasetIdPropertyName)!==null&&r!==void 0?r:"id",s=this.getTreeDataOptionPropName("childrenPropName"),l=this.getTreeDataOptionPropName("collapsedPropName");if(t){t[l]=e,this.dataView.updateItem(t[o],t);const u=c=>c[o]===t[o],p=Ud(this.sharedService.hierarchicalDataset||[],u,s);p&&(p[l]=e)}}}function Wh(a,t){const e=De("select",{className:"form-control"});for(const n of a)e.appendChild(De("option",{value:n.operator,innerHTML:Pn(t,`${I_(n.operator,3)}${n.description}`)}));return e}function Kn(a,t,e,n="Slider"){var r,o,s;let l;return((r=a.filterOptions)===null||r===void 0?void 0:r[t])!==void 0?l=a.filterOptions[t]:((o=a==null?void 0:a.params)===null||o===void 0?void 0:o[t])!==void 0&&(console.warn(`[Slickgrid-Universal] All filter.params from ${n} Filter are moving to "filterOptions" for better typing support and "params" will be deprecated in future release.`),l=(s=a==null?void 0:a.params)===null||s===void 0?void 0:s[t]),l??e}function K0(a,t,e){var n,r;const o=(n=t==null?void 0:t.filter)!==null&&n!==void 0?n:{},s=(r=o==null?void 0:o.collectionOptions)!==null&&r!==void 0?r:{};if(s&&s.collectionInsideObjectProperty){const l=s.collectionInsideObjectProperty;a=_n(a,l)}if(!Array.isArray(a))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');o.collection=a,e(a)}async function Gm(a,t,e,n,r){var o,s,l;const u=(o=t==null?void 0:t.filter)!==null&&o!==void 0?o:{},p=(s=u==null?void 0:u.collectionOptions)!==null&&s!==void 0?s:{};let c=null;if(a){const f=(l=n==null?void 0:n.isObservable(a))!==null&&l!==void 0?l:!1;f&&n&&(c=await wp(n,a));const m=await a;if(Array.isArray(m)?c=m:(m==null?void 0:m.status)>=200&&m.status<300&&typeof m.json=="function"?c=await m.json():m&&m.content&&(c=m.content),!Array.isArray(c)&&(p!=null&&p.collectionInsideObjectProperty)){const v=c||m,_=p.collectionInsideObjectProperty;c=_n(v,_||"")}if(!Array.isArray(c))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');u.collection=c,e(c),f&&Z0(t,e,n,r)}return c}function Z0(a,t,e,n){var r;const o=(r=a==null?void 0:a.filter)!==null&&r!==void 0?r:{},s=e==null?void 0:e.createSubject();o.collectionAsync=s,n&&s&&n.push(s.subscribe(l=>K0(l,a,t)))}function po(a,t,e,n,r){var o;if(n!=null&&n.enableTranslate&&(r!=null&&r.translate)){const l=ao(n);return r.translate(`${l}${a}`)}const s=n.locales||Xe.locales;return(o=s==null?void 0:s[t])!==null&&o!==void 0?o:e}function Q0(a,t){return[{operator:"",description:po("CONTAINS","TEXT_CONTAINS","Contains",a,t)},{operator:"<>",description:po("NOT_CONTAINS","TEXT_NOT_CONTAINS","Not Contains",a,t)},{operator:"=",description:po("EQUALS","TEXT_EQUALS","Equals",a,t)},{operator:"!=",description:po("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",a,t)},{operator:"a*",description:po("STARTS_WITH","TEXT_STARTS_WITH","Starts with",a,t)},{operator:"*z",description:po("ENDS_WITH","TEXT_ENDS_WITH","Ends with",a,t)}]}function $h(a,t){return[{operator:"",description:""},{operator:"=",description:po("EQUAL_TO","TEXT_EQUAL_TO","Equal to",a,t)},{operator:"<",description:po("LESS_THAN","TEXT_LESS_THAN","Less than",a,t)},{operator:"<=",description:po("LESS_THAN_OR_EQUAL_TO","TEXT_LESS_THAN_OR_EQUAL_TO","Less than or equal to",a,t)},{operator:">",description:po("GREATER_THAN","TEXT_GREATER_THAN","Greater than",a,t)},{operator:">=",description:po("GREATER_THAN_OR_EQUAL_TO","TEXT_GREATER_THAN_OR_EQUAL_TO","Greater than or equal to",a,t)},{operator:"<>",description:po("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",a,t)}]}const Wm=Xd&&sh||Xd;class J0{constructor(t,e,n){this.translaterService=t,this.collectionService=e,this.rxjs=n,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.searchTerms=[],this.isFilled=!1,this.isItemSelected=!1,this.valueName="label",this.enableTranslateLabel=!1,this.subscriptions=[],this._bindEventService=new Fn}get autocompleterOptions(){return this._autocompleterOptions||{}}get collectionOptions(){var t,e,n;return(n=(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)===null||e===void 0?void 0:e.collectionOptions)!==null&&n!==void 0?n:{}}get collection(){return this._collection}get columnFilter(){var t;return((t=this.columnDef)===null||t===void 0?void 0:t.filter)||{}}get filterDomElement(){return this._filterElm}get filterOptions(){var t;return((t=this.columnFilter)===null||t===void 0?void 0:t.filterOptions)||{}}get customStructure(){var t,e,n,r,o,s;let l=(t=this.columnFilter)===null||t===void 0?void 0:t.customStructure;const u=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.type)!==null&&n!==void 0?n:(r=this.columnDef)===null||r===void 0?void 0:r.type;return!l&&u===ie.object&&(!((o=this.columnDef)===null||o===void 0)&&o.dataKey)&&(!((s=this.columnDef)===null||s===void 0)&&s.labelKey)&&(l={label:this.columnDef.labelKey,value:this.columnDef.dataKey}),l}get defaultOperator(){return Lt.equal}get gridOptions(){return this.grid&&this.grid.getOptions?this.grid.getOptions():{}}get instance(){return this._instance}get operator(){var t,e;return(e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator}set operator(t){this.columnFilter&&(this.columnFilter.operator=t)}init(t){var e,n,r,o,s,l,u,p,c,f,m,v;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.searchTerms=(t.hasOwnProperty("searchTerms")?t.searchTerms:[])||[],this.filterContainerElm=t.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection&&!this.columnFilter.collectionAsync&&!this.columnFilter.filterOptions)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") for the AutoComplete Filter to work correctly. Also each option should include a value/label pair (or value/labelKey when using Locale). For example:: { filter: model: Filters.autocompleter, collection: [{ value: true, label: 'True' }, { value: false, label: 'False'}] }`);this.enableTranslateLabel=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.enableTranslateLabel)!==null&&n!==void 0?n:!1,this.labelName=(o=(r=this.customStructure)===null||r===void 0?void 0:r.label)!==null&&o!==void 0?o:"label",this.valueName=(l=(s=this.customStructure)===null||s===void 0?void 0:s.value)!==null&&l!==void 0?l:"value",this.labelPrefixName=(p=(u=this.customStructure)===null||u===void 0?void 0:u.labelPrefix)!==null&&p!==void 0?p:"labelPrefix",this.labelSuffixName=(f=(c=this.customStructure)===null||c===void 0?void 0:c.labelSuffix)!==null&&f!==void 0?f:"labelSuffix",this._locales=(v=(m=this.gridOptions)===null||m===void 0?void 0:m.locales)!==null&&v!==void 0?v:Xe.locales;const _=this.columnFilter.collection;return this._collection=_,this.renderDomElement(_),new Promise(async(C,x)=>{try{const w=this.columnFilter.collectionAsync;let E;w&&!this.columnFilter.collection?(E=Gm(w,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),C(E)):(E=_,C(_)),(w||this.columnFilter.enableCollectionWatch)&&(await(E??w),this.watchCollectionChanges())}catch(w){x(w)}})}clear(t=!0){this._filterElm&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[],this._filterElm.value="",this._filterElm.dispatchEvent(new CustomEvent("input")),this._filterElm.classList.remove("filled"))}destroy(){var t,e,n;(t=this._instance)===null||t===void 0||t.destroy(),this._filterElm,(n=(e=this._filterElm)===null||e===void 0?void 0:e.remove)===null||n===void 0||n.call(e),this._collection=void 0,this._bindEventService.unbindAll(),Gd(this.subscriptions)}getValues(){var t;return(t=this._filterElm)===null||t===void 0?void 0:t.value}setValues(t,e){var n;t&&this._filterElm&&(this._filterElm.value=t);const r=this.getValues()!==""?"add":"remove";(n=this._filterElm)===null||n===void 0||n.classList[r]("filled"),this.operator=e||this.defaultOperator}filterCollection(t){let e=t;if(this.columnFilter&&this.columnFilter.collectionFilterBy){const n=this.columnFilter.collectionFilterBy,r=this.columnFilter.collectionOptions&&this.columnFilter.collectionOptions.filterResultAfterEachPass||null;e=this.collectionService.filterCollection(e,n,r)}return e}sortCollection(t){let e=t;if(this.columnFilter&&this.columnFilter.collectionSortBy){const n=this.columnFilter.collectionSortBy;e=this.collectionService.sortCollection(this.columnDef,e,n,this.enableTranslateLabel)}return e}watchCollectionChanges(){var t;!((t=this.columnFilter)===null||t===void 0)&&t.collection&&(Na(this.columnFilter.collection,e=>{this.renderDomElement(this.columnFilter.collection||e||[])}),Kc(this.columnFilter,"collection",e=>{this.renderDomElement(e||[]),this.columnFilter.collection&&Na(this.columnFilter.collection,n=>{this.renderDomElement(this.columnFilter.collection||n||[])})}))}renderDomElement(t){var e;if(!Array.isArray(t)&&(!((e=this.collectionOptions)===null||e===void 0)&&e.collectionInsideObjectProperty)){const o=this.collectionOptions.collectionInsideObjectProperty;t=_n(t,o||"")}let n=t;n&&(n=this.filterCollection(n),n=this.sortCollection(n));const r=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this._collection=n,this._filterElm=this.createFilterElement(n,r),this._bindEventService.bind(this._filterElm,"input",this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._filterElm,"blur",()=>{this.isItemSelected||this.clear()})}createFilterElement(t,e){var n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E;this._collection=t;const I=(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"";en(this.filterContainerElm);let k=(s=(o=this.gridOptions)===null||o===void 0?void 0:o.defaultFilterPlaceholder)!==null&&s!==void 0?s:"";!((l=this.columnFilter)===null||l===void 0)&&l.placeholder&&(k=this.columnFilter.placeholder),this._filterElm=De("input",{type:"text",ariaLabel:(p=(u=this.columnFilter)===null||u===void 0?void 0:u.ariaLabel)!==null&&p!==void 0?p:`${jr(I+"")} Search Filter`,autocomplete:"none",placeholder:k,className:`form-control search-filter filter-${I} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${I}`}});const F=e;Array.isArray(t)&&(t.every(V=>Wd(V))?t=t.map(V=>({label:V,value:V})):t=t.map(V=>{var Q,L;return{label:V==null?void 0:V[this.labelName],value:V==null?void 0:V[this.valueName],labelPrefix:(Q=V==null?void 0:V[this.labelPrefixName])!==null&&Q!==void 0?Q:"",labelSuffix:(L=V==null?void 0:V[this.labelSuffixName])!==null&&L!==void 0?L:""}})),this._autocompleterOptions={input:this._filterElm,debounceWaitMs:200,className:`slick-autocomplete ${(f=(c=this.filterOptions)===null||c===void 0?void 0:c.className)!==null&&f!==void 0?f:""}`.trim(),emptyMsg:this.gridOptions.enableTranslate&&(!((m=this.translaterService)===null||m===void 0)&&m.translate)?this.translaterService.translate("NO_ELEMENTS_FOUND"):(_=(v=this._locales)===null||v===void 0?void 0:v.TEXT_NO_ELEMENTS_FOUND)!==null&&_!==void 0?_:"No elements found",customize:(V,Q,L)=>{L.style.width=""},onSelect:V=>{this.isItemSelected=!0,this.handleSelect(V)},...this.filterOptions},!((C=this._autocompleterOptions.renderItem)===null||C===void 0)&&C.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${Ga(this._autocompleterOptions.renderItem.layout)}`,this._autocompleterOptions.render=this.renderCustomItem.bind(this)):Array.isArray(t)?this._autocompleterOptions.render=(w=(x=this._autocompleterOptions.render)===null||x===void 0?void 0:x.bind(this))!==null&&w!==void 0?w:this.renderCollectionItem.bind(this):this._autocompleterOptions.render||(this._autocompleterOptions.render=this.renderRegularItem.bind(this)),!((E=this.filterOptions)===null||E===void 0)&&E.fetch?(Np(this._filterElm,this._autocompleterOptions),this._instance=Wm(this._autocompleterOptions)):this._instance=Wm({...this._autocompleterOptions,fetch:(V,Q)=>{t&&Q(t.filter(L=>((typeof L=="string"?L:L==null?void 0:L.label)||"").toLowerCase().includes(V.toLowerCase())))}}),this._filterElm.value=F??"";const N=De("div",{className:"autocomplete-filter-container"});return N.appendChild(this._filterElm),N.appendChild(De("span")),e&&this._filterElm.classList.add("filled"),this.filterContainerElm.appendChild(N),this.filterContainerElm.appendChild(document.createElement("span")),this._filterElm}handleSelect(t){var e,n,r,o;if(t!==void 0){const l=(r=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.filterOptions)===null||n===void 0?void 0:n.renderItem)!==null&&r!==void 0?r:!1,u=typeof t=="string"?t:l?t[this.labelName]:t.label;let p=typeof t=="string"?t:l?t[this.valueName]:t.value;p=this.trimWhitespaceWhenEnabled(p);const c=p===""?"remove":"add";(o=this._filterElm)===null||o===void 0||o.classList[c]("filled"),this.setValues(u),this.callback(void 0,{columnDef:this.columnDef,operator:this.operator,searchTerms:[p],shouldTriggerQuery:this._shouldTriggerQuery}),this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}return!1}handleOnInputChange(t){var e,n,r,o,s;let l=(n=(e=t==null?void 0:t.target)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"";const u=(r=this.filterOptions.triggerOnEveryKeyStroke)!==null&&r!==void 0?r:!1;if(l=this.trimWhitespaceWhenEnabled(l),this._clearFilterTriggered||l===""||u){const p={columnDef:this.columnDef,shouldTriggerQuery:this._shouldTriggerQuery};this._clearFilterTriggered?p.clearFilterTriggered=this._clearFilterTriggered:(p.operator=this.operator,p.searchTerms=[l]),l!==""?(this.isItemSelected=!0,(o=this._filterElm)===null||o===void 0||o.classList.add("filled")):(this.isItemSelected=!1,(s=this._filterElm)===null||s===void 0||s.classList.remove("filled")),this.callback(t,p)}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}renderRegularItem(t){var e;const n=typeof t=="string"?t:(e=t==null?void 0:t.label)!==null&&e!==void 0?e:"";return De("div",{textContent:n||""})}renderCustomItem(t){var e,n,r;const o=(r=(n=(e=this._autocompleterOptions)===null||e===void 0?void 0:e.renderItem)===null||n===void 0?void 0:n.templateCallback(t))!==null&&r!==void 0?r:"",s=Pn(this.gridOptions,o)||"";return De("div",{innerHTML:s})}renderCollectionItem(t){var e,n;const r=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.enableRenderHtml)!==null&&n!==void 0?n:!1,o=t.labelPrefix||"",s=t.label||"",l=t.labelSuffix||"",u=o+s+l,p=Pn(this.gridOptions,u)||"",c=document.createElement("div");return c[r?"innerHTML":"textContent"]=p,c}trimWhitespaceWhenEnabled(t){let e=t;const n=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;return typeof t=="string"&&n&&(e=t.trim()),e}}var Yh=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],da={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(a){return typeof console<"u"&&console.warn(a)},getWeek:function(a){var t=new Date(a.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ld={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(a){var t=a%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Nr=function(a,t){return t===void 0&&(t=2),("000"+a).slice(t*-1)},mo=function(a){return a===!0?1:0};function $m(a,t){var e;return function(){var n=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return a.apply(n,r)},t)}}var jh=function(a){return a instanceof Array?a:[a]};function wr(a,t,e){if(e===!0)return a.classList.add(t);a.classList.remove(t)}function Pi(a,t,e){var n=window.document.createElement(a);return t=t||"",e=e||"",n.className=t,e!==void 0&&(n.textContent=e),n}function xu(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function Ym(a,t){if(t(a))return a;if(a.parentNode)return Ym(a.parentNode,t)}function Tu(a,t){var e=Pi("div","numInputWrapper"),n=Pi("input","numInput "+a),r=Pi("span","arrowUp"),o=Pi("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),t!==void 0)for(var s in t)n.setAttribute(s,t[s]);return e.appendChild(n),e.appendChild(r),e.appendChild(o),e}function Zr(a){try{if(typeof a.composedPath=="function"){var t=a.composedPath();return t[0]}return a.target}catch{return a.target}}var Xh=function(){},Ou=function(a,t,e){return e.months[t?"shorthand":"longhand"][a]},eb={D:Xh,F:function(a,t,e){a.setMonth(e.months.longhand.indexOf(t))},G:function(a,t){a.setHours((a.getHours()>=12?12:0)+parseFloat(t))},H:function(a,t){a.setHours(parseFloat(t))},J:function(a,t){a.setDate(parseFloat(t))},K:function(a,t,e){a.setHours(a.getHours()%12+12*mo(new RegExp(e.amPM[1],"i").test(t)))},M:function(a,t,e){a.setMonth(e.months.shorthand.indexOf(t))},S:function(a,t){a.setSeconds(parseFloat(t))},U:function(a,t){return new Date(parseFloat(t)*1e3)},W:function(a,t,e){var n=parseInt(t),r=new Date(a.getFullYear(),0,2+(n-1)*7,0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(a,t){a.setFullYear(parseFloat(t))},Z:function(a,t){return new Date(t)},d:function(a,t){a.setDate(parseFloat(t))},h:function(a,t){a.setHours((a.getHours()>=12?12:0)+parseFloat(t))},i:function(a,t){a.setMinutes(parseFloat(t))},j:function(a,t){a.setDate(parseFloat(t))},l:Xh,m:function(a,t){a.setMonth(parseFloat(t)-1)},n:function(a,t){a.setMonth(parseFloat(t)-1)},s:function(a,t){a.setSeconds(parseFloat(t))},u:function(a,t){return new Date(parseFloat(t))},w:Xh,y:function(a,t){a.setFullYear(2e3+parseFloat(t))}},Al={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ad={Z:function(a){return a.toISOString()},D:function(a,t,e){return t.weekdays.shorthand[ad.w(a,t,e)]},F:function(a,t,e){return Ou(ad.n(a,t,e)-1,!1,t)},G:function(a,t,e){return Nr(ad.h(a,t,e))},H:function(a){return Nr(a.getHours())},J:function(a,t){return t.ordinal!==void 0?a.getDate()+t.ordinal(a.getDate()):a.getDate()},K:function(a,t){return t.amPM[mo(a.getHours()>11)]},M:function(a,t){return Ou(a.getMonth(),!0,t)},S:function(a){return Nr(a.getSeconds())},U:function(a){return a.getTime()/1e3},W:function(a,t,e){return e.getWeek(a)},Y:function(a){return Nr(a.getFullYear(),4)},d:function(a){return Nr(a.getDate())},h:function(a){return a.getHours()%12?a.getHours()%12:12},i:function(a){return Nr(a.getMinutes())},j:function(a){return a.getDate()},l:function(a,t){return t.weekdays.longhand[a.getDay()]},m:function(a){return Nr(a.getMonth()+1)},n:function(a){return a.getMonth()+1},s:function(a){return a.getSeconds()},u:function(a){return a.getTime()},w:function(a){return a.getDay()},y:function(a){return String(a.getFullYear()).substring(2)}},jm=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?ld:n,o=a.isMobile,s=o===void 0?!1:o;return function(l,u,p){var c=p||r;return e.formatDate!==void 0&&!s?e.formatDate(l,u,c):u.split("").map(function(f,m,v){return ad[f]&&v[m-1]!=="\\"?ad[f](l,c,e):f!=="\\"?f:""}).join("")}},qh=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?ld:n;return function(o,s,l,u){if(!(o!==0&&!o)){var p=u||r,c,f=o;if(o instanceof Date)c=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)c=new Date(o);else if(typeof o=="string"){var m=s||(e||da).dateFormat,v=String(o).trim();if(v==="today")c=new Date,l=!0;else if(e&&e.parseDate)c=e.parseDate(o,m);else if(/Z$/.test(v)||/GMT$/.test(v))c=new Date(o);else{for(var _=void 0,C=[],x=0,w=0,E="";x<m.length;x++){var I=m[x],k=I==="\\",F=m[x-1]==="\\"||k;if(Al[I]&&!F){E+=Al[I];var N=new RegExp(E).exec(o);N&&(_=!0)&&C[I!=="Y"?"push":"unshift"]({fn:eb[I],val:N[++w]})}else k||(E+=".")}c=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),C.forEach(function(V){var Q=V.fn,L=V.val;return c=Q(c,L,p)||c}),c=_?c:void 0}}if(!(c instanceof Date&&!isNaN(c.getTime()))){e.errorHandler(new Error("Invalid date provided: "+f));return}return l===!0&&c.setHours(0,0,0,0),c}}};function Qr(a,t,e){return e===void 0&&(e=!0),e!==!1?new Date(a.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):a.getTime()-t.getTime()}var tb=function(a,t,e){return a>Math.min(t,e)&&a<Math.max(t,e)},Kh=function(a,t,e){return a*3600+t*60+e},ib=function(a){var t=Math.floor(a/3600),e=(a-t*3600)/60;return[t,e,a-t*3600-e*60]},nb={DAY:864e5};function Zh(a){var t=a.defaultHour,e=a.defaultMinute,n=a.defaultSeconds;if(a.minDate!==void 0){var r=a.minDate.getHours(),o=a.minDate.getMinutes(),s=a.minDate.getSeconds();t<r&&(t=r),t===r&&e<o&&(e=o),t===r&&e===o&&n<s&&(n=a.minDate.getSeconds())}if(a.maxDate!==void 0){var l=a.maxDate.getHours(),u=a.maxDate.getMinutes();t=Math.min(t,l),t===l&&(e=Math.min(u,e)),t===l&&e===u&&(n=a.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(a){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!a)throw TypeError("Cannot convert undefined or null to object");for(var n=function(l){l&&Object.keys(l).forEach(function(u){return a[u]=l[u]})},r=0,o=t;r<o.length;r++){var s=o[r];n(s)}return a});var pr=globalThis&&globalThis.__assign||function(){return pr=Object.assign||function(a){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},pr.apply(this,arguments)},Xm=globalThis&&globalThis.__spreadArrays||function(){for(var a=0,t=0,e=arguments.length;t<e;t++)a+=arguments[t].length;for(var n=Array(a),r=0,t=0;t<e;t++)for(var o=arguments[t],s=0,l=o.length;s<l;s++,r++)n[r]=o[s];return n},rb=300;function ob(a,t){var e={config:pr(pr({},da),Tn.defaultConfig),l10n:ld};e.parseDate=qh({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=m,e._positionCalendar=ne,e.changeMonth=ae,e.changeYear=Ee,e.clear=he,e.close=Ne,e.onMouseOver=it,e._createElement=Pi,e.createDay=N,e.destroy=ze,e.isEnabled=ve,e.jumpToDate=E,e.updateValue=Kt,e.open=R,e.redraw=Se,e.set=Le,e.setDate=It,e.toggle=at;function n(){e.utils={getDaysInMonth:function(U,Z){return U===void 0&&(U=e.currentMonth),Z===void 0&&(Z=e.currentYear),U===1&&(Z%4===0&&Z%100!==0||Z%400===0)?29:e.l10n.daysInMonth[U]}}}function r(){e.element=e.input=a,e.isOpen=!1,ge(),X(),W(),q(),n(),e.isMobile||F(),w(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&m(e.config.noCalendar?e.latestSelectedDateObj:void 0),Kt(!1)),l();var U=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&U&&ne(),ot("onReady")}function o(){var U;return((U=e.calendarContainer)===null||U===void 0?void 0:U.getRootNode()).activeElement||document.activeElement}function s(U){return U.bind(e)}function l(){var U=e.config;U.weekNumbers===!1&&U.showMonths===1||U.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var Z=(e.days.offsetWidth+1)*U.showMonths;e.daysContainer.style.width=Z+"px",e.calendarContainer.style.width=Z+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function u(U){if(e.selectedDates.length===0){var Z=e.config.minDate===void 0||Qr(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),ce=Zh(e.config);Z.setHours(ce.hours,ce.minutes,ce.seconds,Z.getMilliseconds()),e.selectedDates=[Z],e.latestSelectedDateObj=Z}U!==void 0&&U.type!=="blur"&&Li(U);var we=e._input.value;f(),Kt(),e._input.value!==we&&e._debouncedChange()}function p(U,Z){return U%12+12*mo(Z===e.l10n.amPM[1])}function c(U){switch(U%24){case 0:case 12:return 12;default:return U%12}}function f(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var U=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,Z=(parseInt(e.minuteElement.value,10)||0)%60,ce=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(U=p(U,e.amPM.textContent));var we=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.minDate,!0)===0,st=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var vt=Kh(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ht=Kh(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),wt=Kh(U,Z,ce);if(wt>ht&&wt<vt){var Bt=ib(vt);U=Bt[0],Z=Bt[1],ce=Bt[2]}}else{if(st){var Et=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;U=Math.min(U,Et.getHours()),U===Et.getHours()&&(Z=Math.min(Z,Et.getMinutes())),Z===Et.getMinutes()&&(ce=Math.min(ce,Et.getSeconds()))}if(we){var _t=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;U=Math.max(U,_t.getHours()),U===_t.getHours()&&Z<_t.getMinutes()&&(Z=_t.getMinutes()),Z===_t.getMinutes()&&(ce=Math.max(ce,_t.getSeconds()))}}v(U,Z,ce)}}function m(U){var Z=U||e.latestSelectedDateObj;Z&&Z instanceof Date&&v(Z.getHours(),Z.getMinutes(),Z.getSeconds())}function v(U,Z,ce){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(U%24,Z,ce||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=Nr(e.config.time_24hr?U:(12+U)%12+12*mo(U%12===0)),e.minuteElement.value=Nr(Z),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[mo(U>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Nr(ce)))}function _(U){var Z=Zr(U),ce=parseInt(Z.value)+(U.delta||0);(ce/1e3>1||U.key==="Enter"&&!/[^\d]/.test(ce.toString()))&&Ee(ce)}function C(U,Z,ce,we){if(Z instanceof Array)return Z.forEach(function(st){return C(U,st,ce,we)});if(U instanceof Array)return U.forEach(function(st){return C(st,Z,ce,we)});U.addEventListener(Z,ce,we),e._handlers.push({remove:function(){return U.removeEventListener(Z,ce,we)}})}function x(){ot("onChange")}function w(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(ce){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+ce+"]"),function(we){return C(we,"click",e[ce])})}),e.isMobile){ke();return}var U=$m(et,50);if(e._debouncedChange=$m(x,rb),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(ce){e.config.mode==="range"&&it(Zr(ce))}),C(e._input,"keydown",Ie),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",Ie),!e.config.inline&&!e.config.static&&C(window,"resize",U),window.ontouchstart!==void 0?C(window.document,"touchstart",de):C(window.document,"mousedown",de),C(window.document,"focus",de,{capture:!0}),e.config.clickOpens===!0&&(C(e._input,"focus",e.open),C(e._input,"click",e.open)),e.daysContainer!==void 0&&(C(e.monthNav,"click",Ni),C(e.monthNav,["keyup","increment"],_),C(e.daysContainer,"click",pt)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var Z=function(ce){return Zr(ce).select()};C(e.timeContainer,["increment"],u),C(e.timeContainer,"blur",u,{capture:!0}),C(e.timeContainer,"click",I),C([e.hourElement,e.minuteElement],["focus","click"],Z),e.secondElement!==void 0&&C(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&C(e.amPM,"click",function(ce){u(ce)})}e.config.allowInput&&C(e._input,"blur",lt)}function E(U,Z){var ce=U!==void 0?e.parseDate(U):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),we=e.currentYear,st=e.currentMonth;try{ce!==void 0&&(e.currentYear=ce.getFullYear(),e.currentMonth=ce.getMonth())}catch(vt){vt.message="Invalid date supplied: "+ce,e.config.errorHandler(vt)}Z&&e.currentYear!==we&&(ot("onYearChange"),z()),Z&&(e.currentYear!==we||e.currentMonth!==st)&&ot("onMonthChange"),e.redraw()}function I(U){var Z=Zr(U);~Z.className.indexOf("arrow")&&k(U,Z.classList.contains("arrowUp")?1:-1)}function k(U,Z,ce){var we=U&&Zr(U),st=ce||we&&we.parentNode&&we.parentNode.firstChild,vt=ct("increment");vt.delta=Z,st&&st.dispatchEvent(vt)}function F(){var U=window.document.createDocumentFragment();if(e.calendarContainer=Pi("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(U.appendChild(Ke()),e.innerContainer=Pi("div","flatpickr-innerContainer"),e.config.weekNumbers){var Z=Re(),ce=Z.weekWrapper,we=Z.weekNumbers;e.innerContainer.appendChild(ce),e.weekNumbers=we,e.weekWrapper=ce}e.rContainer=Pi("div","flatpickr-rContainer"),e.rContainer.appendChild(Oe()),e.daysContainer||(e.daysContainer=Pi("div","flatpickr-days"),e.daysContainer.tabIndex=-1),J(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),U.appendChild(e.innerContainer)}e.config.enableTime&&U.appendChild(Pe()),wr(e.calendarContainer,"rangeMode",e.config.mode==="range"),wr(e.calendarContainer,"animate",e.config.animate===!0),wr(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(U);var st=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!st&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var vt=Pi("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(vt,e.element),vt.appendChild(e.element),e.altInput&&vt.appendChild(e.altInput),vt.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function N(U,Z,ce,we){var st=ve(Z,!0),vt=Pi("span",U,Z.getDate().toString());return vt.dateObj=Z,vt.$i=we,vt.setAttribute("aria-label",e.formatDate(Z,e.config.ariaDateFormat)),U.indexOf("hidden")===-1&&Qr(Z,e.now)===0&&(e.todayDateElem=vt,vt.classList.add("today"),vt.setAttribute("aria-current","date")),st?(vt.tabIndex=-1,Rt(Z)&&(vt.classList.add("selected"),e.selectedDateElem=vt,e.config.mode==="range"&&(wr(vt,"startRange",e.selectedDates[0]&&Qr(Z,e.selectedDates[0],!0)===0),wr(vt,"endRange",e.selectedDates[1]&&Qr(Z,e.selectedDates[1],!0)===0),U==="nextMonthDay"&&vt.classList.add("inRange")))):vt.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Ht(Z)&&!Rt(Z)&&vt.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&U!=="prevMonthDay"&&we%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(Z)+"</span>"),ot("onDayCreate",vt),vt}function V(U){U.focus(),e.config.mode==="range"&&it(U)}function Q(U){for(var Z=U>0?0:e.config.showMonths-1,ce=U>0?e.config.showMonths:-1,we=Z;we!=ce;we+=U)for(var st=e.daysContainer.children[we],vt=U>0?0:st.children.length-1,ht=U>0?st.children.length:-1,wt=vt;wt!=ht;wt+=U){var Bt=st.children[wt];if(Bt.className.indexOf("hidden")===-1&&ve(Bt.dateObj))return Bt}}function L(U,Z){for(var ce=U.className.indexOf("Month")===-1?U.dateObj.getMonth():e.currentMonth,we=Z>0?e.config.showMonths:-1,st=Z>0?1:-1,vt=ce-e.currentMonth;vt!=we;vt+=st)for(var ht=e.daysContainer.children[vt],wt=ce-e.currentMonth===vt?U.$i+Z:Z<0?ht.children.length-1:0,Bt=ht.children.length,Et=wt;Et>=0&&Et<Bt&&Et!=(Z>0?Bt:-1);Et+=st){var _t=ht.children[Et];if(_t.className.indexOf("hidden")===-1&&ve(_t.dateObj)&&Math.abs(U.$i-Et)>=Math.abs(Z))return V(_t)}e.changeMonth(st),se(Q(st),0)}function se(U,Z){var ce=o(),we=He(ce||document.body),st=U!==void 0?U:we?ce:e.selectedDateElem!==void 0&&He(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&He(e.todayDateElem)?e.todayDateElem:Q(Z>0?1:-1);st===void 0?e._input.focus():we?L(st,Z):V(st)}function Ce(U,Z){for(var ce=(new Date(U,Z,1).getDay()-e.l10n.firstDayOfWeek+7)%7,we=e.utils.getDaysInMonth((Z-1+12)%12,U),st=e.utils.getDaysInMonth(Z,U),vt=window.document.createDocumentFragment(),ht=e.config.showMonths>1,wt=ht?"prevMonthDay hidden":"prevMonthDay",Bt=ht?"nextMonthDay hidden":"nextMonthDay",Et=we+1-ce,_t=0;Et<=we;Et++,_t++)vt.appendChild(N("flatpickr-day "+wt,new Date(U,Z-1,Et),Et,_t));for(Et=1;Et<=st;Et++,_t++)vt.appendChild(N("flatpickr-day",new Date(U,Z,Et),Et,_t));for(var Zt=st+1;Zt<=42-ce&&(e.config.showMonths===1||_t%7!==0);Zt++,_t++)vt.appendChild(N("flatpickr-day "+Bt,new Date(U,Z+1,Zt%st),Zt,_t));var Ii=Pi("div","dayContainer");return Ii.appendChild(vt),Ii}function J(){if(e.daysContainer!==void 0){xu(e.daysContainer),e.weekNumbers&&xu(e.weekNumbers);for(var U=document.createDocumentFragment(),Z=0;Z<e.config.showMonths;Z++){var ce=new Date(e.currentYear,e.currentMonth,1);ce.setMonth(e.currentMonth+Z),U.appendChild(Ce(ce.getFullYear(),ce.getMonth()))}e.daysContainer.appendChild(U),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&it()}}function z(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var U=function(we){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&we<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&we>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var Z=0;Z<12;Z++)if(U(Z)){var ce=Pi("option","flatpickr-monthDropdown-month");ce.value=new Date(e.currentYear,Z).getMonth().toString(),ce.textContent=Ou(Z,e.config.shorthandCurrentMonth,e.l10n),ce.tabIndex=-1,e.currentMonth===Z&&(ce.selected=!0),e.monthsDropdownContainer.appendChild(ce)}}}function P(){var U=Pi("div","flatpickr-month"),Z=window.document.createDocumentFragment(),ce;e.config.showMonths>1||e.config.monthSelectorType==="static"?ce=Pi("span","cur-month"):(e.monthsDropdownContainer=Pi("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),C(e.monthsDropdownContainer,"change",function(ht){var wt=Zr(ht),Bt=parseInt(wt.value,10);e.changeMonth(Bt-e.currentMonth),ot("onMonthChange")}),z(),ce=e.monthsDropdownContainer);var we=Tu("cur-year",{tabindex:"-1"}),st=we.getElementsByTagName("input")[0];st.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&st.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(st.setAttribute("max",e.config.maxDate.getFullYear().toString()),st.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var vt=Pi("div","flatpickr-current-month");return vt.appendChild(ce),vt.appendChild(we),Z.appendChild(vt),U.appendChild(Z),{container:U,yearElement:st,monthElement:ce}}function le(){xu(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var U=e.config.showMonths;U--;){var Z=P();e.yearElements.push(Z.yearElement),e.monthElements.push(Z.monthElement),e.monthNav.appendChild(Z.container)}e.monthNav.appendChild(e.nextMonthNav)}function Ke(){return e.monthNav=Pi("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Pi("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Pi("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,le(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(U){e.__hidePrevMonthArrow!==U&&(wr(e.prevMonthNav,"flatpickr-disabled",U),e.__hidePrevMonthArrow=U)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(U){e.__hideNextMonthArrow!==U&&(wr(e.nextMonthNav,"flatpickr-disabled",U),e.__hideNextMonthArrow=U)}}),e.currentYearElement=e.yearElements[0],Tt(),e.monthNav}function Pe(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var U=Zh(e.config);e.timeContainer=Pi("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var Z=Pi("span","flatpickr-time-separator",":"),ce=Tu("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=ce.getElementsByTagName("input")[0];var we=Tu("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=we.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?U.hours:c(U.hours)),e.minuteElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():U.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(ce),e.timeContainer.appendChild(Z),e.timeContainer.appendChild(we),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var st=Tu("flatpickr-second");e.secondElement=st.getElementsByTagName("input")[0],e.secondElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():U.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Pi("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(st)}return e.config.time_24hr||(e.amPM=Pi("span","flatpickr-am-pm",e.l10n.amPM[mo((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function Oe(){e.weekdayContainer?xu(e.weekdayContainer):e.weekdayContainer=Pi("div","flatpickr-weekdays");for(var U=e.config.showMonths;U--;){var Z=Pi("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(Z)}return ye(),e.weekdayContainer}function ye(){if(e.weekdayContainer){var U=e.l10n.firstDayOfWeek,Z=Xm(e.l10n.weekdays.shorthand);U>0&&U<Z.length&&(Z=Xm(Z.splice(U,Z.length),Z.splice(0,U)));for(var ce=e.config.showMonths;ce--;)e.weekdayContainer.children[ce].innerHTML=`
18
+ You can fix this by setting your gridOption.autoResize.container`);this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>this.resizeObserverCallback())),this._resizeObserver.observe(this._pageContainerElm)}else{if(this._gridDomElm===void 0||qn(this._gridDomElm)===void 0)return null;this.resizeGrid().then(()=>this.resizeGridWhenStylingIsBrokenUntilCorrected()).catch(n=>console.log("Error:",n)),this.resizeGrid(10,t),this._bindingEventService.bind(window,"resize",this.handleResizeGrid.bind(this,t))}}handleResizeGrid(t){this.pubSubService.publish("onGridBeforeResize"),this._resizePaused||(this.resizeGrid(0,t),this.resizeGrid(0,t))}resizeObserverCallback(){this._resizePaused||this.resizeGrid()}calculateGridNewDimensions(t){var e,n,r,o,s,l,u;const p=(e=t==null?void 0:t.autoResize)!==null&&e!==void 0?e:{},c=qn(this._gridDomElm);if(!window||this._pageContainerElm===void 0||c===void 0)return null;let f=(p==null?void 0:p.bottomPadding)!==void 0?p.bottomPadding:V0;if(f&&t.enablePagination&&(f+=U0),f&&t.showCustomFooter){const N=(o=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.customFooterOptions)===null||r===void 0?void 0:r.footerHeight)!==null&&o!==void 0?o:z0;f+=parseInt(`${N}`,10)}let m=0,v=0;p.calculateAvailableSizeBy==="container"?m=Zp(this._pageContainerElm,"height")||0:(m=window.innerHeight||0,v=(s=c==null?void 0:c.top)!==null&&s!==void 0?s:0);const _=m-v-f,C=Zp(this._pageContainerElm,"width")||window.innerWidth||0,x=p==null?void 0:p.maxHeight,w=(l=p==null?void 0:p.minHeight)!==null&&l!==void 0?l:G0,E=p==null?void 0:p.maxWidth,I=(u=p==null?void 0:p.minWidth)!==null&&u!==void 0?u:W0;let k=_,F=p!=null&&p.rightPadding?C-p.rightPadding:C;return k<w&&(k=w),x&&k>x&&(k=x),F<I&&(F=I),E&&F>E&&(F=E),{height:this._fixedHeight||k,width:this._fixedWidth||F}}getLastResizeDimensions(){return this._lastDimensions}pauseResizer(t){this._resizePaused=t}resizeGrid(t,e){return new Promise(n=>{t=t||0,t>0?(clearTimeout(this._timer),this._timer=setTimeout(()=>n(this.resizeGridCallback(e)),t)):n(this.resizeGridCallback(e))})}resizeGridCallback(t){var e,n;const r=this.resizeGridWithDimensions(t);return this.pubSubService.publish("onGridAfterResize",r),this.gridOptions.enableAutoResizeColumnsByCellContent&&(!(!((e=this._lastDimensions)===null||e===void 0)&&e.width)||(r==null?void 0:r.width)!==((n=this._lastDimensions)===null||n===void 0?void 0:n.width))&&this.resizeColumnsByCellContent(!1),this._lastDimensions=r,r}resizeGridWithDimensions(t){var e,n,r,o;const s=this.calculateGridNewDimensions(this.gridOptions);if((t||s)&&this._gridDomElm){const l=t!=null&&t.height?t.height:s==null?void 0:s.height,u=t!=null&&t.width?t.width:s==null?void 0:s.width;this.gridOptions.autoHeight||(this._gridDomElm.style.height=`${l}px`),this._gridDomElm.style.width=`${u}px`,this._gridContainerElm&&(this._gridContainerElm.style.width=`${u}px`),!((e=this._grid)===null||e===void 0)&&e.resizeCanvas&&this._gridContainerElm&&this._grid.resizeCanvas(),!((n=this.gridOptions)===null||n===void 0)&&n.enableAutoSizeColumns&&this._grid.autosizeColumns?this.gridUid&&document.querySelector(this.gridUidSelector)&&this._grid.autosizeColumns():this.gridOptions.enableAutoResizeColumnsByCellContent&&(!(!((r=this._lastDimensions)===null||r===void 0)&&r.width)||u!==((o=this._lastDimensions)===null||o===void 0?void 0:o.width))&&this.resizeColumnsByCellContent(!1),this._lastDimensions={height:l||0,width:u||0}}return this._lastDimensions}requestStopOfAutoFixResizeGrid(t=!0){this._isStopResizeIntervalRequested=t}resizeColumnsByCellContent(t=!1){var e,n,r,o,s,l,u;const p=this._grid.getColumns(),c=this.dataView.getItems(),f={};let m=!1,v=0;const _=(n=(e=this._gridContainerElm)===null||e===void 0?void 0:e.offsetWidth)!==null&&n!==void 0?n:0;if(!Array.isArray(c)||c.length===0||!t&&this._totalColumnsWidthByContent>0&&this._totalColumnsWidthByContent<_){this._grid.autosizeColumns();return}if(this._hasResizedByContentAtLeastOnce&&(!((r=this.gridOptions)===null||r===void 0)&&r.resizeByContentOnlyOnFirstLoad)&&!t)return;if(this.pubSubService.publish("onBeforeResizeByContent",void 0,0),this._totalColumnsWidthByContent===0||t){for(const w of p)f[w.id]=(s=(o=w.originalWidth)!==null&&o!==void 0?o:w.minWidth)!==null&&s!==void 0?s:0;v=this.calculateCellWidthByReadingDataset(p,f,this.resizeByContentOptions.maxItemToInspectCellContentWidth);let x=0;for(const w of p){const E=(u=(l=w.resizeAlwaysRecalculateWidth)!==null&&l!==void 0?l:this.resizeByContentOptions.alwaysRecalculateColumnWidth)!==null&&u!==void 0?u:!1;w.originalWidth&&!E?w.width=w.originalWidth:f[w.id]!==void 0&&(w.rerenderOnResize&&(m=!0),this.applyNewCalculatedColumnWidthByReference(w,f[w.id])),x+=w.width||0,this._totalColumnsWidthByContent=x}}this._grid.setColumns(p),this._hasResizedByContentAtLeastOnce=!0;const C={};for(const x of p)C[x.id]=x.width;this._totalColumnsWidthByContent>_?this._grid.reRenderColumns(m):this._grid.autosizeColumns(),this.pubSubService.publish("onAfterResizeByContent",{readItemCount:v,calculateColumnWidths:C})}calculateCellWidthByReadingDataset(t,e,n=1e3,r){const o=Array.isArray(t)?t:[t],s=this.dataView.getItems();let l=0;for(const[u,p]of s.entries()){if(u>n)break;Array.isArray(o)&&typeof e=="object"&&o.forEach((c,f)=>{const m=this.calculateCellWidthByContent(p,c,u,r??f,e[c.id]);m!==void 0&&(e[c.id]=m)}),l=u+1}return l}calculateCellWidthByContent(t,e,n,r,o){var s,l;const u=(s=this.resizeByContentOptions.cellCharWidthInPx)!==null&&s!==void 0?s:7;if(!e.originalWidth){const p=(l=e==null?void 0:e.resizeCharWidthInPx)!==null&&l!==void 0?l:u,c=nu(e==null?void 0:e.formatter,n,r,e,t,this._grid),f=or(c),m=Math.ceil(f.length*p),v=e.resizeMaxWidthThreshold;e&&(o===void 0||m>o)&&(o=v!==void 0&&m>v?v:e.maxWidth!==void 0&&m>e.maxWidth?e.maxWidth:m)}return o}applyNewCalculatedColumnWidthByReference(t,e){var n,r,o,s,l,u,p;const c=(n=this.resizeByContentOptions.cellPaddingWidthInPx)!==null&&n!==void 0?n:6,f=(r=this.resizeByContentOptions.formatterPaddingWidthInPx)!==null&&r!==void 0?r:6,m=(l=(s=(o=t==null?void 0:t.filter)===null||o===void 0?void 0:o.type)!==null&&s!==void 0?s:t==null?void 0:t.type)!==null&&l!==void 0?l:ie.string;let v=e;const _=(p=(u=t==null?void 0:t.resizeCalcWidthRatio)!==null&&u!==void 0?u:this.resizeByContentOptions.defaultRatioForStringType)!==null&&p!==void 0?p:.9;v*=m==="string"?_:1,v+=c,t.resizeExtraWidthPadding&&(v+=t.resizeExtraWidthPadding),t.editor&&this.gridOptions.editable&&(v+=f),t.maxWidth!==void 0&&v>t.maxWidth&&(v=t.maxWidth),t.resizeMaxWidthThreshold!==void 0&&v>t.resizeMaxWidthThreshold&&(v=t.resizeMaxWidthThreshold),v=Math.ceil(v),(t.originalWidth===void 0||t.resizeAlwaysRecalculateWidth===!0||this.resizeByContentOptions.alwaysRecalculateColumnWidth===!0)&&(t.width=this.readjustNewColumnWidthWhenOverLimit(t,v))}handleSingleColumnResizeByContent(t){var e,n,r;const o=this._grid.getColumns(),s=o.findIndex(l=>l.id===t);if(s>=0){const l=o[s],u={[t]:(n=(e=l.originalWidth)!==null&&e!==void 0?e:l.minWidth)!==null&&n!==void 0?n:0};l.originalWidth=void 0,this.calculateCellWidthByReadingDataset(l,u,this.resizeByContentOptions.maxItemToInspectSingleColumnWidthByContent,s),this.applyNewCalculatedColumnWidthByReference(l,u[t]),this._grid.reRenderColumns((r=l==null?void 0:l.rerenderOnResize)!==null&&r!==void 0?r:!1)}}readjustNewColumnWidthWhenOverLimit(t,e){var n,r,o,s,l,u,p,c;const f=(n=this.gridOptions.frozenColumn)!==null&&n!==void 0?n:-1,m=(r=this._grid.getColumns().findIndex(_=>_.id===t.id))!==null&&r!==void 0?r:0;let v=e;if(f>=0&&m<=f){const _=Array.from(this._grid.getViewports());if(_){const C=(s=(o=_.find(k=>k.classList.contains("slick-viewport-left")))===null||o===void 0?void 0:o.clientWidth)!==null&&s!==void 0?s:0,x=(u=(l=_.find(k=>k.classList.contains("slick-viewport-right")))===null||l===void 0?void 0:l.clientWidth)!==null&&u!==void 0?u:0,w=C+x,E=C-((p=t.width)!==null&&p!==void 0?p:0);if(E+e>w){const k=(c=this.resizeByContentOptions.widthToRemoveFromExceededWidthReadjustment)!==null&&c!==void 0?c:50;v=C-E+x-k}}}return Math.ceil(v)}checkIsGridShown(){var t,e;return!!((e=(t=document.querySelector(`${this.gridUidSelector}`))===null||t===void 0?void 0:t.offsetParent)!==null&&e!==void 0&&e)}resizeGridWhenStylingIsBrokenUntilCorrected(){var t,e,n,r;const o=(e=(t=this.gridOptions)===null||t===void 0?void 0:t.autoFixResizeTimeout)!==null&&e!==void 0?e:18e3,s=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.autoFixResizeRequiredGoodCount)!==null&&r!==void 0?r:5,l=this._gridContainerElm.querySelector(`${this.gridUidSelector} .slick-header`),u=this._gridContainerElm.querySelector(`${this.gridUidSelector} .slick-viewport`);let p=0,c=0;if(l&&u&&this.gridOptions.autoFixResizeWhenBrokenStyleDetected){const f=this.dataView.getItemCount(),m=this._grid.getColumns()||[];this._intervalId=setInterval(async()=>{var v,_,C,x,w,E;const k=qn(l);let F=(v=k==null?void 0:k.top)!==null&&v!==void 0?v:0;this.gridOptions&&this.gridOptions.enableFiltering&&this.gridOptions.headerRowHeight&&(F+=this.gridOptions.headerRowHeight),this.gridOptions&&this.gridOptions.createPreHeaderPanel&&this.gridOptions.showPreHeaderPanel&&this.gridOptions.preHeaderPanelHeight&&(F+=this.gridOptions.preHeaderPanelHeight),F+=44;const N=qn(u),V=(_=N==null?void 0:N.top)!==null&&_!==void 0?_:0,Q=qn(this._gridContainerElm);let L=(k==null?void 0:k.top)===0||F-V>2||(Q==null?void 0:Q.left)===0&&(Q==null?void 0:Q.top)===0;const se=(E=(w=(x=(C=this._grid).getRenderedRange)===null||x===void 0?void 0:x.call(C))===null||w===void 0?void 0:w.rightPx)!==null&&E!==void 0?E:0;!L&&f>0&&se===0&&m.length>1&&(L=!0),this._isStopResizeIntervalRequested&&(L=!1,p=o),this.checkIsGridShown()&&(L||(Q==null?void 0:Q.left)===0||(Q==null?void 0:Q.top)===0)&&(await this.resizeGrid(),this.checkIsGridShown()&&(L=!1)),this.checkIsGridShown()&&c++,this.checkIsGridShown()&&!L&&(c>=s||p++>=o)&&clearInterval(this._intervalId)},this.intervalRetryDelay)}}}class j0{constructor(){this._hasColumnsReordered=!1,this._hideHeaderRowAfterPageLoad=!1}get allColumns(){return this._allColumns}set allColumns(t){this._allColumns=t}get columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}get currentPagination(){return this._currentPagination}set currentPagination(t){this._currentPagination=t}get dataView(){return this._dataView}set dataView(t){this._dataView=t}get frozenVisibleColumnId(){return this._frozenVisibleColumnId}set frozenVisibleColumnId(t){this._frozenVisibleColumnId=t}get hasColumnsReordered(){return this._hasColumnsReordered}set hasColumnsReordered(t){this._hasColumnsReordered=t}get slickGrid(){return this._grid}set slickGrid(t){this._grid=t}get gridContainerElement(){return this._gridContainerElm}set gridContainerElement(t){this._gridContainerElm=t}get gridOptions(){var t;return this._gridOptions||((t=this._grid)===null||t===void 0?void 0:t.getOptions())||{}}set gridOptions(t){this._gridOptions=t}get groupItemMetadataProvider(){return this._groupItemMetadataProvider}set groupItemMetadataProvider(t){this._groupItemMetadataProvider=t}get hideHeaderRowAfterPageLoad(){return this._hideHeaderRowAfterPageLoad}set hideHeaderRowAfterPageLoad(t){this._hideHeaderRowAfterPageLoad=t}get externalRegisteredResources(){return this._externalRegisteredResources}set externalRegisteredResources(t){this._externalRegisteredResources=t}get visibleColumns(){return this._visibleColumns}set visibleColumns(t){this._visibleColumns=t}get hierarchicalDataset(){return this._hierarchicalDataset}set hierarchicalDataset(t){this._hierarchicalDataset=t}}class X0{constructor(t,e,n,r){this.sharedService=t,this.pubSubService=e,this.backendUtilities=n,this.rxjs=r,this._currentLocalSorters=[],this._isBackendGrid=!1,this._eventHandler=new Slick.EventHandler,this.rxjs&&(this.httpCancelRequests$=this.rxjs.createSubject())}get eventHandler(){return this._eventHandler}get _gridOptions(){return this._grid&&this._grid.getOptions?this._grid.getOptions():{}}get _columnDefinitions(){return this._grid&&this._grid.getColumns?this._grid.getColumns():[]}dispose(){var t,e;!((t=this._eventHandler)===null||t===void 0)&&t.unsubscribeAll&&this._eventHandler.unsubscribeAll(),this.httpCancelRequests$&&(!((e=this.rxjs)===null||e===void 0)&&e.isObservable(this.httpCancelRequests$))&&(this.httpCancelRequests$.next(),this.httpCancelRequests$.complete())}addRxJsResource(t){this.rxjs=t}bindBackendOnSort(t){var e,n;this._isBackendGrid=!0,this._grid=t,this._dataView=(n=(e=t==null?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{},this._eventHandler.subscribe(t.onSort,this.onBackendSortChanged.bind(this))}bindLocalOnSort(t){this._isBackendGrid=!1,this._grid=t,this._dataView=t.getData(),this.processTreeDataInitialSort(),this._eventHandler.subscribe(t.onSort,this.handleLocalOnSort.bind(this))}handleLocalOnSort(t,e){const n=e.multiColumnSort?e.sortCols:new Array({columnId:e.sortCol.id,sortAsc:e.sortAsc,sortCol:e.sortCol});this._currentLocalSorters=[],Array.isArray(n)&&n.forEach(r=>{r.sortCol&&this._currentLocalSorters.push({columnId:r.sortCol.id,direction:r.sortAsc?Io.ASC:Io.DESC})}),this.onLocalSortChanged(this._grid,n),this.emitSortChanged(Ji.local)}clearSortByColumnId(t,e){var n,r;const o=this.getCurrentColumnSorts(),s=this.getCurrentColumnSorts(`${e}`);if(Array.isArray(o)&&Array.isArray(s)&&o.length!==s.length){if(this._gridOptions.backendServiceApi)this.onBackendSortChanged(t,{multiColumnSort:!0,sortCols:s,grid:this._grid});else if(this._dataView)this.onLocalSortChanged(this._grid,s,!0,!0);else{const p=((r=(n=this._gridOptions)===null||n===void 0?void 0:n.multiColumnSort)!==null&&r!==void 0?r:!1)?s:s[0];this._grid.onSort.notify(p)}const l=s.map(u=>({columnId:u&&u.sortCol&&u.sortCol.id,sortAsc:u&&u.sortAsc,sortCol:u&&u.sortCol}));this._grid.setSortColumns(l)}Array.isArray(s)&&s.length===0&&this.sortLocalGridByDefaultSortFieldId()}clearSorting(t=!0){var e,n;if(this._grid&&this._gridOptions&&this._dataView){if(this._grid.setSortColumns([]),t)this._isBackendGrid?this.onBackendSortChanged(void 0,{grid:this._grid,multiColumnSort:!0,sortCols:[],clearSortTriggered:!0}):this._columnDefinitions&&Array.isArray(this._columnDefinitions)&&this._columnDefinitions.length>0&&this.sortLocalGridByDefaultSortFieldId();else if(this._isBackendGrid){const r=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.backendServiceApi)===null||n===void 0?void 0:n.service;r!=null&&r.clearSorters&&r.clearSorters()}}this._currentLocalSorters=[],this.pubSubService.publish("onSortCleared",!0)}disableSortFunctionality(t=!0,e=!0){const r=!this._gridOptions.enableSorting;this._gridOptions.enableSorting=r;let o;t?(e&&this.clearSorting(),this._eventHandler.unsubscribeAll(),o=this.disableAllSortingCommands(!0)):(o=this.disableAllSortingCommands(!1),this._eventHandler.subscribe(this._grid.onSort,(s,l)=>this.handleLocalOnSort(s,l))),this._grid.setOptions({enableSorting:this._gridOptions.enableSorting},!1,!0),this.sharedService.gridOptions=this._gridOptions,this._grid.setColumns(o)}toggleSortFunctionality(t=!0){const e=this._gridOptions.enableSorting;this.disableSortFunctionality(e,t)}emitSortChanged(t,e){var n;if(t===Ji.remote&&(!((n=this._gridOptions)===null||n===void 0)&&n.backendServiceApi)){let r=[];const o=this._gridOptions.backendServiceApi.service;o!=null&&o.getCurrentSorters&&(r=o.getCurrentSorters()),this.pubSubService.publish("onSortChanged",r)}else t===Ji.local&&(e&&(this._currentLocalSorters=e),this.pubSubService.publish("onSortChanged",this.getCurrentLocalSorters()))}getCurrentLocalSorters(){return this._currentLocalSorters}getCurrentColumnSorts(t){if(this._grid){const e=this._grid.getSortColumns();if(Array.isArray(e))return e.reduce((r,o)=>(o&&(!t||o.columnId!==t)&&r.push({columnId:o.columnId||"",sortCol:this._columnDefinitions[this._grid.getColumnIndex(o.columnId||"")],sortAsc:o.sortAsc}),r),[])}return[]}loadGridSorters(t){this._currentLocalSorters=[];const e=[];return Array.isArray(t)&&((this._gridOptions.multiColumnSort?t:t.slice(0,1)).forEach(r=>{const o=this._columnDefinitions.find(s=>s.id===r.columnId);o&&(e.push({columnId:o.id,sortAsc:r.direction.toUpperCase()===Io.ASC,sortCol:o}),this._currentLocalSorters.push({columnId:o.id+"",direction:r.direction.toUpperCase()}))}),this.onLocalSortChanged(this._grid,e),this._grid.setSortColumns(e.map(r=>({columnId:r.columnId,sortAsc:r.sortAsc})))),e}processTreeDataInitialSort(){var t,e,n;if(!((t=this._gridOptions)===null||t===void 0)&&t.enableTreeData&&this._gridOptions.treeDataOptions){const r=this._gridOptions.treeDataOptions,o=this._columnDefinitions.find(s=>s.id===r.columnId);if(o){let s=Io.ASC,l={columnId:r.columnId,sortCol:o,sortAsc:!0};if(!((e=r==null?void 0:r.initialSort)===null||e===void 0)&&e.columnId){const u=r.initialSort.columnId,p=this._columnDefinitions.find(c=>c.id===u);s=(r.initialSort.direction||Io.ASC).toUpperCase(),l={columnId:u,sortCol:p,sortAsc:s===Io.ASC}}l!=null&&l.columnId&&(!((n=this.sharedService)===null||n===void 0)&&n.hierarchicalDataset)&&this.updateSorting([{columnId:l.columnId||"",direction:s}])}}}onBackendSortChanged(t,e){var n,r;if(!e||!e.grid)throw new Error('Something went wrong when trying to bind the "onBackendSortChanged(event, args)" function, it seems that "args" is not populated correctly');const o=e.grid&&e.grid.getOptions?e.grid.getOptions():{},s=o.backendServiceApi;if(!s||!s.process||!s.service)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');const l=new Date;s.preProcess&&s.preProcess();const u=s.service.processOnSortChanged(t,e),p=((n=o==null?void 0:o.pagination)===null||n===void 0?void 0:n.totalItems)||0;(r=this.backendUtilities)===null||r===void 0||r.executeBackendCallback(s,u,e,l,p,{emitActionChangedCallback:this.emitSortChanged.bind(this),errorCallback:()=>{var c,f,m;this._grid.setSortColumns(e.previousSortColumns||[]);const v=(c=e.previousSortColumns)===null||c===void 0?void 0:c.map(_=>({columnId:_.columnId,sortAsc:_.sortAsc,sortCol:this._columnDefinitions.find(C=>C.id===_.columnId)}));(m=(f=s==null?void 0:s.service)===null||f===void 0?void 0:f.updateSorters)===null||m===void 0||m.call(f,v||[])},httpCancelRequestSubject:this.httpCancelRequests$})}async onLocalSortChanged(t,e,n=!1,r=!1){var o,s,l,u,p;const c=(s=(o=this._gridOptions)===null||o===void 0?void 0:o.datasetIdPropertyName)!==null&&s!==void 0?s:"id",f=(u=(l=this._gridOptions)===null||l===void 0?void 0:l.enableTreeData)!==null&&u!==void 0?u:!1,m=(p=t.getData)===null||p===void 0?void 0:p.call(t);if(await this.pubSubService.publish("onBeforeSortChange",{sortColumns:e},0),t&&m){if(n&&!f&&m.reSort(),f&&this.sharedService&&Array.isArray(this.sharedService.hierarchicalDataset)){const v=this.sortHierarchicalDataset(this.sharedService.hierarchicalDataset,e);this._dataView.setItems(v.flat,c),this._dataView.onRowCountChanged.notify({previous:this._dataView.getFilteredItemCount(),current:this._dataView.getLength(),itemCount:this._dataView.getItemCount(),dataView:this._dataView,callingOnRowsChanged:!0})}else m.sort(this.sortComparers.bind(this,e));t.invalidate(),r&&this.emitSortChanged(Ji.local,e.map(v=>{var _,C;return{columnId:(C=(_=v.sortCol)===null||_===void 0?void 0:_.id)!==null&&C!==void 0?C:"id",direction:v.sortAsc?Io.ASC:Io.DESC}}))}}sortHierarchicalDataset(t,e,n=!1){var r,o,s,l,u,p;this.sortTreeData(t,e);const c=(o=(r=this._gridOptions)===null||r===void 0?void 0:r.datasetIdPropertyName)!==null&&o!==void 0?o:"id",f=(l=(s=this._gridOptions)===null||s===void 0?void 0:s.treeDataOptions)!==null&&l!==void 0?l:{columnId:""},m={...f,identifierPropName:(u=f.identifierPropName)!==null&&u!==void 0?u:c,shouldAddTreeLevelNumber:!0},v=xp(t,m);if(n){this._currentLocalSorters=[];for(const C of e)this._currentLocalSorters.push({columnId:C.columnId,direction:C.sortAsc?"ASC":"DESC"});const _=!((p=this._gridOptions)===null||p===void 0)&&p.backendServiceApi?Ji.remote:Ji.local;this.emitSortChanged(_)}return{hierarchical:t,flat:v}}sortLocalGridByDefaultSortFieldId(){const t=this._gridOptions&&this._gridOptions.defaultColumnSortFieldId||this._gridOptions.datasetIdPropertyName||"id",e={id:t,field:t};this.onLocalSortChanged(this._grid,new Array({columnId:e.id,sortAsc:!0,sortCol:e,clearSortTriggered:!0}),!1,!0)}sortComparers(t,e,n){if(Array.isArray(t))for(const r of t){const o=this.sortComparer(r,e,n);if(o!==void 0)return o}return Yi.neutral}sortComparer(t,e,n,r){if(t!=null&&t.sortCol){const o=t.sortCol,s=t.sortAsc?Yi.asc:Yi.desc;let l=r||o.queryFieldSorter||o.queryField||o.field,u=l;const p=o.type||ie.string;typeof o.queryFieldNameGetterFn=="function"&&(l=o.queryFieldNameGetterFn(e),u=o.queryFieldNameGetterFn(n));let c=e[l],f=n[u];if(l&&l.indexOf(".")>=0&&(c=_n(e,l)),u&&u.indexOf(".")>=0&&(f=_n(n,u)),o.sortComparer){const m=o.sortComparer(c,f,s,o,this._gridOptions);if(m!==Yi.neutral)return m}else{const m=ea(p,c,f,s,o,this._gridOptions);if(m!==Yi.neutral)return m}}}sortTreeData(t,e){if(Array.isArray(e))for(const n of e)this.sortTreeChildren(t,n,0)}sortTreeChildren(t,e,n){var r,o;const s=(r=this._gridOptions)===null||r===void 0?void 0:r.treeDataOptions,l=(o=s==null?void 0:s.childrenPropName)!==null&&o!==void 0?o:"children";t.sort((u,p)=>{var c;return(c=this.sortComparer(e,u,p))!==null&&c!==void 0?c:Yi.neutral});for(const u of t)u&&u.hasOwnProperty(l)&&Array.isArray(u[l])&&(n++,this.sortTreeChildren(u[l],e,n),n--)}updateSorting(t,e=!0,n=!0){var r,o;if(!this._gridOptions||!this._gridOptions.enableSorting)throw new Error('[Slickgrid-Universal] in order to use "updateSorting" method, you need to have Sortable Columns defined in your grid and "enableSorting" set in your Grid Options');if(Array.isArray(t)){const s=(r=this._gridOptions)===null||r===void 0?void 0:r.backendServiceApi;if(s){const l=s==null?void 0:s.service;l!=null&&l.updateSorters&&(l.updateSorters(void 0,t),n&&((o=this.backendUtilities)===null||o===void 0||o.refreshBackendDataset(this._gridOptions)))}else this.loadGridSorters(t);if(e){const l=s?Ji.remote:Ji.local;this.emitSortChanged(l)}}}disableAllSortingCommands(t=!0){var e,n;const r=this._grid.getColumns();r.forEach(s=>{var l;typeof s.sortable!==void 0&&(s.sortable=!t),!((l=s==null?void 0:s.header)===null||l===void 0)&&l.menu&&s.header.menu.items.forEach(u=>{if(u&&typeof u!="string"){const p=u.command;(p==="sort-asc"||p==="sort-desc"||p==="clear-sort")&&(u.hidden=t)}})});const o=(n=(e=this._gridOptions)===null||e===void 0?void 0:e.gridMenu)===null||n===void 0?void 0:n.commandItems;return o&&o.forEach(s=>{s&&typeof s!="string"&&s.command==="clear-sorting"&&(s.hidden=t)}),r}}class q0{constructor(t,e,n){this.pubSubService=t,this.sharedService=e,this.sortService=n,this._isLastFullToggleCollapsed=!1,this._currentToggledItems=[],this._subscriptions=[],this._eventHandler=new Slick.EventHandler}set currentToggledItems(t){this._currentToggledItems=t}get dataset(){var t;return(t=this.dataView)===null||t===void 0?void 0:t.getItems()}get datasetHierarchical(){return this.sharedService.hierarchicalDataset}get dataView(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getData)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get eventHandler(){return this._eventHandler}get gridOptions(){var t,e,n;return(n=(e=(t=this._grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get treeDataOptions(){return this.gridOptions.treeDataOptions}dispose(){this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}init(t){var e,n,r,o,s,l,u,p,c,f,m;if(this._grid=t,this._isLastFullToggleCollapsed=(r=(n=(e=this.gridOptions)===null||e===void 0?void 0:e.treeDataOptions)===null||n===void 0?void 0:n.initiallyCollapsed)!==null&&r!==void 0?r:!1,this._currentToggledItems=(l=(s=(o=this.gridOptions.presets)===null||o===void 0?void 0:o.treeData)===null||s===void 0?void 0:s.toggledItems)!==null&&l!==void 0?l:[],this._lastToggleStateChange={type:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},!((u=this.gridOptions)===null||u===void 0)&&u.enableTreeData){if(!((p=this.gridOptions)===null||p===void 0)&&p.multiColumnSort)throw new Error('[Slickgrid-Universal] It looks like you are trying to use Tree Data with multi-column sorting, unfortunately it is not supported because of its complexity, you can disable it via "multiColumnSort: false" grid option and/or help in providing support for this feature.');if(!(!((c=this.gridOptions)===null||c===void 0)&&c.enableFiltering))throw new Error('[Slickgrid-Universal] It looks like you are trying to use Tree Data without using the filtering option, unfortunately that is not possible with Tree Data since it relies heavily on the filters to expand/collapse the tree. You need to enable it via "enableFiltering: true"');if(!((f=this.gridOptions)===null||f===void 0)&&f.backendServiceApi||!((m=this.gridOptions)===null||m===void 0)&&m.enablePagination)throw new Error("[Slickgrid-Universal] It looks like you are trying to use Tree Data with Pagination and/or a Backend Service (OData, GraphQL) but unfortunately that is simply not supported because of its complexity.");if(!this.gridOptions.treeDataOptions||!this.gridOptions.treeDataOptions.columnId)throw new Error('[Slickgrid-Universal] When enabling tree data, you must also provide the "treeDataOption" property in your Grid Options with "childrenPropName" or "parentPropName" (depending if your array is hierarchical or flat) for the Tree Data to work properly.')}this._eventHandler.subscribe(t.onClick,this.handleOnCellClick.bind(this)),this._subscriptions.push(this.pubSubService.subscribe("onGridMenuClearAllSorting",this.clearSorting.bind(this)))}applyToggledItemStateChanges(t,e,n=!0,r=!1){if(Array.isArray(t)){const o=this.getTreeDataOptionPropName("collapsedPropName"),s=this.getTreeDataOptionPropName("hasChildrenPropName");this.dataView.beginUpdate(!0);const u=(e??this._lastToggleStateChange.previousFullToggleType)==="full-collapse";e&&(this._lastToggleStateChange.previousFullToggleType=e),n&&(this.dataView.getItems()||[]).forEach(p=>{p[s]&&(p[o]=u)}),this.dynamicallyToggleItemState(t,r)}}dynamicallyToggleItemState(t,e=!0){if(Array.isArray(t)){this.dataView.beginUpdate(!0);for(const n of t){const r=this.dataView.getItemById(n.itemId);if(this.updateToggledItem(r,n.isCollapsed),e){const o=this._currentToggledItems.findIndex(s=>s.itemId===n.itemId);o>=0?this._currentToggledItems[o].isCollapsed=n.isCollapsed:this._currentToggledItems.push({itemId:n.itemId,isCollapsed:n.isCollapsed}),this.pubSubService.publish("onTreeItemToggled",{...this._lastToggleStateChange,fromItemId:n.itemId,toggledItems:this._currentToggledItems,type:n.isCollapsed?gs.toggleCollapse:gs.toggleExpand})}}this.dataView.endUpdate(),this.dataView.refresh()}}getCurrentToggleState(){return this._lastToggleStateChange}getInitialSort(t,e){var n,r,o;const s=e==null?void 0:e.treeDataOptions,l=(n=s==null?void 0:s.initialSort)!==null&&n!==void 0?n:{columnId:(r=s==null?void 0:s.columnId)!==null&&r!==void 0?r:"",direction:"ASC"},u=t.find(p=>p.id===l.columnId);return{columnId:l.columnId,sortAsc:((o=l==null?void 0:l.direction)===null||o===void 0?void 0:o.toUpperCase())!=="DESC",sortCol:u}}getItemCount(t){if(t!==void 0){const e=this.getTreeDataOptionPropName("levelPropName");return this.dataView.getItems().filter(n=>n[e]===t).length}return this.dataView.getItemCount()}getToggledItems(){return this._currentToggledItems}getTreeDataOptionPropName(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C;let x="";switch(t){case"childrenPropName":x=(n=(e=this.treeDataOptions)===null||e===void 0?void 0:e.childrenPropName)!==null&&n!==void 0?n:Xe.treeDataProperties.CHILDREN_PROP;break;case"collapsedPropName":x=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.collapsedPropName)!==null&&o!==void 0?o:Xe.treeDataProperties.COLLAPSED_PROP;break;case"hasChildrenPropName":x=(l=(s=this.treeDataOptions)===null||s===void 0?void 0:s.hasChildrenPropName)!==null&&l!==void 0?l:Xe.treeDataProperties.HAS_CHILDREN_PROP;break;case"identifierPropName":x=(f=(p=(u=this.treeDataOptions)===null||u===void 0?void 0:u.identifierPropName)!==null&&p!==void 0?p:(c=this.gridOptions)===null||c===void 0?void 0:c.datasetIdPropertyName)!==null&&f!==void 0?f:"id";break;case"levelPropName":x=(v=(m=this.treeDataOptions)===null||m===void 0?void 0:m.levelPropName)!==null&&v!==void 0?v:Xe.treeDataProperties.TREE_LEVEL_PROP;break;case"parentPropName":x=(C=(_=this.treeDataOptions)===null||_===void 0?void 0:_.parentPropName)!==null&&C!==void 0?C:Xe.treeDataProperties.PARENT_PROP;break}return x}clearSorting(){const t=this.getInitialSort(this.sharedService.columnDefinitions,this.sharedService.gridOptions);this.sortService.loadGridSorters([{columnId:t.columnId,direction:t.sortAsc?"ASC":"DESC"}])}convertFlatParentChildToTreeDatasetAndSort(t,e,n){var r;const o=this.convertFlatParentChildToTreeDataset(t,n),s=this.getInitialSort(e,n),l=this.sortService.sortHierarchicalDataset(o,[s],!0);return(r=this._grid)===null||r===void 0||r.setSortColumns([s]),l}convertFlatParentChildToTreeDataset(t,e){var n,r,o;const s=(n=e==null?void 0:e.datasetIdPropertyName)!==null&&n!==void 0?n:"id",l=(r=e==null?void 0:e.treeDataOptions)!==null&&r!==void 0?r:{columnId:"id"},u={...l,identifierPropName:(o=l.identifierPropName)!==null&&o!==void 0?o:s,initiallyCollapsed:this._isLastFullToggleCollapsed};return Tp(t,u)}sortHierarchicalDataset(t,e){const n=e??this.getInitialSort(this.sharedService.allColumns,this.gridOptions),r=Array.isArray(n)?n:[n];return this.sortService.sortHierarchicalDataset(t,r)}async toggleTreeDataCollapse(t,e=!0){var n;if(!((n=this.gridOptions)===null||n===void 0)&&n.enableTreeData){const o=this.getTreeDataOptionPropName("hasChildrenPropName");e&&await this.pubSubService.publish("onTreeFullToggleStart",{collapsing:t}),this.dataView.beginUpdate(!0),(this.dataView.getItems()||[]).forEach(s=>{s[o]&&this.updateToggledItem(s,t)}),this.dataView.endUpdate(),this.dataView.refresh(),this._isLastFullToggleCollapsed=t}const r=t?gs.fullCollapse:gs.fullExpand;this._lastToggleStateChange={type:r,previousFullToggleType:r,toggledItems:null},e&&this.pubSubService.publish("onTreeFullToggleEnd",this._lastToggleStateChange)}handleOnCellClick(t,e){var n;if(t&&e){const r=t.target||{},o=(n=this.gridOptions.datasetIdPropertyName)!==null&&n!==void 0?n:"id",s=this.getTreeDataOptionPropName("collapsedPropName"),l=this.getTreeDataOptionPropName("childrenPropName");if(typeof(r==null?void 0:r.className)=="string"&&(r.className.indexOf("toggle")>=0||!1)){const p=this.dataView.getItem(e.row);if(p){p[s]=!p[s];const c=p[s],f=p[o],m=this._currentToggledItems.findIndex(C=>C.itemId===f);m>=0?this._currentToggledItems[m].isCollapsed=c:this._currentToggledItems.push({itemId:f,isCollapsed:c}),this.dataView.updateItem(f,p);const v=C=>C[o]===f,_=Ud(this.sharedService.hierarchicalDataset||[],v,l);_&&(_[s]=c),this._grid.invalidate(),this._lastToggleStateChange={type:c?gs.toggleCollapse:gs.toggleExpand,previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},this.pubSubService.publish("onTreeItemToggled",{...this._lastToggleStateChange,fromItemId:f})}t.stopImmediatePropagation()}}}updateToggledItem(t,e){var n,r;const o=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.datasetIdPropertyName)!==null&&r!==void 0?r:"id",s=this.getTreeDataOptionPropName("childrenPropName"),l=this.getTreeDataOptionPropName("collapsedPropName");if(t){t[l]=e,this.dataView.updateItem(t[o],t);const u=c=>c[o]===t[o],p=Ud(this.sharedService.hierarchicalDataset||[],u,s);p&&(p[l]=e)}}}function Wh(a,t){const e=De("select",{className:"form-control"});for(const n of a)e.appendChild(De("option",{value:n.operator,innerHTML:Pn(t,`${I_(n.operator,3)}${n.description}`)}));return e}function Kn(a,t,e,n="Slider"){var r,o,s;let l;return((r=a.filterOptions)===null||r===void 0?void 0:r[t])!==void 0?l=a.filterOptions[t]:((o=a==null?void 0:a.params)===null||o===void 0?void 0:o[t])!==void 0&&(console.warn(`[Slickgrid-Universal] All filter.params from ${n} Filter are moving to "filterOptions" for better typing support and "params" will be deprecated in future release.`),l=(s=a==null?void 0:a.params)===null||s===void 0?void 0:s[t]),l??e}function K0(a,t,e){var n,r;const o=(n=t==null?void 0:t.filter)!==null&&n!==void 0?n:{},s=(r=o==null?void 0:o.collectionOptions)!==null&&r!==void 0?r:{};if(s&&s.collectionInsideObjectProperty){const l=s.collectionInsideObjectProperty;a=_n(a,l)}if(!Array.isArray(a))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');o.collection=a,e(a)}async function Gm(a,t,e,n,r){var o,s,l;const u=(o=t==null?void 0:t.filter)!==null&&o!==void 0?o:{},p=(s=u==null?void 0:u.collectionOptions)!==null&&s!==void 0?s:{};let c=null;if(a){const f=(l=n==null?void 0:n.isObservable(a))!==null&&l!==void 0?l:!1;f&&n&&(c=await wp(n,a));const m=await a;if(Array.isArray(m)?c=m:(m==null?void 0:m.status)>=200&&m.status<300&&typeof m.json=="function"?c=await m.json():m&&m.content&&(c=m.content),!Array.isArray(c)&&(p!=null&&p.collectionInsideObjectProperty)){const v=c||m,_=p.collectionInsideObjectProperty;c=_n(v,_||"")}if(!Array.isArray(c))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');u.collection=c,e(c),f&&Z0(t,e,n,r)}return c}function Z0(a,t,e,n){var r;const o=(r=a==null?void 0:a.filter)!==null&&r!==void 0?r:{},s=e==null?void 0:e.createSubject();o.collectionAsync=s,n&&s&&n.push(s.subscribe(l=>K0(l,a,t)))}function po(a,t,e,n,r){var o;if(n!=null&&n.enableTranslate&&(r!=null&&r.translate)){const l=ao(n);return r.translate(`${l}${a}`)}const s=n.locales||Xe.locales;return(o=s==null?void 0:s[t])!==null&&o!==void 0?o:e}function Q0(a,t){return[{operator:"",description:po("CONTAINS","TEXT_CONTAINS","Contains",a,t)},{operator:"<>",description:po("NOT_CONTAINS","TEXT_NOT_CONTAINS","Not Contains",a,t)},{operator:"=",description:po("EQUALS","TEXT_EQUALS","Equals",a,t)},{operator:"!=",description:po("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",a,t)},{operator:"a*",description:po("STARTS_WITH","TEXT_STARTS_WITH","Starts with",a,t)},{operator:"*z",description:po("ENDS_WITH","TEXT_ENDS_WITH","Ends with",a,t)}]}function $h(a,t){return[{operator:"",description:""},{operator:"=",description:po("EQUAL_TO","TEXT_EQUAL_TO","Equal to",a,t)},{operator:"<",description:po("LESS_THAN","TEXT_LESS_THAN","Less than",a,t)},{operator:"<=",description:po("LESS_THAN_OR_EQUAL_TO","TEXT_LESS_THAN_OR_EQUAL_TO","Less than or equal to",a,t)},{operator:">",description:po("GREATER_THAN","TEXT_GREATER_THAN","Greater than",a,t)},{operator:">=",description:po("GREATER_THAN_OR_EQUAL_TO","TEXT_GREATER_THAN_OR_EQUAL_TO","Greater than or equal to",a,t)},{operator:"<>",description:po("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",a,t)}]}const Wm=Xd&&sh||Xd;class J0{constructor(t,e,n){this.translaterService=t,this.collectionService=e,this.rxjs=n,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.searchTerms=[],this.isFilled=!1,this.isItemSelected=!1,this.valueName="label",this.enableTranslateLabel=!1,this.subscriptions=[],this._bindEventService=new Fn}get autocompleterOptions(){return this._autocompleterOptions||{}}get collectionOptions(){var t,e,n;return(n=(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)===null||e===void 0?void 0:e.collectionOptions)!==null&&n!==void 0?n:{}}get collection(){return this._collection}get columnFilter(){var t;return((t=this.columnDef)===null||t===void 0?void 0:t.filter)||{}}get filterDomElement(){return this._filterElm}get filterOptions(){var t;return((t=this.columnFilter)===null||t===void 0?void 0:t.filterOptions)||{}}get customStructure(){var t,e,n,r,o,s;let l=(t=this.columnFilter)===null||t===void 0?void 0:t.customStructure;const u=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.type)!==null&&n!==void 0?n:(r=this.columnDef)===null||r===void 0?void 0:r.type;return!l&&u===ie.object&&(!((o=this.columnDef)===null||o===void 0)&&o.dataKey)&&(!((s=this.columnDef)===null||s===void 0)&&s.labelKey)&&(l={label:this.columnDef.labelKey,value:this.columnDef.dataKey}),l}get defaultOperator(){return Lt.equal}get gridOptions(){return this.grid&&this.grid.getOptions?this.grid.getOptions():{}}get instance(){return this._instance}get operator(){var t,e;return(e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator}set operator(t){this.columnFilter&&(this.columnFilter.operator=t)}init(t){var e,n,r,o,s,l,u,p,c,f,m,v;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.searchTerms=(t.hasOwnProperty("searchTerms")?t.searchTerms:[])||[],this.filterContainerElm=t.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection&&!this.columnFilter.collectionAsync&&!this.columnFilter.filterOptions)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") for the AutoComplete Filter to work correctly. Also each option should include a value/label pair (or value/labelKey when using Locale). For example:: { filter: model: Filters.autocompleter, collection: [{ value: true, label: 'True' }, { value: false, label: 'False'}] }`);this.enableTranslateLabel=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.enableTranslateLabel)!==null&&n!==void 0?n:!1,this.labelName=(o=(r=this.customStructure)===null||r===void 0?void 0:r.label)!==null&&o!==void 0?o:"label",this.valueName=(l=(s=this.customStructure)===null||s===void 0?void 0:s.value)!==null&&l!==void 0?l:"value",this.labelPrefixName=(p=(u=this.customStructure)===null||u===void 0?void 0:u.labelPrefix)!==null&&p!==void 0?p:"labelPrefix",this.labelSuffixName=(f=(c=this.customStructure)===null||c===void 0?void 0:c.labelSuffix)!==null&&f!==void 0?f:"labelSuffix",this._locales=(v=(m=this.gridOptions)===null||m===void 0?void 0:m.locales)!==null&&v!==void 0?v:Xe.locales;const _=this.columnFilter.collection;return this._collection=_,this.renderDomElement(_),new Promise(async(C,x)=>{try{const w=this.columnFilter.collectionAsync;let E;w&&!this.columnFilter.collection?(E=Gm(w,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),C(E)):(E=_,C(_)),(w||this.columnFilter.enableCollectionWatch)&&(await(E??w),this.watchCollectionChanges())}catch(w){x(w)}})}clear(t=!0){this._filterElm&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[],this._filterElm.value="",this._filterElm.dispatchEvent(new CustomEvent("input")),this._filterElm.classList.remove("filled"))}destroy(){var t,e,n;(t=this._instance)===null||t===void 0||t.destroy(),this._filterElm,(n=(e=this._filterElm)===null||e===void 0?void 0:e.remove)===null||n===void 0||n.call(e),this._collection=void 0,this._bindEventService.unbindAll(),Gd(this.subscriptions)}getValues(){var t;return(t=this._filterElm)===null||t===void 0?void 0:t.value}setValues(t,e){var n;t&&this._filterElm&&(this._filterElm.value=t);const r=this.getValues()!==""?"add":"remove";(n=this._filterElm)===null||n===void 0||n.classList[r]("filled"),this.operator=e||this.defaultOperator}filterCollection(t){let e=t;if(this.columnFilter&&this.columnFilter.collectionFilterBy){const n=this.columnFilter.collectionFilterBy,r=this.columnFilter.collectionOptions&&this.columnFilter.collectionOptions.filterResultAfterEachPass||null;e=this.collectionService.filterCollection(e,n,r)}return e}sortCollection(t){let e=t;if(this.columnFilter&&this.columnFilter.collectionSortBy){const n=this.columnFilter.collectionSortBy;e=this.collectionService.sortCollection(this.columnDef,e,n,this.enableTranslateLabel)}return e}watchCollectionChanges(){var t;!((t=this.columnFilter)===null||t===void 0)&&t.collection&&(Na(this.columnFilter.collection,e=>{this.renderDomElement(this.columnFilter.collection||e||[])}),Kc(this.columnFilter,"collection",e=>{this.renderDomElement(e||[]),this.columnFilter.collection&&Na(this.columnFilter.collection,n=>{this.renderDomElement(this.columnFilter.collection||n||[])})}))}renderDomElement(t){var e;if(!Array.isArray(t)&&(!((e=this.collectionOptions)===null||e===void 0)&&e.collectionInsideObjectProperty)){const o=this.collectionOptions.collectionInsideObjectProperty;t=_n(t,o||"")}let n=t;n&&(n=this.filterCollection(n),n=this.sortCollection(n));const r=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this._collection=n,this._filterElm=this.createFilterElement(n,r),this._bindEventService.bind(this._filterElm,"input",this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._filterElm,"blur",()=>{this.isItemSelected||this.clear()})}createFilterElement(t,e){var n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E;this._collection=t;const I=(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"";en(this.filterContainerElm);let k=(s=(o=this.gridOptions)===null||o===void 0?void 0:o.defaultFilterPlaceholder)!==null&&s!==void 0?s:"";!((l=this.columnFilter)===null||l===void 0)&&l.placeholder&&(k=this.columnFilter.placeholder),this._filterElm=De("input",{type:"text",ariaLabel:(p=(u=this.columnFilter)===null||u===void 0?void 0:u.ariaLabel)!==null&&p!==void 0?p:`${jr(I+"")} Search Filter`,autocomplete:"none",placeholder:k,className:`form-control search-filter filter-${I} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${I}`}});const F=e;Array.isArray(t)&&(t.every(V=>Wd(V))?t=t.map(V=>({label:V,value:V})):t=t.map(V=>{var Q,L;return{label:V==null?void 0:V[this.labelName],value:V==null?void 0:V[this.valueName],labelPrefix:(Q=V==null?void 0:V[this.labelPrefixName])!==null&&Q!==void 0?Q:"",labelSuffix:(L=V==null?void 0:V[this.labelSuffixName])!==null&&L!==void 0?L:""}})),this._autocompleterOptions={input:this._filterElm,debounceWaitMs:200,className:`slick-autocomplete ${(f=(c=this.filterOptions)===null||c===void 0?void 0:c.className)!==null&&f!==void 0?f:""}`.trim(),emptyMsg:this.gridOptions.enableTranslate&&(!((m=this.translaterService)===null||m===void 0)&&m.translate)?this.translaterService.translate("NO_ELEMENTS_FOUND"):(_=(v=this._locales)===null||v===void 0?void 0:v.TEXT_NO_ELEMENTS_FOUND)!==null&&_!==void 0?_:"No elements found",customize:(V,Q,L)=>{L.style.width=""},onSelect:V=>{this.isItemSelected=!0,this.handleSelect(V)},...this.filterOptions},!((C=this._autocompleterOptions.renderItem)===null||C===void 0)&&C.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${Ga(this._autocompleterOptions.renderItem.layout)}`,this._autocompleterOptions.render=this.renderCustomItem.bind(this)):Array.isArray(t)?this._autocompleterOptions.render=(w=(x=this._autocompleterOptions.render)===null||x===void 0?void 0:x.bind(this))!==null&&w!==void 0?w:this.renderCollectionItem.bind(this):this._autocompleterOptions.render||(this._autocompleterOptions.render=this.renderRegularItem.bind(this)),!((E=this.filterOptions)===null||E===void 0)&&E.fetch?(Np(this._filterElm,this._autocompleterOptions),this._instance=Wm(this._autocompleterOptions)):this._instance=Wm({...this._autocompleterOptions,fetch:(V,Q)=>{t&&Q(t.filter(L=>((typeof L=="string"?L:L==null?void 0:L.label)||"").toLowerCase().includes(V.toLowerCase())))}}),this._filterElm.value=F??"";const N=De("div",{className:"autocomplete-filter-container"});return N.appendChild(this._filterElm),N.appendChild(De("span")),e&&this._filterElm.classList.add("filled"),this.filterContainerElm.appendChild(N),this.filterContainerElm.appendChild(document.createElement("span")),this._filterElm}handleSelect(t){var e,n,r,o;if(t!==void 0){const l=(r=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.filterOptions)===null||n===void 0?void 0:n.renderItem)!==null&&r!==void 0?r:!1,u=typeof t=="string"?t:l?t[this.labelName]:t.label;let p=typeof t=="string"?t:l?t[this.valueName]:t.value;p=this.trimWhitespaceWhenEnabled(p);const c=p===""?"remove":"add";(o=this._filterElm)===null||o===void 0||o.classList[c]("filled"),this.setValues(u),this.callback(void 0,{columnDef:this.columnDef,operator:this.operator,searchTerms:[p],shouldTriggerQuery:this._shouldTriggerQuery}),this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}return!1}handleOnInputChange(t){var e,n,r,o,s;let l=(n=(e=t==null?void 0:t.target)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"";const u=(r=this.filterOptions.triggerOnEveryKeyStroke)!==null&&r!==void 0?r:!1;if(l=this.trimWhitespaceWhenEnabled(l),this._clearFilterTriggered||l===""||u){const p={columnDef:this.columnDef,shouldTriggerQuery:this._shouldTriggerQuery};this._clearFilterTriggered?p.clearFilterTriggered=this._clearFilterTriggered:(p.operator=this.operator,p.searchTerms=[l]),l!==""?(this.isItemSelected=!0,(o=this._filterElm)===null||o===void 0||o.classList.add("filled")):(this.isItemSelected=!1,(s=this._filterElm)===null||s===void 0||s.classList.remove("filled")),this.callback(t,p)}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}renderRegularItem(t){var e;const n=typeof t=="string"?t:(e=t==null?void 0:t.label)!==null&&e!==void 0?e:"";return De("div",{textContent:n||""})}renderCustomItem(t){var e,n,r;const o=(r=(n=(e=this._autocompleterOptions)===null||e===void 0?void 0:e.renderItem)===null||n===void 0?void 0:n.templateCallback(t))!==null&&r!==void 0?r:"",s=Pn(this.gridOptions,o)||"";return De("div",{innerHTML:s})}renderCollectionItem(t){var e,n;const r=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.enableRenderHtml)!==null&&n!==void 0?n:!1,o=t.labelPrefix||"",s=t.label||"",l=t.labelSuffix||"",u=o+s+l,p=Pn(this.gridOptions,u)||"",c=document.createElement("div");return c[r?"innerHTML":"textContent"]=p,c}trimWhitespaceWhenEnabled(t){let e=t;const n=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;return typeof t=="string"&&n&&(e=t.trim()),e}}var Yh=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],da={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(a){return typeof console<"u"&&console.warn(a)},getWeek:function(a){var t=new Date(a.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ld={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(a){var t=a%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Nr=function(a,t){return t===void 0&&(t=2),("000"+a).slice(t*-1)},mo=function(a){return a===!0?1:0};function $m(a,t){var e;return function(){var n=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return a.apply(n,r)},t)}}var jh=function(a){return a instanceof Array?a:[a]};function wr(a,t,e){if(e===!0)return a.classList.add(t);a.classList.remove(t)}function Pi(a,t,e){var n=window.document.createElement(a);return t=t||"",e=e||"",n.className=t,e!==void 0&&(n.textContent=e),n}function xu(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function Ym(a,t){if(t(a))return a;if(a.parentNode)return Ym(a.parentNode,t)}function Tu(a,t){var e=Pi("div","numInputWrapper"),n=Pi("input","numInput "+a),r=Pi("span","arrowUp"),o=Pi("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),t!==void 0)for(var s in t)n.setAttribute(s,t[s]);return e.appendChild(n),e.appendChild(r),e.appendChild(o),e}function Zr(a){try{if(typeof a.composedPath=="function"){var t=a.composedPath();return t[0]}return a.target}catch{return a.target}}var Xh=function(){},Ou=function(a,t,e){return e.months[t?"shorthand":"longhand"][a]},eb={D:Xh,F:function(a,t,e){a.setMonth(e.months.longhand.indexOf(t))},G:function(a,t){a.setHours((a.getHours()>=12?12:0)+parseFloat(t))},H:function(a,t){a.setHours(parseFloat(t))},J:function(a,t){a.setDate(parseFloat(t))},K:function(a,t,e){a.setHours(a.getHours()%12+12*mo(new RegExp(e.amPM[1],"i").test(t)))},M:function(a,t,e){a.setMonth(e.months.shorthand.indexOf(t))},S:function(a,t){a.setSeconds(parseFloat(t))},U:function(a,t){return new Date(parseFloat(t)*1e3)},W:function(a,t,e){var n=parseInt(t),r=new Date(a.getFullYear(),0,2+(n-1)*7,0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(a,t){a.setFullYear(parseFloat(t))},Z:function(a,t){return new Date(t)},d:function(a,t){a.setDate(parseFloat(t))},h:function(a,t){a.setHours((a.getHours()>=12?12:0)+parseFloat(t))},i:function(a,t){a.setMinutes(parseFloat(t))},j:function(a,t){a.setDate(parseFloat(t))},l:Xh,m:function(a,t){a.setMonth(parseFloat(t)-1)},n:function(a,t){a.setMonth(parseFloat(t)-1)},s:function(a,t){a.setSeconds(parseFloat(t))},u:function(a,t){return new Date(parseFloat(t))},w:Xh,y:function(a,t){a.setFullYear(2e3+parseFloat(t))}},Al={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ad={Z:function(a){return a.toISOString()},D:function(a,t,e){return t.weekdays.shorthand[ad.w(a,t,e)]},F:function(a,t,e){return Ou(ad.n(a,t,e)-1,!1,t)},G:function(a,t,e){return Nr(ad.h(a,t,e))},H:function(a){return Nr(a.getHours())},J:function(a,t){return t.ordinal!==void 0?a.getDate()+t.ordinal(a.getDate()):a.getDate()},K:function(a,t){return t.amPM[mo(a.getHours()>11)]},M:function(a,t){return Ou(a.getMonth(),!0,t)},S:function(a){return Nr(a.getSeconds())},U:function(a){return a.getTime()/1e3},W:function(a,t,e){return e.getWeek(a)},Y:function(a){return Nr(a.getFullYear(),4)},d:function(a){return Nr(a.getDate())},h:function(a){return a.getHours()%12?a.getHours()%12:12},i:function(a){return Nr(a.getMinutes())},j:function(a){return a.getDate()},l:function(a,t){return t.weekdays.longhand[a.getDay()]},m:function(a){return Nr(a.getMonth()+1)},n:function(a){return a.getMonth()+1},s:function(a){return a.getSeconds()},u:function(a){return a.getTime()},w:function(a){return a.getDay()},y:function(a){return String(a.getFullYear()).substring(2)}},jm=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?ld:n,o=a.isMobile,s=o===void 0?!1:o;return function(l,u,p){var c=p||r;return e.formatDate!==void 0&&!s?e.formatDate(l,u,c):u.split("").map(function(f,m,v){return ad[f]&&v[m-1]!=="\\"?ad[f](l,c,e):f!=="\\"?f:""}).join("")}},qh=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?ld:n;return function(o,s,l,u){if(!(o!==0&&!o)){var p=u||r,c,f=o;if(o instanceof Date)c=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)c=new Date(o);else if(typeof o=="string"){var m=s||(e||da).dateFormat,v=String(o).trim();if(v==="today")c=new Date,l=!0;else if(e&&e.parseDate)c=e.parseDate(o,m);else if(/Z$/.test(v)||/GMT$/.test(v))c=new Date(o);else{for(var _=void 0,C=[],x=0,w=0,E="";x<m.length;x++){var I=m[x],k=I==="\\",F=m[x-1]==="\\"||k;if(Al[I]&&!F){E+=Al[I];var N=new RegExp(E).exec(o);N&&(_=!0)&&C[I!=="Y"?"push":"unshift"]({fn:eb[I],val:N[++w]})}else k||(E+=".")}c=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),C.forEach(function(V){var Q=V.fn,L=V.val;return c=Q(c,L,p)||c}),c=_?c:void 0}}if(!(c instanceof Date&&!isNaN(c.getTime()))){e.errorHandler(new Error("Invalid date provided: "+f));return}return l===!0&&c.setHours(0,0,0,0),c}}};function Qr(a,t,e){return e===void 0&&(e=!0),e!==!1?new Date(a.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):a.getTime()-t.getTime()}var tb=function(a,t,e){return a>Math.min(t,e)&&a<Math.max(t,e)},Kh=function(a,t,e){return a*3600+t*60+e},ib=function(a){var t=Math.floor(a/3600),e=(a-t*3600)/60;return[t,e,a-t*3600-e*60]},nb={DAY:864e5};function Zh(a){var t=a.defaultHour,e=a.defaultMinute,n=a.defaultSeconds;if(a.minDate!==void 0){var r=a.minDate.getHours(),o=a.minDate.getMinutes(),s=a.minDate.getSeconds();t<r&&(t=r),t===r&&e<o&&(e=o),t===r&&e===o&&n<s&&(n=a.minDate.getSeconds())}if(a.maxDate!==void 0){var l=a.maxDate.getHours(),u=a.maxDate.getMinutes();t=Math.min(t,l),t===l&&(e=Math.min(u,e)),t===l&&e===u&&(n=a.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(a){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!a)throw TypeError("Cannot convert undefined or null to object");for(var n=function(l){l&&Object.keys(l).forEach(function(u){return a[u]=l[u]})},r=0,o=t;r<o.length;r++){var s=o[r];n(s)}return a});var pr=globalThis&&globalThis.__assign||function(){return pr=Object.assign||function(a){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},pr.apply(this,arguments)},Xm=globalThis&&globalThis.__spreadArrays||function(){for(var a=0,t=0,e=arguments.length;t<e;t++)a+=arguments[t].length;for(var n=Array(a),r=0,t=0;t<e;t++)for(var o=arguments[t],s=0,l=o.length;s<l;s++,r++)n[r]=o[s];return n},rb=300;function ob(a,t){var e={config:pr(pr({},da),Tn.defaultConfig),l10n:ld};e.parseDate=qh({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=m,e._positionCalendar=ne,e.changeMonth=ae,e.changeYear=Ee,e.clear=he,e.close=Ne,e.onMouseOver=it,e._createElement=Pi,e.createDay=N,e.destroy=ze,e.isEnabled=ve,e.jumpToDate=E,e.updateValue=Kt,e.open=R,e.redraw=Se,e.set=Le,e.setDate=It,e.toggle=at;function n(){e.utils={getDaysInMonth:function(U,Z){return U===void 0&&(U=e.currentMonth),Z===void 0&&(Z=e.currentYear),U===1&&(Z%4===0&&Z%100!==0||Z%400===0)?29:e.l10n.daysInMonth[U]}}}function r(){e.element=e.input=a,e.isOpen=!1,ge(),X(),W(),q(),n(),e.isMobile||F(),w(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&m(e.config.noCalendar?e.latestSelectedDateObj:void 0),Kt(!1)),l();var U=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&U&&ne(),ot("onReady")}function o(){var U;return((U=e.calendarContainer)===null||U===void 0?void 0:U.getRootNode()).activeElement||document.activeElement}function s(U){return U.bind(e)}function l(){var U=e.config;U.weekNumbers===!1&&U.showMonths===1||U.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var Z=(e.days.offsetWidth+1)*U.showMonths;e.daysContainer.style.width=Z+"px",e.calendarContainer.style.width=Z+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function u(U){if(e.selectedDates.length===0){var Z=e.config.minDate===void 0||Qr(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),ce=Zh(e.config);Z.setHours(ce.hours,ce.minutes,ce.seconds,Z.getMilliseconds()),e.selectedDates=[Z],e.latestSelectedDateObj=Z}U!==void 0&&U.type!=="blur"&&Li(U);var we=e._input.value;f(),Kt(),e._input.value!==we&&e._debouncedChange()}function p(U,Z){return U%12+12*mo(Z===e.l10n.amPM[1])}function c(U){switch(U%24){case 0:case 12:return 12;default:return U%12}}function f(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var U=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,Z=(parseInt(e.minuteElement.value,10)||0)%60,ce=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(U=p(U,e.amPM.textContent));var we=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.minDate,!0)===0,st=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var vt=Kh(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ht=Kh(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),wt=Kh(U,Z,ce);if(wt>ht&&wt<vt){var Bt=ib(vt);U=Bt[0],Z=Bt[1],ce=Bt[2]}}else{if(st){var Et=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;U=Math.min(U,Et.getHours()),U===Et.getHours()&&(Z=Math.min(Z,Et.getMinutes())),Z===Et.getMinutes()&&(ce=Math.min(ce,Et.getSeconds()))}if(we){var _t=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;U=Math.max(U,_t.getHours()),U===_t.getHours()&&Z<_t.getMinutes()&&(Z=_t.getMinutes()),Z===_t.getMinutes()&&(ce=Math.max(ce,_t.getSeconds()))}}v(U,Z,ce)}}function m(U){var Z=U||e.latestSelectedDateObj;Z&&Z instanceof Date&&v(Z.getHours(),Z.getMinutes(),Z.getSeconds())}function v(U,Z,ce){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(U%24,Z,ce||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=Nr(e.config.time_24hr?U:(12+U)%12+12*mo(U%12===0)),e.minuteElement.value=Nr(Z),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[mo(U>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Nr(ce)))}function _(U){var Z=Zr(U),ce=parseInt(Z.value)+(U.delta||0);(ce/1e3>1||U.key==="Enter"&&!/[^\d]/.test(ce.toString()))&&Ee(ce)}function C(U,Z,ce,we){if(Z instanceof Array)return Z.forEach(function(st){return C(U,st,ce,we)});if(U instanceof Array)return U.forEach(function(st){return C(st,Z,ce,we)});U.addEventListener(Z,ce,we),e._handlers.push({remove:function(){return U.removeEventListener(Z,ce,we)}})}function x(){ot("onChange")}function w(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(ce){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+ce+"]"),function(we){return C(we,"click",e[ce])})}),e.isMobile){ke();return}var U=$m(et,50);if(e._debouncedChange=$m(x,rb),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(ce){e.config.mode==="range"&&it(Zr(ce))}),C(e._input,"keydown",Ie),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",Ie),!e.config.inline&&!e.config.static&&C(window,"resize",U),window.ontouchstart!==void 0?C(window.document,"touchstart",de):C(window.document,"mousedown",de),C(window.document,"focus",de,{capture:!0}),e.config.clickOpens===!0&&(C(e._input,"focus",e.open),C(e._input,"click",e.open)),e.daysContainer!==void 0&&(C(e.monthNav,"click",Ni),C(e.monthNav,["keyup","increment"],_),C(e.daysContainer,"click",pt)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var Z=function(ce){return Zr(ce).select()};C(e.timeContainer,["increment"],u),C(e.timeContainer,"blur",u,{capture:!0}),C(e.timeContainer,"click",I),C([e.hourElement,e.minuteElement],["focus","click"],Z),e.secondElement!==void 0&&C(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&C(e.amPM,"click",function(ce){u(ce)})}e.config.allowInput&&C(e._input,"blur",lt)}function E(U,Z){var ce=U!==void 0?e.parseDate(U):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),we=e.currentYear,st=e.currentMonth;try{ce!==void 0&&(e.currentYear=ce.getFullYear(),e.currentMonth=ce.getMonth())}catch(vt){vt.message="Invalid date supplied: "+ce,e.config.errorHandler(vt)}Z&&e.currentYear!==we&&(ot("onYearChange"),z()),Z&&(e.currentYear!==we||e.currentMonth!==st)&&ot("onMonthChange"),e.redraw()}function I(U){var Z=Zr(U);~Z.className.indexOf("arrow")&&k(U,Z.classList.contains("arrowUp")?1:-1)}function k(U,Z,ce){var we=U&&Zr(U),st=ce||we&&we.parentNode&&we.parentNode.firstChild,vt=ct("increment");vt.delta=Z,st&&st.dispatchEvent(vt)}function F(){var U=window.document.createDocumentFragment();if(e.calendarContainer=Pi("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(U.appendChild(Ke()),e.innerContainer=Pi("div","flatpickr-innerContainer"),e.config.weekNumbers){var Z=Re(),ce=Z.weekWrapper,we=Z.weekNumbers;e.innerContainer.appendChild(ce),e.weekNumbers=we,e.weekWrapper=ce}e.rContainer=Pi("div","flatpickr-rContainer"),e.rContainer.appendChild(Oe()),e.daysContainer||(e.daysContainer=Pi("div","flatpickr-days"),e.daysContainer.tabIndex=-1),J(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),U.appendChild(e.innerContainer)}e.config.enableTime&&U.appendChild(Pe()),wr(e.calendarContainer,"rangeMode",e.config.mode==="range"),wr(e.calendarContainer,"animate",e.config.animate===!0),wr(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(U);var st=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!st&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var vt=Pi("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(vt,e.element),vt.appendChild(e.element),e.altInput&&vt.appendChild(e.altInput),vt.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function N(U,Z,ce,we){var st=ve(Z,!0),vt=Pi("span",U,Z.getDate().toString());return vt.dateObj=Z,vt.$i=we,vt.setAttribute("aria-label",e.formatDate(Z,e.config.ariaDateFormat)),U.indexOf("hidden")===-1&&Qr(Z,e.now)===0&&(e.todayDateElem=vt,vt.classList.add("today"),vt.setAttribute("aria-current","date")),st?(vt.tabIndex=-1,Rt(Z)&&(vt.classList.add("selected"),e.selectedDateElem=vt,e.config.mode==="range"&&(wr(vt,"startRange",e.selectedDates[0]&&Qr(Z,e.selectedDates[0],!0)===0),wr(vt,"endRange",e.selectedDates[1]&&Qr(Z,e.selectedDates[1],!0)===0),U==="nextMonthDay"&&vt.classList.add("inRange")))):vt.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Ht(Z)&&!Rt(Z)&&vt.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&U!=="prevMonthDay"&&we%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(Z)+"</span>"),ot("onDayCreate",vt),vt}function V(U){U.focus(),e.config.mode==="range"&&it(U)}function Q(U){for(var Z=U>0?0:e.config.showMonths-1,ce=U>0?e.config.showMonths:-1,we=Z;we!=ce;we+=U)for(var st=e.daysContainer.children[we],vt=U>0?0:st.children.length-1,ht=U>0?st.children.length:-1,wt=vt;wt!=ht;wt+=U){var Bt=st.children[wt];if(Bt.className.indexOf("hidden")===-1&&ve(Bt.dateObj))return Bt}}function L(U,Z){for(var ce=U.className.indexOf("Month")===-1?U.dateObj.getMonth():e.currentMonth,we=Z>0?e.config.showMonths:-1,st=Z>0?1:-1,vt=ce-e.currentMonth;vt!=we;vt+=st)for(var ht=e.daysContainer.children[vt],wt=ce-e.currentMonth===vt?U.$i+Z:Z<0?ht.children.length-1:0,Bt=ht.children.length,Et=wt;Et>=0&&Et<Bt&&Et!=(Z>0?Bt:-1);Et+=st){var _t=ht.children[Et];if(_t.className.indexOf("hidden")===-1&&ve(_t.dateObj)&&Math.abs(U.$i-Et)>=Math.abs(Z))return V(_t)}e.changeMonth(st),se(Q(st),0)}function se(U,Z){var ce=o(),we=He(ce||document.body),st=U!==void 0?U:we?ce:e.selectedDateElem!==void 0&&He(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&He(e.todayDateElem)?e.todayDateElem:Q(Z>0?1:-1);st===void 0?e._input.focus():we?L(st,Z):V(st)}function Ce(U,Z){for(var ce=(new Date(U,Z,1).getDay()-e.l10n.firstDayOfWeek+7)%7,we=e.utils.getDaysInMonth((Z-1+12)%12,U),st=e.utils.getDaysInMonth(Z,U),vt=window.document.createDocumentFragment(),ht=e.config.showMonths>1,wt=ht?"prevMonthDay hidden":"prevMonthDay",Bt=ht?"nextMonthDay hidden":"nextMonthDay",Et=we+1-ce,_t=0;Et<=we;Et++,_t++)vt.appendChild(N("flatpickr-day "+wt,new Date(U,Z-1,Et),Et,_t));for(Et=1;Et<=st;Et++,_t++)vt.appendChild(N("flatpickr-day",new Date(U,Z,Et),Et,_t));for(var Zt=st+1;Zt<=42-ce&&(e.config.showMonths===1||_t%7!==0);Zt++,_t++)vt.appendChild(N("flatpickr-day "+Bt,new Date(U,Z+1,Zt%st),Zt,_t));var Ii=Pi("div","dayContainer");return Ii.appendChild(vt),Ii}function J(){if(e.daysContainer!==void 0){xu(e.daysContainer),e.weekNumbers&&xu(e.weekNumbers);for(var U=document.createDocumentFragment(),Z=0;Z<e.config.showMonths;Z++){var ce=new Date(e.currentYear,e.currentMonth,1);ce.setMonth(e.currentMonth+Z),U.appendChild(Ce(ce.getFullYear(),ce.getMonth()))}e.daysContainer.appendChild(U),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&it()}}function z(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var U=function(we){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&we<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&we>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var Z=0;Z<12;Z++)if(U(Z)){var ce=Pi("option","flatpickr-monthDropdown-month");ce.value=new Date(e.currentYear,Z).getMonth().toString(),ce.textContent=Ou(Z,e.config.shorthandCurrentMonth,e.l10n),ce.tabIndex=-1,e.currentMonth===Z&&(ce.selected=!0),e.monthsDropdownContainer.appendChild(ce)}}}function P(){var U=Pi("div","flatpickr-month"),Z=window.document.createDocumentFragment(),ce;e.config.showMonths>1||e.config.monthSelectorType==="static"?ce=Pi("span","cur-month"):(e.monthsDropdownContainer=Pi("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),C(e.monthsDropdownContainer,"change",function(ht){var wt=Zr(ht),Bt=parseInt(wt.value,10);e.changeMonth(Bt-e.currentMonth),ot("onMonthChange")}),z(),ce=e.monthsDropdownContainer);var we=Tu("cur-year",{tabindex:"-1"}),st=we.getElementsByTagName("input")[0];st.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&st.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(st.setAttribute("max",e.config.maxDate.getFullYear().toString()),st.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var vt=Pi("div","flatpickr-current-month");return vt.appendChild(ce),vt.appendChild(we),Z.appendChild(vt),U.appendChild(Z),{container:U,yearElement:st,monthElement:ce}}function le(){xu(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var U=e.config.showMonths;U--;){var Z=P();e.yearElements.push(Z.yearElement),e.monthElements.push(Z.monthElement),e.monthNav.appendChild(Z.container)}e.monthNav.appendChild(e.nextMonthNav)}function Ke(){return e.monthNav=Pi("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Pi("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Pi("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,le(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(U){e.__hidePrevMonthArrow!==U&&(wr(e.prevMonthNav,"flatpickr-disabled",U),e.__hidePrevMonthArrow=U)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(U){e.__hideNextMonthArrow!==U&&(wr(e.nextMonthNav,"flatpickr-disabled",U),e.__hideNextMonthArrow=U)}}),e.currentYearElement=e.yearElements[0],Tt(),e.monthNav}function Pe(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var U=Zh(e.config);e.timeContainer=Pi("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var Z=Pi("span","flatpickr-time-separator",":"),ce=Tu("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=ce.getElementsByTagName("input")[0];var we=Tu("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=we.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?U.hours:c(U.hours)),e.minuteElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():U.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(ce),e.timeContainer.appendChild(Z),e.timeContainer.appendChild(we),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var st=Tu("flatpickr-second");e.secondElement=st.getElementsByTagName("input")[0],e.secondElement.value=Nr(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():U.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Pi("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(st)}return e.config.time_24hr||(e.amPM=Pi("span","flatpickr-am-pm",e.l10n.amPM[mo((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function Oe(){e.weekdayContainer?xu(e.weekdayContainer):e.weekdayContainer=Pi("div","flatpickr-weekdays");for(var U=e.config.showMonths;U--;){var Z=Pi("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(Z)}return ye(),e.weekdayContainer}function ye(){if(e.weekdayContainer){var U=e.l10n.firstDayOfWeek,Z=Xm(e.l10n.weekdays.shorthand);U>0&&U<Z.length&&(Z=Xm(Z.splice(U,Z.length),Z.splice(0,U)));for(var ce=e.config.showMonths;ce--;)e.weekdayContainer.children[ce].innerHTML=`
19
19
  <span class='flatpickr-weekday'>
20
20
  `+Z.join("</span><span class='flatpickr-weekday'>")+`
21
21
  </span>
@@ -48,7 +48,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48
48
  `]}initSelected(a=!1){var e,n;let t=0;for(let r of this.data||[])if(r.type==="optgroup"){let o=r.children.filter(s=>s&&s.selected&&!s.disabled&&s.visible).length;r.children.length&&(r.selected=!this.options.single&&o&&o===r.children.filter(s=>s&&!s.disabled&&s.visible&&!s.divider).length),t+=o}else t+=r.selected&&!r.disabled&&r.visible?1:0;this.allSelected=((e=this.data)==null?void 0:e.filter(r=>r.selected&&!r.disabled&&r.visible).length)===((n=this.data)==null?void 0:n.filter(r=>!r.disabled&&r.visible&&!r.divider).length),a||(this.allSelected?this.options.onCheckAll():t===0&&this.options.onUncheckAll())}initView(){let a;window.getComputedStyle?(a=window.getComputedStyle(this.elm).width,a==="auto"&&(a=ku(this.dropElm,"outer","width")+20)):a=ku(this.elm,"outer","width")+20,this.parentElm.style.width=`${this.options.width||a}px`,this.elm.classList.add("ms-offscreen")}events(){this._bindEventService.unbind(this.okButtonElm),this._bindEventService.unbind(this.searchInputElm),this._bindEventService.unbind(this.selectAllElm),this._bindEventService.unbind(this.selectGroupElms),this._bindEventService.unbind(this.selectItemElms),this._bindEventService.unbind(this.disableItemElms),this._bindEventService.unbind(this.noResultsElm),this.searchInputElm=this.dropElm.querySelector(".ms-search input"),this.selectAllElm=this.dropElm.querySelector(`input[${this.selectAllName}]`),this.selectGroupElms=this.dropElm.querySelectorAll(`input[${this.selectGroupName}],span[${this.selectGroupName}]`),this.selectItemElms=this.dropElm.querySelectorAll(`input[${this.selectItemName}]:enabled`),this.disableItemElms=this.dropElm.querySelectorAll(`input[${this.selectItemName}]:disabled`),this.noResultsElm=this.dropElm.querySelector(".ms-no-results");let a=t=>{t.preventDefault(),!t.target.classList.contains("icon-close")&&this[this.options.isOpen?"close":"open"]()};this.labelElm&&this._bindEventService.bind(this.labelElm,"click",t=>{t.target.nodeName.toLowerCase()==="label"&&(a(t),(!this.options.filter||!this.options.isOpen)&&this.focus(),t.stopPropagation())}),this._bindEventService.bind(this.choiceElm,"click",a),this.options.onFocus&&this._bindEventService.bind(this.choiceElm,"focus",this.options.onFocus),this.options.onBlur&&this._bindEventService.bind(this.choiceElm,"blur",this.options.onBlur),this._bindEventService.bind(this.parentElm,"keydown",t=>{t.code==="Escape"&&!this.options.keepOpen&&(this.close(),this.choiceElm.focus())}),this.closeElm&&this._bindEventService.bind(this.closeElm,"click",t=>{t.preventDefault(),this._checkAll(!1,!0),this.initSelected(!1),this.updateSelected(),this.update(),this.options.onClear()}),this.searchInputElm&&(this._bindEventService.bind(this.searchInputElm,"keydown",t=>{t.code==="Tab"&&t.shiftKey&&this.close()}),this._bindEventService.bind(this.searchInputElm,"keyup",t=>{var e,n,r;if(this.options.filterAcceptOnEnter&&["Enter","Space"].includes(t.code)&&((e=this.searchInputElm)!=null&&e.value)){if(this.options.single){let o=[];if((n=this.selectItemElms)==null||n.forEach(s=>{var l;((l=s.closest("li"))==null?void 0:l.style.display)!=="none"&&o.push(s)}),o.length){let[s]=this.selectItemName.split("=");o[0].hasAttribute(s)&&this.setSelects([o[0].value])}}else(r=this.selectAllElm)==null||r.click();this.close(),this.focus();return}this.filter()})),this.selectAllElm&&(this._bindEventService.unbind(this.selectAllElm,"click"),this._bindEventService.bind(this.selectAllElm,"click",t=>{var e;this._checkAll((e=t.currentTarget)==null?void 0:e.checked)})),this.okButtonElm&&(this._bindEventService.unbind(this.okButtonElm,"click"),this._bindEventService.bind(this.okButtonElm,"click",t=>{a(t),t.stopPropagation()})),this._bindEventService.bind(this.selectGroupElms,"click",t=>{let e=t.currentTarget,n=e.checked,r=Iu(this.data,"_key",e.dataset.key);this._checkGroup(r,n),this.options.onOptgroupClick(sf({label:r.label,selected:r.selected,data:r._data,children:r.children.map(o=>{if(o)return sf({text:o.text,value:o.value,selected:o.selected,disabled:o.disabled,data:o._data})})}))}),this._bindEventService.bind(this.selectItemElms,"click",t=>{let e=t.currentTarget,n=e.checked,r=Iu(this.data,"_key",e.dataset.key);this._check(r,n),this.options.onClick(sf({text:r.text,value:r.value,selected:r.selected,data:r._data})),this.options.single&&this.options.isOpen&&!this.options.keepOpen&&this.close()})}open(a=0){if(a!==null&&a>=0){let t;clearTimeout(t),t=setTimeout(()=>this.openDrop(),a)}else this.openDrop()}openDrop(){var r,o,s,l,u,p,c;if((r=this.choiceElm)!=null&&r.classList.contains("disabled"))return;if(this.options.isOpen=!0,this.parentElm.classList.add("ms-parent-open"),(s=(o=this.choiceElm)==null?void 0:o.querySelector("div"))==null||s.classList.add("open"),this.dropElm.style.display="block",(l=this.selectAllElm)!=null&&l.parentElement&&(this.selectAllElm.parentElement.style.display="block"),this.noResultsElm&&(this.noResultsElm.style.display="none"),(u=this.data)!=null&&u.length||((p=this.selectAllElm)!=null&&p.parentElement&&(this.selectAllElm.parentElement.style.display="none"),this.noResultsElm&&(this.noResultsElm.style.display="block")),this.options.container){let f=rf(this.dropElm),m;this.options.container instanceof Node?m=this.options.container:typeof this.options.container=="string"&&(m=this.options.container==="body"?document.body:document.querySelector(this.options.container)),m.appendChild(this.dropElm),this.dropElm.style.top=`${(f==null?void 0:f.top)??0}px`,this.dropElm.style.left=`${(f==null?void 0:f.left)??0}px`,this.dropElm.style.minWidth="auto",this.dropElm.style.width=`${ku(this.parentElm,"outer","width")}px`}let a=this.options.minHeight,t=this.options.maxHeight;if(this.options.maxHeightUnit==="row"){let f=this.dropElm.querySelector("ul>li");t=ku(f,"outer","height")*this.options.maxHeight}let e=this.dropElm.querySelector("ul");e&&(a&&(e.style.minHeight=`${a}px`),e.style.maxHeight=`${t}px`),this.dropElm.querySelectorAll(".multiple").forEach(f=>f.style.width=`${this.options.multipleWidth}px`),(c=this.data)!=null&&c.length&&this.options.filter&&(this.searchInputElm&&(this.searchInputElm.value="",this.searchInputElm.focus()),this.filter(!0)),this.options.autoAdjustDropWidthByTextSize&&this.adjustDropWidthByText();let n=this.options.position;if(this.options.autoAdjustDropHeight){if(this.options.autoAdjustDropPosition){let{bottom:f,top:m}=nf(this.dropElm),v=this.dropElm.getBoundingClientRect().height;n=f<v&&m>f?"top":"bottom"}this.adjustDropHeight(n)}this.options.autoAdjustDropPosition&&this.adjustDropPosition(!0),this.options.onOpen()}close(){var a,t;this.options.isOpen=!1,this.parentElm.classList.remove("ms-parent-open"),(t=(a=this.choiceElm)==null?void 0:a.querySelector("div"))==null||t.classList.remove("open"),this.dropElm.style.display="none",this.options.container&&(this.parentElm.appendChild(this.dropElm),this.dropElm.style.top="auto",this.dropElm.style.left="auto"),this.options.onClose()}update(a=!1){var u;let t=this.getSelects(),e=this.getSelects("text");this.options.displayValues&&(e=t);let n=(u=this.choiceElm)==null?void 0:u.querySelector("span"),r=t.length,o=null,s=()=>{if(this.options.useSelectOptionLabel||this.options.useSelectOptionLabelToHtml){let p=t.join(this.options.displayDelimiter);return this.options.useSelectOptionLabelToHtml?Ab(p):p}return e.join(this.options.displayDelimiter)};if(n){if(r===0){let p=this.options.placeholder||"";n.classList.add("ms-placeholder"),n.innerHTML=this.options.sanitizer?this.options.sanitizer(p):p}else r<this.options.minimumCountSelected?o=s():this.formatAllSelected()&&r===this.dataTotal?o=this.formatAllSelected():this.options.ellipsis&&r>this.options.minimumCountSelected?o=`${e.slice(0,this.options.minimumCountSelected).join(this.options.displayDelimiter)}...`:this.formatCountSelected(r,this.dataTotal)&&r>this.options.minimumCountSelected?o=this.formatCountSelected(r,this.dataTotal):o=s();if(o!==null&&(n==null||n.classList.remove("ms-placeholder"),this.options.renderOptionLabelAsHtml||this.options.useSelectOptionLabelToHtml?n.innerHTML=this.options.sanitizer?this.options.sanitizer(o):o:n.textContent=o),this.options.displayTitle||this.options.addTitle){this.options.addTitle&&console.warn("[Multiple-Select-Vanilla] Please note that the `addTitle` option was replaced with `displayTitle`.");let p=this.options.useSelectOptionLabel||this.options.useSelectOptionLabelToHtml?"value":"text";n.title=this.getSelects(p).join(this.options.displayDelimiter)}}let l=this.getSelects().join("");if(this.options.single)this.elm.value=l;else{let p=this.elm.options;for(let c=0,f=p.length;c<f;c++){let m=l.indexOf(p[c].value)>=0;p[c].selected=m}}a||this.elm.dispatchEvent(new Event("change"))}updateSelected(){var t;for(let e=this.updateDataStart;e<this.updateDataEnd;e++){let n=this.updateData[e],r=this.dropElm.querySelector(`input[data-key=${n._key}]`);if(r){r.checked=n.selected;let o=r.closest("li");o&&(n.selected&&!o.classList.contains("selected")?o.classList.add("selected"):n.selected||o.classList.remove("selected"))}}let a=((t=this.data)==null?void 0:t.filter(e=>e.visible).length)===0;this.selectAllElm&&(this.selectAllElm.checked=this.allSelected,nv(this.selectAllElm.closest("li"),!a)),nv(this.noResultsElm,a),this.virtualScroll&&(this.virtualScroll.rows=this.getListRows())}getData(){return this.options.data}getOptions(a=!0){let t=Object.assign({},this.options);return delete t.data,a?of(t):this.options}refreshOptions(a){Tb(this.options,a,!0)||(this.options=Object.assign(this.options,a),this.destroy(!1),this.init())}getDropElement(){return this.dropElm}getParentElement(){return this.parentElm}getSelects(a="value"){let t=[];for(let e of this.data||[])if(e.type==="optgroup"){let n=e.children.filter(r=>r==null?void 0:r.selected);if(!n.length)continue;if(a==="value"||this.options.single)t.push(...n.map(r=>a==="value"&&r._value||r[a]));else{let r=[];r.push("["),r.push(e.label),r.push(`: ${n.map(o=>o[a]).join(", ")}`),r.push("]"),t.push(r.join(""))}}else e.selected&&t.push(a==="value"&&e._value||e[a]);return t}setSelects(a,t="value",e=!1){let n=!1,r=o=>{var s;for(let l of o){let u=!1;if(t==="text"){let p=document.createElement("div");p.innerHTML=l.text,u=a.includes(((s=p.textContent)==null?void 0:s.trim())??"")}else u=a.includes(l._value||l.value),!u&&l.value===`${+l.value}`&&(u=a.includes(+l.value));l.selected!==u&&(n=!0),l.selected=u}};for(let o of this.data||[])o.type==="optgroup"?r(o.children):r([o]);n&&(this.initSelected(e),this.updateSelected(),this.update(e))}enable(){var a;(a=this.choiceElm)==null||a.classList.remove("disabled")}disable(){var a;(a=this.choiceElm)==null||a.classList.add("disabled")}check(a){let t=Iu(this.data,"value",a);t&&this._check(t,!0)}uncheck(a){let t=Iu(this.data,"value",a);t&&this._check(t,!1)}_check(a,t){this.options.single&&this._checkAll(!1,!0),a.selected=t,this.initSelected(),this.updateSelected(),this.update()}checkAll(){this._checkAll(!0)}uncheckAll(){this._checkAll(!1)}_checkAll(a,t){for(let e of this.data||[])e.type==="optgroup"?this._checkGroup(e,a,!0):!e.disabled&&!e.divider&&(t||e.visible)&&(e.selected=a);t||(this.initSelected(),this.updateSelected(),this.update())}_checkGroup(a,t,e){a.selected=t,a.children.forEach(n=>{n&&!n.disabled&&!n.divider&&(e||n.visible)&&(n.selected=t)}),e||(this.initSelected(),this.updateSelected(),this.update())}checkInvert(){if(!this.options.single){for(let a of this.data||[])if(a.type==="optgroup")for(let t of a.children)t&&(t.divider||(t.selected=!t.selected));else a&&!a.divider&&(a.selected=!a.selected);this.initSelected(),this.updateSelected(),this.update()}}focus(){var a;(a=this.choiceElm)==null||a.focus(),this.options.onFocus()}blur(){var a;(a=this.choiceElm)==null||a.blur(),this.options.onBlur()}refresh(){this.destroy(!1),this.init()}filter(a){var n;let t=((n=this.searchInputElm)==null?void 0:n.value.trim())??"",e=t.toLowerCase();if(this.filterText!==e){this.filterText=e;for(let r of this.data||[])if(r.type==="optgroup")if(this.options.filterGroup){let o=`${(r==null?void 0:r.label)??""}`;if(r!=null){let s=this.options.customFilter({label:ca(o.toLowerCase()),search:ca(e),originalLabel:o,originalSearch:t,row:r});r.visible=s;for(let l of r.children)l&&(l.visible=s)}}else{for(let o of r.children)if(o!=null){let s=`${(o==null?void 0:o.text)??""}`;o.visible=this.options.customFilter({text:ca(s.toLowerCase()),search:ca(e),originalText:s,originalSearch:t,row:o,parent:r})}r.visible=r.children.filter(o=>o==null?void 0:o.visible).length>0}else{let o=`${(r==null?void 0:r.text)??""}`;r.visible=this.options.customFilter({text:ca(o.toLowerCase()),search:ca(e),originalText:o,originalSearch:t,row:r})}this.initListItems(),this.initSelected(a),this.updateSelected(),a||this.options.onFilter(e)}}adjustDropHeight(a){var p,c,f,m;let t=a!=="top",e=((p=this.filterParentElm)==null?void 0:p.getBoundingClientRect().height)??0,n=((c=this.okButtonElm)==null?void 0:c.getBoundingClientRect().height)??0,r=this.options.single?0:((f=this.selectAllParentElm)==null?void 0:f.getBoundingClientRect().height)??0,o=e+n+r+5,{bottom:s,top:l}=nf(this.parentElm),u=this.options.maxHeight;if(t?u=s-o-this.options.adjustedHeightPadding:u=l-o-this.options.adjustedHeightPadding,!this.options.maxHeight||this.options.maxHeight&&u<this.options.maxHeight){let v=(m=this.dropElm)==null?void 0:m.querySelector("ul");return v&&(v.style.maxHeight=`${u}px`),!0}return!1}adjustDropPosition(a){let t="bottom";if(this.dropElm&&this.parentElm){let{bottom:e,top:n}=nf(this.dropElm),{top:r,left:o}=rf(this.parentElm),s=this.dropElm.getBoundingClientRect().height,l=this.dropElm.getBoundingClientRect().width,u=document.body.offsetWidth||window.innerWidth,p=this.parentElm.getBoundingClientRect().width;if(e>s)t="bottom";else if(s>e&&n>e){if(this.options.container){let c=r-s;c<0&&(c=0),(c>0||a)&&(t="top",this.dropElm.style.top=`${c<0?0:c}px`)}else t="top",this.dropElm.classList.add(t);this.dropElm.classList.remove("bottom")}if(u-l<o){let c=o-(l-p);this.dropElm.style.left=`${c}px`}}return t}adjustDropWidthByText(){let a=this.parentElm.scrollWidth;(this.options.dropWidth||this.options.width)&&(a=this.options.dropWidth||this.options.width||0);let t=this.dropElm.querySelector(".ms-select-all span"),e=this.dropElm.querySelector("ul"),n=26,r=(t==null?void 0:t.clientWidth)??0+n,o=e.scrollHeight>e.clientHeight?this.getScrollbarWidth():0,s=0;this.dropElm.querySelectorAll("li label").forEach(l=>{l.scrollWidth>s&&(s=l.scrollWidth)}),s+=n+o,s<r&&(s=r),this.options.maxWidth&&s>this.options.maxWidth&&(s=this.options.maxWidth),this.options.minWidth&&s<this.options.minWidth&&(s=this.options.minWidth),(a==="100%"||+a<s)&&(this.dropElm.style.width=`${s}px`,this.dropElm.style.maxWidth=`${s}px`)}getScrollbarWidth(){var r;let a=document.createElement("div");a.style.visibility="hidden",a.style.width="100px",document.body.appendChild(a);let t=a.offsetWidth;a.style.overflow="scroll";let e=document.createElement("div");e.style.width="100%",a.appendChild(e);let n=e.offsetWidth;return(r=a.parentNode)==null||r.removeChild(a),t-n}formatAllSelected(){return this.options.allSelectedText||this.options.formatAllSelected()}formatCountSelected(a,t){return this.options.countSelectedText?this.options.countSelectedText.replace("#",`${a}`).replace("%",`${t}`):this.options.formatCountSelected(a,t)}formatNoMatchesFound(){return this.options.noMatchesFoundText||this.options.formatNoMatchesFound()}formatOkButton(){return this.options.okButtonText||this.options.formatOkButton()}formatSelectAll(){return this.options.selectAllText||this.options.formatSelectAll()}},ha=function(a,t){return typeof a=="string"?lf(document.querySelectorAll(a),t):a instanceof Node?lf([a],t):lf(a,t)};function lf(a,t){let e=Array.from(a),n=[];for(let r=0;r<e.length;r++){let o=e[r];try{o._multipleSelect!==void 0&&(o._multipleSelect.destroy(),delete o._multipleSelect),o._multipleSelect=new kb(o,t||{}),o._multipleSelect.init();let s=o._multipleSelect.getOptions(!1);s.onHardDestroy=()=>delete o._multipleSelect,s.onAfterHardDestroyed=()=>n[r]=null,n.push(o._multipleSelect)}catch(s){console.error(s)}}return n.length===1?n[0]:n}ha.defaults=Lo.DEFAULTS,ha.locales={...Jm},ha.methods=Lo.METHODS,typeof window<"u"&&(window.multipleSelect=ha);class rv{constructor(t,e,n,r=!0){this.translaterService=t,this.collectionService=e,this.rxjs=n,this._isMultipleSelect=!0,this._collectionLength=0,this._shouldTriggerQuery=!0,this.isFilled=!1,this.enableTranslateLabel=!1,this.subscriptions=[],this._isMultipleSelect=r}get collectionOptions(){var t,e,n;return(n=(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)===null||e===void 0?void 0:e.collectionOptions)!==null&&n!==void 0?n:{}}get columnFilter(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)!==null&&e!==void 0?e:{}}get customStructure(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)===null||e===void 0?void 0:e.customStructure}get gridOptions(){return this.grid&&this.grid.getOptions?this.grid.getOptions():{}}get defaultOperator(){return this.isMultipleSelect?Lt.in:Lt.equal}get isMultipleSelect(){return this._isMultipleSelect}get msInstance(){return this._msInstance}get operator(){var t,e;return(e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator}set operator(t){this.columnFilter&&(this.columnFilter.operator=t)}init(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E,I,k;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.searchTerms=(t.hasOwnProperty("searchTerms")?t.searchTerms:[])||[],this.filterContainerElm=t.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection&&!this.columnFilter.collectionAsync)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") for the MultipleSelect/SingleSelect Filter to work correctly. Also each option should include a value/label pair (or value/labelKey when using Locale). For example:: { filter: model: Filters.multipleSelect, collection: [{ value: true, label: 'True' }, { value: false, label: 'False'}] }`);if(this.enableTranslateLabel=(n=(e=this.columnFilter)===null||e===void 0?void 0:e.enableTranslateLabel)!==null&&n!==void 0?n:!1,this.labelName=(o=(r=this.customStructure)===null||r===void 0?void 0:r.label)!==null&&o!==void 0?o:"label",this.labelPrefixName=(l=(s=this.customStructure)===null||s===void 0?void 0:s.labelPrefix)!==null&&l!==void 0?l:"labelPrefix",this.labelSuffixName=(p=(u=this.customStructure)===null||u===void 0?void 0:u.labelSuffix)!==null&&p!==void 0?p:"labelSuffix",this.optionLabel=(f=(c=this.customStructure)===null||c===void 0?void 0:c.optionLabel)!==null&&f!==void 0?f:"value",this.valueName=(v=(m=this.customStructure)===null||m===void 0?void 0:m.value)!==null&&v!==void 0?v:"value",this.enableTranslateLabel&&(!this.translaterService||typeof this.translaterService.translate!="function"))throw new Error('[select-filter] The Translate Service is required for the Select Filter to work correctly when "enableTranslateLabel" is set.');this._locales=(C=(_=this.gridOptions)===null||_===void 0?void 0:_.locales)!==null&&C!==void 0?C:Xe.locales,this.initMultipleSelectTemplate();let F=((x=this.gridOptions)===null||x===void 0?void 0:x.defaultFilterPlaceholder)||"";!((w=this.columnFilter)===null||w===void 0)&&w.placeholder&&(F=this.columnFilter.placeholder),this.defaultOptions.placeholder=F||"",this._isMultipleSelect&&(!((E=this.columnDef)===null||E===void 0)&&E.filter)&&(this.columnDef.filter.emptySearchTermReturnAllValues=(k=(I=this.columnDef.filter)===null||I===void 0?void 0:I.emptySearchTermReturnAllValues)!==null&&k!==void 0?k:!1);const N=this.columnFilter.collection||[];return this.renderDomElement(N),new Promise(async(V,Q)=>{try{const L=this.columnFilter.collectionAsync;let se;L&&!this.columnFilter.collection?(se=Gm(L,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),V(se)):(se=N,V(N)),(L||this.columnFilter.enableCollectionWatch)&&(await(se??L),this.watchCollectionChanges())}catch(L){Q(L)}})}clear(t=!0){var e,n,r;this._msInstance&&this._collectionLength>0&&(this._msInstance.setSelects([]),(e=this.filterElm)===null||e===void 0||e.classList.remove("filled"),(r=(n=this._msInstance)===null||n===void 0?void 0:n.getParentElement())===null||r===void 0||r.classList.remove("filled"),this.searchTerms=[],this._shouldTriggerQuery=t,this.callback(void 0,{columnDef:this.columnDef,clearFilterTriggered:!0,shouldTriggerQuery:this._shouldTriggerQuery}),this._shouldTriggerQuery=!0)}destroy(){var t,e;(t=this._msInstance)===null||t===void 0||t.destroy(),(e=this.filterElm)===null||e===void 0||e.remove(),Gd(this.subscriptions)}getValues(){var t,e;return(e=(t=this._msInstance)===null||t===void 0?void 0:t.getSelects())!==null&&e!==void 0?e:[]}setValues(t,e){t!==void 0&&this._msInstance&&(t=Array.isArray(t)?t.every(n=>Wd(n))?t.map(String):t:[t],this._msInstance.setSelects(t)),this.updateFilterStyle(this.getValues().length>0),this.operator=e||this.defaultOperator}filterCollection(t){var e;let n=t;if(this.columnFilter&&this.columnFilter.collectionFilterBy){const r=this.columnFilter.collectionFilterBy,o=((e=this.columnFilter.collectionOptions)===null||e===void 0?void 0:e.filterResultAfterEachPass)||null;n=this.collectionService.filterCollection(n,r,o)}return n}sortCollection(t){let e=t;if(this.columnFilter&&this.columnFilter.collectionSortBy){const n=this.columnFilter.collectionSortBy;e=this.collectionService.sortCollection(this.columnDef,e,n,this.enableTranslateLabel)}return e}watchCollectionChanges(){var t;!((t=this.columnFilter)===null||t===void 0)&&t.collection&&(Na(this.columnFilter.collection,e=>{this.renderDomElement(this.columnFilter.collection||e||[])}),Kc(this.columnFilter,"collection",e=>{this.renderDomElement(e||[]),this.columnFilter.collection&&Na(this.columnFilter.collection,n=>{this.renderDomElement(this.columnFilter.collection||n||[])})}))}renderDomElement(t){var e,n,r,o;if(!Array.isArray(t)&&(!((e=this.collectionOptions)===null||e===void 0)&&e.collectionInsideObjectProperty)){const p=this.collectionOptions.collectionInsideObjectProperty;t=_n(t,p||"")}if(!Array.isArray(t))throw new Error('The "collection" passed to the Select Filter is not a valid array.');let s=[];if(t.length>0&&(s=[...t]),!((n=this.collectionOptions)===null||n===void 0)&&n.addBlankEntry&&Array.isArray(s)&&s.length>0&&s[0][this.valueName]!==""&&s.unshift(this.createBlankEntry()),!((r=this.collectionOptions)===null||r===void 0)&&r.addCustomFirstEntry&&Array.isArray(s)&&s.length>0&&s[0][this.valueName]!==this.collectionOptions.addCustomFirstEntry[this.valueName]&&s.unshift(this.collectionOptions.addCustomFirstEntry),!((o=this.collectionOptions)===null||o===void 0)&&o.addCustomLastEntry&&Array.isArray(s)&&s.length>0){const p=s.length-1;s[p][this.valueName]!==this.collectionOptions.addCustomLastEntry[this.valueName]&&s.push(this.collectionOptions.addCustomLastEntry)}let l=s;l=this.filterCollection(l),l=this.sortCollection(l);const u=Kp("filter",l,this.columnDef,this.grid,this.isMultipleSelect,this.translaterService,this.searchTerms||[]);this.isFilled=u.hasFoundSearchTerm,this.createFilterElement(u.selectElement,u.dataCollection),this._collectionLength=l.length}createBlankEntry(){const t={[this.labelName]:"",[this.valueName]:""};return this.labelPrefixName&&(t[this.labelPrefixName]=""),this.labelSuffixName&&(t[this.labelSuffixName]=""),t}createFilterElement(t,e){var n,r;const o=(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"";this.elementName=`filter-${o}`,this.defaultOptions.name=this.elementName,en(this.filterContainerElm),this.filterElm=t,this.filterElm.dataset.columnId=`${o}`,this.updateFilterStyle(this.isFilled),this.filterContainerElm.appendChild(t);const s=this.columnFilter?this.columnFilter.filterOptions:{};this.filterElmOptions={...this.defaultOptions,...s,data:e},this._msInstance=ha(t,this.filterElmOptions)}initMultipleSelectTemplate(){var t,e,n,r,o,s,l,u,p,c,f,m,v,_,C,x;const w=(e=(t=this.gridOptions)===null||t===void 0?void 0:t.enableTranslate)!==null&&e!==void 0?e:!1,I={autoAdjustDropHeight:!0,autoAdjustDropPosition:!0,autoAdjustDropWidthByTextSize:!0,name:`${(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:""}`,container:"body",filter:!1,maxHeight:275,single:!0,useSelectOptionLabelToHtml:(s=(o=this.columnFilter)===null||o===void 0?void 0:o.enableRenderHtml)!==null&&s!==void 0?s:!1,sanitizer:k=>Pn(this.gridOptions,k),onClose:()=>this.onTriggerEvent()};if(this._isMultipleSelect){I.single=!1,I.showOkButton=!0,I.displayTitle=!0;const k=ao(this.gridOptions);I.countSelectedText=w&&(!((l=this.translaterService)===null||l===void 0)&&l.translate)?this.translaterService.translate(`${k}X_OF_Y_SELECTED`):(u=this._locales)===null||u===void 0?void 0:u.TEXT_X_OF_Y_SELECTED,I.allSelectedText=w&&(!((p=this.translaterService)===null||p===void 0)&&p.translate)?this.translaterService.translate(`${k}ALL_SELECTED`):(c=this._locales)===null||c===void 0?void 0:c.TEXT_ALL_SELECTED,I.noMatchesFoundText=w&&(!((f=this.translaterService)===null||f===void 0)&&f.translate)?this.translaterService.translate(`${k}NO_MATCHES_FOUND`):(m=this._locales)===null||m===void 0?void 0:m.TEXT_NO_MATCHES_FOUND,I.okButtonText=w&&(!((v=this.translaterService)===null||v===void 0)&&v.translate)?this.translaterService.translate(`${k}OK`):(_=this._locales)===null||_===void 0?void 0:_.TEXT_OK,I.selectAllText=w&&(!((C=this.translaterService)===null||C===void 0)&&C.translate)?this.translaterService.translate(`${k}SELECT_ALL`):(x=this._locales)===null||x===void 0?void 0:x.TEXT_SELECT_ALL}this.defaultOptions=I}onTriggerEvent(){if(this._msInstance){const t=this.getValues();this.updateFilterStyle(Array.isArray(t)&&t.length>1||t.length===1&&t[0]!==""),this.searchTerms=t,this.callback(void 0,{columnDef:this.columnDef,operator:this.operator,searchTerms:t,shouldTriggerQuery:this._shouldTriggerQuery}),this._shouldTriggerQuery=!0}}updateFilterStyle(t){var e,n,r,o,s,l;t?(this.isFilled=!0,(e=this.filterElm)===null||e===void 0||e.classList.add("filled"),(r=(n=this._msInstance)===null||n===void 0?void 0:n.getParentElement())===null||r===void 0||r.classList.add("filled")):(this.isFilled=!1,(o=this.filterElm)===null||o===void 0||o.classList.remove("filled"),(l=(s=this._msInstance)===null||s===void 0?void 0:s.getParentElement())===null||l===void 0||l.classList.remove("filled"))}}class Ib extends rv{constructor(t,e,n){super(t,e,n,!0),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Db{constructor(t){this.translater=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this._currentValues=[],this.searchTerms=[],this._bindEventService=new Fn}get columnFilter(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)!==null&&e!==void 0?e:{}}get defaultOperator(){return Lt.equal}get gridOptions(){return this.grid&&this.grid.getOptions?this.grid.getOptions():{}}get operator(){var t,e;return(e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator}set operator(t){this.columnFilter&&(this.columnFilter.operator=t)}init(t){if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.searchTerms=(t.hasOwnProperty("searchTerms")?t.searchTerms:[])||[],this.filterContainerElm=t.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection)throw new Error('[Slickgrid-Universal] You need to pass a "collection" for the Native Select Filter to work correctly.');if(this.columnFilter.enableTranslateLabel&&!this.gridOptions.enableTranslate&&(!this.translater||typeof this.translater.translate!="function"))throw new Error('The I18N Service is required for the Native Select Filter to work correctly when "enableTranslateLabel" is set.');let e=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";(typeof e=="boolean"||typeof e=="number")&&(e=`${e??""}`),this.filterElm=this.createFilterElement(e),this._bindEventService.bind(this.filterElm,"change",this.handleOnChange.bind(this))}clear(t=!0){this.filterElm&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[],this._currentValues=[],this.filterElm.value="",this.filterElm.classList.remove("filled"),this.filterElm.dispatchEvent(new Event("change")))}destroy(){var t,e;this._bindEventService.unbindAll(),(e=(t=this.filterElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t)}getValues(){return this._currentValues||[]}setValues(t,e){var n;Array.isArray(t)?(this.filterElm.value=`${(n=t[0])!==null&&n!==void 0?n:""}`,this._currentValues=t):t&&(this.filterElm.value=`${t??""}`,this._currentValues=[t]),this.getValues().length>0?this.filterElm.classList.add("filled"):this.filterElm.classList.remove("filled"),this.operator=e||this.defaultOperator}buildFilterSelectFromCollection(t){var e,n,r,o,s,l,u,p,c,f,m,v;const _=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",C=De("select",{className:`form-control search-filter filter-${_}`,ariaLabel:(o=(r=this.columnFilter)===null||r===void 0?void 0:r.ariaLabel)!==null&&o!==void 0?o:`${jr(_+"")} Search Filter`}),x=(l=(s=this.columnFilter.customStructure)===null||s===void 0?void 0:s.label)!==null&&l!==void 0?l:"label",w=(p=(u=this.columnFilter.customStructure)===null||u===void 0?void 0:u.value)!==null&&p!==void 0?p:"value",E=(f=(c=this.columnFilter)===null||c===void 0?void 0:c.enableTranslateLabel)!==null&&f!==void 0?f:!1;if(t.every(I=>typeof I=="string"))for(const I of t)C.appendChild(De("option",{value:I,label:I,textContent:I}));else for(const I of t){if(!I||I[x]===void 0&&I.labelKey===void 0)throw new Error("A collection with value/label (or value/labelKey when using Locale) is required to populate the Native Select Filter list, for example:: { filter: model: Filters.select, collection: [ { value: '1', label: 'One' } ]')");const k=I.labelKey||I[x],F=(I.labelKey||E)&&typeof this.translater!==void 0&&(!((v=(m=this.translater).getCurrentLanguage)===null||v===void 0)&&v.call(m))?this.translater.translate(k||" "):k;C.appendChild(De("option",{value:I[w],textContent:F}))}return C}createFilterElement(t){var e,n,r,o;const s=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"";en(this.filterContainerElm);const l=t||"",u=(o=(r=this.columnFilter)===null||r===void 0?void 0:r.collection)!==null&&o!==void 0?o:[];if(!Array.isArray(u))throw new Error('The "collection" passed to the Native Select Filter is not a valid array.');const p=this.buildFilterSelectFromCollection(u);return p.value=l,p.dataset.columnid=`${s||""}`,l&&(this._currentValues=[l]),this.filterContainerElm.appendChild(p),p}handleOnChange(t){const e=t&&t.target&&t.target.value||"";this._currentValues=[e],this._clearFilterTriggered?(this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,shouldTriggerQuery:this._shouldTriggerQuery}),this.filterElm.classList.remove("filled")):(e===""?this.filterElm.classList.remove("filled"):this.filterElm.classList.add("filled"),this.callback(t,{columnDef:this.columnDef,operator:this.operator,searchTerms:[e],shouldTriggerQuery:this._shouldTriggerQuery})),this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}}class Rb extends rv{constructor(t,e,n){super(t,e,n,!1),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Fb extends tf{constructor(t){super(t),this.translaterService=t,super.sliderType="single"}}class Pb extends tf{constructor(t){super(t),this.translaterService=t,super.sliderType="double"}}const Du={autocompleter:J0,compoundDate:lb,compoundInput:Zm,compoundInputNumber:ab,compoundInputPassword:db,compoundInputText:Zm,compoundSlider:cb,dateRange:hb,input:Qs,inputMask:fb,inputNumber:pb,inputPassword:mb,inputText:Qs,multipleSelect:Ib,select:Db,singleSelect:Rb,slider:Fb,sliderRange:Pb};class Mb{constructor(t,e,n,r){var o,s;this.config=t,this.translaterService=e,this.collectionService=n,this.rxjs=r,this._options=(s=(o=this.config)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{}}addRxJsResource(t){this.rxjs=t}createFilter(t){let e;return t!=null&&t.model&&(e=typeof t.model=="function"?new t.model(this.translaterService,this.collectionService,this.rxjs):t.model),!e&&this._options.defaultFilter&&(e=new this._options.defaultFilter(this.translaterService,this.collectionService,this.rxjs)),e}}const af={alwaysShowVerticalScroll:!0,autoEdit:!1,asyncEditorLoading:!1,autoFitColumnsOnFirstLoad:!0,autoFixResizeTimeout:5*60*5,autoFixResizeRequiredGoodCount:2,autoFixResizeWhenBrokenStyleDetected:!1,autoParseInputFilterOperator:!0,autoResize:{applyResizeToContainer:!0,calculateAvailableSizeBy:"window",bottomPadding:20,minHeight:180,minWidth:300,rightPadding:0},cellHighlightCssClass:"slick-cell-modified",checkboxSelector:{cssClass:"slick-cell-checkboxsel",width:40},columnGroupSeparator:" - ",columnPicker:{fadeSpeed:0,hideForceFitButton:!1,hideSyncResizeButton:!0,headerColumnValueExtractor:ov},cellMenu:{autoAdjustDrop:!0,autoAlignSide:!0,hideCloseButton:!0,hideCommandSection:!1,hideOptionSection:!1,showBulletWhenIconMissing:!0},compositeEditorOptions:{labels:{cancelButtonKey:"CANCEL",cloneButtonKey:"CLONE",resetEditorButtonTooltipKey:"RESET_INPUT_VALUE",resetFormButtonKey:"RESET_FORM",massSelectionButtonKey:"APPLY_TO_SELECTION",massSelectionStatusKey:"X_OF_Y_MASS_SELECTED",massUpdateButtonKey:"APPLY_MASS_UPDATE",massUpdateStatusKey:"ALL_X_RECORDS_SELECTED",saveButtonKey:"SAVE"}},contextMenu:{autoAdjustDrop:!0,autoAlignSide:!0,hideCloseButton:!0,hideClearAllGrouping:!1,hideCollapseAllGroups:!1,hideCommandSection:!1,hideCopyCellValueCommand:!1,hideExpandAllGroups:!1,hideExportCsvCommand:!1,hideExportExcelCommand:!1,hideExportTextDelimitedCommand:!0,hideMenuOnScroll:!0,hideOptionSection:!1,iconCollapseAllGroupsCommand:"fa fa-compress mdi mdi-arrow-collapse",iconExpandAllGroupsCommand:"fa fa-expand mdi mdi-arrow-expand",iconClearGroupingCommand:"fa fa-times mdi mdi-close",iconCopyCellValueCommand:"fa fa-clone mdi mdi-content-copy",iconExportCsvCommand:"fa fa-download mdi mdi-download",iconExportExcelCommand:"fa fa-file-excel-o mdi mdi-file-excel-outline",iconExportTextDelimitedCommand:"fa fa-download mdi mdi-download",showBulletWhenIconMissing:!0},customFooterOptions:{dateFormat:"YYYY-MM-DD, hh:mm a",hideRowSelectionCount:!1,hideTotalItemCount:!1,hideLastUpdateTimestamp:!0,footerHeight:25,leftContainerClass:"col-xs-12 col-sm-5",rightContainerClass:"col-xs-6 col-sm-7",metricSeparator:"|",metricTexts:{itemsKey:"ITEMS",ofKey:"OF",itemsSelectedKey:"ITEMS_SELECTED"}},customTooltip:{tooltipTextMaxLength:700,maxWidth:500},dataView:{syncGridSelection:{preserveHidden:!1,preserveHiddenOnSelectionChange:!0},syncGridSelectionWithBackendService:!1},datasetIdPropertyName:"id",defaultFilter:Du.input,defaultBackendServiceFilterTypingDebounce:500,enableFilterTrimWhiteSpace:!1,defaultFilterPlaceholder:"🔎︎",defaultFilterRangeOperator:Lt.rangeInclusive,defaultColumnSortFieldId:"id",defaultComponentEventPrefix:"",defaultSlickgridEventPrefix:"",draggableGrouping:{hideToggleAllButton:!1,toggleAllButtonText:"",dropPlaceHolderTextKey:"DROP_COLUMN_HEADER_TO_GROUP_BY"},editable:!1,editorTypingDebounce:450,filterTypingDebounce:0,enableEmptyDataWarningMessage:!0,emptyDataWarning:{className:"slick-empty-data-warning",messageKey:"EMPTY_DATA_WARNING_MESSAGE",hideFrozenLeftWarning:!1,hideFrozenRightWarning:!1,leftViewportMarginLeft:"40%",rightViewportMarginLeft:"40%",frozenLeftViewportMarginLeft:"0px",frozenRightViewportMarginLeft:"40%"},enableAutoResize:!0,enableAutoSizeColumns:!0,enableCellNavigation:!1,enableColumnPicker:!0,enableColumnReorder:!0,enableColumnResizeOnDoubleClick:!0,enableContextMenu:!0,enableExcelExport:!1,enableTextExport:!1,enableGridMenu:!0,enableHeaderMenu:!0,enableMouseHoverHighlightRow:!0,enableSorting:!0,enableTextSelectionOnCells:!0,explicitInitialization:!0,excelExportOptions:{addGroupIndentation:!0,exportWithFormatter:!1,filename:"export",format:dn.xlsx,groupingColumnHeaderTitle:"Group By",groupCollapsedSymbol:"⮞",groupExpandedSymbol:"⮟",groupingAggregatorRowText:"",sanitizeDataExport:!0},textExportOptions:{delimiter:vs.comma,exportWithFormatter:!1,filename:"export",format:dn.csv,groupingColumnHeaderTitle:"Group By",groupingAggregatorRowText:"",sanitizeDataExport:!0,useUtf8WithBom:!0},gridAutosizeColsMode:Vd.none,eventNamingStyle:Do.lowerCase,forceFitColumns:!1,frozenHeaderWidthCalcDifferential:1,gridMenu:{dropSide:"left",commandLabels:{clearAllFiltersCommandKey:"CLEAR_ALL_FILTERS",clearAllSortingCommandKey:"CLEAR_ALL_SORTING",clearFrozenColumnsCommandKey:"CLEAR_PINNING",exportCsvCommandKey:"EXPORT_TO_CSV",exportExcelCommandKey:"EXPORT_TO_EXCEL",exportTextDelimitedCommandKey:"EXPORT_TO_TAB_DELIMITED",refreshDatasetCommandKey:"REFRESH_DATASET",toggleFilterCommandKey:"TOGGLE_FILTER_ROW",togglePreHeaderCommandKey:"TOGGLE_PRE_HEADER_ROW"},hideClearAllFiltersCommand:!1,hideClearAllSortingCommand:!1,hideClearFrozenColumnsCommand:!0,hideExportCsvCommand:!1,hideExportExcelCommand:!1,hideExportTextDelimitedCommand:!0,hideForceFitButton:!1,hideRefreshDatasetCommand:!1,hideSyncResizeButton:!0,hideToggleFilterCommand:!1,hideTogglePreHeaderCommand:!1,iconCssClass:"fa fa-bars mdi mdi-menu",iconClearAllFiltersCommand:"fa fa-filter mdi mdi-filter-remove-outline",iconClearAllSortingCommand:"fa fa-unsorted mdi mdi-swap-vertical",iconClearFrozenColumnsCommand:"fa fa-times mdi mdi-pin-off-outline",iconExportCsvCommand:"fa fa-download mdi mdi-download",iconExportExcelCommand:"fa fa-file-excel-o mdi mdi-file-excel-outline",iconExportTextDelimitedCommand:"fa fa-download mdi mdi-download",iconRefreshDatasetCommand:"fa fa-refresh mdi mdi-sync",iconToggleFilterCommand:"fa fa-random mdi mdi-flip-vertical",iconTogglePreHeaderCommand:"fa fa-random mdi mdi-flip-vertical",menuWidth:16,resizeOnShowHeaderRow:!0,showBulletWhenIconMissing:!0,headerColumnValueExtractor:ov},headerMenu:{autoAlign:!0,autoAlignOffset:4,minWidth:140,iconClearFilterCommand:"fa fa-filter mdi mdi mdi-filter-remove-outline",iconClearSortCommand:"fa fa-unsorted mdi mdi-swap-vertical",iconFreezeColumns:"fa fa-thumb-tack mdi mdi-pin-outline",iconSortAscCommand:"fa fa-sort-amount-asc mdi mdi-flip-v mdi-sort-ascending",iconSortDescCommand:"fa fa-sort-amount-desc mdi mdi-flip-v mdi-sort-descending",iconColumnHideCommand:"fa fa-times mdi mdi-close",iconColumnResizeByContentCommand:"fa fa-arrows-h mdi mdi-arrow-expand-horizontal",hideColumnResizeByContentCommand:!1,hideColumnHideCommand:!1,hideClearFilterCommand:!1,hideClearSortCommand:!1,hideFreezeColumnsCommand:!0,hideSortCommands:!1},ignoreAccentOnStringFilterAndSort:!1,multiColumnSort:!0,numberedMultiColumnSort:!0,tristateMultiColumnSort:!1,sortColNumberInSeparateSpan:!0,suppressActiveCellChangeOnEdit:!1,pagination:{pageSizes:[10,15,20,25,30,40,50,75,100],pageSize:25,totalItems:0},headerRowHeight:35,rowHeight:35,topPanelHeight:30,translationNamespaceSeparator:":",resetFilterSearchValueAfterOnBeforeCancellation:!0,resizeByContentOnlyOnFirstLoad:!0,resizeByContentOptions:{alwaysRecalculateColumnWidth:!1,cellCharWidthInPx:7.8,cellPaddingWidthInPx:14,defaultRatioForStringType:.88,formatterPaddingWidthInPx:0,maxItemToInspectCellContentWidth:1e3,maxItemToInspectSingleColumnWidthByContent:5e3,widthToRemoveFromExceededWidthReadjustment:50},treeDataOptions:{exportIndentMarginLeft:5,exportIndentationLeadingChar:"͏͏͏͏͏͏͏͏͏·"}};function ov(a,t){var e,n;const r=(a==null?void 0:a.columnGroup)||"",o=(e=t==null?void 0:t.columnGroupSeparator)!==null&&e!==void 0?e:" - ";return r?r+o+a.name:(n=a==null?void 0:a.name)!==null&&n!==void 0?n:""}class Nb{constructor(t){this._sum=0,this._type="sum",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._sum=0}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:null;e!==null&&e!==""&&!isNaN(e)&&(this._sum+=parseFloat(e))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=this._sum}}class Lb{constructor(t){this._max=null,this._type="max",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._max=null}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:null;e!==null&&e!==""&&!isNaN(e)&&(this._max===null||e>this._max)&&(this._max=parseFloat(e))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=this._max}}class Hb{constructor(t){this._distinctValues=[],this._type="distinct",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._distinctValues=[]}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:void 0;this._distinctValues.indexOf(e)===-1&&e!==void 0&&this._distinctValues.push(e)}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=this._distinctValues}}class Bb{constructor(t){this._min=null,this._type="min",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._min=null}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:null;e!==null&&e!==""&&!isNaN(e)&&(this._min===null||e<this._min)&&(this._min=parseFloat(e))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=this._min}}class Vb{constructor(t){this._type="count",this._field=t}get field(){return this._field}get type(){return this._type}init(){}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=t.group.rows.length}}class zb{constructor(t){this._type="clone",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._data=""}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:null;e!==null&&e!==""&&(this._data=e)}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),t[this._type][this._field]=this._data}}class Ub{constructor(t){this._nonNullCount=0,this._sum=0,this._type="avg",this._field=t}get field(){return this._field}get type(){return this._type}init(){this._nonNullCount=0,this._sum=0}accumulate(t){const e=t&&t.hasOwnProperty(this._field)?t[this._field]:null;e!==null&&e!==""&&!isNaN(e)&&(this._nonNullCount++,this._sum+=parseFloat(e))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),this._nonNullCount!==0&&(t[this._type][this._field]=this._sum/this._nonNullCount)}}const df={Avg:Ub,Clone:zb,Count:Vb,Distinct:Hb,Min:Bb,Max:Lb,Sum:Nb};function Ru(a,t){var e;const n=t.errorMessage,r=t.required,o=t.minLength,s=t.maxLength,l=t.operatorConditionalType||"inclusive",u={"{{minLength}}":o,"{{maxLength}}":s};let p=!0,c="";const f=(e=a==null?void 0:a.length)!==null&&e!==void 0?e:0;if(t.validator)return t.validator(a,t.editorArgs);if(r&&a==="")p=!1,c=n||Xe.VALIDATION_REQUIRED_FIELD;else if(o!==void 0&&s!==void 0&&(l==="exclusive"&&(f<=o||f>=s)||l==="inclusive"&&(f<o||f>s)))p=!1,c=n||Xe.VALIDATION_EDITOR_TEXT_LENGTH_BETWEEN.replace(/{{minLength}}|{{maxLength}}/gi,m=>u[m]);else if(o!==void 0&&f!==null&&(l==="exclusive"&&f<=o||l==="inclusive"&&f!==null&&f<o)){p=!1;const m=l==="inclusive"?Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE:Xe.VALIDATION_EDITOR_TEXT_MIN_LENGTH;c=n||m.replace(/{{minLength}}/gi,v=>u[v])}else if(s!==void 0&&f!==null&&(l==="exclusive"&&f>=s||l==="inclusive"&&f!==null&&f>s)){p=!1;const m=l==="inclusive"?Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE:Xe.VALIDATION_EDITOR_TEXT_MAX_LENGTH;c=n||m.replace(/{{maxLength}}/gi,v=>u[v])}return{valid:p,msg:c}}function kl(a,t,e,n="Slider"){var r,o,s;let l;return((r=a.editorOptions)===null||r===void 0?void 0:r[t])!==void 0?l=a.editorOptions[t]:((o=a==null?void 0:a.params)===null||o===void 0?void 0:o[t])!==void 0&&(console.warn(`[Slickgrid-Universal] All editor.params from ${n} Editor are moving to "editorOptions" for better typing support and "params" will be deprecated in future release.`),l=(s=a==null?void 0:a.params)===null||s===void 0?void 0:s[t]),l??e}const sv=Xd&&sh||Xd,Gb=3;class Wb{constructor(t){var e;if(this.args=t,this._isValueTouched=!1,this._lastTriggeredByClearInput=!1,this.disabled=!1,this.forceUserInput=!1,this.finalCollection=[],!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this._bindEventService=new Fn,!((e=this.gridOptions)===null||e===void 0)&&e.translater&&(this._translater=this.gridOptions.translater),this._locales=this.gridOptions&&this.gridOptions.locales||Xe.locales,this.init()}get autocompleterOptions(){return this._autocompleterOptions||{}}get collection(){var t,e;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.collection)!==null&&e!==void 0?e:[]}get editorDomElement(){return this._inputElm}get elementCollection(){return this._elementCollection}get columnDef(){return this.args.column}get columnEditor(){var t;return((t=this.columnDef)===null||t===void 0?void 0:t.internalColumnEditor)||{}}get customStructure(){var t,e,n,r,o,s;let l=(t=this.columnEditor)===null||t===void 0?void 0:t.customStructure;const u=(n=(e=this.columnEditor)===null||e===void 0?void 0:e.type)!==null&&n!==void 0?n:(r=this.columnDef)===null||r===void 0?void 0:r.type;return!l&&u===ie.object&&(!((o=this.columnDef)===null||o===void 0)&&o.dataKey)&&(!((s=this.columnDef)===null||s===void 0)&&s.labelKey)&&(l={label:this.columnDef.labelKey,value:this.columnDef.dataKey}),l}get dataContext(){return this.args.item}get editorOptions(){var t;return((t=this.columnEditor)===null||t===void 0?void 0:t.editorOptions)||{}}get gridOptions(){var t,e,n;return(n=(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:{}}get instance(){return this._instance}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l,u,p,c;this.labelName=(e=(t=this.customStructure)===null||t===void 0?void 0:t.label)!==null&&e!==void 0?e:"label",this.valueName=(r=(n=this.customStructure)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:"value",this.labelPrefixName=(s=(o=this.customStructure)===null||o===void 0?void 0:o.labelPrefix)!==null&&s!==void 0?s:"labelPrefix",this.labelSuffixName=(u=(l=this.customStructure)===null||l===void 0?void 0:l.labelSuffix)!==null&&u!==void 0?u:"labelSuffix";let f=this.columnEditor.collection;!((p=this.columnEditor)===null||p===void 0)&&p.collectionAsync&&!f&&(f=[]),this.renderDomElement(f),(this.disabled||!((c=this.columnEditor)===null||c===void 0)&&c.collectionAsync&&Array.isArray(f)&&f.length===0)&&this.disable(!0)}destroy(){var t,e,n;this._bindEventService.unbindAll(),(t=this._instance)===null||t===void 0||t.destroy(),(n=(e=this._inputElm)===null||e===void 0?void 0:e.remove)===null||n===void 0||n.call(e),this._elementCollection=null}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._inputElm)if(t){this._inputElm.disabled=!0;const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==""&&this.clear(!0)}else this._inputElm.disabled=!1}focus(){this.grid.focus(),this._inputElm&&(this._inputElm.focus(),this._inputElm.select())}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValue(){return this._inputElm.value}setValue(t,e=!1,n=!0){var r;if(this._inputElm.value=t!=null&&t.hasOwnProperty(this.labelName)?t[this.labelName]:t,e){this._currentValue=t,this._defaultTextValue=typeof t=="string"?t:(r=t==null?void 0:t[this.labelName])!==null&&r!==void 0?r:"",this.applyValue(this.args.item,this.serializeValue());const o=this.args.compositeEditorOptions;o&&n&&this.handleChangeOnCompositeEditor(null,o,"system")}}applyValue(t,e){var n,r,o,s;let l=e;const u=(n=this.columnDef)===null||n===void 0?void 0:n.field;if(u!==void 0){Array.isArray(this.collection)&&this.collection.length>0&&(l=bs(this.collection,f=>f&&Ko(e)&&f.hasOwnProperty(this.valueName)?f[this.valueName].toString()===(e.hasOwnProperty(this.valueName)&&e[this.valueName].toString()):f&&typeof e=="string"&&f.hasOwnProperty(this.valueName)?f[this.valueName].toString()===e:(f==null?void 0:f.toString())===e,""));const p=(u==null?void 0:u.indexOf("."))>0,c=this.validate(null,l);if(l=c!=null&&c.valid?l:"",p){const f=(s=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.complexObjectPath)!==null&&o!==void 0?o:u)!==null&&s!==void 0?s:"";cr(t,f,l)}else t[u]=l}}isValueChanged(){var t,e;const n=this._inputElm.value,r=(t=this._lastInputKeyEvent)===null||t===void 0?void 0:t.keyCode;if(!((e=this.columnEditor)===null||e===void 0)&&e.alwaysSaveOnEnterKey&&r===li.ENTER)return!0;const o=!(n===""&&(this._defaultTextValue===null||this._defaultTextValue===void 0))&&n!==this._defaultTextValue;return this._lastTriggeredByClearInput||o}isValueTouched(){return this._isValueTouched}loadValue(t){var e,n;const r=(e=this.columnDef)===null||e===void 0?void 0:e.field;if(t&&r!==void 0){const s=(r==null?void 0:r.indexOf("."))>0?_n(t,r):t[r];this._currentValue=s,this._originalValue=s,this._defaultTextValue=typeof s=="string"?s:(n=s==null?void 0:s[this.labelName])!==null&&n!==void 0?n:"",this._inputElm.value=this._defaultTextValue,this._inputElm.select()}}clear(t=!1){this._inputElm&&(this._currentValue="",this._defaultTextValue="",this.setValue("",!0)),this._isValueTouched=!0,this._lastTriggeredByClearInput=!0;const e=this.args.compositeEditorOptions;if(e){const n=!t;this.handleChangeOnCompositeEditor(null,e,"user",n)}else this.save()}reset(t,e=!0,n=!1){var r,o;const s=(r=t??this._originalValue)!==null&&r!==void 0?r:"";this._inputElm&&(this._currentValue=s,this._defaultTextValue=typeof s=="string"?s:(o=s==null?void 0:s[this.labelName])!==null&&o!==void 0?o:"",this._inputElm.value=this._defaultTextValue),this._isValueTouched=!1;const l=this.args.compositeEditorOptions;if(l&&e){const u=!n;this.handleChangeOnCompositeEditor(null,l,"user",u)}}save(){var t;const e=this.validate(),n=(t=e==null?void 0:e.valid)!==null&&t!==void 0?t:!1;this.hasAutoCommitEdit&&n?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t,e,n,r,o,s;if(this._inputElm&&this.editorOptions.forceUserInput){const l=(e=(t=this.editorOptions)===null||t===void 0?void 0:t.minLength)!==null&&e!==void 0?e:Gb;this._currentValue=this._inputElm.value.length>l?this._inputElm.value:this._currentValue}return this.customStructure&&this._currentValue&&this._currentValue.hasOwnProperty(this.valueName)&&((n=this.columnDef)===null||n===void 0?void 0:n.type)!==ie.object&&((r=this.columnEditor)===null||r===void 0?void 0:r.type)!==ie.object?this._currentValue[this.valueName]:this._currentValue&&this._currentValue.value!==void 0?((o=this.columnDef)===null||o===void 0?void 0:o.type)===ie.object||((s=this.columnEditor)===null||s===void 0?void 0:s.type)===ie.object?{[this.labelName]:this._currentValue.label,[this.valueName]:this._currentValue.value}:this._currentValue.value:this._currentValue}validate(t,e){var n,r;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const o=e!==void 0?e:(n=this._inputElm)===null||n===void 0?void 0:n.value;return Ru(o,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minLength:this.columnEditor.minLength,maxLength:this.columnEditor.maxLength,operatorConditionalType:this.columnEditor.operatorConditionalType,required:!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}handleSelect(t){var e,n;if(t!==void 0){const o=t;this._currentValue=o,this._isValueTouched=!0;const s=this.args.compositeEditorOptions,l=(n=(e=this.editorOptions)===null||e===void 0?void 0:e.renderItem)!==null&&n!==void 0?n:!1,u=typeof o=="string"?o:l?o[this.labelName]:o.label;if(this.setValue(u),s?this.handleChangeOnCompositeEditor(null,s):this.save(),typeof this.editorOptions.onSelectItem=="function"){const{row:p,cell:c}=this.grid.getActiveCell();this.editorOptions.onSelectItem(t,p,c,this.args.column,this.args.item)}setTimeout(()=>this._lastTriggeredByClearInput=!1)}return!1}renderRegularItem(t){var e;const n=typeof t=="string"?t:(e=t==null?void 0:t.label)!==null&&e!==void 0?e:"";return De("div",{textContent:n||""})}renderCustomItem(t){var e,n,r;const o=(r=(n=(e=this._autocompleterOptions)===null||e===void 0?void 0:e.renderItem)===null||n===void 0?void 0:n.templateCallback(t))!==null&&r!==void 0?r:"",s=Pn(this.gridOptions,o)||"";return De("div",{innerHTML:s})}renderCollectionItem(t){var e,n;const r=(n=(e=this.columnEditor)===null||e===void 0?void 0:e.enableRenderHtml)!==null&&n!==void 0?n:!1,o=t.labelPrefix||"",s=t.label||"",l=t.labelSuffix||"",u=o+s+l,p=Pn(this.gridOptions,u)||"",c=document.createElement("div");return c[r?"innerHTML":"textContent"]=p,c}renderDomElement(t){var e,n,r,o,s,l,u,p,c,f,m,v,_,C,x,w;const E=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",I=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.placeholder)!==null&&o!==void 0?o:"",k=(l=(s=this.columnEditor)===null||s===void 0?void 0:s.title)!==null&&l!==void 0?l:"";this._editorInputGroupElm=De("div",{className:"autocomplete-container input-group"});const F=De("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=De("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=De("input",{type:"text",placeholder:I,title:k,autocomplete:"none",className:`autocomplete form-control editor-text input-group-editor editor-${E}`,dataset:{input:""}},this._editorInputGroupElm),this._editorInputGroupElm.appendChild(document.createElement("span")),kl(this.columnEditor,"hideClearButton",void 0,"autocomplete")||(F.appendChild(this._clearButtonElm),this._editorInputGroupElm.appendChild(F),this._bindEventService.bind(this._clearButtonElm,"click",()=>this.clear())),this._bindEventService.bind(this._inputElm,"focus",()=>{var V;return(V=this._inputElm)===null||V===void 0?void 0:V.select()}),this._bindEventService.bind(this._inputElm,"keydown",V=>{this._lastInputKeyEvent=V,(V.keyCode===li.LEFT||V.keyCode===li.RIGHT||V.key==="ArrowLeft"||V.key==="ArrowRight")&&V.stopImmediatePropagation(),this.columnEditor.alwaysSaveOnEnterKey&&(V.keyCode===li.ENTER||V.key==="Enter")&&(this._currentValue=null)});let N=t;if(N&&(!((u=this.columnEditor)===null||u===void 0)&&u.collectionOverride)){const V={column:this.columnDef,dataContext:this.dataContext,grid:this.grid,originalCollections:this.collection};if(this.args.compositeEditorOptions){const{formValues:Q,modalType:L}=this.args.compositeEditorOptions;V.compositeEditorOptions={formValues:Q,modalType:L}}N=this.columnEditor.collectionOverride(N,V)}N&&(this.finalCollection=N),Array.isArray(N)&&(this.collection.every(V=>Wd(V))?N=N.map(V=>({label:V,value:V})):N=N.map(V=>{var Q,L;return{label:V==null?void 0:V[this.labelName],value:V==null?void 0:V[this.valueName],labelPrefix:(Q=V==null?void 0:V[this.labelPrefixName])!==null&&Q!==void 0?Q:"",labelSuffix:(L=V==null?void 0:V[this.labelSuffixName])!==null&&L!==void 0?L:""}}),this._elementCollection=N),this._autocompleterOptions={input:this._inputElm,debounceWaitMs:200,className:`slick-autocomplete ${(c=(p=this.editorOptions)===null||p===void 0?void 0:p.className)!==null&&c!==void 0?c:""}`.trim(),emptyMsg:this.gridOptions.enableTranslate&&(!((f=this._translater)===null||f===void 0)&&f.translate)?this._translater.translate("NO_ELEMENTS_FOUND"):(v=(m=this._locales)===null||m===void 0?void 0:m.TEXT_NO_ELEMENTS_FOUND)!==null&&v!==void 0?v:"No elements found",customize:(V,Q,L)=>{L.style.width=""},onSelect:this.handleSelect.bind(this),...this.editorOptions},!((_=this._autocompleterOptions.renderItem)===null||_===void 0)&&_.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${Ga(this._autocompleterOptions.renderItem.layout)}`,this._autocompleterOptions.render=this.renderCustomItem.bind(this)):Array.isArray(t)?this._autocompleterOptions.render=(x=(C=this._autocompleterOptions.render)===null||C===void 0?void 0:C.bind(this))!==null&&x!==void 0?x:this.renderCollectionItem.bind(this):this._autocompleterOptions.render||(this._autocompleterOptions.render=this.renderRegularItem.bind(this)),!((w=this._autocompleterOptions)===null||w===void 0)&&w.fetch?(Np(this._inputElm,this._autocompleterOptions),this._instance=sv(this._autocompleterOptions)):this._instance=sv({...this._autocompleterOptions,fetch:(V,Q)=>{N&&Q(N.filter(L=>((typeof L=="string"?L:L==null?void 0:L.label)||"").toLowerCase().includes(V.toLowerCase())))}}),this.args.container.appendChild(this._editorInputGroupElm),this.args.compositeEditorOptions||setTimeout(()=>this.focus(),50)}}class $b{constructor(t){if(this.args=t,this._isValueTouched=!1,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},this._bindEventService=new Fn,this.init()}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return this._input}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l;const u=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",p=this.args.compositeEditorOptions;this._checkboxContainerElm=De("div",{className:`checkbox-editor-container editor-${u}`}),this._input=De("input",{type:"checkbox",value:"true",ariaLabel:(r=(n=this.columnEditor)===null||n===void 0?void 0:n.ariaLabel)!==null&&r!==void 0?r:`${jr(u+"")} Checkbox Editor`,className:`editor-checkbox editor-${u}`,title:(s=(o=this.columnEditor)===null||o===void 0?void 0:o.title)!==null&&s!==void 0?s:""});const c=(l=this.args)===null||l===void 0?void 0:l.container;c&&typeof c.appendChild=="function"&&(p?(this._checkboxContainerElm.appendChild(this._input),c.appendChild(this._checkboxContainerElm)):c.appendChild(this._input)),this.hasAutoCommitEdit&&!p&&this._bindEventService.bind(this._input,"click",()=>{this._isValueTouched=!0,this.save()}),p?this._bindEventService.bind(this._input,"change",f=>{this._isValueTouched=!0,this.handleChangeOnCompositeEditor(f,p)}):this.focus()}destroy(){var t,e;this._bindEventService.unbindAll(),(e=(t=this._input)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t)}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._input)if(t){this._input.setAttribute("disabled","disabled"),this._checkboxContainerElm.classList.add("disabled");const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==!1&&this.reset(!1,!0,!0)}else this._input.removeAttribute("disabled"),this._checkboxContainerElm.classList.remove("disabled")}focus(){this.grid.focus(),this._input&&this._input.focus()}preClick(){this._input&&(this._input.checked=!this._input.checked)}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValue(){var t,e;return(e=(t=this._input)===null||t===void 0?void 0:t.checked)!==null&&e!==void 0?e:!1}setValue(t,e=!1,n=!0){const r=!!t;if(this._input&&(this._input.checked=r),e){this.applyValue(this.args.item,this.serializeValue());const o=this.args.compositeEditorOptions;o&&n&&this.handleChangeOnCompositeEditor(null,o,"system")}}applyValue(t,e){var n,r,o;const s=this.columnDef&&this.columnDef.field;if(s!==void 0){const l=(s==null?void 0:s.indexOf("."))>0,u=this.validate(null,e),p=u&&u.valid?e:"";if(l){const c=(o=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.complexObjectPath)!==null&&r!==void 0?r:s)!==null&&o!==void 0?o:"";cr(t,c,p)}else t[s]=p}}isValueChanged(){return this.serializeValue()!==this._originalValue}isValueTouched(){return this._isValueTouched}loadValue(t){const e=this.columnDef&&this.columnDef.field;if(t&&e!==void 0&&this._input){const r=(e==null?void 0:e.indexOf("."))>0?_n(t,e):t[e];this._originalValue=r,this._input.checked=!!this._originalValue}}reset(t,e=!0,n=!1){var r;const o=(r=t??this._originalValue)!==null&&r!==void 0?r:!1;this._input&&(this._originalValue=o,this._input.checked=!!o),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(null,s,"user",l)}}save(){const t=this.validate(),e=t&&t.valid||!1;this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t,e;return(e=(t=this._input)===null||t===void 0?void 0:t.checked)!==null&&e!==void 0?e:!1}validate(t,e){var n,r;const o=!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions?!1:this.columnEditor.required,s=e!==void 0?e:(r=this._input)===null||r===void 0?void 0:r.checked,l=this.columnEditor.errorMessage;return this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled?{valid:!0,msg:""}:this.validator?this.validator(s,this.args):o&&!s?{valid:!1,msg:l||Xe.VALIDATION_REQUIRED_FIELD}:{valid:!0,msg:null}}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}}const Yb=dd&&Tn||dd,Fu=Ys||ms;class jb{constructor(t){var e;if(this.args=t,this._isValueTouched=!1,this._lastTriggeredByClearDate=!1,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},!((e=this.gridOptions)===null||e===void 0)&&e.translater&&(this._translaterService=this.gridOptions.translater),this._bindEventService=new Fn,this.init()}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return this._inputElm}get editorOptions(){return this.columnEditor.editorOptions||{}}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get pickerOptions(){return this._pickerMergedOptions}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l;if(this.args&&this.columnDef){const u=this.args.compositeEditorOptions,p=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",c=this.args.grid.getOptions()||{};this.defaultDate=this.args.item?this.args.item[this.columnDef.field]:null;const f=za(this.columnEditor.type||this.columnDef.type||ie.dateUtc),m=za(this.columnDef.outputType||this.columnEditor.type||this.columnDef.type||ie.dateUtc);let v=((r=(n=this._translaterService)===null||n===void 0?void 0:n.getCurrentLanguage)===null||r===void 0?void 0:r.call(n))||c.locale||"en";v.length>2&&(v=v.substring(0,2));const _={defaultDate:this.defaultDate,altInput:!0,altFormat:m,dateFormat:f,closeOnSelect:!0,wrap:!0,locale:v,onChange:()=>this.handleOnDateChange(),errorHandler:w=>{w.toString().includes("invalid locale")&&console.warn(`[Slickgrid-Universal] Flatpickr missing locale imports (${v}), will revert to English as the default locale.
49
49
  See Flatpickr Localization for more info, for example if we want to use French, then we can import it with: import 'flatpickr/dist/l10n/fr';`)}};this._pickerMergedOptions={..._,...this.editorOptions};const C=`.editor-text.editor-${p}.form-control`;this._pickerMergedOptions.altInput&&(this._pickerMergedOptions.altInputClass="flatpickr-alt-input form-control"),this._editorInputGroupElm=De("div",{className:"flatpickr input-group"});const x=De("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=De("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=De("input",{placeholder:(s=(o=this.columnEditor)===null||o===void 0?void 0:o.placeholder)!==null&&s!==void 0?s:"",title:this.columnEditor&&this.columnEditor.title||"",className:C.replace(/\./g," "),dataset:{input:"",defaultdate:this.defaultDate}},this._editorInputGroupElm),kl(this.columnEditor,"hideClearButton",void 0,"date")||(x.appendChild(this._clearButtonElm),this._editorInputGroupElm.appendChild(x),this._bindEventService.bind(this._clearButtonElm,"click",()=>this._lastTriggeredByClearDate=!0)),this.args.container.appendChild(this._editorInputGroupElm),this.flatInstance=Yb(this._editorInputGroupElm,this._pickerMergedOptions),this._inputWithDataElm=!((l=this._pickerMergedOptions)===null||l===void 0)&&l.altInput?document.querySelector(`${C}.flatpickr-alt-input`):this._inputElm,u||setTimeout(()=>{this.show(),this.focus()},50)}}destroy(){var t,e,n,r,o,s,l,u;this.hide(),this._bindEventService.unbindAll(),!((t=this.flatInstance)===null||t===void 0)&&t.destroy&&(this.flatInstance.destroy(),!((e=this.flatInstance)===null||e===void 0)&&e.element&&setTimeout(()=>gh(this.flatInstance))),en(this._editorInputGroupElm),en(this._inputWithDataElm),en(this._inputElm),(r=(n=this._editorInputGroupElm)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n),(s=(o=this._inputWithDataElm)===null||o===void 0?void 0:o.remove)===null||s===void 0||s.call(o),(u=(l=this._inputElm)===null||l===void 0?void 0:l.remove)===null||u===void 0||u.call(l)}disable(t=!0){var e,n;const r=this.disabled;if(this.disabled=t,!((e=this.flatInstance)===null||e===void 0)&&e._input)if(t){this.flatInstance._input.setAttribute("disabled","disabled"),this._clearButtonElm.disabled=!0;const o=this.getValue();r!==t&&(!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions)&&o!==""&&this.reset("",!0,!0)}else this.flatInstance._input.removeAttribute("disabled"),this._clearButtonElm.disabled=!1}changeEditorOption(t,e){this.columnEditor.editorOptions||(this.columnEditor.editorOptions={}),this.columnEditor.editorOptions[t]=e,this._pickerMergedOptions={...this._pickerMergedOptions,[t]:e},this.flatInstance.set(t,e)}focus(){var t,e;this.grid.focus(),this.show(),(t=this._inputElm)===null||t===void 0||t.focus(),!((e=this._inputWithDataElm)===null||e===void 0)&&e.focus&&(this._inputWithDataElm.focus(),this._inputWithDataElm.select())}hide(){this.flatInstance&&typeof this.flatInstance.close=="function"&&this.flatInstance.close()}show(){var t;const e=!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions);!e&&this.flatInstance&&typeof this.flatInstance.open=="function"&&this.flatInstance._input?this.flatInstance.open():e&&this.applyInputUsabilityState()}getValue(){return this._inputElm.value}setValue(t,e=!1,n=!0){if(this.flatInstance.setDate(t),e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(r,"system")}}applyValue(t,e){var n,r,o;const s=this.columnDef&&this.columnDef.field;if(s!==void 0){const l=Fr(this.columnDef&&(this.columnDef.outputType||this.columnEditor.type||this.columnDef.type)||ie.dateUtc),u=Fr(this.columnDef&&(this.columnDef.saveOutputType||this.columnDef.outputType||this.columnEditor.type||this.columnDef.type)||ie.dateUtc),p=(s==null?void 0:s.indexOf("."))>0,c=this.validate(null,e),f=e&&c&&c.valid?Fu(e,l).format(u):"";if(p){const m=(o=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.complexObjectPath)!==null&&r!==void 0?r:s)!==null&&o!==void 0?o:"";cr(t,m,f)}else t[s]=f}}isValueChanged(){var t;const e=this._inputElm.value,n=Fr(this.columnEditor.type||((t=this.columnDef)===null||t===void 0?void 0:t.type)||ie.dateIso),r=Fr(this.columnDef&&(this.columnDef.outputType||this.columnEditor.type||this.columnDef.type)||ie.dateUtc),o=e?Fu(e,n,!1).format(r):"",s=this._originalDate?Fu(this._originalDate,n,!1).format(r):"";return o==="Invalid date"||s==="Invalid date"?!1:this._lastTriggeredByClearDate||!(o===""&&s==="")&&o!==s}isValueTouched(){return this._isValueTouched}loadValue(t){const e=this.columnDef&&this.columnDef.field;if(t&&e!==void 0){const r=(e==null?void 0:e.indexOf("."))>0?_n(t,e):t[e];this._originalDate=r,this.flatInstance.setDate(r)}}reset(t,e=!0,n=!1){var r;const o=(r=t??this._originalDate)!==null&&r!==void 0?r:"";this.flatInstance&&(this._originalDate=o,this.flatInstance.setDate(o),o||this.flatInstance.clear()),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(s,"user",l)}}save(){const t=this.validate(),e=t&&t.valid||!1;this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t;const e=this._inputElm.value;if(!e)return"";const n=Fr(this.columnEditor.type||((t=this.columnDef)===null||t===void 0?void 0:t.type)||ie.dateIso),r=Fr(this.columnDef&&(this.columnDef.outputType||this.columnEditor.type||this.columnDef.type)||ie.dateIso);return Fu(e,n,!1).format(r)}validate(t,e){var n,r;const o=!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions?!1:this.columnEditor.required,s=e!==void 0?e:(r=this._inputElm)===null||r===void 0?void 0:r.value,l=this.columnEditor.errorMessage;return this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled?{valid:!0,msg:""}:this.validator?this.validator(s,this.args):o&&s===""?{valid:!1,msg:l||Xe.VALIDATION_REQUIRED_FIELD}:{valid:!0,msg:null}}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleOnDateChange(){var t,e;this._isValueTouched=!0;const n=(e=(t=this.flatInstance)===null||t===void 0?void 0:t.config)!==null&&e!==void 0?e:this._pickerMergedOptions;if(this.args&&(n!=null&&n.closeOnSelect)){const r=this.args.compositeEditorOptions;r?this.handleChangeOnCompositeEditor(r):this.save()}setTimeout(()=>this._lastTriggeredByClearDate=!1)}handleChangeOnCompositeEditor(t,e="user",n=!1){var r,o,s,l,u;const p=this.grid.getActiveCell(),c=this.args.column,f=(o=(r=this.columnDef)===null||r===void 0?void 0:r.id)!==null&&o!==void 0?o:"",m=this.dataContext,v=this.grid,_=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,_),this.applyValue(t.formValues,_);const C=(u=(l=(s=this.gridOptions)===null||s===void 0?void 0:s.compositeEditorOptions)===null||l===void 0?void 0:l.excludeDisabledFieldFormValues)!==null&&u!==void 0?u:!1;(n||this.disabled&&C&&t.formValues.hasOwnProperty(f))&&delete t.formValues[f],v.onCompositeEditorChange.notify({...p,item:m,grid:v,column:c,formValues:t.formValues,editors:t.editors,triggeredBy:e},new Slick.EventData)}}function lv(a,t){const e=isNaN(a)?null:parseFloat(a),n=t.decimal||0,r=t.required,o=t.minValue,s=t.maxValue,l=t.operatorConditionalType||"inclusive",u=t.errorMessage,p={"{{minValue}}":o,"{{maxValue}}":s,"{{minDecimal}}":0,"{{maxDecimal}}":n};let c=!0,f="";if(typeof t.validator=="function")return t.validator(a,t.editorArgs);if(r&&a==="")c=!1,f=u||Xe.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||n===0&&!/^[-+]?(\d*(\.)?(\d)*)$/.test(a)))c=!1,f=u||Xe.VALIDATION_EDITOR_VALID_NUMBER;else if(o!==void 0&&s!==void 0&&e!==null&&(l==="exclusive"&&(e<=+o||e>=+s)||l==="inclusive"&&(e<+o||e>+s)))c=!1,f=u||Xe.VALIDATION_EDITOR_NUMBER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi,m=>p[m]);else if(o!==void 0&&e!==null&&(l==="exclusive"&&e<=+o||l==="inclusive"&&e<+o)){c=!1;const m=l==="inclusive"?Xe.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE:Xe.VALIDATION_EDITOR_NUMBER_MIN;f=u||m.replace(/{{minValue}}/gi,v=>p[v])}else if(s!==void 0&&e!==null&&(l==="exclusive"&&e>=+s||l==="inclusive"&&e>+s)){c=!1;const m=l==="inclusive"?Xe.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE:Xe.VALIDATION_EDITOR_NUMBER_MAX;f=u||m.replace(/{{maxValue}}/gi,v=>p[v])}else n>0&&!new RegExp(`^[-+]?(\\d*(\\.)?(\\d){0,${n}})$`).test(a)&&(c=!1,f=u||Xe.VALIDATION_EDITOR_DECIMAL_BETWEEN.replace(/{{minDecimal}}|{{maxDecimal}}/gi,m=>p[m]));return{valid:c,msg:f}}function av(a,t){let e=isNaN(a)?null:parseInt(a,10);e!==null&&isNaN(e)&&(e=null);const n=t.errorMessage,r=t.required,o=t.minValue,s=t.maxValue,l=t.operatorConditionalType||"inclusive",u={"{{minValue}}":o,"{{maxValue}}":s};let p=!0,c="";if(t.validator)return t.validator(a,t.editorArgs);if(r&&a==="")p=!1,c=n||Xe.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||!/^[+-]?\d+$/.test(a)))p=!1,c=n||Xe.VALIDATION_EDITOR_VALID_INTEGER;else if(o!==void 0&&s!==void 0&&e!==null&&(l==="exclusive"&&(e<=+o||e>=+s)||l==="inclusive"&&(e<+o||e>+s)))p=!1,c=n||Xe.VALIDATION_EDITOR_INTEGER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi,f=>u[f]);else if(o!==void 0&&e!==null&&(l==="exclusive"&&e<=+o||l==="inclusive"&&e!==null&&e<+o)){p=!1;const f=l==="inclusive"?Xe.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE:Xe.VALIDATION_EDITOR_INTEGER_MIN;c=n||f.replace(/{{minValue}}/gi,m=>u[m])}else if(s!==void 0&&e!==null&&(l==="exclusive"&&e>=+s||l==="inclusive"&&e!==null&&e>+s)){p=!1;const f=l==="inclusive"?Xe.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE:Xe.VALIDATION_EDITOR_INTEGER_MAX;c=n||f.replace(/{{maxValue}}/gi,m=>u[m])}return{valid:p,msg:c}}function Xb(a,t){const e=t.required,n=t.minValue,r=t.maxValue,o=t.errorMessage,s={"{{minValue}}":n,"{{maxValue}}":r};return t.validator?t.validator(a,t.editorArgs):e&&a===""?{valid:!1,msg:o||Xe.VALIDATION_REQUIRED_FIELD}:n!==void 0&&r!==void 0&&a!==null&&(a<n||a>r)?{valid:!1,msg:o||Xe.VALIDATION_EDITOR_NUMBER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi,l=>s[l])}:{valid:!0,msg:null}}class qb{constructor(t){if(this.args=t,this._isValueSaveCalled=!1,this._isLeftValueTouched=!1,this._isRightValueTouched=!1,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},this._eventHandler=new Slick.EventHandler,this._bindEventService=new Fn,this.init(),this._eventHandler.subscribe(this.grid.onValidationError,()=>this._isValueSaveCalled=!0)}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return{leftInput:this._leftInput,rightInput:this._rightInput}}get editorParams(){return this.columnEditor.params||{}}get eventHandler(){return this._eventHandler}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get isValueSaveCalled(){return this._isValueSaveCalled}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r;if(!this.editorParams||!this.editorParams.leftInput||!this.editorParams.leftInput.field||!this.editorParams.rightInput||!this.editorParams.rightInput.field)throw new Error(`[Slickgrid-Universal] Please make sure that your Combo Input Editor has params defined with "leftInput" and "rightInput" (example: { editor: { model: Editors.comboInput, params: { leftInput: { field: 'firstName' }, { rightSide: { field: 'lastName' } }}}`);this._leftFieldName=(t=this.editorParams.leftInput)===null||t===void 0?void 0:t.field,this._rightFieldName=(e=this.editorParams.rightInput)===null||e===void 0?void 0:e.field,this._leftInput=this.createInput("leftInput"),this._rightInput=this.createInput("rightInput");const o=(n=this.args)===null||n===void 0?void 0:n.container;o&&typeof o.appendChild=="function"&&(o.appendChild(this._leftInput),o.appendChild(this._rightInput)),this._bindEventService.bind(this._leftInput,"keydown",l=>this.handleKeyDown(l,"leftInput")),this._bindEventService.bind(this._rightInput,"keydown",l=>this.handleKeyDown(l,"rightInput")),this.hasAutoCommitEdit&&(this._bindEventService.bind(this._leftInput,"focusout",l=>this.handleFocusOut(l,"leftInput")),this._bindEventService.bind(this._rightInput,"focusout",l=>this.handleFocusOut(l,"rightInput"))),((r=this.args)===null||r===void 0?void 0:r.compositeEditorOptions)?(this._bindEventService.bind(this._leftInput,"input",this.handleChangeOnCompositeEditorDebounce.bind(this)),this._bindEventService.bind(this._rightInput,"input",this.handleChangeOnCompositeEditorDebounce.bind(this))):setTimeout(()=>this._leftInput.select(),50)}handleFocusOut(t,e){var n;const r=((n=t.relatedTarget)===null||n===void 0?void 0:n.className)||"";!this.args.compositeEditorOptions&&r.indexOf("dual-editor")===-1&&this._lastEventType!=="focusout-right"&&(e==="rightInput"||e==="leftInput"&&this._lastEventType!=="focusout-left")&&(e==="leftInput"?this._isLeftValueTouched=!0:this._isRightValueTouched=!0,this.save());const s=e==="leftInput"?"left":"right";this._lastEventType=`${t==null?void 0:t.type}-${s}`}handleKeyDown(t,e){e==="leftInput"?this._isLeftValueTouched=!0:this._isRightValueTouched=!0,this._lastInputKeyEvent=t,(t.keyCode===li.LEFT||t.keyCode===li.RIGHT||t.keyCode===li.TAB)&&t.stopImmediatePropagation()}destroy(){var t,e,n,r;this._eventHandler.unsubscribeAll(),this._bindEventService.unbindAll(),(e=(t=this._leftInput)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t),(r=(n=this._rightInput)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n)}createInput(t){var e,n,r,o,s,l,u;const p=this.editorParams[t],c=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",f=this.gridOptions.datasetIdPropertyName||"id",m=(s=(o=(r=this.args)===null||r===void 0?void 0:r.item)===null||o===void 0?void 0:o[f])!==null&&s!==void 0?s:"";let v=p.type||"text";(v==="float"||v==="integer")&&(v="number");const _=De("input",{type:v||"text",id:`item-${m}-${t}`,ariaLabel:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.ariaLabel)!==null&&u!==void 0?u:`${jr(c+"")} Input Editor`,className:`dual-editor-text editor-${c} ${t.replace(/input/gi,"")}`,autocomplete:"none",placeholder:p.placeholder||"",title:p.title||""});return v==="readonly"&&(_.readOnly=!0,v="text"),v==="number"&&(_.step=this.getInputDecimalSteps(t)),_}disable(t=!0){var e;const n=this.disabled;this.disabled=t,this._leftInput&&this._rightInput&&(t?(this._leftInput.setAttribute("disabled","disabled"),this._rightInput.setAttribute("disabled","disabled"),n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&this.reset("",!0,!0)):(this._leftInput.removeAttribute("disabled"),this._rightInput.removeAttribute("disabled")))}focus(){this.grid.focus()}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValues(){const t={},e=this._leftInput.value,n=this._rightInput.value,r=this.editorParams.leftInput&&(this.editorParams.leftInput.type==="float"||this.editorParams.leftInput.type==="integer"),o=this.editorParams.rightInput&&(this.editorParams.rightInput.type==="float"||this.editorParams.rightInput.type==="integer"),s=e!==""&&r?+this._leftInput.value:e||"",l=n!==""&&o?+this._rightInput.value:n||"";return cr(t,this._leftFieldName,s),cr(t,this._rightFieldName,l),t}setValues(t){Array.isArray(t)&&t.length===2&&(this._leftInput.value=`${t[0]}`,this._rightInput.value=`${t[1]}`)}applyValue(t,e){this.applyValueByPosition(t,e,"leftInput"),this.applyValueByPosition(t,e,"rightInput")}applyValueByPosition(t,e,n){var r,o,s;const l=n==="leftInput"?this._leftFieldName:this._rightFieldName;if(l!==void 0){const u=(l==null?void 0:l.indexOf("."))>0;let p=l;if(u){const m=l.split(/\.(.*)/);p=m.length>1?m[1]:m}const c=u?_n(e,p):e[l],f=this.validate(null,{position:n,inputValue:c});if(u){const m=_n(e,p),v=f&&f.valid?m:"",_=(s=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.complexObjectPath)!==null&&o!==void 0?o:l)!==null&&s!==void 0?s:"";cr(t,_,v)}else l&&(t[l]=f&&f.valid?e[l]:"")}}isValueChanged(){const t=this._leftInput.value,e=this._rightInput.value,n=this.editorParams&&this.editorParams.leftInput,r=this.editorParams&&this.editorParams.rightInput,o=this._lastInputKeyEvent&&this._lastInputKeyEvent.keyCode;if((n&&n.alwaysSaveOnEnterKey||r&&r.alwaysSaveOnEnterKey)&&o===li.ENTER)return!0;const s=!(t===""&&(this._originalLeftValue===null||this._originalLeftValue===void 0))&&t!==this._originalLeftValue,l=!(e===""&&(this._originalRightValue===null||this._originalRightValue===void 0))&&e!==this._originalRightValue;return s||l}isValueTouched(){return this._isLeftValueTouched||this._isRightValueTouched}loadValue(t){this.loadValueByPosition(t,"leftInput"),this.loadValueByPosition(t,"rightInput"),this._leftInput.select()}loadValueByPosition(t,e){const n=e==="leftInput"?this._leftFieldName:this._rightFieldName,r=e==="leftInput"?"_originalLeftValue":"_originalRightValue",o=e==="leftInput"?"_leftInput":"_rightInput";if(t&&n!==void 0){const l=(n==null?void 0:n.indexOf("."))>0?_n(t,n):t.hasOwnProperty(n)?t[n]:"";if(this[r]=l,this.editorParams[e].type==="float"){const u=this.getDecimalPlaces(e);u!==null&&(this[r]||this[r]===0)&&typeof this[r]!==void 0&&(this[r]=(+this[r]).toFixed(u))}this[o]&&(this[o].value=`${this[r]}`)}}reset(t,e=!0,n=!1){var r,o;const s=(r=t??this._originalLeftValue)!==null&&r!==void 0?r:"",l=(o=t??this._originalRightValue)!==null&&o!==void 0?o:"";this._leftInput&&this._rightInput&&(this._originalLeftValue=s,this._originalRightValue=l,this._leftInput.value=`${s}`,this._rightInput.value=`${l}`),this._isLeftValueTouched=!1,this._isRightValueTouched=!1;const u=this.args.compositeEditorOptions;if(u&&e){const p=!n;this.handleChangeOnCompositeEditor(null,u,"user",p)}}save(){const t=this.validate(),e=t&&t.valid||!1;this._isValueSaveCalled||(this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges(),this._isValueSaveCalled=!0)}serializeValue(){const t={},e=this.serializeValueByPosition("leftInput"),n=this.serializeValueByPosition("rightInput");return cr(t,this._leftFieldName,e),cr(t,this._rightFieldName,n),t}serializeValueByPosition(t){const e=t==="leftInput"?this._leftInput.value:this._rightInput.value;if(e===""||isNaN(+e))return e;let n=parseFloat(e);const r=this.getDecimalPlaces(t);return r!==null&&(n||n===0)&&n.toFixed&&(n=parseFloat(n.toFixed(r))),n}getDecimalPlaces(t){const n=t==="leftInput"?"leftInput":"rightInput",r=this.editorParams[n],o=r==null?void 0:r.decimal;return o===void 0?0:o}getInputDecimalSteps(t){const e=this.getDecimalPlaces(t);let n="";for(let r=1;r<e;r++)n+="0";return e>0?`0.${n}1`:"1"}validate(t,e){if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};if(e){const n=this.validateByPosition(e.position,e.inputValue);if(!n.valid)return e.position==="leftInput"?this._leftInput.select():this._rightInput.select(),n}else{const n=this.validateByPosition("leftInput"),r=this.validateByPosition("rightInput");if(!n.valid)return this._leftInput.select(),n;if(!r.valid)return this._rightInput.select(),r}return{valid:!0,msg:""}}validateByPosition(t,e){var n;const r=this.editorParams[t];let o="";if(e)o=e;else{const u=t==="leftInput"?this._leftInput:this._rightInput;o=u&&u.value}const s=this.validator;o=typeof s=="function"?this.getValues():o;const l={editorArgs:this.args,errorMessage:r.errorMessage,required:!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions?!1:r.required,validator:typeof s=="function"?s:r.validator};switch(r.type){case"float":return lv(o,{...l,decimal:this.getDecimalPlaces(t),minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"integer":return av(o,{...l,minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"text":case"password":default:return Ru(o,l)}}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p,c,f,m,v;const _=this.grid.getActiveCell(),C=this.args.column,x=(l=(s=(o=this.columnEditor.params)===null||o===void 0?void 0:o.leftInput)===null||s===void 0?void 0:s.field)!==null&&l!==void 0?l:"",w=(c=(p=(u=this.columnEditor.params)===null||u===void 0?void 0:u.rightInput)===null||p===void 0?void 0:p.field)!==null&&c!==void 0?c:"",E=this.dataContext,I=this.grid,k=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,k),this.applyValue(e.formValues,k);const F=(v=(m=(f=this.gridOptions)===null||f===void 0?void 0:f.compositeEditorOptions)===null||m===void 0?void 0:m.excludeDisabledFieldFormValues)!==null&&v!==void 0?v:!1;(r||this.disabled&&F&&e.formValues.hasOwnProperty(x))&&delete e.formValues[x],(r||this.disabled&&F&&e.formValues.hasOwnProperty(w))&&delete e.formValues[w],I.onCompositeEditorChange.notify({..._,item:E,grid:I,column:C,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}handleChangeOnCompositeEditorDebounce(t){var e,n,r;const o=(e=this.args)===null||e===void 0?void 0:e.compositeEditorOptions;if(o){const s=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.editorTypingDebounce)!==null&&r!==void 0?r:500;clearTimeout(this._timer),this._timer=setTimeout(()=>this.handleChangeOnCompositeEditor(t,o),s)}}}class Pu{constructor(t,e){if(this.args=t,this._inputType="text",this._isValueTouched=!1,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=t.grid&&t.grid.getOptions(),this._bindEventService=new Fn,this.inputType=e||"text",this.init()}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return this._input}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get inputType(){return this._inputType}set inputType(t){this._inputType=t}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l,u;const p=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",c=this.args.compositeEditorOptions;this._input=De("input",{type:this._inputType||"text",autocomplete:"none",ariaLabel:(r=(n=this.columnEditor)===null||n===void 0?void 0:n.ariaLabel)!==null&&r!==void 0?r:`${jr(p+"")} Input Editor`,placeholder:(s=(o=this.columnEditor)===null||o===void 0?void 0:o.placeholder)!==null&&s!==void 0?s:"",title:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.title)!==null&&u!==void 0?u:"",className:`editor-text editor-${p}`});const f=this.args.container;f&&typeof f.appendChild=="function"&&f.appendChild(this._input),this._bindEventService.bind(this._input,"focus",()=>{var m;return(m=this._input)===null||m===void 0?void 0:m.select()}),this._bindEventService.bind(this._input,"keydown",m=>{this._isValueTouched=!0,this._lastInputKeyEvent=m,(m.keyCode===li.LEFT||m.keyCode===li.RIGHT)&&m.stopImmediatePropagation()}),this.hasAutoCommitEdit&&!c&&this._bindEventService.bind(this._input,"focusout",()=>{this._isValueTouched=!0,this.save()}),c&&this._bindEventService.bind(this._input,["input","paste"],this.handleOnInputChange.bind(this))}destroy(){var t,e;this._bindEventService.unbindAll(),(e=(t=this._input)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t)}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._input)if(t){this._input.setAttribute("disabled","disabled");const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==""&&this.reset("",!0,!0)}else this._input.removeAttribute("disabled")}focus(){this.grid.focus(),this._input&&this._input.focus()}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValue(){var t;return((t=this._input)===null||t===void 0?void 0:t.value)||""}setValue(t,e=!1,n=!0){if(this._input&&(this._input.value=`${t}`,e)){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(null,r,"system")}}applyValue(t,e){var n,r,o;const s=this.columnDef&&this.columnDef.field;if(s!==void 0){const l=(s==null?void 0:s.indexOf("."))>0,u=this.validate(null,e),p=u!=null&&u.valid?e:"";if(l){const c=(o=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.complexObjectPath)!==null&&r!==void 0?r:s)!==null&&o!==void 0?o:"";cr(t,c,p)}else s&&(t[s]=p)}}isValueChanged(){var t;const e=(t=this._input)===null||t===void 0?void 0:t.value,n=this._lastInputKeyEvent&&this._lastInputKeyEvent.keyCode;return this.columnEditor&&this.columnEditor.alwaysSaveOnEnterKey&&n===li.ENTER?!0:!(e===""&&(this._originalValue===null||this._originalValue===void 0))&&e!==this._originalValue}isValueTouched(){return this._isValueTouched}loadValue(t){const e=this.columnDef&&this.columnDef.field;if(t&&e!==void 0&&this._input){const r=(e==null?void 0:e.indexOf("."))>0?_n(t,e):t.hasOwnProperty(e)&&t[e]||"";this._originalValue=r,this._input.value=this._originalValue,this._input.select()}}reset(t,e=!0,n=!1){var r;const o=(r=t??this._originalValue)!==null&&r!==void 0?r:"";this._input&&(this._originalValue=o,this._input.value=`${o}`),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(null,s,"user",l)}}save(){const t=this.validate(),e=t&&t.valid||!1;this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t,e;return(e=(t=this._input)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:""}validate(t,e){var n;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const r=e!==void 0?e:this._input&&this._input.value;return Ru(r,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minLength:this.columnEditor.minLength,maxLength:this.columnEditor.maxLength,operatorConditionalType:this.columnEditor.operatorConditionalType,required:!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}handleOnInputChange(t){var e,n;this._isValueTouched=!0;const r=this.args.compositeEditorOptions;if(r){const o=(n=(e=this.gridOptions)===null||e===void 0?void 0:e.editorTypingDebounce)!==null&&n!==void 0?n:500;clearTimeout(this._timer),this._timer=setTimeout(()=>this.handleChangeOnCompositeEditor(t,r),o)}}}const Kb=0;class Zb extends Pu{constructor(t){super(t,"number"),this.args=t}init(){var t,e,n,r,o,s,l,u;if(this.columnDef&&this.columnEditor&&this.args){const p=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",c=this.args.compositeEditorOptions;this._input=De("input",{type:"number",autocomplete:"none",ariaLabel:(r=(n=this.columnEditor)===null||n===void 0?void 0:n.ariaLabel)!==null&&r!==void 0?r:`${jr(p+"")} Number Editor`,className:`editor-text editor-${p}`,placeholder:(s=(o=this.columnEditor)===null||o===void 0?void 0:o.placeholder)!==null&&s!==void 0?s:"",title:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.title)!==null&&u!==void 0?u:"",step:`${this.columnEditor.valueStep!==void 0?this.columnEditor.valueStep:this.getInputDecimalSteps()}`});const f=this.args.container;f&&typeof f.appendChild=="function"&&f.appendChild(this._input),this._bindEventService.bind(this._input,"focus",()=>{var m;return(m=this._input)===null||m===void 0?void 0:m.select()}),this._bindEventService.bind(this._input,"keydown",m=>{this._lastInputKeyEvent=m,(m.keyCode===li.LEFT||m.keyCode===li.RIGHT)&&m.stopImmediatePropagation()}),this.hasAutoCommitEdit&&!c&&this._bindEventService.bind(this._input,"focusout",()=>{this._isValueTouched=!0,this.save()}),c&&(this._bindEventService.bind(this._input,["input","paste"],this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._input,"wheel",this.handleOnMouseWheel.bind(this),{passive:!0}))}}getDecimalPlaces(){var t,e,n,r,o;let s=(o=(e=(t=this.columnEditor)===null||t===void 0?void 0:t.decimal)!==null&&e!==void 0?e:(r=(n=this.columnEditor)===null||n===void 0?void 0:n.params)===null||r===void 0?void 0:r.decimalPlaces)!==null&&o!==void 0?o:void 0;return s===void 0&&(s=Kb),!s&&s!==0?null:s}getInputDecimalSteps(){const t=this.getDecimalPlaces();let e="";for(let n=1;n<t;n++)e+="0";return t>0?`0.${e}1`:"1"}loadValue(t){const e=this.columnDef&&this.columnDef.field;if(e!==void 0&&t&&e!==void 0&&this._input){const r=(e==null?void 0:e.indexOf("."))>0?_n(t,e):t[e];this._originalValue=r;const o=this.getDecimalPlaces();o!==null&&(this._originalValue||this._originalValue===0)&&typeof this._originalValue!==void 0&&(this._originalValue=(+this._originalValue).toFixed(o)),this._input.value=`${this._originalValue}`,this._input.select()}}serializeValue(){var t;const e=(t=this._input)===null||t===void 0?void 0:t.value;if(e===void 0||e===""||isNaN(+e))return e;let n=parseFloat(e);const r=this.getDecimalPlaces();return r!==null&&(n||n===0)&&n.toFixed&&(n=parseFloat(n.toFixed(r))),n}validate(t,e){var n,r;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const o=e!==void 0?e:(n=this._input)===null||n===void 0?void 0:n.value;return lv(o,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,decimal:this.getDecimalPlaces(),minValue:this.columnEditor.minValue,maxValue:this.columnEditor.maxValue,operatorConditionalType:this.columnEditor.operatorConditionalType,required:!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}handleOnMouseWheel(t){this._isValueTouched=!0;const e=this.args.compositeEditorOptions;e&&this.handleChangeOnCompositeEditor(t,e)}}class Qb extends Pu{constructor(t){super(t,"password"),this.args=t}}class Jb extends Pu{constructor(t){super(t,"number"),this.args=t}init(){var t,e,n,r,o,s,l,u;if(this.columnDef&&this.columnEditor&&this.args){const p=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",c=this.args.compositeEditorOptions;this._input=De("input",{type:"number",autocomplete:"none",ariaLabel:(r=(n=this.columnEditor)===null||n===void 0?void 0:n.ariaLabel)!==null&&r!==void 0?r:`${jr(p+"")} Slider Editor`,placeholder:(s=(o=this.columnEditor)===null||o===void 0?void 0:o.placeholder)!==null&&s!==void 0?s:"",title:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.title)!==null&&u!==void 0?u:"",step:`${this.columnEditor.valueStep!==void 0?this.columnEditor.valueStep:"1"}`,className:`editor-text editor-${p}`});const f=this.args.container;f&&typeof f.appendChild=="function"&&f.appendChild(this._input),this._bindEventService.bind(this._input,"focus",()=>{var m;return(m=this._input)===null||m===void 0?void 0:m.select()}),this._bindEventService.bind(this._input,"keydown",m=>{this._lastInputKeyEvent=m,(m.keyCode===li.LEFT||m.keyCode===li.RIGHT)&&m.stopImmediatePropagation()}),this.hasAutoCommitEdit&&!c&&this._bindEventService.bind(this._input,"focusout",()=>{this._isValueTouched=!0,this.save()}),c&&(this._bindEventService.bind(this._input,["input","paste"],this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._input,"wheel",this.handleOnMouseWheel.bind(this),{passive:!0}))}}loadValue(t){const e=this.columnDef&&this.columnDef.field;if(e!==void 0&&t&&e!==void 0&&this._input){const r=(e==null?void 0:e.indexOf("."))>0?_n(t,e):t[e];this._originalValue=isNaN(r)||r===null||r===void 0?r:`${r}`,this._input.value=`${this._originalValue}`,this._input.select()}}serializeValue(){var t;const e=(t=this._input)===null||t===void 0?void 0:t.value;if(e===void 0||e===""||isNaN(+e))return e;const n=isNaN(+e)?e:parseInt(e,10);return isNaN(+n)?e:n}validate(t,e){var n;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const r=e!==void 0?e:this.getValue();return av(r,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minValue:this.columnEditor.minValue,maxValue:this.columnEditor.maxValue,operatorConditionalType:this.columnEditor.operatorConditionalType,required:!((n=this.args)===null||n===void 0)&&n.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}handleOnMouseWheel(t){this._isValueTouched=!0;const e=this.args.compositeEditorOptions;e&&this.handleChangeOnCompositeEditor(t,e)}}class eC{constructor(t){if(this.args=t,this._isValueTouched=!1,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=t.grid&&t.grid.getOptions();const e=this.gridOptions||this.args.column.params||{};e!=null&&e.translater&&(this._translater=e.translater),this._locales=this.gridOptions&&this.gridOptions.locales||Xe.locales,this._bindEventService=new Fn,this.init()}get columnDef(){return this.args.column}get columnEditor(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.internalColumnEditor)!==null&&e!==void 0?e:{}}get dataContext(){return this.args.item}get editorDomElement(){return this._textareaElm}get editorOptions(){var t,e;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.editorOptions)!==null&&e!==void 0?e:{}}get hasAutoCommitEdit(){var t,e;return(e=(t=this.gridOptions)===null||t===void 0?void 0:t.autoCommitEdit)!==null&&e!==void 0?e:!1}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l,u,p,c,f,m,v,_,C,x,w,E,I,k,F,N,V,Q,L,se;let Ce="",J="";if(this._translater&&this._translater.translate&&this.gridOptions.enableTranslate){const Re=ao(this.gridOptions),ae=(e=(t=this.editorOptions.buttonTexts)===null||t===void 0?void 0:t.cancelKey)!==null&&e!==void 0?e:`${Re}CANCEL`,he=(r=(n=this.editorOptions.buttonTexts)===null||n===void 0?void 0:n.saveKey)!==null&&r!==void 0?r:`${Re}SAVE`;Ce=this._translater.translate(`${Re}${ae}`),J=this._translater.translate(`${Re}${he}`)}else Ce=(u=(s=(o=this.editorOptions.buttonTexts)===null||o===void 0?void 0:o.cancel)!==null&&s!==void 0?s:(l=this._locales)===null||l===void 0?void 0:l.TEXT_CANCEL)!==null&&u!==void 0?u:"Cancel",J=(m=(c=(p=this.editorOptions.buttonTexts)===null||p===void 0?void 0:p.save)!==null&&c!==void 0?c:(f=this._locales)===null||f===void 0?void 0:f.TEXT_SAVE)!==null&&m!==void 0?m:"Save";const z=this.args.compositeEditorOptions,P=(_=(v=this.columnDef)===null||v===void 0?void 0:v.id)!==null&&_!==void 0?_:"",le=(C=this.columnEditor)===null||C===void 0?void 0:C.maxLength,Ke=(w=(x=this.editorOptions)===null||x===void 0?void 0:x.rows)!==null&&w!==void 0?w:4,Pe=z?this.args.container:document.body;this._wrapperElm=De("div",{className:`slick-large-editor-text editor-${P}`,style:{position:z?"relative":"absolute"}}),Pe.appendChild(this._wrapperElm),this._textareaElm=De("textarea",{ariaLabel:(I=(E=this.columnEditor)===null||E===void 0?void 0:E.ariaLabel)!==null&&I!==void 0?I:`${jr(P+"")} Text Editor`,cols:(F=(k=this.editorOptions)===null||k===void 0?void 0:k.cols)!==null&&F!==void 0?F:40,rows:z&&Ke>3?3:Ke,placeholder:(V=(N=this.columnEditor)===null||N===void 0?void 0:N.placeholder)!==null&&V!==void 0?V:"",title:(L=(Q=this.columnEditor)===null||Q===void 0?void 0:Q.title)!==null&&L!==void 0?L:""},this._wrapperElm);const Oe=De("div",{className:"editor-footer"}),ye=De("span",{className:"counter"});if(this._currentLengthElm=De("span",{className:"text-length",textContent:"0"}),ye.appendChild(this._currentLengthElm),le!==void 0&&(ye.appendChild(De("span",{className:"separator",textContent:"/"})),ye.appendChild(De("span",{className:"max-length",textContent:`${le}`}))),Oe.appendChild(ye),!z){const Re=De("button",{className:"btn btn-cancel btn-default btn-xs",textContent:Ce},Oe),ae=De("button",{className:"btn btn-save btn-primary btn-xs",textContent:J},Oe);this._bindEventService.bind(Re,"click",this.cancel.bind(this)),this._bindEventService.bind(ae,"click",this.save.bind(this)),this.position((se=this.args)===null||se===void 0?void 0:se.position),this._textareaElm.focus(),this._textareaElm.select()}this._wrapperElm.appendChild(Oe),this._bindEventService.bind(this._textareaElm,"keydown",this.handleKeyDown.bind(this)),this._bindEventService.bind(this._textareaElm,"input",this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._textareaElm,"paste",this.handleOnInputChange.bind(this))}cancel(){var t;const e=this._defaultTextValue||"";this._textareaElm.value=e,this._currentLengthElm.textContent=`${e.length}`,!((t=this.args)===null||t===void 0)&&t.cancelChanges&&this.args.cancelChanges()}hide(){this._wrapperElm.style.display="none"}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)?this.applyInputUsabilityState():this._wrapperElm.style.display="block"}destroy(){var t,e;this._bindEventService.unbindAll(),(e=(t=this._wrapperElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t)}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._textareaElm&&this._wrapperElm)if(t){this._textareaElm.disabled=!0,this._wrapperElm.classList.add("disabled");const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==""&&this.reset("",!0,!0)}else this._textareaElm.disabled=!1,this._wrapperElm.classList.remove("disabled")}focus(){this.grid.focus(),this._textareaElm&&(this._textareaElm.focus(),this._textareaElm.select())}getValue(){return this._textareaElm.value}setValue(t,e=!1,n=!0){if(this._textareaElm.value=t,this._currentLengthElm.textContent=`${t.length}`,e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(null,r,"system")}}applyValue(t,e){var n,r,o,s;const l=(n=this.columnDef)===null||n===void 0?void 0:n.field;if(l!==void 0){const u=(l==null?void 0:l.indexOf("."))>0,p=this.validate(void 0,e),c=p&&p.valid?e:"";if(u){const f=(s=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.complexObjectPath)!==null&&o!==void 0?o:l)!==null&&s!==void 0?s:"";cr(t,f,c)}else t[l]=c}}isValueChanged(){const t=this._textareaElm.value;return!(t===""&&(this._defaultTextValue===null||this._defaultTextValue===void 0))&&t!==this._defaultTextValue}isValueTouched(){return this._isValueTouched}loadValue(t){var e;const n=(e=this.columnDef)===null||e===void 0?void 0:e.field;if(t&&n!==void 0){const o=(n==null?void 0:n.indexOf("."))>0?_n(t,n):t[n];this._defaultTextValue=o||"",this._textareaElm.value=this._defaultTextValue,this._currentLengthElm.textContent=this._defaultTextValue.length,this._textareaElm.defaultValue=this._defaultTextValue,this._textareaElm.select()}}position(t){var e,n,r,o,s,l,u,p;const c=qn(this.args.container),f=this.args.container.offsetHeight,m=this.args.container.offsetWidth,v=this._wrapperElm.getBoundingClientRect().height||this.args.position.height,_=this._wrapperElm.getBoundingClientRect().width||this.args.position.width,C=document.body.offsetHeight||window.innerHeight,x=document.body.offsetWidth||window.innerWidth;let w=(n=(e=c==null?void 0:c.top)!==null&&e!==void 0?e:t.top)!==null&&n!==void 0?n:0,E=(o=(r=c==null?void 0:c.left)!==null&&r!==void 0?r:t.left)!==null&&o!==void 0?o:0;const I=(l=(s=this.editorOptions)===null||s===void 0?void 0:s.position)!==null&&l!==void 0?l:"auto";if(I==="left"||I==="auto"&&E+_>x){const k=(p=(u=this.editorOptions)===null||u===void 0?void 0:u.marginRight)!==null&&p!==void 0?p:0;E-=_-m+k}(I==="top"||I==="auto"&&w+v>C)&&(w-=v-f),this._wrapperElm.style.top=`${w}px`,this._wrapperElm.style.left=`${E}px`}reset(t,e=!0,n=!1){var r;const o=(r=t??this._defaultTextValue)!==null&&r!==void 0?r:"";this._textareaElm&&(this._defaultTextValue=o,this._textareaElm.value=o,this._currentLengthElm.textContent=o.length),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(null,s,"user",l)}}save(){var t;const e=this.validate(),n=(t=e==null?void 0:e.valid)!==null&&t!==void 0?t:!1;this.hasAutoCommitEdit&&n?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){return this._textareaElm.value}validate(t,e){var n,r;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const o=e!==void 0?e:(n=this._textareaElm)===null||n===void 0?void 0:n.value;return Ru(o,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minLength:this.columnEditor.minLength,maxLength:this.columnEditor.maxLength,operatorConditionalType:this.columnEditor.operatorConditionalType,required:!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleKeyDown(t){var e;const n=(e=t.keyCode)!==null&&e!==void 0?e:t.code;this._isValueTouched=!0,this.args.compositeEditorOptions||(n===li.ENTER&&t.ctrlKey||t.ctrlKey&&t.key.toUpperCase()==="S"?(t.preventDefault(),this.save()):n===li.ESCAPE?(t.preventDefault(),this.cancel()):n===li.TAB&&t.shiftKey?(t.preventDefault(),this.args&&this.grid&&this.grid.navigatePrev()):n===li.TAB&&(t.preventDefault(),this.args&&this.grid&&this.grid.navigateNext()))}handleOnInputChange(t){var e,n,r;const o=this.args.compositeEditorOptions,s=(e=this.columnEditor)===null||e===void 0?void 0:e.maxLength;let l=!1;if(s&&(l=this.truncateText(this._textareaElm,s)),l)this._currentLengthElm.textContent=`${s}`;else{const u=t.type==="paste"?t.clipboardData.getData("text"):t.target.value;this._currentLengthElm.textContent=`${u.length}`}if(o){const u=(r=(n=this.gridOptions)===null||n===void 0?void 0:n.editorTypingDebounce)!==null&&r!==void 0?r:500;clearTimeout(this._timer),this._timer=setTimeout(()=>this.handleChangeOnCompositeEditor(t,o),u)}}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}truncateText(t,e){const n=t.value+"";return n.length>e?(t.value=n.substring(0,e),!0):!1}}class dv{constructor(t,e,n=-1){var r,o,s,l,u,p,c,f,m,v,_;if(this.args=t,this.isMultipleSelect=e,this.delayOpening=n,this._isValueTouched=!1,this._isDisposingOrCallingSave=!1,this.disabled=!1,this.enableTranslateLabel=!1,this.finalCollection=[],!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},!((r=this.gridOptions)===null||r===void 0)&&r.translater&&(this._translaterService=this.gridOptions.translater),this._locales=this.gridOptions.locales||Xe.locales;const C=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"";this.elementName=`editor-${C}`;const x=this.args.compositeEditorOptions,w={autoAdjustDropHeight:!0,autoAdjustDropPosition:!0,autoAdjustDropWidthByTextSize:!0,container:"body",filter:!1,maxHeight:275,minHeight:25,name:this.elementName,single:!0,useSelectOptionLabelToHtml:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.enableRenderHtml)!==null&&u!==void 0?u:!1,sanitizer:E=>Pn(this.gridOptions,E),onClick:()=>this._isValueTouched=!0,onCheckAll:()=>this._isValueTouched=!0,onUncheckAll:()=>this._isValueTouched=!0,onClose:()=>{x?this.handleChangeOnCompositeEditor(x):(this._isDisposingOrCallingSave=!0,this.save(this.hasAutoCommitEdit))}};if(e)if(w.single=!1,w.displayTitle=!0,w.showOkButton=!0,!((p=this._translaterService)===null||p===void 0)&&p.getCurrentLanguage()){const E=ao(this.gridOptions);w.countSelectedText=this._translaterService.translate(`${E}X_OF_Y_SELECTED`),w.allSelectedText=this._translaterService.translate(`${E}ALL_SELECTED`),w.selectAllText=this._translaterService.translate(`${E}SELECT_ALL`),w.okButtonText=this._translaterService.translate(`${E}OK`),w.noMatchesFoundText=this._translaterService.translate(`${E}NO_MATCHES_FOUND`)}else w.countSelectedText=(c=this._locales)===null||c===void 0?void 0:c.TEXT_X_OF_Y_SELECTED,w.allSelectedText=(f=this._locales)===null||f===void 0?void 0:f.TEXT_ALL_SELECTED,w.selectAllText=(m=this._locales)===null||m===void 0?void 0:m.TEXT_SELECT_ALL,w.okButtonText=(v=this._locales)===null||v===void 0?void 0:v.TEXT_OK,w.noMatchesFoundText=(_=this._locales)===null||_===void 0?void 0:_.TEXT_NO_MATCHES_FOUND;this.defaultOptions=w,this.init()}get collection(){var t,e;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.collection)!==null&&e!==void 0?e:[]}get collectionOptions(){var t;return(t=this.columnEditor)===null||t===void 0?void 0:t.collectionOptions}get columnDef(){return this.args.column}get columnEditor(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.internalColumnEditor)!==null&&e!==void 0?e:{}}get dataContext(){return this.args.item}get editorDomElement(){return this.editorElm}get isCompositeEditor(){var t;return!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)}get customStructure(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.internalColumnEditor)===null||e===void 0?void 0:e.customStructure}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get msInstance(){return this._msInstance}get currentValues(){var t,e,n,r,o,s;const l=(e=(t=this._msInstance)===null||t===void 0?void 0:t.getSelects())!==null&&e!==void 0?e:[];if(this.collection.every(c=>typeof c=="number"||typeof c=="string"))return this.collection.filter(c=>l==null?void 0:l.some(f=>`${f}`===(c==null?void 0:c.toString())));const u=(r=(n=this.collectionOptions)===null||n===void 0?void 0:n.separatorBetweenTextLabels)!==null&&r!==void 0?r:"",p=(s=(o=this.collectionOptions)===null||o===void 0?void 0:o.includePrefixSuffixToSelectedValues)!==null&&s!==void 0?s:!1;return this.collection.filter(c=>l.some(f=>{var m;return`${f}`===((m=c==null?void 0:c[this.valueName])===null||m===void 0?void 0:m.toString())})).map(c=>{var f,m,v,_;const C=c[this.valueName];let x=c[this.labelPrefixName]||"",w=c[this.labelSuffixName]||"";const E=(m=(f=this.columnDef)===null||f===void 0?void 0:f.field)!==null&&m!==void 0?m:"",I=(E==null?void 0:E.indexOf("."))>0,k=(_=(v=this.columnEditor)===null||v===void 0?void 0:v.serializeComplexValueFormat)!==null&&_!==void 0?_:"object";return I&&typeof c=="object"&&k==="object"?c:(x=this.enableTranslateLabel&&this._translaterService&&x&&typeof x=="string"?this._translaterService.translate(x||" "):x,w=this.enableTranslateLabel&&this._translaterService&&w&&typeof w=="string"?this._translaterService.translate(w||" "):w,p?[x,C,w].filter(N=>N).join(u):C)})}get currentValue(){var t,e,n,r,o,s,l,u,p;const c=(e=(t=this._msInstance)===null||t===void 0?void 0:t.getSelects())!==null&&e!==void 0?e:[],f=c.length?c[0]:"",m=(n=this.columnDef)===null||n===void 0?void 0:n.field;if(m!==void 0){if(this.collection.every(E=>typeof E=="number"||typeof E=="string"))return bs(this.collection,E=>{var I;return((I=E==null?void 0:E.toString)===null||I===void 0?void 0:I.call(E))===`${f}`});const v=(o=(r=this.collectionOptions)===null||r===void 0?void 0:r.separatorBetweenTextLabels)!==null&&o!==void 0?o:"",_=(l=(s=this.collectionOptions)===null||s===void 0?void 0:s.includePrefixSuffixToSelectedValues)!==null&&l!==void 0?l:!1,C=bs(this.collection,E=>{var I;return E.hasOwnProperty(this.valueName)&&((I=E[this.valueName])===null||I===void 0?void 0:I.toString())===`${f}`}),x=(m==null?void 0:m.indexOf("."))>0,w=(p=(u=this.columnEditor)===null||u===void 0?void 0:u.serializeComplexValueFormat)!==null&&p!==void 0?p:"object";if(x&&typeof C=="object"&&w==="object")return C;if(C&&C.hasOwnProperty(this.valueName)){const E=C[this.valueName];if(_){let I=C[this.labelPrefixName]||"",k=C[this.labelSuffixName]||"";return I=this.enableTranslateLabel&&this._translaterService&&I&&typeof I=="string"?this._translaterService.translate(I||" "):I,k=this.enableTranslateLabel&&this._translaterService&&k&&typeof k=="string"?this._translaterService.translate(k||" "):k,[I,E,k].filter(N=>N).join(v)}return E}}return""}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t,e,n,r,o,s,l,u,p,c,f,m,v;if(!this.columnDef||!this.columnDef.internalColumnEditor||!this.columnDef.internalColumnEditor.collection&&!this.columnDef.internalColumnEditor.collectionAsync)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") inside Column Definition Editor for the MultipleSelect/SingleSelect Editor to work correctly.
50
50
  Also each option should include a value/label pair (or value/labelKey when using Locale).
51
- For example: { editor: { collection: [{ value: true, label: 'True' },{ value: false, label: 'False'}] } }`);if(this._collectionService=new Lp(this._translaterService),this.enableTranslateLabel=(e=(t=this.columnEditor)===null||t===void 0?void 0:t.enableTranslateLabel)!==null&&e!==void 0?e:!1,this.labelName=(r=(n=this.customStructure)===null||n===void 0?void 0:n.label)!==null&&r!==void 0?r:"label",this.labelPrefixName=(s=(o=this.customStructure)===null||o===void 0?void 0:o.labelPrefix)!==null&&s!==void 0?s:"labelPrefix",this.labelSuffixName=(u=(l=this.customStructure)===null||l===void 0?void 0:l.labelSuffix)!==null&&u!==void 0?u:"labelSuffix",this.optionLabel=(c=(p=this.customStructure)===null||p===void 0?void 0:p.optionLabel)!==null&&c!==void 0?c:"value",this.valueName=(m=(f=this.customStructure)===null||f===void 0?void 0:f.value)!==null&&m!==void 0?m:"value",this.enableTranslateLabel&&(!this._translaterService||typeof this._translaterService.translate!="function"))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');this.renderDomElement(this.collection),(this.disabled||!((v=this.columnEditor)===null||v===void 0)&&v.collectionAsync&&Array.isArray(this.collection)&&this.collection.length===0)&&this.disable(!0)}getValue(){return this.isMultipleSelect?this.currentValues:this.currentValue}setValue(t,e=!1,n=!0){if(this.isMultipleSelect&&Array.isArray(t)?this.loadMultipleValues(t):this.loadSingleValue(t),e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(r,"system")}}hide(){this._msInstance&&this._msInstance.close()}show(t){!this.isCompositeEditor&&this._msInstance?this._msInstance.open(t):this.isCompositeEditor&&this.applyInputUsabilityState()}applyValue(t,e){var n,r,o,s,l;const u=(n=this.columnDef)===null||n===void 0?void 0:n.field,p=(r=this.columnDef)===null||r===void 0?void 0:r.type;let c=e;if(u!==void 0){(p===ie.number||p===ie.integer||p===ie.boolean)&&!isNaN(parseFloat(e))&&(c=parseFloat(e)),this.isMultipleSelect&&typeof e=="string"&&e.indexOf(",")>=0&&(c=e.split(","));const f=(u==null?void 0:u.indexOf("."))>0,m=this.validate(null,c);if(c=m!=null&&m.valid?c:"",f){const v=(l=(s=(o=this.columnEditor)===null||o===void 0?void 0:o.complexObjectPath)!==null&&s!==void 0?s:u)!==null&&l!==void 0?l:"";cr(t,v,c)}else t[u]=c}}destroy(){var t,e;this._msInstance&&this.hasAutoCommitEdit&&this.isValueChanged()&&!this._isDisposingOrCallingSave&&!this.isCompositeEditor&&(this._isDisposingOrCallingSave=!0,this.save(!0)),this._isDisposingOrCallingSave=!0,(t=this._msInstance)===null||t===void 0||t.destroy(),(e=this.editorElm)===null||e===void 0||e.remove(),this._msInstance=void 0}loadValue(t){var e,n,r;const o=(e=this.columnDef)===null||e===void 0?void 0:e.field,s=o!==void 0&&(o==null?void 0:o.indexOf("."))>0;if(t&&o!==void 0){const l=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.complexObjectPath)!==null&&r!==void 0?r:o,u=s?_n(t,l):t.hasOwnProperty(o)&&t[o],p=s&&(u!=null&&u.hasOwnProperty(this.valueName))?u[this.valueName]:u;this.isMultipleSelect&&Array.isArray(p)?this.loadMultipleValues(p):this.loadSingleValue(p)}}loadMultipleValues(t){var e;if(Array.isArray(t)){this.originalValue=t.map(r=>typeof r=="number"||typeof r=="boolean"?`${r}`:r),(e=this._msInstance)===null||e===void 0||e.setSelects(this.originalValue);const n=this.args.compositeEditorOptions;n&&this.handleChangeOnCompositeEditor(n)}}loadSingleValue(t){var e;this.originalValue=typeof t=="number"||typeof t=="boolean"?`${t}`:t,(e=this._msInstance)===null||e===void 0||e.setSelects([this.originalValue])}serializeValue(){return this.isMultipleSelect?this.currentValues:this.currentValue}changeEditorOption(t,e){var n;this.columnEditor&&(this.columnEditor.editorOptions||(this.columnEditor.editorOptions={}),this.columnEditor.editorOptions[t]=e,this.editorElmOptions={...this.editorElmOptions,[t]:e},(n=this._msInstance)===null||n===void 0||n.refreshOptions(this.editorElmOptions))}disable(t=!0){const e=this.disabled;if(this.disabled=t,this._msInstance)if(t){this._msInstance.disable();const n=this.getValue(),r=Array.isArray(n)&&this.isMultipleSelect?(n==null?void 0:n[0])==="":n==="";e!==t&&this.isCompositeEditor&&!r&&this.reset("",!0,!0)}else this._msInstance.enable()}focus(){var t;this.grid.focus(),(t=this._msInstance)===null||t===void 0||t.focus()}isValueChanged(){var t;const e=(t=this._msInstance)===null||t===void 0?void 0:t.getSelects();if(this.isMultipleSelect)return!es(e,this.originalValue);const n=Array.isArray(e)&&e.length>0?e[0]:void 0;return n!==void 0&&n!==this.originalValue}isValueTouched(){return this._isValueTouched}reset(t,e=!0,n=!1){const r=t??this.originalValue;if(this._msInstance){this.originalValue=this.isMultipleSelect?r!==void 0?[r]:[]:r;const s=this.originalValue===void 0?[]:[this.originalValue];this._msInstance.setSelects(s)}this._isValueTouched=!1;const o=this.args.compositeEditorOptions;if(o&&e){const s=!n;this.handleChangeOnCompositeEditor(o,"user",s)}}save(t=!1){var e;const n=this.validate(),r=(e=n==null?void 0:n.valid)!==null&&e!==void 0?e:!1;(!this._isDisposingOrCallingSave||t)&&this.hasAutoCommitEdit&&r?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}validate(t,e){var n,r;const o=this.isCompositeEditor?!1:(n=this.columnEditor)===null||n===void 0?void 0:n.required,s=e!==void 0?e:(r=this._msInstance)===null||r===void 0?void 0:r.getSelects(),l=this.columnEditor&&this.columnEditor.errorMessage;if(this.isCompositeEditor&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};if(this.validator){const u=e!==void 0?e:this.isMultipleSelect?this.currentValues:this.currentValue;return this.validator(u,this.args)}return o&&(s===""||Array.isArray(s)&&s.length===0)?{valid:!1,msg:l||Xe.VALIDATION_REQUIRED_FIELD}:{valid:!0,msg:null}}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}filterCollection(t){var e,n;let r=t;if(this.columnEditor&&this.columnEditor.collectionFilterBy){const o=this.columnEditor.collectionFilterBy,s=(n=(e=this.columnEditor.collectionOptions)===null||e===void 0?void 0:e.filterResultAfterEachPass)!==null&&n!==void 0?n:null;r=this._collectionService.filterCollection(r,o,s)}return r}sortCollection(t){let e=t;if(this.columnDef&&this.columnEditor&&this.columnEditor.collectionSortBy){const n=this.columnEditor.collectionSortBy;e=this._collectionService.sortCollection(this.columnDef,e,n,this.enableTranslateLabel)}return e}renderDomElement(t){var e,n,r,o,s;if(!Array.isArray(t)&&(!((e=this.collectionOptions)===null||e===void 0)&&e.collectionInsideObjectProperty)){const c=this.collectionOptions.collectionInsideObjectProperty;t=_n(t,c)}if(!Array.isArray(t))throw new Error('The "collection" passed to the Select Editor is not a valid array.');let l=[];if(t.length>0&&(l=[...t]),!((n=this.collectionOptions)===null||n===void 0)&&n.addBlankEntry&&Array.isArray(l)&&l.length>0&&l[0][this.valueName]!==""&&(l.unshift(this.createBlankEntry()),this.collection.unshift(this.createBlankEntry())),!((r=this.collectionOptions)===null||r===void 0)&&r.addCustomFirstEntry&&Array.isArray(l)&&l.length>0&&l[0][this.valueName]!==this.collectionOptions.addCustomFirstEntry[this.valueName]&&(l.unshift(this.collectionOptions.addCustomFirstEntry),this.collection.unshift(this.collectionOptions.addCustomFirstEntry)),!((o=this.collectionOptions)===null||o===void 0)&&o.addCustomLastEntry&&Array.isArray(l)&&l.length>0){const c=l.length-1;l[c][this.valueName]!==this.collectionOptions.addCustomLastEntry[this.valueName]&&l.push(this.collectionOptions.addCustomLastEntry)}let u=l;if(u=this.filterCollection(u),u=this.sortCollection(u),!((s=this.columnEditor)===null||s===void 0)&&s.collectionOverride){const c={column:this.columnDef,dataContext:this.dataContext,grid:this.grid,originalCollections:this.collection};if(this.args.compositeEditorOptions){const{formValues:f,modalType:m}=this.args.compositeEditorOptions;c.compositeEditorOptions={formValues:f,modalType:m}}u=this.columnEditor.collectionOverride(u,c)}this.finalCollection=u;const p=Kp("editor",u,this.columnDef,this.grid,this.isMultipleSelect,this._translaterService);this.createDomElement(p.selectElement,p.dataCollection)}createBlankEntry(){const t={[this.labelName]:"",[this.valueName]:""};return this.labelPrefixName&&(t[this.labelPrefixName]=""),this.labelSuffixName&&(t[this.labelSuffixName]=""),t}createDomElement(t,e){var n,r,o,s,l;const u=this.args.container;t&&u&&typeof u.appendChild=="function"&&(en(u),u.appendChild(t));const p=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.placeholder)!==null&&r!==void 0?r:"";this.defaultOptions.placeholder=p||"";const c=(l=(s=(o=this.columnDef)===null||o===void 0?void 0:o.internalColumnEditor)===null||s===void 0?void 0:s.editorOptions)!==null&&l!==void 0?l:{};this.editorElmOptions={...this.defaultOptions,...c,data:e},this._msInstance=ha(t,this.editorElmOptions),this.isCompositeEditor||(this.delayOpening>=0?setTimeout(()=>this.show()):this.show())}handleChangeOnCompositeEditor(t,e="user",n=!1){var r,o,s,l,u;const p=this.grid.getActiveCell(),c=this.args.column,f=(o=(r=this.columnDef)===null||r===void 0?void 0:r.id)!==null&&o!==void 0?o:"",m=this.dataContext,v=this.grid,_=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,_),this.applyValue(t.formValues,_);const C=(u=(l=(s=this.gridOptions)===null||s===void 0?void 0:s.compositeEditorOptions)===null||l===void 0?void 0:l.excludeDisabledFieldFormValues)!==null&&u!==void 0?u:!1;(n||this.disabled&&C&&t.formValues.hasOwnProperty(f))&&delete t.formValues[f],v.onCompositeEditorChange.notify({...p,item:m,grid:v,column:c,formValues:t.formValues,editors:t.editors,triggeredBy:e},new Slick.EventData)}}class tC extends dv{constructor(t,e=0){super(t,!0,e),this.args=t,this.delayOpening=e}}class iC extends dv{constructor(t,e=0){super(t,!1,e),this.args=t,this.delayOpening=e}}class nC{constructor(t){if(this.args=t,this._defaultValue=0,this._isValueTouched=!1,this._sliderNumberElm=null,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},this._bindEventService=new Fn,this.init()}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return this._editorElm}get editorInputDomElement(){return this._inputElm}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get sliderOptions(){return this._sliderOptions}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t;if(this._cellContainerElm=(t=this.args)===null||t===void 0?void 0:t.container,this._cellContainerElm&&this.columnDef){const e=this.args.compositeEditorOptions;this._editorElm=this.buildDomElement(),e||this.focus(),this._cellContainerElm.appendChild(this._editorElm),this._bindEventService.bind(this._sliderTrackElm,["click","mouseup"],this.sliderTrackClicked.bind(this)),this._bindEventService.bind(this._inputElm,["change","mouseup","touchend"],this.handleChangeEvent.bind(this)),this._bindEventService.bind(this._inputElm,["input","change"],this.handleChangeSliderNumber.bind(this))}}cancel(){this._inputElm&&(this._inputElm.value=`${this._originalValue}`),this.args.cancelChanges()}destroy(){var t,e,n;this._bindEventService.unbindAll(),(t=this._inputElm)===null||t===void 0||t.remove(),(e=this._editorElm)===null||e===void 0||e.remove(),(n=this._sliderTrackElm)===null||n===void 0||n.remove()}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._inputElm)if(t){this._inputElm.disabled=!0;const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==""&&this.reset(0,!0,!0)}else this._inputElm.disabled=!1}focus(){this.grid.focus(),this._inputElm&&this._inputElm.focus()}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValue(){var t,e;return(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:""}setValue(t,e=!1,n=!0){if(this._inputElm&&(this._inputElm.value=`${t}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${t}`),e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(null,r,"system")}}applyValue(t,e){var n,r,o,s,l;const u=(r=(n=this.columnDef)===null||n===void 0?void 0:n.field)!==null&&r!==void 0?r:"";if(u!==void 0){const p=(u==null?void 0:u.indexOf("."))>0,c=this.validate(void 0,e),f=c&&c.valid?e:"";if(p){const m=(l=(s=(o=this.columnEditor)===null||o===void 0?void 0:o.complexObjectPath)!==null&&s!==void 0?s:u)!==null&&l!==void 0?l:"";cr(t,m,f)}else t&&(t[u]=f)}}isValueChanged(){var t,e;const n=(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"";return!(n===""&&this._originalValue===void 0)&&+n!==this._originalValue}isValueTouched(){return this._isValueTouched}loadValue(t){var e,n;const r=(n=(e=this.columnDef)===null||e===void 0?void 0:e.field)!==null&&n!==void 0?n:"";if(t&&r!==void 0){let s=(r==null?void 0:r.indexOf("."))>0?_n(t,r):t.hasOwnProperty(r)?t[r]:this._defaultValue;(s===""||s===null||s===void 0)&&(s=this._defaultValue),this._originalValue=+s,this._inputElm&&(this._inputElm.value=`${s}`,this._inputElm.title=`${s}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${s}`)}this.updateTrackFilledColorWhenEnabled()}reset(t,e=!0,n=!1){var r;const o=(r=t??this._originalValue)!==null&&r!==void 0?r:0;this._inputElm&&(this._inputElm.value=`${o}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${o}`),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(null,s,"user",l)}}save(){const t=this.validate(),e=t&&t.valid||!1;this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t,e;const n=(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"";return n!==""?parseInt(n,10):this._originalValue}validate(t,e){var n,r;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const o=e!==void 0?e:(n=this._inputElm)===null||n===void 0?void 0:n.value;return Xb(o,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minValue:this.columnEditor.minValue,maxValue:this.columnEditor.maxValue,required:!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}buildDomElement(){var t,e,n,r,o,s,l,u,p,c,f,m,v,_,C;const x=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",w=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.title)!==null&&r!==void 0?r:"",E=+((s=(o=this.columnEditor)===null||o===void 0?void 0:o.minValue)!==null&&s!==void 0?s:Xe.SLIDER_DEFAULT_MIN_VALUE),I=+((u=(l=this.columnEditor)===null||l===void 0?void 0:l.maxValue)!==null&&u!==void 0?u:Xe.SLIDER_DEFAULT_MAX_VALUE),k=+((c=(p=this.columnEditor)===null||p===void 0?void 0:p.valueStep)!==null&&c!==void 0?c:Xe.SLIDER_DEFAULT_STEP),F=(f=kl(this.columnEditor,"sliderStartValue"))!==null&&f!==void 0?f:E;this._defaultValue=+F,this._sliderTrackElm=De("div",{className:"slider-track"}),this._inputElm=De("input",{type:"range",title:w,defaultValue:`${F}`,value:`${F}`,min:`${E}`,max:`${I}`,step:`${(v=(m=this.columnEditor)===null||m===void 0?void 0:m.valueStep)!==null&&v!==void 0?v:Xe.SLIDER_DEFAULT_STEP}`,ariaLabel:(C=(_=this.columnEditor)===null||_===void 0?void 0:_.ariaLabel)!==null&&C!==void 0?C:`${jr(x+"")} Slider Editor`,className:`slider-editor-input editor-${x}`});const N=De("div",{className:"slider-container slider-editor"}),V=De("div",{className:"slider-input-container slider-editor"});if(V.appendChild(this._sliderTrackElm),V.appendChild(this._inputElm),N.appendChild(V),!kl(this.columnEditor,"hideSliderNumber")){N.classList.add("input-group");const Q=De("div",{className:"input-group-addon input-group-append slider-value"});this._sliderNumberElm=De("span",{className:"input-group-text",textContent:`${F}`}),Q.appendChild(this._sliderNumberElm),N.appendChild(Q)}return this._sliderOptions={minValue:E,maxValue:I,step:k},N}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeEvent(t){this._isValueTouched=!0;const e=this.args.compositeEditorOptions;e?this.handleChangeOnCompositeEditor(t,e):this.save()}handleChangeSliderNumber(t){var e,n,r;const o=(n=(e=t.target)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"";o!==""&&(!kl(this.columnEditor,"hideSliderNumber")&&this._sliderNumberElm&&(this._sliderNumberElm.textContent=o),this._inputElm.title=o,!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions||this.grid.onMouseEnter.notify({grid:this.grid},{...new Slick.EventData,target:t==null?void 0:t.target})),this.updateTrackFilledColorWhenEnabled()}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}sliderTrackClicked(t){t.preventDefault();const e=t.offsetX,n=this._sliderTrackElm.offsetWidth,r=(e+0)*100/n;this._inputElm&&(this._inputElm.value=`${r}`,this._inputElm.dispatchEvent(new Event("change")))}updateTrackFilledColorWhenEnabled(){var t,e,n;if(kl(this.columnEditor,"enableSliderTrackColoring")&&this._inputElm){const o=(+this.getValue()-+this._inputElm.min)/((e=(t=this.sliderOptions)===null||t===void 0?void 0:t.maxValue)!==null&&e!==void 0?e:0-+this._inputElm.min)*100,s="linear-gradient(to right, %b %p1, %c %p1, %c %p2, %b %p2)".replace(/%b/g,"#eee").replace(/%c/g,(n=kl(this.columnEditor,"sliderTrackFilledColor"))!==null&&n!==void 0?n:"var(--slick-slider-filter-thumb-color, #86bff8)").replace(/%p1/g,"0%").replace(/%p2/g,`${o}%`);this._sliderTrackElm.style.background=s,this._sliderOptions.sliderTrackBackground=s}}}const uf={autocompleter:Wb,checkbox:$b,date:jb,dualInput:qb,float:Zb,integer:Jb,longText:eC,multipleSelect:tC,password:Qb,singleSelect:iC,slider:nC,text:Pu},rC=(a,t,e)=>{let n=e;return e==null&&(n=""),`<div style="float: right">${n}</div>`},oC=(a,t,e,n,r)=>{var o;const s=n&&n.params||{},l=s.propertyNames,u=(o=s==null?void 0:s.includeTitle)!==null&&o!==void 0?o:!0;let p=s.dataContextProperty;if(p||(p=n&&n.field&&n.field.split(".")[0]),!l||!Array.isArray(l)||!p)throw new Error(`Formatters.arrayObjectToCsv requires you to pass an array of "propertyNames" (declared in "params") that you want to pull the data from.
51
+ For example: { editor: { collection: [{ value: true, label: 'True' },{ value: false, label: 'False'}] } }`);if(this._collectionService=new Lp(this._translaterService),this.enableTranslateLabel=(e=(t=this.columnEditor)===null||t===void 0?void 0:t.enableTranslateLabel)!==null&&e!==void 0?e:!1,this.labelName=(r=(n=this.customStructure)===null||n===void 0?void 0:n.label)!==null&&r!==void 0?r:"label",this.labelPrefixName=(s=(o=this.customStructure)===null||o===void 0?void 0:o.labelPrefix)!==null&&s!==void 0?s:"labelPrefix",this.labelSuffixName=(u=(l=this.customStructure)===null||l===void 0?void 0:l.labelSuffix)!==null&&u!==void 0?u:"labelSuffix",this.optionLabel=(c=(p=this.customStructure)===null||p===void 0?void 0:p.optionLabel)!==null&&c!==void 0?c:"value",this.valueName=(m=(f=this.customStructure)===null||f===void 0?void 0:f.value)!==null&&m!==void 0?m:"value",this.enableTranslateLabel&&(!this._translaterService||typeof this._translaterService.translate!="function"))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');this.renderDomElement(this.collection),(this.disabled||!((v=this.columnEditor)===null||v===void 0)&&v.collectionAsync&&Array.isArray(this.collection)&&this.collection.length===0)&&this.disable(!0)}getValue(){return this.isMultipleSelect?this.currentValues:this.currentValue}setValue(t,e=!1,n=!0){if(this.isMultipleSelect&&Array.isArray(t)?this.loadMultipleValues(t):this.loadSingleValue(t),e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(r,"system")}}hide(){this._msInstance&&this._msInstance.close()}show(t){!this.isCompositeEditor&&this._msInstance?this._msInstance.open(t):this.isCompositeEditor&&this.applyInputUsabilityState()}applyValue(t,e){var n,r,o,s,l;const u=(n=this.columnDef)===null||n===void 0?void 0:n.field,p=(r=this.columnDef)===null||r===void 0?void 0:r.type;let c=e;if(u!==void 0){(p===ie.number||p===ie.integer||p===ie.boolean)&&!isNaN(parseFloat(e))&&(c=parseFloat(e)),this.isMultipleSelect&&typeof e=="string"&&e.indexOf(",")>=0&&(c=e.split(","));const f=(u==null?void 0:u.indexOf("."))>0,m=this.validate(null,c);if(c=m!=null&&m.valid?c:"",f){const v=(l=(s=(o=this.columnEditor)===null||o===void 0?void 0:o.complexObjectPath)!==null&&s!==void 0?s:u)!==null&&l!==void 0?l:"";cr(t,v,c)}else t[u]=c}}destroy(){var t,e;this._msInstance&&this.hasAutoCommitEdit&&this.isValueChanged()&&!this._isDisposingOrCallingSave&&!this.isCompositeEditor&&(this._isDisposingOrCallingSave=!0,this.save(!0)),this._isDisposingOrCallingSave=!0,(t=this._msInstance)===null||t===void 0||t.destroy(),(e=this.editorElm)===null||e===void 0||e.remove(),this._msInstance=void 0}loadValue(t){var e,n,r;const o=(e=this.columnDef)===null||e===void 0?void 0:e.field,s=o!==void 0&&(o==null?void 0:o.indexOf("."))>0;if(t&&o!==void 0){const l=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.complexObjectPath)!==null&&r!==void 0?r:o,u=s?_n(t,l):t.hasOwnProperty(o)&&t[o],p=s&&(u!=null&&u.hasOwnProperty(this.valueName))?u[this.valueName]:u;this.isMultipleSelect&&Array.isArray(p)?this.loadMultipleValues(p):this.loadSingleValue(p)}}loadMultipleValues(t){var e;if(Array.isArray(t)){this.originalValue=t.map(r=>typeof r=="number"||typeof r=="boolean"?`${r}`:r),(e=this._msInstance)===null||e===void 0||e.setSelects(this.originalValue);const n=this.args.compositeEditorOptions;n&&this.handleChangeOnCompositeEditor(n)}}loadSingleValue(t){var e;this.originalValue=typeof t=="number"||typeof t=="boolean"?`${t}`:t,(e=this._msInstance)===null||e===void 0||e.setSelects([this.originalValue])}serializeValue(){return this.isMultipleSelect?this.currentValues:this.currentValue}changeEditorOption(t,e){var n;this.columnEditor&&(this.columnEditor.editorOptions||(this.columnEditor.editorOptions={}),this.columnEditor.editorOptions[t]=e,this.editorElmOptions={...this.editorElmOptions,[t]:e},(n=this._msInstance)===null||n===void 0||n.refreshOptions(this.editorElmOptions))}disable(t=!0){const e=this.disabled;if(this.disabled=t,this._msInstance)if(t){this._msInstance.disable();const n=this.getValue(),r=Array.isArray(n)&&this.isMultipleSelect?(n==null?void 0:n[0])==="":n==="";e!==t&&this.isCompositeEditor&&!r&&this.reset("",!0,!0)}else this._msInstance.enable()}focus(){var t;this.grid.focus(),(t=this._msInstance)===null||t===void 0||t.focus()}isValueChanged(){var t;const e=(t=this._msInstance)===null||t===void 0?void 0:t.getSelects();if(this.isMultipleSelect)return!es(e,this.originalValue);const n=Array.isArray(e)&&e.length>0?e[0]:void 0;return n!==void 0&&n!==this.originalValue}isValueTouched(){return this._isValueTouched}reset(t,e=!0,n=!1){const r=t??this.originalValue;if(this._msInstance){this.originalValue=this.isMultipleSelect?r!==void 0?[r]:[]:r;const s=this.originalValue===void 0?[]:[this.originalValue];this._msInstance.setSelects(s)}this._isValueTouched=!1;const o=this.args.compositeEditorOptions;if(o&&e){const s=!n;this.handleChangeOnCompositeEditor(o,"user",s)}}save(t=!1){var e;const n=this.validate(),r=(e=n==null?void 0:n.valid)!==null&&e!==void 0?e:!1;(!this._isDisposingOrCallingSave||t)&&this.hasAutoCommitEdit&&r?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}validate(t,e){var n,r;const o=this.isCompositeEditor?!1:(n=this.columnEditor)===null||n===void 0?void 0:n.required,s=e!==void 0?e:(r=this._msInstance)===null||r===void 0?void 0:r.getSelects(),l=this.columnEditor&&this.columnEditor.errorMessage;if(this.isCompositeEditor&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};if(this.validator){const u=e!==void 0?e:this.isMultipleSelect?this.currentValues:this.currentValue;return this.validator(u,this.args)}return o&&(s===""||Array.isArray(s)&&s.length===0)?{valid:!1,msg:l||Xe.VALIDATION_REQUIRED_FIELD}:{valid:!0,msg:null}}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}filterCollection(t){var e,n;let r=t;if(this.columnEditor&&this.columnEditor.collectionFilterBy){const o=this.columnEditor.collectionFilterBy,s=(n=(e=this.columnEditor.collectionOptions)===null||e===void 0?void 0:e.filterResultAfterEachPass)!==null&&n!==void 0?n:null;r=this._collectionService.filterCollection(r,o,s)}return r}sortCollection(t){let e=t;if(this.columnDef&&this.columnEditor&&this.columnEditor.collectionSortBy){const n=this.columnEditor.collectionSortBy;e=this._collectionService.sortCollection(this.columnDef,e,n,this.enableTranslateLabel)}return e}renderDomElement(t){var e,n,r,o,s;if(!Array.isArray(t)&&(!((e=this.collectionOptions)===null||e===void 0)&&e.collectionInsideObjectProperty)){const c=this.collectionOptions.collectionInsideObjectProperty;t=_n(t,c)}if(!Array.isArray(t))throw new Error('The "collection" passed to the Select Editor is not a valid array.');let l=[];if(t.length>0&&(l=[...t]),!((n=this.collectionOptions)===null||n===void 0)&&n.addBlankEntry&&Array.isArray(l)&&l.length>0&&l[0][this.valueName]!==""&&(l.unshift(this.createBlankEntry()),this.collection.unshift(this.createBlankEntry())),!((r=this.collectionOptions)===null||r===void 0)&&r.addCustomFirstEntry&&Array.isArray(l)&&l.length>0&&l[0][this.valueName]!==this.collectionOptions.addCustomFirstEntry[this.valueName]&&(l.unshift(this.collectionOptions.addCustomFirstEntry),this.collection.unshift(this.collectionOptions.addCustomFirstEntry)),!((o=this.collectionOptions)===null||o===void 0)&&o.addCustomLastEntry&&Array.isArray(l)&&l.length>0){const c=l.length-1;l[c][this.valueName]!==this.collectionOptions.addCustomLastEntry[this.valueName]&&l.push(this.collectionOptions.addCustomLastEntry)}let u=l;if(u=this.filterCollection(u),u=this.sortCollection(u),!((s=this.columnEditor)===null||s===void 0)&&s.collectionOverride){const c={column:this.columnDef,dataContext:this.dataContext,grid:this.grid,originalCollections:this.collection};if(this.args.compositeEditorOptions){const{formValues:f,modalType:m}=this.args.compositeEditorOptions;c.compositeEditorOptions={formValues:f,modalType:m}}u=this.columnEditor.collectionOverride(u,c)}this.finalCollection=u;const p=Kp("editor",u,this.columnDef,this.grid,this.isMultipleSelect,this._translaterService);this.createDomElement(p.selectElement,p.dataCollection)}createBlankEntry(){const t={[this.labelName]:"",[this.valueName]:""};return this.labelPrefixName&&(t[this.labelPrefixName]=""),this.labelSuffixName&&(t[this.labelSuffixName]=""),t}createDomElement(t,e){var n,r,o,s,l;const u=this.args.container;t&&u&&typeof u.appendChild=="function"&&(en(u),u.appendChild(t));const p=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.placeholder)!==null&&r!==void 0?r:"";this.defaultOptions.placeholder=p||"";const c=(l=(s=(o=this.columnDef)===null||o===void 0?void 0:o.internalColumnEditor)===null||s===void 0?void 0:s.editorOptions)!==null&&l!==void 0?l:{};this.editorElmOptions={...this.defaultOptions,...c,data:e},this._msInstance=ha(t,this.editorElmOptions),this.editorElm=this._msInstance.getParentElement(),this.isCompositeEditor||(this.delayOpening>=0?setTimeout(()=>this.show()):this.show())}handleChangeOnCompositeEditor(t,e="user",n=!1){var r,o,s,l,u;const p=this.grid.getActiveCell(),c=this.args.column,f=(o=(r=this.columnDef)===null||r===void 0?void 0:r.id)!==null&&o!==void 0?o:"",m=this.dataContext,v=this.grid,_=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,_),this.applyValue(t.formValues,_);const C=(u=(l=(s=this.gridOptions)===null||s===void 0?void 0:s.compositeEditorOptions)===null||l===void 0?void 0:l.excludeDisabledFieldFormValues)!==null&&u!==void 0?u:!1;(n||this.disabled&&C&&t.formValues.hasOwnProperty(f))&&delete t.formValues[f],v.onCompositeEditorChange.notify({...p,item:m,grid:v,column:c,formValues:t.formValues,editors:t.editors,triggeredBy:e},new Slick.EventData)}}class tC extends dv{constructor(t,e=0){super(t,!0,e),this.args=t,this.delayOpening=e}}class iC extends dv{constructor(t,e=0){super(t,!1,e),this.args=t,this.delayOpening=e}}class nC{constructor(t){if(this.args=t,this._defaultValue=0,this._isValueTouched=!1,this._sliderNumberElm=null,this.disabled=!1,!t)throw new Error("[Slickgrid-Universal] Something is wrong with this grid, an Editor must always have valid arguments.");this.grid=t.grid,this.gridOptions=this.grid.getOptions()||{},this._bindEventService=new Fn,this.init()}get columnDef(){return this.args.column}get columnEditor(){return this.columnDef&&this.columnDef.internalColumnEditor||{}}get dataContext(){return this.args.item}get editorDomElement(){return this._editorElm}get editorInputDomElement(){return this._inputElm}get hasAutoCommitEdit(){var t;return(t=this.gridOptions.autoCommitEdit)!==null&&t!==void 0?t:!1}get sliderOptions(){return this._sliderOptions}get validator(){var t,e,n;return(e=(t=this.columnEditor)===null||t===void 0?void 0:t.validator)!==null&&e!==void 0?e:(n=this.columnDef)===null||n===void 0?void 0:n.validator}init(){var t;if(this._cellContainerElm=(t=this.args)===null||t===void 0?void 0:t.container,this._cellContainerElm&&this.columnDef){const e=this.args.compositeEditorOptions;this._editorElm=this.buildDomElement(),e||this.focus(),this._cellContainerElm.appendChild(this._editorElm),this._bindEventService.bind(this._sliderTrackElm,["click","mouseup"],this.sliderTrackClicked.bind(this)),this._bindEventService.bind(this._inputElm,["change","mouseup","touchend"],this.handleChangeEvent.bind(this)),this._bindEventService.bind(this._inputElm,["input","change"],this.handleChangeSliderNumber.bind(this))}}cancel(){this._inputElm&&(this._inputElm.value=`${this._originalValue}`),this.args.cancelChanges()}destroy(){var t,e,n;this._bindEventService.unbindAll(),(t=this._inputElm)===null||t===void 0||t.remove(),(e=this._editorElm)===null||e===void 0||e.remove(),(n=this._sliderTrackElm)===null||n===void 0||n.remove()}disable(t=!0){var e;const n=this.disabled;if(this.disabled=t,this._inputElm)if(t){this._inputElm.disabled=!0;const r=this.getValue();n!==t&&(!((e=this.args)===null||e===void 0)&&e.compositeEditorOptions)&&r!==""&&this.reset(0,!0,!0)}else this._inputElm.disabled=!1}focus(){this.grid.focus(),this._inputElm&&this._inputElm.focus()}show(){var t;!!(!((t=this.args)===null||t===void 0)&&t.compositeEditorOptions)&&this.applyInputUsabilityState()}getValue(){var t,e;return(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:""}setValue(t,e=!1,n=!0){if(this._inputElm&&(this._inputElm.value=`${t}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${t}`),e){this.applyValue(this.args.item,this.serializeValue());const r=this.args.compositeEditorOptions;r&&n&&this.handleChangeOnCompositeEditor(null,r,"system")}}applyValue(t,e){var n,r,o,s,l;const u=(r=(n=this.columnDef)===null||n===void 0?void 0:n.field)!==null&&r!==void 0?r:"";if(u!==void 0){const p=(u==null?void 0:u.indexOf("."))>0,c=this.validate(void 0,e),f=c&&c.valid?e:"";if(p){const m=(l=(s=(o=this.columnEditor)===null||o===void 0?void 0:o.complexObjectPath)!==null&&s!==void 0?s:u)!==null&&l!==void 0?l:"";cr(t,m,f)}else t&&(t[u]=f)}}isValueChanged(){var t,e;const n=(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"";return!(n===""&&this._originalValue===void 0)&&+n!==this._originalValue}isValueTouched(){return this._isValueTouched}loadValue(t){var e,n;const r=(n=(e=this.columnDef)===null||e===void 0?void 0:e.field)!==null&&n!==void 0?n:"";if(t&&r!==void 0){let s=(r==null?void 0:r.indexOf("."))>0?_n(t,r):t.hasOwnProperty(r)?t[r]:this._defaultValue;(s===""||s===null||s===void 0)&&(s=this._defaultValue),this._originalValue=+s,this._inputElm&&(this._inputElm.value=`${s}`,this._inputElm.title=`${s}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${s}`)}this.updateTrackFilledColorWhenEnabled()}reset(t,e=!0,n=!1){var r;const o=(r=t??this._originalValue)!==null&&r!==void 0?r:0;this._inputElm&&(this._inputElm.value=`${o}`),this._sliderNumberElm&&(this._sliderNumberElm.textContent=`${o}`),this._isValueTouched=!1;const s=this.args.compositeEditorOptions;if(s&&e){const l=!n;this.handleChangeOnCompositeEditor(null,s,"user",l)}}save(){const t=this.validate(),e=t&&t.valid||!1;this.hasAutoCommitEdit&&e?this.grid.getEditorLock().commitCurrentEdit():this.args.commitChanges()}serializeValue(){var t,e;const n=(e=(t=this._inputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"";return n!==""?parseInt(n,10):this._originalValue}validate(t,e){var n,r;if(this.args.compositeEditorOptions&&this.applyInputUsabilityState(),this.disabled)return{valid:!0,msg:""};const o=e!==void 0?e:(n=this._inputElm)===null||n===void 0?void 0:n.value;return Xb(o,{editorArgs:this.args,errorMessage:this.columnEditor.errorMessage,minValue:this.columnEditor.minValue,maxValue:this.columnEditor.maxValue,required:!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions?!1:this.columnEditor.required,validator:this.validator})}buildDomElement(){var t,e,n,r,o,s,l,u,p,c,f,m,v,_,C;const x=(e=(t=this.columnDef)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:"",w=(r=(n=this.columnEditor)===null||n===void 0?void 0:n.title)!==null&&r!==void 0?r:"",E=+((s=(o=this.columnEditor)===null||o===void 0?void 0:o.minValue)!==null&&s!==void 0?s:Xe.SLIDER_DEFAULT_MIN_VALUE),I=+((u=(l=this.columnEditor)===null||l===void 0?void 0:l.maxValue)!==null&&u!==void 0?u:Xe.SLIDER_DEFAULT_MAX_VALUE),k=+((c=(p=this.columnEditor)===null||p===void 0?void 0:p.valueStep)!==null&&c!==void 0?c:Xe.SLIDER_DEFAULT_STEP),F=(f=kl(this.columnEditor,"sliderStartValue"))!==null&&f!==void 0?f:E;this._defaultValue=+F,this._sliderTrackElm=De("div",{className:"slider-track"}),this._inputElm=De("input",{type:"range",title:w,defaultValue:`${F}`,value:`${F}`,min:`${E}`,max:`${I}`,step:`${(v=(m=this.columnEditor)===null||m===void 0?void 0:m.valueStep)!==null&&v!==void 0?v:Xe.SLIDER_DEFAULT_STEP}`,ariaLabel:(C=(_=this.columnEditor)===null||_===void 0?void 0:_.ariaLabel)!==null&&C!==void 0?C:`${jr(x+"")} Slider Editor`,className:`slider-editor-input editor-${x}`});const N=De("div",{className:"slider-container slider-editor"}),V=De("div",{className:"slider-input-container slider-editor"});if(V.appendChild(this._sliderTrackElm),V.appendChild(this._inputElm),N.appendChild(V),!kl(this.columnEditor,"hideSliderNumber")){N.classList.add("input-group");const Q=De("div",{className:"input-group-addon input-group-append slider-value"});this._sliderNumberElm=De("span",{className:"input-group-text",textContent:`${F}`}),Q.appendChild(this._sliderNumberElm),N.appendChild(Q)}return this._sliderOptions={minValue:E,maxValue:I,step:k},N}applyInputUsabilityState(){const t=this.grid.getActiveCell(),e=this.grid.onBeforeEditCell.notify({...t,item:this.dataContext,column:this.args.column,grid:this.grid,target:"composite",compositeEditorOptions:this.args.compositeEditorOptions}).getReturnValue();this.disable(e===!1)}handleChangeEvent(t){this._isValueTouched=!0;const e=this.args.compositeEditorOptions;e?this.handleChangeOnCompositeEditor(t,e):this.save()}handleChangeSliderNumber(t){var e,n,r;const o=(n=(e=t.target)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"";o!==""&&(!kl(this.columnEditor,"hideSliderNumber")&&this._sliderNumberElm&&(this._sliderNumberElm.textContent=o),this._inputElm.title=o,!((r=this.args)===null||r===void 0)&&r.compositeEditorOptions||this.grid.onMouseEnter.notify({grid:this.grid},{...new Slick.EventData,target:t==null?void 0:t.target})),this.updateTrackFilledColorWhenEnabled()}handleChangeOnCompositeEditor(t,e,n="user",r=!1){var o,s,l,u,p;const c=this.grid.getActiveCell(),f=this.args.column,m=(s=(o=this.columnDef)===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:"",v=this.dataContext,_=this.grid,C=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,C),this.applyValue(e.formValues,C);const x=(p=(u=(l=this.gridOptions)===null||l===void 0?void 0:l.compositeEditorOptions)===null||u===void 0?void 0:u.excludeDisabledFieldFormValues)!==null&&p!==void 0?p:!1;(r||this.disabled&&x&&e.formValues.hasOwnProperty(m))&&delete e.formValues[m],_.onCompositeEditorChange.notify({...c,item:v,grid:_,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}sliderTrackClicked(t){t.preventDefault();const e=t.offsetX,n=this._sliderTrackElm.offsetWidth,r=(e+0)*100/n;this._inputElm&&(this._inputElm.value=`${r}`,this._inputElm.dispatchEvent(new Event("change")))}updateTrackFilledColorWhenEnabled(){var t,e,n;if(kl(this.columnEditor,"enableSliderTrackColoring")&&this._inputElm){const o=(+this.getValue()-+this._inputElm.min)/((e=(t=this.sliderOptions)===null||t===void 0?void 0:t.maxValue)!==null&&e!==void 0?e:0-+this._inputElm.min)*100,s="linear-gradient(to right, %b %p1, %c %p1, %c %p2, %b %p2)".replace(/%b/g,"#eee").replace(/%c/g,(n=kl(this.columnEditor,"sliderTrackFilledColor"))!==null&&n!==void 0?n:"var(--slick-slider-filter-thumb-color, #86bff8)").replace(/%p1/g,"0%").replace(/%p2/g,`${o}%`);this._sliderTrackElm.style.background=s,this._sliderOptions.sliderTrackBackground=s}}}const uf={autocompleter:Wb,checkbox:$b,date:jb,dualInput:qb,float:Zb,integer:Jb,longText:eC,multipleSelect:tC,password:Qb,singleSelect:iC,slider:nC,text:Pu},rC=(a,t,e)=>{let n=e;return e==null&&(n=""),`<div style="float: right">${n}</div>`},oC=(a,t,e,n,r)=>{var o;const s=n&&n.params||{},l=s.propertyNames,u=(o=s==null?void 0:s.includeTitle)!==null&&o!==void 0?o:!0;let p=s.dataContextProperty;if(p||(p=n&&n.field&&n.field.split(".")[0]),!l||!Array.isArray(l)||!p)throw new Error(`Formatters.arrayObjectToCsv requires you to pass an array of "propertyNames" (declared in "params") that you want to pull the data from.
52
52
  For example, if we have an array of user objects that have the property of firstName & lastName then we need to pass in your column definition:: { params: { propertyNames: ['firtName'] }}.
53
53
  Optionally, you can also pass the "dataContextProperty" if you wish to run this on another completely different field of the dataContext object.`);if(r[p]&&Array.isArray(r[p])&&Array.isArray(r[p])&&r[p].length>0){const c=[];r[p].forEach(m=>{const v=[];l.forEach(_=>{v.push(m[_])}),c.push(v.join(" "))});const f=c.join(", ");return u?`<span title="${f}">${f}</span>`:f}return e},Mu=(a,t,e)=>{if(e&&Array.isArray(e)&&e.length>0){const n=e.join(", ");return`<span title="${n}">${n}</span>`}return e},sC=(a,t,e)=>e?`<b>${e}</b>`:"",uv=(a,t,e)=>{let n=e;return e==null&&(n=""),`<center>${n}</center>`},lC=(a,t,e)=>e?"&#x2611;":"",aC=(a,t,e)=>{let n=!1;const r=rr(e);return r&&(e=+e),(e===!0||r&&+e>0||typeof e=="string"&&e.length>0&&e.toLowerCase()!=="false"&&e!=="0")&&(n=!0),n?'<i class="mdi mdi-18px mdi-check checkmark-icon" aria-hidden="true"></i>':""},dC=(a,t,e)=>{let n=!1;const r=rr(e);return r&&(e=+e),(e===!0||r&&+e>0||typeof e=="string"&&e.length>0&&e.toLowerCase()!=="false"&&e!=="0")&&(n=!0),n?'<i class="fa fa-check checkmark-icon" aria-hidden="true"></i>':""},uC=(a,t,e,n,r,o)=>{if(!e||!n||!n.internalColumnEditor||!n.internalColumnEditor.collection||!n.internalColumnEditor.collection.length)return e;const{internalColumnEditor:s,internalColumnEditor:{collection:l}}=n,u=s.customStructure?s.customStructure.label:"label",p=s.customStructure?s.customStructure.value:"value";return Array.isArray(e)?l.every(c=>typeof c=="string")?Mu(a,t,e.map(c=>bs(l,f=>f===c))):Mu(a,t,e.map(c=>bs(l,f=>f[p]===c)[u])):bs(l,c=>c[p]===e)[u]||""},cC=(a,t,e,n,r,o)=>{if(!e||!n||!n.params||!n.params.collection||!n.params.collection.length)return e;const{params:s,params:{collection:l}}=n,u=s.customStructure?s.customStructure.label:"label",p=s.customStructure?s.customStructure.value:"value";return Array.isArray(e)?Mu(a,t,e.map(c=>bs(l,f=>f[p]===c)[u])):bs(l,c=>c[p]===e)[u]||""},cv=(a,t,e,n,r)=>{var o,s,l;if(!n)return"";const u=n.params||{},p=(s=(o=u==null?void 0:u.complexField)!==null&&o!==void 0?o:u==null?void 0:u.complexFieldLabel)!==null&&s!==void 0?s:n.field;if(!p)throw new Error(`For the Formatters.complexObject to work properly, you need to tell it which property of the complex object to use.
54
54
  There are 3 ways to provide it: