jquery.dgtable 0.5.52 → 0.5.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/jquery.dgtable.cjs.js +29 -16
- package/dist/jquery.dgtable.cjs.js.map +1 -1
- package/dist/jquery.dgtable.cjs.min.js +2 -2
- package/dist/jquery.dgtable.cjs.min.js.map +1 -1
- package/dist/jquery.dgtable.es6.js +29 -16
- package/dist/jquery.dgtable.es6.js.map +1 -1
- package/dist/jquery.dgtable.es6.min.js +2 -2
- package/dist/jquery.dgtable.es6.min.js.map +1 -1
- package/dist/jquery.dgtable.umd.js +42 -29
- package/dist/jquery.dgtable.umd.js.map +1 -1
- package/dist/jquery.dgtable.umd.min.js +2 -2
- package/dist/jquery.dgtable.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +17 -8
- package/src/row_collection.js +11 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* jquery.dgtable 0.5.
|
|
2
|
+
* jquery.dgtable 0.5.55
|
|
3
3
|
* git://github.com/danielgindi/jquery.dgtable.git
|
|
4
4
|
*/
|
|
5
|
-
import e from"jquery";import{getScrollHorz as t,setScrollHorz as o}from"@danielgindi/dom-utils/lib/ScrollHelper";import{getElementWidth as r,getElementHeight as l,setElementWidth as i}from"@danielgindi/dom-utils/lib/Css";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=function(e){return e&&e.Math==Math&&e},a=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof n&&n)||function(){return this}()||Function("return this")(),d={},u=function(e){try{return!!e()}catch(e){return!0}},h=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=Function.prototype.call,p=c.bind?c.bind(c):function(){return c.apply(c,arguments)},f={},m={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b=g&&!m.call({1:2},1);f.f=b?function(e){var t=g(this,e);return!!t&&t.enumerable}:m;var v,C,w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},y=Function.prototype,_=y.bind,R=y.call,W=_&&_.bind(R,R),T=_?function(e){return e&&W(e)}:function(e){return e&&function(){return R.apply(e,arguments)}},N=T,S=N({}.toString),M=N("".slice),F=function(e){return M(S(e),8,-1)},E=T,x=u,z=F,H=a.Object,O=E("".split),A=x((function(){return!H("z").propertyIsEnumerable(0)}))?function(e){return"String"==z(e)?O(e,""):H(e)}:H,P=a.TypeError,$=function(e){if(null==e)throw P("Can't call method on "+e);return e},L=A,k=$,I=function(e){return L(k(e))},B=function(e){return"function"==typeof e},D=B,j=function(e){return"object"==typeof e?null!==e:D(e)},V=a,U=B,q=function(e){return U(e)?e:void 0},X=function(e,t){return arguments.length<2?q(V[e]):V[e]&&V[e][t]},Y=T({}.isPrototypeOf),G=X("navigator","userAgent")||"",J=a,K=G,Q=J.process,Z=J.Deno,ee=Q&&Q.versions||Z&&Z.version,te=ee&&ee.v8;te&&(C=(v=te.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!C&&K&&(!(v=K.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=K.match(/Chrome\/(\d+)/))&&(C=+v[1]);var oe=C,re=oe,le=u,ie=!!Object.getOwnPropertySymbols&&!le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&re&&re<41})),ne=ie&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,se=X,ae=B,de=Y,ue=ne,he=a.Object,ce=ue?function(e){return"symbol"==typeof e}:function(e){var t=se("Symbol");return ae(t)&&de(t.prototype,he(e))},pe=a.String,fe=B,me=a.TypeError,ge=function(e){if(fe(e))return e;throw me(function(e){try{return pe(e)}catch(e){return"Object"}}(e)+" is not a function")},be=ge,ve=p,Ce=B,we=j,ye=a.TypeError,_e={exports:{}},Re=a,We=Object.defineProperty,Te=function(e,t){try{We(Re,e,{value:t,configurable:!0,writable:!0})}catch(o){Re[e]=t}return t},Ne=Te,Se=a["__core-js_shared__"]||Ne("__core-js_shared__",{}),Me=Se;(_e.exports=function(e,t){return Me[e]||(Me[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.2",mode:"global",copyright:"© 2022 Denis Pushkarev (zloirock.ru)"});var Fe=$,Ee=a.Object,xe=function(e){return Ee(Fe(e))},ze=xe,He=T({}.hasOwnProperty),Oe=Object.hasOwn||function(e,t){return He(ze(e),t)},Ae=T,Pe=0,$e=Math.random(),Le=Ae(1..toString),ke=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Le(++Pe+$e,36)},Ie=a,Be=_e.exports,De=Oe,je=ke,Ve=ie,Ue=ne,qe=Be("wks"),Xe=Ie.Symbol,Ye=Xe&&Xe.for,Ge=Ue?Xe:Xe&&Xe.withoutSetter||je,Je=function(e){if(!De(qe,e)||!Ve&&"string"!=typeof qe[e]){var t="Symbol."+e;Ve&&De(Xe,e)?qe[e]=Xe[e]:qe[e]=Ue&&Ye?Ye(t):Ge(t)}return qe[e]},Ke=p,Qe=j,Ze=ce,et=Je,tt=a.TypeError,ot=et("toPrimitive"),rt=function(e,t){if(!Qe(e)||Ze(e))return e;var o,r,l=null==(r=e[ot])?void 0:be(r);if(l){if(void 0===t&&(t="default"),o=Ke(l,e,t),!Qe(o)||Ze(o))return o;throw tt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var o,r;if("string"===t&&Ce(o=e.toString)&&!we(r=ve(o,e)))return r;if(Ce(o=e.valueOf)&&!we(r=ve(o,e)))return r;if("string"!==t&&Ce(o=e.toString)&&!we(r=ve(o,e)))return r;throw ye("Can't convert object to primitive value")}(e,t)},lt=ce,it=function(e){var t=rt(e,"string");return lt(t)?t:t+""},nt=j,st=a.document,at=nt(st)&&nt(st.createElement),dt=!h&&!u((function(){return 7!=Object.defineProperty((e="div",at?st.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),ut=h,ht=p,ct=f,pt=w,ft=I,mt=it,gt=Oe,bt=dt,vt=Object.getOwnPropertyDescriptor;d.f=ut?vt:function(e,t){if(e=ft(e),t=mt(t),bt)try{return vt(e,t)}catch(e){}if(gt(e,t))return pt(!ht(ct.f,e,t),e[t])};var Ct={},wt=h&&u((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),yt=a,_t=j,Rt=yt.String,Wt=yt.TypeError,Tt=function(e){if(_t(e))return e;throw Wt(Rt(e)+" is not an object")},Nt=h,St=dt,Mt=wt,Ft=Tt,Et=it,xt=a.TypeError,zt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor;Ct.f=Nt?Mt?function(e,t,o){if(Ft(e),t=Et(t),Ft(o),"function"==typeof e&&"prototype"===t&&"value"in o&&"writable"in o&&!o.writable){var r=Ht(e,t);r&&r.writable&&(e[t]=o.value,o={configurable:"configurable"in o?o.configurable:r.configurable,enumerable:"enumerable"in o?o.enumerable:r.enumerable,writable:!1})}return zt(e,t,o)}:zt:function(e,t,o){if(Ft(e),t=Et(t),Ft(o),St)try{return zt(e,t,o)}catch(e){}if("get"in o||"set"in o)throw xt("Accessors not supported");return"value"in o&&(e[t]=o.value),e};var Ot=Ct,At=w,Pt=h?function(e,t,o){return Ot.f(e,t,At(1,o))}:function(e,t,o){return e[t]=o,e},$t={exports:{}},Lt=B,kt=Se,It=T(Function.toString);Lt(kt.inspectSource)||(kt.inspectSource=function(e){return It(e)});var Bt,Dt,jt,Vt,Ut=kt.inspectSource,qt=B,Xt=Ut,Yt=a.WeakMap,Gt=qt(Yt)&&/native code/.test(Xt(Yt)),Jt=_e.exports,Kt=ke,Qt=Jt("keys"),Zt={},eo=Gt,to=a,oo=T,ro=j,lo=Pt,io=Oe,no=Se,so=Zt,ao=to.TypeError,uo=to.WeakMap;if(eo||no.state){var ho=no.state||(no.state=new uo),co=oo(ho.get),po=oo(ho.has),fo=oo(ho.set);Bt=function(e,t){if(po(ho,e))throw new ao("Object already initialized");return t.facade=e,fo(ho,e,t),t},Dt=function(e){return co(ho,e)||{}},jt=function(e){return po(ho,e)}}else{var mo=Qt[Vt="state"]||(Qt[Vt]=Kt(Vt));so[mo]=!0,Bt=function(e,t){if(io(e,mo))throw new ao("Object already initialized");return t.facade=e,lo(e,mo,t),t},Dt=function(e){return io(e,mo)?e[mo]:{}},jt=function(e){return io(e,mo)}}var go={set:Bt,get:Dt,has:jt,enforce:function(e){return jt(e)?Dt(e):Bt(e,{})},getterFor:function(e){return function(t){var o;if(!ro(t)||(o=Dt(t)).type!==e)throw ao("Incompatible receiver, "+e+" required");return o}}},bo=h,vo=Oe,Co=Function.prototype,wo=bo&&Object.getOwnPropertyDescriptor,yo=vo(Co,"name"),_o=yo&&(!bo||bo&&wo(Co,"name").configurable),Ro=a,Wo=B,To=Oe,No=Pt,So=Te,Mo=Ut,Fo=_o,Eo=go.get,xo=go.enforce,zo=String(String).split("String");($t.exports=function(e,t,o,r){var l,i=!!r&&!!r.unsafe,n=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet,a=r&&void 0!==r.name?r.name:t;Wo(o)&&("Symbol("===String(a).slice(0,7)&&(a="["+String(a).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!To(o,"name")||Fo&&o.name!==a)&&No(o,"name",a),(l=xo(o)).source||(l.source=zo.join("string"==typeof a?a:""))),e!==Ro?(i?!s&&e[t]&&(n=!0):delete e[t],n?e[t]=o:No(e,t,o)):n?e[t]=o:So(t,o)})(Function.prototype,"toString",(function(){return Wo(this)&&Eo(this).source||Mo(this)}));var Ho={},Oo=Math.ceil,Ao=Math.floor,Po=function(e){var t=+e;return t!=t||0===t?0:(t>0?Ao:Oo)(t)},$o=Po,Lo=Math.max,ko=Math.min,Io=function(e,t){var o=$o(e);return o<0?Lo(o+t,0):ko(o,t)},Bo=Po,Do=Math.min,jo=function(e){return(t=e.length)>0?Do(Bo(t),9007199254740991):0;var t},Vo=I,Uo=Io,qo=jo,Xo=function(e){return function(t,o,r){var l,i=Vo(t),n=qo(i),s=Uo(r,n);if(e&&o!=o){for(;n>s;)if((l=i[s++])!=l)return!0}else for(;n>s;s++)if((e||s in i)&&i[s]===o)return e||s||0;return!e&&-1}},Yo={includes:Xo(!0),indexOf:Xo(!1)},Go=Oe,Jo=I,Ko=Yo.indexOf,Qo=Zt,Zo=T([].push),er=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Ho.f=Object.getOwnPropertyNames||function(e){return function(e,t){var o,r=Jo(e),l=0,i=[];for(o in r)!Go(Qo,o)&&Go(r,o)&&Zo(i,o);for(;t.length>l;)Go(r,o=t[l++])&&(~Ko(i,o)||Zo(i,o));return i}(e,er)};var tr={};tr.f=Object.getOwnPropertySymbols;var or=X,rr=Ho,lr=tr,ir=Tt,nr=T([].concat),sr=or("Reflect","ownKeys")||function(e){var t=rr.f(ir(e)),o=lr.f;return o?nr(t,o(e)):t},ar=Oe,dr=sr,ur=d,hr=Ct,cr=u,pr=B,fr=/#|\.prototype\./,mr=function(e,t){var o=br[gr(e)];return o==Cr||o!=vr&&(pr(t)?cr(t):!!t)},gr=mr.normalize=function(e){return String(e).replace(fr,".").toLowerCase()},br=mr.data={},vr=mr.NATIVE="N",Cr=mr.POLYFILL="P",wr=mr,yr=a,_r=d.f,Rr=Pt,Wr=$t.exports,Tr=Te,Nr=function(e,t,o){for(var r=dr(t),l=hr.f,i=ur.f,n=0;n<r.length;n++){var s=r[n];ar(e,s)||o&&ar(o,s)||l(e,s,i(t,s))}},Sr=wr,Mr={};Mr[Je("toStringTag")]="z";var Fr,Er,xr=a,zr="[object z]"===String(Mr),Hr=B,Or=F,Ar=Je("toStringTag"),Pr=xr.Object,$r="Arguments"==Or(function(){return arguments}()),Lr=zr?Or:function(e){var t,o,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(o=function(e,t){try{return e[t]}catch(e){}}(t=Pr(e),Ar))?o:$r?Or(t):"Object"==(r=Or(t))&&Hr(t.callee)?"Arguments":r},kr=a.String,Ir=it,Br=Ct,Dr=w,jr=Io,Vr=jo,Ur=function(e,t,o){var r=Ir(t);r in e?Br.f(e,r,Dr(0,o)):e[r]=o},qr=a.Array,Xr=Math.max,Yr=function(e,t,o){for(var r=Vr(e),l=jr(t,r),i=jr(void 0===o?r:o,r),n=qr(Xr(i-l,0)),s=0;l<i;l++,s++)Ur(n,s,e[l]);return n.length=s,n},Gr=Math.floor,Jr=function(e,t){var o=e.length,r=Gr(o/2);return o<8?Kr(e,t):Qr(e,Jr(Yr(e,0,r),t),Jr(Yr(e,r),t),t)},Kr=function(e,t){for(var o,r,l=e.length,i=1;i<l;){for(r=i,o=e[i];r&&t(e[r-1],o)>0;)e[r]=e[--r];r!==i++&&(e[r]=o)}return e},Qr=function(e,t,o,r){for(var l=t.length,i=o.length,n=0,s=0;n<l||s<i;)e[n+s]=n<l&&s<i?r(t[n],o[s])<=0?t[n++]:o[s++]:n<l?t[n++]:o[s++];return e},Zr=Jr,el=u,tl=G.match(/firefox\/(\d+)/i),ol=!!tl&&+tl[1],rl=/MSIE|Trident/.test(G),ll=G.match(/AppleWebKit\/(\d+)\./),il=!!ll&&+ll[1],nl=T,sl=ge,al=xe,dl=jo,ul=function(e){if("Symbol"===Lr(e))throw TypeError("Cannot convert a Symbol value to a string");return kr(e)},hl=u,cl=Zr,pl=ol,fl=rl,ml=oe,gl=il,bl=[],vl=nl(bl.sort),Cl=nl(bl.push),wl=hl((function(){bl.sort(void 0)})),yl=hl((function(){bl.sort(null)})),_l=!!(Er=[]["sort"])&&el((function(){Er.call(null,Fr||function(){throw 1},1)})),Rl=!hl((function(){if(ml)return ml<70;if(!(pl&&pl>3)){if(fl)return!0;if(gl)return gl<603;var e,t,o,r,l="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:o=3;break;case 68:case 71:o=4;break;default:o=2}for(r=0;r<47;r++)bl.push({k:t+r,v:o})}for(bl.sort((function(e,t){return t.v-e.v})),r=0;r<bl.length;r++)t=bl[r].k.charAt(0),l.charAt(l.length-1)!==t&&(l+=t);return"DGBEFHACIJK"!==l}}));!function(e,t){var o,r,l,i,n,s=e.target,a=e.global,d=e.stat;if(o=a?yr:d?yr[s]||Tr(s,{}):(yr[s]||{}).prototype)for(r in t){if(i=t[r],l=e.noTargetGet?(n=_r(o,r))&&n.value:o[r],!Sr(a?r:s+(d?".":"#")+r,e.forced)&&void 0!==l){if(typeof i==typeof l)continue;Nr(i,l)}(e.sham||l&&l.sham)&&Rr(i,"sham",!0),Wr(o,r,i,e)}}({target:"Array",proto:!0,forced:wl||!yl||!_l||!Rl},{sort:function(e){void 0!==e&&sl(e);var t=al(this);if(Rl)return void 0===e?vl(t):vl(t,e);var o,r,l=[],i=dl(t);for(r=0;r<i;r++)r in t&&Cl(l,t[r]);for(cl(l,function(e){return function(t,o){return void 0===o?-1:void 0===t?1:void 0!==e?+e(t,o)||0:ul(t)>ul(o)?1:-1}}(e)),o=l.length,r=0;r<o;)t[r]=l[r++];for(;r<i;)delete t[r++];return t}});const Wl=Array.prototype.indexOf,Tl=function(e,t){for(let o=0,r=e.length;o>=0&&o<r;o+=1)if(t(e[o],o,e))return e[o]},Nl=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")};function Sl(){let e=[];return Object.assign(e,Sl.prototype),e.initialize.apply(e,arguments),e}Sl.prototype=[],Sl.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},Sl.prototype.add=function(e,t){let o,r;if("splice"in e&&"length"in e)if("number"==typeof t)for(o=0,r=e.length;o<r;o++)this.splice(t++,0,e[o]);else for(o=0,r=e.length;o<r;o++)this.push(e[o]);else"number"==typeof t?this.splice(t,0,e):this.push(e)},Sl.prototype.reset=function(e){this.length=0,e&&this.add(e)},Sl.prototype.filteredCollection=function(e,t){if(e&&t){let o=new Sl({sortColumn:this.sortColumn});for(let r,l=0,i=this.length;l<i;l++)r=this[l],e(r,t)&&(r.__i=l,o.push(r));return o}return null},Sl.prototype.onComparatorRequired=null,Sl.prototype.onSort=null;let Ml=Sl.prototype.sort;function Fl(e,t){let o=e.column,r=e.comparePath||o;"string"==typeof r&&(r=r.split("."));let l,i=r.length,n=i>1,s=t?1:-1,a=t?-1:1;return function(e,t){let o=e[r[0]],d=t[r[0]];if(n)for(l=1;l<i;l++)o=o&&o[r[l]],d=d&&d[r[l]];return o===d?0:null==o?s:null==d?a:o<d?s:a}}function El(){let e=[];return Object.assign(e,El.prototype),e.initialize.apply(e,arguments),e}Sl.prototype.sort=function(e){if(this.sortColumn.length){let t,o,r=[];for(t=0;t<this.sortColumn.length;t++){o=null;const e=Fl(this.sortColumn[t],this.sortColumn[t].descending);this.onComparatorRequired&&(o=this.onComparatorRequired(this.sortColumn[t].column,this.sortColumn[t].descending,e)),o||(o=e),r.push(o.bind(this))}if(1===r.length)Ml.call(this,r[0]);else{let e,l=r.length;o=function(o,i){for(t=0;t<l;t++)if(e=r[t](o,i),0!==e)return e;return e},Ml.call(this,o)}e||this.onSort&&this.onSort()}return this},El.prototype=[],El.prototype.initialize=function(){},El.prototype.get=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].name==e)return this[t];return null},El.prototype.indexOf=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].name==e)return t;return-1},El.prototype.getByOrder=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].order==e)return this[t];return null},El.prototype.normalizeOrder=function(){let e,t=[];for(e=0;e<this.length;e++)t.push(this[e]);for(t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),e=0;e<t.length;e++)t[e].order=e;return this},El.prototype.getColumns=function(){let e=[];for(let t,o=0;o<this.length;o++)t=this[o],e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},El.prototype.getVisibleColumns=function(){let e=[];for(let t,o=0;o<this.length;o++)t=this[o],t.visible&&e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},El.prototype.getMaxOrder=function(){let e=0;for(let t,o=0;o<this.length;o++)t=this[o],t.order>e&&(e=t.order);return e},El.prototype.moveColumn=function(e,t){if(e&&t){let o,r,l=e.order,i=t.order;if(l<i)for(o=l+1;o<=i;o++)r=this.getByOrder(o),r.order--;else for(o=l-1;o>=i;o--)r=this.getByOrder(o),r.order++;e.order=i}return this};const xl={};let zl=null;xl.getSupportedTransform=()=>{if(null===zl){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");zl=!1;for(let o of e)if(t&&void 0!==t.style[o]){zl=o;break}}return zl};class Hl{static saveSelection(e){let t=window.getSelection().getRangeAt(0);if(e!==t.commonAncestorContainer&&!function(e,t){for(;(e=e.parentNode)&&e!==t;);return!!e}(t.commonAncestorContainer,e))return null;let o=t.cloneRange();o.selectNodeContents(e),o.setEnd(t.startContainer,t.startOffset);let r=o.toString().length;return{start:r,end:r+t.toString().length}}static restoreSelection(e,t){let o,r=0,l=[e],i=!1,n=!1,s=document.createRange();for(s.setStart(e,0),s.collapse(!0);!n&&(o=l.pop());)if(3===o.nodeType){let e=r+o.length;!i&&t.start>=r&&t.start<=e&&(s.setStart(o,t.start-r),i=!0),i&&t.end>=r&&t.end<=e&&(s.setEnd(o,t.end-r),n=!0),r=e}else{let e=o.childNodes.length;for(;e--;)l.push(o.childNodes[e])}let a=window.getSelection();a.removeAllRanges(),a.addRange(s)}}function Ol(e,t){let o=t.column,r=null==t.keyword?"":t.keyword.toString();if(!r||!o)return!0;let l=e[o];return null!=l&&(l=l.toString(),t.caseSensitive||(l=l.toLowerCase(),r=r.toLowerCase()),-1!==l.indexOf(r))}const Al=Array.prototype.indexOf,Pl=e;let $l=navigator.userAgent,Ll=-1!==$l.indexOf("MSIE ")?parseFloat($l.substr($l.indexOf("MSIE ")+5)):null,kl=Ll&&Ll<10,Il=document.createElement.bind(document);const Bl=Object.prototype.hasOwnProperty;function Dl(e){var t,o;t=["relative","absolute","fixed"],o=e.css("position"),Wl.call(t,o)>=0||e.css("position","relative")}const jl=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let Vl=function e(){if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[e].concat(Array.prototype.slice.call(arguments,0))));this.initialize.apply(this,arguments)};Vl.VERSION="@@VERSION",Vl.prototype.VERSION=Vl.VERSION,Vl.prototype.initialize=function(e){let t=this;e=e||{};let o=t.o={},r=t.p={};r.events={},t.el=e.el&&e.el instanceof Element?e.el:document.createElement("div");let l=t.$el=Pl(t.el);t.el!==e.el&&l.addClass(e.className||"dgtable-wrapper"),l.data("control",t).data("dgtable",t),l.on("remove",(function(){t.destroy()})),r.onMouseMoveResizeAreaBound=this._onMouseMoveResizeArea.bind(this),r.onEndDragColumnHeaderBound=this._onEndDragColumnHeader.bind(this),r.onTableScrolledHorizontallyBound=this._onTableScrolledHorizontally.bind(this),this.$el.on("dragend",r.onEndDragColumnHeaderBound),r.tableSkeletonNeedsRendering=!0,o.virtualTable=void 0===e.virtualTable||!!e.virtualTable,o.rowsBufferSize=e.rowsBufferSize||3,o.minColumnWidth=Math.max(e.minColumnWidth||35,0),o.resizeAreaWidth=e.resizeAreaWidth||8,o.resizableColumns=void 0===e.resizableColumns||!!e.resizableColumns,o.movableColumns=void 0===e.movableColumns||!!e.movableColumns,o.sortableColumns=void 0===e.sortableColumns?1:parseInt(e.sortableColumns,10)||1,o.adjustColumnWidthForSortArrow=void 0===e.adjustColumnWidthForSortArrow||!!e.adjustColumnWidthForSortArrow,o.convertColumnWidthsToRelative=void 0!==e.convertColumnWidthsToRelative&&!!e.convertColumnWidthsToRelative,o.autoFillTableWidth=void 0!==e.autoFillTableWidth&&!!e.autoFillTableWidth,o.cellClasses=void 0===e.cellClasses?"":e.cellClasses,o.resizerClassName=void 0===e.resizerClassName?"dgtable-resize":e.resizerClassName,o.tableClassName=void 0===e.tableClassName?"dgtable":e.tableClassName,o.allowCellPreview=void 0===e.allowCellPreview||e.allowCellPreview,o.allowHeaderCellPreview=void 0===e.allowHeaderCellPreview||e.allowHeaderCellPreview,o.cellPreviewClassName=void 0===e.cellPreviewClassName?"dgtable-cell-preview":e.cellPreviewClassName,o.cellPreviewAutoBackground=void 0===e.cellPreviewAutoBackground||e.cellPreviewAutoBackground,o.onComparatorRequired=void 0===e.onComparatorRequired?null:e.onComparatorRequired,o.onComparatorRequired||"function"!=typeof e.comparatorCallback||(o.onComparatorRequired=e.comparatorCallback),o.width=void 0===e.width?Vl.Width.NONE:e.width,o.relativeWidthGrowsToFillWidth=void 0===e.relativeWidthGrowsToFillWidth||!!e.relativeWidthGrowsToFillWidth,o.relativeWidthShrinksToFillWidth=void 0!==e.relativeWidthShrinksToFillWidth&&!!e.relativeWidthShrinksToFillWidth,this.setCellFormatter(e.cellFormatter),this.setHeaderCellFormatter(e.headerCellFormatter),this.setFilter(e.filter),o.height=e.height,t.setColumns(e.columns||[],!1);let i=[];if(e.sortColumn){let t=e.sortColumn;if(t&&"object"!=typeof t&&(t=[t]),t instanceof Array||"object"==typeof t)for(let e=0,o=t.length;e<o;e++){let o=t[e];"string"==typeof o&&(o={column:o,descending:!1});let l=r.columns.get(o.column);l&&i.push({column:o.column,comparePath:l.comparePath||l.dataPath,descending:o.descending})}}r.rows=new Sl({sortColumn:i}),r.rows.onComparatorRequired=(e,t,r)=>{if(o.onComparatorRequired)return o.onComparatorRequired(e,t,r)},r.filteredRows=null;let n=function(e){let o=(e=e||event).fromElement||e.relatedTarget;o===this||Pl.contains(this,o)||this.__previewCell&&(o===this.__previewCell||Pl.contains(this.__previewCell,o))||t._cellMouseOverEvent.call(t,this)},s=function(e){let o=(e=e||event).toElement||e.relatedTarget;o===this||Pl.contains(this,o)||this.__previewCell&&(o===this.__previewCell||Pl.contains(this.__previewCell,o))||t._cellMouseOutEvent.call(t,this)};"addEventListener"in window?(r._bindCellHoverIn=function(e){e.__hoverIn||e.addEventListener("mouseover",e.__hoverIn=n.bind(e))},r._unbindCellHoverIn=function(e){e.__hoverIn&&(e.removeEventListener("mouseover",e.__hoverIn),e.__hoverIn=null)},r._bindCellHoverOut=function(e){return e.__hoverOut||e.addEventListener("mouseout",e.__hoverOut=s.bind(e.__cell||e)),this},r._unbindCellHoverOut=function(e){return e.__hoverOut&&(e.removeEventListener("mouseout",e.__hoverOut),e.__hoverOut=null),this}):(r._bindCellHoverIn=function(e){e.__hoverIn||e.attachEvent("mouseover",e.__hoverIn=n.bind(e))},r._unbindCellHoverIn=function(e){e.__hoverIn&&(e.detachEvent("mouseover",e.__hoverIn),e.__hoverIn=null)},r._bindCellHoverOut=function(e){e.__hoverOut||e.attachEvent("mouseout",e.__hoverOut=s.bind(e.__cell||e))},r._unbindCellHoverOut=function(e){return e.__hoverOut&&(e.detachEvent("mouseout",e.__hoverOut),e.__hoverOut=null),this})},Vl.prototype.on=function(e,t){let o=this.p.events;return"function"!=typeof t||(Bl.call(o,e)||(o[e]=[]),o[e].push({cb:t,once:!1})),this},Vl.prototype.once=function(e,t){let o=this.p.events;return"function"!=typeof t||(Bl.call(o,e)||(o[e]=[]),o[e].push({cb:t,once:!0})),this},Vl.prototype.off=function(e,t){let o=this.p.events;if(!Bl.call(o,e))return this;let r=o[e];for(let e=0;e<r.length;e++){let o=r[e];t&&o.cb!==t||r.splice(e--,1)}return this},Vl.prototype.trigger=function(e){let t=this.p.events;if(Bl.call(t,e)){let o=t[e];for(let e=0;e<o.length;e++){let t=o[e];t.once&&o.splice(e--,1),t.cb.apply(this,Array.prototype.slice.call(arguments,1))}}return this},Vl.prototype._parseColumnWidth=function(e,t){let o=Math.max(0,parseFloat(e)),r=Ul.AUTO;return o>0&&(e===o+"%"?(r=Ul.RELATIVE,o/=100):o>0&&o<1?r=Ul.RELATIVE:(o<t&&(o=t),r=Ul.ABSOLUTE)),{width:o,mode:r}},Vl.prototype._initColumnFromData=function(e){let t=this._parseColumnWidth(e.width,e.ignoreMin?0:this.o.minColumnWidth),o={name:e.name,label:void 0===e.label?e.name:e.label,width:t.width,widthMode:t.mode,resizable:void 0===e.resizable||e.resizable,sortable:void 0===e.sortable||e.sortable,movable:void 0===e.movable||e.movable,visible:void 0===e.visible||e.visible,cellClasses:void 0===e.cellClasses?this.o.cellClasses:e.cellClasses,ignoreMin:void 0!==e.ignoreMin&&!!e.ignoreMin};return o.dataPath=void 0===e.dataPath?o.name:e.dataPath,o.comparePath=void 0===e.comparePath?o.dataPath:e.comparePath,"string"==typeof o.dataPath&&(o.dataPath=o.dataPath.split(".")),"string"==typeof o.comparePath&&(o.comparePath=o.comparePath.split(".")),o},Vl.prototype.close=Vl.prototype.remove=Vl.prototype.destroy=function(){let e=this,t=e.p||{},o=e.$el;if(e.__removed)return e;if(t.$resizer&&(t.$resizer.remove(),t.$resizer=null),t.$tbody){let o=t.$tbody[0].childNodes;for(let t=0,r=o.length;t<r;t++)e.trigger("rowdestroy",o[t])}if(this._destroyHeaderCells()._unbindCellEventsForTable(),t.$table&&t.$table.empty(),t.$tbody&&t.$tbody.empty(),t.workerListeners){for(let e=0;e<t.workerListeners.length;e++){let o=t.workerListeners[e];o.worker.removeEventListener("message",o.listener,!1)}t.workerListeners.length=0}t.rows.length=t.columns.length=0,t._deferredRender&&clearTimeout(t._deferredRender);for(let t in e)Bl.call(e,t)&&(e[t]=null);return e.__removed=!0,o&&o.remove(),this},Vl.prototype._unbindCellEventsForTable=function(){const e=this.p;if(e.headerRow)for(let t=0,o=e.headerRow.childNodes,r=o.length;t<r;t++)for(let r=0,l=o[t].childNodes,i=l.length;r<i;r++)e._unbindCellHoverIn(l[r]);if(e.tbody)for(let t=0,o=e.tbody.childNodes,r=o.length;t<r;t++)this._unbindCellEventsForRow(o[t]);return this},Vl.prototype._unbindCellEventsForRow=function(e){const t=this.p;for(let o=0,r=e.childNodes,l=r.length;o<l;o++)t._unbindCellHoverIn(r[o]);return this},Vl.prototype.render=function(){const e=this.o,r=this.p;if(!this.el.offsetParent)return r._deferredRender||(r._deferredRender=setTimeout((()=>{r._deferredRender=null,!this.__removed&&this.el.offsetParent&&this.render()}))),this;let l,i;if(!0===r.tableSkeletonNeedsRendering){r.tableSkeletonNeedsRendering=!1,e.width===Vl.Width.AUTO&&this._clearSortArrows();let n=r.table&&r.table.parentNode?r.table.scrollTop:NaN,s=r.table&&r.table.parentNode?t(r.table):NaN;this._renderSkeletonBase()._renderSkeletonBody().tableWidthChanged(!0,!1)._renderSkeletonHeaderCells(),e.virtualTable||(i=(r.filteredRows||r.rows).length,l=this.renderRows(0,i-1),r.$tbody.html("").append(l)),this._updateLastCellWidthFromScrollbar(!0),this._updateTableWidth(!0);for(let e=0;e<r.rows.sortColumn.length;e++)this._showSortArrow(r.rows.sortColumn[e].column,r.rows.sortColumn[e].descending);e.adjustColumnWidthForSortArrow&&r.rows.sortColumn.length?this.tableWidthChanged(!0):e.virtualTable||this.tableWidthChanged(),isNaN(n)||(r.table.scrollTop=n),isNaN(s)||(o(r.table,s),o(r.header,s)),this.trigger("renderskeleton"),e.virtualTable&&(r.$table.on("scroll",this._onVirtualTableScrolled.bind(this)),this.render())}else if(e.virtualTable){i=(r.filteredRows||r.rows).length;let t=r.table.scrollTop,o=Math.floor((t-r.virtualRowHeightFirst)/r.virtualRowHeight)+1-e.rowsBufferSize,n=Math.ceil((t-r.virtualRowHeightFirst+r.visibleHeight)/r.virtualRowHeight)+e.rowsBufferSize;o<0&&(o=0),n>=i&&(n=i-1);let s,a=-1,d=-1,u=r.tbody.childNodes;if(u.length&&(a=u[0].rowIndex,d=u[u.length-1].rowIndex),-1!==a&&a<o){s=Math.min(d+1,o)-a;for(let e=0;e<s;e++)this.trigger("rowdestroy",u[0]),this._unbindCellEventsForRow(u[0]),r.tbody.removeChild(u[0]);a+=s,a>d&&(a=d=-1)}else if(-1!==d&&d>n){s=d-Math.max(a-1,n);for(let e=0;e<s;e++)this.trigger("rowdestroy",u[u.length-1]),this._unbindCellEventsForRow(u[u.length-1]),r.tbody.removeChild(u[u.length-1]);d<a&&(a=d=-1)}o<a&&(l=this.renderRows(o,Math.min(n,a-1)),r.$tbody.prepend(l)),(n>d||-1===d)&&(l=this.renderRows(-1===d?o:d+1,n),r.$tbody.append(l))}return this.trigger("render"),this},Vl.prototype.clearAndRender=function(e){return this.p.tableSkeletonNeedsRendering=!0,(void 0===e||e)&&this.render(),this},Vl.prototype.renderRows=function(e,t){const o=this.o,r=this.p;let l,i,n=o.tableClassName,s=n+"-row",a=n+"-cell",d=r.filteredRows||r.rows,u=!!r.filteredRows,h=o.allowCellPreview,c=r.visibleColumns,p=o.virtualTable,f=r.virtualRowHeightFirst,m=r.virtualRowHeight,g=c.length;for(let e,t=0;t<g;t++)e=c[t],e._finalWidth=e.actualWidthConsideringScrollbarWidth||e.actualWidth;let b=document.createDocumentFragment(),v=this._isTableRtl()?"right":"left";const C=xl.getSupportedTransform();for(let o=e,n=d.length;o<n&&o<=t;o++){let e=d[o];i=u?e.__i:o;let t=Il("div");t.className=s,t.rowIndex=o,t.physicalRowIndex=i;for(let o=0;o<g;o++){let l=c[o],i=Il("div");i.columnName=l.name,i.setAttribute("data-column",l.name),i.className=a,i.style.width=l._finalWidth+"px",l.cellClasses&&(i.className+=" "+l.cellClasses),h&&r._bindCellHoverIn(i),i.appendChild(Il("div")).innerHTML=this._getHtmlForCell(e,l),t.appendChild(i)}p&&(l=o>0?f+(o-1)*m:0,t.style.position="absolute",t.style[v]=0,!1===C?t.style.top=`${l}px`:(t.style.top="0px",t.style[C]=`translateY(${l}px)`)),b.appendChild(t),this.trigger("rowcreate",o,i,t,e)}return b},Vl.prototype._calculateVirtualHeight=function(){let e=this.p;if(e.tbody){let t=(e.filteredRows||e.rows).length,o=e.virtualRowHeight*t;t&&(o+=e.virtualRowHeightFirst-e.virtualRowHeight,o+=e.virtualRowHeightLast-e.virtualRowHeight),o<1&&(o=1),e.tbody.style.height=o+"px"}return this},Vl.prototype._calculateTbodyWidth=function(){const e=this.p;let t,o,l,i=this.o.tableClassName,n=i+"-row",s=i+"-cell",a=e.visibleColumns,d=a.length,u=Pl("<div>").addClass(n).css("float","left"),h=0;for(o=0;o<d;o++)l=a[o],t=Il("div"),t.className=s,t.style.width=l.actualWidth+"px",l.cellClasses&&(t.className+=" "+l.cellClasses),t.appendChild(Il("div")),u.append(t),h+=l.actualWidth;let c=Pl("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Pl("<div>").addClass(i).append(Pl("<div>").addClass(i+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Pl('<div style="border:1.5px solid #000;width:0;height:0;position:absolute;left:0;top:-9999px">').appendTo(document.body),f=parseFloat(p.css("border-width")),m=Math.round(f)!==f;p.remove();let g=r(u[0],!0,!0,!0);return g-=e.scrollbarWidth||0,m&&g++,c.remove(),g},Vl.prototype.setColumns=function(e,t){const o=this.p;e=e||[];let r=new El;for(let t=0,o=0;t<e.length;t++){let l=e[t],i=this._initColumnFromData(l);void 0!==l.order?(l.order>o&&(o=l.order+1),i.order=l.order):i.order=o++,r.push(i)}return r.normalizeOrder(),o.columns=r,o.visibleColumns=r.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this},Vl.prototype.addColumn=function(e,t,o){const r=this.p;let l=r.columns;if(e&&!l.get(e.name)){let i=null;void 0!==t&&(i=l.get(t)||l.getByOrder(t));let n=this._initColumnFromData(e);n.order=i?i.order:l.getMaxOrder()+1;for(let e=l.getMaxOrder(),t=n.order;e>=t;e--){let t=l.getByOrder(e);t&&t.order++}l.push(n),l.normalizeOrder(),r.visibleColumns=l.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(o),this.trigger("addcolumn",n.name)}return this},Vl.prototype.removeColumn=function(e,t){const o=this.p;let r=o.columns,l=r.indexOf(e);return l>-1&&(r.splice(l,1),r.normalizeOrder(),o.visibleColumns=r.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this.trigger("removecolumn",e)),this},Vl.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?Nl(e):e).safe=!0),this.o.cellFormatter=e,this},Vl.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?Nl(e):e},this},Vl.prototype.setFilter=function(e){return this.o.filter=e,this},Vl.prototype.filter=function(e){const t=this.p;let o=this.o.filter||Ol;"string"==typeof arguments[0]&&"string"==typeof arguments[1]&&(e={column:arguments[0],keyword:arguments[1],caseSensitive:arguments[2]});let r=!!t.filteredRows;return t.filteredRows&&(t.filteredRows=null),t.filterArgs=null==e?null:"object"!=typeof e||Array.isArray(e)?e:Pl.extend({},e),null!==t.filterArgs?(t.filteredRows=t.rows.filteredCollection(o,t.filterArgs),(r||t.filteredRows)&&(this.clearAndRender(),this.trigger("filter",e))):(t.filterArgs=null,t.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Vl.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Vl.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||Ol;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},Vl.prototype.setColumnLabel=function(e,t){let o=this.p.columns.get(e);if(o&&(o.label=void 0===t?o.name:t,o.element))for(let e=0;e<o.element[0].firstChild.childNodes.length;e++){let t=o.element[0].firstChild.childNodes[e];if(3===t.nodeType){t.textContent=o.label;break}}return this},Vl.prototype.moveColumn=function(e,t,o=!0){const r=this.o,l=this.p;let i,n,s=l.columns,a=o?l.visibleColumns:s.getColumns();if("string"==typeof e?i=s.get(e):"number"==typeof e&&(i=a[e]),"string"==typeof t?n=s.get(t):"number"==typeof t&&(n=a[t]),i&&n&&e!==t){let e=i.order,t=n.order,o=s.moveColumn(i,n).getVisibleColumns();if(l.visibleColumns.length!==o.length||l.visibleColumns.some(((e,t)=>e!==o[t])))if(l.visibleColumns=o,this._ensureVisibleColumns(),r.virtualTable)this.clearAndRender()._updateLastCellWidthFromScrollbar(!0);else{let o=l.$headerRow.find(">div."+r.tableClassName+"-header-cell"),i=e<t?t+1:t,n=e;o[0].parentNode.insertBefore(o[n],o[i]);let s=l.visibleColumns[e];s=(s.actualWidthConsideringScrollbarWidth||s.actualWidth)+"px";let a=l.visibleColumns[t];a=(a.actualWidthConsideringScrollbarWidth||a.actualWidth)+"px";let d=l.$tbody[0].childNodes;for(let o=0,r=d.length;o<r;o++){let r=d[o];1===r.nodeType&&(r.insertBefore(r.childNodes[n],r.childNodes[i]),r.childNodes[t].firstChild.style.width=a,r.childNodes[e].firstChild.style.width=s)}}this.trigger("movecolumn",i.name,e,t)}return this},Vl.prototype.sort=function(e,t,o){const r=this.o,l=this.p;let i=l.columns.get(e),n=l.rows.sortColumn;if(i){if(n.length&&n[n.length-1].column===e&&(t=void 0===t?!n[n.length-1].descending:t),o){for(let e=0;e<n.length;e++)if(n[e].column===i.name){e<n.length-1?n.length=0:n.splice(n.length-1,1);break}(r.sortableColumns>0&&n.length>=r.sortableColumns||n.length>=l.visibleColumns.length)&&(n.length=0)}else n.length=0;t=void 0!==t&&t,n.push({column:i.name,comparePath:i.comparePath||i.dataPath,descending:!!t})}else n.length=0;this._clearSortArrows();for(let e=0;e<n.length;e++)this._showSortArrow(n[e].column,n[e].descending);if(r.adjustColumnWidthForSortArrow&&!r._tableSkeletonNeedsRendering&&this.tableWidthChanged(!0),r.virtualTable)for(;l.tbody&&l.tbody.firstChild;)this.trigger("rowdestroy",l.tbody.firstChild),this._unbindCellEventsForRow(l.tbody.firstChild),l.tbody.removeChild(l.tbody.firstChild);else l.tableSkeletonNeedsRendering=!0;l.rows.sortColumn=n,n.length&&(l.rows.sort(!!l.filteredRows),l.filteredRows&&l.filteredRows.sort(!!l.filteredRows));let s=[];for(let e=0;e<n.length;e++)s.push({column:n[e].column,descending:n[e].descending});return this.trigger("sort",s,!0),this},Vl.prototype.resort=function(){const e=this.p;let t=e.columns,o=e.rows.sortColumn;if(o.length){for(let e=0;e<o.length;e++)t.get(o[e].column)||o.splice(e--,1);e.rows.sortColumn=o,o.length&&(e.rows.sort(!!e.filteredRows),e.filteredRows&&e.filteredRows.sort(!!e.filteredRows));let r=[];for(let e=0;e<o.length;e++)r.push({column:o[e].column,descending:o[e].descending});this.trigger("sort",r,!1)}return this},Vl.prototype._ensureVisibleColumns=function(){const e=this.p;return 0===e.visibleColumns.length&&e.columns.length&&(e.columns[0].visible=!0,e.visibleColumns.push(e.columns[0]),this.trigger("showcolumn",e.columns[0].name)),this},Vl.prototype.setColumnVisible=function(e,t){const o=this.p;let r=o.columns.get(e);return t=!!t,r&&!!r.visible!==t&&(r.visible=t,o.visibleColumns=o.columns.getVisibleColumns(),this.trigger(t?"showcolumn":"hidecolumn",e),this._ensureVisibleColumns(),this.clearAndRender()),this},Vl.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},Vl.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},Vl.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},Vl.prototype.setSortableColumns=function(e){const t=this.p,o=this.o;if(o.sortableColumns!==e&&(o.sortableColumns=e,t.$table)){let e=t.$headerRow.find(">div."+o.tableClassName+"-header-cell");for(let r=0;r<e.length;r++)Pl(e[0])[o.sortableColumns>0&&t.visibleColumns[r].sortable?"addClass":"removeClass"]("sortable")}return this},Vl.prototype.getSortableColumns=function(){return this.o.sortableColumns},Vl.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},Vl.prototype.getMovableColumns=function(){return this.o.movableColumns},Vl.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},Vl.prototype.getResizableColumns=function(){return this.o.resizableColumns},Vl.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},Vl.prototype.setColumnWidth=function(e,t){let o=this.p.columns.get(e),r=this._parseColumnWidth(t,o.ignoreMin?0:this.o.minColumnWidth);if(o){let e=this._serializeColumnWidth(o);o.width=r.width,o.widthMode=r.mode;let t=this._serializeColumnWidth(o);e!==t&&this.tableWidthChanged(!0),this.trigger("columnwidth",o.name,e,t)}return this},Vl.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},Vl.prototype.getColumnConfig=function(e){let t=this.p.columns.get(e);return t?{order:t.order,width:this._serializeColumnWidth(t),visible:t.visible,label:t.label}:null},Vl.prototype.getColumnsConfig=function(){const e=this.p;let t={};for(let o=0;o<e.columns.length;o++)t[e.columns[o].name]=this.getColumnConfig(e.columns[o].name);return t},Vl.prototype.getSortedColumns=function(){const e=this.p;let t=[];for(let o=0;o<e.rows.sortColumn.length;o++){let r=e.rows.sortColumn[o];t.push({column:r.column,descending:r.descending})}return t},Vl.prototype.getHtmlForRowCell=function(e,t){const o=this.p;if(e<0||e>o.rows.length-1)return null;let r=o.columns.get(t);if(!r)return null;let l=o.rows[e];return this._getHtmlForCell(l,r)},Vl.prototype.getHtmlForRowDataCell=function(e,t){let o=this.p.columns.get(t);return o?this._getHtmlForCell(e,o):null},Vl.prototype._getHtmlForCell=function(e,t){let o=t.dataPath,r=e[o[0]];for(let e=1;e<o.length&&null!=r;e++)r=r&&r[o[e]];const l=this.o.cellFormatter;let i;if(l.safe)i=l(r,t.name,e);else try{i=l(r,t.name,e)}catch(e){i="[ERROR]",console.error("Failed to generate content for cell "+t.name,e)}return null==i&&(i=""),i},Vl.prototype.getRowYPos=function(e){const t=this.p;if(this.o.virtualTable)return e>0?t.virtualRowHeightFirst+(e-1)*t.virtualRowHeight:0;{let o=t.tbody.childNodes[e];return o?o.offsetTop:null}},Vl.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},Vl.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},Vl.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},Vl.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},Vl.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},Vl.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},Vl.prototype.getHeaderRowElement=function(){return this.p.headerRow},Vl.prototype._horizontalPadding=function(e){return(parseFloat(Pl.css(e,"padding-left"))||0)+(parseFloat(Pl.css(e,"padding-right"))||0)},Vl.prototype._horizontalBorderWidth=function(e){return(parseFloat(Pl.css(e,"border-left"))||0)+(parseFloat(Pl.css(e,"border-right"))||0)},Vl.prototype._calculateWidthAvailableForColumns=function(){const e=this.o,t=this.p;let o,l,i;t.$table&&(l=t.table?t.table.scrollTop:0,i=t.table?t.table.scrollLeft:0,e.virtualTable&&(o=t.$table[0].style.display,t.$table[0].style.display="none"));let n=r(this.$el[0]);t.$table&&(e.virtualTable&&(t.$table[0].style.display=o),t.table.scrollTop=l,t.table.scrollLeft=i,t.header.scrollLeft=i);let s=e.tableClassName,a=Pl("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Pl("<div>").addClass(s+"-header").appendTo(a),u=Pl("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Pl("<div><div></div></div>").addClass(s+"-header-cell").addClass(t.visibleColumns[e].cellClasses||""));a.appendTo(document.body),n-=this._horizontalBorderWidth(u[0]);let h=u.find(">div."+s+"-header-cell");for(let e=0;e<h.length;e++){let t=Pl(h[e]);"border-box"===t.css("boxSizing")||(n-=(parseFloat(t.css("border-right-width"))||0)+(parseFloat(t.css("border-left-width"))||0)+this._horizontalPadding(t[0]))}return a&&a.remove(),Math.max(0,n)},Vl.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,l=Pl("<div>").addClass(this.$el).append(Pl("<div>").addClass(o+"-header").append(Pl("<div>").addClass(o+"-header-row").append(t=Pl("<div>").addClass(o+"-header-cell").append(Pl("<div>").text(e))))).css({position:"absolute",top:"-9999px",visibility:"hidden"});l.appendTo(document.body);let i=r(t[0]);return l.remove(),i},t=null;return function(o,r){let l=this.o,i=this.p,n=this._calculateWidthAvailableForColumns(),s=n,a=0;if(!i.$table)return this;r=void 0===r||r;let d=0;if(i.tbody||(r=!1),r&&(d=parseFloat(i.tbody.style.minWidth)||0),s!==t||o){t=n;let o=0,u=[],h=0;for(let e=0;e<i.columns.length;e++)i.columns[e].actualWidthConsideringScrollbarWidth=null;for(let t=0;t<i.visibleColumns.length;t++){let r=i.visibleColumns[t];if(r.widthMode===Ul.ABSOLUTE){let e=r.width;e+=r.arrowProposedWidth||0,!r.ignoreMin&&e<l.minColumnWidth&&(e=l.minColumnWidth),s-=e,o+=e,e!==r.actualWidth&&(r.actualWidth=e,u.push(t))}else if(r.widthMode===Ul.AUTO){let i=e.call(this,r.label)+20;i+=r.arrowProposedWidth||0,!r.ignoreMin&&i<l.minColumnWidth&&(i=l.minColumnWidth),s-=i,o+=i,i!==r.actualWidth&&(r.actualWidth=i,l.convertColumnWidthsToRelative||u.push(t))}else r.widthMode===Ul.RELATIVE&&(h+=r.width,a++)}if(l.convertColumnWidthsToRelative)for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];t.widthMode===Ul.AUTO&&(t.widthMode=Ul.RELATIVE,s+=t.actualWidth,t.width=t.actualWidth/o,h+=t.width,a++)}if(a&&(h<1&&l.relativeWidthGrowsToFillWidth||h>1&&l.relativeWidthShrinksToFillWidth))for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];t.widthMode===Ul.RELATIVE&&(t.width/=h)}let c=Math.max(0,s);0===c&&(c=i.table.clientWidth);let p=l.minColumnWidth/c;if(isNaN(p)&&(p=0),p>0){let e,t=0;for(let e=0;e<i.visibleColumns.length;e++){let o=i.visibleColumns[e];o.widthMode===Ul.RELATIVE&&!o.ignoreMin&&o.width<p&&(t+=p-o.width,o.width=p)}for(let o=0;o<i.visibleColumns.length;o++){let r=i.visibleColumns[o];r.widthMode===Ul.RELATIVE&&!r.ignoreMin&&r.width>p&&t>0&&(e=Math.min(t,r.width-p),r.width-=e,t-=e)}}if(l.autoFillTableWidth&&s>0){let e=0,t=s;for(let o=0;o<i.visibleColumns.length;o++){let r=i.visibleColumns[o];r.resizable||r.widthMode!==Ul.ABSOLUTE||(e+=r.width),r.widthMode===Ul.RELATIVE&&(t-=Math.round(c*r.width))}let o=(n-e)/(n-t-e)||NaN;for(let e=0;e<i.visibleColumns.length&&t>0;e++){let t=i.visibleColumns[e];if(t.resizable||t.widthMode!==Ul.ABSOLUTE)if(t.widthMode===Ul.RELATIVE)t.width*=o;else{let r=t.actualWidth*o;t.actualWidth!==r&&(t.actualWidth=r,-1===u.indexOf(e)&&u.push(e))}}}for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];if(t.widthMode===Ul.RELATIVE){let o=Math.round(c*t.width);s-=o,a--,0===a&&1===s&&(o++,s--),-1===s&&(o--,s++),o!==t.actualWidth&&(t.actualWidth=o,u.push(e))}}if(i.visibleColumns.length&&(i.visibleColumns[i.visibleColumns.length-1].actualWidthConsideringScrollbarWidth=i.visibleColumns[i.visibleColumns.length-1].actualWidth-(i.scrollbarWidth||0)),r){let e=this._calculateTbodyWidth();d<e&&this._updateTableWidth(!1);for(let e=0;e<u.length;e++)this._resizeColumnElements(u[e]);d>e&&this._updateTableWidth(!1)}}return this}}(),Vl.prototype.tableHeightChanged=function(){let e=this,t=e.o,o=e.p;if(!o.$table)return e;let r=l(e.$el[0],!0)-(parseFloat(o.$table.css("border-top-width"))||0)-(parseFloat(o.$table.css("border-bottom-width"))||0);return r!==t.height&&(t.height=r,o.tbody&&(o.tbody.style.height=Math.max(t.height-l(o.$headerRow[0],!0,!0,!0),1)+"px"),t.virtualTable&&e.clearAndRender()),e},Vl.prototype.addRows=function(e,t,o,r){let l=this,i=l.p;if("boolean"==typeof t&&(r=o,o=t,t=-1),"number"!=typeof t&&(t=-1),(t<0||t>i.rows.length)&&(t=i.rows.length),r=void 0===r||!!r,e){if(i.rows.add(e,t),i.filteredRows||o&&i.rows.sortColumn.length)o&&i.rows.sortColumn.length?this.resort():this._refilter(),i.tableSkeletonNeedsRendering=!0,r&&this.render();else if(r){let o=i.tbody.childNodes;if(l.o.virtualTable){for(;i.tbody.firstChild;)this.trigger("rowdestroy",i.tbody.firstChild),this._unbindCellEventsForRow(i.tbody.firstChild),i.tbody.removeChild(i.tbody.firstChild);this._calculateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1)}else if(i.$tbody){let r=t,n=t+e.length-1,s=l.renderRows(r,n);i.tbody.insertBefore(s,o[t]||null);for(let t=n+1;t<o.length;t++){let r=o[t];r.rowIndex+=e.length,r.physicalRowIndex+=e.length}this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)}}this.trigger("addrows",e.length,!1)}return this},Vl.prototype.removeRows=function(e,t,o){let r=this.p;if("number"!=typeof t||t<=0)return this;if(e<0||e>r.rows.length-1)return this;if(r.rows.splice(e,t),o=void 0===o||!!o,r.filteredRows)this._refilter(),r.tableSkeletonNeedsRendering=!0,o&&this.render();else if(o){let o=r.tbody.childNodes;if(this.o.virtualTable){for(;r.tbody.firstChild;)this.trigger("rowdestroy",r.tbody.firstChild),this._unbindCellEventsForRow(r.tbody.firstChild),r.tbody.removeChild(r.tbody.firstChild);this._calculateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1)}else{let l=e+t-1;for(let i=0;i<o.length;i++){let n=o[i],s=n.physicalRowIndex;s>=e?s<=l?(this.trigger("rowdestroy",n),this._unbindCellEventsForRow(n),r.tbody.removeChild(n),i--):n.physicalRowIndex-=t:n.rowIndex=i}this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)}}return this},Vl.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},Vl.prototype.refreshRow=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return this;let o=-1;if(t.filteredRows&&-1===(o=t.filteredRows.indexOf(t.rows[e])))return this;-1===o&&(o=e);let r=t.tbody.childNodes;if(this.o.virtualTable){let l=!1,i=0;for(;i<r.length;i++)if(r[i].physicalRowIndex===e){l=!0,this.trigger("rowdestroy",r[i]),this._unbindCellEventsForRow(r[i]),t.tbody.removeChild(r[i]);break}if(l){let e=this.renderRows(o,o);t.tbody.insertBefore(e,r[i]||null)}}else{this.trigger("rowdestroy",r[o]),this._unbindCellEventsForRow(r[o]),t.tbody.removeChild(r[o]);let e=this.renderRows(o,o);t.tbody.insertBefore(e,r[o]||null)}return this},Vl.prototype.getRowElement=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return null;let o=-1;if(t.filteredRows&&-1===(o=t.filteredRows.indexOf(t.rows[e])))return this;-1===o&&(o=e);let r=t.tbody.childNodes;if(!this.o.virtualTable)return r[o];for(let t=0;t<r.length;t++)if(r[t].physicalRowIndex===e)return r[t];return null},Vl.prototype.refreshAllVirtualRows=function(){const e=this.p;if(this.o.virtualTable){let t=[],o=e.tbody.childNodes;for(let r=0,l=o.length;r<l;r++)t.push(o[r].physicalRowIndex),this.trigger("rowdestroy",o[r]),this._unbindCellEventsForRow(o[r]),e.tbody.removeChild(o[r]),r--,l--;for(let o=0;o<t.length;o++){let r=this.renderRows(t[o],t[o]);e.tbody.appendChild(r)}}return this},Vl.prototype.setRows=function(e,t){let o=this.p;return o.rows.reset(e),t&&o.rows.sortColumn.length?this.resort():this._refilter(),this.clearAndRender().trigger("addrows",e.length,!0),this},Vl.prototype.getUrlForElementContent=function(e){let t,o=document.getElementById(e);if(o){let e=o.textContent;if("function"==typeof Blob)t=new Blob([e]);else{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(!o)return null;let r=new o;r.append(e),t=r.getBlob()}return(window.URL||window.webkitURL).createObjectURL(t)}return null},Vl.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},Vl.prototype.createWebWorker=function(e,t,o){if(this.isWorkerSupported()){let r=this,l=r.p,i=new Worker(e),n=function(e){e.data.append?r.addRows(e.data.rows,o):r.setRows(e.data.rows,o)};return i.addEventListener("message",n,!1),l.workerListeners||(l.workerListeners=[]),l.workerListeners.push({worker:i,listener:n}),(t||void 0===t)&&i.postMessage(null),i}return null},Vl.prototype.unbindWebWorker=function(e){let t=this.p;if(t.workerListeners)for(let o=0;o<t.workerListeners.length;o++)t.workerListeners[o].worker===e&&(e.removeEventListener("message",t.workerListeners[o].listener,!1),t.workerListeners.splice(o,1),o--);return this},Vl.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},Vl.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Pl(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},Vl.prototype._onVirtualTableScrolled=function(){this.render()},Vl.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},Vl.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=l[0];i.__cell&&(i=i.__cell,l=Pl(i));let n=l[0].previousSibling;for(;n&&1!==n.nodeType;)n=n.previousSibling;let s=!n,a=((null!=e.pageX?e.pageX:e.originalEvent.pageX)||e.originalEvent.clientX)-l.offset().left;if(o){if(!s&&r(l[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return n.columnName;if(a<=t.resizeAreaWidth/2)return i.columnName}else{if(!s&&a<=t.resizeAreaWidth/2)return n.columnName;if(r(l[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return i.columnName}return null},Vl.prototype._onTouchStartColumnHeader=function(e){const t=this.p;if(t.currentTouchId)return;let o=e.originalEvent.changedTouches[0];t.currentTouchId=o.identifier;let r,l=Pl(e.currentTarget),i={x:o.pageX,y:o.pageY},n=i,s=function(){t.currentTouchId=null,l.off("touchend").off("touchcancel"),clearTimeout(r)},a=function(t){let o=Pl.Event(t),r=Array.prototype.slice.call(arguments,1);for(let t of["target","clientX","clientY","offsetX","offsetY","screenX","screenY","pageX","pageY","which"]){o[t]=e[t];for(let e=0;e<r.length;e++)null!=r[e][t]&&(o[t]=r[e][t])}return o};l.trigger(a("mousedown",e.originalEvent.changedTouches[0],{which:1,target:e.target})),r=setTimeout((()=>{s(),l.one("touchend",(e=>{jl(e)||e.preventDefault(),l.off("touchend").off("touchcancel")})).one("touchcancel",(e=>{l.off("touchend").off("touchcancel")})),Math.sqrt(Math.pow(Math.abs(n.x-i.x),2)+Math.pow(Math.abs(n.y-i.y),2))<9&&(this.cancelColumnResize(),l.trigger(a("mouseup",e.originalEvent.changedTouches[0],{which:3,target:e.target})))}),500),l.on("touchend",(e=>{let o=Tl(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));o&&(s(),jl(e)||e.preventDefault(),n={x:o.pageX,y:o.pageY},(Math.sqrt(Math.pow(Math.abs(n.x-i.x),2)+Math.pow(Math.abs(n.y-i.y),2))<9||t.$resizer)&&(l.trigger(a("mouseup",o,{which:1,target:e.target})),l.trigger(a("click",o,{which:1,target:e.target}))))})).on("touchcancel",(()=>{s()})).on("touchmove",(e=>{let o=Tl(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));o&&(n={x:o.pageX,y:o.pageY},t.$resizer&&(e.preventDefault(),l.trigger(a("mousemove",o,{target:e.target}))))}))},Vl.prototype._onMouseDownColumnHeader=function(e){if(1!==e.which)return this;let t=this.o,o=this.p,i=this._getColumnByResizePosition(e);if(i){let n=o.columns.get(i);if(!t.resizableColumns||!n||!n.resizable)return!1;let s=this._isTableRtl();o.$resizer&&Pl(o.$resizer).remove(),o.$resizer=Pl("<div></div>").addClass(t.resizerClassName).css({position:"absolute",display:"block","z-index":-1,visibility:"hidden",width:"2px",background:"#000",opacity:.7}).appendTo(this.$el);let a=n.element,d=o.$resizer.parent(),u=a.offset(),h=d.offset();8===Ll&&(u=a.offset()),h.left+=parseFloat(d.css("border-left-width"))||0,h.top+=parseFloat(d.css("border-top-width"))||0,u.left-=h.left,u.top-=h.top,u.top-=parseFloat(a.css("border-top-width"))||0;let c=r(o.$resizer[0],!0,!0,!0);s?(u.left-=Math.ceil((parseFloat(a.css("border-left-width"))||0)/2),u.left-=Math.ceil(c/2)):(u.left+=r(a[0],!0,!0,!0),u.left+=Math.ceil((parseFloat(a.css("border-right-width"))||0)/2),u.left-=Math.ceil(c/2)),o.$resizer.css({"z-index":"10",visibility:"visible",left:u.left,top:u.top,height:l(this.$el[0])})[0].columnName=a[0].columnName;try{o.$resizer[0].style.zIndex=""}catch(e){}Pl(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Pl(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},Vl.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,o=this.p;if(t.resizableColumns){let r=this._getColumnByResizePosition(e),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0];r&&o.columns.get(r).resizable?l.style.cursor="e-resize":l.style.cursor=""}},Vl.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=o.offset();i.width=r(o[0],!0,!0,!0),i.height=l(o[0],!0,!0,!0),this.trigger("headercontextmenu",o[0].columnName,e.pageX,e.pageY,i)}return this},Vl.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},Vl.prototype._onClickColumnHeader=function(e){if(!jl(e)&&!this._getColumnByResizePosition(e)){let t=this,o=t.o,r=t.p,l=Pl(e.target).closest("div."+o.tableClassName+"-header-cell,div."+o.cellPreviewClassName)[0];if(o.sortableColumns){let e=r.columns.get(l.columnName);e&&e.sortable&&this.sort(l.columnName,void 0,!0).render()}}},Vl.prototype._onStartDragColumnHeader=function(e){let t=this.o,o=this.p;if(t.movableColumns){let r=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),l=o.columns.get(r[0].columnName);l&&l.movable?(r[0].style.opacity=.35,o.dragId=161061273*Math.random(),e.originalEvent.dataTransfer.setData("text",JSON.stringify({dragId:o.dragId,column:l.name}))):e.preventDefault()}else e.preventDefault()},Vl.prototype._onMouseMoveResizeArea=function(e){let t=this.p,o=t.columns.get(t.$resizer[0].columnName),l=this._isTableRtl(),i=o.element,n=t.$resizer.parent(),s=i.offset(),a=n.offset();a.left+=parseFloat(n.css("border-left-width"))||0,s.left-=a.left;let d=r(t.$resizer[0],!0,!0,!0),u="border-box"===i.css("box-sizing"),h=e.pageX-a.left,c=s.left;c-=Math.ceil(d/2),l?(c+=r(i[0],!0,!0,!0),c-=o.ignoreMin?0:this.o.minColumnWidth,u||(c-=Math.ceil((parseFloat(i.css("border-left-width"))||0)/2),c-=this._horizontalPadding(i[0])),h>c&&(h=c)):(c+=o.ignoreMin?0:this.o.minColumnWidth,u||(c+=Math.ceil((parseFloat(i.css("border-right-width"))||0)/2),c+=this._horizontalPadding(i[0])),h<c&&(h=c)),t.$resizer.css("left",h+"px")},Vl.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Pl(document).off("mousemove.dgtable",o.onMouseMoveResizeAreaBound).off("mouseup.dgtable",o.onEndDragColumnHeaderBound);let l=o.columns.get(o.$resizer[0].columnName),i=this._isTableRtl(),n=l.element,s=o.$resizer.parent(),a=n.offset(),d=s.offset();d.left+=parseFloat(s.css("border-left-width"))||0,a.left-=d.left;let u=r(o.$resizer[0],!0,!0,!0),h="border-box"===n.css("box-sizing"),c=e.pageX-d.left,p=a.left,f=a.left,m=0;p-=Math.ceil(u/2),i?(h||(c+=this._horizontalPadding(n[0]),c+=parseFloat(n.css("border-left-width"))||0,c+=parseFloat(n.css("border-right-width"))||0),p+=r(n[0],!0,!0,!0),f=p-(l.ignoreMin?0:this.o.minColumnWidth),c>f&&(c=f),m=p-c):(h||(c-=this._horizontalPadding(n[0]),c-=parseFloat(n.css("border-left-width"))||0,c-=parseFloat(n.css("border-right-width"))||0),f=p+(l.ignoreMin?0:this.o.minColumnWidth),c<f&&(c=f),m=c-p),o.$resizer.remove(),o.$resizer=null;let g=m;if(l.widthMode===Ul.RELATIVE){let e=this._calculateWidthAvailableForColumns(),r=0,i=0;for(let t=0;t<o.visibleColumns.length;t++){let n=o.visibleColumns[t];n.name!==l.name&&(n.widthMode===Ul.RELATIVE?(r+=n.width,i++):e-=n.actualWidth)}if(e=Math.max(1,e),g=m/e,i>0){let e=g/((1-g)/r);r+=g,(r<1&&t.relativeWidthGrowsToFillWidth||r>1&&t.relativeWidthShrinksToFillWidth)&&(g=e)}g*=100,g+="%"}this.setColumnWidth(l.name,g)}else e.target.style.opacity=null},Vl.prototype._onDragEnterColumnHeader=function(e){let t=this.o,o=this.p;if(t.movableColumns){let r=e.originalEvent.dataTransfer.getData("text");r=r?JSON.parse(r):null;let l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(!r||o.dragId===r.dragId&&l.columnName!==r.column){let e=o.columns.get(l[0].columnName);e&&(e.movable||e!==o.visibleColumns[0])&&Pl(l).addClass("drag-over")}}},Vl.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},Vl.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,o=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Pl(o[0].firstChild).has(e.originalEvent.relatedTarget).length||o.removeClass("drag-over")},Vl.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,o=this.p,r=JSON.parse(e.originalEvent.dataTransfer.getData("text")),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(t.movableColumns&&r.dragId===o.dragId){let e=r.column,t=l[0].columnName,i=o.columns.get(e),n=o.columns.get(t);i&&n&&i.movable&&(n.movable||n!==o.visibleColumns[0])&&this.moveColumn(e,t)}Pl(l).removeClass("drag-over")},Vl.prototype._clearSortArrows=function(){let e=this.p;if(e.$table){let t=this.o.tableClassName,o=e.$headerRow.find(">div."+t+"-header-cell.sorted"),r=o.find(">div>.sort-arrow");for(let t of r){let o=e.columns.get(t.parentNode.parentNode.columnName);o&&(o.arrowProposedWidth=0)}r.remove(),o.removeClass("sorted").removeClass("desc")}return this},Vl.prototype._showSortArrow=function(e,t){let o=this.p.columns.get(e);if(!o)return!1;let r=Il("span");return r.className="sort-arrow",o.element&&(o.element.addClass(t?"sorted desc":"sorted"),o.element[0].firstChild.insertBefore(r,o.element[0].firstChild.firstChild)),o.widthMode!==Ul.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(o.arrowProposedWidth=r.scrollWidth+(parseFloat(Pl(r).css("margin-right"))||0)+(parseFloat(Pl(r).css("margin-left"))||0)),this},Vl.prototype._resizeColumnElements=function(e){let t=this.p,o=t.$headerRow.find("div."+this.o.tableClassName+"-header-cell"),r=t.columns.get(o[e].columnName);if(r){o[e].style.width=(r.actualWidthConsideringScrollbarWidth||r.actualWidth)+"px";let l=(r.actualWidthConsideringScrollbarWidth||r.actualWidth)+"px",i=t.$tbody[0].childNodes;for(let t=0,o=i.length;t<o;t++){let o=i[t];1===o.nodeType&&(o.childNodes[e].style.width=l)}}return this},Vl.prototype._destroyHeaderCells=function(){let e=this.o,t=this.p;return t.$headerRow&&(this.trigger("headerrowdestroy",t.headerRow),t.$headerRow.find("div."+e.tableClassName+"-header-cell").remove(),t.$headerRow=null,t.headerRow=null),this},Vl.prototype._renderSkeletonBase=function(){let e=this,t=e.p,o=e.o;if(t.$table&&o.virtualTable){if(t.$table.remove(),t.$tbody){let o=t.$tbody[0].childNodes;for(let t=0,r=o.length;t<r;t++)e.trigger("rowdestroy",o[t]),e._unbindCellEventsForRow(o[t])}t.$table=t.table=t.$tbody=t.tbody=null}e._destroyHeaderCells(),t.currentTouchId=null,t.$header&&t.$header.remove();let r=o.tableClassName,i=Il("div"),n=Pl(i),s=Il("div"),a=Pl(s);return i.className=r+"-header",s.className=r+"-header-row",t.$header=n,t.header=i,t.$headerRow=a,t.headerRow=s,a.appendTo(t.$header),n.prependTo(this.$el),Dl(e.$el),o.width===Vl.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!o.height&&o.virtualTable&&(o.height=l(this.$el[0],!0)),this},Vl.prototype._renderSkeletonHeaderCells=function(){let e,t=this,o=t.p,r=t.o,l=r.allowCellPreview,i=r.allowHeaderCellPreview,n=r.tableClassName+"-header-cell",s=o.headerRow;kl&&(e=function(e){return e.preventDefault(),this.dragDrop(),!1});let a=function(e){e.preventDefault()};for(let d=0;d<o.visibleColumns.length;d++){let u=o.visibleColumns[d];if(u.visible){let h=Il("div"),c=Pl(h);h.draggable=!0,h.className=n,h.style.width=u.actualWidth+"px",r.sortableColumns&&u.sortable&&(h.className+=" sortable"),h.columnName=u.name,h.setAttribute("data-column",u.name);let p=Il("div");p.innerHTML=r.headerCellFormatter(u.label,u.name),h.appendChild(p),l&&i&&o._bindCellHoverIn(h),s.appendChild(h),o.visibleColumns[d].element=c,c.on("mousedown.dgtable",t._onMouseDownColumnHeader.bind(t)).on("mousemove.dgtable",t._onMouseMoveColumnHeader.bind(t)).on("mouseup.dgtable",t._onMouseUpColumnHeader.bind(t)).on("mouseleave.dgtable",t._onMouseLeaveColumnHeader.bind(t)).on("touchstart.dgtable",t._onTouchStartColumnHeader.bind(t)).on("dragstart.dgtable",t._onStartDragColumnHeader.bind(t)).on("click.dgtable",t._onClickColumnHeader.bind(t)).on("contextmenu.dgtable",a),Pl(p).on("dragenter.dgtable",t._onDragEnterColumnHeader.bind(t)).on("dragover.dgtable",t._onDragOverColumnHeader.bind(t)).on("dragleave.dgtable",t._onDragLeaveColumnHeader.bind(t)).on("drop.dgtable",t._onDropColumnHeader.bind(t)),kl&&c.on("selectstart.dgtable",e.bind(h)),c.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"})}}return this.trigger("headerrowcreate",s),this},Vl.prototype._renderSkeletonBody=function(){let e=this,t=e.p,o=e.o,r=o.tableClassName;if(o.virtualTable&&!t.virtualRowHeight){let o,i=function(){let e=Il("div"),t=e.appendChild(Il("div")),o=t.appendChild(Il("div"));return e.className=r+"-row",t.className=r+"-cell",o.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},n=Pl("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Pl("<div>").addClass(r).append(o=Pl("<div>").addClass(r+"-body").css("width",99999)));n.appendTo(document.body);let s=i(),a=i(),d=i();o.append(s,a,d),t.virtualRowHeightFirst=l(s,!0,!0,!0),t.virtualRowHeight=l(a,!0,!0,!0),t.virtualRowHeightLast=l(d,!0,!0,!0),t.virtualRowHeightMin=Math.min(Math.min(t.virtualRowHeightFirst,t.virtualRowHeight),t.virtualRowHeightLast),t.virtualRowHeightMax=Math.max(Math.max(t.virtualRowHeightFirst,t.virtualRowHeight),t.virtualRowHeightLast),n.remove()}if(!t.$table){let i=document.createDocumentFragment(),n=Il("div"),s=Pl(n);n.className=r,o.virtualTable&&(n.className+=" virtual");let a=o.height-l(t.$headerRow[0],!0,!0,!0);"border-box"!==s.css("box-sizing")&&(a-=parseFloat(s.css("border-top-width"))||0,a-=parseFloat(s.css("border-bottom-width"))||0,a-=parseFloat(s.css("padding-top"))||0,a-=parseFloat(s.css("padding-bottom"))||0),t.visibleHeight=a,n.style.height=o.height?a+"px":"auto",n.style.display="block",n.style.overflowY="auto",n.style.overflowX=o.width===Vl.Width.SCROLL?"auto":"hidden",i.appendChild(n);let d=Il("div"),u=Pl(d);d.className=o.tableClassName+"-body",t.table=n,t.tbody=d,t.$table=s,t.$tbody=u,o.virtualTable&&(t.virtualVisibleRows=Math.ceil(t.visibleHeight/t.virtualRowHeightMin)),e._calculateVirtualHeight(),Dl(u),Dl(s),n.appendChild(d),e.el.appendChild(i)}return this},Vl.prototype._renderSkeleton=function(){return this},Vl.prototype._updateLastCellWidthFromScrollbar=function(e){const t=this.p;let o=t.table.offsetWidth-t.table.clientWidth;if(o!==t.scrollbarWidth||e){t.scrollbarWidth=o;for(let e=0;e<t.columns.length;e++)t.columns[e].actualWidthConsideringScrollbarWidth=null;if(t.scrollbarWidth>0&&t.visibleColumns.length>0){let e=t.visibleColumns.length-1;t.visibleColumns[e].actualWidthConsideringScrollbarWidth=t.visibleColumns[e].actualWidth-t.scrollbarWidth;let o=t.visibleColumns[e].actualWidthConsideringScrollbarWidth+"px",r=t.tbody.childNodes;for(let t=0,l=r.length;t<l;t++){let l=r[t];1===l.nodeType&&(l.childNodes[e].style.width=o)}t.headerRow.childNodes[e].style.width=o}}return this},Vl.prototype._updateTableWidth=function(e){const t=this.o,o=this.p;let l=this._calculateTbodyWidth();if(o.tbody.style.minWidth=l+"px",o.headerRow.style.minWidth=l+(o.scrollbarWidth||0)+"px",o.$table.off("scroll",o.onTableScrolledHorizontallyBound),t.width===Vl.Width.AUTO)i(o.$table[0],r(o.$tbody[0],!0,!0,!0)),i(this.$el[0],r(o.$table[0],!0,!0,!0));else if(t.width===Vl.Width.SCROLL){if(e){let e=o.table?o.table.scrollTop:0,t=o.table?o.table.scrollLeft:0;!function(e){let t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}(this.el),o.table.scrollTop=e,o.table.scrollLeft=t,o.header.scrollLeft=t}o.$table.on("scroll",o.onTableScrolledHorizontallyBound)}return this},Vl.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},Vl.prototype._serializeColumnWidth=function(e){return e.widthMode===Ul.AUTO?"auto":e.widthMode===Ul.RELATIVE?100*e.width+"%":e.width},Vl.prototype._cellMouseOverEvent=function(e){const t=this.o,o=this.p;let i=e.firstChild;if(i.scrollWidth-i.clientWidth>1||i.scrollHeight-i.clientHeight>1){this.hideCellPreview(),o.abortCellPreview=!1;let n=Pl(e),s=Pl(i),a=Il("div"),d=Pl(a);a.innerHTML=e.innerHTML,a.className=t.cellPreviewClassName;let u=n.hasClass(t.tableClassName+"-header-cell");u&&(a.className+=" header",n.hasClass("sortable")&&(a.className+=" sortable"),a.draggable=!0,Pl(a).on("mousedown",this._onMouseDownColumnHeader.bind(this)).on("mousemove",this._onMouseMoveColumnHeader.bind(this)).on("mouseup",this._onMouseUpColumnHeader.bind(this)).on("mouseleave",this._onMouseLeaveColumnHeader.bind(this)).on("touchstart",this._onTouchStartColumnHeader.bind(this)).on("dragstart",this._onStartDragColumnHeader.bind(this)).on("click",this._onClickColumnHeader.bind(this)).on("contextmenu.dgtable",(function(e){e.preventDefault()})),Pl(a.firstChild).on("dragenter",this._onDragEnterColumnHeader.bind(this)).on("dragover",this._onDragOverColumnHeader.bind(this)).on("dragleave",this._onDragLeaveColumnHeader.bind(this)).on("drop",this._onDropColumnHeader.bind(this)),kl&&Pl(a).on("selectstart",function(e){return e.preventDefault(),this.dragDrop(),!1}.bind(a)));let h=parseFloat(n.css("padding-left"))||0,c=parseFloat(n.css("padding-right"))||0,p=parseFloat(n.css("padding-top"))||0,f=parseFloat(n.css("padding-bottom"))||0,m=i.scrollWidth+(e.clientWidth-i.offsetWidth),g="border-box"===n.css("box-sizing");if(g?d.css("box-sizing","border-box"):(m-=h+c,d.css("margin-top",parseFloat(Pl(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Pl(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Pl(e).css("background-color")}let b={"box-sizing":g?"border-box":"content-box",width:m,"min-height":l(n[0]),"padding-left":h,"padding-right":c,"padding-top":p,"padding-bottom":f,overflow:"hidden",position:"absolute","z-index":"-1",left:"0",top:"0",cursor:"default"};if(b){let t=Pl(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Pl(e.parentNode).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),b["background-color"]=t}d.css(b),this.el.appendChild(a),Pl(a.firstChild).css({direction:s.css("direction"),"white-space":s.css("white-space")}),u&&d.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"}),a.rowIndex=e.parentNode.rowIndex;let v=a.physicalRowIndex=e.parentNode.physicalRowIndex;a.columnName=o.visibleColumns[Al.call(e.parentNode.childNodes,e)].name;try{let t=Hl.saveSelection(e);t&&Hl.restoreSelection(a,t)}catch(e){}if(this.trigger("cellpreview",a.firstChild,null==v?null:v,a.columnName,null==v?null:o.rows[v],e),o.abortCellPreview)return void d.remove();let C=this.$el,w=C[0]===window?Pl(document):C,y=n.offset(),_=C.offset(),R="right"===n.css("float"),W=R?"right":"left";if(R){let e=Pl(window).width();y.right=e-(y.left+r(n[0],!0,!0,!0)),_.right=e-(_.left+r(C[0],!0,!0,!0))}y.left-=parseFloat(C.css("border-left-width"))||0,y.right-=parseFloat(C.css("border-right-width"))||0,y.top-=parseFloat(C.css("border-top-width"))||0,y[W]+=parseFloat(Pl(e).css("border-"+W+"-width"))||0,y.top+=parseFloat(Pl(e).css("border-top-width"))||parseFloat(Pl(e).css("border-bottom-width"))||0,y.left-=_.left,y.right-=_.right,y.top-=_.top;let T=0,N=C-r(d[0],!0,!0,!0);y[W]=y[W]<T?T:y[W]>N?N:y[W];let S=l(n[0],!0,!0,!0),M=w.scrollTop()+l(C[0],!0)-S;y.top>M&&(y.top=Math.max(0,M));let F={top:y.top,"z-index":9999};F[W]=y[W],d.css(F),a.__cell=e,o.$cellPreviewCell=d,e.__previewCell=a,o._bindCellHoverOut(e),o._bindCellHoverOut(a),d.on("wheel",(()=>{this.hideCellPreview()}))}},Vl.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},Vl.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,o=e.$cellPreviewCell[0],r=o.__cell;try{t=Hl.saveSelection(o)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(r),e._unbindCellHoverOut(o);try{t&&Hl.restoreSelection(r,t)}catch(e){}this.trigger("cellpreviewdestroy",o.firstChild,o.physicalRowIndex,o.columnName,r),r.__previewCell=null,o.__cell=null,e.$cellPreviewCell=null,e.abortCellPreview=!1}else e.abortCellPreview=!0;return this};const Ul={AUTO:0,ABSOLUTE:1,RELATIVE:2};Vl.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Pl.controls||(Pl.controls={}),Pl.controls.dgtable=Vl;export{Vl as default};
|
|
5
|
+
import e from"jquery";import{getScrollHorz as t,setScrollHorz as o}from"@danielgindi/dom-utils/lib/ScrollHelper";import{getElementWidth as r,getElementHeight as l,setElementWidth as i}from"@danielgindi/dom-utils/lib/Css";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=function(e){return e&&e.Math==Math&&e},a=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof n&&n)||function(){return this}()||Function("return this")(),d={},u=function(e){try{return!!e()}catch(e){return!0}},h=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=Function.prototype.call,p=c.bind?c.bind(c):function(){return c.apply(c,arguments)},f={},m={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b=g&&!m.call({1:2},1);f.f=b?function(e){var t=g(this,e);return!!t&&t.enumerable}:m;var v,C,w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},y=Function.prototype,_=y.bind,R=y.call,W=_&&_.bind(R,R),T=_?function(e){return e&&W(e)}:function(e){return e&&function(){return R.apply(e,arguments)}},N=T,S=N({}.toString),M=N("".slice),F=function(e){return M(S(e),8,-1)},E=T,x=u,z=F,H=a.Object,O=E("".split),A=x((function(){return!H("z").propertyIsEnumerable(0)}))?function(e){return"String"==z(e)?O(e,""):H(e)}:H,P=a.TypeError,$=function(e){if(null==e)throw P("Can't call method on "+e);return e},L=A,k=$,I=function(e){return L(k(e))},B=function(e){return"function"==typeof e},D=B,j=function(e){return"object"==typeof e?null!==e:D(e)},V=a,U=B,q=function(e){return U(e)?e:void 0},X=function(e,t){return arguments.length<2?q(V[e]):V[e]&&V[e][t]},Y=T({}.isPrototypeOf),G=X("navigator","userAgent")||"",J=a,K=G,Q=J.process,Z=J.Deno,ee=Q&&Q.versions||Z&&Z.version,te=ee&&ee.v8;te&&(C=(v=te.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!C&&K&&(!(v=K.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=K.match(/Chrome\/(\d+)/))&&(C=+v[1]);var oe=C,re=oe,le=u,ie=!!Object.getOwnPropertySymbols&&!le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&re&&re<41})),ne=ie&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,se=X,ae=B,de=Y,ue=ne,he=a.Object,ce=ue?function(e){return"symbol"==typeof e}:function(e){var t=se("Symbol");return ae(t)&&de(t.prototype,he(e))},pe=a.String,fe=B,me=a.TypeError,ge=function(e){if(fe(e))return e;throw me(function(e){try{return pe(e)}catch(e){return"Object"}}(e)+" is not a function")},be=ge,ve=p,Ce=B,we=j,ye=a.TypeError,_e={exports:{}},Re=a,We=Object.defineProperty,Te=function(e,t){try{We(Re,e,{value:t,configurable:!0,writable:!0})}catch(o){Re[e]=t}return t},Ne=Te,Se=a["__core-js_shared__"]||Ne("__core-js_shared__",{}),Me=Se;(_e.exports=function(e,t){return Me[e]||(Me[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.2",mode:"global",copyright:"© 2022 Denis Pushkarev (zloirock.ru)"});var Fe=$,Ee=a.Object,xe=function(e){return Ee(Fe(e))},ze=xe,He=T({}.hasOwnProperty),Oe=Object.hasOwn||function(e,t){return He(ze(e),t)},Ae=T,Pe=0,$e=Math.random(),Le=Ae(1..toString),ke=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Le(++Pe+$e,36)},Ie=a,Be=_e.exports,De=Oe,je=ke,Ve=ie,Ue=ne,qe=Be("wks"),Xe=Ie.Symbol,Ye=Xe&&Xe.for,Ge=Ue?Xe:Xe&&Xe.withoutSetter||je,Je=function(e){if(!De(qe,e)||!Ve&&"string"!=typeof qe[e]){var t="Symbol."+e;Ve&&De(Xe,e)?qe[e]=Xe[e]:qe[e]=Ue&&Ye?Ye(t):Ge(t)}return qe[e]},Ke=p,Qe=j,Ze=ce,et=Je,tt=a.TypeError,ot=et("toPrimitive"),rt=function(e,t){if(!Qe(e)||Ze(e))return e;var o,r,l=null==(r=e[ot])?void 0:be(r);if(l){if(void 0===t&&(t="default"),o=Ke(l,e,t),!Qe(o)||Ze(o))return o;throw tt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var o,r;if("string"===t&&Ce(o=e.toString)&&!we(r=ve(o,e)))return r;if(Ce(o=e.valueOf)&&!we(r=ve(o,e)))return r;if("string"!==t&&Ce(o=e.toString)&&!we(r=ve(o,e)))return r;throw ye("Can't convert object to primitive value")}(e,t)},lt=ce,it=function(e){var t=rt(e,"string");return lt(t)?t:t+""},nt=j,st=a.document,at=nt(st)&&nt(st.createElement),dt=!h&&!u((function(){return 7!=Object.defineProperty((e="div",at?st.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),ut=h,ht=p,ct=f,pt=w,ft=I,mt=it,gt=Oe,bt=dt,vt=Object.getOwnPropertyDescriptor;d.f=ut?vt:function(e,t){if(e=ft(e),t=mt(t),bt)try{return vt(e,t)}catch(e){}if(gt(e,t))return pt(!ht(ct.f,e,t),e[t])};var Ct={},wt=h&&u((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),yt=a,_t=j,Rt=yt.String,Wt=yt.TypeError,Tt=function(e){if(_t(e))return e;throw Wt(Rt(e)+" is not an object")},Nt=h,St=dt,Mt=wt,Ft=Tt,Et=it,xt=a.TypeError,zt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor;Ct.f=Nt?Mt?function(e,t,o){if(Ft(e),t=Et(t),Ft(o),"function"==typeof e&&"prototype"===t&&"value"in o&&"writable"in o&&!o.writable){var r=Ht(e,t);r&&r.writable&&(e[t]=o.value,o={configurable:"configurable"in o?o.configurable:r.configurable,enumerable:"enumerable"in o?o.enumerable:r.enumerable,writable:!1})}return zt(e,t,o)}:zt:function(e,t,o){if(Ft(e),t=Et(t),Ft(o),St)try{return zt(e,t,o)}catch(e){}if("get"in o||"set"in o)throw xt("Accessors not supported");return"value"in o&&(e[t]=o.value),e};var Ot=Ct,At=w,Pt=h?function(e,t,o){return Ot.f(e,t,At(1,o))}:function(e,t,o){return e[t]=o,e},$t={exports:{}},Lt=B,kt=Se,It=T(Function.toString);Lt(kt.inspectSource)||(kt.inspectSource=function(e){return It(e)});var Bt,Dt,jt,Vt,Ut=kt.inspectSource,qt=B,Xt=Ut,Yt=a.WeakMap,Gt=qt(Yt)&&/native code/.test(Xt(Yt)),Jt=_e.exports,Kt=ke,Qt=Jt("keys"),Zt={},eo=Gt,to=a,oo=T,ro=j,lo=Pt,io=Oe,no=Se,so=Zt,ao=to.TypeError,uo=to.WeakMap;if(eo||no.state){var ho=no.state||(no.state=new uo),co=oo(ho.get),po=oo(ho.has),fo=oo(ho.set);Bt=function(e,t){if(po(ho,e))throw new ao("Object already initialized");return t.facade=e,fo(ho,e,t),t},Dt=function(e){return co(ho,e)||{}},jt=function(e){return po(ho,e)}}else{var mo=Qt[Vt="state"]||(Qt[Vt]=Kt(Vt));so[mo]=!0,Bt=function(e,t){if(io(e,mo))throw new ao("Object already initialized");return t.facade=e,lo(e,mo,t),t},Dt=function(e){return io(e,mo)?e[mo]:{}},jt=function(e){return io(e,mo)}}var go={set:Bt,get:Dt,has:jt,enforce:function(e){return jt(e)?Dt(e):Bt(e,{})},getterFor:function(e){return function(t){var o;if(!ro(t)||(o=Dt(t)).type!==e)throw ao("Incompatible receiver, "+e+" required");return o}}},bo=h,vo=Oe,Co=Function.prototype,wo=bo&&Object.getOwnPropertyDescriptor,yo=vo(Co,"name"),_o=yo&&(!bo||bo&&wo(Co,"name").configurable),Ro=a,Wo=B,To=Oe,No=Pt,So=Te,Mo=Ut,Fo=_o,Eo=go.get,xo=go.enforce,zo=String(String).split("String");($t.exports=function(e,t,o,r){var l,i=!!r&&!!r.unsafe,n=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet,a=r&&void 0!==r.name?r.name:t;Wo(o)&&("Symbol("===String(a).slice(0,7)&&(a="["+String(a).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!To(o,"name")||Fo&&o.name!==a)&&No(o,"name",a),(l=xo(o)).source||(l.source=zo.join("string"==typeof a?a:""))),e!==Ro?(i?!s&&e[t]&&(n=!0):delete e[t],n?e[t]=o:No(e,t,o)):n?e[t]=o:So(t,o)})(Function.prototype,"toString",(function(){return Wo(this)&&Eo(this).source||Mo(this)}));var Ho={},Oo=Math.ceil,Ao=Math.floor,Po=function(e){var t=+e;return t!=t||0===t?0:(t>0?Ao:Oo)(t)},$o=Po,Lo=Math.max,ko=Math.min,Io=function(e,t){var o=$o(e);return o<0?Lo(o+t,0):ko(o,t)},Bo=Po,Do=Math.min,jo=function(e){return(t=e.length)>0?Do(Bo(t),9007199254740991):0;var t},Vo=I,Uo=Io,qo=jo,Xo=function(e){return function(t,o,r){var l,i=Vo(t),n=qo(i),s=Uo(r,n);if(e&&o!=o){for(;n>s;)if((l=i[s++])!=l)return!0}else for(;n>s;s++)if((e||s in i)&&i[s]===o)return e||s||0;return!e&&-1}},Yo={includes:Xo(!0),indexOf:Xo(!1)},Go=Oe,Jo=I,Ko=Yo.indexOf,Qo=Zt,Zo=T([].push),er=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Ho.f=Object.getOwnPropertyNames||function(e){return function(e,t){var o,r=Jo(e),l=0,i=[];for(o in r)!Go(Qo,o)&&Go(r,o)&&Zo(i,o);for(;t.length>l;)Go(r,o=t[l++])&&(~Ko(i,o)||Zo(i,o));return i}(e,er)};var tr={};tr.f=Object.getOwnPropertySymbols;var or=X,rr=Ho,lr=tr,ir=Tt,nr=T([].concat),sr=or("Reflect","ownKeys")||function(e){var t=rr.f(ir(e)),o=lr.f;return o?nr(t,o(e)):t},ar=Oe,dr=sr,ur=d,hr=Ct,cr=u,pr=B,fr=/#|\.prototype\./,mr=function(e,t){var o=br[gr(e)];return o==Cr||o!=vr&&(pr(t)?cr(t):!!t)},gr=mr.normalize=function(e){return String(e).replace(fr,".").toLowerCase()},br=mr.data={},vr=mr.NATIVE="N",Cr=mr.POLYFILL="P",wr=mr,yr=a,_r=d.f,Rr=Pt,Wr=$t.exports,Tr=Te,Nr=function(e,t,o){for(var r=dr(t),l=hr.f,i=ur.f,n=0;n<r.length;n++){var s=r[n];ar(e,s)||o&&ar(o,s)||l(e,s,i(t,s))}},Sr=wr,Mr={};Mr[Je("toStringTag")]="z";var Fr,Er,xr=a,zr="[object z]"===String(Mr),Hr=B,Or=F,Ar=Je("toStringTag"),Pr=xr.Object,$r="Arguments"==Or(function(){return arguments}()),Lr=zr?Or:function(e){var t,o,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(o=function(e,t){try{return e[t]}catch(e){}}(t=Pr(e),Ar))?o:$r?Or(t):"Object"==(r=Or(t))&&Hr(t.callee)?"Arguments":r},kr=a.String,Ir=it,Br=Ct,Dr=w,jr=Io,Vr=jo,Ur=function(e,t,o){var r=Ir(t);r in e?Br.f(e,r,Dr(0,o)):e[r]=o},qr=a.Array,Xr=Math.max,Yr=function(e,t,o){for(var r=Vr(e),l=jr(t,r),i=jr(void 0===o?r:o,r),n=qr(Xr(i-l,0)),s=0;l<i;l++,s++)Ur(n,s,e[l]);return n.length=s,n},Gr=Math.floor,Jr=function(e,t){var o=e.length,r=Gr(o/2);return o<8?Kr(e,t):Qr(e,Jr(Yr(e,0,r),t),Jr(Yr(e,r),t),t)},Kr=function(e,t){for(var o,r,l=e.length,i=1;i<l;){for(r=i,o=e[i];r&&t(e[r-1],o)>0;)e[r]=e[--r];r!==i++&&(e[r]=o)}return e},Qr=function(e,t,o,r){for(var l=t.length,i=o.length,n=0,s=0;n<l||s<i;)e[n+s]=n<l&&s<i?r(t[n],o[s])<=0?t[n++]:o[s++]:n<l?t[n++]:o[s++];return e},Zr=Jr,el=u,tl=G.match(/firefox\/(\d+)/i),ol=!!tl&&+tl[1],rl=/MSIE|Trident/.test(G),ll=G.match(/AppleWebKit\/(\d+)\./),il=!!ll&&+ll[1],nl=T,sl=ge,al=xe,dl=jo,ul=function(e){if("Symbol"===Lr(e))throw TypeError("Cannot convert a Symbol value to a string");return kr(e)},hl=u,cl=Zr,pl=ol,fl=rl,ml=oe,gl=il,bl=[],vl=nl(bl.sort),Cl=nl(bl.push),wl=hl((function(){bl.sort(void 0)})),yl=hl((function(){bl.sort(null)})),_l=!!(Er=[]["sort"])&&el((function(){Er.call(null,Fr||function(){throw 1},1)})),Rl=!hl((function(){if(ml)return ml<70;if(!(pl&&pl>3)){if(fl)return!0;if(gl)return gl<603;var e,t,o,r,l="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:o=3;break;case 68:case 71:o=4;break;default:o=2}for(r=0;r<47;r++)bl.push({k:t+r,v:o})}for(bl.sort((function(e,t){return t.v-e.v})),r=0;r<bl.length;r++)t=bl[r].k.charAt(0),l.charAt(l.length-1)!==t&&(l+=t);return"DGBEFHACIJK"!==l}}));!function(e,t){var o,r,l,i,n,s=e.target,a=e.global,d=e.stat;if(o=a?yr:d?yr[s]||Tr(s,{}):(yr[s]||{}).prototype)for(r in t){if(i=t[r],l=e.noTargetGet?(n=_r(o,r))&&n.value:o[r],!Sr(a?r:s+(d?".":"#")+r,e.forced)&&void 0!==l){if(typeof i==typeof l)continue;Nr(i,l)}(e.sham||l&&l.sham)&&Rr(i,"sham",!0),Wr(o,r,i,e)}}({target:"Array",proto:!0,forced:wl||!yl||!_l||!Rl},{sort:function(e){void 0!==e&&sl(e);var t=al(this);if(Rl)return void 0===e?vl(t):vl(t,e);var o,r,l=[],i=dl(t);for(r=0;r<i;r++)r in t&&Cl(l,t[r]);for(cl(l,function(e){return function(t,o){return void 0===o?-1:void 0===t?1:void 0!==e?+e(t,o)||0:ul(t)>ul(o)?1:-1}}(e)),o=l.length,r=0;r<o;)t[r]=l[r++];for(;r<i;)delete t[r++];return t}});const Wl=Array.prototype.indexOf,Tl=function(e,t){for(let o=0,r=e.length;o>=0&&o<r;o+=1)if(t(e[o],o,e))return e[o]},Nl=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")};function Sl(){let e=[];return Object.assign(e,Sl.prototype),e.initialize.apply(e,arguments),e}Sl.prototype=[],Sl.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},Sl.prototype.add=function(e,t){let o,r;if("splice"in e&&"length"in e)if("number"==typeof t)for(o=0,r=e.length;o<r;o++)this.splice(t++,0,e[o]);else for(o=0,r=e.length;o<r;o++)this.push(e[o]);else"number"==typeof t?this.splice(t,0,e):this.push(e)},Sl.prototype.reset=function(e){this.length=0,e&&this.add(e)},Sl.prototype.filteredCollection=function(e,t){if(e&&t){let o=new Sl({sortColumn:this.sortColumn});for(let r,l=0,i=this.length;l<i;l++)r=this[l],e(r,t)&&(r.__i=l,o.push(r));return o}return null},Sl.prototype.onComparatorRequired=null,Sl.prototype.onSort=null;let Ml=Sl.prototype.sort;function Fl(e,t){let o=e.column,r=e.comparePath||o;"string"==typeof r&&(r=r.split("."));let l,i=r.length,n=i>1,s=t?1:-1,a=t?-1:1;return function(e,t){let o=e[r[0]],d=t[r[0]];if(n)for(l=1;l<i;l++)o=o&&o[r[l]],d=d&&d[r[l]];return o===d?0:null==o?s:null==d?a:o<d?s:a}}function El(){let e=[];return Object.assign(e,El.prototype),e.initialize.apply(e,arguments),e}Sl.prototype.sort=function(e){let t;if(this.sortColumn.length){let o=[];for(let e=0;e<this.sortColumn.length;e++){t=null;const r=Fl(this.sortColumn[e],this.sortColumn[e].descending);this.onComparatorRequired&&(t=this.onComparatorRequired(this.sortColumn[e].column,this.sortColumn[e].descending,r)),t||(t=r),o.push(t.bind(this))}if(1===o.length)t=o[0],Ml.call(this,t);else{let e,r=o.length;t=function(t,l){for(let i=0;i<r;i++)if(e=o[i](t,l),0!==e)return e;return e},Ml.call(this,t)}e||this.onSort&&this.onSort(t)}return t},El.prototype=[],El.prototype.initialize=function(){},El.prototype.get=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].name==e)return this[t];return null},El.prototype.indexOf=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].name==e)return t;return-1},El.prototype.getByOrder=function(e){for(let t=0,o=this.length;t<o;t++)if(this[t].order==e)return this[t];return null},El.prototype.normalizeOrder=function(){let e,t=[];for(e=0;e<this.length;e++)t.push(this[e]);for(t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),e=0;e<t.length;e++)t[e].order=e;return this},El.prototype.getColumns=function(){let e=[];for(let t,o=0;o<this.length;o++)t=this[o],e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},El.prototype.getVisibleColumns=function(){let e=[];for(let t,o=0;o<this.length;o++)t=this[o],t.visible&&e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},El.prototype.getMaxOrder=function(){let e=0;for(let t,o=0;o<this.length;o++)t=this[o],t.order>e&&(e=t.order);return e},El.prototype.moveColumn=function(e,t){if(e&&t){let o,r,l=e.order,i=t.order;if(l<i)for(o=l+1;o<=i;o++)r=this.getByOrder(o),r.order--;else for(o=l-1;o>=i;o--)r=this.getByOrder(o),r.order++;e.order=i}return this};const xl={};let zl=null;xl.getSupportedTransform=()=>{if(null===zl){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");zl=!1;for(let o of e)if(t&&void 0!==t.style[o]){zl=o;break}}return zl};class Hl{static saveSelection(e){let t=window.getSelection().getRangeAt(0);if(e!==t.commonAncestorContainer&&!function(e,t){for(;(e=e.parentNode)&&e!==t;);return!!e}(t.commonAncestorContainer,e))return null;let o=t.cloneRange();o.selectNodeContents(e),o.setEnd(t.startContainer,t.startOffset);let r=o.toString().length;return{start:r,end:r+t.toString().length}}static restoreSelection(e,t){let o,r=0,l=[e],i=!1,n=!1,s=document.createRange();for(s.setStart(e,0),s.collapse(!0);!n&&(o=l.pop());)if(3===o.nodeType){let e=r+o.length;!i&&t.start>=r&&t.start<=e&&(s.setStart(o,t.start-r),i=!0),i&&t.end>=r&&t.end<=e&&(s.setEnd(o,t.end-r),n=!0),r=e}else{let e=o.childNodes.length;for(;e--;)l.push(o.childNodes[e])}let a=window.getSelection();a.removeAllRanges(),a.addRange(s)}}function Ol(e,t){let o=t.column,r=null==t.keyword?"":t.keyword.toString();if(!r||!o)return!0;let l=e[o];return null!=l&&(l=l.toString(),t.caseSensitive||(l=l.toLowerCase(),r=r.toLowerCase()),-1!==l.indexOf(r))}const Al=Array.prototype.indexOf,Pl=e;let $l=navigator.userAgent,Ll=-1!==$l.indexOf("MSIE ")?parseFloat($l.substr($l.indexOf("MSIE ")+5)):null,kl=Ll&&Ll<10,Il=document.createElement.bind(document);const Bl=Object.prototype.hasOwnProperty;function Dl(e){var t,o;t=["relative","absolute","fixed"],o=e.css("position"),Wl.call(t,o)>=0||e.css("position","relative")}const jl=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let Vl=function e(){if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[e].concat(Array.prototype.slice.call(arguments,0))));this.initialize.apply(this,arguments)};Vl.VERSION="@@VERSION",Vl.prototype.VERSION=Vl.VERSION,Vl.prototype.initialize=function(e){let t=this;e=e||{};let o=t.o={},r=t.p={};r.events={},t.el=e.el&&e.el instanceof Element?e.el:document.createElement("div");let l=t.$el=Pl(t.el);t.el!==e.el&&l.addClass(e.className||"dgtable-wrapper"),l.data("control",t).data("dgtable",t),l.on("remove",(function(){t.destroy()})),r.onMouseMoveResizeAreaBound=this._onMouseMoveResizeArea.bind(this),r.onEndDragColumnHeaderBound=this._onEndDragColumnHeader.bind(this),r.onTableScrolledHorizontallyBound=this._onTableScrolledHorizontally.bind(this),this.$el.on("dragend",r.onEndDragColumnHeaderBound),r.tableSkeletonNeedsRendering=!0,o.virtualTable=void 0===e.virtualTable||!!e.virtualTable,o.rowsBufferSize=e.rowsBufferSize||3,o.minColumnWidth=Math.max(e.minColumnWidth||35,0),o.resizeAreaWidth=e.resizeAreaWidth||8,o.resizableColumns=void 0===e.resizableColumns||!!e.resizableColumns,o.movableColumns=void 0===e.movableColumns||!!e.movableColumns,o.sortableColumns=void 0===e.sortableColumns?1:parseInt(e.sortableColumns,10)||1,o.adjustColumnWidthForSortArrow=void 0===e.adjustColumnWidthForSortArrow||!!e.adjustColumnWidthForSortArrow,o.convertColumnWidthsToRelative=void 0!==e.convertColumnWidthsToRelative&&!!e.convertColumnWidthsToRelative,o.autoFillTableWidth=void 0!==e.autoFillTableWidth&&!!e.autoFillTableWidth,o.cellClasses=void 0===e.cellClasses?"":e.cellClasses,o.resizerClassName=void 0===e.resizerClassName?"dgtable-resize":e.resizerClassName,o.tableClassName=void 0===e.tableClassName?"dgtable":e.tableClassName,o.allowCellPreview=void 0===e.allowCellPreview||e.allowCellPreview,o.allowHeaderCellPreview=void 0===e.allowHeaderCellPreview||e.allowHeaderCellPreview,o.cellPreviewClassName=void 0===e.cellPreviewClassName?"dgtable-cell-preview":e.cellPreviewClassName,o.cellPreviewAutoBackground=void 0===e.cellPreviewAutoBackground||e.cellPreviewAutoBackground,o.onComparatorRequired=void 0===e.onComparatorRequired?null:e.onComparatorRequired,o.onComparatorRequired||"function"!=typeof e.comparatorCallback||(o.onComparatorRequired=e.comparatorCallback),o.width=void 0===e.width?Vl.Width.NONE:e.width,o.relativeWidthGrowsToFillWidth=void 0===e.relativeWidthGrowsToFillWidth||!!e.relativeWidthGrowsToFillWidth,o.relativeWidthShrinksToFillWidth=void 0!==e.relativeWidthShrinksToFillWidth&&!!e.relativeWidthShrinksToFillWidth,this.setCellFormatter(e.cellFormatter),this.setHeaderCellFormatter(e.headerCellFormatter),this.setFilter(e.filter),o.height=e.height,t.setColumns(e.columns||[],!1);let i=[];if(e.sortColumn){let t=e.sortColumn;if(t&&"object"!=typeof t&&(t=[t]),t instanceof Array||"object"==typeof t)for(let e=0,o=t.length;e<o;e++){let o=t[e];"string"==typeof o&&(o={column:o,descending:!1});let l=r.columns.get(o.column);l&&i.push({column:o.column,comparePath:l.comparePath||l.dataPath,descending:o.descending})}}r.rows=new Sl({sortColumn:i}),r.rows.onComparatorRequired=(e,t,r)=>{if(o.onComparatorRequired)return o.onComparatorRequired(e,t,r)},r.filteredRows=null;let n=function(e){let o=(e=e||event).fromElement||e.relatedTarget;o===this||Pl.contains(this,o)||this.__previewCell&&(o===this.__previewCell||Pl.contains(this.__previewCell,o))||t._cellMouseOverEvent.call(t,this)},s=function(e){let o=(e=e||event).toElement||e.relatedTarget;o===this||Pl.contains(this,o)||this.__previewCell&&(o===this.__previewCell||Pl.contains(this.__previewCell,o))||t._cellMouseOutEvent.call(t,this)};"addEventListener"in window?(r._bindCellHoverIn=function(e){e.__hoverIn||e.addEventListener("mouseover",e.__hoverIn=n.bind(e))},r._unbindCellHoverIn=function(e){e.__hoverIn&&(e.removeEventListener("mouseover",e.__hoverIn),e.__hoverIn=null)},r._bindCellHoverOut=function(e){return e.__hoverOut||e.addEventListener("mouseout",e.__hoverOut=s.bind(e.__cell||e)),this},r._unbindCellHoverOut=function(e){return e.__hoverOut&&(e.removeEventListener("mouseout",e.__hoverOut),e.__hoverOut=null),this}):(r._bindCellHoverIn=function(e){e.__hoverIn||e.attachEvent("mouseover",e.__hoverIn=n.bind(e))},r._unbindCellHoverIn=function(e){e.__hoverIn&&(e.detachEvent("mouseover",e.__hoverIn),e.__hoverIn=null)},r._bindCellHoverOut=function(e){e.__hoverOut||e.attachEvent("mouseout",e.__hoverOut=s.bind(e.__cell||e))},r._unbindCellHoverOut=function(e){return e.__hoverOut&&(e.detachEvent("mouseout",e.__hoverOut),e.__hoverOut=null),this})},Vl.prototype.on=function(e,t){let o=this.p.events;return"function"!=typeof t||(Bl.call(o,e)||(o[e]=[]),o[e].push({cb:t,once:!1})),this},Vl.prototype.once=function(e,t){let o=this.p.events;return"function"!=typeof t||(Bl.call(o,e)||(o[e]=[]),o[e].push({cb:t,once:!0})),this},Vl.prototype.off=function(e,t){let o=this.p.events;if(!Bl.call(o,e))return this;let r=o[e];for(let e=0;e<r.length;e++){let o=r[e];t&&o.cb!==t||r.splice(e--,1)}return this},Vl.prototype.trigger=function(e){let t=this.p.events;if(Bl.call(t,e)){let o=t[e];for(let e=0;e<o.length;e++){let t=o[e];t.once&&o.splice(e--,1),t.cb.apply(this,Array.prototype.slice.call(arguments,1))}}return this},Vl.prototype._parseColumnWidth=function(e,t){let o=Math.max(0,parseFloat(e)),r=Ul.AUTO;return o>0&&(e===o+"%"?(r=Ul.RELATIVE,o/=100):o>0&&o<1?r=Ul.RELATIVE:(o<t&&(o=t),r=Ul.ABSOLUTE)),{width:o,mode:r}},Vl.prototype._initColumnFromData=function(e){let t=this._parseColumnWidth(e.width,e.ignoreMin?0:this.o.minColumnWidth),o={name:e.name,label:void 0===e.label?e.name:e.label,width:t.width,widthMode:t.mode,resizable:void 0===e.resizable||e.resizable,sortable:void 0===e.sortable||e.sortable,movable:void 0===e.movable||e.movable,visible:void 0===e.visible||e.visible,cellClasses:void 0===e.cellClasses?this.o.cellClasses:e.cellClasses,ignoreMin:void 0!==e.ignoreMin&&!!e.ignoreMin};return o.dataPath=void 0===e.dataPath?o.name:e.dataPath,o.comparePath=void 0===e.comparePath?o.dataPath:e.comparePath,"string"==typeof o.dataPath&&(o.dataPath=o.dataPath.split(".")),"string"==typeof o.comparePath&&(o.comparePath=o.comparePath.split(".")),o},Vl.prototype.close=Vl.prototype.remove=Vl.prototype.destroy=function(){let e=this,t=e.p||{},o=e.$el;if(e.__removed)return e;if(t.$resizer&&(t.$resizer.remove(),t.$resizer=null),t.$tbody){let o=t.$tbody[0].childNodes;for(let t=0,r=o.length;t<r;t++)e.trigger("rowdestroy",o[t])}if(this._destroyHeaderCells()._unbindCellEventsForTable(),t.$table&&t.$table.empty(),t.$tbody&&t.$tbody.empty(),t.workerListeners){for(let e=0;e<t.workerListeners.length;e++){let o=t.workerListeners[e];o.worker.removeEventListener("message",o.listener,!1)}t.workerListeners.length=0}t.rows.length=t.columns.length=0,t._deferredRender&&clearTimeout(t._deferredRender);for(let t in e)Bl.call(e,t)&&(e[t]=null);return e.__removed=!0,o&&o.remove(),this},Vl.prototype._unbindCellEventsForTable=function(){const e=this.p;if(e.headerRow)for(let t=0,o=e.headerRow.childNodes,r=o.length;t<r;t++)for(let r=0,l=o[t].childNodes,i=l.length;r<i;r++)e._unbindCellHoverIn(l[r]);if(e.tbody)for(let t=0,o=e.tbody.childNodes,r=o.length;t<r;t++)this._unbindCellEventsForRow(o[t]);return this},Vl.prototype._unbindCellEventsForRow=function(e){const t=this.p;for(let o=0,r=e.childNodes,l=r.length;o<l;o++)t._unbindCellHoverIn(r[o]);return this},Vl.prototype.render=function(){const e=this.o,r=this.p;if(!this.el.offsetParent)return r._deferredRender||(r._deferredRender=setTimeout((()=>{r._deferredRender=null,!this.__removed&&this.el.offsetParent&&this.render()}))),this;let l,i;if(!0===r.tableSkeletonNeedsRendering){r.tableSkeletonNeedsRendering=!1,e.width===Vl.Width.AUTO&&this._clearSortArrows();let n=r.table&&r.table.parentNode?r.table.scrollTop:NaN,s=r.table&&r.table.parentNode?t(r.table):NaN;this._renderSkeletonBase()._renderSkeletonBody().tableWidthChanged(!0,!1)._renderSkeletonHeaderCells(),e.virtualTable||(i=(r.filteredRows||r.rows).length,l=this.renderRows(0,i-1),r.$tbody.html("").append(l)),this._updateLastCellWidthFromScrollbar(!0),this._updateTableWidth(!0);for(let e=0;e<r.rows.sortColumn.length;e++)this._showSortArrow(r.rows.sortColumn[e].column,r.rows.sortColumn[e].descending);e.adjustColumnWidthForSortArrow&&r.rows.sortColumn.length?this.tableWidthChanged(!0):e.virtualTable||this.tableWidthChanged(),isNaN(n)||(r.table.scrollTop=n),isNaN(s)||(o(r.table,s),o(r.header,s)),this.trigger("renderskeleton"),e.virtualTable&&(r.$table.on("scroll",this._onVirtualTableScrolled.bind(this)),this.render())}else if(e.virtualTable){i=(r.filteredRows||r.rows).length;let t=r.table.scrollTop,o=Math.floor((t-r.virtualRowHeightFirst)/r.virtualRowHeight)+1-e.rowsBufferSize,n=Math.ceil((t-r.virtualRowHeightFirst+r.visibleHeight)/r.virtualRowHeight)+e.rowsBufferSize;o<0&&(o=0),n>=i&&(n=i-1);let s,a=-1,d=-1,u=r.tbody.childNodes;if(u.length&&(a=u[0].rowIndex,d=u[u.length-1].rowIndex),-1!==a&&a<o){s=Math.min(d+1,o)-a;for(let e=0;e<s;e++)this.trigger("rowdestroy",u[0]),this._unbindCellEventsForRow(u[0]),r.tbody.removeChild(u[0]);a+=s,a>d&&(a=d=-1)}else if(-1!==d&&d>n){s=d-Math.max(a-1,n);for(let e=0;e<s;e++)this.trigger("rowdestroy",u[u.length-1]),this._unbindCellEventsForRow(u[u.length-1]),r.tbody.removeChild(u[u.length-1]);d<a&&(a=d=-1)}o<a&&(l=this.renderRows(o,Math.min(n,a-1)),r.$tbody.prepend(l)),(n>d||-1===d)&&(l=this.renderRows(-1===d?o:d+1,n),r.$tbody.append(l))}return this.trigger("render"),this},Vl.prototype.clearAndRender=function(e){return this.p.tableSkeletonNeedsRendering=!0,(void 0===e||e)&&this.render(),this},Vl.prototype.renderRows=function(e,t){const o=this.o,r=this.p;let l,i=o.tableClassName,n=i+"-row",s=i+"-row-alt",a=i+"-cell",d=r.filteredRows||r.rows,u=!!r.filteredRows,h=o.allowCellPreview,c=r.visibleColumns,p=o.virtualTable,f=r.virtualRowHeightFirst,m=r.virtualRowHeight,g=c.length;for(let e,t=0;t<g;t++)e=c[t],e._finalWidth=e.actualWidthConsideringScrollbarWidth||e.actualWidth;let b=document.createDocumentFragment(),v=this._isTableRtl()?"right":"left";const C=xl.getSupportedTransform();for(let o=e,i=d.length;o<i&&o<=t;o++){let e=d[o],t=u?e.__i:o,i=Il("div");i.className=n,o%2==1&&(i.className+=" "+s),i.rowIndex=o,i.physicalRowIndex=t;for(let t=0;t<g;t++){let o=c[t],l=Il("div");l.columnName=o.name,l.setAttribute("data-column",o.name),l.className=a,l.style.width=o._finalWidth+"px",o.cellClasses&&(l.className+=" "+o.cellClasses),h&&r._bindCellHoverIn(l),l.appendChild(Il("div")).innerHTML=this._getHtmlForCell(e,o),i.appendChild(l)}p&&(l=o>0?f+(o-1)*m:0,i.style.position="absolute",i.style[v]=0,!1===C?i.style.top=`${l}px`:(i.style.top="0px",i.style[C]=`translateY(${l}px)`)),b.appendChild(i),this.trigger("rowcreate",o,t,i,e);let w=o;i.addEventListener("click",(o=>{this.trigger("rowclick",o,w,t,i,e)}))}return b},Vl.prototype._calculateVirtualHeight=function(){let e=this.p;if(e.tbody){let t=(e.filteredRows||e.rows).length,o=e.virtualRowHeight*t;t&&(o+=e.virtualRowHeightFirst-e.virtualRowHeight,o+=e.virtualRowHeightLast-e.virtualRowHeight),o<1&&(o=1),e.tbody.style.height=o+"px"}return this},Vl.prototype._calculateTbodyWidth=function(){const e=this.p;let t,o,l,i=this.o.tableClassName,n=i+"-row",s=i+"-cell",a=e.visibleColumns,d=a.length,u=Pl("<div>").addClass(n).css("float","left"),h=0;for(o=0;o<d;o++)l=a[o],t=Il("div"),t.className=s,t.style.width=l.actualWidth+"px",l.cellClasses&&(t.className+=" "+l.cellClasses),t.appendChild(Il("div")),u.append(t),h+=l.actualWidth;let c=Pl("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Pl("<div>").addClass(i).append(Pl("<div>").addClass(i+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Pl('<div style="border:1.5px solid #000;width:0;height:0;position:absolute;left:0;top:-9999px">').appendTo(document.body),f=parseFloat(p.css("border-width")),m=Math.round(f)!==f;p.remove();let g=r(u[0],!0,!0,!0);return g-=e.scrollbarWidth||0,m&&g++,c.remove(),g},Vl.prototype.setColumns=function(e,t){const o=this.p;e=e||[];let r=new El;for(let t=0,o=0;t<e.length;t++){let l=e[t],i=this._initColumnFromData(l);void 0!==l.order?(l.order>o&&(o=l.order+1),i.order=l.order):i.order=o++,r.push(i)}return r.normalizeOrder(),o.columns=r,o.visibleColumns=r.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this},Vl.prototype.addColumn=function(e,t,o){const r=this.p;let l=r.columns;if(e&&!l.get(e.name)){let i=null;void 0!==t&&(i=l.get(t)||l.getByOrder(t));let n=this._initColumnFromData(e);n.order=i?i.order:l.getMaxOrder()+1;for(let e=l.getMaxOrder(),t=n.order;e>=t;e--){let t=l.getByOrder(e);t&&t.order++}l.push(n),l.normalizeOrder(),r.visibleColumns=l.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(o),this.trigger("addcolumn",n.name)}return this},Vl.prototype.removeColumn=function(e,t){const o=this.p;let r=o.columns,l=r.indexOf(e);return l>-1&&(r.splice(l,1),r.normalizeOrder(),o.visibleColumns=r.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this.trigger("removecolumn",e)),this},Vl.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?Nl(e):e).safe=!0),this.o.cellFormatter=e,this},Vl.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?Nl(e):e},this},Vl.prototype.setFilter=function(e){return this.o.filter=e,this},Vl.prototype.filter=function(e){const t=this.p;let o=this.o.filter||Ol;"string"==typeof arguments[0]&&"string"==typeof arguments[1]&&(e={column:arguments[0],keyword:arguments[1],caseSensitive:arguments[2]});let r=!!t.filteredRows;return t.filteredRows&&(t.filteredRows=null),t.filterArgs=null==e?null:"object"!=typeof e||Array.isArray(e)?e:Pl.extend({},e),null!==t.filterArgs?(t.filteredRows=t.rows.filteredCollection(o,t.filterArgs),(r||t.filteredRows)&&(this.clearAndRender(),this.trigger("filter",e))):(t.filterArgs=null,t.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Vl.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Vl.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||Ol;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},Vl.prototype.setColumnLabel=function(e,t){let o=this.p.columns.get(e);if(o&&(o.label=void 0===t?o.name:t,o.element))for(let e=0;e<o.element[0].firstChild.childNodes.length;e++){let t=o.element[0].firstChild.childNodes[e];if(3===t.nodeType){t.textContent=o.label;break}}return this},Vl.prototype.moveColumn=function(e,t,o=!0){const r=this.o,l=this.p;let i,n,s=l.columns,a=o?l.visibleColumns:s.getColumns();if("string"==typeof e?i=s.get(e):"number"==typeof e&&(i=a[e]),"string"==typeof t?n=s.get(t):"number"==typeof t&&(n=a[t]),i&&n&&e!==t){let e=i.order,t=n.order,o=s.moveColumn(i,n).getVisibleColumns();if(l.visibleColumns.length!==o.length||l.visibleColumns.some(((e,t)=>e!==o[t])))if(l.visibleColumns=o,this._ensureVisibleColumns(),r.virtualTable)this.clearAndRender()._updateLastCellWidthFromScrollbar(!0);else{let o=l.$headerRow.find(">div."+r.tableClassName+"-header-cell"),i=e<t?t+1:t,n=e;o[0].parentNode.insertBefore(o[n],o[i]);let s=l.visibleColumns[e];s=(s.actualWidthConsideringScrollbarWidth||s.actualWidth)+"px";let a=l.visibleColumns[t];a=(a.actualWidthConsideringScrollbarWidth||a.actualWidth)+"px";let d=l.$tbody[0].childNodes;for(let o=0,r=d.length;o<r;o++){let r=d[o];1===r.nodeType&&(r.insertBefore(r.childNodes[n],r.childNodes[i]),r.childNodes[t].firstChild.style.width=a,r.childNodes[e].firstChild.style.width=s)}}this.trigger("movecolumn",i.name,e,t)}return this},Vl.prototype.sort=function(e,t,o){const r=this.o,l=this.p;let i,n=l.columns.get(e),s=l.rows.sortColumn;if(n){if(s.length&&s[s.length-1].column===e&&(t=void 0===t?!s[s.length-1].descending:t),o){for(let e=0;e<s.length;e++)if(s[e].column===n.name){e<s.length-1?s.length=0:s.splice(s.length-1,1);break}(r.sortableColumns>0&&s.length>=r.sortableColumns||s.length>=l.visibleColumns.length)&&(s.length=0)}else s.length=0;t=void 0!==t&&t,s.push({column:n.name,comparePath:n.comparePath||n.dataPath,descending:!!t})}else s.length=0;this._clearSortArrows();for(let e=0;e<s.length;e++)this._showSortArrow(s[e].column,s[e].descending);if(r.adjustColumnWidthForSortArrow&&!r._tableSkeletonNeedsRendering&&this.tableWidthChanged(!0),r.virtualTable)for(;l.tbody&&l.tbody.firstChild;)this.trigger("rowdestroy",l.tbody.firstChild),this._unbindCellEventsForRow(l.tbody.firstChild),l.tbody.removeChild(l.tbody.firstChild);else l.tableSkeletonNeedsRendering=!0;l.rows.sortColumn=s,s.length&&(i=l.rows.sort(!!l.filteredRows),l.filteredRows&&l.filteredRows.sort(!!l.filteredRows));let a=[];for(let e=0;e<s.length;e++)a.push({column:s[e].column,descending:s[e].descending});return this.trigger("sort",a,!0,i),this},Vl.prototype.resort=function(){const e=this.p;let t=e.columns,o=e.rows.sortColumn;if(o.length){for(let e=0;e<o.length;e++)t.get(o[e].column)||o.splice(e--,1);let r;e.rows.sortColumn=o,o.length&&(r=e.rows.sort(!!e.filteredRows),e.filteredRows&&e.filteredRows.sort(!!e.filteredRows));let l=[];for(let e=0;e<o.length;e++)l.push({column:o[e].column,descending:o[e].descending});this.trigger("sort",l,!1,r)}return this},Vl.prototype._ensureVisibleColumns=function(){const e=this.p;return 0===e.visibleColumns.length&&e.columns.length&&(e.columns[0].visible=!0,e.visibleColumns.push(e.columns[0]),this.trigger("showcolumn",e.columns[0].name)),this},Vl.prototype.setColumnVisible=function(e,t){const o=this.p;let r=o.columns.get(e);return t=!!t,r&&!!r.visible!==t&&(r.visible=t,o.visibleColumns=o.columns.getVisibleColumns(),this.trigger(t?"showcolumn":"hidecolumn",e),this._ensureVisibleColumns(),this.clearAndRender()),this},Vl.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},Vl.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},Vl.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},Vl.prototype.setSortableColumns=function(e){const t=this.p,o=this.o;if(o.sortableColumns!==e&&(o.sortableColumns=e,t.$table)){let e=t.$headerRow.find(">div."+o.tableClassName+"-header-cell");for(let r=0;r<e.length;r++)Pl(e[0])[o.sortableColumns>0&&t.visibleColumns[r].sortable?"addClass":"removeClass"]("sortable")}return this},Vl.prototype.getSortableColumns=function(){return this.o.sortableColumns},Vl.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},Vl.prototype.getMovableColumns=function(){return this.o.movableColumns},Vl.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},Vl.prototype.getResizableColumns=function(){return this.o.resizableColumns},Vl.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},Vl.prototype.setColumnWidth=function(e,t){let o=this.p.columns.get(e),r=this._parseColumnWidth(t,o.ignoreMin?0:this.o.minColumnWidth);if(o){let e=this._serializeColumnWidth(o);o.width=r.width,o.widthMode=r.mode;let t=this._serializeColumnWidth(o);e!==t&&this.tableWidthChanged(!0),this.trigger("columnwidth",o.name,e,t)}return this},Vl.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},Vl.prototype.getColumnConfig=function(e){let t=this.p.columns.get(e);return t?{order:t.order,width:this._serializeColumnWidth(t),visible:t.visible,label:t.label}:null},Vl.prototype.getColumnsConfig=function(){const e=this.p;let t={};for(let o=0;o<e.columns.length;o++)t[e.columns[o].name]=this.getColumnConfig(e.columns[o].name);return t},Vl.prototype.getSortedColumns=function(){const e=this.p;let t=[];for(let o=0;o<e.rows.sortColumn.length;o++){let r=e.rows.sortColumn[o];t.push({column:r.column,descending:r.descending})}return t},Vl.prototype.getHtmlForRowCell=function(e,t){const o=this.p;if(e<0||e>o.rows.length-1)return null;let r=o.columns.get(t);if(!r)return null;let l=o.rows[e];return this._getHtmlForCell(l,r)},Vl.prototype.getHtmlForRowDataCell=function(e,t){let o=this.p.columns.get(t);return o?this._getHtmlForCell(e,o):null},Vl.prototype._getHtmlForCell=function(e,t){let o=t.dataPath,r=e[o[0]];for(let e=1;e<o.length&&null!=r;e++)r=r&&r[o[e]];const l=this.o.cellFormatter;let i;if(l.safe)i=l(r,t.name,e);else try{i=l(r,t.name,e)}catch(e){i="[ERROR]",console.error("Failed to generate content for cell "+t.name,e)}return null==i&&(i=""),i},Vl.prototype.getRowYPos=function(e){const t=this.p;if(this.o.virtualTable)return e>0?t.virtualRowHeightFirst+(e-1)*t.virtualRowHeight:0;{let o=t.tbody.childNodes[e];return o?o.offsetTop:null}},Vl.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},Vl.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},Vl.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},Vl.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},Vl.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},Vl.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},Vl.prototype.getHeaderRowElement=function(){return this.p.headerRow},Vl.prototype._horizontalPadding=function(e){return(parseFloat(Pl.css(e,"padding-left"))||0)+(parseFloat(Pl.css(e,"padding-right"))||0)},Vl.prototype._horizontalBorderWidth=function(e){return(parseFloat(Pl.css(e,"border-left"))||0)+(parseFloat(Pl.css(e,"border-right"))||0)},Vl.prototype._calculateWidthAvailableForColumns=function(){const e=this.o,t=this.p;let o,l,i;t.$table&&(l=t.table?t.table.scrollTop:0,i=t.table?t.table.scrollLeft:0,e.virtualTable&&(o=t.$table[0].style.display,t.$table[0].style.display="none"));let n=r(this.$el[0]);t.$table&&(e.virtualTable&&(t.$table[0].style.display=o),t.table.scrollTop=l,t.table.scrollLeft=i,t.header.scrollLeft=i);let s=e.tableClassName,a=Pl("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Pl("<div>").addClass(s+"-header").appendTo(a),u=Pl("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Pl("<div><div></div></div>").addClass(s+"-header-cell").addClass(t.visibleColumns[e].cellClasses||""));a.appendTo(document.body),n-=this._horizontalBorderWidth(u[0]);let h=u.find(">div."+s+"-header-cell");for(let e=0;e<h.length;e++){let t=Pl(h[e]);"border-box"===t.css("boxSizing")||(n-=(parseFloat(t.css("border-right-width"))||0)+(parseFloat(t.css("border-left-width"))||0)+this._horizontalPadding(t[0]))}return a&&a.remove(),Math.max(0,n)},Vl.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,l=Pl("<div>").addClass(this.$el).append(Pl("<div>").addClass(o+"-header").append(Pl("<div>").addClass(o+"-header-row").append(t=Pl("<div>").addClass(o+"-header-cell").append(Pl("<div>").text(e))))).css({position:"absolute",top:"-9999px",visibility:"hidden"});l.appendTo(document.body);let i=r(t[0]);return l.remove(),i},t=null;return function(o,r){let l=this.o,i=this.p,n=this._calculateWidthAvailableForColumns(),s=n,a=0;if(!i.$table)return this;r=void 0===r||r;let d=0;if(i.tbody||(r=!1),r&&(d=parseFloat(i.tbody.style.minWidth)||0),s!==t||o){t=n;let o=0,u=[],h=0;for(let e=0;e<i.columns.length;e++)i.columns[e].actualWidthConsideringScrollbarWidth=null;for(let t=0;t<i.visibleColumns.length;t++){let r=i.visibleColumns[t];if(r.widthMode===Ul.ABSOLUTE){let e=r.width;e+=r.arrowProposedWidth||0,!r.ignoreMin&&e<l.minColumnWidth&&(e=l.minColumnWidth),s-=e,o+=e,e!==r.actualWidth&&(r.actualWidth=e,u.push(t))}else if(r.widthMode===Ul.AUTO){let i=e.call(this,r.label)+20;i+=r.arrowProposedWidth||0,!r.ignoreMin&&i<l.minColumnWidth&&(i=l.minColumnWidth),s-=i,o+=i,i!==r.actualWidth&&(r.actualWidth=i,l.convertColumnWidthsToRelative||u.push(t))}else r.widthMode===Ul.RELATIVE&&(h+=r.width,a++)}if(l.convertColumnWidthsToRelative)for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];t.widthMode===Ul.AUTO&&(t.widthMode=Ul.RELATIVE,s+=t.actualWidth,t.width=t.actualWidth/o,h+=t.width,a++)}if(a&&(h<1&&l.relativeWidthGrowsToFillWidth||h>1&&l.relativeWidthShrinksToFillWidth))for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];t.widthMode===Ul.RELATIVE&&(t.width/=h)}let c=Math.max(0,s);0===c&&(c=i.table.clientWidth);let p=l.minColumnWidth/c;if(isNaN(p)&&(p=0),p>0){let e,t=0;for(let e=0;e<i.visibleColumns.length;e++){let o=i.visibleColumns[e];o.widthMode===Ul.RELATIVE&&!o.ignoreMin&&o.width<p&&(t+=p-o.width,o.width=p)}for(let o=0;o<i.visibleColumns.length;o++){let r=i.visibleColumns[o];r.widthMode===Ul.RELATIVE&&!r.ignoreMin&&r.width>p&&t>0&&(e=Math.min(t,r.width-p),r.width-=e,t-=e)}}if(l.autoFillTableWidth&&s>0){let e=0,t=s;for(let o=0;o<i.visibleColumns.length;o++){let r=i.visibleColumns[o];r.resizable||r.widthMode!==Ul.ABSOLUTE||(e+=r.width),r.widthMode===Ul.RELATIVE&&(t-=Math.round(c*r.width))}let o=(n-e)/(n-t-e)||NaN;for(let e=0;e<i.visibleColumns.length&&t>0;e++){let t=i.visibleColumns[e];if(t.resizable||t.widthMode!==Ul.ABSOLUTE)if(t.widthMode===Ul.RELATIVE)t.width*=o;else{let r=t.actualWidth*o;t.actualWidth!==r&&(t.actualWidth=r,-1===u.indexOf(e)&&u.push(e))}}}for(let e=0;e<i.visibleColumns.length;e++){let t=i.visibleColumns[e];if(t.widthMode===Ul.RELATIVE){let o=Math.round(c*t.width);s-=o,a--,0===a&&1===s&&(o++,s--),-1===s&&(o--,s++),o!==t.actualWidth&&(t.actualWidth=o,u.push(e))}}if(i.visibleColumns.length&&(i.visibleColumns[i.visibleColumns.length-1].actualWidthConsideringScrollbarWidth=i.visibleColumns[i.visibleColumns.length-1].actualWidth-(i.scrollbarWidth||0)),r){let e=this._calculateTbodyWidth();d<e&&this._updateTableWidth(!1);for(let e=0;e<u.length;e++)this._resizeColumnElements(u[e]);d>e&&this._updateTableWidth(!1)}}return this}}(),Vl.prototype.tableHeightChanged=function(){let e=this,t=e.o,o=e.p;if(!o.$table)return e;let r=l(e.$el[0],!0)-(parseFloat(o.$table.css("border-top-width"))||0)-(parseFloat(o.$table.css("border-bottom-width"))||0);return r!==t.height&&(t.height=r,o.tbody&&(o.tbody.style.height=Math.max(t.height-l(o.$headerRow[0],!0,!0,!0),1)+"px"),t.virtualTable&&e.clearAndRender()),e},Vl.prototype.addRows=function(e,t,o,r){let l=this,i=l.p;if("boolean"==typeof t&&(r=o,o=t,t=-1),"number"!=typeof t&&(t=-1),(t<0||t>i.rows.length)&&(t=i.rows.length),r=void 0===r||!!r,e){if(i.rows.add(e,t),i.filteredRows||o&&i.rows.sortColumn.length)o&&i.rows.sortColumn.length?this.resort():this._refilter(),i.tableSkeletonNeedsRendering=!0,r&&this.render();else if(r){let o=i.tbody.childNodes;if(l.o.virtualTable){for(;i.tbody.firstChild;)this.trigger("rowdestroy",i.tbody.firstChild),this._unbindCellEventsForRow(i.tbody.firstChild),i.tbody.removeChild(i.tbody.firstChild);this._calculateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1)}else if(i.$tbody){let r=t,n=t+e.length-1,s=l.renderRows(r,n);i.tbody.insertBefore(s,o[t]||null);for(let t=n+1;t<o.length;t++){let r=o[t];r.rowIndex+=e.length,r.physicalRowIndex+=e.length}this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)}}this.trigger("addrows",e.length,!1)}return this},Vl.prototype.removeRows=function(e,t,o){let r=this.p;if("number"!=typeof t||t<=0)return this;if(e<0||e>r.rows.length-1)return this;if(r.rows.splice(e,t),o=void 0===o||!!o,r.filteredRows)this._refilter(),r.tableSkeletonNeedsRendering=!0,o&&this.render();else if(o){let o=r.tbody.childNodes;if(this.o.virtualTable){for(;r.tbody.firstChild;)this.trigger("rowdestroy",r.tbody.firstChild),this._unbindCellEventsForRow(r.tbody.firstChild),r.tbody.removeChild(r.tbody.firstChild);this._calculateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1)}else{let l=e+t-1;for(let i=0;i<o.length;i++){let n=o[i],s=n.physicalRowIndex;s>=e?s<=l?(this.trigger("rowdestroy",n),this._unbindCellEventsForRow(n),r.tbody.removeChild(n),i--):n.physicalRowIndex-=t:n.rowIndex=i}this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)}}return this},Vl.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},Vl.prototype.refreshRow=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return this;let o=-1;if(t.filteredRows&&-1===(o=t.filteredRows.indexOf(t.rows[e])))return this;-1===o&&(o=e);let r=t.tbody.childNodes;if(this.o.virtualTable){let l=!1,i=0;for(;i<r.length;i++)if(r[i].physicalRowIndex===e){l=!0,this.trigger("rowdestroy",r[i]),this._unbindCellEventsForRow(r[i]),t.tbody.removeChild(r[i]);break}if(l){let e=this.renderRows(o,o);t.tbody.insertBefore(e,r[i]||null)}}else{this.trigger("rowdestroy",r[o]),this._unbindCellEventsForRow(r[o]),t.tbody.removeChild(r[o]);let e=this.renderRows(o,o);t.tbody.insertBefore(e,r[o]||null)}return this},Vl.prototype.getRowElement=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return null;let o=-1;if(t.filteredRows&&-1===(o=t.filteredRows.indexOf(t.rows[e])))return this;-1===o&&(o=e);let r=t.tbody.childNodes;if(!this.o.virtualTable)return r[o];for(let t=0;t<r.length;t++)if(r[t].physicalRowIndex===e)return r[t];return null},Vl.prototype.refreshAllVirtualRows=function(){const e=this.p;if(this.o.virtualTable){let t=[],o=e.tbody.childNodes;for(let r=0,l=o.length;r<l;r++)t.push(o[r].physicalRowIndex),this.trigger("rowdestroy",o[r]),this._unbindCellEventsForRow(o[r]),e.tbody.removeChild(o[r]),r--,l--;for(let o=0;o<t.length;o++){let r=this.renderRows(t[o],t[o]);e.tbody.appendChild(r)}}return this},Vl.prototype.setRows=function(e,t){let o=this.p;return o.rows.reset(e),t&&o.rows.sortColumn.length?this.resort():this._refilter(),this.clearAndRender().trigger("addrows",e.length,!0),this},Vl.prototype.getUrlForElementContent=function(e){let t,o=document.getElementById(e);if(o){let e=o.textContent;if("function"==typeof Blob)t=new Blob([e]);else{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(!o)return null;let r=new o;r.append(e),t=r.getBlob()}return(window.URL||window.webkitURL).createObjectURL(t)}return null},Vl.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},Vl.prototype.createWebWorker=function(e,t,o){if(this.isWorkerSupported()){let r=this,l=r.p,i=new Worker(e),n=function(e){e.data.append?r.addRows(e.data.rows,o):r.setRows(e.data.rows,o)};return i.addEventListener("message",n,!1),l.workerListeners||(l.workerListeners=[]),l.workerListeners.push({worker:i,listener:n}),(t||void 0===t)&&i.postMessage(null),i}return null},Vl.prototype.unbindWebWorker=function(e){let t=this.p;if(t.workerListeners)for(let o=0;o<t.workerListeners.length;o++)t.workerListeners[o].worker===e&&(e.removeEventListener("message",t.workerListeners[o].listener,!1),t.workerListeners.splice(o,1),o--);return this},Vl.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},Vl.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Pl(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},Vl.prototype._onVirtualTableScrolled=function(){this.render()},Vl.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},Vl.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=l[0];i.__cell&&(i=i.__cell,l=Pl(i));let n=l[0].previousSibling;for(;n&&1!==n.nodeType;)n=n.previousSibling;let s=!n,a=((null!=e.pageX?e.pageX:e.originalEvent.pageX)||e.originalEvent.clientX)-l.offset().left;if(o){if(!s&&r(l[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return n.columnName;if(a<=t.resizeAreaWidth/2)return i.columnName}else{if(!s&&a<=t.resizeAreaWidth/2)return n.columnName;if(r(l[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return i.columnName}return null},Vl.prototype._onTouchStartColumnHeader=function(e){const t=this.p;if(t.currentTouchId)return;let o=e.originalEvent.changedTouches[0];t.currentTouchId=o.identifier;let r,l=Pl(e.currentTarget),i={x:o.pageX,y:o.pageY},n=i,s=function(){t.currentTouchId=null,l.off("touchend").off("touchcancel"),clearTimeout(r)},a=function(t){let o=Pl.Event(t),r=Array.prototype.slice.call(arguments,1);for(let t of["target","clientX","clientY","offsetX","offsetY","screenX","screenY","pageX","pageY","which"]){o[t]=e[t];for(let e=0;e<r.length;e++)null!=r[e][t]&&(o[t]=r[e][t])}return o};l.trigger(a("mousedown",e.originalEvent.changedTouches[0],{which:1,target:e.target})),r=setTimeout((()=>{s(),l.one("touchend",(e=>{jl(e)||e.preventDefault(),l.off("touchend").off("touchcancel")})).one("touchcancel",(e=>{l.off("touchend").off("touchcancel")})),Math.sqrt(Math.pow(Math.abs(n.x-i.x),2)+Math.pow(Math.abs(n.y-i.y),2))<9&&(this.cancelColumnResize(),l.trigger(a("mouseup",e.originalEvent.changedTouches[0],{which:3,target:e.target})))}),500),l.on("touchend",(e=>{let o=Tl(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));o&&(s(),jl(e)||e.preventDefault(),n={x:o.pageX,y:o.pageY},(Math.sqrt(Math.pow(Math.abs(n.x-i.x),2)+Math.pow(Math.abs(n.y-i.y),2))<9||t.$resizer)&&(l.trigger(a("mouseup",o,{which:1,target:e.target})),l.trigger(a("click",o,{which:1,target:e.target}))))})).on("touchcancel",(()=>{s()})).on("touchmove",(e=>{let o=Tl(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));o&&(n={x:o.pageX,y:o.pageY},t.$resizer&&(e.preventDefault(),l.trigger(a("mousemove",o,{target:e.target}))))}))},Vl.prototype._onMouseDownColumnHeader=function(e){if(1!==e.which)return this;let t=this.o,o=this.p,i=this._getColumnByResizePosition(e);if(i){let n=o.columns.get(i);if(!t.resizableColumns||!n||!n.resizable)return!1;let s=this._isTableRtl();o.$resizer&&Pl(o.$resizer).remove(),o.$resizer=Pl("<div></div>").addClass(t.resizerClassName).css({position:"absolute",display:"block","z-index":-1,visibility:"hidden",width:"2px",background:"#000",opacity:.7}).appendTo(this.$el);let a=n.element,d=o.$resizer.parent(),u=a.offset(),h=d.offset();8===Ll&&(u=a.offset()),h.left+=parseFloat(d.css("border-left-width"))||0,h.top+=parseFloat(d.css("border-top-width"))||0,u.left-=h.left,u.top-=h.top,u.top-=parseFloat(a.css("border-top-width"))||0;let c=r(o.$resizer[0],!0,!0,!0);s?(u.left-=Math.ceil((parseFloat(a.css("border-left-width"))||0)/2),u.left-=Math.ceil(c/2)):(u.left+=r(a[0],!0,!0,!0),u.left+=Math.ceil((parseFloat(a.css("border-right-width"))||0)/2),u.left-=Math.ceil(c/2)),o.$resizer.css({"z-index":"10",visibility:"visible",left:u.left,top:u.top,height:l(this.$el[0])})[0].columnName=a[0].columnName;try{o.$resizer[0].style.zIndex=""}catch(e){}Pl(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Pl(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},Vl.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,o=this.p;if(t.resizableColumns){let r=this._getColumnByResizePosition(e),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0];r&&o.columns.get(r).resizable?l.style.cursor="e-resize":l.style.cursor=""}},Vl.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=o.offset();i.width=r(o[0],!0,!0,!0),i.height=l(o[0],!0,!0,!0),this.trigger("headercontextmenu",o[0].columnName,e.pageX,e.pageY,i)}return this},Vl.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},Vl.prototype._onClickColumnHeader=function(e){if(!jl(e)&&!this._getColumnByResizePosition(e)){let t=this,o=t.o,r=t.p,l=Pl(e.target).closest("div."+o.tableClassName+"-header-cell,div."+o.cellPreviewClassName)[0];if(o.sortableColumns){let e=r.columns.get(l.columnName);e&&e.sortable&&this.sort(l.columnName,void 0,!0).render()}}},Vl.prototype._onStartDragColumnHeader=function(e){let t=this.o,o=this.p;if(t.movableColumns){let r=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),l=o.columns.get(r[0].columnName);l&&l.movable?(r[0].style.opacity=.35,o.dragId=161061273*Math.random(),e.originalEvent.dataTransfer.setData("text",JSON.stringify({dragId:o.dragId,column:l.name}))):e.preventDefault()}else e.preventDefault()},Vl.prototype._onMouseMoveResizeArea=function(e){let t=this.p,o=t.columns.get(t.$resizer[0].columnName),l=this._isTableRtl(),i=o.element,n=t.$resizer.parent(),s=i.offset(),a=n.offset();a.left+=parseFloat(n.css("border-left-width"))||0,s.left-=a.left;let d=r(t.$resizer[0],!0,!0,!0),u="border-box"===i.css("box-sizing"),h=e.pageX-a.left,c=s.left;c-=Math.ceil(d/2),l?(c+=r(i[0],!0,!0,!0),c-=o.ignoreMin?0:this.o.minColumnWidth,u||(c-=Math.ceil((parseFloat(i.css("border-left-width"))||0)/2),c-=this._horizontalPadding(i[0])),h>c&&(h=c)):(c+=o.ignoreMin?0:this.o.minColumnWidth,u||(c+=Math.ceil((parseFloat(i.css("border-right-width"))||0)/2),c+=this._horizontalPadding(i[0])),h<c&&(h=c)),t.$resizer.css("left",h+"px")},Vl.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Pl(document).off("mousemove.dgtable",o.onMouseMoveResizeAreaBound).off("mouseup.dgtable",o.onEndDragColumnHeaderBound);let l=o.columns.get(o.$resizer[0].columnName),i=this._isTableRtl(),n=l.element,s=o.$resizer.parent(),a=n.offset(),d=s.offset();d.left+=parseFloat(s.css("border-left-width"))||0,a.left-=d.left;let u=r(o.$resizer[0],!0,!0,!0),h="border-box"===n.css("box-sizing"),c=e.pageX-d.left,p=a.left,f=a.left,m=0;p-=Math.ceil(u/2),i?(h||(c+=this._horizontalPadding(n[0]),c+=parseFloat(n.css("border-left-width"))||0,c+=parseFloat(n.css("border-right-width"))||0),p+=r(n[0],!0,!0,!0),f=p-(l.ignoreMin?0:this.o.minColumnWidth),c>f&&(c=f),m=p-c):(h||(c-=this._horizontalPadding(n[0]),c-=parseFloat(n.css("border-left-width"))||0,c-=parseFloat(n.css("border-right-width"))||0),f=p+(l.ignoreMin?0:this.o.minColumnWidth),c<f&&(c=f),m=c-p),o.$resizer.remove(),o.$resizer=null;let g=m;if(l.widthMode===Ul.RELATIVE){let e=this._calculateWidthAvailableForColumns(),r=0,i=0;for(let t=0;t<o.visibleColumns.length;t++){let n=o.visibleColumns[t];n.name!==l.name&&(n.widthMode===Ul.RELATIVE?(r+=n.width,i++):e-=n.actualWidth)}if(e=Math.max(1,e),g=m/e,i>0){let e=g/((1-g)/r);r+=g,(r<1&&t.relativeWidthGrowsToFillWidth||r>1&&t.relativeWidthShrinksToFillWidth)&&(g=e)}g*=100,g+="%"}this.setColumnWidth(l.name,g)}else e.target.style.opacity=null},Vl.prototype._onDragEnterColumnHeader=function(e){let t=this.o,o=this.p;if(t.movableColumns){let r=e.originalEvent.dataTransfer.getData("text");r=r?JSON.parse(r):null;let l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(!r||o.dragId===r.dragId&&l.columnName!==r.column){let e=o.columns.get(l[0].columnName);e&&(e.movable||e!==o.visibleColumns[0])&&Pl(l).addClass("drag-over")}}},Vl.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},Vl.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,o=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Pl(o[0].firstChild).has(e.originalEvent.relatedTarget).length||o.removeClass("drag-over")},Vl.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,o=this.p,r=JSON.parse(e.originalEvent.dataTransfer.getData("text")),l=Pl(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(t.movableColumns&&r.dragId===o.dragId){let e=r.column,t=l[0].columnName,i=o.columns.get(e),n=o.columns.get(t);i&&n&&i.movable&&(n.movable||n!==o.visibleColumns[0])&&this.moveColumn(e,t)}Pl(l).removeClass("drag-over")},Vl.prototype._clearSortArrows=function(){let e=this.p;if(e.$table){let t=this.o.tableClassName,o=e.$headerRow.find(">div."+t+"-header-cell.sorted"),r=o.find(">div>.sort-arrow");for(let t of r){let o=e.columns.get(t.parentNode.parentNode.columnName);o&&(o.arrowProposedWidth=0)}r.remove(),o.removeClass("sorted").removeClass("desc")}return this},Vl.prototype._showSortArrow=function(e,t){let o=this.p.columns.get(e);if(!o)return!1;let r=Il("span");return r.className="sort-arrow",o.element&&(o.element.addClass(t?"sorted desc":"sorted"),o.element[0].firstChild.insertBefore(r,o.element[0].firstChild.firstChild)),o.widthMode!==Ul.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(o.arrowProposedWidth=r.scrollWidth+(parseFloat(Pl(r).css("margin-right"))||0)+(parseFloat(Pl(r).css("margin-left"))||0)),this},Vl.prototype._resizeColumnElements=function(e){let t=this.p,o=t.$headerRow.find("div."+this.o.tableClassName+"-header-cell"),r=t.columns.get(o[e].columnName);if(r){o[e].style.width=(r.actualWidthConsideringScrollbarWidth||r.actualWidth)+"px";let l=(r.actualWidthConsideringScrollbarWidth||r.actualWidth)+"px",i=t.$tbody[0].childNodes;for(let t=0,o=i.length;t<o;t++){let o=i[t];1===o.nodeType&&(o.childNodes[e].style.width=l)}}return this},Vl.prototype._destroyHeaderCells=function(){let e=this.o,t=this.p;return t.$headerRow&&(this.trigger("headerrowdestroy",t.headerRow),t.$headerRow.find("div."+e.tableClassName+"-header-cell").remove(),t.$headerRow=null,t.headerRow=null),this},Vl.prototype._renderSkeletonBase=function(){let e=this,t=e.p,o=e.o;if(t.$table&&o.virtualTable){if(t.$table.remove(),t.$tbody){let o=t.$tbody[0].childNodes;for(let t=0,r=o.length;t<r;t++)e.trigger("rowdestroy",o[t]),e._unbindCellEventsForRow(o[t])}t.$table=t.table=t.$tbody=t.tbody=null}e._destroyHeaderCells(),t.currentTouchId=null,t.$header&&t.$header.remove();let r=o.tableClassName,i=Il("div"),n=Pl(i),s=Il("div"),a=Pl(s);return i.className=r+"-header",s.className=r+"-header-row",t.$header=n,t.header=i,t.$headerRow=a,t.headerRow=s,a.appendTo(t.$header),n.prependTo(this.$el),Dl(e.$el),o.width===Vl.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!o.height&&o.virtualTable&&(o.height=l(this.$el[0],!0)),this},Vl.prototype._renderSkeletonHeaderCells=function(){let e,t=this,o=t.p,r=t.o,l=r.allowCellPreview,i=r.allowHeaderCellPreview,n=r.tableClassName+"-header-cell",s=o.headerRow;kl&&(e=function(e){return e.preventDefault(),this.dragDrop(),!1});let a=function(e){e.preventDefault()};for(let d=0;d<o.visibleColumns.length;d++){let u=o.visibleColumns[d];if(u.visible){let h=Il("div"),c=Pl(h);h.draggable=!0,h.className=n,h.style.width=u.actualWidth+"px",r.sortableColumns&&u.sortable&&(h.className+=" sortable"),h.columnName=u.name,h.setAttribute("data-column",u.name);let p=Il("div");p.innerHTML=r.headerCellFormatter(u.label,u.name),h.appendChild(p),l&&i&&o._bindCellHoverIn(h),s.appendChild(h),o.visibleColumns[d].element=c,c.on("mousedown.dgtable",t._onMouseDownColumnHeader.bind(t)).on("mousemove.dgtable",t._onMouseMoveColumnHeader.bind(t)).on("mouseup.dgtable",t._onMouseUpColumnHeader.bind(t)).on("mouseleave.dgtable",t._onMouseLeaveColumnHeader.bind(t)).on("touchstart.dgtable",t._onTouchStartColumnHeader.bind(t)).on("dragstart.dgtable",t._onStartDragColumnHeader.bind(t)).on("click.dgtable",t._onClickColumnHeader.bind(t)).on("contextmenu.dgtable",a),Pl(p).on("dragenter.dgtable",t._onDragEnterColumnHeader.bind(t)).on("dragover.dgtable",t._onDragOverColumnHeader.bind(t)).on("dragleave.dgtable",t._onDragLeaveColumnHeader.bind(t)).on("drop.dgtable",t._onDropColumnHeader.bind(t)),kl&&c.on("selectstart.dgtable",e.bind(h)),c.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"})}}return this.trigger("headerrowcreate",s),this},Vl.prototype._renderSkeletonBody=function(){let e=this,t=e.p,o=e.o,r=o.tableClassName;if(o.virtualTable&&!t.virtualRowHeight){let o,i=function(){let e=Il("div"),t=e.appendChild(Il("div")),o=t.appendChild(Il("div"));return e.className=r+"-row",t.className=r+"-cell",o.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},n=Pl("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Pl("<div>").addClass(r).append(o=Pl("<div>").addClass(r+"-body").css("width",99999)));n.appendTo(document.body);let s=i(),a=i(),d=i();o.append(s,a,d),t.virtualRowHeightFirst=l(s,!0,!0,!0),t.virtualRowHeight=l(a,!0,!0,!0),t.virtualRowHeightLast=l(d,!0,!0,!0),t.virtualRowHeightMin=Math.min(Math.min(t.virtualRowHeightFirst,t.virtualRowHeight),t.virtualRowHeightLast),t.virtualRowHeightMax=Math.max(Math.max(t.virtualRowHeightFirst,t.virtualRowHeight),t.virtualRowHeightLast),n.remove()}if(!t.$table){let i=document.createDocumentFragment(),n=Il("div"),s=Pl(n);n.className=r,o.virtualTable&&(n.className+=" virtual");let a=o.height-l(t.$headerRow[0],!0,!0,!0);"border-box"!==s.css("box-sizing")&&(a-=parseFloat(s.css("border-top-width"))||0,a-=parseFloat(s.css("border-bottom-width"))||0,a-=parseFloat(s.css("padding-top"))||0,a-=parseFloat(s.css("padding-bottom"))||0),t.visibleHeight=a,n.style.height=o.height?a+"px":"auto",n.style.display="block",n.style.overflowY="auto",n.style.overflowX=o.width===Vl.Width.SCROLL?"auto":"hidden",i.appendChild(n);let d=Il("div"),u=Pl(d);d.className=o.tableClassName+"-body",t.table=n,t.tbody=d,t.$table=s,t.$tbody=u,o.virtualTable&&(t.virtualVisibleRows=Math.ceil(t.visibleHeight/t.virtualRowHeightMin)),e._calculateVirtualHeight(),Dl(u),Dl(s),n.appendChild(d),e.el.appendChild(i)}return this},Vl.prototype._renderSkeleton=function(){return this},Vl.prototype._updateLastCellWidthFromScrollbar=function(e){const t=this.p;let o=t.table.offsetWidth-t.table.clientWidth;if(o!==t.scrollbarWidth||e){t.scrollbarWidth=o;for(let e=0;e<t.columns.length;e++)t.columns[e].actualWidthConsideringScrollbarWidth=null;if(t.scrollbarWidth>0&&t.visibleColumns.length>0){let e=t.visibleColumns.length-1;t.visibleColumns[e].actualWidthConsideringScrollbarWidth=t.visibleColumns[e].actualWidth-t.scrollbarWidth;let o=t.visibleColumns[e].actualWidthConsideringScrollbarWidth+"px",r=t.tbody.childNodes;for(let t=0,l=r.length;t<l;t++){let l=r[t];1===l.nodeType&&(l.childNodes[e].style.width=o)}t.headerRow.childNodes[e].style.width=o}}return this},Vl.prototype._updateTableWidth=function(e){const t=this.o,o=this.p;let l=this._calculateTbodyWidth();if(o.tbody.style.minWidth=l+"px",o.headerRow.style.minWidth=l+(o.scrollbarWidth||0)+"px",o.$table.off("scroll",o.onTableScrolledHorizontallyBound),t.width===Vl.Width.AUTO)i(o.$table[0],r(o.$tbody[0],!0,!0,!0)),i(this.$el[0],r(o.$table[0],!0,!0,!0));else if(t.width===Vl.Width.SCROLL){if(e){let e=o.table?o.table.scrollTop:0,t=o.table?o.table.scrollLeft:0;!function(e){let t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}(this.el),o.table.scrollTop=e,o.table.scrollLeft=t,o.header.scrollLeft=t}o.$table.on("scroll",o.onTableScrolledHorizontallyBound)}return this},Vl.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},Vl.prototype._serializeColumnWidth=function(e){return e.widthMode===Ul.AUTO?"auto":e.widthMode===Ul.RELATIVE?100*e.width+"%":e.width},Vl.prototype._cellMouseOverEvent=function(e){const t=this.o,o=this.p;let i=e.firstChild;if(i.scrollWidth-i.clientWidth>1||i.scrollHeight-i.clientHeight>1){this.hideCellPreview(),o.abortCellPreview=!1;let n=Pl(e),s=Pl(i),a=Il("div"),d=Pl(a);a.innerHTML=e.innerHTML,a.className=t.cellPreviewClassName;let u=n.hasClass(t.tableClassName+"-header-cell");u&&(a.className+=" header",n.hasClass("sortable")&&(a.className+=" sortable"),a.draggable=!0,Pl(a).on("mousedown",this._onMouseDownColumnHeader.bind(this)).on("mousemove",this._onMouseMoveColumnHeader.bind(this)).on("mouseup",this._onMouseUpColumnHeader.bind(this)).on("mouseleave",this._onMouseLeaveColumnHeader.bind(this)).on("touchstart",this._onTouchStartColumnHeader.bind(this)).on("dragstart",this._onStartDragColumnHeader.bind(this)).on("click",this._onClickColumnHeader.bind(this)).on("contextmenu.dgtable",(function(e){e.preventDefault()})),Pl(a.firstChild).on("dragenter",this._onDragEnterColumnHeader.bind(this)).on("dragover",this._onDragOverColumnHeader.bind(this)).on("dragleave",this._onDragLeaveColumnHeader.bind(this)).on("drop",this._onDropColumnHeader.bind(this)),kl&&Pl(a).on("selectstart",function(e){return e.preventDefault(),this.dragDrop(),!1}.bind(a)));let h=parseFloat(n.css("padding-left"))||0,c=parseFloat(n.css("padding-right"))||0,p=parseFloat(n.css("padding-top"))||0,f=parseFloat(n.css("padding-bottom"))||0,m=i.scrollWidth+(e.clientWidth-i.offsetWidth),g="border-box"===n.css("box-sizing");if(g?d.css("box-sizing","border-box"):(m-=h+c,d.css("margin-top",parseFloat(Pl(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Pl(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Pl(e).css("background-color")}let b={"box-sizing":g?"border-box":"content-box",width:m,"min-height":l(n[0]),"padding-left":h,"padding-right":c,"padding-top":p,"padding-bottom":f,overflow:"hidden",position:"absolute","z-index":"-1",left:"0",top:"0",cursor:"default"};if(b){let t=Pl(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Pl(e.parentNode).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),b["background-color"]=t}d.css(b),this.el.appendChild(a),Pl(a.firstChild).css({direction:s.css("direction"),"white-space":s.css("white-space")}),u&&d.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"}),a.rowIndex=e.parentNode.rowIndex;let v=a.physicalRowIndex=e.parentNode.physicalRowIndex;a.columnName=o.visibleColumns[Al.call(e.parentNode.childNodes,e)].name;try{let t=Hl.saveSelection(e);t&&Hl.restoreSelection(a,t)}catch(e){}if(this.trigger("cellpreview",a.firstChild,null==v?null:v,a.columnName,null==v?null:o.rows[v],e),o.abortCellPreview)return void d.remove();let C=this.$el,w=C[0]===window?Pl(document):C,y=n.offset(),_=C.offset(),R="right"===n.css("float"),W=R?"right":"left";if(R){let e=Pl(window).width();y.right=e-(y.left+r(n[0],!0,!0,!0)),_.right=e-(_.left+r(C[0],!0,!0,!0))}y.left-=parseFloat(C.css("border-left-width"))||0,y.right-=parseFloat(C.css("border-right-width"))||0,y.top-=parseFloat(C.css("border-top-width"))||0,y[W]+=parseFloat(Pl(e).css("border-"+W+"-width"))||0,y.top+=parseFloat(Pl(e).css("border-top-width"))||parseFloat(Pl(e).css("border-bottom-width"))||0,y.left-=_.left,y.right-=_.right,y.top-=_.top;let T=0,N=C-r(d[0],!0,!0,!0);y[W]=y[W]<T?T:y[W]>N?N:y[W];let S=l(n[0],!0,!0,!0),M=w.scrollTop()+l(C[0],!0)-S;y.top>M&&(y.top=Math.max(0,M));let F={top:y.top,"z-index":9999};F[W]=y[W],d.css(F),a.__cell=e,o.$cellPreviewCell=d,e.__previewCell=a,o._bindCellHoverOut(e),o._bindCellHoverOut(a),d.on("wheel",(()=>{this.hideCellPreview()}))}},Vl.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},Vl.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,o=e.$cellPreviewCell[0],r=o.__cell;try{t=Hl.saveSelection(o)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(r),e._unbindCellHoverOut(o);try{t&&Hl.restoreSelection(r,t)}catch(e){}this.trigger("cellpreviewdestroy",o.firstChild,o.physicalRowIndex,o.columnName,r),r.__previewCell=null,o.__cell=null,e.$cellPreviewCell=null,e.abortCellPreview=!1}else e.abortCellPreview=!0;return this};const Ul={AUTO:0,ABSOLUTE:1,RELATIVE:2};Vl.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Pl.controls||(Pl.controls={}),Pl.controls.dgtable=Vl;export{Vl as default};
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=jquery.dgtable.es6.min.js.map
|