@slickgrid-universal/vanilla-force-bundle 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(Fn,Cl){typeof exports=="object"&&typeof module<"u"?Cl(exports):typeof define=="function"&&define.amd?define(["exports"],Cl):(Fn=typeof globalThis<"u"?globalThis:Fn||self,Cl(Fn.Slicker={}))})(this,function(Fn){"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 yp{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 Wg=Object.freeze(Object.defineProperty({__proto__:null,BackendUtilityService:yp},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 Zc(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 $g=Object.freeze(Object.defineProperty({__proto__:null,collectionObserver:Na,propertyObserver:Zc},Symbol.toStringTag,{value:"Module"})),Yg=a=>a;function jg(a,t,e=Yg,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 Qc(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 Ep={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 R=[],H=g.length,ee=0;ee<H;++ee)R.push(S(g[ee],ee));return R}function m(g,S){for(var R in S)s(S,R)&&(g[R]=S[R]);return s(S,"toString")&&(g.toString=S.toString),s(S,"valueOf")&&(g.valueOf=S.valueOf),g}function v(g,S,R,H){return Je(g,S,R,H,!0).utc()}function b(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=b(g),R=w.call(S.parsedDateParts,function(H){return H!=null}),R=!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&&R);if(g._strict&&(R=R&&S.charsLeftOver===0&&S.unusedTokens.length===0&&S.bigHour===void 0),Object.isFrozen!=null&&Object.isFrozen(g))return R;g._isValid=R}return g._isValid}function x(g){var S=v(NaN);return g!=null?m(b(S),g):b(S).userInvalidated=!0,S}var w=Array.prototype.some||function(g){for(var S=Object(this),R=S.length>>>0,H=0;H<R;H++)if(H in S&&g.call(this,S[H],H,S))return!0;return!1},E=n.momentProperties=[],D=!1;function A(g,S){var R,H,ee,we=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=b(S)),u(S._locale)||(g._locale=S._locale),0<we)for(R=0;R<we;R++)u(ee=S[H=E[R]])||(g[H]=ee);return g}function F(g){A(this,g),this._d=new Date(g._d!=null?g._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),D===!1&&(D=!0,n.updateOffset(this),D=!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 R=!0;return m(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,g),R){for(var H,ee,we=[],He=arguments.length,qe=0;qe<He;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];we.push(H)}V(g+`
|
|
3
3
|
Arguments: `+Array.prototype.slice.call(we).join("")+`
|
|
4
|
-
`+new Error().stack),R=!1}return S.apply(this,arguments)},S)}var L={};function le(g,S){n.deprecationHandler!=null&&n.deprecationHandler(g,S),L[g]||(V(S),L[g]=!0)}function ve(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function J(g,S){var R,H=m({},g);for(R in S)s(S,R)&&(o(g[R])&&o(S[R])?(H[R]={},m(H[R],g[R]),m(H[R],S[R])):S[R]!=null?H[R]=S[R]:delete H[R]);for(R in g)s(g,R)&&!s(S,R)&&o(g[R])&&(H[R]=m({},H[R]));return H}function z(g){g!=null&&this.set(g)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var P=Object.keys||function(g){var S,R=[];for(S in g)s(g,S)&&R.push(S);return R};function ae(g,S,R){var H=""+Math.abs(g);return(0<=g?R?"+":"":"-")+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,Re=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,xe={},Oe={};function De(g,S,R,H){var ee=typeof H=="string"?function(){return this[H]()}:H;g&&(Oe[g]=ee),S&&(Oe[S[0]]=function(){return ae(ee.apply(this,arguments),S[1],S[2])}),R&&(Oe[R]=function(){return this.localeData().ordinal(ee.apply(this,arguments),g)})}function re(g,S){return g.isValid()?(S=pe(S,g.localeData()),xe[S]=xe[S]||function(R){for(var H,ee=R.match(Ke),we=0,He=ee.length;we<He;we++)Oe[ee[we]]?ee[we]=Oe[ee[we]]:ee[we]=(H=ee[we]).match(/\[[\s\S]/)?H.replace(/^\[|\]$/g,""):H.replace(/\\/g,"");return function(qe){for(var Ct="",ht=0;ht<He;ht++)Ct+=ve(ee[ht])?ee[ht].call(qe,R):ee[ht];return Ct}}(S),xe[S](g)):g.localeData().invalidDate()}function pe(g,S){var R=5;function H(ee){return S.longDateFormat(ee)||ee}for(Re.lastIndex=0;0<=R&&Re.test(g);)g=g.replace(Re,H),Re.lastIndex=0,--R;return g}var Ve={};function Ye(g,S){var R=g.toLowerCase();Ve[R]=Ve[R+"s"]=Ve[S]=g}function Be(g){return typeof g=="string"?Ve[g]||Ve[g.toLowerCase()]:void 0}function ue(g){var S,R,H={};for(R in g)s(g,R)&&(S=Be(R))&&(H[S]=g[R]);return H}var Ce={};function be(g,S){Ce[g]=S}function Le(g){return g%4==0&&g%100!=0||g%400==0}function nt(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ge(S){var S=+S,R=0;return R=S!=0&&isFinite(S)?nt(S):R}function Et(g,S){return function(R){return R!=null?(k(this,g,R),n.updateOffset(this,S),this):at(this,g)}}function at(g,S){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+S]():NaN}function k(g,S,R){g.isValid()&&!isNaN(R)&&(S==="FullYear"&&Le(g.year())&&g.month()===1&&g.date()===29?(R=Ge(R),g._d["set"+(g._isUTC?"UTC":"")+S](R,g.month(),Li(R,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+S](R))}var te=/\d/,Mt=/\d\d/,_e=/\d{3}/,qi=/\d{4}/,sn=/[+-]?\d{6}/,$=/\d\d?/,X=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,Pe=/\d{1,3}/,jn=/\d{1,4}/,Tr=/[+-]?\d{1,6}/,Me=/\d+/,fe=/[+-]?\d+/,Ue=/Z|[+-]\d\d:?\d\d/gi,ft=/Z|[+-]\d\d(?::?\d\d)?/gi,ze=/[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 Ne(g,S,R){yi[g]=ve(S)?S:function(H,ee){return H&&R?R:S}}function Xt(g,S){return s(yi,g)?yi[g](S._strict,S._locale):new RegExp(It(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(R,H,ee,we,He){return H||ee||we||He})))}function It(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var yi={},q={};function W(g,S){var R,H,ee=S;for(typeof g=="string"&&(g=[g]),p(S)&&(ee=function(we,He){He[S]=Ge(we)}),H=g.length,R=0;R<H;R++)q[g[R]]=ee}function me(g,S){W(g,function(R,H,ee,we){ee._w=ee._w||{},S(R,ee._w,ee,we)})}var ke,st=0,rt=1,ut=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 R=(S%(R=12)+R)%R;return g+=(S-R)/12,R==1?Le(g)?29:28:31-R%7%2}ke=Array.prototype.indexOf||function(g){for(var S=0;S<this.length;++S)if(this[S]===g)return S;return-1},De("M",["MM",2],"Mo",function(){return this.month()+1}),De("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)}),De("MMMM",0,0,function(g){return this.localeData().months(this,g)}),Ye("month","M"),be("month",8),Ne("M",$),Ne("MM",$,Mt),Ne("MMM",function(g,S){return S.monthsShortRegex(g)}),Ne("MMMM",function(g,S){return S.monthsRegex(g)}),W(["M","MM"],function(g,S){S[rt]=Ge(g)-1}),W(["MMM","MMMM"],function(g,S,R,H){H=R._locale.monthsParse(g,H,R._strict),H!=null?S[rt]=H:b(R).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?/,Se=ze,ot=ze;function mt(g,S){var R;if(g.isValid()){if(typeof S=="string"){if(/^\d+$/.test(S))S=Ge(S);else if(!p(S=g.localeData().monthsParse(S)))return}R=Math.min(g.date(),Li(g.year(),S)),g._d["set"+(g._isUTC?"UTC":"")+"Month"](S,R)}}function ct(g){return g!=null?(mt(this,g),n.updateOffset(this,!0),this):at(this,"Month")}function wt(){function g(He,qe){return qe.length-He.length}for(var S,R=[],H=[],ee=[],we=0;we<12;we++)S=v([2e3,we]),R.push(this.monthsShort(S,"")),H.push(this.months(S,"")),ee.push(this.months(S,"")),ee.push(this.monthsShort(S,""));for(R.sort(g),H.sort(g),ee.sort(g),we=0;we<12;we++)R[we]=It(R[we]),H[we]=It(H[we]);for(we=0;we<24;we++)ee[we]=It(ee[we]);this._monthsRegex=new RegExp("^("+ee.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+H.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+R.join("|")+")","i")}function Vt(g){return Le(g)?366:365}De("Y",0,0,function(){var g=this.year();return g<=9999?ae(g,4):"+"+g}),De(0,["YY",2],0,function(){return this.year()%100}),De(0,["YYYY",4],0,"year"),De(0,["YYYYY",5],0,"year"),De(0,["YYYYYY",6,!0],0,"year"),Ye("year","y"),be("year",1),Ne("Y",fe),Ne("YY",$,Mt),Ne("YYYY",jn,qi),Ne("YYYYY",Tr,sn),Ne("YYYYYY",Tr,sn),W(["YYYYY","YYYYYY"],st),W("YYYY",function(g,S){S[st]=g.length===2?n.parseTwoDigitYear(g):Ge(g)}),W("YY",function(g,S){S[st]=n.parseTwoDigitYear(g)}),W("Y",function(g,S){S[st]=parseInt(g,10)}),n.parseTwoDigitYear=function(g){return Ge(g)+(68<Ge(g)?1900:2e3)};var xo=Et("FullYear",!0);function yt(g,S,R,H,ee,we,He){var qe;return g<100&&0<=g?(qe=new Date(g+400,S,R,H,ee,we,He),isFinite(qe.getFullYear())&&qe.setFullYear(g)):qe=new Date(g,S,R,H,ee,we,He),qe}function gt(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,R){return R=7+S-R,R-(7+gt(g,0,R).getUTCDay()-S)%7-1}function Ii(g,He,qe,H,ee){var we,He=1+7*(He-1)+(7+qe-H)%7+Zt(g,H,ee),qe=He<=0?Vt(we=g-1)+He:He>Vt(g)?(we=g+1,He-Vt(g)):(we=g,He);return{year:we,dayOfYear:qe}}function Gi(g,S,R){var H,ee,we=Zt(g.year(),S,R),we=Math.floor((g.dayOfYear()-we-1)/7)+1;return we<1?H=we+Qt(ee=g.year()-1,S,R):we>Qt(g.year(),S,R)?(H=we-Qt(g.year(),S,R),ee=g.year()+1):(ee=g.year(),H=we),{week:H,year:ee}}function Qt(g,ee,R){var H=Zt(g,ee,R),ee=Zt(g+1,ee,R);return(Vt(g)-H+ee)/7}De("w",["ww",2],"wo","week"),De("W",["WW",2],"Wo","isoWeek"),Ye("week","w"),Ye("isoWeek","W"),be("week",5),be("isoWeek",5),Ne("w",$),Ne("ww",$,Mt),Ne("W",$),Ne("WW",$,Mt),me(["w","ww","W","WW"],function(g,S,R,H){S[H.substr(0,1)]=Ge(g)});function Hi(g,S){return g.slice(S,7).concat(g.slice(0,S))}De("d",0,"do","day"),De("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),De("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),De("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),De("e",0,0,"weekday"),De("E",0,0,"isoWeekday"),Ye("day","d"),Ye("weekday","e"),Ye("isoWeekday","E"),be("day",11),be("weekday",11),be("isoWeekday",11),Ne("d",$),Ne("e",$),Ne("E",$),Ne("dd",function(g,S){return S.weekdaysMinRegex(g)}),Ne("ddd",function(g,S){return S.weekdaysShortRegex(g)}),Ne("dddd",function(g,S){return S.weekdaysRegex(g)}),me(["dd","ddd","dddd"],function(g,S,R,H){H=R._locale.weekdaysParse(g,H,R._strict),H!=null?S.d=H:b(R).invalidWeekday=g}),me(["d","e","E"],function(g,S,R,H){S[H]=Ge(g)});var Ln="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ye=ze,Xe=ze,pt=ze;function Jt(){function g(ht,zt){return zt.length-ht.length}for(var S,R,H,ee=[],we=[],He=[],qe=[],Ct=0;Ct<7;Ct++)H=v([2e3,1]).day(Ct),S=It(this.weekdaysMin(H,"")),R=It(this.weekdaysShort(H,"")),H=It(this.weekdays(H,"")),ee.push(S),we.push(R),He.push(H),qe.push(S),qe.push(R),qe.push(H);ee.sort(g),we.sort(g),He.sort(g),qe.sort(g),this._weekdaysRegex=new RegExp("^("+qe.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+He.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+we.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+ee.join("|")+")","i")}function Mi(){return this.hours()%12||12}function vn(g,S){De(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),S)})}function pi(g,S){return S._meridiemParse}De("H",["HH",2],0,"hour"),De("h",["hh",2],0,Mi),De("k",["kk",2],0,function(){return this.hours()||24}),De("hmm",0,0,function(){return""+Mi.apply(this)+ae(this.minutes(),2)}),De("hmmss",0,0,function(){return""+Mi.apply(this)+ae(this.minutes(),2)+ae(this.seconds(),2)}),De("Hmm",0,0,function(){return""+this.hours()+ae(this.minutes(),2)}),De("Hmmss",0,0,function(){return""+this.hours()+ae(this.minutes(),2)+ae(this.seconds(),2)}),vn("a",!0),vn("A",!1),Ye("hour","h"),be("hour",13),Ne("a",pi),Ne("A",pi),Ne("H",$),Ne("h",$),Ne("k",$),Ne("HH",$,Mt),Ne("hh",$,Mt),Ne("kk",$,Mt),Ne("hmm",X),Ne("hmmss",ne),Ne("Hmm",X),Ne("Hmmss",ne),W(["H","HH"],Rt),W(["k","kk"],function(g,S,R){g=Ge(g),S[Rt]=g===24?0:g}),W(["a","A"],function(g,S,R){R._isPm=R._locale.isPM(g),R._meridiem=g}),W(["h","hh"],function(g,S,R){S[Rt]=Ge(g),b(R).bigHour=!0}),W("hmm",function(g,S,R){var H=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H)),b(R).bigHour=!0}),W("hmmss",function(g,S,R){var H=g.length-4,ee=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H,2)),S[Tt]=Ge(g.substr(ee)),b(R).bigHour=!0}),W("Hmm",function(g,S,R){var H=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H))}),W("Hmmss",function(g,S,R){var H=g.length-4,ee=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H,2)),S[Tt]=Ge(g.substr(ee))}),ze=Et("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:Ln,weekdaysMin:bt,weekdaysShort:mn,meridiemParse:/[ap]\.?m?\.?/i},Ei={},rn={};function Lr(g){return g&&g.toLowerCase().replace("_","-")}function go(g){for(var S,R,H,ee,we=0;we<g.length;){for(S=(ee=Lr(g[we]).split("-")).length,R=(R=Lr(g[we+1]))?R.split("-"):null;0<S;){if(H=Qn(ee.slice(0,S).join("-")))return H;if(R&&R.length>=S&&function(He,qe){for(var Ct=Math.min(He.length,qe.length),ht=0;ht<Ct;ht+=1)if(He[ht]!==qe[ht])return ht;return Ct}(ee,R)>=S-1)break;S--}we++}return Xi}function Qn(g){var S;if(Ei[g]===void 0&&a&&a.exports&&g.match("^[^/\\\\]*$")!=null)try{S=Xi._abbr,La("./locale/"+g),Jn(S)}catch{Ei[g]=null}return Ei[g]}function Jn(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 R,H=lr;if(S.abbr=g,Ei[g]!=null)le("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((R=Qn(S.parentLocale))==null)return rn[S.parentLocale]||(rn[S.parentLocale]=[]),rn[S.parentLocale].push({name:g,config:S}),null;H=R._config}return Ei[g]=new z(J(H,S)),rn[g]&&rn[g].forEach(function(ee){_o(ee.name,ee.config)}),Jn(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=Qn(g))return S;g=[g]}return go(g)}function ar(g){var S=g._a;return S&&b(g).overflow===-2&&(S=S[rt]<0||11<S[rt]?rt:S[ut]<1||S[ut]>Li(S[st],S[rt])?ut: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,b(g)._overflowDayOfYear&&(S<st||ut<S)&&(S=ut),b(g)._overflowWeeks&&S===-1&&(S=Kt),b(g)._overflowWeekday&&S===-1&&(S=Ni),b(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)?)?$/,Un=/^\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)?)?$/,Hn=/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]],Vn=[["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}))$/,gn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function er(g){var S,R,H,ee,we,He,Ct=g._i,qe=xr.exec(Ct)||Un.exec(Ct),Ct=ci.length,ht=Vn.length;if(qe){for(b(g).iso=!0,S=0,R=Ct;S<R;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,R=ht;S<R;S++)if(Vn[S][1].exec(qe[3])){we=(qe[2]||" ")+Vn[S][0];break}if(we==null)return void(g._isValid=!1)}if(H||we==null){if(qe[4]){if(!Hn.exec(qe[4]))return void(g._isValid=!1);He="Z"}g._f=ee+(we||"")+(He||""),Ee(g)}else g._isValid=!1}}else g._isValid=!1}function vr(g,S,R,H,ee,we){return g=[function(He){He=parseInt(He,10);{if(He<=49)return 2e3+He;if(He<=999)return 1900+He}return He}(g),Z.indexOf(S),parseInt(R,10),parseInt(H,10),parseInt(ee,10)],we&&g.push(parseInt(we,10)),g}function gr(g){var S,R,H,ee,we=bo.exec(g._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));we?(S=vr(we[4],we[3],we[2],we[5],we[6],we[7]),R=we[1],H=S,ee=g,R&&mn.indexOf(R)!==new Date(H[0],H[1],H[2]).getDay()?(b(ee).weekdayMismatch=!0,ee._isValid=!1):(g._a=S,g._tzm=(R=we[8],H=we[9],ee=we[10],R?gn[R]:H?0:60*(((R=parseInt(ee,10))-(H=R%100))/100)+H),g._d=gt.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),b(g).rfc2822=!0)):g._isValid=!1}function oe(g,S,R){return g??S??R}function de(g){var S,R,H,ee,we,He,qe,Ct,ht,zt,Nt,Ki=[];if(!g._d){for(H=g,ee=new Date(n.now()),R=H._useUTC?[ee.getUTCFullYear(),ee.getUTCMonth(),ee.getUTCDate()]:[ee.getFullYear(),ee.getMonth(),ee.getDate()],g._w&&g._a[ut]==null&&g._a[rt]==null&&((ee=(H=g)._w).GG!=null||ee.W!=null||ee.E!=null?(Ct=1,ht=4,we=oe(ee.GG,H._a[st],Gi(lt(),1,4).year),He=oe(ee.W,1),((qe=oe(ee.E,1))<1||7<qe)&&(zt=!0)):(Ct=H._locale._week.dow,ht=H._locale._week.doy,Nt=Gi(lt(),Ct,ht),we=oe(ee.gg,H._a[st],Nt.year),He=oe(ee.w,Nt.week),ee.d!=null?((qe=ee.d)<0||6<qe)&&(zt=!0):ee.e!=null?(qe=ee.e+Ct,(ee.e<0||6<ee.e)&&(zt=!0)):qe=Ct),He<1||He>Qt(we,Ct,ht)?b(H)._overflowWeeks=!0:zt!=null?b(H)._overflowWeekday=!0:(Nt=Ii(we,He,qe,Ct,ht),H._a[st]=Nt.year,H._dayOfYear=Nt.dayOfYear)),g._dayOfYear!=null&&(ee=oe(g._a[st],R[st]),(g._dayOfYear>Vt(ee)||g._dayOfYear===0)&&(b(g)._overflowDayOfYear=!0),zt=gt(ee,0,g._dayOfYear),g._a[rt]=zt.getUTCMonth(),g._a[ut]=zt.getUTCDate()),S=0;S<3&&g._a[S]==null;++S)g._a[S]=Ki[S]=R[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?gt:yt).apply(null,Ki),we=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!==we&&(b(g).weekdayMismatch=!0)}}function Ee(g){if(g._f===n.ISO_8601)er(g);else if(g._f===n.RFC_2822)gr(g);else{g._a=[],b(g).empty=!0;for(var S,R,H,ee,we,He=""+g._i,qe=He.length,Ct=0,ht=pe(g._f,g._locale).match(Ke)||[],zt=ht.length,Nt=0;Nt<zt;Nt++)R=ht[Nt],(S=(He.match(Xt(R,g))||[])[0])&&(0<(H=He.substr(0,He.indexOf(S))).length&&b(g).unusedInput.push(H),He=He.slice(He.indexOf(S)+S.length),Ct+=S.length),Oe[R]?(S?b(g).empty=!1:b(g).unusedTokens.push(R),H=R,we=g,(ee=S)!=null&&s(q,H)&&q[H](ee,we._a,we,H)):g._strict&&!S&&b(g).unusedTokens.push(R);b(g).charsLeftOver=qe-Ct,0<He.length&&b(g).unusedInput.push(He),g._a[Rt]<=12&&b(g).bigHour===!0&&0<g._a[Rt]&&(b(g).bigHour=void 0),b(g).parsedDateParts=g._a.slice(0),b(g).meridiem=g._meridiem,g._a[Rt]=function(Ki,an,Zi){return Zi==null?an:Ki.meridiemHour!=null?Ki.meridiemHour(an,Zi):Ki.isPM!=null?((Ki=Ki.isPM(Zi))&&an<12&&(an+=12),an=Ki||an!==12?an:0):an}(g._locale,g._a[Rt],g._meridiem),(qe=b(g).era)!==null&&(g._a[st]=g._locale.erasConvertYear(qe,g._a[st])),de(g),ar(g)}}function We(g){var S,R,H,ee=g._i,we=g._f;return g._locale=g._locale||mr(g._l),ee===null||we===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(we)?function(He){var qe,Ct,ht,zt,Nt,Ki,an=!1,Zi=He._f.length;if(Zi===0)return b(He).invalidFormat=!0,He._d=new Date(NaN);for(zt=0;zt<Zi;zt++)Nt=0,Ki=!1,qe=A({},He),He._useUTC!=null&&(qe._useUTC=He._useUTC),qe._f=He._f[zt],Ee(qe),C(qe)&&(Ki=!0),Nt=(Nt+=b(qe).charsLeftOver)+10*b(qe).unusedTokens.length,b(qe).score=Nt,an?Nt<ht&&(ht=Nt,Ct=qe):(ht==null||Nt<ht||Ki)&&(ht=Nt,Ct=qe,Ki&&(an=!0));m(He,Ct||qe)}(g):we?Ee(g):u(we=(ee=g)._i)?ee._d=new Date(n.now()):c(we)?ee._d=new Date(we.valueOf()):typeof we=="string"?(R=ee,(S=Jr.exec(R._i))!==null?R._d=new Date(+S[1]):(er(R),R._isValid===!1&&(delete R._isValid,gr(R),R._isValid===!1&&(delete R._isValid,R._strict?R._isValid=!1:n.createFromInputFallback(R))))):r(we)?(ee._a=f(we.slice(0),function(He){return parseInt(He,10)}),de(ee)):o(we)?(S=ee)._d||(H=(R=ue(S._i)).day===void 0?R.date:R.day,S._a=f([R.year,R.month,H,R.hour,R.minute,R.second,R.millisecond],function(He){return He&&parseInt(He,10)}),de(S)):p(we)?ee._d=new Date(we):n.createFromInputFallback(ee),C(g)||(g._d=null),g))}function Je(g,S,R,H,ee){var we={};return S!==!0&&S!==!1||(H=S,S=void 0),R!==!0&&R!==!1||(H=R,R=void 0),(o(g)&&l(g)||r(g)&&g.length===0)&&(g=void 0),we._isAMomentObject=!0,we._useUTC=we._isUTC=ee,we._l=R,we._i=g,we._f=S,we._strict=H,(ee=new F(ar(We(ee=we))))._nextDay&&(ee.add(1,"d"),ee._nextDay=void 0),ee}function lt(g,S,R,H){return Je(g,S,R,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=lt.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=lt.apply(null,arguments);return this.isValid()&&g.isValid()?this<g?this:g:x()});function Ot(g,S){var R,H;if(!(S=S.length===1&&r(S[0])?S[0]:S).length)return lt();for(R=S[0],H=1;H<S.length;++H)S[H].isValid()&&!S[H][g](R)||(R=S[H]);return R}var Bt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hi(S){var S=ue(S),R=S.year||0,H=S.quarter||0,ee=S.month||0,we=S.week||S.isoWeek||0,He=S.day||0,qe=S.hour||0,Ct=S.minute||0,ht=S.second||0,zt=S.millisecond||0;this._isValid=function(Nt){var Ki,an,Zi=!1,rs=Bt.length;for(Ki in Nt)if(s(Nt,Ki)&&(ke.call(Bt,Ki)===-1||Nt[Ki]!=null&&isNaN(Nt[Ki])))return!1;for(an=0;an<rs;++an)if(Nt[Bt[an]]){if(Zi)return!1;parseFloat(Nt[Bt[an]])!==Ge(Nt[Bt[an]])&&(Zi=!0)}return!0}(S),this._milliseconds=+zt+1e3*ht+6e4*Ct+1e3*qe*60*60,this._days=+He+7*we,this._months=+ee+3*H+12*R,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 En(g,S){De(g,0,0,function(){var R=this.utcOffset(),H="+";return R<0&&(R=-R,H="-"),H+ae(~~(R/60),2)+S+ae(~~R%60,2)})}En("Z",":"),En("ZZ",""),Ne("Z",ft),Ne("ZZ",ft),W(["Z","ZZ"],function(g,S,R){R._useUTC=!0,R._tzm=Wn(ft,g)});var Gn=/([\+\-]|\d\d)/gi;function Wn(g,R){var R=(R||"").match(g);return R===null?null:(R=60*(g=((R[R.length-1]||[])+"").match(Gn)||["-",0,0])[1]+Ge(g[2]))===0?0:g[0]==="+"?R:-R}function $n(g,S){var R;return S._isUTC?(S=S.clone(),R=(N(g)||c(g)?g:lt(g)).valueOf()-S.valueOf(),S._d.setTime(S._d.valueOf()+R),n.updateOffset(S,!1),S):lt(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*)?)?$/,Vi=/^(-|\+)?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 R,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))?(R=ee[1]==="-"?-1:1,H={y:0,d:Ge(ee[ut])*R,h:Ge(ee[Rt])*R,m:Ge(ee[Ht])*R,s:Ge(ee[Tt])*R,ms:Ge(wi(1e3*ee[Ut]))*R}):(ee=Vi.exec(g))?(R=ee[1]==="-"?-1:1,H={y:Hr(ee[2],R),M:Hr(ee[3],R),w:Hr(ee[4],R),d:Hr(ee[5],R),h:Hr(ee[6],R),m:Hr(ee[7],R),s:Hr(ee[8],R)}):H==null?H={}:typeof H=="object"&&("from"in H||"to"in H)&&(S=function(we,He){var qe;return!we.isValid()||!He.isValid()?{milliseconds:0,months:0}:(He=$n(He,we),we.isBefore(He)?qe=Ss(we,He):((qe=Ss(He,we)).milliseconds=-qe.milliseconds,qe.months=-qe.months),qe)}(lt(H.from),lt(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 R={};return R.months=S.month()-g.month()+12*(S.year()-g.year()),g.clone().add(R.months,"M").isAfter(S)&&--R.months,R.milliseconds=+S-+g.clone().add(R.months,"M"),R}function yo(g,S){return function(R,H){var ee;return H===null||isNaN(+H)||(le(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=R,R=H,H=ee),Js(this,Ai(R,H),g),this}}function Js(g,He,R,H){var ee=He._milliseconds,we=wi(He._days),He=wi(He._months);g.isValid()&&(H=H==null||H,He&&mt(g,at(g,"Month")+He*R),we&&k(g,"Date",at(g,"Date")+we*R),ee&&g._d.setTime(g._d.valueOf()+ee*R),H&&n.updateOffset(g,we||He))}Ai.fn=hi.prototype,Ai.invalid=function(){return Ai(NaN)},U=yo(1,"add"),Ln=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 R=r(S),H=!1;return R&&(H=S.filter(function(ee){return!p(ee)&&ws(S)}).length===0),R&&H}(g)||function(S){var R,H,ee=o(S)&&!l(S),we=!1,He=["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=He.length;for(R=0;R<qe;R+=1)H=He[R],we=we||s(S,H);return ee&&we}(g)||g==null}function ts(g,ee){if(g.date()<ee.date())return-ts(ee,g);var R=12*(ee.year()-g.year())+(ee.month()-g.month()),H=g.clone().add(R,"months"),ee=ee-H<0?(ee-H)/(H-g.clone().add(R-1,"months")):(ee-H)/(g.clone().add(1+R,"months")-H);return-(R+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]",bt=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,R){return g<100&&0<=g?new Date(g+400,S,R)-_i:new Date(g,S,R).valueOf()}function Ts(g,S,R){return g<100&&0<=g?Date.UTC(g+400,S,R)-_i:Date.UTC(g,S,R)}function Dl(g,S){return S.erasAbbrRegex(g)}function el(){for(var g=[],S=[],R=[],H=[],ee=this.eras(),we=0,He=ee.length;we<He;++we)S.push(It(ee[we].name)),g.push(It(ee[we].abbr)),R.push(It(ee[we].narrow)),H.push(It(ee[we].name)),H.push(It(ee[we].abbr)),H.push(It(ee[we].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("^("+R.join("|")+")","i")}function is(g,S){De(0,[g,g.length],0,S)}function Os(g,S,R,H,ee){var we;return g==null?Gi(this,H,ee).year:(we=Qt(g,H,ee),(function(He,qe,Ct,ht,zt){return He=Ii(He,qe,Ct,ht,zt),qe=gt(He.year,0,He.dayOfYear),this.year(qe.getUTCFullYear()),this.month(qe.getUTCMonth()),this.date(qe.getUTCDate()),this}).call(this,g,S=we<S?we:S,R,H,ee))}De("N",0,0,"eraAbbr"),De("NN",0,0,"eraAbbr"),De("NNN",0,0,"eraAbbr"),De("NNNN",0,0,"eraName"),De("NNNNN",0,0,"eraNarrow"),De("y",["y",1],"yo","eraYear"),De("y",["yy",2],0,"eraYear"),De("y",["yyy",3],0,"eraYear"),De("y",["yyyy",4],0,"eraYear"),Ne("N",Dl),Ne("NN",Dl),Ne("NNN",Dl),Ne("NNNN",function(g,S){return S.erasNameRegex(g)}),Ne("NNNNN",function(g,S){return S.erasNarrowRegex(g)}),W(["N","NN","NNN","NNNN","NNNNN"],function(g,S,R,H){H=R._locale.erasParse(g,H,R._strict),H?b(R).era=H:b(R).invalidEra=g}),Ne("y",Me),Ne("yy",Me),Ne("yyy",Me),Ne("yyyy",Me),Ne("yo",function(g,S){return S._eraYearOrdinalRegex||Me}),W(["y","yy","yyy","yyyy"],st),W(["yo"],function(g,S,R,H){var ee;R._locale._eraYearOrdinalRegex&&(ee=g.match(R._locale._eraYearOrdinalRegex)),R._locale.eraYearOrdinalParse?S[st]=R._locale.eraYearOrdinalParse(g,ee):S[st]=parseInt(g,10)}),De(0,["gg",2],0,function(){return this.weekYear()%100}),De(0,["GG",2],0,function(){return this.isoWeekYear()%100}),is("gggg","weekYear"),is("ggggg","weekYear"),is("GGGG","isoWeekYear"),is("GGGGG","isoWeekYear"),Ye("weekYear","gg"),Ye("isoWeekYear","GG"),be("weekYear",1),be("isoWeekYear",1),Ne("G",fe),Ne("g",fe),Ne("GG",$,Mt),Ne("gg",$,Mt),Ne("GGGG",jn,qi),Ne("gggg",jn,qi),Ne("GGGGG",Tr,sn),Ne("ggggg",Tr,sn),me(["gggg","ggggg","GGGG","GGGGG"],function(g,S,R,H){S[H.substr(0,2)]=Ge(g)}),me(["gg","GG"],function(g,S,R,H){S[H]=n.parseTwoDigitYear(g)}),De("Q",0,"Qo","quarter"),Ye("quarter","Q"),be("quarter",7),Ne("Q",te),W("Q",function(g,S){S[rt]=3*(Ge(g)-1)}),De("D",["DD",2],"Do","date"),Ye("date","D"),be("date",9),Ne("D",$),Ne("DD",$,Mt),Ne("Do",function(g,S){return g?S._dayOfMonthOrdinalParse||S._ordinalParse:S._dayOfMonthOrdinalParseLenient}),W(["D","DD"],ut),W("Do",function(g,S){S[ut]=Ge(g.match($)[0])}),jn=Et("Date",!0),De("DDD",["DDDD",3],"DDDo","dayOfYear"),Ye("dayOfYear","DDD"),be("dayOfYear",4),Ne("DDD",Pe),Ne("DDDD",_e),W(["DDD","DDDD"],function(g,S,R){R._dayOfYear=Ge(g)}),De("m",["mm",2],0,"minute"),Ye("minute","m"),be("minute",14),Ne("m",$),Ne("mm",$,Mt),W(["m","mm"],Ht);var At,qi=Et("Minutes",!1),Tr=(De("s",["ss",2],0,"second"),Ye("second","s"),be("second",15),Ne("s",$),Ne("ss",$,Mt),W(["s","ss"],Tt),Et("Seconds",!1));for(De("S",0,0,function(){return~~(this.millisecond()/100)}),De(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),De(0,["SSS",3],0,"millisecond"),De(0,["SSSS",4],0,function(){return 10*this.millisecond()}),De(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),De(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),De(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),De(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),De(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),Ye("millisecond","ms"),be("millisecond",16),Ne("S",Pe,te),Ne("SS",Pe,Mt),Ne("SSS",Pe,_e),At="SSSS";At.length<=9;At+="S")Ne(At,Me);function Ho(g,S){S[Ut]=Ge(1e3*("0."+g))}for(At="S";At.length<=9;At+="S")W(At,Ho);sn=Et("Milliseconds",!1),De("z",0,0,"zoneAbbr"),De("zz",0,0,"zoneName"),te=F.prototype;function Rl(g){return g}te.add=U,te.calendar=function(R,ee){arguments.length===1&&(arguments[0]?fa(arguments[0])?(R=arguments[0],ee=void 0):function(we){for(var He=o(we)&&!l(we),qe=!1,Ct=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ht=0;ht<Ct.length;ht+=1)qe=qe||s(we,Ct[ht]);return He&&qe}(arguments[0])&&(ee=arguments[0],R=void 0):ee=R=void 0);var R=R||lt(),H=$n(R,this).startOf("day"),H=n.calendarFormat(this,H)||"sameElse",ee=ee&&(ve(ee[H])?ee[H].call(this,R):ee[H]);return this.format(ee||this.localeData().calendar(H,this,lt(R)))},te.clone=function(){return new F(this)},te.diff=function(g,S,R){var H,ee,we;if(!this.isValid())return NaN;if(!(H=$n(g,this)).isValid())return NaN;switch(ee=6e4*(H.utcOffset()-this.utcOffset()),S=Be(S)){case"year":we=ts(this,H)/12;break;case"month":we=ts(this,H);break;case"quarter":we=ts(this,H)/3;break;case"second":we=(this-H)/1e3;break;case"minute":we=(this-H)/6e4;break;case"hour":we=(this-H)/36e5;break;case"day":we=(this-H-ee)/864e5;break;case"week":we=(this-H-ee)/6048e5;break;default:we=this-H}return R?we:nt(we)},te.endOf=function(g){var S,R;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(R=this._isUTC?Ts:So,g){case"year":S=R(this.year()+1,0,1)-1;break;case"quarter":S=R(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":S=R(this.year(),this.month()+1,1)-1;break;case"week":S=R(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":S=R(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":S=R(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=re(this,g),this.localeData().postformat(g)},te.from=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||lt(g).isValid())?Ai({to:this,from:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.fromNow=function(g){return this.from(lt(),g)},te.to=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||lt(g).isValid())?Ai({from:this,to:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.toNow=function(g){return this.to(lt(),g)},te.get=function(g){return ve(this[g=Be(g)])?this[g]():this},te.invalidAt=function(){return b(this).overflow},te.isAfter=function(g,S){return g=N(g)?g:lt(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:lt(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,R,H){return g=N(g)?g:lt(g),S=N(S)?S:lt(S),!!(this.isValid()&&g.isValid()&&S.isValid())&&((H=H||"()")[0]==="("?this.isAfter(g,R):!this.isBefore(g,R))&&(H[1]===")"?this.isBefore(S,R):!this.isAfter(S,R))},te.isSame=function(R,S){var R=N(R)?R:lt(R);return!(!this.isValid()||!R.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()===R.valueOf():(R=R.valueOf(),this.clone().startOf(S).valueOf()<=R&&R<=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=bt,te.locale=xs,te.localeData=Di,te.max=ne,te.min=X,te.parsingFlags=function(){return m({},b(this))},te.set=function(g,S){if(typeof g=="object")for(var R=function(we){var He,qe=[];for(He in we)s(we,He)&&qe.push({unit:He,priority:Ce[He]});return qe.sort(function(Ct,ht){return Ct.priority-ht.priority}),qe}(g=ue(g)),H=R.length,ee=0;ee<H;ee++)this[R[ee].unit](g[R[ee].unit]);else if(ve(this[g=Be(g)]))return this[g](S);return this},te.startOf=function(g){var S,R;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(R=this._isUTC?Ts:So,g){case"year":S=R(this.year(),0,1);break;case"quarter":S=R(this.year(),this.month()-this.month()%3,1);break;case"month":S=R(this.year(),this.month(),1);break;case"week":S=R(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":S=R(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":S=R(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=Ln,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()?re(S,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ve(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(S,"Z")):re(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",R="";return this.isLocal()||(S=this.utcOffset()===0?"moment.utc":"moment.parseZone",R="Z"),S="["+S+'("]',g=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(S+g+"-MM-DD[T]HH:mm:ss.SSS"+(R+'[")]'))},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(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].name;return""},te.eraNarrow=function(){for(var g,S=this.localeData().eras(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].narrow;return""},te.eraAbbr=function(){for(var g,S=this.localeData().eras(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].abbr;return""},te.eraYear=function(){for(var g,S,R=this.localeData().eras(),H=0,ee=R.length;H<ee;++H)if(g=R[H].since<=R[H].until?1:-1,S=this.clone().startOf("day").valueOf(),R[H].since<=S&&S<=R[H].until||R[H].until<=S&&S<=R[H].since)return(this.year()-n(R[H].since).year())*g+R[H].offset;return this.year()},te.year=xo,te.isLeapYear=function(){return Le(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=ct,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=jn,te.day=te.days=function(g){if(!this.isValid())return g!=null?this:NaN;var S,R,H=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(S=g,R=this.localeData(),g=typeof S!="string"?S:isNaN(S)?typeof(S=R.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,R=this.localeData(),R=typeof S=="string"?R.weekdaysParse(S)%7||7:isNaN(S)?null:S,this.day(this.day()%7?R:R-7)):this.day()||7:g!=null?this:NaN;var S,R},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=ze,te.minute=te.minutes=qi,te.second=te.seconds=Tr,te.millisecond=te.milliseconds=sn,te.utcOffset=function(g,S,R){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=Wn(ft,g))===null)return this}else Math.abs(g)<16&&!R&&(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=Wn(Ue,this._i))!=null?this.utcOffset(g):this.utcOffset(0,!0)),this},te.hasAlignedHourOffset=function(g){return!!this.isValid()&&(g=g?lt(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.",jn),te.months=Q("months accessor is deprecated. Use month instead",ct),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 A(S,this),(S=We(S))._a?(g=(S._isUTC?v:lt)(S._a),this._isDSTShifted=this.isValid()&&0<function(R,H,ee){for(var we=Math.min(R.length,H.length),He=Math.abs(R.length-H.length),qe=0,Ct=0;Ct<we;Ct++)(ee&&R[Ct]!==H[Ct]||!ee&&Ge(R[Ct])!==Ge(H[Ct]))&&qe++;return qe+He}(S._a,g.toArray())):this._isDSTShifted=!1,this._isDSTShifted}),Mt=z.prototype;function to(g,S,R,we){var ee=mr(),we=v().set(we,S);return ee[R](we,g)}function Yn(g,S,R){if(p(g)&&(S=g,g=void 0),g=g||"",S!=null)return to(g,S,R,"month");for(var H=[],ee=0;ee<12;ee++)H[ee]=to(g,ee,R,"month");return H}function tl(g,S,R,H){S=(typeof g=="boolean"?p(S)&&(R=S,S=void 0):(S=g,g=!1,p(R=S)&&(R=S,S=void 0)),S||"");var ee,we=mr(),He=g?we._week.dow:0,qe=[];if(R!=null)return to(S,(R+He)%7,H,"day");for(ee=0;ee<7;ee++)qe[ee]=to(S,(ee+He)%7,H,"day");return qe}Mt.calendar=function(g,S,R){return ve(g=this._calendar[g]||this._calendar.sameElse)?g.call(S,R):g},Mt.longDateFormat=function(g){var S=this._longDateFormat[g],R=this._longDateFormat[g.toUpperCase()];return S||!R?S:(this._longDateFormat[g]=R.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,R,H){var ee=this._relativeTime[R];return ve(ee)?ee(g,S,R,H):ee.replace(/%d/i,g)},Mt.pastFuture=function(g,S){return ve(g=this._relativeTime[0<g?"future":"past"])?g(S):g.replace(/%s/i,S)},Mt.set=function(g){var S,R;for(R in g)s(g,R)&&(ve(S=g[R])?this[R]=S:this["_"+R]=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 R,H=this._eras||mr("en")._eras,ee=0,we=H.length;ee<we;++ee){switch(typeof H[ee].since){case"string":R=n(H[ee].since).startOf("day"),H[ee].since=R.valueOf();break}switch(typeof H[ee].until){case"undefined":H[ee].until=1/0;break;case"string":R=n(H[ee].until).startOf("day").valueOf(),H[ee].until=R.valueOf();break}}return H},Mt.erasParse=function(g,S,R){var H,ee,we,He,qe,Ct=this.eras();for(g=g.toUpperCase(),H=0,ee=Ct.length;H<ee;++H)if(we=Ct[H].name.toUpperCase(),He=Ct[H].abbr.toUpperCase(),qe=Ct[H].narrow.toUpperCase(),R)switch(S){case"N":case"NN":case"NNN":if(He===g)return Ct[H];break;case"NNNN":if(we===g)return Ct[H];break;case"NNNNN":if(qe===g)return Ct[H];break}else if(0<=[we,He,qe].indexOf(g))return Ct[H]},Mt.erasConvertYear=function(g,S){var R=g.since<=g.until?1:-1;return S===void 0?n(g.since).year():n(g.since).year()+(S-g.offset)*R},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,R){var H,ee;if(this._monthsParseExact)return(function(Nt,He,qe){var Ct,ht,zt,Nt=Nt.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],Ct=0;Ct<12;++Ct)zt=v([2e3,Ct]),this._shortMonthsParse[Ct]=this.monthsShort(zt,"").toLocaleLowerCase(),this._longMonthsParse[Ct]=this.months(zt,"").toLocaleLowerCase();return qe?He==="MMM"?(ht=ke.call(this._shortMonthsParse,Nt))!==-1?ht:null:(ht=ke.call(this._longMonthsParse,Nt))!==-1?ht:null:He==="MMM"?(ht=ke.call(this._shortMonthsParse,Nt))!==-1||(ht=ke.call(this._longMonthsParse,Nt))!==-1?ht:null:(ht=ke.call(this._longMonthsParse,Nt))!==-1||(ht=ke.call(this._shortMonthsParse,Nt))!==-1?ht:null}).call(this,g,S,R);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),H=0;H<12;H++)if(ee=v([2e3,H]),R&&!this._longMonthsParse[H]&&(this._longMonthsParse[H]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[H]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),R||this._monthsParse[H]||(ee="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[H]=new RegExp(ee.replace(".",""),"i")),R&&S==="MMMM"&&this._longMonthsParse[H].test(g)||R&&S==="MMM"&&this._shortMonthsParse[H].test(g)||!R&&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=ot),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=Se),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,R){var H,ee;if(this._weekdaysParseExact)return(function(Nt,He,qe){var Ct,ht,zt,Nt=Nt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],Ct=0;Ct<7;++Ct)zt=v([2e3,1]).day(Ct),this._minWeekdaysParse[Ct]=this.weekdaysMin(zt,"").toLocaleLowerCase(),this._shortWeekdaysParse[Ct]=this.weekdaysShort(zt,"").toLocaleLowerCase(),this._weekdaysParse[Ct]=this.weekdays(zt,"").toLocaleLowerCase();return qe?He==="dddd"?(ht=ke.call(this._weekdaysParse,Nt))!==-1?ht:null:He==="ddd"?(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1?ht:null:(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:He==="dddd"?(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:He==="ddd"?(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:(ht=ke.call(this._minWeekdaysParse,Nt))!==-1||(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1?ht:null}).call(this,g,S,R);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),H=0;H<7;H++)if(ee=v([2e3,1]).day(H),R&&!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")),R&&S==="dddd"&&this._fullWeekdaysParse[H].test(g)||R&&S==="ddd"&&this._shortWeekdaysParse[H].test(g)||R&&S==="dd"&&this._minWeekdaysParse[H].test(g)||!R&&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=ye),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=Xe),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=pt),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Mt.isPM=function(g){return(g+"").toLowerCase().charAt(0)==="p"},Mt.meridiem=function(g,S,R){return 11<g?R?"pm":"PM":R?"am":"AM"},Jn("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+(Ge(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.",Jn),n.langData=Q("moment.langData is deprecated. Use moment.localeData instead.",mr);var Or=Math.abs;function Fl(g,S,R,H){return S=Ai(S,R),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 on(g){return function(){return this.as(g)}}Pe=on("ms"),_e=on("s"),U=on("m"),ne=on("h"),X=on("d"),Ln=on("w"),ze=on("M"),qi=on("Q"),Tr=on("y");function wo(g){return function(){return this.isValid()?this._data[g]:NaN}}var sn=wo("milliseconds"),jn=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 fd(g,S,R,H){var ht=Ai(g).abs(),zt=Bn(ht.as("s")),ee=Bn(ht.as("m")),we=Bn(ht.as("h")),He=Bn(ht.as("d")),qe=Bn(ht.as("M")),Ct=Bn(ht.as("w")),ht=Bn(ht.as("y")),zt=(zt<=R.ss?["s",zt]:zt<R.s&&["ss",zt])||ee<=1&&["m"]||ee<R.m&&["mm",ee]||we<=1&&["h"]||we<R.h&&["hh",we]||He<=1&&["d"]||He<R.d&&["dd",He];return(zt=(zt=R.w!=null?zt||Ct<=1&&["w"]||Ct<R.w&&["ww",Ct]:zt)||qe<=1&&["M"]||qe<R.M&&["MM",qe]||ht<=1&&["y"]||["yy",ht])[2]=S,zt[3]=0<+g,zt[4]=H,(function(Nt,Ki,an,Zi,rs){return rs.relativeTime(Ki||1,!!an,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,R,H,ee,we,He,qe=ks(this._milliseconds)/1e3,Ct=ks(this._days),ht=ks(this._months),zt=this.asSeconds();return zt?(g=nt(qe/60),S=nt(g/60),qe%=60,g%=60,R=nt(ht/12),ht%=12,H=qe?qe.toFixed(3).replace(/\.?0+$/,""):"",ee=ns(this._months)!==ns(zt)?"-":"",we=ns(this._days)!==ns(zt)?"-":"",He=ns(this._milliseconds)!==ns(zt)?"-":"",(zt<0?"-":"")+"P"+(R?ee+R+"Y":"")+(ht?ee+ht+"M":"")+(Ct?we+Ct+"D":"")+(S||g||qe?"T":"")+(S?He+S+"H":"")+(g?He+g+"M":"")+(qe?He+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,R,H=this._milliseconds;if((g=Be(g))==="month"||g==="quarter"||g==="year")switch(S=this._days+H/864e5,R=this._months+Pl(S),g){case"month":return R;case"quarter":return R/3;case"year":return R/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=Pe,mi.asSeconds=_e,mi.asMinutes=U,mi.asHours=ne,mi.asDays=X,mi.asWeeks=Ln,mi.asMonths=ze,mi.asQuarters=qi,mi.asYears=Tr,mi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Ge(this._months/12):NaN},mi._bubble=function(){var g=this._milliseconds,S=this._days,R=this._months,H=this._data;return 0<=g&&0<=S&&0<=R||g<=0&&S<=0&&R<=0||(g+=864e5*il(As(R)+S),R=S=0),H.milliseconds=g%1e3,g=nt(g/1e3),H.seconds=g%60,g=nt(g/60),H.minutes=g%60,g=nt(g/60),H.hours=g%24,S+=nt(g/24),R+=g=nt(Pl(S)),S-=il(As(g)),g=nt(R/12),R%=12,H.days=S,H.months=R,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=sn,mi.seconds=jn,mi.minutes=xo,mi.hours=Mt,mi.days=nl,mi.weeks=function(){return nt(this.days()/7)},mi.months=rl,mi.years=Wi,mi.humanize=function(g,S){if(!this.isValid())return this.localeData().invalidDate();var R=!1,H=To;return typeof g=="object"&&(S=g,g=!1),typeof g=="boolean"&&(R=g),typeof S=="object"&&(H=Object.assign({},To,S),S.s!=null&&S.ss==null&&(H.ss=S.s-1)),g=this.localeData(),S=fd(this,!R,H,g),R&&(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=bt,De("X",0,0,"unix"),De("x",0,0,"valueOf"),Ne("x",fe),Ne("X",/[+-]?\d+(\.\d{1,3})?/),W("X",function(g,S,R){R._d=new Date(1e3*parseFloat(g))}),W("x",function(g,S,R){R._d=new Date(Ge(g))}),n.version="2.29.4",e=lt,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 lt(1e3*g)},n.months=function(g,S){return Yn(g,S,"months")},n.isDate=c,n.locale=Jn,n.invalid=x,n.duration=Ai,n.isMoment=N,n.weekdays=function(g,S,R){return tl(g,S,R,"weekdays")},n.parseZone=function(){return lt.apply(null,arguments).parseZone()},n.localeData=mr,n.isDuration=Si,n.monthsShort=function(g,S){return Yn(g,S,"monthsShort")},n.weekdaysMin=function(g,S,R){return tl(g,S,R,"weekdaysMin")},n.defineLocale=_o,n.updateLocale=function(g,S){var R,H;return S!=null?(H=lr,Ei[g]!=null&&Ei[g].parentLocale!=null?Ei[g].set(J(Ei[g]._config,S)):(S=J(H=(R=Qn(g))!=null?R._config:H,S),R==null&&(S.abbr=g),(H=new z(S)).parentLocale=Ei[g],Ei[g]=H),Jn(g)):Ei[g]!=null&&(Ei[g].parentLocale!=null?(Ei[g]=Ei[g].parentLocale,g===Jn()&&Jn(g)):Ei[g]!=null&&delete Ei[g]),Ei[g]},n.locales=function(){return P(Ei)},n.weekdaysShort=function(g,S,R){return tl(g,S,R,"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})})(Ep);var Sp=Ep.exports;const Ys=Qc(Sp),ms=Cl({__proto__:null,default:Ys},[Sp]);class je{}je.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"},je.treeDataProperties={CHILDREN_PROP:"children",COLLAPSED_PROP:"__collapsed",HAS_CHILDREN_PROP:"__hasChildren",TREE_LEVEL_PROP:"__treeLevel",PARENT_PROP:"__parentId"},je.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL=2,je.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL=2,je.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL=2,je.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL=4,je.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL=void 0,je.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL=void 0,je.DEFAULT_NUMBER_DECIMAL_SEPARATOR=".",je.DEFAULT_NUMBER_THOUSAND_SEPARATOR="",je.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET=!1,je.SLIDER_DEFAULT_MIN_VALUE=0,je.SLIDER_DEFAULT_MAX_VALUE=100,je.SLIDER_DEFAULT_STEP=1,je.VALIDATION_REQUIRED_FIELD="Field is required",je.VALIDATION_EDITOR_VALID_NUMBER="Please enter a valid number",je.VALIDATION_EDITOR_VALID_INTEGER="Please enter a valid integer number",je.VALIDATION_EDITOR_INTEGER_BETWEEN="Please enter a valid integer number between {{minValue}} and {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MAX="Please enter a valid integer number that is lower than {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE="Please enter a valid integer number that is lower than or equal to {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MIN="Please enter a valid integer number that is greater than {{minValue}}",je.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE="Please enter a valid integer number that is greater than or equal to {{minValue}}",je.VALIDATION_EDITOR_NUMBER_BETWEEN="Please enter a valid number between {{minValue}} and {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MAX="Please enter a valid number that is lower than {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE="Please enter a valid number that is lower than or equal to {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MIN="Please enter a valid number that is greater than {{minValue}}",je.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE="Please enter a valid number that is greater than or equal to {{minValue}}",je.VALIDATION_EDITOR_DECIMAL_BETWEEN="Please enter a valid number with a maximum of {{maxDecimal}} decimals",je.VALIDATION_EDITOR_TEXT_LENGTH_BETWEEN="Please make sure your text length is between {{minLength}} and {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MAX_LENGTH="Please make sure your text is less than {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE="Please make sure your text is less than or equal to {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MIN_LENGTH="Please make sure your text is more than {{minLength}} character(s)",je.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE="Please make sure your text is at least {{minLength}} character(s)";var Jc;(function(a){a[a.camelCase=0]="camelCase",a[a.pascalCase=1]="pascalCase",a[a.snakeCase=2]="snakeCase",a[a.kebabCase=3]="kebabCase"})(Jc||(Jc={}));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 un;(function(a){a.csv="csv",a.txt="txt",a.xls="xls",a.xlsx="xlsx"})(un||(un={}));var Zl;(function(a){a.merge="merge",a.chain="chain"})(Zl||(Zl={}));var Ud;(function(a){a.none="NOA",a.legacyOff="LOF",a.legacyForceFit="LFF",a.ignoreViewport="IGV",a.fitColsToViewport="FCV",a.fitViewportToCols="FVC"})(Ud||(Ud={}));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 eh=Object.freeze(Object.defineProperty({__proto__:null,get CaseType(){return Jc},get DelimiterType(){return vs},get EmitterType(){return Ji},get ExtensionName(){return ni},FieldType:ie,get FileType(){return un},get FilterMultiplePassType(){return Zl},get GridAutosizeColsMode(){return Ud},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"})),Xg=Ys||ms;class Ha extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Ha.prototype)}}function wp(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 xp(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 Gd(a,t,e=0){var n;const r=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:je.treeDataProperties.CHILDREN_PROP;if(Array.isArray(a))for(const o of a)o&&(Array.isArray(o[r])&&o[r].length>0&&(e++,Gd(o[r],t,e),e--),o[t.levelPropName]=e)}function Va(a,t,e=0,n=null){var r;const o=(r=t==null?void 0:t.childrenPropName)!==null&&r!==void 0?r:je.treeDataProperties.CHILDREN_PROP,{aggregator:s}=t;if(Array.isArray(a)){for(const l of a)if(l){const u=Array.isArray(l[o]);Array.isArray(l[o])&&l[o].length>0&&(s.init(l,!0),e++,Va(l[o],t,e,l),e--),n&&s.isInitialized&&typeof s.accumulate=="function"&&!(l!=null&&l.__filteredOut)&&(s.accumulate(l,u),s.storeResult(n.__treeTotals)),l[t.levelPropName]=e}}}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:je.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.hasChildrenPropName)!==null&&r!==void 0?r:je.treeDataProperties.HAS_CHILDREN_PROP,c=(o=t==null?void 0:t.parentPropName)!==null&&o!==void 0?o:je.treeDataProperties.PARENT_PROP,f=(s=t==null?void 0:t.levelPropName)!==null&&s!==void 0?s:je.treeDataProperties.TREE_LEVEL_PROP;return t!=null&&t.shouldAddTreeLevelNumber&&(t!=null&&t.aggregators?t.aggregators.forEach(v=>{Va(a,{childrenPropName:u,levelPropName:f,aggregator:v})}):Gd(a,{childrenPropName:u,levelPropName:f})),jg(a,v=>v[u],(v,b)=>({[l]:v[l],[c]:b!==void 0?b[l]:null,[p]:!!v[u],...Ap(v,u)}))}function Op(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:je.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.parentPropName)!==null&&r!==void 0?r:je.treeDataProperties.PARENT_PROP,c=(o=t==null?void 0:t.levelPropName)!==null&&o!==void 0?o:je.treeDataProperties.TREE_LEVEL_PROP,f=(s=t==null?void 0:t.collapsedPropName)!==null&&s!==void 0?s:je.treeDataProperties.COLLAPSED_PROP,m=a||[],v=[],b={};return m.forEach(C=>b[C[l]]=C),Object.keys(b).forEach(C=>{var x;const w=b[C];if(!(p in w)||w[p]===null||w[p]===void 0||w[p]==="")v.push(w);else if(w[p]in b){const E=b[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)}}),t!=null&&t.aggregators?t.aggregators.forEach(C=>{Va(v,{childrenPropName:u,levelPropName:c,aggregator:C},0)}):Gd(v,{childrenPropName:u,levelPropName:c},0),v}function Ba(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])}),Ba(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 wn(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 za(a,t,e){if(typeof a.queryFieldNameGetterFn=="function"){const n=a.queryFieldNameGetterFn(t);(n==null?void 0:n.indexOf("."))>=0?e=bn(t,n):e=t.hasOwnProperty(n)?t[n]:e}return e}function bn(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 Ua(a){return a.outputType||a.type||ie.string}function th(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 Ga(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 qg(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 ih(a){let t;if(th(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 Ap(a,t){return Object.keys(a).reduce((e,n)=>(n!==t&&(e[n]=a[n]),e),{})}function Kg(a,t){let e="";if(typeof a=="string"&&/^[0-9\-\/]*$/.test(a)){const n=decodeURIComponent(a),r=Xg(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 Wd(a){if(Array.isArray(a))for(;a.length>0;){const t=a.pop();t!=null&&t.unsubscribe&&t.unsubscribe()}return a}const Zg=Object.freeze(Object.defineProperty({__proto__:null,CancelledException:Ha,addTreeLevelAndAggregatorsByMutation:Va,addTreeLevelByMutation:Gd,cancellablePromise:wp,castObservableToPromise:xp,decimalFormatted:js,findItemInTreeStructure:Ba,findOrDefault:bs,flattenToParentChildArray:Tp,formatNumber:wn,getCellValueFromQueryFieldGetter:za,getColumnFieldType:Ua,getDescendantProperty:bn,getTranslationPrefix:ao,isColumnDateType:th,mapFlatpickrDateFormatWithFieldType:Ga,mapMomentDateFormatWithFieldType:Fr,mapOperatorByFieldType:ih,mapOperatorToShorthandDesignation:Ql,mapOperatorType:qg,objectWithoutKey:Ap,parseUtcDate:Kg,thousandSeparatorFormatted:_s,unflattenParentChildArrayToTree:Op,unsubscribeAll:Wd},Symbol.toStringTag,{value:"Module"})),Qg=(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},Jg=(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 e_(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 Wa(a,t=" "){let e="";for(let n=0;n<a;n++)e+=t;return e}function nh(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 rh(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&&rh(a[n],e[n]),(a[n]===null||a[n]===void 0)&&e[n]!==null&&e[n]!==void 0&&(a[n]=e[n]);return rh(a,...t)}function kp(a){for(const t in a)a.hasOwnProperty(t)&&delete a[t];return a=null,a={},a}function oh(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 $d(a){return a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"}function Yd(a){return a!=null&&a!==""}function en(a,t=!1){return t?a==null||typeof a=="string"?!1:!isNaN(a):a==null||a===""?!1:!isNaN(+a)}function Ip(a){return!a||a&&typeof a=="object"&&Object.keys(a).length===0}function jd(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]=Yd(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 sh(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 $a(a){return typeof a=="string"?sh(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 t_(a){return typeof a=="string"?sh(a).replace(/([A-Z])/g,"_$1").toLowerCase():a}function Dp(a){return Array.isArray(a)&&a.length>0?a.filter((t,e)=>a.indexOf(t)>=e):a}function i_(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 n_=Object.freeze(Object.defineProperty({__proto__:null,addToArrayWhenNotExists:e_,addWhiteSpaces:Wa,arrayRemoveItemByIndex:nh,deepCopy:uo,deepMerge:yl,emptyObject:kp,hasData:Yd,isEmptyObject:oh,isNumber:en,isObject:Ko,isObjectEmpty:Ip,isPrimitiveValue:$d,objectAssignAndExtend:rh,parseBoolean:jd,removeAccentFromText:Jl,setDeepValue:cr,titleCase:El,toCamelCase:sh,toKebabCase:$a,toSentenceCase:jr,toSnakeCase:t_,uniqueArray:Dp,uniqueObjectArray:i_},Symbol.toStringTag,{value:"Module"})),r_=(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},Rp=(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)},Xd=Ys||ms;function Fp(a,t,e,n,r){let o=0;if(a===t)o=0;else{let s=Xd(a,n,r),l=Xd(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?Xd.ISO_8601:Fr(a);return(e,n,r)=>t===Xd.ISO_8601?Fp(e,n,r,t,!1):Fp(e,n,r,t,!0)}const Sl={boolean:Qg,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:Rp,objectString:Jg,string:r_};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 o_=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 Pp{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}-${$a(t)}`:$a(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 Mp={exports:{}};(function(a,t){(function(e,n){a.exports=n()})(Rr,function(){function e(n){var r=document,o=n.container||r.createElement("div"),s=n.preventSubmit||0;o.id=o.id||"autocomplete-"+F();var l=o.style,u=n.debounceWaitMs||0,p=n.disableAutoSelect||!1,c=o.parentElement,f=[],m="",v=2,b=n.showOnFocus,C,x=0,w,E=!1,D=!1;if(n.minLength!==void 0&&(v=n.minLength),!n.input)throw new Error("input undefined");var A=n.input;o.className="autocomplete "+(n.className||""),o.setAttribute("role","listbox"),A.setAttribute("role","combobox"),A.setAttribute("aria-expanded","false"),A.setAttribute("aria-autocomplete","list"),A.setAttribute("aria-controls",o.id),A.setAttribute("aria-owns",o.id),A.setAttribute("aria-activedescendant",""),A.setAttribute("aria-haspopup","listbox"),l.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function N(){var k=o.parentNode;k&&k.removeChild(o)}function V(){w&&window.clearTimeout(w)}function Q(){o.parentNode||(c||r.body).appendChild(o)}function L(){return!!o.parentNode}function le(){x++,f=[],m="",C=void 0,A.setAttribute("aria-activedescendant",""),A.setAttribute("aria-expanded","false"),N()}function ve(){if(!L())return;A.setAttribute("aria-expanded","true"),l.height="auto",l.width=A.offsetWidth+"px";var k=0,te;function _e(){var $=r.documentElement,X=$.clientTop||r.body.clientTop||0,ne=$.clientLeft||r.body.clientLeft||0,Pe=window.pageYOffset||$.scrollTop,Me=window.pageXOffset||$.scrollLeft;te=A.getBoundingClientRect();var fe=te.top+A.offsetHeight+Pe-X,Ue=te.left+Me-ne;l.top=fe+"px",l.left=Ue+"px",k=window.innerHeight-(te.top+A.offsetHeight),k<0&&(k=0),l.top=fe+"px",l.bottom="",l.left=Ue+"px",l.maxHeight=k+"px"}_e(),_e(),n.customize&&te&&n.customize(A,te,o,k)}function J(){o.innerHTML="",A.setAttribute("aria-activedescendant","");var k=function(ne,Pe,Me){var fe=r.createElement("div");return fe.textContent=ne.label||"",fe};n.render&&(k=n.render);var te=function(ne,Pe){var Me=r.createElement("div");return Me.textContent=ne,Me};n.renderGroup&&(te=n.renderGroup);var _e=r.createDocumentFragment(),$=F();if(f.forEach(function(ne,Pe){if(ne.group&&ne.group!==$){$=ne.group;var Me=te(ne.group,m);Me&&(Me.className+=" group",_e.appendChild(Me))}var fe=k(ne,m,Pe);fe&&(fe.id=o.id+"_"+Pe,fe.setAttribute("role","option"),fe.addEventListener("click",function(Ue){D=!0;try{n.onSelect(ne,A)}finally{D=!1}le(),Ue.preventDefault(),Ue.stopPropagation()}),ne===C&&(fe.className+=" selected",fe.setAttribute("aria-selected","true"),A.setAttribute("aria-activedescendant",fe.id)),_e.appendChild(fe))}),o.appendChild(_e),f.length<1)if(n.emptyMsg){var X=r.createElement("div");X.id=o.id+"_"+F(),X.className="empty",X.textContent=n.emptyMsg,o.appendChild(X),A.setAttribute("aria-activedescendant",X.id)}else{le();return}Q(),ve(),Re()}function z(){L()&&J()}function P(){z()}function ae(k){k.target!==o?z():k.preventDefault()}function Ke(){D||Ce(0)}function Re(){var k=o.getElementsByClassName("selected");if(k.length>0){var te=k[0],_e=te.previousElementSibling;if(_e&&_e.className.indexOf("group")!==-1&&!_e.previousElementSibling&&(te=_e),te.offsetTop<o.scrollTop)o.scrollTop=te.offsetTop;else{var $=te.offsetTop+te.offsetHeight,X=o.scrollTop+o.offsetHeight;$>X&&(o.scrollTop+=$-X)}}}function xe(){var k=f.indexOf(C);C=k===-1?void 0:f[(k+f.length-1)%f.length],De(k)}function Oe(){var k=f.indexOf(C);C=f.length<1?void 0:k===-1?f[0]:f[(k+1)%f.length],De(k)}function De(k){f.length>0&&(pe(k),re(f.indexOf(C)),Re())}function re(k){var te=r.getElementById(o.id+"_"+k);te&&(te.classList.add("selected"),te.setAttribute("aria-selected","true"),A.setAttribute("aria-activedescendant",te.id))}function pe(k){var te=r.getElementById(o.id+"_"+k);te&&(te.classList.remove("selected"),te.removeAttribute("aria-selected"),A.removeAttribute("aria-activedescendant"))}function Ve(k,te){var _e=L();if(te==="Escape")le();else{if(!_e||f.length<1)return;te==="ArrowUp"?xe():Oe()}k.preventDefault(),_e&&k.stopPropagation()}function Ye(k){if(C){s===2&&k.preventDefault(),D=!0;try{n.onSelect(C,A)}finally{D=!1}le()}s===1&&k.preventDefault()}function Be(k){var te=k.key;switch(te){case"ArrowUp":case"ArrowDown":case"Escape":Ve(k,te);break;case"Enter":Ye(k);break}}function ue(){b&&Ce(1)}function Ce(k){A.value.length>=v||k===1?(V(),w=window.setTimeout(function(){return be(A.value,k,A.selectionStart||0)},k===0||k===2?u:0)):le()}function be(k,te,_e){if(!E){var $=++x;n.fetch(k,function(X){x===$&&X&&(f=X,m=k,C=f.length<1||p?void 0:f[0],J())},te,_e)}}function Le(k){if(n.keyup){n.keyup({event:k,fetch:function(){return Ce(0)}});return}!L()&&k.key==="ArrowDown"&&Ce(0)}function nt(k){n.click&&n.click({event:k,fetch:function(){return Ce(2)}})}function Ge(){setTimeout(function(){r.activeElement!==A&&le()},200)}function Et(){be(A.value,3,A.selectionStart||0)}o.addEventListener("mousedown",function(k){k.stopPropagation(),k.preventDefault()}),o.addEventListener("focus",function(){return A.focus()});function at(){A.removeEventListener("focus",ue),A.removeEventListener("keyup",Le),A.removeEventListener("click",nt),A.removeEventListener("keydown",Be),A.removeEventListener("input",Ke),A.removeEventListener("blur",Ge),window.removeEventListener("resize",P),r.removeEventListener("scroll",ae,!0),A.removeAttribute("role"),A.removeAttribute("aria-expanded"),A.removeAttribute("aria-autocomplete"),A.removeAttribute("aria-controls"),A.removeAttribute("aria-activedescendant"),A.removeAttribute("aria-owns"),A.removeAttribute("aria-haspopup"),V(),le(),E=!0}return A.addEventListener("keyup",Le),A.addEventListener("click",nt),A.addEventListener("keydown",Be),A.addEventListener("input",Ke),A.addEventListener("blur",Ge),A.addEventListener("focus",ue),window.addEventListener("resize",P),r.addEventListener("scroll",ae,!0),{destroy:at,fetch:Et}}return e})})(Mp);var Np=Mp.exports;const lh=Qc(Np),qd=Cl({__proto__:null,default:lh},[Np]);function Lp(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 Pn{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 Hp{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=Dp([...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,b,C;for(let x=0,w=n.length;x<w;x++){const E=n[x];if(E!=null&&E.property){const D=E.sortDesc?Yi.desc:Yi.asc,A=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?((b=this.translaterService)===null||b===void 0?void 0:b.translate)&&this.translaterService.translate(c[A]||" "):c[A],V=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(f[A]||" "):f[A],Q=ea(F,N,V,D,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,b)=>{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(b[c]||" "):b[c],D=ea(m,w,E,f,t);return D!==Yi.neutral?D: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 b,C;const x=r?((b=this.translaterService)===null||b===void 0?void 0:b.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:Vp,setPrototypeOf:Bp,isFrozen:s_,getPrototypeOf:l_,getOwnPropertyDescriptor:a_}=Object;let{freeze:Er,seal:Ro,create:d_}=Object,{apply:ah,construct:dh}=typeof Reflect<"u"&&Reflect;ah||(ah=function(t,e,n){return t.apply(e,n)}),Er||(Er=function(t){return t}),Ro||(Ro=function(t){return t}),dh||(dh=function(t,e){return new t(...e)});const u_=co(Array.prototype.forEach),zp=co(Array.prototype.pop),Ya=co(Array.prototype.push),Kd=co(String.prototype.toLowerCase),uh=co(String.prototype.toString),c_=co(String.prototype.match),Fo=co(String.prototype.replace),h_=co(String.prototype.indexOf),f_=co(String.prototype.trim),Xr=co(RegExp.prototype.test),ja=p_(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 ah(a,t,n)}}function p_(a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return dh(a,e)}}function ui(a,t,e){var n;e=(n=e)!==null&&n!==void 0?n:Kd,Bp&&Bp(a,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=e(o);s!==o&&(s_(t)||(t[r]=s),o=s)}a[o]=!0}return a}function ta(a){const t=d_(null);for(const[e,n]of Vp(a))t[e]=n;return t}function Zd(a,t){for(;a!==null;){const n=a_(a,t);if(n){if(n.get)return co(n.get);if(typeof n.value=="function")return co(n.value)}a=l_(a)}function e(n){return console.warn("fallback value for",n),null}return e}const Up=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"]),ch=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"]),hh=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"]),m_=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"]),fh=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"]),v_=Er(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gp=Er(["#text"]),Wp=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"]),ph=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"]),$p=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"]),Qd=Er(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g_=Ro(/\{\{[\w\W]*|[\w\W]*\}\}/gm),__=Ro(/<%[\w\W]*|[\w\W]*%>/gm),b_=Ro(/\${[\w\W]*}/gm),C_=Ro(/^data-[\-\w.\u00B7-\uFFFF]/),y_=Ro(/^aria-[\-\w]+$/),Yp=Ro(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E_=Ro(/^(?:\w+script|data):/i),S_=Ro(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jp=Ro(/^html$/i);var Xp=Object.freeze({__proto__:null,MUSTACHE_EXPR:g_,ERB_EXPR:__,TMPLIT_EXPR:b_,DATA_ATTR:C_,ARIA_ATTR:y_,IS_ALLOWED_URI:Yp,IS_SCRIPT_OR_DATA:E_,ATTR_WHITESPACE:S_,DOCTYPE_NAME:jp});const w_=()=>typeof window>"u"?null:window,x_=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 qp(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w_();const t=bt=>qp(bt);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,b=u.prototype,C=Zd(b,"cloneNode"),x=Zd(b,"nextSibling"),w=Zd(b,"childNodes"),E=Zd(b,"parentNode");if(typeof s=="function"){const bt=r.createElement("template");bt.content&&bt.content.ownerDocument&&(r=bt.content.ownerDocument)}let D,A="";const{implementation:F,createNodeIterator:N,createDocumentFragment:V,getElementsByTagName:Q}=r,{importNode:L}=e;let le={};t.isSupported=typeof Vp=="function"&&typeof E=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ve,ERB_EXPR:J,TMPLIT_EXPR:z,DATA_ATTR:P,ARIA_ATTR:ae,IS_SCRIPT_OR_DATA:Ke,ATTR_WHITESPACE:Re}=Xp;let{IS_ALLOWED_URI:xe}=Xp,Oe=null;const De=ui({},[...Up,...ch,...hh,...fh,...Gp]);let re=null;const pe=ui({},[...Wp,...ph,...$p,...Qd]);let Ve=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}})),Ye=null,Be=null,ue=!0,Ce=!0,be=!1,Le=!0,nt=!1,Ge=!1,Et=!1,at=!1,k=!1,te=!1,_e=!1,$=!0,X=!1;const ne="user-content-";let Pe=!0,Me=!1,fe={},Ue=null;const ft=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 ze=null;const Ne=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 me=W,ke=!1,st=null;const rt=ui({},[yi,q,W],uh);let ut;const Rt=["application/xhtml+xml","text/html"],Ht="text/html";let Tt,Ut=null;const Kt=r.createElement("form"),Ni=function(ye){return ye instanceof RegExp||ye instanceof Function},Li=function(ye){if(!(Ut&&Ut===ye)){if((!ye||typeof ye!="object")&&(ye={}),ye=ta(ye),ut=Rt.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ut=Ht:ut=ye.PARSER_MEDIA_TYPE,Tt=ut==="application/xhtml+xml"?uh:Kd,Oe="ALLOWED_TAGS"in ye?ui({},ye.ALLOWED_TAGS,Tt):De,re="ALLOWED_ATTR"in ye?ui({},ye.ALLOWED_ATTR,Tt):pe,st="ALLOWED_NAMESPACES"in ye?ui({},ye.ALLOWED_NAMESPACES,uh):rt,Xt="ADD_URI_SAFE_ATTR"in ye?ui(ta(It),ye.ADD_URI_SAFE_ATTR,Tt):It,ze="ADD_DATA_URI_TAGS"in ye?ui(ta(Ne),ye.ADD_DATA_URI_TAGS,Tt):Ne,Ue="FORBID_CONTENTS"in ye?ui({},ye.FORBID_CONTENTS,Tt):ft,Ye="FORBID_TAGS"in ye?ui({},ye.FORBID_TAGS,Tt):{},Be="FORBID_ATTR"in ye?ui({},ye.FORBID_ATTR,Tt):{},fe="USE_PROFILES"in ye?ye.USE_PROFILES:!1,ue=ye.ALLOW_ARIA_ATTR!==!1,Ce=ye.ALLOW_DATA_ATTR!==!1,be=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=ye.SAFE_FOR_TEMPLATES||!1,Ge=ye.WHOLE_DOCUMENT||!1,k=ye.RETURN_DOM||!1,te=ye.RETURN_DOM_FRAGMENT||!1,_e=ye.RETURN_TRUSTED_TYPE||!1,at=ye.FORCE_BODY||!1,$=ye.SANITIZE_DOM!==!1,X=ye.SANITIZE_NAMED_PROPS||!1,Pe=ye.KEEP_CONTENT!==!1,Me=ye.IN_PLACE||!1,xe=ye.ALLOWED_URI_REGEXP||Yp,me=ye.NAMESPACE||W,Ve=ye.CUSTOM_ELEMENT_HANDLING||{},ye.CUSTOM_ELEMENT_HANDLING&&Ni(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ve.tagNameCheck=ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&Ni(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ve.attributeNameCheck=ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ve.allowCustomizedBuiltInElements=ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(Ce=!1),te&&(k=!0),fe&&(Oe=ui({},[...Gp]),re=[],fe.html===!0&&(ui(Oe,Up),ui(re,Wp)),fe.svg===!0&&(ui(Oe,ch),ui(re,ph),ui(re,Qd)),fe.svgFilters===!0&&(ui(Oe,hh),ui(re,ph),ui(re,Qd)),fe.mathMl===!0&&(ui(Oe,fh),ui(re,$p),ui(re,Qd))),ye.ADD_TAGS&&(Oe===De&&(Oe=ta(Oe)),ui(Oe,ye.ADD_TAGS,Tt)),ye.ADD_ATTR&&(re===pe&&(re=ta(re)),ui(re,ye.ADD_ATTR,Tt)),ye.ADD_URI_SAFE_ATTR&&ui(Xt,ye.ADD_URI_SAFE_ATTR,Tt),ye.FORBID_CONTENTS&&(Ue===ft&&(Ue=ta(Ue)),ui(Ue,ye.FORBID_CONTENTS,Tt)),Pe&&(Oe["#text"]=!0),Ge&&ui(Oe,["html","head","body"]),Oe.table&&(ui(Oe,["tbody"]),delete Ye.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=ye.TRUSTED_TYPES_POLICY,A=D.createHTML("")}else D===void 0&&(D=x_(v,n)),D!==null&&typeof A=="string"&&(A=D.createHTML(""));Er&&Er(ye),Ut=ye}},U=ui({},["mi","mo","mn","ms","mtext"]),Z=ui({},["foreignobject","desc","title","annotation-xml"]),ce=ui({},["title","style","font","a","script"]),Se=ui({},ch);ui(Se,hh),ui(Se,m_);const ot=ui({},fh);ui(ot,v_);const mt=function(ye){let Xe=E(ye);(!Xe||!Xe.tagName)&&(Xe={namespaceURI:me,tagName:"template"});const pt=Kd(ye.tagName),Jt=Kd(Xe.tagName);return st[ye.namespaceURI]?ye.namespaceURI===q?Xe.namespaceURI===W?pt==="svg":Xe.namespaceURI===yi?pt==="svg"&&(Jt==="annotation-xml"||U[Jt]):!!Se[pt]:ye.namespaceURI===yi?Xe.namespaceURI===W?pt==="math":Xe.namespaceURI===q?pt==="math"&&Z[Jt]:!!ot[pt]:ye.namespaceURI===W?Xe.namespaceURI===q&&!Z[Jt]||Xe.namespaceURI===yi&&!U[Jt]?!1:!ot[pt]&&(ce[pt]||!Se[pt]):!!(ut==="application/xhtml+xml"&&st[ye.namespaceURI]):!1},ct=function(ye){Ya(t.removed,{element:ye});try{ye.parentNode.removeChild(ye)}catch{ye.remove()}},wt=function(ye,Xe){try{Ya(t.removed,{attribute:Xe.getAttributeNode(ye),from:Xe})}catch{Ya(t.removed,{attribute:null,from:Xe})}if(Xe.removeAttribute(ye),ye==="is"&&!re[ye])if(k||te)try{ct(Xe)}catch{}else try{Xe.setAttribute(ye,"")}catch{}},Vt=function(ye){let Xe,pt;if(at)ye="<remove></remove>"+ye;else{const vn=c_(ye,/^[\r\n\t ]+/);pt=vn&&vn[0]}ut==="application/xhtml+xml"&&me===W&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");const Jt=D?D.createHTML(ye):ye;if(me===W)try{Xe=new m().parseFromString(Jt,ut)}catch{}if(!Xe||!Xe.documentElement){Xe=F.createDocument(me,"template",null);try{Xe.documentElement.innerHTML=ke?A:Jt}catch{}}const Mi=Xe.body||Xe.documentElement;return ye&&pt&&Mi.insertBefore(r.createTextNode(pt),Mi.childNodes[0]||null),me===W?Q.call(Xe,Ge?"html":"body")[0]:Ge?Xe.documentElement:Mi},yt=function(ye){return N.call(ye.ownerDocument||ye,ye,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},gt=function(ye){return ye instanceof f&&(typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||!(ye.attributes instanceof c)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function")},Zt=function(ye){return typeof l=="object"?ye instanceof l:ye&&typeof ye=="object"&&typeof ye.nodeType=="number"&&typeof ye.nodeName=="string"},Ii=function(ye,Xe,pt){le[ye]&&u_(le[ye],Jt=>{Jt.call(t,Xe,pt,Ut)})},Gi=function(ye){let Xe;if(Ii("beforeSanitizeElements",ye,null),gt(ye))return ct(ye),!0;const pt=Tt(ye.nodeName);if(Ii("uponSanitizeElement",ye,{tagName:pt,allowedTags:Oe}),ye.hasChildNodes()&&!Zt(ye.firstElementChild)&&(!Zt(ye.content)||!Zt(ye.content.firstElementChild))&&Xr(/<[/\w]/g,ye.innerHTML)&&Xr(/<[/\w]/g,ye.textContent))return ct(ye),!0;if(!Oe[pt]||Ye[pt]){if(!Ye[pt]&&Hi(pt)&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,pt)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(pt)))return!1;if(Pe&&!Ue[pt]){const Jt=E(ye)||ye.parentNode,Mi=w(ye)||ye.childNodes;if(Mi&&Jt){const vn=Mi.length;for(let pi=vn-1;pi>=0;--pi)Jt.insertBefore(C(Mi[pi],!0),x(ye))}}return ct(ye),!0}return ye instanceof u&&!mt(ye)||(pt==="noscript"||pt==="noembed"||pt==="noframes")&&Xr(/<\/no(script|embed|frames)/i,ye.innerHTML)?(ct(ye),!0):(nt&&ye.nodeType===3&&(Xe=ye.textContent,Xe=Fo(Xe,ve," "),Xe=Fo(Xe,J," "),Xe=Fo(Xe,z," "),ye.textContent!==Xe&&(Ya(t.removed,{element:ye.cloneNode()}),ye.textContent=Xe)),Ii("afterSanitizeElements",ye,null),!1)},Qt=function(ye,Xe,pt){if($&&(Xe==="id"||Xe==="name")&&(pt in r||pt in Kt))return!1;if(!(Ce&&!Be[Xe]&&Xr(P,Xe))){if(!(ue&&Xr(ae,Xe))){if(!re[Xe]||Be[Xe]){if(!(Hi(ye)&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,ye)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(ye))&&(Ve.attributeNameCheck instanceof RegExp&&Xr(Ve.attributeNameCheck,Xe)||Ve.attributeNameCheck instanceof Function&&Ve.attributeNameCheck(Xe))||Xe==="is"&&Ve.allowCustomizedBuiltInElements&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,pt)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(pt))))return!1}else if(!Xt[Xe]){if(!Xr(xe,Fo(pt,Re,""))){if(!((Xe==="src"||Xe==="xlink:href"||Xe==="href")&&ye!=="script"&&h_(pt,"data:")===0&&ze[ye])){if(!(be&&!Xr(Ke,Fo(pt,Re,"")))){if(pt)return!1}}}}}}return!0},Hi=function(ye){return ye.indexOf("-")>0},Ln=function(ye){let Xe,pt,Jt,Mi;Ii("beforeSanitizeAttributes",ye,null);const{attributes:vn}=ye;if(!vn)return;const pi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re};for(Mi=vn.length;Mi--;){Xe=vn[Mi];const{name:Xi,namespaceURI:lr}=Xe;if(pt=Xi==="value"?Xe.value:f_(Xe.value),Jt=Tt(Xi),pi.attrName=Jt,pi.attrValue=pt,pi.keepAttr=!0,pi.forceKeepAttr=void 0,Ii("uponSanitizeAttribute",ye,pi),pt=pi.attrValue,pi.forceKeepAttr||(wt(Xi,ye),!pi.keepAttr))continue;if(!Le&&Xr(/\/>/i,pt)){wt(Xi,ye);continue}nt&&(pt=Fo(pt,ve," "),pt=Fo(pt,J," "),pt=Fo(pt,z," "));const Ei=Tt(ye.nodeName);if(Qt(Ei,Jt,pt)){if(X&&(Jt==="id"||Jt==="name")&&(wt(Xi,ye),pt=ne+pt),D&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!lr)switch(v.getAttributeType(Ei,Jt)){case"TrustedHTML":{pt=D.createHTML(pt);break}case"TrustedScriptURL":{pt=D.createScriptURL(pt);break}}try{lr?ye.setAttributeNS(lr,Xi,pt):ye.setAttribute(Xi,pt),zp(t.removed)}catch{}}}Ii("afterSanitizeAttributes",ye,null)},mn=function bt(ye){let Xe;const pt=yt(ye);for(Ii("beforeSanitizeShadowDOM",ye,null);Xe=pt.nextNode();)Ii("uponSanitizeShadowNode",Xe,null),!Gi(Xe)&&(Xe.content instanceof o&&bt(Xe.content),Ln(Xe));Ii("afterSanitizeShadowDOM",ye,null)};return t.sanitize=function(bt){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe,pt,Jt,Mi;if(ke=!bt,ke&&(bt="<!-->"),typeof bt!="string"&&!Zt(bt))if(typeof bt.toString=="function"){if(bt=bt.toString(),typeof bt!="string")throw ja("dirty is not a string, aborting")}else throw ja("toString is not a function");if(!t.isSupported)return bt;if(Et||Li(ye),t.removed=[],typeof bt=="string"&&(Me=!1),Me){if(bt.nodeName){const Xi=Tt(bt.nodeName);if(!Oe[Xi]||Ye[Xi])throw ja("root node is forbidden and cannot be sanitized in-place")}}else if(bt instanceof l)Xe=Vt("<!---->"),pt=Xe.ownerDocument.importNode(bt,!0),pt.nodeType===1&&pt.nodeName==="BODY"||pt.nodeName==="HTML"?Xe=pt:Xe.appendChild(pt);else{if(!k&&!nt&&!Ge&&bt.indexOf("<")===-1)return D&&_e?D.createHTML(bt):bt;if(Xe=Vt(bt),!Xe)return k?null:_e?A:""}Xe&&at&&ct(Xe.firstChild);const vn=yt(Me?bt:Xe);for(;Jt=vn.nextNode();)Gi(Jt)||(Jt.content instanceof o&&mn(Jt.content),Ln(Jt));if(Me)return bt;if(k){if(te)for(Mi=V.call(Xe.ownerDocument);Xe.firstChild;)Mi.appendChild(Xe.firstChild);else Mi=Xe;return(re.shadowroot||re.shadowrootmode)&&(Mi=L.call(e,Mi,!0)),Mi}let pi=Ge?Xe.outerHTML:Xe.innerHTML;return Ge&&Oe["!doctype"]&&Xe.ownerDocument&&Xe.ownerDocument.doctype&&Xe.ownerDocument.doctype.name&&Xr(jp,Xe.ownerDocument.doctype.name)&&(pi="<!DOCTYPE "+Xe.ownerDocument.doctype.name+`>
|
|
4
|
+
`+new Error().stack),R=!1}return S.apply(this,arguments)},S)}var L={};function le(g,S){n.deprecationHandler!=null&&n.deprecationHandler(g,S),L[g]||(V(S),L[g]=!0)}function ve(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function J(g,S){var R,H=m({},g);for(R in S)s(S,R)&&(o(g[R])&&o(S[R])?(H[R]={},m(H[R],g[R]),m(H[R],S[R])):S[R]!=null?H[R]=S[R]:delete H[R]);for(R in g)s(g,R)&&!s(S,R)&&o(g[R])&&(H[R]=m({},H[R]));return H}function z(g){g!=null&&this.set(g)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var P=Object.keys||function(g){var S,R=[];for(S in g)s(g,S)&&R.push(S);return R};function ae(g,S,R){var H=""+Math.abs(g);return(0<=g?R?"+":"":"-")+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,Re=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,xe={},Oe={};function De(g,S,R,H){var ee=typeof H=="string"?function(){return this[H]()}:H;g&&(Oe[g]=ee),S&&(Oe[S[0]]=function(){return ae(ee.apply(this,arguments),S[1],S[2])}),R&&(Oe[R]=function(){return this.localeData().ordinal(ee.apply(this,arguments),g)})}function re(g,S){return g.isValid()?(S=pe(S,g.localeData()),xe[S]=xe[S]||function(R){for(var H,ee=R.match(Ke),we=0,He=ee.length;we<He;we++)Oe[ee[we]]?ee[we]=Oe[ee[we]]:ee[we]=(H=ee[we]).match(/\[[\s\S]/)?H.replace(/^\[|\]$/g,""):H.replace(/\\/g,"");return function(qe){for(var Ct="",ht=0;ht<He;ht++)Ct+=ve(ee[ht])?ee[ht].call(qe,R):ee[ht];return Ct}}(S),xe[S](g)):g.localeData().invalidDate()}function pe(g,S){var R=5;function H(ee){return S.longDateFormat(ee)||ee}for(Re.lastIndex=0;0<=R&&Re.test(g);)g=g.replace(Re,H),Re.lastIndex=0,--R;return g}var Ve={};function Ye(g,S){var R=g.toLowerCase();Ve[R]=Ve[R+"s"]=Ve[S]=g}function Be(g){return typeof g=="string"?Ve[g]||Ve[g.toLowerCase()]:void 0}function ue(g){var S,R,H={};for(R in g)s(g,R)&&(S=Be(R))&&(H[S]=g[R]);return H}var Ce={};function be(g,S){Ce[g]=S}function Le(g){return g%4==0&&g%100!=0||g%400==0}function nt(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ge(S){var S=+S,R=0;return R=S!=0&&isFinite(S)?nt(S):R}function Et(g,S){return function(R){return R!=null?(k(this,g,R),n.updateOffset(this,S),this):at(this,g)}}function at(g,S){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+S]():NaN}function k(g,S,R){g.isValid()&&!isNaN(R)&&(S==="FullYear"&&Le(g.year())&&g.month()===1&&g.date()===29?(R=Ge(R),g._d["set"+(g._isUTC?"UTC":"")+S](R,g.month(),Li(R,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+S](R))}var te=/\d/,Mt=/\d\d/,_e=/\d{3}/,qi=/\d{4}/,sn=/[+-]?\d{6}/,$=/\d\d?/,X=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,Pe=/\d{1,3}/,jn=/\d{1,4}/,Tr=/[+-]?\d{1,6}/,Me=/\d+/,fe=/[+-]?\d+/,Ue=/Z|[+-]\d\d:?\d\d/gi,ft=/Z|[+-]\d\d(?::?\d\d)?/gi,ze=/[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 Ne(g,S,R){yi[g]=ve(S)?S:function(H,ee){return H&&R?R:S}}function Xt(g,S){return s(yi,g)?yi[g](S._strict,S._locale):new RegExp(It(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(R,H,ee,we,He){return H||ee||we||He})))}function It(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var yi={},q={};function W(g,S){var R,H,ee=S;for(typeof g=="string"&&(g=[g]),p(S)&&(ee=function(we,He){He[S]=Ge(we)}),H=g.length,R=0;R<H;R++)q[g[R]]=ee}function me(g,S){W(g,function(R,H,ee,we){ee._w=ee._w||{},S(R,ee._w,ee,we)})}var ke,st=0,rt=1,ut=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 R=(S%(R=12)+R)%R;return g+=(S-R)/12,R==1?Le(g)?29:28:31-R%7%2}ke=Array.prototype.indexOf||function(g){for(var S=0;S<this.length;++S)if(this[S]===g)return S;return-1},De("M",["MM",2],"Mo",function(){return this.month()+1}),De("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)}),De("MMMM",0,0,function(g){return this.localeData().months(this,g)}),Ye("month","M"),be("month",8),Ne("M",$),Ne("MM",$,Mt),Ne("MMM",function(g,S){return S.monthsShortRegex(g)}),Ne("MMMM",function(g,S){return S.monthsRegex(g)}),W(["M","MM"],function(g,S){S[rt]=Ge(g)-1}),W(["MMM","MMMM"],function(g,S,R,H){H=R._locale.monthsParse(g,H,R._strict),H!=null?S[rt]=H:b(R).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?/,Se=ze,ot=ze;function mt(g,S){var R;if(g.isValid()){if(typeof S=="string"){if(/^\d+$/.test(S))S=Ge(S);else if(!p(S=g.localeData().monthsParse(S)))return}R=Math.min(g.date(),Li(g.year(),S)),g._d["set"+(g._isUTC?"UTC":"")+"Month"](S,R)}}function ct(g){return g!=null?(mt(this,g),n.updateOffset(this,!0),this):at(this,"Month")}function wt(){function g(He,qe){return qe.length-He.length}for(var S,R=[],H=[],ee=[],we=0;we<12;we++)S=v([2e3,we]),R.push(this.monthsShort(S,"")),H.push(this.months(S,"")),ee.push(this.months(S,"")),ee.push(this.monthsShort(S,""));for(R.sort(g),H.sort(g),ee.sort(g),we=0;we<12;we++)R[we]=It(R[we]),H[we]=It(H[we]);for(we=0;we<24;we++)ee[we]=It(ee[we]);this._monthsRegex=new RegExp("^("+ee.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+H.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+R.join("|")+")","i")}function Vt(g){return Le(g)?366:365}De("Y",0,0,function(){var g=this.year();return g<=9999?ae(g,4):"+"+g}),De(0,["YY",2],0,function(){return this.year()%100}),De(0,["YYYY",4],0,"year"),De(0,["YYYYY",5],0,"year"),De(0,["YYYYYY",6,!0],0,"year"),Ye("year","y"),be("year",1),Ne("Y",fe),Ne("YY",$,Mt),Ne("YYYY",jn,qi),Ne("YYYYY",Tr,sn),Ne("YYYYYY",Tr,sn),W(["YYYYY","YYYYYY"],st),W("YYYY",function(g,S){S[st]=g.length===2?n.parseTwoDigitYear(g):Ge(g)}),W("YY",function(g,S){S[st]=n.parseTwoDigitYear(g)}),W("Y",function(g,S){S[st]=parseInt(g,10)}),n.parseTwoDigitYear=function(g){return Ge(g)+(68<Ge(g)?1900:2e3)};var xo=Et("FullYear",!0);function yt(g,S,R,H,ee,we,He){var qe;return g<100&&0<=g?(qe=new Date(g+400,S,R,H,ee,we,He),isFinite(qe.getFullYear())&&qe.setFullYear(g)):qe=new Date(g,S,R,H,ee,we,He),qe}function gt(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,R){return R=7+S-R,R-(7+gt(g,0,R).getUTCDay()-S)%7-1}function Ii(g,He,qe,H,ee){var we,He=1+7*(He-1)+(7+qe-H)%7+Zt(g,H,ee),qe=He<=0?Vt(we=g-1)+He:He>Vt(g)?(we=g+1,He-Vt(g)):(we=g,He);return{year:we,dayOfYear:qe}}function Gi(g,S,R){var H,ee,we=Zt(g.year(),S,R),we=Math.floor((g.dayOfYear()-we-1)/7)+1;return we<1?H=we+Qt(ee=g.year()-1,S,R):we>Qt(g.year(),S,R)?(H=we-Qt(g.year(),S,R),ee=g.year()+1):(ee=g.year(),H=we),{week:H,year:ee}}function Qt(g,ee,R){var H=Zt(g,ee,R),ee=Zt(g+1,ee,R);return(Vt(g)-H+ee)/7}De("w",["ww",2],"wo","week"),De("W",["WW",2],"Wo","isoWeek"),Ye("week","w"),Ye("isoWeek","W"),be("week",5),be("isoWeek",5),Ne("w",$),Ne("ww",$,Mt),Ne("W",$),Ne("WW",$,Mt),me(["w","ww","W","WW"],function(g,S,R,H){S[H.substr(0,1)]=Ge(g)});function Hi(g,S){return g.slice(S,7).concat(g.slice(0,S))}De("d",0,"do","day"),De("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),De("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),De("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),De("e",0,0,"weekday"),De("E",0,0,"isoWeekday"),Ye("day","d"),Ye("weekday","e"),Ye("isoWeekday","E"),be("day",11),be("weekday",11),be("isoWeekday",11),Ne("d",$),Ne("e",$),Ne("E",$),Ne("dd",function(g,S){return S.weekdaysMinRegex(g)}),Ne("ddd",function(g,S){return S.weekdaysShortRegex(g)}),Ne("dddd",function(g,S){return S.weekdaysRegex(g)}),me(["dd","ddd","dddd"],function(g,S,R,H){H=R._locale.weekdaysParse(g,H,R._strict),H!=null?S.d=H:b(R).invalidWeekday=g}),me(["d","e","E"],function(g,S,R,H){S[H]=Ge(g)});var Ln="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ye=ze,Xe=ze,pt=ze;function Jt(){function g(ht,zt){return zt.length-ht.length}for(var S,R,H,ee=[],we=[],He=[],qe=[],Ct=0;Ct<7;Ct++)H=v([2e3,1]).day(Ct),S=It(this.weekdaysMin(H,"")),R=It(this.weekdaysShort(H,"")),H=It(this.weekdays(H,"")),ee.push(S),we.push(R),He.push(H),qe.push(S),qe.push(R),qe.push(H);ee.sort(g),we.sort(g),He.sort(g),qe.sort(g),this._weekdaysRegex=new RegExp("^("+qe.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+He.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+we.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+ee.join("|")+")","i")}function Mi(){return this.hours()%12||12}function vn(g,S){De(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),S)})}function pi(g,S){return S._meridiemParse}De("H",["HH",2],0,"hour"),De("h",["hh",2],0,Mi),De("k",["kk",2],0,function(){return this.hours()||24}),De("hmm",0,0,function(){return""+Mi.apply(this)+ae(this.minutes(),2)}),De("hmmss",0,0,function(){return""+Mi.apply(this)+ae(this.minutes(),2)+ae(this.seconds(),2)}),De("Hmm",0,0,function(){return""+this.hours()+ae(this.minutes(),2)}),De("Hmmss",0,0,function(){return""+this.hours()+ae(this.minutes(),2)+ae(this.seconds(),2)}),vn("a",!0),vn("A",!1),Ye("hour","h"),be("hour",13),Ne("a",pi),Ne("A",pi),Ne("H",$),Ne("h",$),Ne("k",$),Ne("HH",$,Mt),Ne("hh",$,Mt),Ne("kk",$,Mt),Ne("hmm",X),Ne("hmmss",ne),Ne("Hmm",X),Ne("Hmmss",ne),W(["H","HH"],Rt),W(["k","kk"],function(g,S,R){g=Ge(g),S[Rt]=g===24?0:g}),W(["a","A"],function(g,S,R){R._isPm=R._locale.isPM(g),R._meridiem=g}),W(["h","hh"],function(g,S,R){S[Rt]=Ge(g),b(R).bigHour=!0}),W("hmm",function(g,S,R){var H=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H)),b(R).bigHour=!0}),W("hmmss",function(g,S,R){var H=g.length-4,ee=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H,2)),S[Tt]=Ge(g.substr(ee)),b(R).bigHour=!0}),W("Hmm",function(g,S,R){var H=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H))}),W("Hmmss",function(g,S,R){var H=g.length-4,ee=g.length-2;S[Rt]=Ge(g.substr(0,H)),S[Ht]=Ge(g.substr(H,2)),S[Tt]=Ge(g.substr(ee))}),ze=Et("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:Ln,weekdaysMin:bt,weekdaysShort:mn,meridiemParse:/[ap]\.?m?\.?/i},Ei={},rn={};function Lr(g){return g&&g.toLowerCase().replace("_","-")}function go(g){for(var S,R,H,ee,we=0;we<g.length;){for(S=(ee=Lr(g[we]).split("-")).length,R=(R=Lr(g[we+1]))?R.split("-"):null;0<S;){if(H=Qn(ee.slice(0,S).join("-")))return H;if(R&&R.length>=S&&function(He,qe){for(var Ct=Math.min(He.length,qe.length),ht=0;ht<Ct;ht+=1)if(He[ht]!==qe[ht])return ht;return Ct}(ee,R)>=S-1)break;S--}we++}return Xi}function Qn(g){var S;if(Ei[g]===void 0&&a&&a.exports&&g.match("^[^/\\\\]*$")!=null)try{S=Xi._abbr,La("./locale/"+g),Jn(S)}catch{Ei[g]=null}return Ei[g]}function Jn(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 R,H=lr;if(S.abbr=g,Ei[g]!=null)le("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((R=Qn(S.parentLocale))==null)return rn[S.parentLocale]||(rn[S.parentLocale]=[]),rn[S.parentLocale].push({name:g,config:S}),null;H=R._config}return Ei[g]=new z(J(H,S)),rn[g]&&rn[g].forEach(function(ee){_o(ee.name,ee.config)}),Jn(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=Qn(g))return S;g=[g]}return go(g)}function ar(g){var S=g._a;return S&&b(g).overflow===-2&&(S=S[rt]<0||11<S[rt]?rt:S[ut]<1||S[ut]>Li(S[st],S[rt])?ut: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,b(g)._overflowDayOfYear&&(S<st||ut<S)&&(S=ut),b(g)._overflowWeeks&&S===-1&&(S=Kt),b(g)._overflowWeekday&&S===-1&&(S=Ni),b(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)?)?$/,Un=/^\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)?)?$/,Hn=/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]],Vn=[["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}))$/,gn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function er(g){var S,R,H,ee,we,He,Ct=g._i,qe=xr.exec(Ct)||Un.exec(Ct),Ct=ci.length,ht=Vn.length;if(qe){for(b(g).iso=!0,S=0,R=Ct;S<R;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,R=ht;S<R;S++)if(Vn[S][1].exec(qe[3])){we=(qe[2]||" ")+Vn[S][0];break}if(we==null)return void(g._isValid=!1)}if(H||we==null){if(qe[4]){if(!Hn.exec(qe[4]))return void(g._isValid=!1);He="Z"}g._f=ee+(we||"")+(He||""),Ee(g)}else g._isValid=!1}}else g._isValid=!1}function vr(g,S,R,H,ee,we){return g=[function(He){He=parseInt(He,10);{if(He<=49)return 2e3+He;if(He<=999)return 1900+He}return He}(g),Z.indexOf(S),parseInt(R,10),parseInt(H,10),parseInt(ee,10)],we&&g.push(parseInt(we,10)),g}function gr(g){var S,R,H,ee,we=bo.exec(g._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));we?(S=vr(we[4],we[3],we[2],we[5],we[6],we[7]),R=we[1],H=S,ee=g,R&&mn.indexOf(R)!==new Date(H[0],H[1],H[2]).getDay()?(b(ee).weekdayMismatch=!0,ee._isValid=!1):(g._a=S,g._tzm=(R=we[8],H=we[9],ee=we[10],R?gn[R]:H?0:60*(((R=parseInt(ee,10))-(H=R%100))/100)+H),g._d=gt.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),b(g).rfc2822=!0)):g._isValid=!1}function oe(g,S,R){return g??S??R}function de(g){var S,R,H,ee,we,He,qe,Ct,ht,zt,Nt,Ki=[];if(!g._d){for(H=g,ee=new Date(n.now()),R=H._useUTC?[ee.getUTCFullYear(),ee.getUTCMonth(),ee.getUTCDate()]:[ee.getFullYear(),ee.getMonth(),ee.getDate()],g._w&&g._a[ut]==null&&g._a[rt]==null&&((ee=(H=g)._w).GG!=null||ee.W!=null||ee.E!=null?(Ct=1,ht=4,we=oe(ee.GG,H._a[st],Gi(lt(),1,4).year),He=oe(ee.W,1),((qe=oe(ee.E,1))<1||7<qe)&&(zt=!0)):(Ct=H._locale._week.dow,ht=H._locale._week.doy,Nt=Gi(lt(),Ct,ht),we=oe(ee.gg,H._a[st],Nt.year),He=oe(ee.w,Nt.week),ee.d!=null?((qe=ee.d)<0||6<qe)&&(zt=!0):ee.e!=null?(qe=ee.e+Ct,(ee.e<0||6<ee.e)&&(zt=!0)):qe=Ct),He<1||He>Qt(we,Ct,ht)?b(H)._overflowWeeks=!0:zt!=null?b(H)._overflowWeekday=!0:(Nt=Ii(we,He,qe,Ct,ht),H._a[st]=Nt.year,H._dayOfYear=Nt.dayOfYear)),g._dayOfYear!=null&&(ee=oe(g._a[st],R[st]),(g._dayOfYear>Vt(ee)||g._dayOfYear===0)&&(b(g)._overflowDayOfYear=!0),zt=gt(ee,0,g._dayOfYear),g._a[rt]=zt.getUTCMonth(),g._a[ut]=zt.getUTCDate()),S=0;S<3&&g._a[S]==null;++S)g._a[S]=Ki[S]=R[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?gt:yt).apply(null,Ki),we=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!==we&&(b(g).weekdayMismatch=!0)}}function Ee(g){if(g._f===n.ISO_8601)er(g);else if(g._f===n.RFC_2822)gr(g);else{g._a=[],b(g).empty=!0;for(var S,R,H,ee,we,He=""+g._i,qe=He.length,Ct=0,ht=pe(g._f,g._locale).match(Ke)||[],zt=ht.length,Nt=0;Nt<zt;Nt++)R=ht[Nt],(S=(He.match(Xt(R,g))||[])[0])&&(0<(H=He.substr(0,He.indexOf(S))).length&&b(g).unusedInput.push(H),He=He.slice(He.indexOf(S)+S.length),Ct+=S.length),Oe[R]?(S?b(g).empty=!1:b(g).unusedTokens.push(R),H=R,we=g,(ee=S)!=null&&s(q,H)&&q[H](ee,we._a,we,H)):g._strict&&!S&&b(g).unusedTokens.push(R);b(g).charsLeftOver=qe-Ct,0<He.length&&b(g).unusedInput.push(He),g._a[Rt]<=12&&b(g).bigHour===!0&&0<g._a[Rt]&&(b(g).bigHour=void 0),b(g).parsedDateParts=g._a.slice(0),b(g).meridiem=g._meridiem,g._a[Rt]=function(Ki,an,Zi){return Zi==null?an:Ki.meridiemHour!=null?Ki.meridiemHour(an,Zi):Ki.isPM!=null?((Ki=Ki.isPM(Zi))&&an<12&&(an+=12),an=Ki||an!==12?an:0):an}(g._locale,g._a[Rt],g._meridiem),(qe=b(g).era)!==null&&(g._a[st]=g._locale.erasConvertYear(qe,g._a[st])),de(g),ar(g)}}function We(g){var S,R,H,ee=g._i,we=g._f;return g._locale=g._locale||mr(g._l),ee===null||we===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(we)?function(He){var qe,Ct,ht,zt,Nt,Ki,an=!1,Zi=He._f.length;if(Zi===0)return b(He).invalidFormat=!0,He._d=new Date(NaN);for(zt=0;zt<Zi;zt++)Nt=0,Ki=!1,qe=A({},He),He._useUTC!=null&&(qe._useUTC=He._useUTC),qe._f=He._f[zt],Ee(qe),C(qe)&&(Ki=!0),Nt=(Nt+=b(qe).charsLeftOver)+10*b(qe).unusedTokens.length,b(qe).score=Nt,an?Nt<ht&&(ht=Nt,Ct=qe):(ht==null||Nt<ht||Ki)&&(ht=Nt,Ct=qe,Ki&&(an=!0));m(He,Ct||qe)}(g):we?Ee(g):u(we=(ee=g)._i)?ee._d=new Date(n.now()):c(we)?ee._d=new Date(we.valueOf()):typeof we=="string"?(R=ee,(S=Jr.exec(R._i))!==null?R._d=new Date(+S[1]):(er(R),R._isValid===!1&&(delete R._isValid,gr(R),R._isValid===!1&&(delete R._isValid,R._strict?R._isValid=!1:n.createFromInputFallback(R))))):r(we)?(ee._a=f(we.slice(0),function(He){return parseInt(He,10)}),de(ee)):o(we)?(S=ee)._d||(H=(R=ue(S._i)).day===void 0?R.date:R.day,S._a=f([R.year,R.month,H,R.hour,R.minute,R.second,R.millisecond],function(He){return He&&parseInt(He,10)}),de(S)):p(we)?ee._d=new Date(we):n.createFromInputFallback(ee),C(g)||(g._d=null),g))}function Je(g,S,R,H,ee){var we={};return S!==!0&&S!==!1||(H=S,S=void 0),R!==!0&&R!==!1||(H=R,R=void 0),(o(g)&&l(g)||r(g)&&g.length===0)&&(g=void 0),we._isAMomentObject=!0,we._useUTC=we._isUTC=ee,we._l=R,we._i=g,we._f=S,we._strict=H,(ee=new F(ar(We(ee=we))))._nextDay&&(ee.add(1,"d"),ee._nextDay=void 0),ee}function lt(g,S,R,H){return Je(g,S,R,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=lt.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=lt.apply(null,arguments);return this.isValid()&&g.isValid()?this<g?this:g:x()});function Ot(g,S){var R,H;if(!(S=S.length===1&&r(S[0])?S[0]:S).length)return lt();for(R=S[0],H=1;H<S.length;++H)S[H].isValid()&&!S[H][g](R)||(R=S[H]);return R}var Bt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hi(S){var S=ue(S),R=S.year||0,H=S.quarter||0,ee=S.month||0,we=S.week||S.isoWeek||0,He=S.day||0,qe=S.hour||0,Ct=S.minute||0,ht=S.second||0,zt=S.millisecond||0;this._isValid=function(Nt){var Ki,an,Zi=!1,rs=Bt.length;for(Ki in Nt)if(s(Nt,Ki)&&(ke.call(Bt,Ki)===-1||Nt[Ki]!=null&&isNaN(Nt[Ki])))return!1;for(an=0;an<rs;++an)if(Nt[Bt[an]]){if(Zi)return!1;parseFloat(Nt[Bt[an]])!==Ge(Nt[Bt[an]])&&(Zi=!0)}return!0}(S),this._milliseconds=+zt+1e3*ht+6e4*Ct+1e3*qe*60*60,this._days=+He+7*we,this._months=+ee+3*H+12*R,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 En(g,S){De(g,0,0,function(){var R=this.utcOffset(),H="+";return R<0&&(R=-R,H="-"),H+ae(~~(R/60),2)+S+ae(~~R%60,2)})}En("Z",":"),En("ZZ",""),Ne("Z",ft),Ne("ZZ",ft),W(["Z","ZZ"],function(g,S,R){R._useUTC=!0,R._tzm=Wn(ft,g)});var Gn=/([\+\-]|\d\d)/gi;function Wn(g,R){var R=(R||"").match(g);return R===null?null:(R=60*(g=((R[R.length-1]||[])+"").match(Gn)||["-",0,0])[1]+Ge(g[2]))===0?0:g[0]==="+"?R:-R}function $n(g,S){var R;return S._isUTC?(S=S.clone(),R=(N(g)||c(g)?g:lt(g)).valueOf()-S.valueOf(),S._d.setTime(S._d.valueOf()+R),n.updateOffset(S,!1),S):lt(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*)?)?$/,Vi=/^(-|\+)?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 R,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))?(R=ee[1]==="-"?-1:1,H={y:0,d:Ge(ee[ut])*R,h:Ge(ee[Rt])*R,m:Ge(ee[Ht])*R,s:Ge(ee[Tt])*R,ms:Ge(wi(1e3*ee[Ut]))*R}):(ee=Vi.exec(g))?(R=ee[1]==="-"?-1:1,H={y:Hr(ee[2],R),M:Hr(ee[3],R),w:Hr(ee[4],R),d:Hr(ee[5],R),h:Hr(ee[6],R),m:Hr(ee[7],R),s:Hr(ee[8],R)}):H==null?H={}:typeof H=="object"&&("from"in H||"to"in H)&&(S=function(we,He){var qe;return!we.isValid()||!He.isValid()?{milliseconds:0,months:0}:(He=$n(He,we),we.isBefore(He)?qe=Ss(we,He):((qe=Ss(He,we)).milliseconds=-qe.milliseconds,qe.months=-qe.months),qe)}(lt(H.from),lt(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 R={};return R.months=S.month()-g.month()+12*(S.year()-g.year()),g.clone().add(R.months,"M").isAfter(S)&&--R.months,R.milliseconds=+S-+g.clone().add(R.months,"M"),R}function yo(g,S){return function(R,H){var ee;return H===null||isNaN(+H)||(le(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=R,R=H,H=ee),Js(this,Ai(R,H),g),this}}function Js(g,He,R,H){var ee=He._milliseconds,we=wi(He._days),He=wi(He._months);g.isValid()&&(H=H==null||H,He&&mt(g,at(g,"Month")+He*R),we&&k(g,"Date",at(g,"Date")+we*R),ee&&g._d.setTime(g._d.valueOf()+ee*R),H&&n.updateOffset(g,we||He))}Ai.fn=hi.prototype,Ai.invalid=function(){return Ai(NaN)},U=yo(1,"add"),Ln=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 R=r(S),H=!1;return R&&(H=S.filter(function(ee){return!p(ee)&&ws(S)}).length===0),R&&H}(g)||function(S){var R,H,ee=o(S)&&!l(S),we=!1,He=["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=He.length;for(R=0;R<qe;R+=1)H=He[R],we=we||s(S,H);return ee&&we}(g)||g==null}function ts(g,ee){if(g.date()<ee.date())return-ts(ee,g);var R=12*(ee.year()-g.year())+(ee.month()-g.month()),H=g.clone().add(R,"months"),ee=ee-H<0?(ee-H)/(H-g.clone().add(R-1,"months")):(ee-H)/(g.clone().add(1+R,"months")-H);return-(R+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]",bt=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,R){return g<100&&0<=g?new Date(g+400,S,R)-_i:new Date(g,S,R).valueOf()}function Ts(g,S,R){return g<100&&0<=g?Date.UTC(g+400,S,R)-_i:Date.UTC(g,S,R)}function Dl(g,S){return S.erasAbbrRegex(g)}function el(){for(var g=[],S=[],R=[],H=[],ee=this.eras(),we=0,He=ee.length;we<He;++we)S.push(It(ee[we].name)),g.push(It(ee[we].abbr)),R.push(It(ee[we].narrow)),H.push(It(ee[we].name)),H.push(It(ee[we].abbr)),H.push(It(ee[we].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("^("+R.join("|")+")","i")}function is(g,S){De(0,[g,g.length],0,S)}function Os(g,S,R,H,ee){var we;return g==null?Gi(this,H,ee).year:(we=Qt(g,H,ee),(function(He,qe,Ct,ht,zt){return He=Ii(He,qe,Ct,ht,zt),qe=gt(He.year,0,He.dayOfYear),this.year(qe.getUTCFullYear()),this.month(qe.getUTCMonth()),this.date(qe.getUTCDate()),this}).call(this,g,S=we<S?we:S,R,H,ee))}De("N",0,0,"eraAbbr"),De("NN",0,0,"eraAbbr"),De("NNN",0,0,"eraAbbr"),De("NNNN",0,0,"eraName"),De("NNNNN",0,0,"eraNarrow"),De("y",["y",1],"yo","eraYear"),De("y",["yy",2],0,"eraYear"),De("y",["yyy",3],0,"eraYear"),De("y",["yyyy",4],0,"eraYear"),Ne("N",Dl),Ne("NN",Dl),Ne("NNN",Dl),Ne("NNNN",function(g,S){return S.erasNameRegex(g)}),Ne("NNNNN",function(g,S){return S.erasNarrowRegex(g)}),W(["N","NN","NNN","NNNN","NNNNN"],function(g,S,R,H){H=R._locale.erasParse(g,H,R._strict),H?b(R).era=H:b(R).invalidEra=g}),Ne("y",Me),Ne("yy",Me),Ne("yyy",Me),Ne("yyyy",Me),Ne("yo",function(g,S){return S._eraYearOrdinalRegex||Me}),W(["y","yy","yyy","yyyy"],st),W(["yo"],function(g,S,R,H){var ee;R._locale._eraYearOrdinalRegex&&(ee=g.match(R._locale._eraYearOrdinalRegex)),R._locale.eraYearOrdinalParse?S[st]=R._locale.eraYearOrdinalParse(g,ee):S[st]=parseInt(g,10)}),De(0,["gg",2],0,function(){return this.weekYear()%100}),De(0,["GG",2],0,function(){return this.isoWeekYear()%100}),is("gggg","weekYear"),is("ggggg","weekYear"),is("GGGG","isoWeekYear"),is("GGGGG","isoWeekYear"),Ye("weekYear","gg"),Ye("isoWeekYear","GG"),be("weekYear",1),be("isoWeekYear",1),Ne("G",fe),Ne("g",fe),Ne("GG",$,Mt),Ne("gg",$,Mt),Ne("GGGG",jn,qi),Ne("gggg",jn,qi),Ne("GGGGG",Tr,sn),Ne("ggggg",Tr,sn),me(["gggg","ggggg","GGGG","GGGGG"],function(g,S,R,H){S[H.substr(0,2)]=Ge(g)}),me(["gg","GG"],function(g,S,R,H){S[H]=n.parseTwoDigitYear(g)}),De("Q",0,"Qo","quarter"),Ye("quarter","Q"),be("quarter",7),Ne("Q",te),W("Q",function(g,S){S[rt]=3*(Ge(g)-1)}),De("D",["DD",2],"Do","date"),Ye("date","D"),be("date",9),Ne("D",$),Ne("DD",$,Mt),Ne("Do",function(g,S){return g?S._dayOfMonthOrdinalParse||S._ordinalParse:S._dayOfMonthOrdinalParseLenient}),W(["D","DD"],ut),W("Do",function(g,S){S[ut]=Ge(g.match($)[0])}),jn=Et("Date",!0),De("DDD",["DDDD",3],"DDDo","dayOfYear"),Ye("dayOfYear","DDD"),be("dayOfYear",4),Ne("DDD",Pe),Ne("DDDD",_e),W(["DDD","DDDD"],function(g,S,R){R._dayOfYear=Ge(g)}),De("m",["mm",2],0,"minute"),Ye("minute","m"),be("minute",14),Ne("m",$),Ne("mm",$,Mt),W(["m","mm"],Ht);var At,qi=Et("Minutes",!1),Tr=(De("s",["ss",2],0,"second"),Ye("second","s"),be("second",15),Ne("s",$),Ne("ss",$,Mt),W(["s","ss"],Tt),Et("Seconds",!1));for(De("S",0,0,function(){return~~(this.millisecond()/100)}),De(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),De(0,["SSS",3],0,"millisecond"),De(0,["SSSS",4],0,function(){return 10*this.millisecond()}),De(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),De(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),De(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),De(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),De(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),Ye("millisecond","ms"),be("millisecond",16),Ne("S",Pe,te),Ne("SS",Pe,Mt),Ne("SSS",Pe,_e),At="SSSS";At.length<=9;At+="S")Ne(At,Me);function Ho(g,S){S[Ut]=Ge(1e3*("0."+g))}for(At="S";At.length<=9;At+="S")W(At,Ho);sn=Et("Milliseconds",!1),De("z",0,0,"zoneAbbr"),De("zz",0,0,"zoneName"),te=F.prototype;function Rl(g){return g}te.add=U,te.calendar=function(R,ee){arguments.length===1&&(arguments[0]?fa(arguments[0])?(R=arguments[0],ee=void 0):function(we){for(var He=o(we)&&!l(we),qe=!1,Ct=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ht=0;ht<Ct.length;ht+=1)qe=qe||s(we,Ct[ht]);return He&&qe}(arguments[0])&&(ee=arguments[0],R=void 0):ee=R=void 0);var R=R||lt(),H=$n(R,this).startOf("day"),H=n.calendarFormat(this,H)||"sameElse",ee=ee&&(ve(ee[H])?ee[H].call(this,R):ee[H]);return this.format(ee||this.localeData().calendar(H,this,lt(R)))},te.clone=function(){return new F(this)},te.diff=function(g,S,R){var H,ee,we;if(!this.isValid())return NaN;if(!(H=$n(g,this)).isValid())return NaN;switch(ee=6e4*(H.utcOffset()-this.utcOffset()),S=Be(S)){case"year":we=ts(this,H)/12;break;case"month":we=ts(this,H);break;case"quarter":we=ts(this,H)/3;break;case"second":we=(this-H)/1e3;break;case"minute":we=(this-H)/6e4;break;case"hour":we=(this-H)/36e5;break;case"day":we=(this-H-ee)/864e5;break;case"week":we=(this-H-ee)/6048e5;break;default:we=this-H}return R?we:nt(we)},te.endOf=function(g){var S,R;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(R=this._isUTC?Ts:So,g){case"year":S=R(this.year()+1,0,1)-1;break;case"quarter":S=R(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":S=R(this.year(),this.month()+1,1)-1;break;case"week":S=R(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":S=R(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":S=R(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=re(this,g),this.localeData().postformat(g)},te.from=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||lt(g).isValid())?Ai({to:this,from:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.fromNow=function(g){return this.from(lt(),g)},te.to=function(g,S){return this.isValid()&&(N(g)&&g.isValid()||lt(g).isValid())?Ai({from:this,to:g}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()},te.toNow=function(g){return this.to(lt(),g)},te.get=function(g){return ve(this[g=Be(g)])?this[g]():this},te.invalidAt=function(){return b(this).overflow},te.isAfter=function(g,S){return g=N(g)?g:lt(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:lt(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,R,H){return g=N(g)?g:lt(g),S=N(S)?S:lt(S),!!(this.isValid()&&g.isValid()&&S.isValid())&&((H=H||"()")[0]==="("?this.isAfter(g,R):!this.isBefore(g,R))&&(H[1]===")"?this.isBefore(S,R):!this.isAfter(S,R))},te.isSame=function(R,S){var R=N(R)?R:lt(R);return!(!this.isValid()||!R.isValid())&&((S=Be(S)||"millisecond")==="millisecond"?this.valueOf()===R.valueOf():(R=R.valueOf(),this.clone().startOf(S).valueOf()<=R&&R<=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=bt,te.locale=xs,te.localeData=Di,te.max=ne,te.min=X,te.parsingFlags=function(){return m({},b(this))},te.set=function(g,S){if(typeof g=="object")for(var R=function(we){var He,qe=[];for(He in we)s(we,He)&&qe.push({unit:He,priority:Ce[He]});return qe.sort(function(Ct,ht){return Ct.priority-ht.priority}),qe}(g=ue(g)),H=R.length,ee=0;ee<H;ee++)this[R[ee].unit](g[R[ee].unit]);else if(ve(this[g=Be(g)]))return this[g](S);return this},te.startOf=function(g){var S,R;if((g=Be(g))===void 0||g==="millisecond"||!this.isValid())return this;switch(R=this._isUTC?Ts:So,g){case"year":S=R(this.year(),0,1);break;case"quarter":S=R(this.year(),this.month()-this.month()%3,1);break;case"month":S=R(this.year(),this.month(),1);break;case"week":S=R(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":S=R(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":S=R(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=Ln,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()?re(S,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ve(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(S,"Z")):re(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",R="";return this.isLocal()||(S=this.utcOffset()===0?"moment.utc":"moment.parseZone",R="Z"),S="["+S+'("]',g=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(S+g+"-MM-DD[T]HH:mm:ss.SSS"+(R+'[")]'))},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(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].name;return""},te.eraNarrow=function(){for(var g,S=this.localeData().eras(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].narrow;return""},te.eraAbbr=function(){for(var g,S=this.localeData().eras(),R=0,H=S.length;R<H;++R)if(g=this.clone().startOf("day").valueOf(),S[R].since<=g&&g<=S[R].until||S[R].until<=g&&g<=S[R].since)return S[R].abbr;return""},te.eraYear=function(){for(var g,S,R=this.localeData().eras(),H=0,ee=R.length;H<ee;++H)if(g=R[H].since<=R[H].until?1:-1,S=this.clone().startOf("day").valueOf(),R[H].since<=S&&S<=R[H].until||R[H].until<=S&&S<=R[H].since)return(this.year()-n(R[H].since).year())*g+R[H].offset;return this.year()},te.year=xo,te.isLeapYear=function(){return Le(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=ct,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=jn,te.day=te.days=function(g){if(!this.isValid())return g!=null?this:NaN;var S,R,H=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(S=g,R=this.localeData(),g=typeof S!="string"?S:isNaN(S)?typeof(S=R.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,R=this.localeData(),R=typeof S=="string"?R.weekdaysParse(S)%7||7:isNaN(S)?null:S,this.day(this.day()%7?R:R-7)):this.day()||7:g!=null?this:NaN;var S,R},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=ze,te.minute=te.minutes=qi,te.second=te.seconds=Tr,te.millisecond=te.milliseconds=sn,te.utcOffset=function(g,S,R){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=Wn(ft,g))===null)return this}else Math.abs(g)<16&&!R&&(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=Wn(Ue,this._i))!=null?this.utcOffset(g):this.utcOffset(0,!0)),this},te.hasAlignedHourOffset=function(g){return!!this.isValid()&&(g=g?lt(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.",jn),te.months=Q("months accessor is deprecated. Use month instead",ct),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 A(S,this),(S=We(S))._a?(g=(S._isUTC?v:lt)(S._a),this._isDSTShifted=this.isValid()&&0<function(R,H,ee){for(var we=Math.min(R.length,H.length),He=Math.abs(R.length-H.length),qe=0,Ct=0;Ct<we;Ct++)(ee&&R[Ct]!==H[Ct]||!ee&&Ge(R[Ct])!==Ge(H[Ct]))&&qe++;return qe+He}(S._a,g.toArray())):this._isDSTShifted=!1,this._isDSTShifted}),Mt=z.prototype;function to(g,S,R,we){var ee=mr(),we=v().set(we,S);return ee[R](we,g)}function Yn(g,S,R){if(p(g)&&(S=g,g=void 0),g=g||"",S!=null)return to(g,S,R,"month");for(var H=[],ee=0;ee<12;ee++)H[ee]=to(g,ee,R,"month");return H}function tl(g,S,R,H){S=(typeof g=="boolean"?p(S)&&(R=S,S=void 0):(S=g,g=!1,p(R=S)&&(R=S,S=void 0)),S||"");var ee,we=mr(),He=g?we._week.dow:0,qe=[];if(R!=null)return to(S,(R+He)%7,H,"day");for(ee=0;ee<7;ee++)qe[ee]=to(S,(ee+He)%7,H,"day");return qe}Mt.calendar=function(g,S,R){return ve(g=this._calendar[g]||this._calendar.sameElse)?g.call(S,R):g},Mt.longDateFormat=function(g){var S=this._longDateFormat[g],R=this._longDateFormat[g.toUpperCase()];return S||!R?S:(this._longDateFormat[g]=R.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,R,H){var ee=this._relativeTime[R];return ve(ee)?ee(g,S,R,H):ee.replace(/%d/i,g)},Mt.pastFuture=function(g,S){return ve(g=this._relativeTime[0<g?"future":"past"])?g(S):g.replace(/%s/i,S)},Mt.set=function(g){var S,R;for(R in g)s(g,R)&&(ve(S=g[R])?this[R]=S:this["_"+R]=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 R,H=this._eras||mr("en")._eras,ee=0,we=H.length;ee<we;++ee){switch(typeof H[ee].since){case"string":R=n(H[ee].since).startOf("day"),H[ee].since=R.valueOf();break}switch(typeof H[ee].until){case"undefined":H[ee].until=1/0;break;case"string":R=n(H[ee].until).startOf("day").valueOf(),H[ee].until=R.valueOf();break}}return H},Mt.erasParse=function(g,S,R){var H,ee,we,He,qe,Ct=this.eras();for(g=g.toUpperCase(),H=0,ee=Ct.length;H<ee;++H)if(we=Ct[H].name.toUpperCase(),He=Ct[H].abbr.toUpperCase(),qe=Ct[H].narrow.toUpperCase(),R)switch(S){case"N":case"NN":case"NNN":if(He===g)return Ct[H];break;case"NNNN":if(we===g)return Ct[H];break;case"NNNNN":if(qe===g)return Ct[H];break}else if(0<=[we,He,qe].indexOf(g))return Ct[H]},Mt.erasConvertYear=function(g,S){var R=g.since<=g.until?1:-1;return S===void 0?n(g.since).year():n(g.since).year()+(S-g.offset)*R},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,R){var H,ee;if(this._monthsParseExact)return(function(Nt,He,qe){var Ct,ht,zt,Nt=Nt.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],Ct=0;Ct<12;++Ct)zt=v([2e3,Ct]),this._shortMonthsParse[Ct]=this.monthsShort(zt,"").toLocaleLowerCase(),this._longMonthsParse[Ct]=this.months(zt,"").toLocaleLowerCase();return qe?He==="MMM"?(ht=ke.call(this._shortMonthsParse,Nt))!==-1?ht:null:(ht=ke.call(this._longMonthsParse,Nt))!==-1?ht:null:He==="MMM"?(ht=ke.call(this._shortMonthsParse,Nt))!==-1||(ht=ke.call(this._longMonthsParse,Nt))!==-1?ht:null:(ht=ke.call(this._longMonthsParse,Nt))!==-1||(ht=ke.call(this._shortMonthsParse,Nt))!==-1?ht:null}).call(this,g,S,R);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),H=0;H<12;H++)if(ee=v([2e3,H]),R&&!this._longMonthsParse[H]&&(this._longMonthsParse[H]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[H]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),R||this._monthsParse[H]||(ee="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[H]=new RegExp(ee.replace(".",""),"i")),R&&S==="MMMM"&&this._longMonthsParse[H].test(g)||R&&S==="MMM"&&this._shortMonthsParse[H].test(g)||!R&&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=ot),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=Se),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,R){var H,ee;if(this._weekdaysParseExact)return(function(Nt,He,qe){var Ct,ht,zt,Nt=Nt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],Ct=0;Ct<7;++Ct)zt=v([2e3,1]).day(Ct),this._minWeekdaysParse[Ct]=this.weekdaysMin(zt,"").toLocaleLowerCase(),this._shortWeekdaysParse[Ct]=this.weekdaysShort(zt,"").toLocaleLowerCase(),this._weekdaysParse[Ct]=this.weekdays(zt,"").toLocaleLowerCase();return qe?He==="dddd"?(ht=ke.call(this._weekdaysParse,Nt))!==-1?ht:null:He==="ddd"?(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1?ht:null:(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:He==="dddd"?(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:He==="ddd"?(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1||(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._minWeekdaysParse,Nt))!==-1?ht:null:(ht=ke.call(this._minWeekdaysParse,Nt))!==-1||(ht=ke.call(this._weekdaysParse,Nt))!==-1||(ht=ke.call(this._shortWeekdaysParse,Nt))!==-1?ht:null}).call(this,g,S,R);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),H=0;H<7;H++)if(ee=v([2e3,1]).day(H),R&&!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")),R&&S==="dddd"&&this._fullWeekdaysParse[H].test(g)||R&&S==="ddd"&&this._shortWeekdaysParse[H].test(g)||R&&S==="dd"&&this._minWeekdaysParse[H].test(g)||!R&&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=ye),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=Xe),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=pt),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Mt.isPM=function(g){return(g+"").toLowerCase().charAt(0)==="p"},Mt.meridiem=function(g,S,R){return 11<g?R?"pm":"PM":R?"am":"AM"},Jn("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+(Ge(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.",Jn),n.langData=Q("moment.langData is deprecated. Use moment.localeData instead.",mr);var Or=Math.abs;function Fl(g,S,R,H){return S=Ai(S,R),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 on(g){return function(){return this.as(g)}}Pe=on("ms"),_e=on("s"),U=on("m"),ne=on("h"),X=on("d"),Ln=on("w"),ze=on("M"),qi=on("Q"),Tr=on("y");function wo(g){return function(){return this.isValid()?this._data[g]:NaN}}var sn=wo("milliseconds"),jn=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 fd(g,S,R,H){var ht=Ai(g).abs(),zt=Bn(ht.as("s")),ee=Bn(ht.as("m")),we=Bn(ht.as("h")),He=Bn(ht.as("d")),qe=Bn(ht.as("M")),Ct=Bn(ht.as("w")),ht=Bn(ht.as("y")),zt=(zt<=R.ss?["s",zt]:zt<R.s&&["ss",zt])||ee<=1&&["m"]||ee<R.m&&["mm",ee]||we<=1&&["h"]||we<R.h&&["hh",we]||He<=1&&["d"]||He<R.d&&["dd",He];return(zt=(zt=R.w!=null?zt||Ct<=1&&["w"]||Ct<R.w&&["ww",Ct]:zt)||qe<=1&&["M"]||qe<R.M&&["MM",qe]||ht<=1&&["y"]||["yy",ht])[2]=S,zt[3]=0<+g,zt[4]=H,(function(Nt,Ki,an,Zi,rs){return rs.relativeTime(Ki||1,!!an,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,R,H,ee,we,He,qe=ks(this._milliseconds)/1e3,Ct=ks(this._days),ht=ks(this._months),zt=this.asSeconds();return zt?(g=nt(qe/60),S=nt(g/60),qe%=60,g%=60,R=nt(ht/12),ht%=12,H=qe?qe.toFixed(3).replace(/\.?0+$/,""):"",ee=ns(this._months)!==ns(zt)?"-":"",we=ns(this._days)!==ns(zt)?"-":"",He=ns(this._milliseconds)!==ns(zt)?"-":"",(zt<0?"-":"")+"P"+(R?ee+R+"Y":"")+(ht?ee+ht+"M":"")+(Ct?we+Ct+"D":"")+(S||g||qe?"T":"")+(S?He+S+"H":"")+(g?He+g+"M":"")+(qe?He+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,R,H=this._milliseconds;if((g=Be(g))==="month"||g==="quarter"||g==="year")switch(S=this._days+H/864e5,R=this._months+Pl(S),g){case"month":return R;case"quarter":return R/3;case"year":return R/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=Pe,mi.asSeconds=_e,mi.asMinutes=U,mi.asHours=ne,mi.asDays=X,mi.asWeeks=Ln,mi.asMonths=ze,mi.asQuarters=qi,mi.asYears=Tr,mi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Ge(this._months/12):NaN},mi._bubble=function(){var g=this._milliseconds,S=this._days,R=this._months,H=this._data;return 0<=g&&0<=S&&0<=R||g<=0&&S<=0&&R<=0||(g+=864e5*il(As(R)+S),R=S=0),H.milliseconds=g%1e3,g=nt(g/1e3),H.seconds=g%60,g=nt(g/60),H.minutes=g%60,g=nt(g/60),H.hours=g%24,S+=nt(g/24),R+=g=nt(Pl(S)),S-=il(As(g)),g=nt(R/12),R%=12,H.days=S,H.months=R,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=sn,mi.seconds=jn,mi.minutes=xo,mi.hours=Mt,mi.days=nl,mi.weeks=function(){return nt(this.days()/7)},mi.months=rl,mi.years=Wi,mi.humanize=function(g,S){if(!this.isValid())return this.localeData().invalidDate();var R=!1,H=To;return typeof g=="object"&&(S=g,g=!1),typeof g=="boolean"&&(R=g),typeof S=="object"&&(H=Object.assign({},To,S),S.s!=null&&S.ss==null&&(H.ss=S.s-1)),g=this.localeData(),S=fd(this,!R,H,g),R&&(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=bt,De("X",0,0,"unix"),De("x",0,0,"valueOf"),Ne("x",fe),Ne("X",/[+-]?\d+(\.\d{1,3})?/),W("X",function(g,S,R){R._d=new Date(1e3*parseFloat(g))}),W("x",function(g,S,R){R._d=new Date(Ge(g))}),n.version="2.29.4",e=lt,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 lt(1e3*g)},n.months=function(g,S){return Yn(g,S,"months")},n.isDate=c,n.locale=Jn,n.invalid=x,n.duration=Ai,n.isMoment=N,n.weekdays=function(g,S,R){return tl(g,S,R,"weekdays")},n.parseZone=function(){return lt.apply(null,arguments).parseZone()},n.localeData=mr,n.isDuration=Si,n.monthsShort=function(g,S){return Yn(g,S,"monthsShort")},n.weekdaysMin=function(g,S,R){return tl(g,S,R,"weekdaysMin")},n.defineLocale=_o,n.updateLocale=function(g,S){var R,H;return S!=null?(H=lr,Ei[g]!=null&&Ei[g].parentLocale!=null?Ei[g].set(J(Ei[g]._config,S)):(S=J(H=(R=Qn(g))!=null?R._config:H,S),R==null&&(S.abbr=g),(H=new z(S)).parentLocale=Ei[g],Ei[g]=H),Jn(g)):Ei[g]!=null&&(Ei[g].parentLocale!=null?(Ei[g]=Ei[g].parentLocale,g===Jn()&&Jn(g)):Ei[g]!=null&&delete Ei[g]),Ei[g]},n.locales=function(){return P(Ei)},n.weekdaysShort=function(g,S,R){return tl(g,S,R,"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})})(Ep);var Sp=Ep.exports;const Ys=Qc(Sp),ms=Cl({__proto__:null,default:Ys},[Sp]);class je{}je.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"},je.treeDataProperties={CHILDREN_PROP:"children",COLLAPSED_PROP:"__collapsed",HAS_CHILDREN_PROP:"__hasChildren",TREE_LEVEL_PROP:"__treeLevel",PARENT_PROP:"__parentId"},je.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL=2,je.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL=2,je.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL=2,je.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL=4,je.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL=void 0,je.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL=void 0,je.DEFAULT_NUMBER_DECIMAL_SEPARATOR=".",je.DEFAULT_NUMBER_THOUSAND_SEPARATOR="",je.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET=!1,je.SLIDER_DEFAULT_MIN_VALUE=0,je.SLIDER_DEFAULT_MAX_VALUE=100,je.SLIDER_DEFAULT_STEP=1,je.VALIDATION_REQUIRED_FIELD="Field is required",je.VALIDATION_EDITOR_VALID_NUMBER="Please enter a valid number",je.VALIDATION_EDITOR_VALID_INTEGER="Please enter a valid integer number",je.VALIDATION_EDITOR_INTEGER_BETWEEN="Please enter a valid integer number between {{minValue}} and {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MAX="Please enter a valid integer number that is lower than {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE="Please enter a valid integer number that is lower than or equal to {{maxValue}}",je.VALIDATION_EDITOR_INTEGER_MIN="Please enter a valid integer number that is greater than {{minValue}}",je.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE="Please enter a valid integer number that is greater than or equal to {{minValue}}",je.VALIDATION_EDITOR_NUMBER_BETWEEN="Please enter a valid number between {{minValue}} and {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MAX="Please enter a valid number that is lower than {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE="Please enter a valid number that is lower than or equal to {{maxValue}}",je.VALIDATION_EDITOR_NUMBER_MIN="Please enter a valid number that is greater than {{minValue}}",je.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE="Please enter a valid number that is greater than or equal to {{minValue}}",je.VALIDATION_EDITOR_DECIMAL_BETWEEN="Please enter a valid number with a maximum of {{maxDecimal}} decimals",je.VALIDATION_EDITOR_TEXT_LENGTH_BETWEEN="Please make sure your text length is between {{minLength}} and {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MAX_LENGTH="Please make sure your text is less than {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE="Please make sure your text is less than or equal to {{maxLength}} characters",je.VALIDATION_EDITOR_TEXT_MIN_LENGTH="Please make sure your text is more than {{minLength}} character(s)",je.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE="Please make sure your text is at least {{minLength}} character(s)";var Jc;(function(a){a[a.camelCase=0]="camelCase",a[a.pascalCase=1]="pascalCase",a[a.snakeCase=2]="snakeCase",a[a.kebabCase=3]="kebabCase"})(Jc||(Jc={}));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 un;(function(a){a.csv="csv",a.txt="txt",a.xls="xls",a.xlsx="xlsx"})(un||(un={}));var Zl;(function(a){a.merge="merge",a.chain="chain"})(Zl||(Zl={}));var Ud;(function(a){a.none="NOA",a.legacyOff="LOF",a.legacyForceFit="LFF",a.ignoreViewport="IGV",a.fitColsToViewport="FCV",a.fitViewportToCols="FVC"})(Ud||(Ud={}));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 eh=Object.freeze(Object.defineProperty({__proto__:null,get CaseType(){return Jc},get DelimiterType(){return vs},get EmitterType(){return Ji},get ExtensionName(){return ni},FieldType:ie,get FileType(){return un},get FilterMultiplePassType(){return Zl},get GridAutosizeColsMode(){return Ud},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"})),Xg=Ys||ms;class Ha extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Ha.prototype)}}function wp(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 xp(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 Gd(a,t,e=0){var n;const r=(n=t==null?void 0:t.childrenPropName)!==null&&n!==void 0?n:je.treeDataProperties.CHILDREN_PROP;if(Array.isArray(a))for(const o of a)o&&(Array.isArray(o[r])&&o[r].length>0&&(e++,Gd(o[r],t,e),e--),o[t.levelPropName]=e)}function Va(a,t,e=0,n=null){var r;const o=(r=t==null?void 0:t.childrenPropName)!==null&&r!==void 0?r:je.treeDataProperties.CHILDREN_PROP,{aggregator:s}=t;if(Array.isArray(a)){for(const l of a)if(l){const u=Array.isArray(l[o]);Array.isArray(l[o])&&l[o].length>0&&(s.init(l,!0),e++,Va(l[o],t,e,l),e--),n&&s.isInitialized&&typeof s.accumulate=="function"&&!(l!=null&&l.__filteredOut)&&(s.accumulate(l,u),s.storeResult(n.__treeTotals)),l[t.levelPropName]=e}}}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:je.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.hasChildrenPropName)!==null&&r!==void 0?r:je.treeDataProperties.HAS_CHILDREN_PROP,c=(o=t==null?void 0:t.parentPropName)!==null&&o!==void 0?o:je.treeDataProperties.PARENT_PROP,f=(s=t==null?void 0:t.levelPropName)!==null&&s!==void 0?s:je.treeDataProperties.TREE_LEVEL_PROP;return t!=null&&t.shouldAddTreeLevelNumber&&(t!=null&&t.aggregators?t.aggregators.forEach(v=>{Va(a,{childrenPropName:u,levelPropName:f,aggregator:v})}):Gd(a,{childrenPropName:u,levelPropName:f})),jg(a,v=>v[u],(v,b)=>({[l]:v[l],[c]:b!==void 0?b[l]:null,[p]:!!v[u],...Ap(v,u)}))}function Op(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:je.treeDataProperties.CHILDREN_PROP,p=(r=t==null?void 0:t.parentPropName)!==null&&r!==void 0?r:je.treeDataProperties.PARENT_PROP,c=(o=t==null?void 0:t.levelPropName)!==null&&o!==void 0?o:je.treeDataProperties.TREE_LEVEL_PROP,f=(s=t==null?void 0:t.collapsedPropName)!==null&&s!==void 0?s:je.treeDataProperties.COLLAPSED_PROP,m=a||[],v=[],b={};return m.forEach(C=>b[C[l]]=C),Object.keys(b).forEach(C=>{var x;const w=b[C];if(!(p in w)||w[p]===null||w[p]===void 0||w[p]==="")v.push(w);else if(w[p]in b){const E=b[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)}}),t!=null&&t.aggregators?t.aggregators.forEach(C=>{Va(v,{childrenPropName:u,levelPropName:c,aggregator:C},0)}):Gd(v,{childrenPropName:u,levelPropName:c},0),v}function Ba(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])}),Ba(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 wn(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 za(a,t,e){if(typeof a.queryFieldNameGetterFn=="function"){const n=a.queryFieldNameGetterFn(t);(n==null?void 0:n.indexOf("."))>=0?e=bn(t,n):e=t.hasOwnProperty(n)?t[n]:e}return e}function bn(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 Ua(a){return a.outputType||a.type||ie.string}function th(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 Ga(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 qg(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 ih(a){let t;if(th(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 Ap(a,t){return Object.keys(a).reduce((e,n)=>(n!==t&&(e[n]=a[n]),e),{})}function Kg(a,t){let e="";if(typeof a=="string"&&/^[0-9\-\/]*$/.test(a)){const n=decodeURIComponent(a),r=Xg(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 Wd(a){if(Array.isArray(a))for(;a.length>0;){const t=a.pop();t!=null&&t.unsubscribe&&t.unsubscribe()}return a}const Zg=Object.freeze(Object.defineProperty({__proto__:null,CancelledException:Ha,addTreeLevelAndAggregatorsByMutation:Va,addTreeLevelByMutation:Gd,cancellablePromise:wp,castObservableToPromise:xp,decimalFormatted:js,findItemInTreeStructure:Ba,findOrDefault:bs,flattenToParentChildArray:Tp,formatNumber:wn,getCellValueFromQueryFieldGetter:za,getColumnFieldType:Ua,getDescendantProperty:bn,getTranslationPrefix:ao,isColumnDateType:th,mapFlatpickrDateFormatWithFieldType:Ga,mapMomentDateFormatWithFieldType:Fr,mapOperatorByFieldType:ih,mapOperatorToShorthandDesignation:Ql,mapOperatorType:qg,objectWithoutKey:Ap,parseUtcDate:Kg,thousandSeparatorFormatted:_s,unflattenParentChildArrayToTree:Op,unsubscribeAll:Wd},Symbol.toStringTag,{value:"Module"})),Qg=(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},Jg=(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 e_(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 Wa(a,t=" "){let e="";for(let n=0;n<a;n++)e+=t;return e}function nh(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 rh(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&&rh(a[n],e[n]),(a[n]===null||a[n]===void 0)&&e[n]!==null&&e[n]!==void 0&&(a[n]=e[n]);return rh(a,...t)}function kp(a){for(const t in a)a.hasOwnProperty(t)&&delete a[t];return a=null,a={},a}function oh(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 $d(a){return a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"}function Yd(a){return a!=null&&a!==""}function en(a,t=!1){return t?a==null||typeof a=="string"?!1:!isNaN(a):a==null||a===""?!1:!isNaN(+a)}function Ip(a){return!a||a&&typeof a=="object"&&Object.keys(a).length===0}function jd(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]=Yd(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 sh(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 $a(a){return typeof a=="string"?sh(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 t_(a){return typeof a=="string"?sh(a).replace(/([A-Z])/g,"_$1").toLowerCase():a}function Dp(a){return Array.isArray(a)&&a.length>0?a.filter((t,e)=>a.indexOf(t)>=e):a}function i_(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 n_=Object.freeze(Object.defineProperty({__proto__:null,addToArrayWhenNotExists:e_,addWhiteSpaces:Wa,arrayRemoveItemByIndex:nh,deepCopy:uo,deepMerge:yl,emptyObject:kp,hasData:Yd,isEmptyObject:oh,isNumber:en,isObject:Ko,isObjectEmpty:Ip,isPrimitiveValue:$d,objectAssignAndExtend:rh,parseBoolean:jd,removeAccentFromText:Jl,setDeepValue:cr,titleCase:El,toCamelCase:sh,toKebabCase:$a,toSentenceCase:jr,toSnakeCase:t_,uniqueArray:Dp,uniqueObjectArray:i_},Symbol.toStringTag,{value:"Module"})),r_=(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},Rp=(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)},Xd=Ys||ms;function Fp(a,t,e,n,r){let o=0;if(a===t)o=0;else{let s=Xd(a,n,r),l=Xd(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?Xd.ISO_8601:Fr(a);return(e,n,r)=>t===Xd.ISO_8601?Fp(e,n,r,t,!1):Fp(e,n,r,t,!0)}const Sl={boolean:Qg,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:Rp,objectString:Jg,string:r_};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 o_=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 Pp{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}-${$a(t)}`:$a(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 Mp={exports:{}};(function(a,t){(function(e,n){a.exports=n()})(Rr,function(){function e(n){var r=document,o=n.container||r.createElement("div"),s=n.preventSubmit||0;o.id=o.id||"autocomplete-"+F();var l=o.style,u=n.debounceWaitMs||0,p=n.disableAutoSelect||!1,c=o.parentElement,f=[],m="",v=2,b=n.showOnFocus,C,x=0,w,E=!1,D=!1;if(n.minLength!==void 0&&(v=n.minLength),!n.input)throw new Error("input undefined");var A=n.input;o.className="autocomplete "+(n.className||""),o.setAttribute("role","listbox"),A.setAttribute("role","combobox"),A.setAttribute("aria-expanded","false"),A.setAttribute("aria-autocomplete","list"),A.setAttribute("aria-controls",o.id),A.setAttribute("aria-owns",o.id),A.setAttribute("aria-activedescendant",""),A.setAttribute("aria-haspopup","listbox"),l.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function N(){var k=o.parentNode;k&&k.removeChild(o)}function V(){w&&window.clearTimeout(w)}function Q(){o.parentNode||(c||r.body).appendChild(o)}function L(){return!!o.parentNode}function le(){x++,f=[],m="",C=void 0,A.setAttribute("aria-activedescendant",""),A.setAttribute("aria-expanded","false"),N()}function ve(){if(!L())return;A.setAttribute("aria-expanded","true"),l.height="auto",l.width=A.offsetWidth+"px";var k=0,te;function _e(){var $=r.documentElement,X=$.clientTop||r.body.clientTop||0,ne=$.clientLeft||r.body.clientLeft||0,Pe=window.pageYOffset||$.scrollTop,Me=window.pageXOffset||$.scrollLeft;te=A.getBoundingClientRect();var fe=te.top+A.offsetHeight+Pe-X,Ue=te.left+Me-ne;l.top=fe+"px",l.left=Ue+"px",k=window.innerHeight-(te.top+A.offsetHeight),k<0&&(k=0),l.top=fe+"px",l.bottom="",l.left=Ue+"px",l.maxHeight=k+"px"}_e(),_e(),n.customize&&te&&n.customize(A,te,o,k)}function J(){o.innerHTML="",A.setAttribute("aria-activedescendant","");var k=function(ne,Pe,Me){var fe=r.createElement("div");return fe.textContent=ne.label||"",fe};n.render&&(k=n.render);var te=function(ne,Pe){var Me=r.createElement("div");return Me.textContent=ne,Me};n.renderGroup&&(te=n.renderGroup);var _e=r.createDocumentFragment(),$=F();if(f.forEach(function(ne,Pe){if(ne.group&&ne.group!==$){$=ne.group;var Me=te(ne.group,m);Me&&(Me.className+=" group",_e.appendChild(Me))}var fe=k(ne,m,Pe);fe&&(fe.id=o.id+"_"+Pe,fe.setAttribute("role","option"),fe.addEventListener("click",function(Ue){D=!0;try{n.onSelect(ne,A)}finally{D=!1}le(),Ue.preventDefault(),Ue.stopPropagation()}),ne===C&&(fe.className+=" selected",fe.setAttribute("aria-selected","true"),A.setAttribute("aria-activedescendant",fe.id)),_e.appendChild(fe))}),o.appendChild(_e),f.length<1)if(n.emptyMsg){var X=r.createElement("div");X.id=o.id+"_"+F(),X.className="empty",X.textContent=n.emptyMsg,o.appendChild(X),A.setAttribute("aria-activedescendant",X.id)}else{le();return}Q(),ve(),Re()}function z(){L()&&J()}function P(){z()}function ae(k){k.target!==o?z():k.preventDefault()}function Ke(){D||Ce(0)}function Re(){var k=o.getElementsByClassName("selected");if(k.length>0){var te=k[0],_e=te.previousElementSibling;if(_e&&_e.className.indexOf("group")!==-1&&!_e.previousElementSibling&&(te=_e),te.offsetTop<o.scrollTop)o.scrollTop=te.offsetTop;else{var $=te.offsetTop+te.offsetHeight,X=o.scrollTop+o.offsetHeight;$>X&&(o.scrollTop+=$-X)}}}function xe(){var k=f.indexOf(C);C=k===-1?void 0:f[(k+f.length-1)%f.length],De(k)}function Oe(){var k=f.indexOf(C);C=f.length<1?void 0:k===-1?f[0]:f[(k+1)%f.length],De(k)}function De(k){f.length>0&&(pe(k),re(f.indexOf(C)),Re())}function re(k){var te=r.getElementById(o.id+"_"+k);te&&(te.classList.add("selected"),te.setAttribute("aria-selected","true"),A.setAttribute("aria-activedescendant",te.id))}function pe(k){var te=r.getElementById(o.id+"_"+k);te&&(te.classList.remove("selected"),te.removeAttribute("aria-selected"),A.removeAttribute("aria-activedescendant"))}function Ve(k,te){var _e=L();if(te==="Escape")le();else{if(!_e||f.length<1)return;te==="ArrowUp"?xe():Oe()}k.preventDefault(),_e&&k.stopPropagation()}function Ye(k){if(C){s===2&&k.preventDefault(),D=!0;try{n.onSelect(C,A)}finally{D=!1}le()}s===1&&k.preventDefault()}function Be(k){var te=k.key;switch(te){case"ArrowUp":case"ArrowDown":case"Escape":Ve(k,te);break;case"Enter":Ye(k);break}}function ue(){b&&Ce(1)}function Ce(k){A.value.length>=v||k===1?(V(),w=window.setTimeout(function(){return be(A.value,k,A.selectionStart||0)},k===0||k===2?u:0)):le()}function be(k,te,_e){if(!E){var $=++x;n.fetch(k,function(X){x===$&&X&&(f=X,m=k,C=f.length<1||p?void 0:f[0],J())},te,_e)}}function Le(k){if(n.keyup){n.keyup({event:k,fetch:function(){return Ce(0)}});return}!L()&&k.key==="ArrowDown"&&Ce(0)}function nt(k){n.click&&n.click({event:k,fetch:function(){return Ce(2)}})}function Ge(){setTimeout(function(){r.activeElement!==A&&le()},200)}function Et(){be(A.value,3,A.selectionStart||0)}o.addEventListener("mousedown",function(k){k.stopPropagation(),k.preventDefault()}),o.addEventListener("focus",function(){return A.focus()}),N();function at(){A.removeEventListener("focus",ue),A.removeEventListener("keyup",Le),A.removeEventListener("click",nt),A.removeEventListener("keydown",Be),A.removeEventListener("input",Ke),A.removeEventListener("blur",Ge),window.removeEventListener("resize",P),r.removeEventListener("scroll",ae,!0),A.removeAttribute("role"),A.removeAttribute("aria-expanded"),A.removeAttribute("aria-autocomplete"),A.removeAttribute("aria-controls"),A.removeAttribute("aria-activedescendant"),A.removeAttribute("aria-owns"),A.removeAttribute("aria-haspopup"),V(),le(),E=!0}return A.addEventListener("keyup",Le),A.addEventListener("click",nt),A.addEventListener("keydown",Be),A.addEventListener("input",Ke),A.addEventListener("blur",Ge),A.addEventListener("focus",ue),window.addEventListener("resize",P),r.addEventListener("scroll",ae,!0),{destroy:at,fetch:Et}}return e})})(Mp);var Np=Mp.exports;const lh=Qc(Np),qd=Cl({__proto__:null,default:lh},[Np]);function Lp(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 Pn{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 Hp{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=Dp([...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,b,C;for(let x=0,w=n.length;x<w;x++){const E=n[x];if(E!=null&&E.property){const D=E.sortDesc?Yi.desc:Yi.asc,A=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?((b=this.translaterService)===null||b===void 0?void 0:b.translate)&&this.translaterService.translate(c[A]||" "):c[A],V=r?((C=this.translaterService)===null||C===void 0?void 0:C.translate)&&this.translaterService.translate(f[A]||" "):f[A],Q=ea(F,N,V,D,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,b)=>{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(b[c]||" "):b[c],D=ea(m,w,E,f,t);return D!==Yi.neutral?D: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 b,C;const x=r?((b=this.translaterService)===null||b===void 0?void 0:b.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:Vp,setPrototypeOf:Bp,isFrozen:s_,getPrototypeOf:l_,getOwnPropertyDescriptor:a_}=Object;let{freeze:Er,seal:Ro,create:d_}=Object,{apply:ah,construct:dh}=typeof Reflect<"u"&&Reflect;ah||(ah=function(t,e,n){return t.apply(e,n)}),Er||(Er=function(t){return t}),Ro||(Ro=function(t){return t}),dh||(dh=function(t,e){return new t(...e)});const u_=co(Array.prototype.forEach),zp=co(Array.prototype.pop),Ya=co(Array.prototype.push),Kd=co(String.prototype.toLowerCase),uh=co(String.prototype.toString),c_=co(String.prototype.match),Fo=co(String.prototype.replace),h_=co(String.prototype.indexOf),f_=co(String.prototype.trim),Xr=co(RegExp.prototype.test),ja=p_(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 ah(a,t,n)}}function p_(a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return dh(a,e)}}function ui(a,t,e){var n;e=(n=e)!==null&&n!==void 0?n:Kd,Bp&&Bp(a,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=e(o);s!==o&&(s_(t)||(t[r]=s),o=s)}a[o]=!0}return a}function ta(a){const t=d_(null);for(const[e,n]of Vp(a))t[e]=n;return t}function Zd(a,t){for(;a!==null;){const n=a_(a,t);if(n){if(n.get)return co(n.get);if(typeof n.value=="function")return co(n.value)}a=l_(a)}function e(n){return console.warn("fallback value for",n),null}return e}const Up=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"]),ch=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"]),hh=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"]),m_=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"]),fh=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"]),v_=Er(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gp=Er(["#text"]),Wp=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"]),ph=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"]),$p=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"]),Qd=Er(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g_=Ro(/\{\{[\w\W]*|[\w\W]*\}\}/gm),__=Ro(/<%[\w\W]*|[\w\W]*%>/gm),b_=Ro(/\${[\w\W]*}/gm),C_=Ro(/^data-[\-\w.\u00B7-\uFFFF]/),y_=Ro(/^aria-[\-\w]+$/),Yp=Ro(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E_=Ro(/^(?:\w+script|data):/i),S_=Ro(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jp=Ro(/^html$/i);var Xp=Object.freeze({__proto__:null,MUSTACHE_EXPR:g_,ERB_EXPR:__,TMPLIT_EXPR:b_,DATA_ATTR:C_,ARIA_ATTR:y_,IS_ALLOWED_URI:Yp,IS_SCRIPT_OR_DATA:E_,ATTR_WHITESPACE:S_,DOCTYPE_NAME:jp});const w_=()=>typeof window>"u"?null:window,x_=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 qp(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w_();const t=bt=>qp(bt);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,b=u.prototype,C=Zd(b,"cloneNode"),x=Zd(b,"nextSibling"),w=Zd(b,"childNodes"),E=Zd(b,"parentNode");if(typeof s=="function"){const bt=r.createElement("template");bt.content&&bt.content.ownerDocument&&(r=bt.content.ownerDocument)}let D,A="";const{implementation:F,createNodeIterator:N,createDocumentFragment:V,getElementsByTagName:Q}=r,{importNode:L}=e;let le={};t.isSupported=typeof Vp=="function"&&typeof E=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ve,ERB_EXPR:J,TMPLIT_EXPR:z,DATA_ATTR:P,ARIA_ATTR:ae,IS_SCRIPT_OR_DATA:Ke,ATTR_WHITESPACE:Re}=Xp;let{IS_ALLOWED_URI:xe}=Xp,Oe=null;const De=ui({},[...Up,...ch,...hh,...fh,...Gp]);let re=null;const pe=ui({},[...Wp,...ph,...$p,...Qd]);let Ve=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}})),Ye=null,Be=null,ue=!0,Ce=!0,be=!1,Le=!0,nt=!1,Ge=!1,Et=!1,at=!1,k=!1,te=!1,_e=!1,$=!0,X=!1;const ne="user-content-";let Pe=!0,Me=!1,fe={},Ue=null;const ft=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 ze=null;const Ne=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 me=W,ke=!1,st=null;const rt=ui({},[yi,q,W],uh);let ut;const Rt=["application/xhtml+xml","text/html"],Ht="text/html";let Tt,Ut=null;const Kt=r.createElement("form"),Ni=function(ye){return ye instanceof RegExp||ye instanceof Function},Li=function(ye){if(!(Ut&&Ut===ye)){if((!ye||typeof ye!="object")&&(ye={}),ye=ta(ye),ut=Rt.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ut=Ht:ut=ye.PARSER_MEDIA_TYPE,Tt=ut==="application/xhtml+xml"?uh:Kd,Oe="ALLOWED_TAGS"in ye?ui({},ye.ALLOWED_TAGS,Tt):De,re="ALLOWED_ATTR"in ye?ui({},ye.ALLOWED_ATTR,Tt):pe,st="ALLOWED_NAMESPACES"in ye?ui({},ye.ALLOWED_NAMESPACES,uh):rt,Xt="ADD_URI_SAFE_ATTR"in ye?ui(ta(It),ye.ADD_URI_SAFE_ATTR,Tt):It,ze="ADD_DATA_URI_TAGS"in ye?ui(ta(Ne),ye.ADD_DATA_URI_TAGS,Tt):Ne,Ue="FORBID_CONTENTS"in ye?ui({},ye.FORBID_CONTENTS,Tt):ft,Ye="FORBID_TAGS"in ye?ui({},ye.FORBID_TAGS,Tt):{},Be="FORBID_ATTR"in ye?ui({},ye.FORBID_ATTR,Tt):{},fe="USE_PROFILES"in ye?ye.USE_PROFILES:!1,ue=ye.ALLOW_ARIA_ATTR!==!1,Ce=ye.ALLOW_DATA_ATTR!==!1,be=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=ye.SAFE_FOR_TEMPLATES||!1,Ge=ye.WHOLE_DOCUMENT||!1,k=ye.RETURN_DOM||!1,te=ye.RETURN_DOM_FRAGMENT||!1,_e=ye.RETURN_TRUSTED_TYPE||!1,at=ye.FORCE_BODY||!1,$=ye.SANITIZE_DOM!==!1,X=ye.SANITIZE_NAMED_PROPS||!1,Pe=ye.KEEP_CONTENT!==!1,Me=ye.IN_PLACE||!1,xe=ye.ALLOWED_URI_REGEXP||Yp,me=ye.NAMESPACE||W,Ve=ye.CUSTOM_ELEMENT_HANDLING||{},ye.CUSTOM_ELEMENT_HANDLING&&Ni(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ve.tagNameCheck=ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&Ni(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ve.attributeNameCheck=ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ve.allowCustomizedBuiltInElements=ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(Ce=!1),te&&(k=!0),fe&&(Oe=ui({},[...Gp]),re=[],fe.html===!0&&(ui(Oe,Up),ui(re,Wp)),fe.svg===!0&&(ui(Oe,ch),ui(re,ph),ui(re,Qd)),fe.svgFilters===!0&&(ui(Oe,hh),ui(re,ph),ui(re,Qd)),fe.mathMl===!0&&(ui(Oe,fh),ui(re,$p),ui(re,Qd))),ye.ADD_TAGS&&(Oe===De&&(Oe=ta(Oe)),ui(Oe,ye.ADD_TAGS,Tt)),ye.ADD_ATTR&&(re===pe&&(re=ta(re)),ui(re,ye.ADD_ATTR,Tt)),ye.ADD_URI_SAFE_ATTR&&ui(Xt,ye.ADD_URI_SAFE_ATTR,Tt),ye.FORBID_CONTENTS&&(Ue===ft&&(Ue=ta(Ue)),ui(Ue,ye.FORBID_CONTENTS,Tt)),Pe&&(Oe["#text"]=!0),Ge&&ui(Oe,["html","head","body"]),Oe.table&&(ui(Oe,["tbody"]),delete Ye.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=ye.TRUSTED_TYPES_POLICY,A=D.createHTML("")}else D===void 0&&(D=x_(v,n)),D!==null&&typeof A=="string"&&(A=D.createHTML(""));Er&&Er(ye),Ut=ye}},U=ui({},["mi","mo","mn","ms","mtext"]),Z=ui({},["foreignobject","desc","title","annotation-xml"]),ce=ui({},["title","style","font","a","script"]),Se=ui({},ch);ui(Se,hh),ui(Se,m_);const ot=ui({},fh);ui(ot,v_);const mt=function(ye){let Xe=E(ye);(!Xe||!Xe.tagName)&&(Xe={namespaceURI:me,tagName:"template"});const pt=Kd(ye.tagName),Jt=Kd(Xe.tagName);return st[ye.namespaceURI]?ye.namespaceURI===q?Xe.namespaceURI===W?pt==="svg":Xe.namespaceURI===yi?pt==="svg"&&(Jt==="annotation-xml"||U[Jt]):!!Se[pt]:ye.namespaceURI===yi?Xe.namespaceURI===W?pt==="math":Xe.namespaceURI===q?pt==="math"&&Z[Jt]:!!ot[pt]:ye.namespaceURI===W?Xe.namespaceURI===q&&!Z[Jt]||Xe.namespaceURI===yi&&!U[Jt]?!1:!ot[pt]&&(ce[pt]||!Se[pt]):!!(ut==="application/xhtml+xml"&&st[ye.namespaceURI]):!1},ct=function(ye){Ya(t.removed,{element:ye});try{ye.parentNode.removeChild(ye)}catch{ye.remove()}},wt=function(ye,Xe){try{Ya(t.removed,{attribute:Xe.getAttributeNode(ye),from:Xe})}catch{Ya(t.removed,{attribute:null,from:Xe})}if(Xe.removeAttribute(ye),ye==="is"&&!re[ye])if(k||te)try{ct(Xe)}catch{}else try{Xe.setAttribute(ye,"")}catch{}},Vt=function(ye){let Xe,pt;if(at)ye="<remove></remove>"+ye;else{const vn=c_(ye,/^[\r\n\t ]+/);pt=vn&&vn[0]}ut==="application/xhtml+xml"&&me===W&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");const Jt=D?D.createHTML(ye):ye;if(me===W)try{Xe=new m().parseFromString(Jt,ut)}catch{}if(!Xe||!Xe.documentElement){Xe=F.createDocument(me,"template",null);try{Xe.documentElement.innerHTML=ke?A:Jt}catch{}}const Mi=Xe.body||Xe.documentElement;return ye&&pt&&Mi.insertBefore(r.createTextNode(pt),Mi.childNodes[0]||null),me===W?Q.call(Xe,Ge?"html":"body")[0]:Ge?Xe.documentElement:Mi},yt=function(ye){return N.call(ye.ownerDocument||ye,ye,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},gt=function(ye){return ye instanceof f&&(typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||!(ye.attributes instanceof c)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function")},Zt=function(ye){return typeof l=="object"?ye instanceof l:ye&&typeof ye=="object"&&typeof ye.nodeType=="number"&&typeof ye.nodeName=="string"},Ii=function(ye,Xe,pt){le[ye]&&u_(le[ye],Jt=>{Jt.call(t,Xe,pt,Ut)})},Gi=function(ye){let Xe;if(Ii("beforeSanitizeElements",ye,null),gt(ye))return ct(ye),!0;const pt=Tt(ye.nodeName);if(Ii("uponSanitizeElement",ye,{tagName:pt,allowedTags:Oe}),ye.hasChildNodes()&&!Zt(ye.firstElementChild)&&(!Zt(ye.content)||!Zt(ye.content.firstElementChild))&&Xr(/<[/\w]/g,ye.innerHTML)&&Xr(/<[/\w]/g,ye.textContent))return ct(ye),!0;if(!Oe[pt]||Ye[pt]){if(!Ye[pt]&&Hi(pt)&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,pt)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(pt)))return!1;if(Pe&&!Ue[pt]){const Jt=E(ye)||ye.parentNode,Mi=w(ye)||ye.childNodes;if(Mi&&Jt){const vn=Mi.length;for(let pi=vn-1;pi>=0;--pi)Jt.insertBefore(C(Mi[pi],!0),x(ye))}}return ct(ye),!0}return ye instanceof u&&!mt(ye)||(pt==="noscript"||pt==="noembed"||pt==="noframes")&&Xr(/<\/no(script|embed|frames)/i,ye.innerHTML)?(ct(ye),!0):(nt&&ye.nodeType===3&&(Xe=ye.textContent,Xe=Fo(Xe,ve," "),Xe=Fo(Xe,J," "),Xe=Fo(Xe,z," "),ye.textContent!==Xe&&(Ya(t.removed,{element:ye.cloneNode()}),ye.textContent=Xe)),Ii("afterSanitizeElements",ye,null),!1)},Qt=function(ye,Xe,pt){if($&&(Xe==="id"||Xe==="name")&&(pt in r||pt in Kt))return!1;if(!(Ce&&!Be[Xe]&&Xr(P,Xe))){if(!(ue&&Xr(ae,Xe))){if(!re[Xe]||Be[Xe]){if(!(Hi(ye)&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,ye)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(ye))&&(Ve.attributeNameCheck instanceof RegExp&&Xr(Ve.attributeNameCheck,Xe)||Ve.attributeNameCheck instanceof Function&&Ve.attributeNameCheck(Xe))||Xe==="is"&&Ve.allowCustomizedBuiltInElements&&(Ve.tagNameCheck instanceof RegExp&&Xr(Ve.tagNameCheck,pt)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(pt))))return!1}else if(!Xt[Xe]){if(!Xr(xe,Fo(pt,Re,""))){if(!((Xe==="src"||Xe==="xlink:href"||Xe==="href")&&ye!=="script"&&h_(pt,"data:")===0&&ze[ye])){if(!(be&&!Xr(Ke,Fo(pt,Re,"")))){if(pt)return!1}}}}}}return!0},Hi=function(ye){return ye.indexOf("-")>0},Ln=function(ye){let Xe,pt,Jt,Mi;Ii("beforeSanitizeAttributes",ye,null);const{attributes:vn}=ye;if(!vn)return;const pi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re};for(Mi=vn.length;Mi--;){Xe=vn[Mi];const{name:Xi,namespaceURI:lr}=Xe;if(pt=Xi==="value"?Xe.value:f_(Xe.value),Jt=Tt(Xi),pi.attrName=Jt,pi.attrValue=pt,pi.keepAttr=!0,pi.forceKeepAttr=void 0,Ii("uponSanitizeAttribute",ye,pi),pt=pi.attrValue,pi.forceKeepAttr||(wt(Xi,ye),!pi.keepAttr))continue;if(!Le&&Xr(/\/>/i,pt)){wt(Xi,ye);continue}nt&&(pt=Fo(pt,ve," "),pt=Fo(pt,J," "),pt=Fo(pt,z," "));const Ei=Tt(ye.nodeName);if(Qt(Ei,Jt,pt)){if(X&&(Jt==="id"||Jt==="name")&&(wt(Xi,ye),pt=ne+pt),D&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!lr)switch(v.getAttributeType(Ei,Jt)){case"TrustedHTML":{pt=D.createHTML(pt);break}case"TrustedScriptURL":{pt=D.createScriptURL(pt);break}}try{lr?ye.setAttributeNS(lr,Xi,pt):ye.setAttribute(Xi,pt),zp(t.removed)}catch{}}}Ii("afterSanitizeAttributes",ye,null)},mn=function bt(ye){let Xe;const pt=yt(ye);for(Ii("beforeSanitizeShadowDOM",ye,null);Xe=pt.nextNode();)Ii("uponSanitizeShadowNode",Xe,null),!Gi(Xe)&&(Xe.content instanceof o&&bt(Xe.content),Ln(Xe));Ii("afterSanitizeShadowDOM",ye,null)};return t.sanitize=function(bt){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe,pt,Jt,Mi;if(ke=!bt,ke&&(bt="<!-->"),typeof bt!="string"&&!Zt(bt))if(typeof bt.toString=="function"){if(bt=bt.toString(),typeof bt!="string")throw ja("dirty is not a string, aborting")}else throw ja("toString is not a function");if(!t.isSupported)return bt;if(Et||Li(ye),t.removed=[],typeof bt=="string"&&(Me=!1),Me){if(bt.nodeName){const Xi=Tt(bt.nodeName);if(!Oe[Xi]||Ye[Xi])throw ja("root node is forbidden and cannot be sanitized in-place")}}else if(bt instanceof l)Xe=Vt("<!---->"),pt=Xe.ownerDocument.importNode(bt,!0),pt.nodeType===1&&pt.nodeName==="BODY"||pt.nodeName==="HTML"?Xe=pt:Xe.appendChild(pt);else{if(!k&&!nt&&!Ge&&bt.indexOf("<")===-1)return D&&_e?D.createHTML(bt):bt;if(Xe=Vt(bt),!Xe)return k?null:_e?A:""}Xe&&at&&ct(Xe.firstChild);const vn=yt(Me?bt:Xe);for(;Jt=vn.nextNode();)Gi(Jt)||(Jt.content instanceof o&&mn(Jt.content),Ln(Jt));if(Me)return bt;if(k){if(te)for(Mi=V.call(Xe.ownerDocument);Xe.firstChild;)Mi.appendChild(Xe.firstChild);else Mi=Xe;return(re.shadowroot||re.shadowrootmode)&&(Mi=L.call(e,Mi,!0)),Mi}let pi=Ge?Xe.outerHTML:Xe.innerHTML;return Ge&&Oe["!doctype"]&&Xe.ownerDocument&&Xe.ownerDocument.doctype&&Xe.ownerDocument.doctype.name&&Xr(jp,Xe.ownerDocument.doctype.name)&&(pi="<!DOCTYPE "+Xe.ownerDocument.doctype.name+`>
|
|
5
5
|
`+pi),nt&&(pi=Fo(pi,ve," "),pi=Fo(pi,J," "),pi=Fo(pi,z," ")),D&&_e?D.createHTML(pi):pi},t.setConfig=function(bt){Li(bt),Et=!0},t.clearConfig=function(){Ut=null,Et=!1},t.isValidAttribute=function(bt,ye,Xe){Ut||Li({});const pt=Tt(bt),Jt=Tt(ye);return Qt(pt,Jt,Xe)},t.addHook=function(bt,ye){typeof ye=="function"&&(le[bt]=le[bt]||[],Ya(le[bt],ye))},t.removeHook=function(bt){if(le[bt])return zp(le[bt])},t.removeHooks=function(bt){le[bt]&&(le[bt]=[])},t.removeAllHooks=function(){le={}},t}var Kp=qp();const mh=Object.freeze(Object.defineProperty({__proto__:null,default:Kp},Symbol.toStringTag,{value:"Module"}));var vh;const Jd=(vh=mh==null?void 0:Kp)!==null&&vh!==void 0?vh:mh;function Zp(a,t,e,n,r=!1,o,s){var l,u,p,c,f,m,v,b,C,x,w,E,D,A,F,N,V,Q;const L=(l=e==null?void 0:e.id)!==null&&l!==void 0?l:"",le=n.getOptions(),ve=(u=a==="editor"?e==null?void 0:e.internalColumnEditor:e==null?void 0:e.filter)!==null&&u!==void 0?u:{},J=(p=ve==null?void 0:ve.collectionOptions)!==null&&p!==void 0?p:{},z=(c=J==null?void 0:J.separatorBetweenTextLabels)!==null&&c!==void 0?c:"",P=(f=ve==null?void 0:ve.enableTranslateLabel)!==null&&f!==void 0?f:!1,ae=(m=le==null?void 0:le.enableTranslate)!==null&&m!==void 0?m:!1,Ke=(v=ve==null?void 0:ve.enableRenderHtml)!==null&&v!==void 0?v:!1,Re=(b=le==null?void 0:le.sanitizeHtmlOptions)!==null&&b!==void 0?b:{},xe=(x=(C=ve==null?void 0:ve.customStructure)===null||C===void 0?void 0:C.label)!==null&&x!==void 0?x:"label",Oe=(E=(w=ve==null?void 0:ve.customStructure)===null||w===void 0?void 0:w.labelPrefix)!==null&&E!==void 0?E:"labelPrefix",De=(A=(D=ve==null?void 0:ve.customStructure)===null||D===void 0?void 0:D.labelSuffix)!==null&&A!==void 0?A:"labelSuffix",re=(N=(F=ve==null?void 0:ve.customStructure)===null||F===void 0?void 0:F.optionLabel)!==null&&N!==void 0?N:"value",pe=(Q=(V=ve==null?void 0:ve.customStructure)===null||V===void 0?void 0:V.value)!==null&&Q!==void 0?Q:"value",Ve=Ie("select",{className:"ms-filter search-filter"}),Ye=a==="filter"?["search-filter",`filter-${L}`]:["select-editor",`editor-${L}`];Ve.classList.add(...Ye),Ve.multiple=r;const Be=[];let ue=!1;if(Array.isArray(t))if(t.every(Ce=>typeof Ce=="number"||typeof Ce=="string"))for(const Ce of t){const be={text:Ce,value:Ce};a==="filter"&&Array.isArray(s)&&(be.selected=s.findIndex(Le=>Le===Ce)>=0),Be.push(be),(be.selected&&r||be.selected&&!r&&Ce!=="")&&(ue=!0)}else t.forEach(Ce=>{if(Ce===void 0||typeof Ce=="object"&&Ce[xe]===void 0&&Ce.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 be=Ce.labelKey||Ce[xe],Le=(Ce.labelKey||P&&o)&&be&&ae?o==null?void 0:o.translate(be||" "):be;let nt=Ce[Oe]||"",Ge=Ce[De]||"",Et=Ce.hasOwnProperty(re)?Ce[re]:"";Et!=null&&Et.toString&&(Et=Et.toString().replace(/\"/g,"'")),nt=P&&o&&nt&&typeof nt=="string"?o.translate(nt||" "):nt,Ge=P&&o&&Ge&&typeof Ge=="string"?o.translate(Ge||" "):Ge,Et=P&&o&&Et&&typeof Et=="string"?o.translate(Et||" "):Et;let k=[nt,typeof Le=="string"||typeof Le=="number"?Le.toString():Le,Ge].filter($=>$).join(z);const te={text:"",value:""};Ke&&(k=Mn(le,k,Re)),te.text=k;let _e=Ce[pe];_e==null&&(_e=""),a==="filter"&&Array.isArray(s)&&(te.selected=s.findIndex($=>`${$}`==`${Ce[pe]}`)>=0),te.value=`${_e??""}`,Be.push(te),(te.selected&&r||te.selected&&!r&&Ce[pe]!=="")&&(ue=!0)});return{selectElement:Ve,dataCollection:Be,hasFoundSearchTerm:ue}}function gh(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=R_(),m=f.top,v=f.left,b=Kn(a);if(b){const C=(n=b.top)!==null&&n!==void 0?n:0,x=(r=b.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 Ie(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 _h(a){if(a)for(const t of Object.keys(a))Array.isArray(a[t])&&_h(a[t]),a[t]instanceof HTMLElement&&(a[t]=null)}function tn(a){if(a!=null&&a.firstChild)for(;a.firstChild;)a.lastChild&&a.removeChild(a.lastChild);return a}function T_(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 Kn(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 Qp(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(O_(a,`padding-${o}`))||0}return e}function O_(a,t){return window.getComputedStyle(a,null).getPropertyValue(t)}function A_(a){let t="";return a!=null&&a.localName&&(t=a!=null&&a.className?`${a.localName}.${Array.from(a.classList).join(".")}`:a.localName),t}function eu(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 k_(a){const t=typeof a=="string"?a:String(a),e={"&":"&","<":"<",">":">",'"':""","'":"'"};return(t||"").toString().replace(/[&<>"']/g,n=>e[n])}function I_(a){return a.replace(/&#(\d+);/g,(t,e)=>String.fromCharCode(e))}function D_(a,t){const e=a.length;let n=k_(a);if(e<t)for(let r=e;r<t;r++)n+=" ";return n}function or(a){const t=document.createElement("div");return t.innerHTML=a,t.textContent||t.innerText||""}function Mn(a,t,e){let n=t;return typeof(a==null?void 0:a.sanitizer)=="function"?n=a.sanitizer(t||""):typeof(Jd==null?void 0:Jd.sanitize)=="function"&&(n=(Jd.sanitize(t||"",e||{})||"").toString()),n}function R_(){return{left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0}}class F_{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,b,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 D=(r=(n=this.sharedService.gridOptions)===null||n===void 0?void 0:n[e])!==null&&r!==void 0?r:{},A=(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:je.locales,N=D==null?void 0:D[t],V=D==null?void 0:D[`${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||A&&((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||A&&((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||A&&((b=this.translaterService)===null||b===void 0?void 0:b.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||A&&((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:je.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 P_{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 M_{constructor(){this.pluginName="CellExcelCopyManager",this._eventHandler=new Slick.EventHandler,this._bindingEventService=new Pn}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 L_,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 N_=2e3,Jp=100;class L_{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 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=Ie("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 F of s)u[l++]=F!==""?F.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 b=!1,C=u.length,x=u.length?u[0].length:0;u.length===1&&u[0].length===1&&f&&(b=!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 F=this._grid.getData();for(E=1;E<=C-w;E++)F.push({});this._grid.setData(F),this._grid.render()}if(m+C>this._grid.getDataLength()&&typeof this._addonOptions.newRowCreator=="function"){const F=m+C-this._grid.getDataLength();this._addonOptions.newRowCreator(F)}const A={isClipboardCommand:!0,clippedRange:u,oldValues:[],cellExternalCopyManager:this,_options:this._addonOptions,setDataItemValueForColumn:this.setDataItemValueForColumn,markCopySelection:this.markCopySelection,oneCellToMultiple:b,activeRow:m,activeCell:v,destH:C,destW:x,maxDestY:this._grid.getDataLength(),maxDestX:this._grid.getColumns().length,h:0,w:0,execute:()=>{var F;A.h=0;for(let V=0;V<A.destH;V++){A.oldValues[V]=[],A.w=0,A.h++;for(let Q=0;Q<A.destW;Q++){A.w++;const L=m+V,le=v+Q;if(L<A.maxDestY&&le<A.maxDestX){const ve=this._grid.getDataItem(L);A.oldValues[V][Q]=ve[r[le].field],b?this.setDataItemValueForColumn(ve,r[le],u[0][0]):this.setDataItemValueForColumn(ve,r[le],u[V]?u[V][Q]:""),this._grid.updateCell(L,le),this._grid.onCellChange.notify({row:L,cell:le,item:ve,grid:this._grid,column:{}})}}}const N={fromCell:v,fromRow:m,toCell:v+A.w-1,toRow:m+A.h-1};this.markCopySelection([N]),(F=this._grid.getSelectionModel())===null||F===void 0||F.setSelectedRanges([N]),this.onPasteCells.notify({ranges:[N]})},undo:()=>{var F;for(let V=0;V<A.destH;V++)for(let Q=0;Q<A.destW;Q++){const L=m+V,le=v+Q;if(L<A.maxDestY&&le<A.maxDestX){const ve=this._grid.getDataItem(L);b?this.setDataItemValueForColumn(ve,r[le],A.oldValues[0][0]):this.setDataItemValueForColumn(ve,r[le],A.oldValues[V][Q]),this._grid.updateCell(L,le),this._grid.onCellChange.notify({row:L,cell:le,item:ve,grid:this._grid,column:{}})}}const N={fromCell:v,fromRow:m,toCell:v+A.w-1,toRow:m+A.h-1};if(this.markCopySelection([N]),(F=this._grid.getSelectionModel())===null||F===void 0||F.setSelectedRanges([N]),this.onPasteCells.notify({ranges:[N]}),typeof this._addonOptions.onPasteCells=="function"&&this._addonOptions.onPasteCells(new Slick.EventData,{ranges:[N]}),E>1){const V=this._grid.getData();for(;E>1;E--)V.splice(V.length-1,1);this._grid.setData(V),this._grid.render()}}};this._addonOptions.clipboardCommandHandler?this._addonOptions.clipboardCommandHandler(A):A.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 b=m.fromRow;b<m.toRow+1;b++){const C=[],x=this._grid.getDataItem(b);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
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:Jp),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:Jp),!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)||N_)}}class tu{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 Pn,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(),tn(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:Ie("div",{className:`slick-${t}-header`}),l=`${t}Title`;e!=null&&e[l]?(this[`_${t}TitleElm`]=Ie("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=Ie("li",{className:p,role:"menuitem"}),typeof r=="object"&&Yd(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=Ie("div",{className:`${this._menuCssPrefix}-icon`});l.appendChild(m),r.iconCssClass?m.classList.add(...r.iconCssClass.split(" ")):m.textContent="◦";const v=Ie("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 em extends tu{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,b,C,x,w,E;(e=this.menuElement)===null||e===void 0||e.remove(),this._menuElm=void 0;const D=this.grid.getCellFromEvent(t);if(D){this._currentCell=(n=D.cell)!==null&&n!==void 0?n:0,this._currentRow=(r=D.row)!==null&&r!==void 0?r:0;const A=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,le=!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:[],A.id),le=this.checkIsColumnAllowed((m=(f=this._addonOptions)===null||f===void 0?void 0:f.commandShownOverColumnIds)!==null&&m!==void 0?m:[],A.id),!A||(!le||!V.length)&&(!L||!Q.length)){this.hideMenu();return}}else if(!A||!A.cellMenu||!V.length&&!Q.length)return;const ve={cell:this._currentCell,row:this._currentRow,grid:this.grid};if(this.closeMenu(t,ve),typeof t.stopPropagation=="function"&&(this.pubSubService.publish(`on${El(this._camelPluginName)}BeforeMenuShow`,ve),typeof((v=this.addonOptions)===null||v===void 0?void 0:v.onBeforeMenuShow)=="function"&&this.addonOptions.onBeforeMenuShow(t,ve)===!1))return;this._menuElm=Ie("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:`${(b=this.addonOptions.maxHeight)!==null&&b!==void 0?b: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=Ie("button",{ariaLabel:"Close",className:"close",type:"button",innerHTML:"×",dataset:{dismiss:this._menuCssPrefix}});if(!this.addonOptions.hideOptionSection&&L&&Q.length>0){const ae=Ie("div",{className:`${this._menuCssPrefix}-option-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("option",this.addonOptions,ae),this.addonOptions.hideCloseButton||this.populateCommandOrOptionCloseBtn("option",P,ae),this.populateCommandOrOptionItems("option",this.addonOptions,ae,Q,{cell:this._currentCell,row:this._currentRow,column:A,dataContext:F,grid:this.grid},this.handleMenuItemCommandClick)}if(!this.addonOptions.hideCommandSection&&le&&V.length>0){const ae=Ie("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},this._menuElm);this.populateCommandOrOptionTitle("command",this.addonOptions,ae),!this.addonOptions.hideCloseButton&&(!L||Q.length===0||this.addonOptions.hideOptionSection)&&this.populateCommandOrOptionCloseBtn("command",P,ae),this.populateCommandOrOptionItems("command",this.addonOptions,ae,V,{cell:this._currentCell,row:this._currentRow,column:A,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`,ve),typeof((E=this.addonOptions)===null||E===void 0?void 0:E.onAfterMenuShow)=="function"&&this.addonOptions.onAfterMenuShow(t,ve)===!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:Ie("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=Kn(f))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:0:c.pageX,v=f&&this._camelPluginName==="cellMenu"?(l=(s=Kn(f))===null||s===void 0?void 0:s.top)!==null&&l!==void 0?l:0:c.pageY;const b=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),D=+(this._addonOptions.autoAlignSideOffset||0);if(this._addonOptions.autoAdjustDrop||this._addonOptions.dropDirection){const A=gh(f).bottom,F=gh(f).top,N=A+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 A=this.grid.getGridPosition();(m+ +x>=A.width?"left":"right")==="left"||this._addonOptions.dropSide==="left"?(this._menuElm.classList.remove("dropright"),this._menuElm.classList.add("dropleft"),this._camelPluginName==="cellMenu"?m=m-(+x-b)-D:m=m-+x-D):(this._menuElm.classList.remove("dropleft"),this._menuElm.classList.add("dropright"),m=m+D)}this._menuElm.style.top=`${v}px`,this._menuElm.style.left=`${m}px`}}}class H_ extends em{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 V_{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=Ie("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 tm{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 V_(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(),tn(this._activeCanvas),tn(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=Kn(this._activeViewport),v=(o=m==null?void 0:m.left)!==null&&o!==void 0?o:0,b=(s=m==null?void 0:m.top)!==null&&s!==void 0?s:0,C=v+this._viewportWidth,x=b+this._viewportHeight,w={e:t,dd:e,viewport:{left:u,top:p,right:c,bottom:f,offset:{left:v,top:b,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<b?w.offset.y=b-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=Kn(this._activeCanvas))===null||o===void 0?void 0:o.left)!==null&&s!==void 0?s:0)+this._columnOffset,p.pageY-((u=(l=Kn(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=Kn(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=Kn(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 tm({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 bh{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 tm({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 im{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 Pn,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 bh(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")){tn(n.node);const r=Ie("span",{id:"filter-checkbox-selectall-container",ariaChecked:"false"});r.appendChild(Ie("input",{type:"checkbox",id:`header-filter-selector${this._selectAll_UID}`})),r.appendChild(Ie("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 nm extends tu{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,iu.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&&(om.call(this,this._menuElm),this._listElm=Ie("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",sm.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=Ie("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=Ie("div",{role:"menu",className:`slick-grid-menu ${this._gridUid}`,style:{display:"none"}}),this._commandMenuElm=Ie("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 b=(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=Kn(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),D=(p=(u=this._menuElm)===null||u===void 0?void 0:u.offsetWidth)!==null&&p!==void 0?p:0,A=(f=(c=e==null?void 0:e.contentMinWidth)!==null&&c!==void 0?c:this._defaults.contentMinWidth)!==null&&f!==void 0?f:0,F=(A>D?A:D)||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),A>0&&(this._menuElm.style.minWidth=`${A}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-b.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(),tn(this._listElm),tn(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),iu.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;lm.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,b;const C=this.gridOptions.backendServiceApi||null,x=[],w=this.gridOptions,E=ao(w),D=(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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.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=D==null?void 0:D.exportTextDelimitedCommandKey)!==null&&v!==void 0?v:"EXPORT_TO_TAB_DELIMITED"}`,disabled:!1,command:F,positionOrder:56})}const A=((b=this._gridMenuOptions)===null||b===void 0?void 0:b.commandItems)||[];return this.gridOptions&&this._gridMenuOptions&&(Array.isArray(x)&&x.length>0||Array.isArray(A)&&A.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:un.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 b=u.find(w=>w.className==="TextExportService");b!=null&&b.exportToFile?b.exportToFile({delimiter:vs.tab,format:un.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:Ie("div",{className:"slick-command-header"});r.classList.add("with-close"),rm.call(this,r),this._commandMenuElm.appendChild(r),this.populateCommandOrOptionItems("command",t,this._commandMenuElm,(t==null?void 0:t.commandItems)||[],e,this.handleMenuItemCommandClick)}}function rm(a){const e=Ie("button",{type:"button",className:"close",ariaLabel:"Close",innerHTML:"×",dataset:{dismiss:this instanceof Ch?"slick-column-picker":"slick-grid-menu"}});a.appendChild(e)}function om(a){var t,e,n;const r=this;!((t=r.addonOptions)===null||t===void 0)&&t.columnTitle&&(r._columnTitleElm=Ie("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 sm(a){var t,e;const n=this,r=n instanceof Ch?"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 lm(a){var t,e;const n=this,r=n instanceof nm?"gridmenu-":"";for(const o of n.columns){const s=o.id,l=document.createElement("li");o.excludeFromColumnPicker&&(l.className="hidden");const u=Ie("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(Ie("label",{htmlFor:`${n._gridUid}-${r}colpicker-${s}`,innerHTML:Mn(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(Ie("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-forcefit`,ariaChecked:String(n.gridOptions.forceFitColumns),checked:n.gridOptions.forceFitColumns,dataset:{option:"autoresize"}})),o.appendChild(Ie("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(Ie("input",{type:"checkbox",id:`${n._gridUid}-${r}colpicker-syncresize`,ariaChecked:String(n.gridOptions.syncColumnCellResize),checked:n.gridOptions.syncColumnCellResize,dataset:{option:"syncresize"}})),o.appendChild(Ie("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 iu(){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 Ch{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 Pn,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,iu.bind(this)),this._menuElm=Ie("div",{ariaExpanded:"false",className:`slick-column-picker ${this._gridUid}`,role:"menu",style:{display:"none"}}),om.call(this,this._menuElm),rm.call(this,this._menuElm),this._listElm=Ie("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",sm.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(),tn(this._listElm),iu.call(this),this._columnCheckboxes=[],lm.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 nu=(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.
|
|
@@ -15,12 +15,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
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||Kn(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=Kn(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:z0;if(f&&t.enablePagination&&(f+=G0),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:U0;f+=parseInt(`${N}`,10)}let m=0,v=0;p.calculateAvailableSizeBy==="container"?m=Qp(this._pageContainerElm,"height")||0:(m=window.innerHeight||0,v=(s=c==null?void 0:c.top)!==null&&s!==void 0?s:0);const b=m-v-f,C=Qp(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:W0,E=p==null?void 0:p.maxWidth,D=(u=p==null?void 0:p.minWidth)!==null&&u!==void 0?u:$0;let A=b,F=p!=null&&p.rightPadding?C-p.rightPadding:C;return A<w&&(A=w),x&&A>x&&(A=x),F<D&&(F=D),E&&F>E&&(F=E),{height:this._fixedHeight||A,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 b=(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<b){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>b?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=ru(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 b=(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"?b: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(b=>b.id===t.id))!==null&&r!==void 0?r:0;let v=e;if(f>=0&&m<=f){const b=Array.from(this._grid.getViewports());if(b){const C=(s=(o=b.find(A=>A.classList.contains("slick-viewport-left")))===null||o===void 0?void 0:o.clientWidth)!==null&&s!==void 0?s:0,x=(u=(l=b.find(A=>A.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 A=(c=this.resizeByContentOptions.widthToRemoveFromExceededWidthReadjustment)!==null&&c!==void 0?c:50;v=C-E+x-A}}}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,b,C,x,w,E;const A=Kn(l);let F=(v=A==null?void 0:A.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=Kn(u),V=(b=N==null?void 0:N.top)!==null&&b!==void 0?b:0,Q=Kn(this._gridContainerElm);let L=(A==null?void 0:A.top)===0||F-V>2||(Q==null?void 0:Q.left)===0&&(Q==null?void 0:Q.top)===0;const le=(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&&le===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 X0{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 q0{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){var n,r;const o=e.multiColumnSort?e.sortCols:new Array({columnId:(r=(n=e.sortCol)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"",sortAsc:e.sortAsc,sortCol:e.sortCol});this._currentLocalSorters=[],Array.isArray(o)&&o.forEach(s=>{s.sortCol&&this._currentLocalSorters.push({columnId:s.sortCol.id,direction:s.sortAsc?Io.ASC:Io.DESC})}),this.onLocalSortChanged(this._grid,o),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(b=>({columnId:b.columnId,sortAsc:b.sortAsc,sortCol:this._columnDefinitions.find(C=>C.id===b.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 b,C;return{columnId:(C=(b=v.sortCol)===null||b===void 0?void 0:b.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=Tp(t,m);if(n){this._currentLocalSorters=[];for(const C of e)this._currentLocalSorters.push({columnId:C.columnId,direction:C.sortAsc?"ASC":"DESC"});const b=!((p=this._gridOptions)===null||p===void 0)&&p.backendServiceApi?Ji.remote:Ji.local;this.emitSortChanged(b)}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=bn(e,l)),u&&u.indexOf(".")>=0&&(f=bn(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 K0{constructor(t,e,n){this.pubSubService=t,this.sharedService=e,this.sortService=n,this._currentToggledItems=[],this._isLastFullToggleCollapsed=!1,this._isOneCpuCyclePassed=!1,this._isTreeDataEnabled=!1,this._subscriptions=[],this._treeDataRecalcHandler=null,this._eventHandler=new Slick.EventHandler,setTimeout(()=>this._isOneCpuCyclePassed=!0)}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._isTreeDataEnabled=(n=(e=this.gridOptions)===null||e===void 0?void 0:e.enableTreeData)!==null&&n!==void 0?n:!1,this._isLastFullToggleCollapsed=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.initiallyCollapsed)!==null&&o!==void 0?o:!1,this._currentToggledItems=(u=(l=(s=this.gridOptions.presets)===null||s===void 0?void 0:s.treeData)===null||l===void 0?void 0:l.toggledItems)!==null&&u!==void 0?u:[],this._lastToggleStateChange={type:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},this._isTreeDataEnabled){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))),this._treeDataRecalcHandler=this.setAutoRecalcTotalsCallbackWhenFeatEnabled(this.gridOptions),this._eventHandler.subscribe(this.dataView.onRowCountChanged,()=>{var v,b;typeof this._treeDataRecalcHandler=="function"&&this._isOneCpuCyclePassed&&(clearTimeout(this._timer),this._timer=setTimeout(()=>{var C;return(C=this._treeDataRecalcHandler)===null||C===void 0?void 0:C.call(this)},(b=(v=this.treeDataOptions)===null||v===void 0?void 0:v.autoRecalcTotalsDebounce)!==null&&b!==void 0?b:0))})}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,b,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:je.treeDataProperties.CHILDREN_PROP;break;case"collapsedPropName":x=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.collapsedPropName)!==null&&o!==void 0?o:je.treeDataProperties.COLLAPSED_PROP;break;case"hasChildrenPropName":x=(l=(s=this.treeDataOptions)===null||s===void 0?void 0:s.hasChildrenPropName)!==null&&l!==void 0?l:je.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:je.treeDataProperties.TREE_LEVEL_PROP;break;case"parentPropName":x=(C=(b=this.treeDataOptions)===null||b===void 0?void 0:b.parentPropName)!==null&&C!==void 0?C:je.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 Op(t,u)}enableAutoRecalcTotalsFeature(t=!0){t&&this._isTreeDataEnabled?this._treeDataRecalcHandler=this.recalculateTreeTotals.bind(this,this.gridOptions):this._treeDataRecalcHandler=null}recalculateTreeTotals(t){var e,n;const r=t.treeDataOptions,o=(e=r==null?void 0:r.childrenPropName)!==null&&e!==void 0?e:je.treeDataProperties.CHILDREN_PROP,s=(n=r==null?void 0:r.levelPropName)!==null&&n!==void 0?n:je.treeDataProperties.TREE_LEVEL_PROP;r!=null&&r.aggregators&&(r.aggregators.forEach(l=>{Va(this.sharedService.hierarchicalDataset||[],{childrenPropName:o,levelPropName:s,aggregator:l})}),this._grid.invalidate())}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,b=Ba(this.sharedService.hierarchicalDataset||[],v,l);b&&(b[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=Ba(this.sharedService.hierarchicalDataset||[],u,s);p&&(p[l]=e)}}setAutoRecalcTotalsCallbackWhenFeatEnabled(t){var e,n;return t!=null&&t.enableTreeData&&(!((e=t==null?void 0:t.treeDataOptions)===null||e===void 0)&&e.autoRecalcTotalsOnFilterChange)&&(!((n=t==null?void 0:t.treeDataOptions)===null||n===void 0)&&n.aggregators)?this.recalculateTreeTotals.bind(this,t):null}}function $h(a,t){const e=Ie("select",{className:"form-control"});for(const n of a)e.appendChild(Ie("option",{value:n.operator,innerHTML:Mn(t,`${D_(n.operator,3)}${n.description}`)}));return e}function Zn(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 Z0(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=bn(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 Wm(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 xp(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,b=p.collectionInsideObjectProperty;c=bn(v,b||"")}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&&Q0(t,e,n,r)}return c}function Q0(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=>Z0(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||je.locales;return(o=s==null?void 0:s[t])!==null&&o!==void 0?o:e}function J0(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 Yh(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 $m=qd&&lh||qd;class eb{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 Pn}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:je.locales;const b=this.columnFilter.collection;return this._collection=b,this.renderDomElement(b),new Promise(async(C,x)=>{try{const w=this.columnFilter.collectionAsync;let E;w&&!this.columnFilter.collection?(E=Wm(w,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),C(E)):(E=b,C(b)),(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(),Wd(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||[])}),Zc(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=bn(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,b,C,x,w,E;this._collection=t;const D=(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"";tn(this.filterContainerElm);let A=(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&&(A=this.columnFilter.placeholder),this._filterElm=Ie("input",{type:"text",ariaLabel:(p=(u=this.columnFilter)===null||u===void 0?void 0:u.ariaLabel)!==null&&p!==void 0?p:`${jr(D+"")} Search Filter`,autocomplete:"none",placeholder:A,className:`form-control search-filter filter-${D} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${D}`}});const F=e;Array.isArray(t)&&(t.every(V=>$d(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"):(b=(v=this._locales)===null||v===void 0?void 0:v.TEXT_NO_ELEMENTS_FOUND)!==null&&b!==void 0?b:"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-${$a(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?(Lp(this._filterElm,this._autocompleterOptions),this._instance=$m(this._autocompleterOptions)):this._instance=$m({...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=Ie("div",{className:"autocomplete-filter-container"});return N.appendChild(this._filterElm),N.appendChild(Ie("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 Ie("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=Mn(this.gridOptions,o)||"";return Ie("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=Mn(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 jh=["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},dd={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 Ym(a,t){var e;return function(){var n=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return a.apply(n,r)},t)}}var Xh=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 Tu(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function jm(a,t){if(t(a))return a;if(a.parentNode)return jm(a.parentNode,t)}function Ou(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 qh=function(){},Au=function(a,t,e){return e.months[t?"shorthand":"longhand"][a]},tb={D:qh,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:qh,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:qh,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})"},ud={Z:function(a){return a.toISOString()},D:function(a,t,e){return t.weekdays.shorthand[ud.w(a,t,e)]},F:function(a,t,e){return Au(ud.n(a,t,e)-1,!1,t)},G:function(a,t,e){return Nr(ud.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 Au(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)}},Xm=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?dd: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 ud[f]&&v[m-1]!=="\\"?ud[f](l,c,e):f!=="\\"?f:""}).join("")}},Kh=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?dd: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 b=void 0,C=[],x=0,w=0,E="";x<m.length;x++){var D=m[x],A=D==="\\",F=m[x-1]==="\\"||A;if(Al[D]&&!F){E+=Al[D];var N=new RegExp(E).exec(o);N&&(b=!0)&&C[D!=="Y"?"push":"unshift"]({fn:tb[D],val:N[++w]})}else A||(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=b?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 ib=function(a,t,e){return a>Math.min(t,e)&&a<Math.max(t,e)},Zh=function(a,t,e){return a*3600+t*60+e},nb=function(a){var t=Math.floor(a/3600),e=(a-t*3600)/60;return[t,e,a-t*3600-e*60]},rb={DAY:864e5};function Qh(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)},qm=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},ob=300;function sb(a,t){var e={config:pr(pr({},da),On.defaultConfig),l10n:dd};e.parseDate=Kh({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=m,e._positionCalendar=ne,e.changeMonth=re,e.changeYear=Ce,e.clear=pe,e.close=Ve,e.onMouseOver=Et,e._createElement=Pi,e.createDay=N,e.destroy=Ye,e.isEnabled=be,e.jumpToDate=E,e.updateValue=Kt,e.open=k,e.redraw=fe,e.set=Ne,e.setDate=It,e.toggle=st;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,_e(),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(),rt("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=Qh(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 Se=e._input.value;f(),Kt(),e._input.value!==Se&&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 Se=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.minDate,!0)===0,ot=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 mt=Zh(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ct=Zh(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),wt=Zh(U,Z,ce);if(wt>ct&&wt<mt){var Vt=nb(mt);U=Vt[0],Z=Vt[1],ce=Vt[2]}}else{if(ot){var yt=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;U=Math.min(U,yt.getHours()),U===yt.getHours()&&(Z=Math.min(Z,yt.getMinutes())),Z===yt.getMinutes()&&(ce=Math.min(ce,yt.getSeconds()))}if(Se){var gt=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;U=Math.max(U,gt.getHours()),U===gt.getHours()&&Z<gt.getMinutes()&&(Z=gt.getMinutes()),Z===gt.getMinutes()&&(ce=Math.max(ce,gt.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 b(U){var Z=Zr(U),ce=parseInt(Z.value)+(U.delta||0);(ce/1e3>1||U.key==="Enter"&&!/[^\d]/.test(ce.toString()))&&Ce(ce)}function C(U,Z,ce,Se){if(Z instanceof Array)return Z.forEach(function(ot){return C(U,ot,ce,Se)});if(U instanceof Array)return U.forEach(function(ot){return C(ot,Z,ce,Se)});U.addEventListener(Z,ce,Se),e._handlers.push({remove:function(){return U.removeEventListener(Z,ce,Se)}})}function x(){rt("onChange")}function w(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(ce){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+ce+"]"),function(Se){return C(Se,"click",e[ce])})}),e.isMobile){ke();return}var U=Ym(at,50);if(e._debouncedChange=Ym(x,ob),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(ce){e.config.mode==="range"&&Et(Zr(ce))}),C(e._input,"keydown",Ge),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",Ge),!e.config.inline&&!e.config.static&&C(window,"resize",U),window.ontouchstart!==void 0?C(window.document,"touchstart",ue):C(window.document,"mousedown",ue),C(window.document,"focus",ue,{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"],b),C(e.daysContainer,"click",ft)),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",D),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",nt)}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),Se=e.currentYear,ot=e.currentMonth;try{ce!==void 0&&(e.currentYear=ce.getFullYear(),e.currentMonth=ce.getMonth())}catch(mt){mt.message="Invalid date supplied: "+ce,e.config.errorHandler(mt)}Z&&e.currentYear!==Se&&(rt("onYearChange"),z()),Z&&(e.currentYear!==Se||e.currentMonth!==ot)&&rt("onMonthChange"),e.redraw()}function D(U){var Z=Zr(U);~Z.className.indexOf("arrow")&&A(U,Z.classList.contains("arrowUp")?1:-1)}function A(U,Z,ce){var Se=U&&Zr(U),ot=ce||Se&&Se.parentNode&&Se.parentNode.firstChild,mt=ut("increment");mt.delta=Z,ot&&ot.dispatchEvent(mt)}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=De(),ce=Z.weekWrapper,Se=Z.weekNumbers;e.innerContainer.appendChild(ce),e.weekNumbers=Se,e.weekWrapper=ce}e.rContainer=Pi("div","flatpickr-rContainer"),e.rContainer.appendChild(xe()),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(Re()),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 ot=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&&(!ot&&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 mt=Pi("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(mt,e.element),mt.appendChild(e.element),e.altInput&&mt.appendChild(e.altInput),mt.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,Se){var ot=be(Z,!0),mt=Pi("span",U,Z.getDate().toString());return mt.dateObj=Z,mt.$i=Se,mt.setAttribute("aria-label",e.formatDate(Z,e.config.ariaDateFormat)),U.indexOf("hidden")===-1&&Qr(Z,e.now)===0&&(e.todayDateElem=mt,mt.classList.add("today"),mt.setAttribute("aria-current","date")),ot?(mt.tabIndex=-1,Rt(Z)&&(mt.classList.add("selected"),e.selectedDateElem=mt,e.config.mode==="range"&&(wr(mt,"startRange",e.selectedDates[0]&&Qr(Z,e.selectedDates[0],!0)===0),wr(mt,"endRange",e.selectedDates[1]&&Qr(Z,e.selectedDates[1],!0)===0),U==="nextMonthDay"&&mt.classList.add("inRange")))):mt.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Ht(Z)&&!Rt(Z)&&mt.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&U!=="prevMonthDay"&&Se%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(Z)+"</span>"),rt("onDayCreate",mt),mt}function V(U){U.focus(),e.config.mode==="range"&&Et(U)}function Q(U){for(var Z=U>0?0:e.config.showMonths-1,ce=U>0?e.config.showMonths:-1,Se=Z;Se!=ce;Se+=U)for(var ot=e.daysContainer.children[Se],mt=U>0?0:ot.children.length-1,ct=U>0?ot.children.length:-1,wt=mt;wt!=ct;wt+=U){var Vt=ot.children[wt];if(Vt.className.indexOf("hidden")===-1&&be(Vt.dateObj))return Vt}}function L(U,Z){for(var ce=U.className.indexOf("Month")===-1?U.dateObj.getMonth():e.currentMonth,Se=Z>0?e.config.showMonths:-1,ot=Z>0?1:-1,mt=ce-e.currentMonth;mt!=Se;mt+=ot)for(var ct=e.daysContainer.children[mt],wt=ce-e.currentMonth===mt?U.$i+Z:Z<0?ct.children.length-1:0,Vt=ct.children.length,yt=wt;yt>=0&&yt<Vt&&yt!=(Z>0?Vt:-1);yt+=ot){var gt=ct.children[yt];if(gt.className.indexOf("hidden")===-1&&be(gt.dateObj)&&Math.abs(U.$i-yt)>=Math.abs(Z))return V(gt)}e.changeMonth(ot),le(Q(ot),0)}function le(U,Z){var ce=o(),Se=Le(ce||document.body),ot=U!==void 0?U:Se?ce:e.selectedDateElem!==void 0&&Le(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Le(e.todayDateElem)?e.todayDateElem:Q(Z>0?1:-1);ot===void 0?e._input.focus():Se?L(ot,Z):V(ot)}function ve(U,Z){for(var ce=(new Date(U,Z,1).getDay()-e.l10n.firstDayOfWeek+7)%7,Se=e.utils.getDaysInMonth((Z-1+12)%12,U),ot=e.utils.getDaysInMonth(Z,U),mt=window.document.createDocumentFragment(),ct=e.config.showMonths>1,wt=ct?"prevMonthDay hidden":"prevMonthDay",Vt=ct?"nextMonthDay hidden":"nextMonthDay",yt=Se+1-ce,gt=0;yt<=Se;yt++,gt++)mt.appendChild(N("flatpickr-day "+wt,new Date(U,Z-1,yt),yt,gt));for(yt=1;yt<=ot;yt++,gt++)mt.appendChild(N("flatpickr-day",new Date(U,Z,yt),yt,gt));for(var Zt=ot+1;Zt<=42-ce&&(e.config.showMonths===1||gt%7!==0);Zt++,gt++)mt.appendChild(N("flatpickr-day "+Vt,new Date(U,Z+1,Zt%ot),Zt,gt));var Ii=Pi("div","dayContainer");return Ii.appendChild(mt),Ii}function J(){if(e.daysContainer!==void 0){Tu(e.daysContainer),e.weekNumbers&&Tu(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(ve(ce.getFullYear(),ce.getMonth()))}e.daysContainer.appendChild(U),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&Et()}}function z(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var U=function(Se){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&Se<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&Se>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=Au(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(ct){var wt=Zr(ct),Vt=parseInt(wt.value,10);e.changeMonth(Vt-e.currentMonth),rt("onMonthChange")}),z(),ce=e.monthsDropdownContainer);var Se=Ou("cur-year",{tabindex:"-1"}),ot=Se.getElementsByTagName("input")[0];ot.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&ot.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(ot.setAttribute("max",e.config.maxDate.getFullYear().toString()),ot.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var mt=Pi("div","flatpickr-current-month");return mt.appendChild(ce),mt.appendChild(Se),Z.appendChild(mt),U.appendChild(Z),{container:U,yearElement:ot,monthElement:ce}}function ae(){Tu(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,ae(),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 Re(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var U=Qh(e.config);e.timeContainer=Pi("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var Z=Pi("span","flatpickr-time-separator",":"),ce=Ou("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=ce.getElementsByTagName("input")[0];var Se=Ou("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=Se.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(Se),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var ot=Ou("flatpickr-second");e.secondElement=ot.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(ot)}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 xe(){e.weekdayContainer?Tu(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 Oe(),e.weekdayContainer}function Oe(){if(e.weekdayContainer){var U=e.l10n.firstDayOfWeek,Z=qm(e.l10n.weekdays.shorthand);U>0&&U<Z.length&&(Z=qm(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||Kn(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=Kn(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:z0;if(f&&t.enablePagination&&(f+=G0),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:U0;f+=parseInt(`${N}`,10)}let m=0,v=0;p.calculateAvailableSizeBy==="container"?m=Qp(this._pageContainerElm,"height")||0:(m=window.innerHeight||0,v=(s=c==null?void 0:c.top)!==null&&s!==void 0?s:0);const b=m-v-f,C=Qp(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:W0,E=p==null?void 0:p.maxWidth,D=(u=p==null?void 0:p.minWidth)!==null&&u!==void 0?u:$0;let A=b,F=p!=null&&p.rightPadding?C-p.rightPadding:C;return A<w&&(A=w),x&&A>x&&(A=x),F<D&&(F=D),E&&F>E&&(F=E),{height:this._fixedHeight||A,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 b=(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<b){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>b?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=ru(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 b=(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"?b: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(b=>b.id===t.id))!==null&&r!==void 0?r:0;let v=e;if(f>=0&&m<=f){const b=Array.from(this._grid.getViewports());if(b){const C=(s=(o=b.find(A=>A.classList.contains("slick-viewport-left")))===null||o===void 0?void 0:o.clientWidth)!==null&&s!==void 0?s:0,x=(u=(l=b.find(A=>A.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 A=(c=this.resizeByContentOptions.widthToRemoveFromExceededWidthReadjustment)!==null&&c!==void 0?c:50;v=C-E+x-A}}}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,b,C,x,w,E;const A=Kn(l);let F=(v=A==null?void 0:A.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=Kn(u),V=(b=N==null?void 0:N.top)!==null&&b!==void 0?b:0,Q=Kn(this._gridContainerElm);let L=(A==null?void 0:A.top)===0||F-V>2||(Q==null?void 0:Q.left)===0&&(Q==null?void 0:Q.top)===0;const le=(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&&le===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 X0{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 q0{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){var n,r;const o=e.multiColumnSort?e.sortCols:new Array({columnId:(r=(n=e.sortCol)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"",sortAsc:e.sortAsc,sortCol:e.sortCol});this._currentLocalSorters=[],Array.isArray(o)&&o.forEach(s=>{s.sortCol&&this._currentLocalSorters.push({columnId:s.sortCol.id,direction:s.sortAsc?Io.ASC:Io.DESC})}),this.onLocalSortChanged(this._grid,o),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(b=>({columnId:b.columnId,sortAsc:b.sortAsc,sortCol:this._columnDefinitions.find(C=>C.id===b.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 b,C;return{columnId:(C=(b=v.sortCol)===null||b===void 0?void 0:b.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=Tp(t,m);if(n){this._currentLocalSorters=[];for(const C of e)this._currentLocalSorters.push({columnId:C.columnId,direction:C.sortAsc?"ASC":"DESC"});const b=!((p=this._gridOptions)===null||p===void 0)&&p.backendServiceApi?Ji.remote:Ji.local;this.emitSortChanged(b)}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=bn(e,l)),u&&u.indexOf(".")>=0&&(f=bn(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 K0{constructor(t,e,n){this.pubSubService=t,this.sharedService=e,this.sortService=n,this._currentToggledItems=[],this._isLastFullToggleCollapsed=!1,this._isOneCpuCyclePassed=!1,this._isTreeDataEnabled=!1,this._subscriptions=[],this._treeDataRecalcHandler=null,this._eventHandler=new Slick.EventHandler,setTimeout(()=>this._isOneCpuCyclePassed=!0)}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._isTreeDataEnabled=(n=(e=this.gridOptions)===null||e===void 0?void 0:e.enableTreeData)!==null&&n!==void 0?n:!1,this._isLastFullToggleCollapsed=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.initiallyCollapsed)!==null&&o!==void 0?o:!1,this._currentToggledItems=(u=(l=(s=this.gridOptions.presets)===null||s===void 0?void 0:s.treeData)===null||l===void 0?void 0:l.toggledItems)!==null&&u!==void 0?u:[],this._lastToggleStateChange={type:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",previousFullToggleType:this._isLastFullToggleCollapsed?"full-collapse":"full-expand",toggledItems:this._currentToggledItems},this._isTreeDataEnabled){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))),this._treeDataRecalcHandler=this.setAutoRecalcTotalsCallbackWhenFeatEnabled(this.gridOptions),this._eventHandler.subscribe(this.dataView.onRowCountChanged,()=>{var v,b;typeof this._treeDataRecalcHandler=="function"&&this._isOneCpuCyclePassed&&(clearTimeout(this._timer),this._timer=setTimeout(()=>{var C;return(C=this._treeDataRecalcHandler)===null||C===void 0?void 0:C.call(this)},(b=(v=this.treeDataOptions)===null||v===void 0?void 0:v.autoRecalcTotalsDebounce)!==null&&b!==void 0?b:0))})}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,b,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:je.treeDataProperties.CHILDREN_PROP;break;case"collapsedPropName":x=(o=(r=this.treeDataOptions)===null||r===void 0?void 0:r.collapsedPropName)!==null&&o!==void 0?o:je.treeDataProperties.COLLAPSED_PROP;break;case"hasChildrenPropName":x=(l=(s=this.treeDataOptions)===null||s===void 0?void 0:s.hasChildrenPropName)!==null&&l!==void 0?l:je.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:je.treeDataProperties.TREE_LEVEL_PROP;break;case"parentPropName":x=(C=(b=this.treeDataOptions)===null||b===void 0?void 0:b.parentPropName)!==null&&C!==void 0?C:je.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 Op(t,u)}enableAutoRecalcTotalsFeature(t=!0){t&&this._isTreeDataEnabled?this._treeDataRecalcHandler=this.recalculateTreeTotals.bind(this,this.gridOptions):this._treeDataRecalcHandler=null}recalculateTreeTotals(t){var e,n;const r=t.treeDataOptions,o=(e=r==null?void 0:r.childrenPropName)!==null&&e!==void 0?e:je.treeDataProperties.CHILDREN_PROP,s=(n=r==null?void 0:r.levelPropName)!==null&&n!==void 0?n:je.treeDataProperties.TREE_LEVEL_PROP;r!=null&&r.aggregators&&(r.aggregators.forEach(l=>{Va(this.sharedService.hierarchicalDataset||[],{childrenPropName:o,levelPropName:s,aggregator:l})}),this._grid.invalidate())}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,b=Ba(this.sharedService.hierarchicalDataset||[],v,l);b&&(b[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=Ba(this.sharedService.hierarchicalDataset||[],u,s);p&&(p[l]=e)}}setAutoRecalcTotalsCallbackWhenFeatEnabled(t){var e,n;return t!=null&&t.enableTreeData&&(!((e=t==null?void 0:t.treeDataOptions)===null||e===void 0)&&e.autoRecalcTotalsOnFilterChange)&&(!((n=t==null?void 0:t.treeDataOptions)===null||n===void 0)&&n.aggregators)?this.recalculateTreeTotals.bind(this,t):null}}function $h(a,t){const e=Ie("select",{className:"form-control"});for(const n of a)e.appendChild(Ie("option",{value:n.operator,innerHTML:Mn(t,`${D_(n.operator,3)}${n.description}`)}));return e}function Zn(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 Z0(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=bn(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 Wm(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 xp(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,b=p.collectionInsideObjectProperty;c=bn(v,b||"")}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&&Q0(t,e,n,r)}return c}function Q0(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=>Z0(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||je.locales;return(o=s==null?void 0:s[t])!==null&&o!==void 0?o:e}function J0(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 Yh(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 $m=qd&&lh||qd;class eb{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 Pn}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:je.locales;const b=this.columnFilter.collection;return this._collection=b,this.renderDomElement(b),new Promise(async(C,x)=>{try{const w=this.columnFilter.collectionAsync;let E;w&&!this.columnFilter.collection?(E=Wm(w,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),C(E)):(E=b,C(b)),(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(),Wd(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||[])}),Zc(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=bn(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,b,C,x,w,E;this._collection=t;const D=(r=(n=this.columnDef)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"";tn(this.filterContainerElm);let A=(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&&(A=this.columnFilter.placeholder),this._filterElm=Ie("input",{type:"text",ariaLabel:(p=(u=this.columnFilter)===null||u===void 0?void 0:u.ariaLabel)!==null&&p!==void 0?p:`${jr(D+"")} Search Filter`,autocomplete:"off",ariaAutoComplete:"none",placeholder:A,className:`form-control search-filter filter-${D} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${D}`}});const F=e;Array.isArray(t)&&(t.every(V=>$d(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"):(b=(v=this._locales)===null||v===void 0?void 0:v.TEXT_NO_ELEMENTS_FOUND)!==null&&b!==void 0?b:"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-${$a(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?(Lp(this._filterElm,this._autocompleterOptions),this._instance=$m(this._autocompleterOptions)):this._instance=$m({...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=Ie("div",{className:"autocomplete-filter-container"});return N.appendChild(this._filterElm),N.appendChild(Ie("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 Ie("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=Mn(this.gridOptions,o)||"";return Ie("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=Mn(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 jh=["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},dd={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 Ym(a,t){var e;return function(){var n=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return a.apply(n,r)},t)}}var Xh=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 Tu(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function jm(a,t){if(t(a))return a;if(a.parentNode)return jm(a.parentNode,t)}function Ou(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 qh=function(){},Au=function(a,t,e){return e.months[t?"shorthand":"longhand"][a]},tb={D:qh,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:qh,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:qh,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})"},ud={Z:function(a){return a.toISOString()},D:function(a,t,e){return t.weekdays.shorthand[ud.w(a,t,e)]},F:function(a,t,e){return Au(ud.n(a,t,e)-1,!1,t)},G:function(a,t,e){return Nr(ud.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 Au(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)}},Xm=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?dd: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 ud[f]&&v[m-1]!=="\\"?ud[f](l,c,e):f!=="\\"?f:""}).join("")}},Kh=function(a){var t=a.config,e=t===void 0?da:t,n=a.l10n,r=n===void 0?dd: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 b=void 0,C=[],x=0,w=0,E="";x<m.length;x++){var D=m[x],A=D==="\\",F=m[x-1]==="\\"||A;if(Al[D]&&!F){E+=Al[D];var N=new RegExp(E).exec(o);N&&(b=!0)&&C[D!=="Y"?"push":"unshift"]({fn:tb[D],val:N[++w]})}else A||(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=b?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 ib=function(a,t,e){return a>Math.min(t,e)&&a<Math.max(t,e)},Zh=function(a,t,e){return a*3600+t*60+e},nb=function(a){var t=Math.floor(a/3600),e=(a-t*3600)/60;return[t,e,a-t*3600-e*60]},rb={DAY:864e5};function Qh(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)},qm=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},ob=300;function sb(a,t){var e={config:pr(pr({},da),On.defaultConfig),l10n:dd};e.parseDate=Kh({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=m,e._positionCalendar=ne,e.changeMonth=re,e.changeYear=Ce,e.clear=pe,e.close=Ve,e.onMouseOver=Et,e._createElement=Pi,e.createDay=N,e.destroy=Ye,e.isEnabled=be,e.jumpToDate=E,e.updateValue=Kt,e.open=k,e.redraw=fe,e.set=Ne,e.setDate=It,e.toggle=st;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,_e(),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(),rt("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=Qh(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 Se=e._input.value;f(),Kt(),e._input.value!==Se&&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 Se=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Qr(e.latestSelectedDateObj,e.config.minDate,!0)===0,ot=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 mt=Zh(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ct=Zh(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),wt=Zh(U,Z,ce);if(wt>ct&&wt<mt){var Vt=nb(mt);U=Vt[0],Z=Vt[1],ce=Vt[2]}}else{if(ot){var yt=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;U=Math.min(U,yt.getHours()),U===yt.getHours()&&(Z=Math.min(Z,yt.getMinutes())),Z===yt.getMinutes()&&(ce=Math.min(ce,yt.getSeconds()))}if(Se){var gt=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;U=Math.max(U,gt.getHours()),U===gt.getHours()&&Z<gt.getMinutes()&&(Z=gt.getMinutes()),Z===gt.getMinutes()&&(ce=Math.max(ce,gt.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 b(U){var Z=Zr(U),ce=parseInt(Z.value)+(U.delta||0);(ce/1e3>1||U.key==="Enter"&&!/[^\d]/.test(ce.toString()))&&Ce(ce)}function C(U,Z,ce,Se){if(Z instanceof Array)return Z.forEach(function(ot){return C(U,ot,ce,Se)});if(U instanceof Array)return U.forEach(function(ot){return C(ot,Z,ce,Se)});U.addEventListener(Z,ce,Se),e._handlers.push({remove:function(){return U.removeEventListener(Z,ce,Se)}})}function x(){rt("onChange")}function w(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(ce){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+ce+"]"),function(Se){return C(Se,"click",e[ce])})}),e.isMobile){ke();return}var U=Ym(at,50);if(e._debouncedChange=Ym(x,ob),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(ce){e.config.mode==="range"&&Et(Zr(ce))}),C(e._input,"keydown",Ge),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",Ge),!e.config.inline&&!e.config.static&&C(window,"resize",U),window.ontouchstart!==void 0?C(window.document,"touchstart",ue):C(window.document,"mousedown",ue),C(window.document,"focus",ue,{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"],b),C(e.daysContainer,"click",ft)),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",D),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",nt)}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),Se=e.currentYear,ot=e.currentMonth;try{ce!==void 0&&(e.currentYear=ce.getFullYear(),e.currentMonth=ce.getMonth())}catch(mt){mt.message="Invalid date supplied: "+ce,e.config.errorHandler(mt)}Z&&e.currentYear!==Se&&(rt("onYearChange"),z()),Z&&(e.currentYear!==Se||e.currentMonth!==ot)&&rt("onMonthChange"),e.redraw()}function D(U){var Z=Zr(U);~Z.className.indexOf("arrow")&&A(U,Z.classList.contains("arrowUp")?1:-1)}function A(U,Z,ce){var Se=U&&Zr(U),ot=ce||Se&&Se.parentNode&&Se.parentNode.firstChild,mt=ut("increment");mt.delta=Z,ot&&ot.dispatchEvent(mt)}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=De(),ce=Z.weekWrapper,Se=Z.weekNumbers;e.innerContainer.appendChild(ce),e.weekNumbers=Se,e.weekWrapper=ce}e.rContainer=Pi("div","flatpickr-rContainer"),e.rContainer.appendChild(xe()),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(Re()),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 ot=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&&(!ot&&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 mt=Pi("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(mt,e.element),mt.appendChild(e.element),e.altInput&&mt.appendChild(e.altInput),mt.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,Se){var ot=be(Z,!0),mt=Pi("span",U,Z.getDate().toString());return mt.dateObj=Z,mt.$i=Se,mt.setAttribute("aria-label",e.formatDate(Z,e.config.ariaDateFormat)),U.indexOf("hidden")===-1&&Qr(Z,e.now)===0&&(e.todayDateElem=mt,mt.classList.add("today"),mt.setAttribute("aria-current","date")),ot?(mt.tabIndex=-1,Rt(Z)&&(mt.classList.add("selected"),e.selectedDateElem=mt,e.config.mode==="range"&&(wr(mt,"startRange",e.selectedDates[0]&&Qr(Z,e.selectedDates[0],!0)===0),wr(mt,"endRange",e.selectedDates[1]&&Qr(Z,e.selectedDates[1],!0)===0),U==="nextMonthDay"&&mt.classList.add("inRange")))):mt.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Ht(Z)&&!Rt(Z)&&mt.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&U!=="prevMonthDay"&&Se%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(Z)+"</span>"),rt("onDayCreate",mt),mt}function V(U){U.focus(),e.config.mode==="range"&&Et(U)}function Q(U){for(var Z=U>0?0:e.config.showMonths-1,ce=U>0?e.config.showMonths:-1,Se=Z;Se!=ce;Se+=U)for(var ot=e.daysContainer.children[Se],mt=U>0?0:ot.children.length-1,ct=U>0?ot.children.length:-1,wt=mt;wt!=ct;wt+=U){var Vt=ot.children[wt];if(Vt.className.indexOf("hidden")===-1&&be(Vt.dateObj))return Vt}}function L(U,Z){for(var ce=U.className.indexOf("Month")===-1?U.dateObj.getMonth():e.currentMonth,Se=Z>0?e.config.showMonths:-1,ot=Z>0?1:-1,mt=ce-e.currentMonth;mt!=Se;mt+=ot)for(var ct=e.daysContainer.children[mt],wt=ce-e.currentMonth===mt?U.$i+Z:Z<0?ct.children.length-1:0,Vt=ct.children.length,yt=wt;yt>=0&&yt<Vt&&yt!=(Z>0?Vt:-1);yt+=ot){var gt=ct.children[yt];if(gt.className.indexOf("hidden")===-1&&be(gt.dateObj)&&Math.abs(U.$i-yt)>=Math.abs(Z))return V(gt)}e.changeMonth(ot),le(Q(ot),0)}function le(U,Z){var ce=o(),Se=Le(ce||document.body),ot=U!==void 0?U:Se?ce:e.selectedDateElem!==void 0&&Le(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Le(e.todayDateElem)?e.todayDateElem:Q(Z>0?1:-1);ot===void 0?e._input.focus():Se?L(ot,Z):V(ot)}function ve(U,Z){for(var ce=(new Date(U,Z,1).getDay()-e.l10n.firstDayOfWeek+7)%7,Se=e.utils.getDaysInMonth((Z-1+12)%12,U),ot=e.utils.getDaysInMonth(Z,U),mt=window.document.createDocumentFragment(),ct=e.config.showMonths>1,wt=ct?"prevMonthDay hidden":"prevMonthDay",Vt=ct?"nextMonthDay hidden":"nextMonthDay",yt=Se+1-ce,gt=0;yt<=Se;yt++,gt++)mt.appendChild(N("flatpickr-day "+wt,new Date(U,Z-1,yt),yt,gt));for(yt=1;yt<=ot;yt++,gt++)mt.appendChild(N("flatpickr-day",new Date(U,Z,yt),yt,gt));for(var Zt=ot+1;Zt<=42-ce&&(e.config.showMonths===1||gt%7!==0);Zt++,gt++)mt.appendChild(N("flatpickr-day "+Vt,new Date(U,Z+1,Zt%ot),Zt,gt));var Ii=Pi("div","dayContainer");return Ii.appendChild(mt),Ii}function J(){if(e.daysContainer!==void 0){Tu(e.daysContainer),e.weekNumbers&&Tu(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(ve(ce.getFullYear(),ce.getMonth()))}e.daysContainer.appendChild(U),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&Et()}}function z(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var U=function(Se){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&Se<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&Se>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=Au(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(ct){var wt=Zr(ct),Vt=parseInt(wt.value,10);e.changeMonth(Vt-e.currentMonth),rt("onMonthChange")}),z(),ce=e.monthsDropdownContainer);var Se=Ou("cur-year",{tabindex:"-1"}),ot=Se.getElementsByTagName("input")[0];ot.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&ot.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(ot.setAttribute("max",e.config.maxDate.getFullYear().toString()),ot.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var mt=Pi("div","flatpickr-current-month");return mt.appendChild(ce),mt.appendChild(Se),Z.appendChild(mt),U.appendChild(Z),{container:U,yearElement:ot,monthElement:ce}}function ae(){Tu(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,ae(),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 Re(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var U=Qh(e.config);e.timeContainer=Pi("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var Z=Pi("span","flatpickr-time-separator",":"),ce=Ou("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=ce.getElementsByTagName("input")[0];var Se=Ou("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=Se.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(Se),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var ot=Ou("flatpickr-second");e.secondElement=ot.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(ot)}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 xe(){e.weekdayContainer?Tu(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 Oe(),e.weekdayContainer}function Oe(){if(e.weekdayContainer){var U=e.l10n.firstDayOfWeek,Z=qm(e.l10n.weekdays.shorthand);U>0&&U<Z.length&&(Z=qm(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>
|
|
22
22
|
`}}function De(){e.calendarContainer.classList.add("hasWeeks");var U=Pi("div","flatpickr-weekwrapper");U.appendChild(Pi("span","flatpickr-weekday",e.l10n.weekAbbreviation));var Z=Pi("div","flatpickr-weeks");return U.appendChild(Z),{weekWrapper:U,weekNumbers:Z}}function re(U,Z){Z===void 0&&(Z=!0);var ce=Z?U:U-e.currentMonth;ce<0&&e._hidePrevMonthArrow===!0||ce>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=ce,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,rt("onYearChange"),z()),J(),rt("onMonthChange"),Tt())}function pe(U,Z){if(U===void 0&&(U=!0),Z===void 0&&(Z=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,Z===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var ce=Qh(e.config),Se=ce.hours,ot=ce.minutes,mt=ce.seconds;v(Se,ot,mt)}e.redraw(),U&&rt("onChange")}function Ve(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),rt("onClose")}function Ye(){e.config!==void 0&&rt("onDestroy");for(var U=e._handlers.length;U--;)e._handlers[U].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var Z=e.calendarContainer.parentNode;if(Z.lastChild&&Z.removeChild(Z.lastChild),Z.parentNode){for(;Z.firstChild;)Z.parentNode.insertBefore(Z.firstChild,Z);Z.parentNode.removeChild(Z)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ce){try{delete e[ce]}catch{}})}function Be(U){return e.calendarContainer.contains(U)}function ue(U){if(e.isOpen&&!e.config.inline){var Z=Zr(U),ce=Be(Z),Se=Z===e.input||Z===e.altInput||e.element.contains(Z)||U.path&&U.path.indexOf&&(~U.path.indexOf(e.input)||~U.path.indexOf(e.altInput)),ot=!Se&&!ce&&!Be(U.relatedTarget),mt=!e.config.ignoredFocusElements.some(function(ct){return ct.contains(Z)});ot&&mt&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function Ce(U){if(!(!U||e.config.minDate&&U<e.config.minDate.getFullYear()||e.config.maxDate&&U>e.config.maxDate.getFullYear())){var Z=U,ce=e.currentYear!==Z;e.currentYear=Z||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),ce&&(e.redraw(),rt("onYearChange"),z())}}function be(U,Z){var ce;Z===void 0&&(Z=!0);var Se=e.parseDate(U,void 0,Z);if(e.config.minDate&&Se&&Qr(Se,e.config.minDate,Z!==void 0?Z:!e.minDateHasTime)<0||e.config.maxDate&&Se&&Qr(Se,e.config.maxDate,Z!==void 0?Z:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(Se===void 0)return!1;for(var ot=!!e.config.enable,mt=(ce=e.config.enable)!==null&&ce!==void 0?ce:e.config.disable,ct=0,wt=void 0;ct<mt.length;ct++){if(wt=mt[ct],typeof wt=="function"&&wt(Se))return ot;if(wt instanceof Date&&Se!==void 0&&wt.getTime()===Se.getTime())return ot;if(typeof wt=="string"){var Vt=e.parseDate(wt,void 0,!0);return Vt&&Vt.getTime()===Se.getTime()?ot:!ot}else if(typeof wt=="object"&&Se!==void 0&&wt.from&&wt.to&&Se.getTime()>=wt.from.getTime()&&Se.getTime()<=wt.to.getTime())return ot}return!ot}function Le(U){return e.daysContainer!==void 0?U.className.indexOf("hidden")===-1&&U.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(U):!1}function nt(U){var Z=U.target===e._input,ce=e._input.value.trimEnd()!==Ut();Z&&ce&&!(U.relatedTarget&&Be(U.relatedTarget))&&e.setDate(e._input.value,!0,U.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Ge(U){var Z=Zr(U),ce=e.config.wrap?a.contains(Z):Z===e._input,Se=e.config.allowInput,ot=e.isOpen&&(!Se||!ce),mt=e.config.inline&&ce&&!Se;if(U.keyCode===13&&ce){if(Se)return e.setDate(e._input.value,!0,Z===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),Z.blur();e.open()}else if(Be(Z)||ot||mt){var ct=!!e.timeContainer&&e.timeContainer.contains(Z);switch(U.keyCode){case 13:ct?(U.preventDefault(),u(),Ue()):ft(U);break;case 27:U.preventDefault(),Ue();break;case 8:case 46:ce&&!e.config.allowInput&&(U.preventDefault(),e.clear());break;case 37:case 39:if(!ct&&!ce){U.preventDefault();var wt=o();if(e.daysContainer!==void 0&&(Se===!1||wt&&Le(wt))){var Vt=U.keyCode===39?1:-1;U.ctrlKey?(U.stopPropagation(),re(Vt),le(Q(1),0)):le(void 0,Vt)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:U.preventDefault();var yt=U.keyCode===40?1:-1;e.daysContainer&&Z.$i!==void 0||Z===e.input||Z===e.altInput?U.ctrlKey?(U.stopPropagation(),Ce(e.currentYear-yt),le(Q(1),0)):ct||le(void 0,yt*7):Z===e.currentYearElement?Ce(e.currentYear-yt):e.config.enableTime&&(!ct&&e.hourElement&&e.hourElement.focus(),u(U),e._debouncedChange());break;case 9:if(ct){var gt=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Gi){return Gi}),Zt=gt.indexOf(Z);if(Zt!==-1){var Ii=gt[Zt+(U.shiftKey?-1:1)];U.preventDefault(),(Ii||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(Z)&&U.shiftKey&&(U.preventDefault(),e._input.focus());break}}if(e.amPM!==void 0&&Z===e.amPM)switch(U.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],f(),Kt();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],f(),Kt();break}(ce||Be(Z))&&rt("onKeyDown",U)}function Et(U,Z){if(Z===void 0&&(Z="flatpickr-day"),!(e.selectedDates.length!==1||U&&(!U.classList.contains(Z)||U.classList.contains("flatpickr-disabled")))){for(var ce=U?U.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),Se=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),ot=Math.min(ce,e.selectedDates[0].getTime()),mt=Math.max(ce,e.selectedDates[0].getTime()),ct=!1,wt=0,Vt=0,yt=ot;yt<mt;yt+=rb.DAY)be(new Date(yt),!0)||(ct=ct||yt>ot&&yt<mt,yt<Se&&(!wt||yt>wt)?wt=yt:yt>Se&&(!Vt||yt<Vt)&&(Vt=yt));var gt=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+Z));gt.forEach(function(Zt){var Ii=Zt.dateObj,Gi=Ii.getTime(),Qt=wt>0&&Gi<wt||Vt>0&&Gi>Vt;if(Qt){Zt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Hi){Zt.classList.remove(Hi)});return}else if(ct&&!Qt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Hi){Zt.classList.remove(Hi)}),U!==void 0&&(U.classList.add(ce<=e.selectedDates[0].getTime()?"startRange":"endRange"),Se<ce&&Gi===Se?Zt.classList.add("startRange"):Se>ce&&Gi===Se&&Zt.classList.add("endRange"),Gi>=wt&&(Vt===0||Gi<=Vt)&&ib(Gi,Se,ce)&&Zt.classList.add("inRange"))})}}function at(){e.isOpen&&!e.config.static&&!e.config.inline&&ne()}function k(U,Z){if(Z===void 0&&(Z=e._positionElement),e.isMobile===!0){if(U){U.preventDefault();var ce=Zr(U);ce&&ce.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),rt("onOpen");return}else if(e._input.disabled||e.config.inline)return;var Se=e.isOpen;e.isOpen=!0,Se||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),rt("onOpen"),ne(Z)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(U===void 0||!e.timeContainer.contains(U.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function te(U){return function(Z){var ce=e.config["_"+U+"Date"]=e.parseDate(Z,e.config.dateFormat),Se=e.config["_"+(U==="min"?"max":"min")+"Date"];ce!==void 0&&(e[U==="min"?"minDateHasTime":"maxDateHasTime"]=ce.getHours()>0||ce.getMinutes()>0||ce.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(ot){return be(ot)}),!e.selectedDates.length&&U==="min"&&m(ce),Kt()),e.daysContainer&&(fe(),ce!==void 0?e.currentYearElement[U]=ce.getFullYear().toString():e.currentYearElement.removeAttribute(U),e.currentYearElement.disabled=!!Se&&ce!==void 0&&Se.getFullYear()===ce.getFullYear())}}function _e(){var U=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Z=pr(pr({},JSON.parse(JSON.stringify(a.dataset||{}))),t),ce={};e.config.parseDate=Z.parseDate,e.config.formatDate=Z.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(gt){e.config._enable=yi(gt)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(gt){e.config._disable=yi(gt)}});var Se=Z.mode==="time";if(!Z.dateFormat&&(Z.enableTime||Se)){var ot=On.defaultConfig.dateFormat||da.dateFormat;ce.dateFormat=Z.noCalendar||Se?"H:i"+(Z.enableSeconds?":S":""):ot+" H:i"+(Z.enableSeconds?":S":"")}if(Z.altInput&&(Z.enableTime||Se)&&!Z.altFormat){var mt=On.defaultConfig.altFormat||da.altFormat;ce.altFormat=Z.noCalendar||Se?"h:i"+(Z.enableSeconds?":S K":" K"):mt+(" h:i"+(Z.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:te("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:te("max")});var ct=function(gt){return function(Zt){e.config[gt==="min"?"_minTime":"_maxTime"]=e.parseDate(Zt,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:ct("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:ct("max")}),Z.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,ce,Z);for(var wt=0;wt<U.length;wt++)e.config[U[wt]]=e.config[U[wt]]===!0||e.config[U[wt]]==="true";jh.filter(function(gt){return e.config[gt]!==void 0}).forEach(function(gt){e.config[gt]=Xh(e.config[gt]||[]).map(s)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var wt=0;wt<e.config.plugins.length;wt++){var Vt=e.config.plugins[wt](e)||{};for(var yt in Vt)jh.indexOf(yt)>-1?e.config[yt]=Xh(Vt[yt]).map(s).concat(e.config[yt]):typeof Z[yt]>"u"&&(e.config[yt]=Vt[yt])}Z.altInputClass||(e.config.altInputClass=$().className+" "+e.config.altInputClass),rt("onParseConfig")}function $(){return e.config.wrap?a.querySelector("[data-input]"):a}function X(){typeof e.config.locale!="object"&&typeof On.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=pr(pr({},On.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?On.l10ns[e.config.locale]:void 0),Al.D="("+e.l10n.weekdays.shorthand.join("|")+")",Al.l="("+e.l10n.weekdays.longhand.join("|")+")",Al.M="("+e.l10n.months.shorthand.join("|")+")",Al.F="("+e.l10n.months.longhand.join("|")+")",Al.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var U=pr(pr({},t),JSON.parse(JSON.stringify(a.dataset||{})));U.time_24hr===void 0&&On.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Xm(e),e.parseDate=Kh({config:e.config,l10n:e.l10n})}function ne(U){if(typeof e.config.position=="function")return void e.config.position(e,U);if(e.calendarContainer!==void 0){rt("onPreCalendarPosition");var Z=U||e._positionElement,ce=Array.prototype.reduce.call(e.calendarContainer.children,function(vn,pi){return vn+pi.offsetHeight},0),Se=e.calendarContainer.offsetWidth,ot=e.config.position.split(" "),mt=ot[0],ct=ot.length>1?ot[1]:null,wt=Z.getBoundingClientRect(),Vt=window.innerHeight-wt.bottom,yt=mt==="above"||mt!=="below"&&Vt<ce&&wt.top>ce,gt=window.pageYOffset+wt.top+(yt?-ce-2:Z.offsetHeight+2);if(wr(e.calendarContainer,"arrowTop",!yt),wr(e.calendarContainer,"arrowBottom",yt),!e.config.inline){var Zt=window.pageXOffset+wt.left,Ii=!1,Gi=!1;ct==="center"?(Zt-=(Se-wt.width)/2,Ii=!0):ct==="right"&&(Zt-=Se-wt.width,Gi=!0),wr(e.calendarContainer,"arrowLeft",!Ii&&!Gi),wr(e.calendarContainer,"arrowCenter",Ii),wr(e.calendarContainer,"arrowRight",Gi);var Qt=window.document.body.offsetWidth-(window.pageXOffset+wt.right),Hi=Zt+Se>window.document.body.offsetWidth,Ln=Qt+Se>window.document.body.offsetWidth;if(wr(e.calendarContainer,"rightMost",Hi),!e.config.static)if(e.calendarContainer.style.top=gt+"px",!Hi)e.calendarContainer.style.left=Zt+"px",e.calendarContainer.style.right="auto";else if(!Ln)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Qt+"px";else{var mn=Pe();if(mn===void 0)return;var bt=window.document.body.offsetWidth,ye=Math.max(0,bt/2-Se/2),Xe=".flatpickr-calendar.centerMost:before",pt=".flatpickr-calendar.centerMost:after",Jt=mn.cssRules.length,Mi="{left:"+wt.left+"px;right:auto;}";wr(e.calendarContainer,"rightMost",!1),wr(e.calendarContainer,"centerMost",!0),mn.insertRule(Xe+","+pt+Mi,Jt),e.calendarContainer.style.left=ye+"px",e.calendarContainer.style.right="auto"}}}}function Pe(){for(var U=null,Z=0;Z<document.styleSheets.length;Z++){var ce=document.styleSheets[Z];if(ce.cssRules){try{ce.cssRules}catch{continue}U=ce;break}}return U??Me()}function Me(){var U=document.createElement("style");return document.head.appendChild(U),U.sheet}function fe(){e.config.noCalendar||e.isMobile||(z(),Tt(),J())}function Ue(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function ft(U){U.preventDefault(),U.stopPropagation();var Z=function(gt){return gt.classList&>.classList.contains("flatpickr-day")&&!gt.classList.contains("flatpickr-disabled")&&!gt.classList.contains("notAllowed")},ce=jm(Zr(U),Z);if(ce!==void 0){var Se=ce,ot=e.latestSelectedDateObj=new Date(Se.dateObj.getTime()),mt=(ot.getMonth()<e.currentMonth||ot.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=Se,e.config.mode==="single")e.selectedDates=[ot];else if(e.config.mode==="multiple"){var ct=Rt(ot);ct?e.selectedDates.splice(parseInt(ct),1):e.selectedDates.push(ot)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=ot,e.selectedDates.push(ot),Qr(ot,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(gt,Zt){return gt.getTime()-Zt.getTime()}));if(f(),mt){var wt=e.currentYear!==ot.getFullYear();e.currentYear=ot.getFullYear(),e.currentMonth=ot.getMonth(),wt&&(rt("onYearChange"),z()),rt("onMonthChange")}if(Tt(),J(),Kt(),!mt&&e.config.mode!=="range"&&e.config.showMonths===1?V(Se):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var Vt=e.config.mode==="single"&&!e.config.enableTime,yt=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(Vt||yt)&&Ue()}x()}}var ze={locale:[X,Oe],showMonths:[ae,l,xe],minDate:[E],maxDate:[E],positionElement:[me],clickOpens:[function(){e.config.clickOpens===!0?(C(e._input,"focus",e.open),C(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Ne(U,Z){if(U!==null&&typeof U=="object"){Object.assign(e.config,U);for(var ce in U)ze[ce]!==void 0&&ze[ce].forEach(function(Se){return Se()})}else e.config[U]=Z,ze[U]!==void 0?ze[U].forEach(function(Se){return Se()}):jh.indexOf(U)>-1&&(e.config[U]=Xh(Z));e.redraw(),Kt(!0)}function Xt(U,Z){var ce=[];if(U instanceof Array)ce=U.map(function(Se){return e.parseDate(Se,Z)});else if(U instanceof Date||typeof U=="number")ce=[e.parseDate(U,Z)];else if(typeof U=="string")switch(e.config.mode){case"single":case"time":ce=[e.parseDate(U,Z)];break;case"multiple":ce=U.split(e.config.conjunction).map(function(Se){return e.parseDate(Se,Z)});break;case"range":ce=U.split(e.l10n.rangeSeparator).map(function(Se){return e.parseDate(Se,Z)});break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(U)));e.selectedDates=e.config.allowInvalidPreload?ce:ce.filter(function(Se){return Se instanceof Date&&be(Se,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(Se,ot){return Se.getTime()-ot.getTime()})}function It(U,Z,ce){if(Z===void 0&&(Z=!1),ce===void 0&&(ce=e.config.dateFormat),U!==0&&!U||U instanceof Array&&U.length===0)return e.clear(Z);Xt(U,ce),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),E(void 0,Z),m(),e.selectedDates.length===0&&e.clear(!1),Kt(Z),Z&&rt("onChange")}function yi(U){return U.slice().map(function(Z){return typeof Z=="string"||typeof Z=="number"||Z instanceof Date?e.parseDate(Z,void 0,!0):Z&&typeof Z=="object"&&Z.from&&Z.to?{from:e.parseDate(Z.from,void 0),to:e.parseDate(Z.to,void 0)}:Z}).filter(function(Z){return Z})}function q(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var U=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);U&&Xt(U,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function W(){if(e.input=$(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Pi(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),me()}function me(){e._positionElement=e.config.positionElement||e._input}function ke(){var U=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Pi("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=U,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=U==="datetime-local"?"Y-m-d\\TH:i:S":U==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}C(e.mobileInput,"change",function(Z){e.setDate(Zr(Z).value,!1,e.mobileFormatStr),rt("onChange"),rt("onClose")})}function st(U){if(e.isOpen===!0)return e.close();e.open(U)}function rt(U,Z){if(e.config!==void 0){var ce=e.config[U];if(ce!==void 0&&ce.length>0)for(var Se=0;ce[Se]&&Se<ce.length;Se++)ce[Se](e.selectedDates,e.input.value,e,Z);U==="onChange"&&(e.input.dispatchEvent(ut("change")),e.input.dispatchEvent(ut("input")))}}function ut(U){var Z=document.createEvent("Event");return Z.initEvent(U,!0,!0),Z}function Rt(U){for(var Z=0;Z<e.selectedDates.length;Z++){var ce=e.selectedDates[Z];if(ce instanceof Date&&Qr(ce,U)===0)return""+Z}return!1}function Ht(U){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Qr(U,e.selectedDates[0])>=0&&Qr(U,e.selectedDates[1])<=0}function Tt(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(U,Z){var ce=new Date(e.currentYear,e.currentMonth,1);ce.setMonth(e.currentMonth+Z),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[Z].textContent=Au(ce.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=ce.getMonth().toString(),U.value=ce.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ut(U){var Z=U||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(ce){return e.formatDate(ce,Z)}).filter(function(ce,Se,ot){return e.config.mode!=="range"||e.config.enableTime||ot.indexOf(ce)===Se}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Kt(U){U===void 0&&(U=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ut(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ut(e.config.altFormat)),U!==!1&&rt("onValueUpdate")}function Ni(U){var Z=Zr(U),ce=e.prevMonthNav.contains(Z),Se=e.nextMonthNav.contains(Z);ce||Se?re(ce?-1:1):e.yearElements.indexOf(Z)>=0?Z.select():Z.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):Z.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Li(U){U.preventDefault();var Z=U.type==="keydown",ce=Zr(U),Se=ce;e.amPM!==void 0&&ce===e.amPM&&(e.amPM.textContent=e.l10n.amPM[mo(e.amPM.textContent===e.l10n.amPM[0])]);var ot=parseFloat(Se.getAttribute("min")),mt=parseFloat(Se.getAttribute("max")),ct=parseFloat(Se.getAttribute("step")),wt=parseInt(Se.value,10),Vt=U.delta||(Z?U.which===38?1:-1:0),yt=wt+ct*Vt;if(typeof Se.value<"u"&&Se.value.length===2){var gt=Se===e.hourElement,Zt=Se===e.minuteElement;yt<ot?(yt=mt+yt+mo(!gt)+(mo(gt)&&mo(!e.amPM)),Zt&&A(void 0,-1,e.hourElement)):yt>mt&&(yt=Se===e.hourElement?yt-mt-mo(!e.amPM):ot,Zt&&A(void 0,1,e.hourElement)),e.amPM&>&&(ct===1?yt+wt===23:Math.abs(yt-wt)>ct)&&(e.amPM.textContent=e.l10n.amPM[mo(e.amPM.textContent===e.l10n.amPM[0])]),Se.value=Nr(yt)}}return r(),e}function ua(a,t){for(var e=Array.prototype.slice.call(a).filter(function(s){return s instanceof HTMLElement}),n=[],r=0;r<e.length;r++){var o=e[r];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=sb(o,t||{}),n.push(o._flatpickr)}catch(s){console.error(s)}}return n.length===1?n[0]:n}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(a){return ua(this,a)},HTMLElement.prototype.flatpickr=function(a){return ua([this],a)});var On=function(a,t){return typeof a=="string"?ua(window.document.querySelectorAll(a),t):a instanceof Node?ua([a],t):ua(a,t)};On.defaultConfig={},On.l10ns={en:pr({},dd),default:pr({},dd)},On.localize=function(a){On.l10ns.default=pr(pr({},On.l10ns.default),a)},On.setDefaults=function(a){On.defaultConfig=pr(pr({},On.defaultConfig),a)},On.parseDate=Kh({}),On.formatDate=Xm({}),On.compareDates=Qr,typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(a){return ua(this,a)}),Date.prototype.fp_incr=function(a){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof a=="string"?parseInt(a,10):a))},typeof window<"u"&&(window.flatpickr=On);const cd=Object.freeze(Object.defineProperty({__proto__:null,default:On},Symbol.toStringTag,{value:"Module"}));var Jh,ef;const lb=(Jh=cd==null?void 0:On)!==null&&Jh!==void 0?Jh:cd,Km=(ef=ms==null?void 0:Ys)!==null&&ef!==void 0?ef:ms;class Zm{constructor(t){this.translaterService=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.inputFilterType="range",this.searchTerms=[],this._bindEventService=new Pn}get gridOptions(){return this.grid&&this.grid.getOptions?this.grid.getOptions():{}}get columnFilter(){return this.columnDef&&this.columnDef.filter||{}}get currentDateOrDates(){return this._currentDateOrDates}get defaultOperator(){return this.inputFilterType==="compound"?Lt.empty:this.gridOptions.defaultFilterRangeOperator||Lt.rangeInclusive}get flatpickrOptions(){return this._flatpickrOptions||{}}get operator(){var t,e;return this.inputFilterType==="compound"?this._operator||this.columnFilter.operator||this.defaultOperator:(e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator}set operator(t){this.inputFilterType==="compound"?this._operator=t:this.columnFilter&&(this.columnFilter.operator=t)}init(t){var e;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.inputFilterType==="compound"&&(this.operator=t.operator||""),this.searchTerms=(e=t==null?void 0:t.searchTerms)!==null&&e!==void 0?e:[],this.filterContainerElm=t.filterContainerElm;const n=this.inputFilterType==="compound"?Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"":this.searchTerms;this._filterElm=this.createDomFilterElement(n),this._bindEventService.bind(this._filterDivInputElm,"keyup",this.onTriggerEvent.bind(this)),this._selectOperatorElm&&this._bindEventService.bind(this._selectOperatorElm,"change",this.onTriggerEvent.bind(this))}clear(t=!0){this.flatInstance&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[],this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0),this.flatInstance.input&&this.flatInstance.clear()),this._filterElm.classList.remove("filled"),this._filterDivInputElm.classList.remove("filled")}destroy(){var t,e,n,r,o;this._bindEventService.unbindAll(),typeof((t=this.flatInstance)===null||t===void 0?void 0:t.destroy)=="function"&&(this.flatInstance.destroy(),this.flatInstance.element&&_h(this.flatInstance)),tn(this.filterContainerElm),tn(this._filterDivInputElm),(e=this._filterDivInputElm)===null||e===void 0||e.remove(),(n=this.filterContainerElm)===null||n===void 0||n.remove(),(r=this._selectOperatorElm)===null||r===void 0||r.remove(),(o=this._filterElm)===null||o===void 0||o.remove()}hide(){var t;typeof((t=this.flatInstance)===null||t===void 0?void 0:t.close)=="function"&&this.flatInstance.close()}show(){var t;typeof((t=this.flatInstance)===null||t===void 0?void 0:t.open)=="function"&&this.flatInstance.open()}getValues(){return this._currentDateOrDates}setValues(t,e){let n;this.inputFilterType==="compound"?n=Array.isArray(t)?t[0]:t:typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"&&t[0].indexOf("..")>0?n=typeof t=="string"?[t]:t[0].split(".."):Array.isArray(t)&&(n=t),this.flatInstance&&(this._currentDateOrDates=t&&n?n:void 0,this.flatInstance.setDate(this._currentDateOrDates||""));const r=this.getValues()||[];if(this.getValues()||Array.isArray(r)&&r.length>0&&t?(this._filterElm.classList.add("filled"),this._filterDivInputElm.classList.add("filled")):(this._filterElm.classList.remove("filled"),this._filterDivInputElm.classList.remove("filled")),this.operator=e||this.defaultOperator,e&&this._selectOperatorElm){const o=Ql(this.operator);this._selectOperatorElm.value=o}}buildDatePickerInput(t){var e,n,r,o,s,l,u,p,c,f;const m=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",v=Ga(this.columnFilter.type||this.columnDef.type||ie.dateIso),b=Ga(this.columnDef.outputType||this.columnFilter.type||this.columnDef.type||ie.dateUtc),C=(o=(r=this.columnFilter)===null||r===void 0?void 0:r.filterOptions)!==null&&o!==void 0?o:{};let x=((s=C==null?void 0:C.locale)!==null&&s!==void 0?s:(u=(l=this.translaterService)===null||l===void 0?void 0:l.getCurrentLanguage)===null||u===void 0?void 0:u.call(l))||this.gridOptions.locale||"en";(x==null?void 0:x.length)>2&&(x=x.substring(0,2));let w;if(this.inputFilterType==="compound")t&&(w=t,this._currentDateOrDates=t);else if(typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"&&t[0].indexOf("..")>0?w=typeof t=="string"?[t]:t[0].split(".."):Array.isArray(t)&&(w=t),Array.isArray(w)){this._currentDateOrDates=w;const F=Fr(this.columnFilter.type||this.columnDef.type||ie.dateIso);this._currentDateStrings=w.map(N=>Km(N).format(F))}const E={defaultDate:w||"",altInput:!0,altFormat:b,dateFormat:v,mode:this.inputFilterType==="range"?"range":"single",wrap:!0,closeOnSelect:!0,locale:x,onChange:(F,N)=>{if(this.inputFilterType==="compound")this._currentValue=N,this._currentDateOrDates=Array.isArray(F)&&F[0]||void 0;else if(Array.isArray(F)){this._currentDateOrDates=F;const Q=Fr(this.columnDef.outputType||this.columnFilter.type||this.columnDef.type||ie.dateIso);this._currentDateStrings=F.map(L=>Km(L).format(Q)),this._currentValue=this._currentDateStrings.join("..")}const V=E.enableTime?new Event("keyup"):void 0;this.onTriggerEvent(V)},errorHandler:F=>{F.toString().includes("invalid locale")&&console.warn(`[Slickgrid-Universal] Flatpickr missing locale imports (${x}), will revert to English as the default locale.
|
|
23
|
-
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';`)}};b&&(b==="Z"||b.toLowerCase().includes("h"))&&(E.enableTime=!0),this._flatpickrOptions={...E,...C};let D=(c=(p=this.gridOptions)===null||p===void 0?void 0:p.defaultFilterPlaceholder)!==null&&c!==void 0?c:"";!((f=this.columnFilter)===null||f===void 0)&&f.placeholder&&(D=this.columnFilter.placeholder);const A=Ie("div",{className:"flatpickr"});return this.inputFilterType==="range"&&A.classList.add("search-filter",`filter-${m}`),A.appendChild(Ie("input",{type:"text",className:"form-control",placeholder:D,dataset:{input:"",columnid:`${m}`}})),this.flatInstance=lb(A,this._flatpickrOptions),A}getOperatorOptionValues(){var t;return!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList?this.columnFilter.compoundOperatorList:Yh(this.gridOptions,this.translaterService)}createDomFilterElement(t){var e,n;const r=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"";if(tn(this.filterContainerElm),this._filterDivInputElm=this.buildDatePickerInput(t),this.inputFilterType==="range")return Array.isArray(t)&&t.length>0&&t[0]!==""&&(this._filterDivInputElm.classList.add("filled"),this._currentDateOrDates=t,this._currentValue=t[0]),this._filterDivInputElm&&this.filterContainerElm.appendChild(this._filterDivInputElm),this._filterDivInputElm;{this._selectOperatorElm=$h(this.getOperatorOptionValues(),this.gridOptions);const o=Ie("div",{className:`form-group search-filter filter-${r}`}),s=Ie("div",{className:"input-group flatpickr"},o);if(Ie("div",{className:"input-group-addon input-group-prepend operator"},s).appendChild(this._selectOperatorElm),s.appendChild(this._filterDivInputElm),this.operator){const u=Ql(this.operator);this._selectOperatorElm.value=u}return t!==""&&(this._filterDivInputElm.classList.add("filled"),this._currentDateOrDates=t,this._currentValue=t),o&&this.filterContainerElm.appendChild(o),o}}onTriggerEvent(t){var e,n;if(this._clearFilterTriggered)this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterElm.classList.remove("filled");else if(this.inputFilterType==="range")this._currentDateStrings?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.callback(t,{columnDef:this.columnDef,searchTerms:this._currentDateStrings?this._currentDateStrings:[this._currentValue],operator:this.operator||"",shouldTriggerQuery:this._shouldTriggerQuery});else if(this.inputFilterType==="compound"&&this._selectOperatorElm){const r=this._selectOperatorElm.value;this._currentValue?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),(!((n=(e=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&e!==void 0?e:this.gridOptions.skipCompoundOperatorFilterWithNullInput)!==null&&n!==void 0?n:this.gridOptions.skipCompoundOperatorFilterWithNullInput===void 0)||this._currentDateOrDates!==void 0)&&this.callback(t,{columnDef:this.columnDef,searchTerms:this._currentValue?[this._currentValue]:null,operator:r||"",shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}}class ab extends Zm{constructor(t){super(t),this.translaterService=t,this.inputFilterType="compound"}}class Qs{constructor(t){this.translaterService=t,this._debounceTypingDelay=0,this._shouldTriggerQuery=!0,this._inputType="text",this.inputFilterType="single",this.searchTerms=[],this._bindEventService=new Pn}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.empty}get inputType(){return this._inputType}set inputType(t){this._inputType=t}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)}get gridOptions(){var t,e;return(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions())!==null&&e!==void 0?e:{}}init(t){var e,n,r,o,s,l;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.inputFilterType==="compound"&&(this.operator=t.operator||""),this.searchTerms=(e=t==null?void 0:t.searchTerms)!==null&&e!==void 0?e:[],this._cellContainerElm=t.filterContainerElm;const u=(n=this.gridOptions)===null||n===void 0?void 0:n.backendServiceApi;this._debounceTypingDelay=(l=u?(r=u==null?void 0:u.filterTypingDebounce)!==null&&r!==void 0?r:(o=this.gridOptions)===null||o===void 0?void 0:o.defaultBackendServiceFilterTypingDebounce:(s=this.gridOptions)===null||s===void 0?void 0:s.filterTypingDebounce)!==null&&l!==void 0?l:0;const p=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this.createDomFilterElement(p),this._bindEventService.bind(this._filterInputElm,["keyup","blur","change"],this.onTriggerEvent.bind(this)),this._bindEventService.bind(this._filterInputElm,"wheel",this.onTriggerEvent.bind(this),{passive:!0}),this.inputFilterType==="compound"&&this._selectOperatorElm&&this._bindEventService.bind(this._selectOperatorElm,"change",this.onTriggerEvent.bind(this))}clear(t=!0){this._filterInputElm&&(this._shouldTriggerQuery=t,this.searchTerms=[],this._filterInputElm.value="",this._currentValue=void 0,this.inputFilterType==="compound"&&this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0,this._filterContainerElm.classList.remove("filled")),this._filterInputElm.classList.remove("filled"),this.onTriggerEvent(void 0,!0))}destroy(){var t,e,n,r;this._bindEventService.unbindAll(),(e=(t=this._selectOperatorElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t),(r=(n=this._filterInputElm)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n)}getValues(){return this._filterInputElm.value}setValues(t,e){const n=Array.isArray(t)?t:[t];let r="";for(const o of n)this.inputFilterType==="single"?r=e?this.addOptionalOperatorIntoSearchString(o,e):o:r=`${o}`,this._filterInputElm.value=`${r??""}`,this._currentValue=this._filterInputElm.value;if(this.getValues()!==""?(this._filterContainerElm.classList.add("filled"),this._filterInputElm.classList.add("filled")):(this._filterContainerElm.classList.remove("filled"),this._filterInputElm.classList.remove("filled")),this.operator=e||this.defaultOperator,e&&this._selectOperatorElm){const o=Ql(this.operator);this._selectOperatorElm.value=o}}addOptionalOperatorIntoSearchString(t,e){let n="",r="",o=t==null?"":`${t}`;if(e&&o){switch(e){case"<>":case"!=":case"=":case"==":case">":case">=":case"<":case"<=":n=e;break;case"EndsWith":case"*z":n="*";break;case"StartsWith":case"a*":r="*";break}o=`${n}${o}${r}`}return o}getCompoundOperatorOptionValues(){var t;const e=this.columnDef.type&&this.columnDef.type?this.columnDef.type:ie.string;let n=[];if(!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList)return this.columnFilter.compoundOperatorList;switch(e){case ie.string:case ie.text:case ie.readonly:case ie.password:n=J0(this.gridOptions,this.translaterService);break;default:n=Yh(this.gridOptions,this.translaterService);break}return n}createDomFilterElement(t){var e,n,r,o,s,l,u;const p=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"";tn(this._cellContainerElm);let c=(o=(r=this.gridOptions)===null||r===void 0?void 0:r.defaultFilterPlaceholder)!==null&&o!==void 0?o:"";!((s=this.columnFilter)===null||s===void 0)&&s.placeholder&&(c=this.columnFilter.placeholder);const f=`${t??""}`;if(this._filterInputElm=Ie("input",{type:this._inputType||"text",autocomplete:"none",placeholder:c,ariaLabel:(u=(l=this.columnFilter)===null||l===void 0?void 0:l.ariaLabel)!==null&&u!==void 0?u:`${jr(p+"")} Search Filter`,className:`form-control filter-${p}`,value:f,dataset:{columnid:`${p}`}}),t&&this._filterInputElm.classList.add("filled"),t!==void 0&&(this._currentValue=f),this.inputFilterType==="single")this._filterContainerElm=this._filterInputElm,this._filterInputElm.classList.add("search-filter"),this._cellContainerElm.appendChild(this._filterInputElm),this._cellContainerElm.appendChild(document.createElement("span"));else{this._filterInputElm.classList.add("compound-input"),this._selectOperatorElm=$h(this.getCompoundOperatorOptionValues(),this.gridOptions),this._filterContainerElm=Ie("div",{className:`form-group search-filter filter-${p}`});const m=Ie("div",{className:"input-group"},this._filterContainerElm);Ie("div",{className:"input-group-addon input-group-prepend operator"},m).appendChild(this._selectOperatorElm),m.appendChild(this._filterInputElm),m.appendChild(Ie("span")),this.operator&&(this._selectOperatorElm.value=Ql(this.operator)),this._filterContainerElm&&this._cellContainerElm.appendChild(this._filterContainerElm)}}onTriggerEvent(t,e=!1){var n,r,o,s,l;if(e)this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:e,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterContainerElm.classList.remove("filled");else{const u=(n=t==null?void 0:t.type)!==null&&n!==void 0?n:"",p=(o=(r=this._selectOperatorElm)===null||r===void 0?void 0:r.value)!==null&&o!==void 0?o:this.operator;let c=this._filterInputElm.value;const f=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;typeof c=="string"&&f&&(c=c.trim()),((s=t==null?void 0:t.target)===null||s===void 0?void 0:s.tagName.toLowerCase())!=="select"&&(this._currentValue=c),c===""?this._filterContainerElm.classList.remove("filled"):this._filterContainerElm.classList.add("filled");const m={columnDef:this.columnDef,operator:p,searchTerms:c?[c]:null,shouldTriggerQuery:this._shouldTriggerQuery},v=u==="keyup"&&(t==null?void 0:t.key)!=="Enter"?this._debounceTypingDelay:0,b=(l=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&l!==void 0?l:this.gridOptions.skipCompoundOperatorFilterWithNullInput;(this.inputFilterType==="single"||!b||this._currentValue!==void 0)&&(v>0?(clearTimeout(this._timer),this._timer=setTimeout(()=>this.callback(t,m),v)):this.callback(t,m))}this._shouldTriggerQuery=!0}}class Qm extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="text",this.inputFilterType="compound"}}class db extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="number",this.inputFilterType="compound"}}class ub extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="password",this.inputFilterType="compound"}}const tf="#86bff8",ku=0,cb=20;class nf{constructor(t){this.translaterService=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this._sliderTrackFilledColor=tf,this.sliderType="double",this.searchTerms=[],this._bindEventService=new Pn}get columnFilter(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)!==null&&e!==void 0?e:{}}get currentValue(){return this._currentValue}get currentValues(){return this._currentValues}get defaultOperator(){return this.sliderType==="compound"?Lt.empty:this.sliderType==="single"?Lt.greaterThanOrEqual:this.gridOptions.defaultFilterRangeOperator||Lt.rangeInclusive}get gridOptions(){var t,e;return(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions())!==null&&e!==void 0?e:{}}get sliderOptions(){return this._sliderOptions}get operator(){var t,e;return this._operator||((e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator)}set operator(t){this._operator=t}init(t){var e;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.operator=t.operator||"",this.searchTerms=(e=t==null?void 0:t.searchTerms)!==null&&e!==void 0?e:[],this._argFilterContainerElm=t.filterContainerElm,this._sliderTrackFilledColor=window.getComputedStyle(document.documentElement).getPropertyValue("--slick-slider-filter-filled-track-color")||tf,this._filterElm=this.createDomFilterElement(this.searchTerms)}clear(t=!0){var e,n,r,o,s,l;if(this._filterElm){this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[];const u=+((e=Zn(this.columnFilter,"sliderStartValue"))!==null&&e!==void 0?e:je.SLIDER_DEFAULT_MIN_VALUE),p=+((n=Zn(this.columnFilter,"sliderEndValue"))!==null&&n!==void 0?n:je.SLIDER_DEFAULT_MAX_VALUE);this.sliderType==="double"?(this._sliderLeftInputElm&&(this._sliderLeftInputElm.value=`${u}`),this._sliderRightInputElm&&(this._sliderRightInputElm.value=`${p}`),this._currentValues=[u,p],(r=this._sliderLeftInputElm)===null||r===void 0||r.dispatchEvent(new Event("change")),(o=this._sliderRightInputElm)===null||o===void 0||o.dispatchEvent(new Event("change"))):(this._sliderRightInputElm&&(this._sliderRightInputElm.value=`${u}`),this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0),this._currentValue=u,(s=this._sliderRightInputElm)===null||s===void 0||s.dispatchEvent(new Event("change"))),((l=Zn(this.columnFilter,"hideSliderNumber"))!==null&&l!==void 0?l:Zn(this.columnFilter,"hideSliderNumbers"))||(this.sliderType==="double"?this.renderSliderValues(u,p):this.renderSliderValues(void 0,u)),this._divContainerFilterElm.classList.remove("filled"),this._filterElm.classList.remove("filled"),this.callback(void 0,{columnDef:this.columnDef,clearFilterTriggered:!0,shouldTriggerQuery:t,searchTerms:[]})}}destroy(){var t,e,n;this._bindEventService.unbindAll(),(t=this._sliderTrackElm)===null||t===void 0||t.remove(),(e=this._sliderLeftInputElm)===null||e===void 0||e.remove(),(n=this._sliderRightInputElm)===null||n===void 0||n.remove()}renderSliderValues(t,e){var n,r;!((n=this._leftSliderNumberElm)===null||n===void 0)&&n.textContent&&t&&(this._leftSliderNumberElm.textContent=t.toString()),!((r=this._rightSliderNumberElm)===null||r===void 0)&&r.textContent&&e&&(this._rightSliderNumberElm.textContent=e.toString())}getValues(){return this.sliderType==="double"?this._currentValues:this._currentValue}setValues(t,e){var n;if(t){let s=[];const l=Array.isArray(t)?t==null?void 0:t[0]:t;if(Array.isArray(t)&&t.length===2?s=t:typeof l=="string"&&l.indexOf("..")>0?(s=l.split(".."),this._currentValue=+((n=s==null?void 0:s[0])!==null&&n!==void 0?n:0)):(Yd(l)||l==="")&&(this._currentValue=+l,s=[l]),this.sliderType!=="double"&&this._sliderRightInputElm)this._sliderRightInputElm.value=typeof t=="string"?t:`${l}`,this.renderSliderValues(void 0,this._sliderRightInputElm.value);else if(Array.isArray(s)&&s.length===2&&!Zn(this.columnFilter,"hideSliderNumbers")){const[u,p]=s;this._sliderLeftInputElm&&(this._sliderLeftInputElm.value=String(u??je.SLIDER_DEFAULT_MIN_VALUE)),this._sliderRightInputElm&&(this._sliderRightInputElm.value=String(p??je.SLIDER_DEFAULT_MAX_VALUE)),this.renderSliderValues(...s)}}else this._currentValue=void 0,this._currentValues=void 0;const r=this.getValues();if((r===void 0?[]:Array.isArray(r)?r:[r]).length>0?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),e!==void 0&&(this.operator=e),this.operator&&this._selectOperatorElm){const s=Ql(this.operator);this._selectOperatorElm.value=s}}createDomFilterElement(t){var e,n,r,o,s,l,u,p,c,f,m,v,b,C,x,w,E,D;const A=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",F=+((o=(r=this.columnFilter)===null||r===void 0?void 0:r.minValue)!==null&&o!==void 0?o:je.SLIDER_DEFAULT_MIN_VALUE),N=+((l=(s=this.columnFilter)===null||s===void 0?void 0:s.maxValue)!==null&&l!==void 0?l:je.SLIDER_DEFAULT_MAX_VALUE),V=+((p=(u=this.columnFilter)===null||u===void 0?void 0:u.valueStep)!==null&&p!==void 0?p:je.SLIDER_DEFAULT_STEP);tn(this._argFilterContainerElm);const Q=+((f=(c=Array.isArray(t)&&(t==null?void 0:t[0]))!==null&&c!==void 0?c:Zn(this.columnFilter,"sliderStartValue"))!==null&&f!==void 0?f:F),L=+((v=(m=Array.isArray(t)&&(t==null?void 0:t[1]))!==null&&m!==void 0?m:Zn(this.columnFilter,"sliderEndValue"))!==null&&v!==void 0?v:N);if(this._sliderRangeContainElm=Ie("div",{className:`filter-input filter-${A} slider-input-container slider-values`,title:this.sliderType==="double"?`${Q} - ${L}`:`${Q}`}),this._sliderTrackElm=Ie("div",{className:"slider-track"}),this.sliderType==="compound"){const z=Ie("span",{className:"input-group-addon input-group-prepend operator"});this._selectOperatorElm=$h(this.getOperatorOptionValues(),this.gridOptions),z.appendChild(this._selectOperatorElm)}this.sliderType==="double"&&(this._sliderLeftInputElm=Ie("input",{type:"range",className:"slider-filter-input",ariaLabel:(C=(b=this.columnFilter)===null||b===void 0?void 0:b.ariaLabel)!==null&&C!==void 0?C:`${jr(A+"")} Search Filter`,defaultValue:`${Q}`,value:`${Q}`,min:`${F}`,max:`${N}`,step:`${V}`}));const le=this.sliderType==="double"?L:Q;this._sliderRightInputElm=Ie("input",{type:"range",className:"slider-filter-input",ariaLabel:(w=(x=this.columnFilter)===null||x===void 0?void 0:x.ariaLabel)!==null&&w!==void 0?w:`${jr(A+"")} Search Filter`,defaultValue:`${le}`,value:`${le}`,min:`${F}`,max:`${N}`,step:`${V}`});const ve=(E=Zn(this.columnFilter,"hideSliderNumber"))!==null&&E!==void 0?E:Zn(this.columnFilter,"hideSliderNumbers"),J=ve?"":"input-group";if(this._divContainerFilterElm=Ie("div",{className:`${J} search-filter slider-container slider-values filter-${A}`.trim()}),this._sliderRangeContainElm.appendChild(this._sliderTrackElm),this.sliderType==="double"&&this._sliderLeftInputElm&&this._sliderRangeContainElm.appendChild(this._sliderLeftInputElm),this._sliderRangeContainElm.appendChild(this._sliderRightInputElm),ve)this._divContainerFilterElm.appendChild(this._sliderRangeContainElm);else{let z;this.sliderType==="compound"&&this._selectOperatorElm?(z=Ie("span",{className:"input-group-addon input-group-prepend operator"}),z.appendChild(this._selectOperatorElm)):this.sliderType==="double"&&(z=Ie("div",{className:"input-group-addon input-group-prepend slider-range-value"}),this._leftSliderNumberElm=Ie("span",{className:`input-group-text lowest-range-${A}`,textContent:`${Q}`}),z.appendChild(this._leftSliderNumberElm));const P=Ie("div",{className:"input-group-addon input-group-append slider-range-value"});this._rightSliderNumberElm=Ie("span",{className:`input-group-text highest-range-${A}`,textContent:`${le}`},P),z&&this._divContainerFilterElm.appendChild(z),this._divContainerFilterElm.appendChild(this._sliderRangeContainElm),this._divContainerFilterElm.appendChild(P)}return this._sliderOptions={minValue:F,maxValue:N,step:V},this._currentValues=[Q,L],Array.isArray(t)&&t.length>0&&t[0]!==""&&(this._divContainerFilterElm.classList.add("filled"),this._currentValue=Q),(Zn(this.columnFilter,"sliderStartValue")!==void 0||((D=this.columnFilter)===null||D===void 0?void 0:D.minValue)!==void 0)&&(this._currentValue=Q),this._argFilterContainerElm.appendChild(this._divContainerFilterElm),this.updateTrackFilledColorWhenEnabled(),this._bindEventService.bind(this._sliderTrackElm,"click",this.sliderTrackClicked.bind(this)),this._bindEventService.bind(this._sliderRightInputElm,["input","change"],this.slideRightInputChanged.bind(this)),this._bindEventService.bind(this._sliderRightInputElm,["change","mouseup","touchend"],this.onValueChanged.bind(this)),this.sliderType==="compound"&&this._selectOperatorElm?this._bindEventService.bind(this._selectOperatorElm,["change"],this.onValueChanged.bind(this)):this.sliderType==="double"&&this._sliderLeftInputElm&&(this._bindEventService.bind(this._sliderLeftInputElm,["input","change"],this.slideLeftInputChanged.bind(this)),this._bindEventService.bind(this._sliderLeftInputElm,["change","mouseup","touchend"],this.onValueChanged.bind(this))),this._divContainerFilterElm}getOperatorOptionValues(){var t;return!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList?this.columnFilter.compoundOperatorList:Yh(this.gridOptions,this.translaterService)}onValueChanged(t){var e,n,r,o,s,l,u,p,c;const f=parseInt((n=(e=this._sliderRightInputElm)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"",10);let m,v;if(this.sliderType==="compound"||this.sliderType==="single")((o=(r=t==null?void 0:t.target)===null||r===void 0?void 0:r.tagName)===null||o===void 0?void 0:o.toLowerCase())!=="select"&&(this._currentValue=+f),m=this._currentValue,v=[m||"0"];else if(this.sliderType==="double"){const C=[parseInt((l=(s=this._sliderLeftInputElm)===null||s===void 0?void 0:s.value)!==null&&l!==void 0?l:"",10),f];m=C.join(".."),v=C}if(this._clearFilterTriggered)this._filterElm.classList.remove("filled"),this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,searchTerms:[],shouldTriggerQuery:this._shouldTriggerQuery});else{const b=(p=(u=this._selectOperatorElm)===null||u===void 0?void 0:u.value)!==null&&p!==void 0?p:this.operator;m===""?this._filterElm.classList.remove("filled"):this._filterElm.classList.add("filled");const C=(c=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&c!==void 0?c:this.gridOptions.skipCompoundOperatorFilterWithNullInput;(this.sliderType!=="compound"||!C||this._currentValue!==void 0)&&this.callback(t,{columnDef:this.columnDef,operator:b||"",searchTerms:v,shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.changeBothSliderFocuses(!1),this.grid.onHeaderRowMouseEnter.notify({column:this.columnDef,grid:this.grid},{...new Slick.EventData,target:this._argFilterContainerElm})}changeBothSliderFocuses(t){var e,n;const r=t?"add":"remove";(e=this._sliderLeftInputElm)===null||e===void 0||e.classList[r]("focus"),(n=this._sliderRightInputElm)===null||n===void 0||n.classList[r]("focus")}slideLeftInputChanged(){var t,e,n,r;const o=parseInt((e=(t=this._sliderLeftInputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"",10),s=parseInt((r=(n=this._sliderRightInputElm)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:"",10);this._sliderLeftInputElm&&s-o<=Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku)&&(this._sliderLeftInputElm.value=String(o-Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku))),this._sliderLeftInputElm&&this._sliderRightInputElm&&(+this._sliderLeftInputElm.value>=+this._sliderRightInputElm.value-cb?(this._sliderLeftInputElm.style.zIndex="1",this._sliderRightInputElm.style.zIndex="0"):(this._sliderLeftInputElm.style.zIndex="0",this._sliderRightInputElm.style.zIndex="1")),this.sliderLeftOrRightChanged(o,s)}slideRightInputChanged(){var t,e,n,r;const o=parseInt((e=(t=this._sliderLeftInputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"",10),s=parseInt((r=(n=this._sliderRightInputElm)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:"",10);this.sliderType==="double"&&this._sliderRightInputElm&&s-o<=Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku)&&(this._sliderRightInputElm.value=String(o+Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku))),this.sliderLeftOrRightChanged(o,s)}sliderLeftOrRightChanged(t,e){var n,r,o,s,l,u,p;this.updateTrackFilledColorWhenEnabled(),this.changeBothSliderFocuses(!0),this._sliderRangeContainElm.title=this.sliderType==="double"?`${t} - ${e}`:`${e}`,((n=Zn(this.columnFilter,"hideSliderNumber"))!==null&&n!==void 0?n:Zn(this.columnFilter,"hideSliderNumbers"))||(!((r=this._leftSliderNumberElm)===null||r===void 0)&&r.textContent&&(this._leftSliderNumberElm.textContent=(s=(o=this._sliderLeftInputElm)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:""),!((l=this._rightSliderNumberElm)===null||l===void 0)&&l.textContent&&(this._rightSliderNumberElm.textContent=(p=(u=this._sliderRightInputElm)===null||u===void 0?void 0:u.value)!==null&&p!==void 0?p:"")),this.grid.onHeaderRowMouseEnter.notify({column:this.columnDef,grid:this.grid},{...new Slick.EventData,target:this._argFilterContainerElm})}sliderTrackClicked(t){t.preventDefault();const e=t.offsetX,n=this._sliderTrackElm.offsetWidth,r=(e+0)*100/n;this._sliderRightInputElm&&this.sliderType!=="double"?(this._sliderRightInputElm.value=`${r}`,this._sliderRightInputElm.dispatchEvent(new Event("change"))):this._sliderLeftInputElm&&this._sliderRightInputElm&&(r<=50?(this._sliderLeftInputElm.value=`${r}`,this._sliderLeftInputElm.dispatchEvent(new Event("change"))):(this._sliderRightInputElm.value=`${r}`,this._sliderRightInputElm.dispatchEvent(new Event("change"))))}updateTrackFilledColorWhenEnabled(){var t,e,n,r;if(Zn(this.columnFilter,"enableSliderTrackColoring")&&this._sliderRightInputElm){let o=0;this._sliderLeftInputElm&&(o=(+this._sliderLeftInputElm.value-+this._sliderLeftInputElm.min)/((e=(t=this.sliderOptions)===null||t===void 0?void 0:t.maxValue)!==null&&e!==void 0?e:0-+this._sliderLeftInputElm.min)*100);const s=(+this._sliderRightInputElm.value-+this._sliderRightInputElm.min)/((r=(n=this.sliderOptions)===null||n===void 0?void 0:n.maxValue)!==null&&r!==void 0?r:0-+this._sliderRightInputElm.min)*100,l="linear-gradient(to right, %b %p1, %c %p1, %c %p2, %b %p2)".replace(/%b/g,"#eee").replace(/%c/g,Zn(this.columnFilter,"sliderTrackFilledColor")||this._sliderTrackFilledColor||tf).replace(/%p1/g,`${o}%`).replace(/%p2/g,`${s}%`);this._sliderTrackElm.style.background=l,this._sliderOptions.sliderTrackBackground=l}}}class hb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="compound"}}class fb extends Zm{constructor(t){super(t),this.translaterService=t,this.inputFilterType="range"}}class pb extends Qs{constructor(t){super(t),this.translaterService=t,this._inputMask="",this.inputType="text"}get inputMask(){return this._inputMask}init(t){var e,n,r,o;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._cellContainerElm=t.filterContainerElm,!((n=(e=this.columnDef)===null||e===void 0?void 0:e.params)===null||n===void 0)&&n.mask?this._inputMask=this.columnDef.params.mask:!((o=(r=this.columnFilter)===null||r===void 0?void 0:r.params)===null||o===void 0)&&o.mask&&(this._inputMask=this.columnFilter.params.mask),!this._inputMask)throw new Error(`[Slickgrid-Universal] The Filters.inputMask requires the mask to be passed in the filter params or the column definition params
|
|
23
|
+
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';`)}};b&&(b==="Z"||b.toLowerCase().includes("h"))&&(E.enableTime=!0),this._flatpickrOptions={...E,...C};let D=(c=(p=this.gridOptions)===null||p===void 0?void 0:p.defaultFilterPlaceholder)!==null&&c!==void 0?c:"";!((f=this.columnFilter)===null||f===void 0)&&f.placeholder&&(D=this.columnFilter.placeholder);const A=Ie("div",{className:"flatpickr"});return this.inputFilterType==="range"&&A.classList.add("search-filter",`filter-${m}`),A.appendChild(Ie("input",{type:"text",className:"form-control",placeholder:D,dataset:{input:"",columnid:`${m}`}})),this.flatInstance=lb(A,this._flatpickrOptions),A}getOperatorOptionValues(){var t;return!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList?this.columnFilter.compoundOperatorList:Yh(this.gridOptions,this.translaterService)}createDomFilterElement(t){var e,n;const r=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"";if(tn(this.filterContainerElm),this._filterDivInputElm=this.buildDatePickerInput(t),this.inputFilterType==="range")return Array.isArray(t)&&t.length>0&&t[0]!==""&&(this._filterDivInputElm.classList.add("filled"),this._currentDateOrDates=t,this._currentValue=t[0]),this._filterDivInputElm&&this.filterContainerElm.appendChild(this._filterDivInputElm),this._filterDivInputElm;{this._selectOperatorElm=$h(this.getOperatorOptionValues(),this.gridOptions);const o=Ie("div",{className:`form-group search-filter filter-${r}`}),s=Ie("div",{className:"input-group flatpickr"},o);if(Ie("div",{className:"input-group-addon input-group-prepend operator"},s).appendChild(this._selectOperatorElm),s.appendChild(this._filterDivInputElm),this.operator){const u=Ql(this.operator);this._selectOperatorElm.value=u}return t!==""&&(this._filterDivInputElm.classList.add("filled"),this._currentDateOrDates=t,this._currentValue=t),o&&this.filterContainerElm.appendChild(o),o}}onTriggerEvent(t){var e,n;if(this._clearFilterTriggered)this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterElm.classList.remove("filled");else if(this.inputFilterType==="range")this._currentDateStrings?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.callback(t,{columnDef:this.columnDef,searchTerms:this._currentDateStrings?this._currentDateStrings:[this._currentValue],operator:this.operator||"",shouldTriggerQuery:this._shouldTriggerQuery});else if(this.inputFilterType==="compound"&&this._selectOperatorElm){const r=this._selectOperatorElm.value;this._currentValue?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),(!((n=(e=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&e!==void 0?e:this.gridOptions.skipCompoundOperatorFilterWithNullInput)!==null&&n!==void 0?n:this.gridOptions.skipCompoundOperatorFilterWithNullInput===void 0)||this._currentDateOrDates!==void 0)&&this.callback(t,{columnDef:this.columnDef,searchTerms:this._currentValue?[this._currentValue]:null,operator:r||"",shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}}class ab extends Zm{constructor(t){super(t),this.translaterService=t,this.inputFilterType="compound"}}class Qs{constructor(t){this.translaterService=t,this._debounceTypingDelay=0,this._shouldTriggerQuery=!0,this._inputType="text",this.inputFilterType="single",this.searchTerms=[],this._bindEventService=new Pn}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.empty}get inputType(){return this._inputType}set inputType(t){this._inputType=t}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)}get gridOptions(){var t,e;return(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions())!==null&&e!==void 0?e:{}}init(t){var e,n,r,o,s,l;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.inputFilterType==="compound"&&(this.operator=t.operator||""),this.searchTerms=(e=t==null?void 0:t.searchTerms)!==null&&e!==void 0?e:[],this._cellContainerElm=t.filterContainerElm;const u=(n=this.gridOptions)===null||n===void 0?void 0:n.backendServiceApi;this._debounceTypingDelay=(l=u?(r=u==null?void 0:u.filterTypingDebounce)!==null&&r!==void 0?r:(o=this.gridOptions)===null||o===void 0?void 0:o.defaultBackendServiceFilterTypingDebounce:(s=this.gridOptions)===null||s===void 0?void 0:s.filterTypingDebounce)!==null&&l!==void 0?l:0;const p=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this.createDomFilterElement(p),this._bindEventService.bind(this._filterInputElm,["keyup","blur","change"],this.onTriggerEvent.bind(this)),this._bindEventService.bind(this._filterInputElm,"wheel",this.onTriggerEvent.bind(this),{passive:!0}),this.inputFilterType==="compound"&&this._selectOperatorElm&&this._bindEventService.bind(this._selectOperatorElm,"change",this.onTriggerEvent.bind(this))}clear(t=!0){this._filterInputElm&&(this._shouldTriggerQuery=t,this.searchTerms=[],this._filterInputElm.value="",this._currentValue=void 0,this.inputFilterType==="compound"&&this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0,this._filterContainerElm.classList.remove("filled")),this._filterInputElm.classList.remove("filled"),this.onTriggerEvent(void 0,!0))}destroy(){var t,e,n,r;this._bindEventService.unbindAll(),(e=(t=this._selectOperatorElm)===null||t===void 0?void 0:t.remove)===null||e===void 0||e.call(t),(r=(n=this._filterInputElm)===null||n===void 0?void 0:n.remove)===null||r===void 0||r.call(n)}getValues(){return this._filterInputElm.value}setValues(t,e){const n=Array.isArray(t)?t:[t];let r="";for(const o of n)this.inputFilterType==="single"?r=e?this.addOptionalOperatorIntoSearchString(o,e):o:r=`${o}`,this._filterInputElm.value=`${r??""}`,this._currentValue=this._filterInputElm.value;if(this.getValues()!==""?(this._filterContainerElm.classList.add("filled"),this._filterInputElm.classList.add("filled")):(this._filterContainerElm.classList.remove("filled"),this._filterInputElm.classList.remove("filled")),this.operator=e||this.defaultOperator,e&&this._selectOperatorElm){const o=Ql(this.operator);this._selectOperatorElm.value=o}}addOptionalOperatorIntoSearchString(t,e){let n="",r="",o=t==null?"":`${t}`;if(e&&o){switch(e){case"<>":case"!=":case"=":case"==":case">":case">=":case"<":case"<=":n=e;break;case"EndsWith":case"*z":n="*";break;case"StartsWith":case"a*":r="*";break}o=`${n}${o}${r}`}return o}getCompoundOperatorOptionValues(){var t;const e=this.columnDef.type&&this.columnDef.type?this.columnDef.type:ie.string;let n=[];if(!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList)return this.columnFilter.compoundOperatorList;switch(e){case ie.string:case ie.text:case ie.readonly:case ie.password:n=J0(this.gridOptions,this.translaterService);break;default:n=Yh(this.gridOptions,this.translaterService);break}return n}createDomFilterElement(t){var e,n,r,o,s,l,u;const p=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"";tn(this._cellContainerElm);let c=(o=(r=this.gridOptions)===null||r===void 0?void 0:r.defaultFilterPlaceholder)!==null&&o!==void 0?o:"";!((s=this.columnFilter)===null||s===void 0)&&s.placeholder&&(c=this.columnFilter.placeholder);const f=`${t??""}`;if(this._filterInputElm=Ie("input",{type:this._inputType||"text",autocomplete:"off",ariaAutoComplete:"none",placeholder:c,ariaLabel:(u=(l=this.columnFilter)===null||l===void 0?void 0:l.ariaLabel)!==null&&u!==void 0?u:`${jr(p+"")} Search Filter`,className:`form-control filter-${p}`,value:f,dataset:{columnid:`${p}`}}),t&&this._filterInputElm.classList.add("filled"),t!==void 0&&(this._currentValue=f),this.inputFilterType==="single")this._filterContainerElm=this._filterInputElm,this._filterInputElm.classList.add("search-filter"),this._cellContainerElm.appendChild(this._filterInputElm),this._cellContainerElm.appendChild(document.createElement("span"));else{this._filterInputElm.classList.add("compound-input"),this._selectOperatorElm=$h(this.getCompoundOperatorOptionValues(),this.gridOptions),this._filterContainerElm=Ie("div",{className:`form-group search-filter filter-${p}`});const m=Ie("div",{className:"input-group"},this._filterContainerElm);Ie("div",{className:"input-group-addon input-group-prepend operator"},m).appendChild(this._selectOperatorElm),m.appendChild(this._filterInputElm),m.appendChild(Ie("span")),this.operator&&(this._selectOperatorElm.value=Ql(this.operator)),this._filterContainerElm&&this._cellContainerElm.appendChild(this._filterContainerElm)}}onTriggerEvent(t,e=!1){var n,r,o,s,l;if(e)this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:e,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterContainerElm.classList.remove("filled");else{const u=(n=t==null?void 0:t.type)!==null&&n!==void 0?n:"",p=(o=(r=this._selectOperatorElm)===null||r===void 0?void 0:r.value)!==null&&o!==void 0?o:this.operator;let c=this._filterInputElm.value;const f=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;typeof c=="string"&&f&&(c=c.trim()),((s=t==null?void 0:t.target)===null||s===void 0?void 0:s.tagName.toLowerCase())!=="select"&&(this._currentValue=c),c===""?this._filterContainerElm.classList.remove("filled"):this._filterContainerElm.classList.add("filled");const m={columnDef:this.columnDef,operator:p,searchTerms:c?[c]:null,shouldTriggerQuery:this._shouldTriggerQuery},v=u==="keyup"&&(t==null?void 0:t.key)!=="Enter"?this._debounceTypingDelay:0,b=(l=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&l!==void 0?l:this.gridOptions.skipCompoundOperatorFilterWithNullInput;(this.inputFilterType==="single"||!b||this._currentValue!==void 0)&&(v>0?(clearTimeout(this._timer),this._timer=setTimeout(()=>this.callback(t,m),v)):this.callback(t,m))}this._shouldTriggerQuery=!0}}class Qm extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="text",this.inputFilterType="compound"}}class db extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="number",this.inputFilterType="compound"}}class ub extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="password",this.inputFilterType="compound"}}const tf="#86bff8",ku=0,cb=20;class nf{constructor(t){this.translaterService=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this._sliderTrackFilledColor=tf,this.sliderType="double",this.searchTerms=[],this._bindEventService=new Pn}get columnFilter(){var t,e;return(e=(t=this.columnDef)===null||t===void 0?void 0:t.filter)!==null&&e!==void 0?e:{}}get currentValue(){return this._currentValue}get currentValues(){return this._currentValues}get defaultOperator(){return this.sliderType==="compound"?Lt.empty:this.sliderType==="single"?Lt.greaterThanOrEqual:this.gridOptions.defaultFilterRangeOperator||Lt.rangeInclusive}get gridOptions(){var t,e;return(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions())!==null&&e!==void 0?e:{}}get sliderOptions(){return this._sliderOptions}get operator(){var t,e;return this._operator||((e=(t=this.columnFilter)===null||t===void 0?void 0:t.operator)!==null&&e!==void 0?e:this.defaultOperator)}set operator(t){this._operator=t}init(t){var e;if(!t)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=t.grid,this.callback=t.callback,this.columnDef=t.columnDef,this.operator=t.operator||"",this.searchTerms=(e=t==null?void 0:t.searchTerms)!==null&&e!==void 0?e:[],this._argFilterContainerElm=t.filterContainerElm,this._sliderTrackFilledColor=window.getComputedStyle(document.documentElement).getPropertyValue("--slick-slider-filter-filled-track-color")||tf,this._filterElm=this.createDomFilterElement(this.searchTerms)}clear(t=!0){var e,n,r,o,s,l;if(this._filterElm){this._clearFilterTriggered=!0,this._shouldTriggerQuery=t,this.searchTerms=[];const u=+((e=Zn(this.columnFilter,"sliderStartValue"))!==null&&e!==void 0?e:je.SLIDER_DEFAULT_MIN_VALUE),p=+((n=Zn(this.columnFilter,"sliderEndValue"))!==null&&n!==void 0?n:je.SLIDER_DEFAULT_MAX_VALUE);this.sliderType==="double"?(this._sliderLeftInputElm&&(this._sliderLeftInputElm.value=`${u}`),this._sliderRightInputElm&&(this._sliderRightInputElm.value=`${p}`),this._currentValues=[u,p],(r=this._sliderLeftInputElm)===null||r===void 0||r.dispatchEvent(new Event("change")),(o=this._sliderRightInputElm)===null||o===void 0||o.dispatchEvent(new Event("change"))):(this._sliderRightInputElm&&(this._sliderRightInputElm.value=`${u}`),this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0),this._currentValue=u,(s=this._sliderRightInputElm)===null||s===void 0||s.dispatchEvent(new Event("change"))),((l=Zn(this.columnFilter,"hideSliderNumber"))!==null&&l!==void 0?l:Zn(this.columnFilter,"hideSliderNumbers"))||(this.sliderType==="double"?this.renderSliderValues(u,p):this.renderSliderValues(void 0,u)),this._divContainerFilterElm.classList.remove("filled"),this._filterElm.classList.remove("filled"),this.callback(void 0,{columnDef:this.columnDef,clearFilterTriggered:!0,shouldTriggerQuery:t,searchTerms:[]})}}destroy(){var t,e,n;this._bindEventService.unbindAll(),(t=this._sliderTrackElm)===null||t===void 0||t.remove(),(e=this._sliderLeftInputElm)===null||e===void 0||e.remove(),(n=this._sliderRightInputElm)===null||n===void 0||n.remove()}renderSliderValues(t,e){var n,r;!((n=this._leftSliderNumberElm)===null||n===void 0)&&n.textContent&&t&&(this._leftSliderNumberElm.textContent=t.toString()),!((r=this._rightSliderNumberElm)===null||r===void 0)&&r.textContent&&e&&(this._rightSliderNumberElm.textContent=e.toString())}getValues(){return this.sliderType==="double"?this._currentValues:this._currentValue}setValues(t,e){var n;if(t){let s=[];const l=Array.isArray(t)?t==null?void 0:t[0]:t;if(Array.isArray(t)&&t.length===2?s=t:typeof l=="string"&&l.indexOf("..")>0?(s=l.split(".."),this._currentValue=+((n=s==null?void 0:s[0])!==null&&n!==void 0?n:0)):(Yd(l)||l==="")&&(this._currentValue=+l,s=[l]),this.sliderType!=="double"&&this._sliderRightInputElm)this._sliderRightInputElm.value=typeof t=="string"?t:`${l}`,this.renderSliderValues(void 0,this._sliderRightInputElm.value);else if(Array.isArray(s)&&s.length===2&&!Zn(this.columnFilter,"hideSliderNumbers")){const[u,p]=s;this._sliderLeftInputElm&&(this._sliderLeftInputElm.value=String(u??je.SLIDER_DEFAULT_MIN_VALUE)),this._sliderRightInputElm&&(this._sliderRightInputElm.value=String(p??je.SLIDER_DEFAULT_MAX_VALUE)),this.renderSliderValues(...s)}}else this._currentValue=void 0,this._currentValues=void 0;const r=this.getValues();if((r===void 0?[]:Array.isArray(r)?r:[r]).length>0?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),e!==void 0&&(this.operator=e),this.operator&&this._selectOperatorElm){const s=Ql(this.operator);this._selectOperatorElm.value=s}}createDomFilterElement(t){var e,n,r,o,s,l,u,p,c,f,m,v,b,C,x,w,E,D;const A=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",F=+((o=(r=this.columnFilter)===null||r===void 0?void 0:r.minValue)!==null&&o!==void 0?o:je.SLIDER_DEFAULT_MIN_VALUE),N=+((l=(s=this.columnFilter)===null||s===void 0?void 0:s.maxValue)!==null&&l!==void 0?l:je.SLIDER_DEFAULT_MAX_VALUE),V=+((p=(u=this.columnFilter)===null||u===void 0?void 0:u.valueStep)!==null&&p!==void 0?p:je.SLIDER_DEFAULT_STEP);tn(this._argFilterContainerElm);const Q=+((f=(c=Array.isArray(t)&&(t==null?void 0:t[0]))!==null&&c!==void 0?c:Zn(this.columnFilter,"sliderStartValue"))!==null&&f!==void 0?f:F),L=+((v=(m=Array.isArray(t)&&(t==null?void 0:t[1]))!==null&&m!==void 0?m:Zn(this.columnFilter,"sliderEndValue"))!==null&&v!==void 0?v:N);if(this._sliderRangeContainElm=Ie("div",{className:`filter-input filter-${A} slider-input-container slider-values`,title:this.sliderType==="double"?`${Q} - ${L}`:`${Q}`}),this._sliderTrackElm=Ie("div",{className:"slider-track"}),this.sliderType==="compound"){const z=Ie("span",{className:"input-group-addon input-group-prepend operator"});this._selectOperatorElm=$h(this.getOperatorOptionValues(),this.gridOptions),z.appendChild(this._selectOperatorElm)}this.sliderType==="double"&&(this._sliderLeftInputElm=Ie("input",{type:"range",className:"slider-filter-input",ariaLabel:(C=(b=this.columnFilter)===null||b===void 0?void 0:b.ariaLabel)!==null&&C!==void 0?C:`${jr(A+"")} Search Filter`,defaultValue:`${Q}`,value:`${Q}`,min:`${F}`,max:`${N}`,step:`${V}`}));const le=this.sliderType==="double"?L:Q;this._sliderRightInputElm=Ie("input",{type:"range",className:"slider-filter-input",ariaLabel:(w=(x=this.columnFilter)===null||x===void 0?void 0:x.ariaLabel)!==null&&w!==void 0?w:`${jr(A+"")} Search Filter`,defaultValue:`${le}`,value:`${le}`,min:`${F}`,max:`${N}`,step:`${V}`});const ve=(E=Zn(this.columnFilter,"hideSliderNumber"))!==null&&E!==void 0?E:Zn(this.columnFilter,"hideSliderNumbers"),J=ve?"":"input-group";if(this._divContainerFilterElm=Ie("div",{className:`${J} search-filter slider-container slider-values filter-${A}`.trim()}),this._sliderRangeContainElm.appendChild(this._sliderTrackElm),this.sliderType==="double"&&this._sliderLeftInputElm&&this._sliderRangeContainElm.appendChild(this._sliderLeftInputElm),this._sliderRangeContainElm.appendChild(this._sliderRightInputElm),ve)this._divContainerFilterElm.appendChild(this._sliderRangeContainElm);else{let z;this.sliderType==="compound"&&this._selectOperatorElm?(z=Ie("span",{className:"input-group-addon input-group-prepend operator"}),z.appendChild(this._selectOperatorElm)):this.sliderType==="double"&&(z=Ie("div",{className:"input-group-addon input-group-prepend slider-range-value"}),this._leftSliderNumberElm=Ie("span",{className:`input-group-text lowest-range-${A}`,textContent:`${Q}`}),z.appendChild(this._leftSliderNumberElm));const P=Ie("div",{className:"input-group-addon input-group-append slider-range-value"});this._rightSliderNumberElm=Ie("span",{className:`input-group-text highest-range-${A}`,textContent:`${le}`},P),z&&this._divContainerFilterElm.appendChild(z),this._divContainerFilterElm.appendChild(this._sliderRangeContainElm),this._divContainerFilterElm.appendChild(P)}return this._sliderOptions={minValue:F,maxValue:N,step:V},this._currentValues=[Q,L],Array.isArray(t)&&t.length>0&&t[0]!==""&&(this._divContainerFilterElm.classList.add("filled"),this._currentValue=Q),(Zn(this.columnFilter,"sliderStartValue")!==void 0||((D=this.columnFilter)===null||D===void 0?void 0:D.minValue)!==void 0)&&(this._currentValue=Q),this._argFilterContainerElm.appendChild(this._divContainerFilterElm),this.updateTrackFilledColorWhenEnabled(),this._bindEventService.bind(this._sliderTrackElm,"click",this.sliderTrackClicked.bind(this)),this._bindEventService.bind(this._sliderRightInputElm,["input","change"],this.slideRightInputChanged.bind(this)),this._bindEventService.bind(this._sliderRightInputElm,["change","mouseup","touchend"],this.onValueChanged.bind(this)),this.sliderType==="compound"&&this._selectOperatorElm?this._bindEventService.bind(this._selectOperatorElm,["change"],this.onValueChanged.bind(this)):this.sliderType==="double"&&this._sliderLeftInputElm&&(this._bindEventService.bind(this._sliderLeftInputElm,["input","change"],this.slideLeftInputChanged.bind(this)),this._bindEventService.bind(this._sliderLeftInputElm,["change","mouseup","touchend"],this.onValueChanged.bind(this))),this._divContainerFilterElm}getOperatorOptionValues(){var t;return!((t=this.columnFilter)===null||t===void 0)&&t.compoundOperatorList?this.columnFilter.compoundOperatorList:Yh(this.gridOptions,this.translaterService)}onValueChanged(t){var e,n,r,o,s,l,u,p,c;const f=parseInt((n=(e=this._sliderRightInputElm)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:"",10);let m,v;if(this.sliderType==="compound"||this.sliderType==="single")((o=(r=t==null?void 0:t.target)===null||r===void 0?void 0:r.tagName)===null||o===void 0?void 0:o.toLowerCase())!=="select"&&(this._currentValue=+f),m=this._currentValue,v=[m||"0"];else if(this.sliderType==="double"){const C=[parseInt((l=(s=this._sliderLeftInputElm)===null||s===void 0?void 0:s.value)!==null&&l!==void 0?l:"",10),f];m=C.join(".."),v=C}if(this._clearFilterTriggered)this._filterElm.classList.remove("filled"),this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,searchTerms:[],shouldTriggerQuery:this._shouldTriggerQuery});else{const b=(p=(u=this._selectOperatorElm)===null||u===void 0?void 0:u.value)!==null&&p!==void 0?p:this.operator;m===""?this._filterElm.classList.remove("filled"):this._filterElm.classList.add("filled");const C=(c=this.columnFilter.skipCompoundOperatorFilterWithNullInput)!==null&&c!==void 0?c:this.gridOptions.skipCompoundOperatorFilterWithNullInput;(this.sliderType!=="compound"||!C||this._currentValue!==void 0)&&this.callback(t,{columnDef:this.columnDef,operator:b||"",searchTerms:v,shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.changeBothSliderFocuses(!1),this.grid.onHeaderRowMouseEnter.notify({column:this.columnDef,grid:this.grid},{...new Slick.EventData,target:this._argFilterContainerElm})}changeBothSliderFocuses(t){var e,n;const r=t?"add":"remove";(e=this._sliderLeftInputElm)===null||e===void 0||e.classList[r]("focus"),(n=this._sliderRightInputElm)===null||n===void 0||n.classList[r]("focus")}slideLeftInputChanged(){var t,e,n,r;const o=parseInt((e=(t=this._sliderLeftInputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"",10),s=parseInt((r=(n=this._sliderRightInputElm)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:"",10);this._sliderLeftInputElm&&s-o<=Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku)&&(this._sliderLeftInputElm.value=String(o-Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku))),this._sliderLeftInputElm&&this._sliderRightInputElm&&(+this._sliderLeftInputElm.value>=+this._sliderRightInputElm.value-cb?(this._sliderLeftInputElm.style.zIndex="1",this._sliderRightInputElm.style.zIndex="0"):(this._sliderLeftInputElm.style.zIndex="0",this._sliderRightInputElm.style.zIndex="1")),this.sliderLeftOrRightChanged(o,s)}slideRightInputChanged(){var t,e,n,r;const o=parseInt((e=(t=this._sliderLeftInputElm)===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"",10),s=parseInt((r=(n=this._sliderRightInputElm)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:"",10);this.sliderType==="double"&&this._sliderRightInputElm&&s-o<=Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku)&&(this._sliderRightInputElm.value=String(o+Zn(this.columnFilter,"stopGapBetweenSliderHandles",ku))),this.sliderLeftOrRightChanged(o,s)}sliderLeftOrRightChanged(t,e){var n,r,o,s,l,u,p;this.updateTrackFilledColorWhenEnabled(),this.changeBothSliderFocuses(!0),this._sliderRangeContainElm.title=this.sliderType==="double"?`${t} - ${e}`:`${e}`,((n=Zn(this.columnFilter,"hideSliderNumber"))!==null&&n!==void 0?n:Zn(this.columnFilter,"hideSliderNumbers"))||(!((r=this._leftSliderNumberElm)===null||r===void 0)&&r.textContent&&(this._leftSliderNumberElm.textContent=(s=(o=this._sliderLeftInputElm)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:""),!((l=this._rightSliderNumberElm)===null||l===void 0)&&l.textContent&&(this._rightSliderNumberElm.textContent=(p=(u=this._sliderRightInputElm)===null||u===void 0?void 0:u.value)!==null&&p!==void 0?p:"")),this.grid.onHeaderRowMouseEnter.notify({column:this.columnDef,grid:this.grid},{...new Slick.EventData,target:this._argFilterContainerElm})}sliderTrackClicked(t){t.preventDefault();const e=t.offsetX,n=this._sliderTrackElm.offsetWidth,r=(e+0)*100/n;this._sliderRightInputElm&&this.sliderType!=="double"?(this._sliderRightInputElm.value=`${r}`,this._sliderRightInputElm.dispatchEvent(new Event("change"))):this._sliderLeftInputElm&&this._sliderRightInputElm&&(r<=50?(this._sliderLeftInputElm.value=`${r}`,this._sliderLeftInputElm.dispatchEvent(new Event("change"))):(this._sliderRightInputElm.value=`${r}`,this._sliderRightInputElm.dispatchEvent(new Event("change"))))}updateTrackFilledColorWhenEnabled(){var t,e,n,r;if(Zn(this.columnFilter,"enableSliderTrackColoring")&&this._sliderRightInputElm){let o=0;this._sliderLeftInputElm&&(o=(+this._sliderLeftInputElm.value-+this._sliderLeftInputElm.min)/((e=(t=this.sliderOptions)===null||t===void 0?void 0:t.maxValue)!==null&&e!==void 0?e:0-+this._sliderLeftInputElm.min)*100);const s=(+this._sliderRightInputElm.value-+this._sliderRightInputElm.min)/((r=(n=this.sliderOptions)===null||n===void 0?void 0:n.maxValue)!==null&&r!==void 0?r:0-+this._sliderRightInputElm.min)*100,l="linear-gradient(to right, %b %p1, %c %p1, %c %p2, %b %p2)".replace(/%b/g,"#eee").replace(/%c/g,Zn(this.columnFilter,"sliderTrackFilledColor")||this._sliderTrackFilledColor||tf).replace(/%p1/g,`${o}%`).replace(/%p2/g,`${s}%`);this._sliderTrackElm.style.background=l,this._sliderOptions.sliderTrackBackground=l}}}class hb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="compound"}}class fb extends Zm{constructor(t){super(t),this.translaterService=t,this.inputFilterType="range"}}class pb extends Qs{constructor(t){super(t),this.translaterService=t,this._inputMask="",this.inputType="text"}get inputMask(){return this._inputMask}init(t){var e,n,r,o;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._cellContainerElm=t.filterContainerElm,!((n=(e=this.columnDef)===null||e===void 0?void 0:e.params)===null||n===void 0)&&n.mask?this._inputMask=this.columnDef.params.mask:!((o=(r=this.columnFilter)===null||r===void 0?void 0:r.params)===null||o===void 0)&&o.mask&&(this._inputMask=this.columnFilter.params.mask),!this._inputMask)throw new Error(`[Slickgrid-Universal] The Filters.inputMask requires the mask to be passed in the filter params or the column definition params
|
|
24
24
|
for example:: this.columnDefinitions: [{ id: 'phone', field: 'phone', filter: { model: Filters.inputMask, params: { mask: '000-000-0000' }}}]`);const s=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this.createDomFilterElement(s),this._bindEventService.bind(this._filterInputElm,["keyup","blur","change"],this.onTriggerEvent.bind(this))}onTriggerEvent(t,e=!1){var n,r,o;let s="";if(!((n=t==null?void 0:t.target)===null||n===void 0)&&n.value){let l=(o=(r=t==null?void 0:t.target)===null||r===void 0?void 0:r.value)!==null&&o!==void 0?o:"";const u=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;typeof l=="string"&&u&&(l=l.trim());const p=this.unmaskValue(l),c=this.maskValue(p);s=p,(t==null?void 0:t.keyCode)>=48&&(this._filterInputElm.value=c,t.preventDefault())}e?(this.callback(t,{columnDef:this.columnDef,clearFilterTriggered:e,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterInputElm.classList.remove("filled")):(this._filterInputElm.classList.add("filled"),this.callback(t,{columnDef:this.columnDef,operator:this.operator,searchTerms:[s],shouldTriggerQuery:this._shouldTriggerQuery})),this._shouldTriggerQuery=!0}maskValue(t){let e=0,n="";return this._inputMask&&(n=this._inputMask.replace(/[09A]/gi,r=>((r==="0"||r==="9")&&/\d+/g.test(t[e])||r.toUpperCase()==="A"&&/[^\d]+/gi.test(t[e]))&&t[e++]||"")),n}unmaskValue(t){const e=t.replace(/[^0-9a-z]*/gi,""),n=this._inputMask.replace(/[^0-9a-z]*/gi,"");let r="";for(let o=0;o<n.length;o++)e[o]&&((n[o]==="0"||n[o]==="9")&&/\d+/g.test(e[o])||n[o].toUpperCase()==="A"&&/[^\d]+/gi.test(e[o]))&&(r+=e[o]);return r}}class mb extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="number"}}class vb extends Qs{constructor(t){super(t),this.translaterService=t,this.inputType="password"}}var gb=Object.defineProperty,_b=(a,t,e)=>t in a?gb(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,jt=(a,t,e)=>(_b(a,typeof t!="symbol"?t+"":t,e),e),bb=class{constructor(a){jt(this,"_distinctEvent"),jt(this,"_boundedEvents",[]),this._distinctEvent=(a==null?void 0:a.distinctEvent)??!1}get boundedEvents(){return this._boundedEvents}dispose(){this.unbindAll(),this._boundedEvents=[]}bind(a,t,e,n){let r=Array.isArray(t)?t:[t];if(a!=null&&a.forEach)a==null||a.forEach(o=>{for(let s of r)(!this._distinctEvent||this._distinctEvent&&!this.hasBinding(o,s))&&(o.addEventListener(s,e,n),this._boundedEvents.push({element:o,eventName:s,listener:e}))});else for(let o of r)(!this._distinctEvent||this._distinctEvent&&!this.hasBinding(a,o))&&(a.addEventListener(o,e,n),this._boundedEvents.push({element:a,eventName:o,listener:e}))}hasBinding(a,t){return this._boundedEvents.some(e=>e.element===a&&(!t||e.eventName===t))}unbind(a,t,e){var n;if(a){let r=Array.isArray(a)?a:[a],o=Array.isArray(t)?t||"":[t||""];for(let s of r){e||(e=this._boundedEvents.find(l=>{if(l.element===s&&(!t||l.eventName===t))return l.listener}));for(let l of o)(n=s==null?void 0:s.removeEventListener)==null||n.call(s,l,e)}}}unbindAll(){for(;this._boundedEvents.length>0;){let a=this._boundedEvents.pop(),{element:t,eventName:e,listener:n}=a;this.unbind(t,e,n)}}},Jm=typeof window<"u"&&window.multipleSelect!==void 0?window.multipleSelect:{locales:{}};Jm.locales={"en-US":{formatSelectAll(){return"[Select all]"},formatAllSelected(){return"All selected"},formatCountSelected(a,t){return`${a} of ${t} selected`},formatNoMatchesFound(){return"No matches found"},formatOkButton(){return"OK"}}};var ev=Jm.locales,Cb=50,yb=4,tv={name:"",placeholder:"",classes:"",classPrefix:"",data:void 0,locale:void 0,selectAll:!0,single:void 0,singleRadio:!1,multiple:!1,hideOptgroupCheckboxes:!1,multipleWidth:80,width:void 0,dropWidth:void 0,maxHeight:250,maxHeightUnit:"px",position:"bottom",displayValues:!1,displayTitle:!1,displayDelimiter:", ",minimumCountSelected:3,ellipsis:!1,isOpen:!1,keepOpen:!1,openOnHover:!1,container:null,filter:!1,filterGroup:!1,filterPlaceholder:"",filterAcceptOnEnter:!1,filterByDataLength:void 0,customFilter(a){let{text:t,label:e,search:n}=a;return(e||t||"").includes(n)},showClear:!1,autoAdjustDropHeight:!1,autoAdjustDropPosition:!1,autoAdjustDropWidthByTextSize:!1,adjustedHeightPadding:10,useSelectOptionLabel:!1,useSelectOptionLabelToHtml:!1,styler:()=>!1,textTemplate:a=>a.innerHTML.trim(),labelTemplate:a=>a.label,onOpen:()=>!1,onClose:()=>!1,onCheckAll:()=>!1,onUncheckAll:()=>!1,onFocus:()=>!1,onBlur:()=>!1,onOptgroupClick:()=>!1,onClick:()=>!1,onFilter:()=>!1,onClear:()=>!1,onAfterCreate:()=>!1,onDestroy:()=>!1,onAfterDestroy:()=>!1,onDestroyed:()=>!1},Eb=["init","getOptions","refreshOptions","getSelects","setSelects","enable","disable","open","close","check","uncheck","checkAll","uncheckAll","checkInvert","focus","blur","refresh","destroy"];Object.assign(tv,ev["en-US"]);var Sb={BLOCK_ROWS:Cb,CLUSTER_BLOCKS:yb,DEFAULTS:tv,METHODS:Eb},Lo=Sb,wb=class{constructor(a){jt(this,"cache"),jt(this,"clusterRows"),jt(this,"dataStart"),jt(this,"dataEnd"),jt(this,"rows"),jt(this,"scrollEl"),jt(this,"blockHeight"),jt(this,"clusterHeight"),jt(this,"contentEl"),jt(this,"parentEl"),jt(this,"itemHeight"),jt(this,"lastCluster"),jt(this,"scrollTop"),jt(this,"destroy"),jt(this,"callback"),jt(this,"sanitizer"),this.rows=a.rows,this.scrollEl=a.scrollEl,this.contentEl=a.contentEl,this.parentEl=a.contentEl.parentElement,this.callback=a.callback,this.cache={},this.scrollTop=this.scrollEl.scrollTop,this.initDOM(this.rows),this.scrollEl.scrollTop=this.scrollTop,this.lastCluster=0;let t=()=>{this.lastCluster!==(this.lastCluster=this.getNum())&&(this.initDOM(this.rows),this.callback())};this.scrollEl.addEventListener("scroll",t,!1),this.destroy=()=>{this.contentEl.innerHTML="",this.scrollEl.removeEventListener("scroll",t,!1)}}initDOM(a){if(typeof this.clusterHeight>"u"){this.cache.scrollTop=this.scrollEl.scrollTop;let l=a[0]+a[0]+a[0];this.contentEl.innerHTML=this.sanitizer?this.sanitizer(`${l}`):`${l}`,this.cache.data=l,this.getRowsHeight()}let t=this.initData(a,this.getNum()),e=t.rows.join(""),n=this.checkChanges("data",e),r=this.checkChanges("top",t.topOffset),o=this.checkChanges("bottom",t.bottomOffset),s=[];n&&r?(t.topOffset&&s.push(this.getExtra("top",t.topOffset)),s.push(e),t.bottomOffset&&s.push(this.getExtra("bottom",t.bottomOffset)),this.contentEl.innerHTML=this.sanitizer?this.sanitizer(s.join("")):s.join("")):o&&this.contentEl.lastChild&&(this.contentEl.lastChild.style.height=`${t.bottomOffset}px`)}getRowsHeight(){var a;if(typeof this.itemHeight>"u"){let t=((a=this.parentEl)==null?void 0:a.style.display)||"";this.parentEl&&(t===""||t==="none")&&(this.parentEl.style.display="block");let e=this.contentEl.children,n=e[Math.floor(e.length/2)];this.itemHeight=n.offsetHeight,this.parentEl&&(this.parentEl.style.display=t)}this.blockHeight=this.itemHeight*Lo.BLOCK_ROWS,this.clusterRows=Lo.BLOCK_ROWS*Lo.CLUSTER_BLOCKS,this.clusterHeight=this.blockHeight*Lo.CLUSTER_BLOCKS}getNum(){this.scrollTop=this.scrollEl.scrollTop;let a=(this.clusterHeight||0)-(this.blockHeight||0);return a&&Math.floor(this.scrollTop/a)||0}initData(a,t){if(a.length<Lo.BLOCK_ROWS)return{topOffset:0,bottomOffset:0,rowsAbove:0,rows:a};let e=Math.max((this.clusterRows-Lo.BLOCK_ROWS)*t,0),n=e+this.clusterRows,r=Math.max(e*this.itemHeight,0),o=Math.max((a.length-n)*this.itemHeight,0),s=[],l=e;r<1&&l++;for(let u=e;u<n;u++)a[u]&&s.push(a[u]);return this.dataStart=e,this.dataEnd=n,{topOffset:r,bottomOffset:o,rowsAbove:l,rows:s}}checkChanges(a,t){let e=t!==this.cache[a];return this.cache[a]=t,e}getExtra(a,t){let e=document.createElement("li");return e.className=`virtual-scroll-${a}`,t&&(e.style.height=`${t}px`),e.outerHTML}};function rf(a){let t=0,e=0,n=0,r=0,o=window.innerHeight??0,s=window.innerWidth??0,l=Tb(),u=l.top,p=l.left,c=of(a);if(c){let f=c.top??0,m=c.left??0;e=f-u,t=o-(f-u),n=m-p,r=s-(m-p)}return{top:e,bottom:t,left:n,right:r}}function vo(a,t,e){let n=document.createElement(a);return t&&Object.keys(t).forEach(r=>{let o=t[r];typeof o=="object"?Object.assign(n[r],o):n[r]=t[r]}),e&&e.appendChild&&e.appendChild(n),n}function of(a){var s;if(!a)return;let t=(s=a==null?void 0:a.getBoundingClientRect)==null?void 0:s.call(a),e=0,n=0,r=0,o=0;return(t==null?void 0:t.top)!==void 0&&t.left!==void 0&&(e=t.top+window.pageYOffset,n=t.left+window.pageXOffset,o=t.right,r=t.bottom),{top:e,left:n,bottom:r,right:o}}function Iu(a,t,e){let n=parseFloat(a.style[e]);if(!n||isNaN(n)){switch(t){case"outer":n=a[e==="width"?"offsetWidth":"offsetHeight"];break;case"scroll":n=a[e==="width"?"scrollWidth":"scrollHeight"];break;case"inner":default:n=a[e==="width"?"clientWidth":"clientHeight"];break}n=a.getBoundingClientRect()[e]}if(!n||isNaN(n)){let r=a.style.display,o=a.style.position;a.style.display="block",a.style.position="absolute";let s=window.getComputedStyle(a)[e];n=parseFloat(s),isNaN(n)&&(n=0),a.style.display=r,a.style.position=o}return n||0}function iv(a,t){let e=null,n=a.parentElement;for(;n;){let[r,o,s,l]=t.match(/^([a-z]*)([#.]{1})([a-z\-]+)$/i)||[];if(s&&l)for(let u of l.replace(s,"").split(" "))n.classList.contains(u)&&(o?(n==null?void 0:n.tagName.toLowerCase())===o&&(e=n):e=n);n=n.parentElement}return e}function xb(a,t){var e;(e=a.parentNode)==null||e.insertBefore(t,a.nextSibling)}function nv(a){let t=typeof a=="string"?a:String(a),e={"&":"&","<":"<",">":">",'"':""","'":"'"};return(t||"").toString().replace(/[&<>"']/g,n=>e[n])}function rv(a,t){a!=null&&a.style&&(a.style.display=a.style.display==="none"&&t!==!1||t===!0?"block":"none")}function Tb(){return{left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0}}function Ob(a,t,e=!1){let n=Object.keys(a),r=Object.keys(t);if(e&&n.length!==r.length)return!1;for(let o of n)if(r.includes(o)&&a[o]!==t[o])return!1;return!0}function sf(a){let t=()=>{let r={};for(let o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=sf(a[o]));return r},e=()=>a.map(r=>sf(r)),n=Object.prototype.toString.call(a).slice(8,-1).toLowerCase();return n==="object"?t():n==="array"?e():a}function Ab(a){let t=0;return a.forEach((e,n)=>{e.type==="optgroup"?(e._key=`group_${n}`,e.visible=typeof e.visible>"u"?!0:e.visible,e.children.forEach((r,o)=>{r&&(r.visible=typeof(r==null?void 0:r.visible)>"u"?!0:r.visible,r.divider||(r._key=`option_${n}_${o}`,t+=1))})):(e.visible=typeof e.visible>"u"?!0:e.visible,e.divider||(e._key=`option_${n}`,t+=1))}),t}function Du(a,t,e){if(Array.isArray(a))for(let n of a){if(n[t]===e||n[t]===`${+n[t]}`&&+n[t]===e)return n;if(n.type==="optgroup"){for(let r of n.children)if(r&&(r[t]===e||r[t]===`${+r[t]}`&&+r[t]===e))return r}}}function kb(a){var r;let t=document.createElement("div");t.innerHTML=a;let e=t.getElementsByTagName("script"),n=e.length;for(;n--;)(r=e[n].parentNode)==null||r.removeChild(e[n]);return t.innerHTML}function lf(a){return Object.keys(a).forEach(t=>a[t]===void 0?delete a[t]:""),a}function ca(a){return typeof a!="string"?a:a.normalize?a.normalize("NFD").replace(/[\u0300-\u036F]/g,""):[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}].reduce((t,{letters:e,base:n})=>t.replace(e,n),a)}var Ib=class{constructor(a,t){this.elm=a,jt(this,"_bindEventService"),jt(this,"allSelected",!1),jt(this,"fromHtml",!1),jt(this,"choiceElm"),jt(this,"closeElm"),jt(this,"filterText",""),jt(this,"updateData",[]),jt(this,"data",[]),jt(this,"dataTotal"),jt(this,"dropElm"),jt(this,"okButtonElm"),jt(this,"filterParentElm"),jt(this,"ulElm"),jt(this,"parentElm"),jt(this,"labelElm"),jt(this,"selectAllParentElm"),jt(this,"selectAllElm"),jt(this,"searchInputElm"),jt(this,"selectGroupElms"),jt(this,"selectItemElms"),jt(this,"disableItemElms"),jt(this,"noResultsElm"),jt(this,"options"),jt(this,"selectAllName",""),jt(this,"selectGroupName",""),jt(this,"selectItemName",""),jt(this,"tabIndex"),jt(this,"updateDataStart"),jt(this,"updateDataEnd"),jt(this,"virtualScroll"),jt(this,"locales",{}),this.options=Object.assign({},Lo.DEFAULTS,this.elm.dataset,t),this._bindEventService=new bb({distinctEvent:!0})}init(){this.initLocale(),this.initContainer(),this.initData(),this.initSelected(!0),this.initFilter(),this.initDrop(),this.initView(),this.options.onAfterCreate()}destroy(a=!0){var t,e,n,r,o;this.parentElm&&(this.options.onDestroy({hardDestroy:a}),a&&this.options.onHardDestroy(),this.elm.parentElement&&this.parentElm.parentElement&&this.elm.parentElement.insertBefore(this.elm,this.parentElm.parentElement.firstChild),this.elm.classList.remove("ms-offscreen"),this._bindEventService.unbindAll(),this.tabIndex&&(this.elm.tabIndex=+this.tabIndex),(t=this.virtualScroll)==null||t.destroy(),(e=this.dropElm)==null||e.remove(),(n=this.parentElm.parentNode)==null||n.removeChild(this.parentElm),this.fromHtml&&(delete this.options.data,this.fromHtml=!1),this.options.onAfterDestroy({hardDestroy:a}),a&&((o=(r=this.options).onAfterHardDestroy)==null||o.call(r),Object.keys(this.options).forEach(s=>delete this[s])))}initLocale(){if(this.options.locale){let a=window.multipleSelect.locales,t=this.options.locale.split(/-|_/);if(t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),a[this.options.locale])Object.assign(this.options,a[this.options.locale]);else if(a[t.join("-")])Object.assign(this.options,a[t.join("-")]);else if(a[t[0]])Object.assign(this.options,a[t[0]]);else throw new Error(`[multiple-select-vanilla] invalid locales "${this.options.locale}", make sure to import it before using it`)}}initContainer(){var r;let a=this.elm.getAttribute("name")||this.options.name||"";this.options.classes&&this.elm.classList.add(this.options.classes),this.options.classPrefix&&(this.elm.classList.add(this.options.classPrefix),this.options.size&&this.elm.classList.add(`${this.options.classPrefix}-${this.options.size}`)),this.elm.style.display="none",this.labelElm=this.elm.closest("label"),!this.labelElm&&this.elm.id&&(this.labelElm=document.createElement("label"),this.labelElm.htmlFor=this.elm.id),(r=this.labelElm)!=null&&r.querySelector("input")&&(this.labelElm=null),typeof this.options.single>"u"&&(this.options.single=!this.elm.multiple),this.parentElm=vo("div",{className:`ms-parent ${this.elm.className||""} ${this.options.classes}`,dataset:{test:"sel"}});let t=this.elm.getAttribute("title")||"";t&&(this.parentElm.title=t),this.options.placeholder=this.options.placeholder||this.elm.getAttribute("placeholder")||"",this.tabIndex=this.elm.getAttribute("tabindex");let e="";this.tabIndex!==null&&(this.elm.tabIndex=-1,e=this.tabIndex&&`tabindex="${this.tabIndex}"`),this.choiceElm=vo("button",{className:"ms-choice",type:"button"},this.parentElm),isNaN(e)&&(this.choiceElm.tabIndex=+e),this.choiceElm.appendChild(vo("span",{className:"ms-placeholder",textContent:this.options.placeholder})),this.options.showClear&&this.choiceElm.appendChild(vo("div",{className:"icon-close"})),this.choiceElm.appendChild(vo("div",{className:"icon-caret"})),this.dropElm=vo("div",{className:`ms-drop ${this.options.position}`},this.parentElm),a&&(this.dropElm.dataset.name=a);let n=this.elm.getAttribute("data-test")||this.options.dataTest;n&&(this.parentElm.dataset.test=n,this.dropElm.dataset.test=n),this.closeElm=this.choiceElm.querySelector(".icon-close"),this.options.dropWidth&&(this.dropElm.style.width=typeof this.options.dropWidth=="string"?this.options.dropWidth:`${this.options.dropWidth}px`),xb(this.elm,this.parentElm),this.elm.disabled&&this.choiceElm.classList.add("disabled"),this.selectAllName=`data-name="selectAll${a}"`,this.selectGroupName=`data-name="selectGroup${a}"`,this.selectItemName=`data-name="selectItem${a}"`,this.options.keepOpen||(this._bindEventService.unbind(document.body,"click"),this._bindEventService.bind(document.body,"click",o=>{o.target===this.choiceElm||iv(o.target,".ms-choice")===this.choiceElm||(o.target===this.dropElm||iv(o.target,".ms-drop")!==this.dropElm&&o.target!==this.elm)&&this.options.isOpen&&this.close()}))}initData(){let a=[];if(this.options.data){if(Array.isArray(this.options.data))this.data=this.options.data.map(t=>typeof t=="string"||typeof t=="number"?{text:t,value:t}:t);else if(typeof this.options.data=="object"){for(let[t,e]of Object.entries(this.options.data))a.push({value:t,text:`${e}`});this.data=a}}else this.elm.childNodes.forEach(t=>{this.initRow(t)&&a.push(this.initRow(t))}),this.options.data=a,this.data=a,this.fromHtml=!0;this.dataTotal=Ab(this.data||[])}initRow(a,t){var n,r;let e={};return((n=a.tagName)==null?void 0:n.toLowerCase())==="option"?(e.type="option",e.text=this.options.textTemplate(a),e.value=a.value,e.visible=!0,e.selected=!!a.selected,e.disabled=t||a.disabled,e.classes=a.getAttribute("class")||"",e.title=a.getAttribute("title")||"",a.dataset.value&&(e._value=a.dataset.value),Object.keys(a.dataset).length&&(e._data=a.dataset,e._data.divider&&(e.divider=e._data.divider)),e):((r=a.tagName)==null?void 0:r.toLowerCase())==="optgroup"?(e.type="optgroup",e.label=this.options.labelTemplate(a),e.visible=!0,e.selected=!!a.selected,e.disabled=a.disabled,e.children=[],Object.keys(a.dataset).length&&(e._data=a.dataset),a.childNodes.forEach(o=>{e.children.push(this.initRow(o,e.disabled))}),e):null}initDrop(){this.initList(),this.update(!0),this.options.isOpen&&this.open(10),this.options.openOnHover&&this.parentElm&&(this._bindEventService.bind(this.parentElm,"mouseover",()=>this.open(null)),this._bindEventService.bind(this.parentElm,"mouseout",()=>this.close()))}initFilter(){if(this.filterText="",this.options.filter||!this.options.filterByDataLength)return;let a=0;for(let t of this.data||[])t.type==="optgroup"?a+=t.children.length:a+=1;this.options.filter=a>this.options.filterByDataLength}initList(){if(this.options.filter&&(this.filterParentElm=vo("div",{className:"ms-search"},this.dropElm),this.filterParentElm.appendChild(vo("input",{autocomplete:"off",autocapitalize:"off",spellcheck:!1,type:"text",placeholder:this.options.filterPlaceholder||"🔎︎"}))),this.options.selectAll&&!this.options.single){let a=this.elm.getAttribute("name")||this.options.name||"";this.selectAllParentElm=vo("div",{className:"ms-select-all"});let t=document.createElement("label");vo("input",{type:"checkbox",checked:this.allSelected,dataset:{name:`selectAll${a}`}},t),t.appendChild(vo("span",{textContent:this.formatSelectAll()})),this.selectAllParentElm.appendChild(t),this.dropElm.appendChild(this.selectAllParentElm)}this.ulElm=document.createElement("ul"),this.dropElm.appendChild(this.ulElm),this.options.showOkButton&&!this.options.single&&(this.okButtonElm=vo("button",{className:"ms-ok-button",type:"button",textContent:this.formatOkButton()},this.dropElm)),this.initListItems()}initListItems(){var e;let a=this.getListRows(),t=0;if(this.options.selectAll&&!this.options.single&&(t=-1),a.length>Lo.BLOCK_ROWS*Lo.CLUSTER_BLOCKS){(e=this.virtualScroll)==null||e.destroy();let n=this.dropElm.style.display!=="none";n||(this.dropElm.style.left="-10000",this.dropElm.style.display="block");let r=()=>{var o,s;this.virtualScroll&&(this.updateDataStart=this.virtualScroll.dataStart+t,this.updateDataEnd=this.virtualScroll.dataEnd+t,this.updateDataStart<0&&(this.updateDataStart=0),this.updateDataEnd>(((o=this.data)==null?void 0:o.length)??0)&&(this.updateDataEnd=((s=this.data)==null?void 0:s.length)??0))};this.ulElm&&(this.virtualScroll=new wb({rows:a,scrollEl:this.ulElm,contentEl:this.ulElm,sanitizer:this.options.sanitizer,callback:()=>{r(),this.events()}})),r(),n||(this.dropElm.style.left="0",this.dropElm.style.display="none")}else this.ulElm&&(this.ulElm.innerHTML=this.options.sanitizer?this.options.sanitizer(a.join("")):a.join("")),this.updateDataStart=0,this.updateDataEnd=this.updateData.length,this.virtualScroll=null;this.events()}getListRows(){var t;let a=[];return this.updateData=[],(t=this.data)==null||t.forEach(e=>{a.push(...this.initListItem(e))}),a.push(`<li class="ms-no-results">${this.formatNoMatchesFound()}</li>`),a}initListItem(a,t=0){let e=this.options.renderOptionLabelAsHtml||this.options.useSelectOptionLabelToHtml,n=a!=null&&a.title?`title="${a.title}"`:"",r=this.options.multiple?"multiple":"",o=this.options.single?"radio":"checkbox",s="";if(!(a!=null&&a.visible))return[];if(this.updateData.push(a),this.options.single&&!this.options.singleRadio&&(s="hide-radio "),a.selected&&(s+="selected "),a.type==="optgroup"){let p=this.options.styler(a),c=p?`style="${p}"`:"",f=[],m=this.options.hideOptgroupCheckboxes||this.options.single?`<span ${this.selectGroupName} data-key="${a._key}"></span>`:`<input type="checkbox"
|
|
25
25
|
${this.selectGroupName}
|
|
26
26
|
data-key="${a._key}"
|
|
@@ -45,8 +45,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<span>${e?a.text:nv(a.text)}</span>
|
|
46
46
|
</label>
|
|
47
47
|
</li>
|
|
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=Iu(this.dropElm,"outer","width")+20)):a=Iu(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=Du(this.data,"_key",e.dataset.key);this._checkGroup(r,n),this.options.onOptgroupClick(lf({label:r.label,selected:r.selected,data:r._data,children:r.children.map(o=>{if(o)return lf({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=Du(this.data,"_key",e.dataset.key);this._check(r,n),this.options.onClick(lf({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=of(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=`${Iu(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=Iu(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}=rf(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?kb(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,rv(this.selectAllElm.closest("li"),!a)),rv(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?sf(t):this.options}refreshOptions(a){Ob(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=Du(this.data,"value",a);t&&this._check(t,!0)}uncheck(a){let t=Du(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}=rf(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}=rf(this.dropElm),{top:r,left:o}=of(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"?af(document.querySelectorAll(a),t):a instanceof Node?af([a],t):af(a,t)};function af(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 Ib(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={...ev},ha.methods=Lo.METHODS,typeof window<"u"&&(window.multipleSelect=ha);class ov{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,b,C,x,w,E,D,A;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=(b=this.gridOptions)===null||b===void 0?void 0:b.locales)!==null&&C!==void 0?C:je.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=(A=(D=this.columnDef.filter)===null||D===void 0?void 0:D.emptySearchTermReturnAllValues)!==null&&A!==void 0?A:!1);const N=this.columnFilter.collection||[];return this.renderDomElement(N),new Promise(async(V,Q)=>{try{const L=this.columnFilter.collectionAsync;let le;L&&!this.columnFilter.collection?(le=Wm(L,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),V(le)):(le=N,V(N)),(L||this.columnFilter.enableCollectionWatch)&&(await(le??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(),Wd(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=>$d(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||[])}),Zc(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=bn(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=Zp("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,tn(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,b,C,x;const w=(e=(t=this.gridOptions)===null||t===void 0?void 0:t.enableTranslate)!==null&&e!==void 0?e:!1,D={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:A=>Mn(this.gridOptions,A),onClose:()=>this.onTriggerEvent()};if(this._isMultipleSelect){D.single=!1,D.showOkButton=!0,D.displayTitle=!0;const A=ao(this.gridOptions);D.countSelectedText=w&&(!((l=this.translaterService)===null||l===void 0)&&l.translate)?this.translaterService.translate(`${A}X_OF_Y_SELECTED`):(u=this._locales)===null||u===void 0?void 0:u.TEXT_X_OF_Y_SELECTED,D.allSelectedText=w&&(!((p=this.translaterService)===null||p===void 0)&&p.translate)?this.translaterService.translate(`${A}ALL_SELECTED`):(c=this._locales)===null||c===void 0?void 0:c.TEXT_ALL_SELECTED,D.noMatchesFoundText=w&&(!((f=this.translaterService)===null||f===void 0)&&f.translate)?this.translaterService.translate(`${A}NO_MATCHES_FOUND`):(m=this._locales)===null||m===void 0?void 0:m.TEXT_NO_MATCHES_FOUND,D.okButtonText=w&&(!((v=this.translaterService)===null||v===void 0)&&v.translate)?this.translaterService.translate(`${A}OK`):(b=this._locales)===null||b===void 0?void 0:b.TEXT_OK,D.selectAllText=w&&(!((C=this.translaterService)===null||C===void 0)&&C.translate)?this.translaterService.translate(`${A}SELECT_ALL`):(x=this._locales)===null||x===void 0?void 0:x.TEXT_SELECT_ALL}this.defaultOptions=D}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 Db extends ov{constructor(t,e,n){super(t,e,n,!0),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Rb{constructor(t){this.translater=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this._currentValues=[],this.searchTerms=[],this._bindEventService=new Pn}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 b=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",C=Ie("select",{className:`form-control search-filter filter-${b}`,ariaLabel:(o=(r=this.columnFilter)===null||r===void 0?void 0:r.ariaLabel)!==null&&o!==void 0?o:`${jr(b+"")} 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(D=>typeof D=="string"))for(const D of t)C.appendChild(Ie("option",{value:D,label:D,textContent:D}));else for(const D of t){if(!D||D[x]===void 0&&D.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 A=D.labelKey||D[x],F=(D.labelKey||E)&&typeof this.translater!==void 0&&(!((v=(m=this.translater).getCurrentLanguage)===null||v===void 0)&&v.call(m))?this.translater.translate(A||" "):A;C.appendChild(Ie("option",{value:D[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:"";tn(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 Fb extends ov{constructor(t,e,n){super(t,e,n,!1),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Pb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="single"}}class Mb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="double"}}const Ru={autocompleter:eb,compoundDate:ab,compoundInput:Qm,compoundInputNumber:db,compoundInputPassword:ub,compoundInputText:Qm,compoundSlider:hb,dateRange:fb,input:Qs,inputMask:pb,inputNumber:mb,inputPassword:vb,inputText:Qs,multipleSelect:Db,select:Rb,singleSelect:Fb,slider:Pb,sliderRange:Mb};class Nb{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 df={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:sv},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:Ru.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,autoDetectCellFormat:!0,exportWithFormatter:!1,filename:"export",format:un.xlsx,groupingColumnHeaderTitle:"Group By",groupCollapsedSymbol:"⮞",groupExpandedSymbol:"⮟",groupingAggregatorRowText:"",sanitizeDataExport:!0},textExportOptions:{delimiter:vs.comma,exportWithFormatter:!1,filename:"export",format:un.csv,groupingColumnHeaderTitle:"Group By",groupingAggregatorRowText:"",sanitizeDataExport:!0,useUtf8WithBom:!0},gridAutosizeColsMode:Ud.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:sv},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 sv(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 Lb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._sum=0,this._itemCount=0,this._type="sum",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._isTreeAggregator=e,this._isInitialized=!0,this._sum=0,this._itemCount=0,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={},t.__treeTotals.count={}),t.__treeTotals.count[this._field]=0,t.__treeTotals[this._type][this._field]=0)}accumulate(t,e=!1){var n,r;const o=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator?e?(t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals),this._sum=parseFloat((n=t.__treeTotals[this._type][this._field])!==null&&n!==void 0?n:0),this._itemCount=(r=t.__treeTotals.count[this._field])!==null&&r!==void 0?r:0):en(o)&&(this._sum=parseFloat(o),this._itemCount=1):o!==null&&o!==""&&!isNaN(o)&&(this._sum+=parseFloat(o))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),this.addGroupTotalPropertiesWhenNotExist(t);let e=this._sum,n=this._itemCount;this._isTreeAggregator&&(e+=t[this._type][this._field],n+=t.count[this._field],t.count[this._field]=n),t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={}),this._isTreeAggregator&&t.count===void 0&&(t.count={})}}class Hb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._max=null,this._type="max",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._max=null,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=null)}accumulate(t,e=!1){const n=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;if(!this._isTreeAggregator)this.keepMaxValueWhenFound(n);else if(e){t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals);const r=t.__treeTotals[this._type][this._field]!==null?parseFloat(t.__treeTotals[this._type][this._field]):null;r!==null&&en(r)&&(this._max===null||r>this._max)&&(this._max=r)}else en(n)&&this.keepMaxValueWhenFound(n)}storeResult(t){let e=this._max;if(this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&e!==null){const n=t[this._type][this._field];en(n)&&n>e&&(e=n)}t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={})}keepMaxValueWhenFound(t){t!==null&&t!==""&&!isNaN(t)&&(this._max===null||t>this._max)&&(this._max=parseFloat(t))}}class Vb{constructor(t){this._isInitialized=!1,this._distinctValues=[],this._type="distinct",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){if(this._distinctValues=[],this._isInitialized=!0,e)throw new Error("[Slickgrid-Universal] CloneAggregator is not currently supported for use with Tree Data")}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._isInitialized=!1,this._isTreeAggregator=!1,this._min=null,this._type="min",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._min=null,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=null)}accumulate(t,e=!1){const n=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;if(!this._isTreeAggregator)this.keepMinValueWhenFound(n);else if(e){t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals);const r=t.__treeTotals[this._type][this._field]!==null?parseFloat(t.__treeTotals[this._type][this._field]):null;r!==null&&en(r)&&(this._min===null||r<this._min)&&(this._min=r)}else en(n)&&this.keepMinValueWhenFound(n)}storeResult(t){let e=this._min;if(this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&e!==null){const n=t[this._type][this._field];en(n)&&n<e&&(e=n)}t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={})}keepMinValueWhenFound(t){t!==null&&t!==""&&!isNaN(t)&&(this._min===null||t<this._min)&&(this._min=parseFloat(t))}}class zb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._count=0,this._type="count",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._count=0,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=0)}accumulate(t,e=!1){var n;const r=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator&&(e?(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),this._count=(n=t.__treeTotals[this._type][this._field])!==null&&n!==void 0?n:0):en(r)&&(this._count=1))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={});let e=this._count;this._isTreeAggregator?e+=t[this._type][this._field]:e=t.group.rows.length,t[this._type][this._field]=e}}class Ub{constructor(t){this._isInitialized=!1,this._type="clone",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){if(this._data="",this._isInitialized=!0,e)throw new Error("[Slickgrid-Universal] CloneAggregator is not currently supported for use with Tree 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 Gb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._nonNullCount=0,this._sum=0,this._type="avg",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._sum=0,this._nonNullCount=0,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={},t.__treeTotals.sum={},t.__treeTotals.count={}),t.__treeTotals[this._type][this._field]=0,t.__treeTotals.count[this._field]=0,t.__treeTotals.sum[this._field]=0)}accumulate(t,e=!1){var n,r;const o=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator?e?(t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals),this._sum=parseFloat((n=t.__treeTotals.sum[this._field])!==null&&n!==void 0?n:0),this._nonNullCount=(r=t.__treeTotals.count[this._field])!==null&&r!==void 0?r:0):en(o)&&(this._sum=parseFloat(o),this._nonNullCount=1):o!==null&&o!==""&&!isNaN(o)&&(this._nonNullCount++,this._sum+=parseFloat(o))}storeResult(t){let e=this._sum,n=this._nonNullCount;this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&(e+=t.sum[this._field],n+=t.count[this._field],t.sum[this._field]=e,t.count[this._field]=n),n!==0&&(t[this._type][this._field]=n===0?e:e/n)}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={}),this._isTreeAggregator&&t.sum===void 0&&(t.sum={}),this._isTreeAggregator&&t.count===void 0&&(t.count={})}}const uf={Avg:Gb,Clone:Ub,Count:zb,Distinct:Vb,Min:Bb,Max:Hb,Sum:Lb};function Fu(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||je.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||je.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"?je.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE:je.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 lv=qd&&lh||qd,Wb=3;class $b{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 Pn,!((e=this.gridOptions)===null||e===void 0)&&e.translater&&(this._translater=this.gridOptions.translater),this._locales=this.gridOptions&&this.gridOptions.locales||je.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?bn(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:Wb;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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 Ie("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=Mn(this.gridOptions,o)||"";return Ie("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=Mn(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,b,C,x,w;const E=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",D=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.placeholder)!==null&&o!==void 0?o:"",A=(l=(s=this.columnEditor)===null||s===void 0?void 0:s.title)!==null&&l!==void 0?l:"";this._editorInputGroupElm=Ie("div",{className:"autocomplete-container input-group"});const F=Ie("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=Ie("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=Ie("input",{type:"text",placeholder:D,title:A,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=>$d(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},!((b=this._autocompleterOptions.renderItem)===null||b===void 0)&&b.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${$a(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?(Lp(this._inputElm,this._autocompleterOptions),this._instance=lv(this._autocompleterOptions)):this._instance=lv({...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 Yb{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 Pn,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=Ie("div",{className:`checkbox-editor-container editor-${u}`}),this._input=Ie("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?bn(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||je.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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}}const jb=cd&&On||cd,Pu=Ys||ms;class Xb{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 Pn,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=Ga(this.columnEditor.type||this.columnDef.type||ie.dateUtc),m=Ga(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 b={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
|
-
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={...b,...this.editorOptions};const C=`.editor-text.editor-${p}.form-control`;this._pickerMergedOptions.altInput&&(this._pickerMergedOptions.altInputClass="flatpickr-alt-input form-control"),this._editorInputGroupElm=Ie("div",{className:"flatpickr input-group"});const x=Ie("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=Ie("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=Ie("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=jb(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(()=>_h(this.flatInstance))),tn(this._editorInputGroupElm),tn(this._inputWithDataElm),tn(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?Pu(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?Pu(e,n,!1).format(r):"",s=this._originalDate?Pu(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?bn(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 Pu(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||je.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,b=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,b),this.applyValue(t.formValues,b);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 av(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||je.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||n===0&&!/^[-+]?(\d*(\.)?(\d)*)$/.test(a)))c=!1,f=u||je.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||je.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"?je.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE:je.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||je.VALIDATION_EDITOR_DECIMAL_BETWEEN.replace(/{{minDecimal}}|{{maxDecimal}}/gi,m=>p[m]));return{valid:c,msg:f}}function dv(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||je.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||!/^[+-]?\d+$/.test(a)))p=!1,c=n||je.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||je.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"?je.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE:je.VALIDATION_EDITOR_INTEGER_MAX;c=n||f.replace(/{{maxValue}}/gi,m=>u[m])}return{valid:p,msg:c}}function qb(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||je.VALIDATION_REQUIRED_FIELD}:n!==void 0&&r!==void 0&&a!==null&&(a<n||a>r)?{valid:!1,msg:o||je.VALIDATION_EDITOR_NUMBER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi,l=>s[l])}:{valid:!0,msg:null}}class Kb{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 Pn,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 b=Ie("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"&&(b.readOnly=!0,v="text"),v==="number"&&(b.step=this.getInputDecimalSteps(t)),b}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?bn(e,p):e[l],f=this.validate(null,{position:n,inputValue:c});if(u){const m=bn(e,p),v=f&&f.valid?m:"",b=(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,b,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?bn(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 av(o,{...l,decimal:this.getDecimalPlaces(t),minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"integer":return dv(o,{...l,minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"text":case"password":default:return Fu(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 b=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,D=this.grid,A=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,A),this.applyValue(e.formValues,A);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],D.onCompositeEditorChange.notify({...b,item:E,grid:D,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 Mu{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 Pn,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=Ie("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?bn(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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 Zb=0;class Qb extends Mu{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=Ie("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=Zb),!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?bn(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 av(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 Jb extends Mu{constructor(t){super(t,"password"),this.args=t}}class eC extends Mu{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=Ie("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?bn(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 dv(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 tC{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||je.locales,this._bindEventService=new Pn,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,b,C,x,w,E,D,A,F,N,V,Q,L,le;let ve="",J="";if(this._translater&&this._translater.translate&&this.gridOptions.enableTranslate){const De=ao(this.gridOptions),re=(e=(t=this.editorOptions.buttonTexts)===null||t===void 0?void 0:t.cancelKey)!==null&&e!==void 0?e:`${De}CANCEL`,pe=(r=(n=this.editorOptions.buttonTexts)===null||n===void 0?void 0:n.saveKey)!==null&&r!==void 0?r:`${De}SAVE`;ve=this._translater.translate(`${De}${re}`),J=this._translater.translate(`${De}${pe}`)}else ve=(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=(b=(v=this.columnDef)===null||v===void 0?void 0:v.id)!==null&&b!==void 0?b:"",ae=(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,Re=z?this.args.container:document.body;this._wrapperElm=Ie("div",{className:`slick-large-editor-text editor-${P}`,style:{position:z?"relative":"absolute"}}),Re.appendChild(this._wrapperElm),this._textareaElm=Ie("textarea",{ariaLabel:(D=(E=this.columnEditor)===null||E===void 0?void 0:E.ariaLabel)!==null&&D!==void 0?D:`${jr(P+"")} Text Editor`,cols:(F=(A=this.editorOptions)===null||A===void 0?void 0:A.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 xe=Ie("div",{className:"editor-footer"}),Oe=Ie("span",{className:"counter"});if(this._currentLengthElm=Ie("span",{className:"text-length",textContent:"0"}),Oe.appendChild(this._currentLengthElm),ae!==void 0&&(Oe.appendChild(Ie("span",{className:"separator",textContent:"/"})),Oe.appendChild(Ie("span",{className:"max-length",textContent:`${ae}`}))),xe.appendChild(Oe),!z){const De=Ie("button",{className:"btn btn-cancel btn-default btn-xs",textContent:ve},xe),re=Ie("button",{className:"btn btn-save btn-primary btn-xs",textContent:J},xe);this._bindEventService.bind(De,"click",this.cancel.bind(this)),this._bindEventService.bind(re,"click",this.save.bind(this)),this.position((le=this.args)===null||le===void 0?void 0:le.position),this._textareaElm.focus(),this._textareaElm.select()}this._wrapperElm.appendChild(xe),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?bn(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=Kn(this.args.container),f=this.args.container.offsetHeight,m=this.args.container.offsetWidth,v=this._wrapperElm.getBoundingClientRect().height||this.args.position.height,b=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 D=(l=(s=this.editorOptions)===null||s===void 0?void 0:s.position)!==null&&l!==void 0?l:"auto";if(D==="left"||D==="auto"&&E+b>x){const A=(p=(u=this.editorOptions)===null||u===void 0?void 0:u.marginRight)!==null&&p!==void 0?p:0;E-=b-m+A}(D==="top"||D==="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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 uv{constructor(t,e,n=-1){var r,o,s,l,u,p,c,f,m,v,b;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||je.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=>Mn(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=(b=this._locales)===null||b===void 0?void 0:b.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,b;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:"",D=(E==null?void 0:E.indexOf("."))>0,A=(b=(v=this.columnEditor)===null||v===void 0?void 0:v.serializeComplexValueFormat)!==null&&b!==void 0?b:"object";return D&&typeof c=="object"&&A==="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 D;return((D=E==null?void 0:E.toString)===null||D===void 0?void 0:D.call(E))===`${f}`});const v=(o=(r=this.collectionOptions)===null||r===void 0?void 0:r.separatorBetweenTextLabels)!==null&&o!==void 0?o:"",b=(l=(s=this.collectionOptions)===null||s===void 0?void 0:s.includePrefixSuffixToSelectedValues)!==null&&l!==void 0?l:!1,C=bs(this.collection,E=>{var D;return E.hasOwnProperty(this.valueName)&&((D=E[this.valueName])===null||D===void 0?void 0:D.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(b){let D=C[this.labelPrefixName]||"",A=C[this.labelSuffixName]||"";return D=this.enableTranslateLabel&&this._translaterService&&D&&typeof D=="string"?this._translaterService.translate(D||" "):D,A=this.enableTranslateLabel&&this._translaterService&&A&&typeof A=="string"?this._translaterService.translate(A||" "):A,[D,E,A].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.
|
|
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=Iu(this.dropElm,"outer","width")+20)):a=Iu(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=Du(this.data,"_key",e.dataset.key);this._checkGroup(r,n),this.options.onOptgroupClick(lf({label:r.label,selected:r.selected,data:r._data,children:r.children.map(o=>{if(o)return lf({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=Du(this.data,"_key",e.dataset.key);this._check(r,n),this.options.onClick(lf({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=of(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=`${Iu(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=Iu(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}=rf(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?kb(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();this.options.single?this.elm.value=l.length?l[0]:"":Array.from(this.elm.options).forEach(p=>{p.selected=l.some(c=>c===p.value)}),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,rv(this.selectAllElm.closest("li"),!a)),rv(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?sf(t):this.options}refreshOptions(a){Ob(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=Du(this.data,"value",a);t&&this._check(t,!0)}uncheck(a){let t=Du(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}=rf(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}=rf(this.dropElm),{top:r,left:o}=of(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"?af(document.querySelectorAll(a),t):a instanceof Node?af([a],t):af(a,t)};function af(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 Ib(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={...ev},ha.methods=Lo.METHODS,typeof window<"u"&&(window.multipleSelect=ha);class ov{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(){var t,e;return(e=(t=this.grid)===null||t===void 0?void 0:t.getOptions())!==null&&e!==void 0?e:{}}get defaultOperator(){return this.isMultipleSelect?Lt.in:Lt.equal}get isMultipleSelect(){return this._isMultipleSelect}get msInstance(){return this._msInstance}get selectOptions(){return this.defaultOptions}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,b,C,x,w,E,D,A;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=(b=this.gridOptions)===null||b===void 0?void 0:b.locales)!==null&&C!==void 0?C:je.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=(A=(D=this.columnDef.filter)===null||D===void 0?void 0:D.emptySearchTermReturnAllValues)!==null&&A!==void 0?A:!1);const N=this.columnFilter.collection||[];return this.renderDomElement(N),new Promise(async(V,Q)=>{try{const L=this.columnFilter.collectionAsync;let le;L&&!this.columnFilter.collection?(le=Wm(L,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),V(le)):(le=N,V(N)),(L||this.columnFilter.enableCollectionWatch)&&(await(le??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(),Wd(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=>$d(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||[])}),Zc(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=bn(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=Zp("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,tn(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,b,C,x;const w=(e=(t=this.gridOptions)===null||t===void 0?void 0:t.enableTranslate)!==null&&e!==void 0?e:!1,D={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,renderOptionLabelAsHtml:(s=(o=this.columnFilter)===null||o===void 0?void 0:o.enableRenderHtml)!==null&&s!==void 0?s:!1,sanitizer:A=>Mn(this.gridOptions,A),onClose:()=>this.onTriggerEvent()};if(this._isMultipleSelect){D.single=!1,D.showOkButton=!0,D.displayTitle=!0;const A=ao(this.gridOptions);D.countSelectedText=w&&(!((l=this.translaterService)===null||l===void 0)&&l.translate)?this.translaterService.translate(`${A}X_OF_Y_SELECTED`):(u=this._locales)===null||u===void 0?void 0:u.TEXT_X_OF_Y_SELECTED,D.allSelectedText=w&&(!((p=this.translaterService)===null||p===void 0)&&p.translate)?this.translaterService.translate(`${A}ALL_SELECTED`):(c=this._locales)===null||c===void 0?void 0:c.TEXT_ALL_SELECTED,D.noMatchesFoundText=w&&(!((f=this.translaterService)===null||f===void 0)&&f.translate)?this.translaterService.translate(`${A}NO_MATCHES_FOUND`):(m=this._locales)===null||m===void 0?void 0:m.TEXT_NO_MATCHES_FOUND,D.okButtonText=w&&(!((v=this.translaterService)===null||v===void 0)&&v.translate)?this.translaterService.translate(`${A}OK`):(b=this._locales)===null||b===void 0?void 0:b.TEXT_OK,D.selectAllText=w&&(!((C=this.translaterService)===null||C===void 0)&&C.translate)?this.translaterService.translate(`${A}SELECT_ALL`):(x=this._locales)===null||x===void 0?void 0:x.TEXT_SELECT_ALL}this.defaultOptions=D}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 Db extends ov{constructor(t,e,n){super(t,e,n,!0),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Rb{constructor(t){this.translater=t,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this._currentValues=[],this.searchTerms=[],this._bindEventService=new Pn}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 b=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",C=Ie("select",{className:`form-control search-filter filter-${b}`,ariaLabel:(o=(r=this.columnFilter)===null||r===void 0?void 0:r.ariaLabel)!==null&&o!==void 0?o:`${jr(b+"")} 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(D=>typeof D=="string"))for(const D of t)C.appendChild(Ie("option",{value:D,label:D,textContent:D}));else for(const D of t){if(!D||D[x]===void 0&&D.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 A=D.labelKey||D[x],F=(D.labelKey||E)&&typeof this.translater!==void 0&&(!((v=(m=this.translater).getCurrentLanguage)===null||v===void 0)&&v.call(m))?this.translater.translate(A||" "):A;C.appendChild(Ie("option",{value:D[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:"";tn(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 Fb extends ov{constructor(t,e,n){super(t,e,n,!1),this.translaterService=t,this.collectionService=e,this.rxjs=n}}class Pb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="single"}}class Mb extends nf{constructor(t){super(t),this.translaterService=t,super.sliderType="double"}}const Ru={autocompleter:eb,compoundDate:ab,compoundInput:Qm,compoundInputNumber:db,compoundInputPassword:ub,compoundInputText:Qm,compoundSlider:hb,dateRange:fb,input:Qs,inputMask:pb,inputNumber:mb,inputPassword:vb,inputText:Qs,multipleSelect:Db,select:Rb,singleSelect:Fb,slider:Pb,sliderRange:Mb};class Nb{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 df={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:sv},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:Ru.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,autoDetectCellFormat:!0,exportWithFormatter:!1,filename:"export",format:un.xlsx,groupingColumnHeaderTitle:"Group By",groupCollapsedSymbol:"⮞",groupExpandedSymbol:"⮟",groupingAggregatorRowText:"",sanitizeDataExport:!0},textExportOptions:{delimiter:vs.comma,exportWithFormatter:!1,filename:"export",format:un.csv,groupingColumnHeaderTitle:"Group By",groupingAggregatorRowText:"",sanitizeDataExport:!0,useUtf8WithBom:!0},gridAutosizeColsMode:Ud.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:sv},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 sv(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 Lb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._sum=0,this._itemCount=0,this._type="sum",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._isTreeAggregator=e,this._isInitialized=!0,this._sum=0,this._itemCount=0,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={},t.__treeTotals.count={}),t.__treeTotals.count[this._field]=0,t.__treeTotals[this._type][this._field]=0)}accumulate(t,e=!1){var n,r;const o=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator?e?(t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals),this._sum=parseFloat((n=t.__treeTotals[this._type][this._field])!==null&&n!==void 0?n:0),this._itemCount=(r=t.__treeTotals.count[this._field])!==null&&r!==void 0?r:0):en(o)&&(this._sum=parseFloat(o),this._itemCount=1):o!==null&&o!==""&&!isNaN(o)&&(this._sum+=parseFloat(o))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={}),this.addGroupTotalPropertiesWhenNotExist(t);let e=this._sum,n=this._itemCount;this._isTreeAggregator&&(e+=t[this._type][this._field],n+=t.count[this._field],t.count[this._field]=n),t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={}),this._isTreeAggregator&&t.count===void 0&&(t.count={})}}class Hb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._max=null,this._type="max",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._max=null,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=null)}accumulate(t,e=!1){const n=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;if(!this._isTreeAggregator)this.keepMaxValueWhenFound(n);else if(e){t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals);const r=t.__treeTotals[this._type][this._field]!==null?parseFloat(t.__treeTotals[this._type][this._field]):null;r!==null&&en(r)&&(this._max===null||r>this._max)&&(this._max=r)}else en(n)&&this.keepMaxValueWhenFound(n)}storeResult(t){let e=this._max;if(this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&e!==null){const n=t[this._type][this._field];en(n)&&n>e&&(e=n)}t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={})}keepMaxValueWhenFound(t){t!==null&&t!==""&&!isNaN(t)&&(this._max===null||t>this._max)&&(this._max=parseFloat(t))}}class Vb{constructor(t){this._isInitialized=!1,this._distinctValues=[],this._type="distinct",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){if(this._distinctValues=[],this._isInitialized=!0,e)throw new Error("[Slickgrid-Universal] CloneAggregator is not currently supported for use with Tree Data")}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._isInitialized=!1,this._isTreeAggregator=!1,this._min=null,this._type="min",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._min=null,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=null)}accumulate(t,e=!1){const n=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;if(!this._isTreeAggregator)this.keepMinValueWhenFound(n);else if(e){t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals);const r=t.__treeTotals[this._type][this._field]!==null?parseFloat(t.__treeTotals[this._type][this._field]):null;r!==null&&en(r)&&(this._min===null||r<this._min)&&(this._min=r)}else en(n)&&this.keepMinValueWhenFound(n)}storeResult(t){let e=this._min;if(this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&e!==null){const n=t[this._type][this._field];en(n)&&n<e&&(e=n)}t[this._type][this._field]=e}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={})}keepMinValueWhenFound(t){t!==null&&t!==""&&!isNaN(t)&&(this._min===null||t<this._min)&&(this._min=parseFloat(t))}}class zb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._count=0,this._type="count",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._count=0,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),t.__treeTotals[this._type][this._field]=0)}accumulate(t,e=!1){var n;const r=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator&&(e?(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={}),this._count=(n=t.__treeTotals[this._type][this._field])!==null&&n!==void 0?n:0):en(r)&&(this._count=1))}storeResult(t){(!t||t[this._type]===void 0)&&(t[this._type]={});let e=this._count;this._isTreeAggregator?e+=t[this._type][this._field]:e=t.group.rows.length,t[this._type][this._field]=e}}class Ub{constructor(t){this._isInitialized=!1,this._type="clone",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){if(this._data="",this._isInitialized=!0,e)throw new Error("[Slickgrid-Universal] CloneAggregator is not currently supported for use with Tree 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 Gb{constructor(t){this._isInitialized=!1,this._isTreeAggregator=!1,this._nonNullCount=0,this._sum=0,this._type="avg",this._field=t}get field(){return this._field}get isInitialized(){return this._isInitialized}get type(){return this._type}init(t,e=!1){this._sum=0,this._nonNullCount=0,this._isInitialized=!0,this._isTreeAggregator=e,e&&(t.__treeTotals||(t.__treeTotals={}),t.__treeTotals[this._type]===void 0&&(t.__treeTotals[this._type]={},t.__treeTotals.sum={},t.__treeTotals.count={}),t.__treeTotals[this._type][this._field]=0,t.__treeTotals.count[this._field]=0,t.__treeTotals.sum[this._field]=0)}accumulate(t,e=!1){var n,r;const o=t!=null&&t.hasOwnProperty(this._field)?t[this._field]:null;this._isTreeAggregator?e?(t.__treeTotals||(t.__treeTotals={}),this.addGroupTotalPropertiesWhenNotExist(t.__treeTotals),this._sum=parseFloat((n=t.__treeTotals.sum[this._field])!==null&&n!==void 0?n:0),this._nonNullCount=(r=t.__treeTotals.count[this._field])!==null&&r!==void 0?r:0):en(o)&&(this._sum=parseFloat(o),this._nonNullCount=1):o!==null&&o!==""&&!isNaN(o)&&(this._nonNullCount++,this._sum+=parseFloat(o))}storeResult(t){let e=this._sum,n=this._nonNullCount;this.addGroupTotalPropertiesWhenNotExist(t),this._isTreeAggregator&&(e+=t.sum[this._field],n+=t.count[this._field],t.sum[this._field]=e,t.count[this._field]=n),n!==0&&(t[this._type][this._field]=n===0?e:e/n)}addGroupTotalPropertiesWhenNotExist(t){t[this._type]===void 0&&(t[this._type]={}),this._isTreeAggregator&&t.sum===void 0&&(t.sum={}),this._isTreeAggregator&&t.count===void 0&&(t.count={})}}const uf={Avg:Gb,Clone:Ub,Count:zb,Distinct:Vb,Min:Bb,Max:Hb,Sum:Lb};function Fu(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||je.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||je.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"?je.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_TEXT_MAX_LENGTH_INCLUSIVE:je.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 lv=qd&&lh||qd,Wb=3;class $b{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 Pn,!((e=this.gridOptions)===null||e===void 0)&&e.translater&&(this._translater=this.gridOptions.translater),this._locales=this.gridOptions&&this.gridOptions.locales||je.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?bn(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:Wb;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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 Ie("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=Mn(this.gridOptions,o)||"";return Ie("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=Mn(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,b,C,x,w;const E=(n=(e=this.columnDef)===null||e===void 0?void 0:e.id)!==null&&n!==void 0?n:"",D=(o=(r=this.columnEditor)===null||r===void 0?void 0:r.placeholder)!==null&&o!==void 0?o:"",A=(l=(s=this.columnEditor)===null||s===void 0?void 0:s.title)!==null&&l!==void 0?l:"";this._editorInputGroupElm=Ie("div",{className:"autocomplete-container input-group"});const F=Ie("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=Ie("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=Ie("input",{type:"text",placeholder:D,title:A,autocomplete:"off",ariaAutoComplete:"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=>$d(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},!((b=this._autocompleterOptions.renderItem)===null||b===void 0)&&b.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${$a(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?(Lp(this._inputElm,this._autocompleterOptions),this._instance=lv(this._autocompleterOptions)):this._instance=lv({...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 Yb{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 Pn,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=Ie("div",{className:`checkbox-editor-container editor-${u}`}),this._input=Ie("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?bn(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||je.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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,column:f,formValues:e.formValues,editors:e.editors,triggeredBy:n},{...new Slick.EventData,...t})}}const jb=cd&&On||cd,Pu=Ys||ms;class Xb{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 Pn,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=Ga(this.columnEditor.type||this.columnDef.type||ie.dateUtc),m=Ga(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 b={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
|
+
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={...b,...this.editorOptions};const C=`.editor-text.editor-${p}.form-control`;this._pickerMergedOptions.altInput&&(this._pickerMergedOptions.altInputClass="flatpickr-alt-input form-control"),this._editorInputGroupElm=Ie("div",{className:"flatpickr input-group"});const x=Ie("span",{className:"input-group-btn input-group-append",dataset:{clear:""}});this._clearButtonElm=Ie("button",{type:"button",className:"btn btn-default icon-clear"}),this._inputElm=Ie("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=jb(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(()=>_h(this.flatInstance))),tn(this._editorInputGroupElm),tn(this._inputWithDataElm),tn(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?Pu(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?Pu(e,n,!1).format(r):"",s=this._originalDate?Pu(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?bn(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 Pu(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||je.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,b=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,b),this.applyValue(t.formValues,b);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 av(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||je.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||n===0&&!/^[-+]?(\d*(\.)?(\d)*)$/.test(a)))c=!1,f=u||je.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||je.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"?je.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_NUMBER_MAX_INCLUSIVE:je.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||je.VALIDATION_EDITOR_DECIMAL_BETWEEN.replace(/{{minDecimal}}|{{maxDecimal}}/gi,m=>p[m]));return{valid:c,msg:f}}function dv(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||je.VALIDATION_REQUIRED_FIELD;else if(a!==""&&(isNaN(a)||!/^[+-]?\d+$/.test(a)))p=!1,c=n||je.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||je.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"?je.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE:je.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"?je.VALIDATION_EDITOR_INTEGER_MAX_INCLUSIVE:je.VALIDATION_EDITOR_INTEGER_MAX;c=n||f.replace(/{{maxValue}}/gi,m=>u[m])}return{valid:p,msg:c}}function qb(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||je.VALIDATION_REQUIRED_FIELD}:n!==void 0&&r!==void 0&&a!==null&&(a<n||a>r)?{valid:!1,msg:o||je.VALIDATION_EDITOR_NUMBER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi,l=>s[l])}:{valid:!0,msg:null}}class Kb{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 Pn,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 b=Ie("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:"off",ariaAutoComplete:"none",placeholder:p.placeholder||"",title:p.title||""});return v==="readonly"&&(b.readOnly=!0,v="text"),v==="number"&&(b.step=this.getInputDecimalSteps(t)),b}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?bn(e,p):e[l],f=this.validate(null,{position:n,inputValue:c});if(u){const m=bn(e,p),v=f&&f.valid?m:"",b=(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,b,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?bn(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 av(o,{...l,decimal:this.getDecimalPlaces(t),minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"integer":return dv(o,{...l,minValue:r.minValue,maxValue:r.maxValue,operatorConditionalType:r.operatorConditionalType});case"text":case"password":default:return Fu(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 b=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,D=this.grid,A=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,A),this.applyValue(e.formValues,A);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],D.onCompositeEditorChange.notify({...b,item:E,grid:D,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 Mu{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 Pn,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=Ie("input",{type:this._inputType||"text",autocomplete:"off",ariaAutoComplete:"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?bn(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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 Zb=0;class Qb extends Mu{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=Ie("input",{type:"number",autocomplete:"off",ariaAutoComplete:"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=Zb),!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?bn(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 av(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 Jb extends Mu{constructor(t){super(t,"password"),this.args=t}}class eC extends Mu{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=Ie("input",{type:"number",autocomplete:"off",ariaAutoComplete:"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?bn(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 dv(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 tC{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||je.locales,this._bindEventService=new Pn,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,b,C,x,w,E,D,A,F,N,V,Q,L,le;let ve="",J="";if(this._translater&&this._translater.translate&&this.gridOptions.enableTranslate){const De=ao(this.gridOptions),re=(e=(t=this.editorOptions.buttonTexts)===null||t===void 0?void 0:t.cancelKey)!==null&&e!==void 0?e:`${De}CANCEL`,pe=(r=(n=this.editorOptions.buttonTexts)===null||n===void 0?void 0:n.saveKey)!==null&&r!==void 0?r:`${De}SAVE`;ve=this._translater.translate(`${De}${re}`),J=this._translater.translate(`${De}${pe}`)}else ve=(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=(b=(v=this.columnDef)===null||v===void 0?void 0:v.id)!==null&&b!==void 0?b:"",ae=(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,Re=z?this.args.container:document.body;this._wrapperElm=Ie("div",{className:`slick-large-editor-text editor-${P}`,style:{position:z?"relative":"absolute"}}),Re.appendChild(this._wrapperElm),this._textareaElm=Ie("textarea",{ariaLabel:(D=(E=this.columnEditor)===null||E===void 0?void 0:E.ariaLabel)!==null&&D!==void 0?D:`${jr(P+"")} Text Editor`,cols:(F=(A=this.editorOptions)===null||A===void 0?void 0:A.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 xe=Ie("div",{className:"editor-footer"}),Oe=Ie("span",{className:"counter"});if(this._currentLengthElm=Ie("span",{className:"text-length",textContent:"0"}),Oe.appendChild(this._currentLengthElm),ae!==void 0&&(Oe.appendChild(Ie("span",{className:"separator",textContent:"/"})),Oe.appendChild(Ie("span",{className:"max-length",textContent:`${ae}`}))),xe.appendChild(Oe),!z){const De=Ie("button",{className:"btn btn-cancel btn-default btn-xs",textContent:ve},xe),re=Ie("button",{className:"btn btn-save btn-primary btn-xs",textContent:J},xe);this._bindEventService.bind(De,"click",this.cancel.bind(this)),this._bindEventService.bind(re,"click",this.save.bind(this)),this.position((le=this.args)===null||le===void 0?void 0:le.position),this._textareaElm.focus(),this._textareaElm.select()}this._wrapperElm.appendChild(xe),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?bn(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=Kn(this.args.container),f=this.args.container.offsetHeight,m=this.args.container.offsetWidth,v=this._wrapperElm.getBoundingClientRect().height||this.args.position.height,b=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 D=(l=(s=this.editorOptions)===null||s===void 0?void 0:s.position)!==null&&l!==void 0?l:"auto";if(D==="left"||D==="auto"&&E+b>x){const A=(p=(u=this.editorOptions)===null||u===void 0?void 0:u.marginRight)!==null&&p!==void 0?p:0;E-=b-m+A}(D==="top"||D==="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 Fu(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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 uv{constructor(t,e,n=-1){var r,o,s,l,u,p,c,f,m,v,b;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||je.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,renderOptionLabelAsHtml:(u=(l=this.columnEditor)===null||l===void 0?void 0:l.enableRenderHtml)!==null&&u!==void 0?u:!1,sanitizer:E=>Mn(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=(b=this._locales)===null||b===void 0?void 0:b.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 selectOptions(){return this.defaultOptions}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,b;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:"",D=(E==null?void 0:E.indexOf("."))>0,A=(b=(v=this.columnEditor)===null||v===void 0?void 0:v.serializeComplexValueFormat)!==null&&b!==void 0?b:"object";return D&&typeof c=="object"&&A==="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 D;return((D=E==null?void 0:E.toString)===null||D===void 0?void 0:D.call(E))===`${f}`});const v=(o=(r=this.collectionOptions)===null||r===void 0?void 0:r.separatorBetweenTextLabels)!==null&&o!==void 0?o:"",b=(l=(s=this.collectionOptions)===null||s===void 0?void 0:s.includePrefixSuffixToSelectedValues)!==null&&l!==void 0?l:!1,C=bs(this.collection,E=>{var D;return E.hasOwnProperty(this.valueName)&&((D=E[this.valueName])===null||D===void 0?void 0:D.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(b){let D=C[this.labelPrefixName]||"",A=C[this.labelSuffixName]||"";return D=this.enableTranslateLabel&&this._translaterService&&D&&typeof D=="string"?this._translaterService.translate(D||" "):D,A=this.enableTranslateLabel&&this._translaterService&&A&&typeof A=="string"?this._translaterService.translate(A||" "):A,[D,E,A].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
51
|
For example: { editor: { collection: [{ value: true, label: 'True' },{ value: false, label: 'False'}] } }`);if(this._collectionService=new Hp(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?bn(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||je.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=bn(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=Zp("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"&&(tn(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,b=this.serializeValue();this.validate().valid&&this.applyValue(this.dataContext,b),this.applyValue(t.formValues,b);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 iC extends uv{constructor(t,e=0){super(t,!0,e),this.args=t,this.delayOpening=e}}class nC extends uv{constructor(t,e=0){super(t,!1,e),this.args=t,this.delayOpening=e}}class rC{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 Pn,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?bn(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 qb(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,b,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:je.SLIDER_DEFAULT_MIN_VALUE),D=+((u=(l=this.columnEditor)===null||l===void 0?void 0:l.maxValue)!==null&&u!==void 0?u:je.SLIDER_DEFAULT_MAX_VALUE),A=+((c=(p=this.columnEditor)===null||p===void 0?void 0:p.valueStep)!==null&&c!==void 0?c:je.SLIDER_DEFAULT_STEP),F=(f=kl(this.columnEditor,"sliderStartValue"))!==null&&f!==void 0?f:E;this._defaultValue=+F,this._sliderTrackElm=Ie("div",{className:"slider-track"}),this._inputElm=Ie("input",{type:"range",title:w,defaultValue:`${F}`,value:`${F}`,min:`${E}`,max:`${D}`,step:`${(v=(m=this.columnEditor)===null||m===void 0?void 0:m.valueStep)!==null&&v!==void 0?v:je.SLIDER_DEFAULT_STEP}`,ariaLabel:(C=(b=this.columnEditor)===null||b===void 0?void 0:b.ariaLabel)!==null&&C!==void 0?C:`${jr(x+"")} Slider Editor`,className:`slider-editor-input editor-${x}`});const N=Ie("div",{className:"slider-container slider-editor"}),V=Ie("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=Ie("div",{className:"input-group-addon input-group-append slider-value"});this._sliderNumberElm=Ie("span",{className:"input-group-text",textContent:`${F}`}),Q.appendChild(this._sliderNumberElm),N.appendChild(Q)}return this._sliderOptions={minValue:E,maxValue:D,step:A},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,b=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],b.onCompositeEditorChange.notify({...c,item:v,grid:b,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 cf={autocompleter:$b,checkbox:Yb,date:Xb,dualInput:Kb,float:Qb,integer:eC,longText:tC,multipleSelect:iC,password:Jb,singleSelect:nC,slider:rC,text:Mu},oC=(a,t,e)=>{let n=e;return e==null&&(n=""),`<div style="float: right">${n}</div>`},sC=(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'] }}.
|