@ninebone/grid 0.0.86 → 0.0.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(de,Se){typeof exports=="object"&&typeof module<"u"?Se(exports,require("jquery"),require("@ninebone/util")):typeof define=="function"&&define.amd?define(["exports","jquery","@ninebone/util"],Se):(de=typeof globalThis<"u"?globalThis:de||self,Se(de.NineGrid={},de.$,de.util))})(this,(function(de,Se,Ve){"use strict";var Ff=Object.defineProperty;var Ru=de=>{throw TypeError(de)};var qf=(de,Se,Ve)=>Se in de?Ff(de,Se,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):de[Se]=Ve;var it=(de,Se,Ve)=>qf(de,typeof Se!="symbol"?Se+"":Se,Ve),yu=(de,Se,Ve)=>Se.has(de)||Ru("Cannot "+Ve);var f=(de,Se,Ve)=>(yu(de,Se,"read from private field"),Ve?Ve.call(de):Se.get(de)),Y=(de,Se,Ve)=>Se.has(de)?Ru("Cannot add the same private member more than once"):Se instanceof WeakSet?Se.add(de):Se.set(de,Ve),tt=(de,Se,Ve,ks)=>(yu(de,Se,"write to private field"),ks?ks.call(de,Ve):Se.set(de,Ve),Ve),Ue=(de,Se,Ve)=>(yu(de,Se,"access private method"),Ve);var Mu=(de,Se,Ve,ks)=>({set _(Ti){tt(de,Se,Ti,Ve)},get _(){return f(de,Se,ks)}});var Zn,Jn,Qn,ls,Bl,Cs,Ge,Fl,ql,Hl,zl,Wt,Ul,Ri,Es,As,Mi,Ts,Ii,to,Ni,Oi,lr,Iu,Nu,Hf,Ou,ju,$u,zf,Lu,ti,ji,eo,ro,so,io,kt,Sr,$i,Vl,no,Ot,hs,oo,ao,lo,jr,ho,co,dr,uo,Wl,Xl,Yl,Gl,Kl,Zl,fo,po,mo,go,Jl,Ql,Li,bo,Pi,Di,Bi,yo,Fi,qi,ei,Br,vo,Hi,wo,th,ve,$r,Fr,xo,kr,zi,qr,_o,ou,So,au,ko,Co,Ui,Vi,Eo,Ie,Cr,Er,Rs,Ms,Hr,Ar,Is,Ns,Ao,To,Ro,lu,Mo,eh,Io,Wi,Xi,Yi,ri,Gi,rh,ce,si,Lr,Ki,No,sh,ih,Zi,De,nr,Oo,Os,ii,Ji,nh,oh,ah,lh,hu,jo,Be,js,ni,Qi,hh,$o,ch,Lo,tn,cu,uh,dh,en,Po,rn,oi,sn,Kr,fh,Do,ph,Bo,mh,zr,Fo,gh,bh,yh,Zr,qo,cs,We,Ft,Pe,Tr,ai,$s,nn,Ho,on,zo,Uo,vh,Vo,Wo,an,ln,Xo,Yo,Go,Ne,Ko,hn,us,li,cn,Zo,uu,du,wh,Jo,hr,Qo,xh,_h,un,ds,Ur,fs,Sh,ta,dn,kh,Ls,fn,Ch,Eh,Ah,Th,Rh,Mh,ea,pn,Ih,ra,Jr,Nh,Qr,hi,Oh,Ze,ps,Vr,Ps,mn,ts,jh,je,ci,gn,bn,yn,ui,es,rs,Lt,sa,$h,Fe,ia,na,Rr,oa,Xe,rr,Ds,Lh,vn,Ph,di,aa,Bs,Pr,Fs,fi,Dh,Bh,wn,Fh,sr,cr,pi,qh,He,la,ha,ca,ms,ua,da,fa,pa,or,gr,mi,Hh,zh,ma,ga,Uh,fr,ss,ba,br,qs,gi,fu,is,Vh,Wh,Xh,ya,va,wa,Yh,Gh,Le,pr,Dt,Wr,ge,yr,vr,_n,Kh,Zh,xa,Jh,_a,Sa,pu,Sn,kn,su,bi,Je,gs,ae,Xr,Yr,Hs,Qh,ka,tc,Ca,ec,Ea,Aa,Cn,Ye,ns,Ta,Ra,Ma,rc,sc,Gt,ic,Ia,Na,bs,Oa,ja,$a,La,Pa,Da,Ba,yi,$l,nc,oc,ac,lc,mu,Fa,qa,hc,cc,uc,yt,Ke,wr,vi,wi,Ha,za,Ua,Va,Wa,dc,fc,pc,En,zs,Us,Qe,Vs,mc,Xa,An,Ya,Mr,Ga,Ka,gc,bc,yc,vc,Za,xi,Ja,Tn,os,Qa,tl,wc,ys,xc,el,_c,as,Sc,rl,kc,sl,Ws,Xs,vs,Cc,il,Rn,nl,ol,Mn,al,ll,Ys,hl,In,ws,_i,Nn,Ec,On,jn,Ac,cl,ul,$n,Ln,dl,fl,pl,Tc,Si,Rc,Mc,Pu,Pn,Ic,Nc,Du,Oc,jc,ml,Dn,gl,$c,bl,Bn,yl,Fn,xs,ki,Lc,ur,vl,Pc,qn,Bu,Fu,Dc,Dr,Bc,Fc,qc,wl,gu,Hc,Ir,xl,_l,Sl,kl,zc,Cl,Ci,El,Nr,Ll,vu,wu,Al,Uc,Tl,Vc,Hn,Rl,xu,zn,Gs,_u,Su,Wc,Xc,Yc,_s,Gc,Ml,Un,Il,Nl,Vn,Ol;class ks extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1
+ (function(de,Se){typeof exports=="object"&&typeof module<"u"?Se(exports,require("jquery"),require("@ninebone/util")):typeof define=="function"&&define.amd?define(["exports","jquery","@ninebone/util"],Se):(de=typeof globalThis<"u"?globalThis:de||self,Se(de.NineGrid={},de.$,de.util))})(this,(function(de,Se,Ve){"use strict";var Bf=Object.defineProperty;var Ru=de=>{throw TypeError(de)};var Ff=(de,Se,Ve)=>Se in de?Bf(de,Se,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):de[Se]=Ve;var it=(de,Se,Ve)=>Ff(de,typeof Se!="symbol"?Se+"":Se,Ve),yu=(de,Se,Ve)=>Se.has(de)||Ru("Cannot "+Ve);var f=(de,Se,Ve)=>(yu(de,Se,"read from private field"),Ve?Ve.call(de):Se.get(de)),Y=(de,Se,Ve)=>Se.has(de)?Ru("Cannot add the same private member more than once"):Se instanceof WeakSet?Se.add(de):Se.set(de,Ve),tt=(de,Se,Ve,ks)=>(yu(de,Se,"write to private field"),ks?ks.call(de,Ve):Se.set(de,Ve),Ve),Ue=(de,Se,Ve)=>(yu(de,Se,"access private method"),Ve);var Mu=(de,Se,Ve,ks)=>({set _(Ti){tt(de,Se,Ti,Ve)},get _(){return f(de,Se,ks)}});var Zn,Jn,Qn,ls,Bl,Cs,Ge,Fl,ql,Hl,zl,Wt,Ul,Ri,Es,As,Mi,Ts,Ii,to,Ni,Oi,lr,Iu,Nu,qf,Ou,ju,$u,Hf,Lu,ti,ji,eo,ro,so,io,kt,Sr,$i,Vl,no,Ot,hs,oo,ao,lo,jr,ho,co,dr,uo,Wl,Xl,Yl,Gl,Kl,Zl,fo,po,mo,go,Jl,Ql,Li,bo,Pi,Di,Bi,yo,Fi,qi,ei,Br,vo,Hi,wo,th,ve,$r,Fr,xo,kr,zi,qr,_o,ou,So,au,ko,Co,Ui,Vi,Eo,Ie,Cr,Er,Rs,Ms,Hr,Ar,Is,Ns,Ao,To,Ro,lu,Mo,eh,Io,Wi,Xi,Yi,ri,Gi,rh,ce,si,Lr,Ki,No,sh,ih,Zi,De,nr,Oo,Os,ii,Ji,nh,oh,ah,lh,hu,jo,Be,js,ni,Qi,hh,$o,ch,Lo,tn,cu,uh,dh,en,Po,rn,oi,sn,Kr,fh,Do,ph,Bo,mh,zr,Fo,gh,bh,yh,Zr,qo,cs,We,Ft,Pe,Tr,ai,$s,nn,Ho,on,zo,Uo,vh,Vo,Wo,an,ln,Xo,Yo,Go,Ne,Ko,hn,us,li,cn,Zo,uu,du,wh,Jo,hr,Qo,xh,_h,un,ds,Ur,fs,Sh,ta,dn,kh,Ls,fn,Ch,Eh,Ah,Th,Rh,Mh,ea,pn,Ih,ra,Jr,Nh,Qr,hi,Oh,Ze,ps,Vr,Ps,mn,ts,jh,je,ci,gn,bn,yn,ui,es,rs,Lt,sa,$h,Fe,ia,na,Rr,oa,Xe,rr,Ds,Lh,vn,Ph,di,aa,Bs,Pr,Fs,fi,Dh,Bh,wn,Fh,sr,cr,pi,qh,He,la,ha,ca,ms,ua,da,fa,pa,or,gr,mi,Hh,zh,ma,ga,Uh,fr,ss,ba,br,qs,gi,fu,is,Vh,Wh,Xh,ya,va,wa,Yh,Gh,Le,pr,Dt,Wr,ge,yr,vr,_n,Kh,Zh,xa,Jh,_a,Sa,pu,Sn,kn,su,bi,Je,gs,ae,Xr,Yr,Hs,Qh,ka,tc,Ca,ec,Ea,Aa,Cn,Ye,ns,Ta,Ra,Ma,rc,sc,Gt,ic,Ia,Na,bs,Oa,ja,$a,La,Pa,Da,Ba,yi,$l,nc,oc,ac,lc,mu,Fa,qa,hc,cc,uc,yt,Ke,wr,vi,wi,Ha,za,Ua,Va,Wa,dc,fc,pc,En,zs,Us,Qe,Vs,mc,Xa,An,Ya,Mr,Ga,Ka,gc,bc,yc,vc,Za,xi,Ja,Tn,os,Qa,tl,wc,ys,xc,el,_c,as,Sc,rl,kc,sl,Ws,Xs,vs,Cc,il,Rn,nl,ol,Mn,al,ll,Ys,hl,In,ws,_i,Nn,Ec,On,jn,Ac,cl,ul,$n,Ln,dl,fl,pl,Tc,Si,Rc,Mc,Pu,Pn,Ic,Nc,Du,Oc,jc,ml,Dn,gl,$c,bl,Bn,yl,Fn,xs,ki,Lc,ur,vl,Pc,qn,Bu,Fu,Dc,Dr,Bc,Fc,qc,wl,gu,Hc,Ir,xl,_l,Sl,kl,zc,Cl,Ci,El,Nr,Ll,vu,wu,Al,Uc,Tl,Vc,Hn,Rl,xu,zn,Gs,_u,Su,Wc,Xc,Yc,_s,Gc,Ml,Un,Il,Nl,Vn,Ol;class ks extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
2
2
  <nx-dialog css-file="nxConfirm.css">
3
3
  <div class="msg"></div>
4
4
  <buttons class="buttons-confirm">
@@ -42,7 +42,7 @@
42
42
  <button class="button" ${t.join(" ")}>${this.getAttribute("text")}</button>
43
43
  `,super.connectedCallback(),tt(this,Cs,this.shadowRoot.querySelector("button")),$(this.cell).on("keydown",c=>{c.code=="Enter"&&$(f(this,Cs)).trigger("click")})}}Cs=new WeakMap,customElements.get("ng-button")||customElements.define("ng-button",zu);class Uu{constructor(E){Y(this,Ge);Y(this,Fl,E=>{!E.ctrlKey&&!E.metaKey||(["C","c"].includes(E.key)?f(this,Hl).call(this):["V","v"].includes(E.key)&&f(this,ql).call(this))});Y(this,ql,()=>{const E=f(this,Ge).cell.currentCell;E&&f(this,Ge).selection.rows[0]&&E.dataset.row==f(this,Ge).selection.rows[0]&&(parseInt(E.dataset.row),parseInt(E.dataset.row),navigator.clipboard.readText().then(t=>{t.split(`
44
44
  `).forEach(l=>{l.split(" ").forEach(c=>{})})}).catch(t=>{console.error("Failed to read clipboard contents: ",t)}))});Y(this,Hl,()=>{const E=[];for(var t=f(this,Ge).selection.selected.startRow;t<=f(this,Ge).selection.selected.endRow;t++){for(var l=[],c=f(this,Ge).selection.selected.startCol;c<=f(this,Ge).selection.selected.endCol;c++)l.push(f(this,zl).call(this,t,c));E.push(l.join(" "))}E.length<=0||navigator.clipboard.writeText(E.join(`
45
- `)).then(()=>{setTimeout(()=>{H.j.querySelectorAll(".selected",f(this,Ge).body).addClass("copied")}),setTimeout(()=>{H.j.querySelectorAll(".copied",f(this,Ge).body).removeClass("copied")},1e3)}).catch(o=>{console.error("Failed to copy text: ",o)})});Y(this,zl,(E,t)=>{const l=parseInt(E/f(this,Ge).template.length),o=f(this,Ge).template[E%f(this,Ge).template.length].querySelector(`[data-col="${t}"]`);if(!o||!o.dataset)return"";if(o.dataset.expr)return f(this,Ge).exprFunction(o.dataset.expr).call(this,f(this,Ge).data.get(l),l);if(o.dataset.bind)return f(this,Ge).data.get(l,o.dataset.bind)});tt(this,Ge,E),$(f(this,Ge).body).on("keydown",f(this,Fl))}}Ge=new WeakMap,Fl=new WeakMap,ql=new WeakMap,Hl=new WeakMap,zl=new WeakMap;class Vu{constructor(E){Y(this,lr);Y(this,Wt);Y(this,Ul);Y(this,Ri);Y(this,Es);Y(this,As);Y(this,Mi);Y(this,Ts);Y(this,Ii);Y(this,to);Y(this,Ni);Y(this,Oi);it(this,"moveCell",E=>{var t=E.target.closest("th,td")||E.target.getRootNode().host.closest("th,td")||document.activeElement.closest("th,td"),l=t.closest("tr");l.sectionRowIndex;var c=parseInt(t.dataset.col);parseInt(l.dataset.row);var o=parseInt(l.dataset.matrixRow),r,n;switch(E.code){case"Tab":case"ArrowRight":case"ArrowLeft":r=o;break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":n=c;break}switch(E.code){case"Tab":E.preventDefault(),n=E.shiftKey?f(this,ti).call(this,o,c):f(this,ji).call(this,o,c);break;case"ArrowRight":n=f(this,ji).call(this,o,c);break;case"ArrowLeft":n=f(this,ti).call(this,o,c);break;case"ArrowDown":if(t.closest("tbody.fixed"))r=parseInt(t.dataset.matrixRow)+(t.rowSpan||1);else{const e=parseInt(t.dataset.row),i=f(this,Wt).view.getVisibleLastRow();f(this,Wt).isLastPage&&e==i-1&&$(".ng-container-body .nodata",f(this,Wt).shadowRoot).height()<=0||!f(this,Wt).isLastPage&&f(this,Wt).lastRowHidden&&e>=i-1||!f(this,Wt).isLastPage&&!f(this,Wt).lastRowHidden&&e>=i?(f(this,Wt).scrollBy(1),this.currentCell=t,setTimeout(()=>{t.focus()})):r=parseInt(t.dataset.matrixRow)+(t.rowSpan||1)}break;case"ArrowUp":t.closest("tbody.fixed")?r=parseInt(t.dataset.matrixRow)-(t.rowSpan||1):t.closest("tr").sectionRowIndex==0?f(this,Wt).isFirstPage||(f(this,Wt).scrollBy(-1),this.currentCell=t,setTimeout(()=>{t.focus()})):r=parseInt(t.dataset.matrixRow)-(t.rowSpan||1);break;case"PageDown":f(this,Wt).pageDown();break;case"PageUp":f(this,Wt).pageUp();break}if(r!=null&&n!=null&&isFinite(r)){var s=f(this,eo).call(this,r,n);s&&!s.querySelector("ng-row-indicator")&&(this.currentCell=s)}["Tab","ArrowLeft","ArrowRight"].includes(E.code)&&f(this,Wt).body.querySelector("ng-hscrollbar").refresh()});Y(this,ti,(E,t)=>{var l=parseInt(E/f(this,Wt).template.length),c;return $(`tbody tr[data-matrix-row=${E}]`,f(this,Wt).body).find("th,td").each((o,r)=>{var n=parseInt(r.dataset.col);if(t-1>=n&&t-1<=n+r.colSpan-1)return c=H.j.querySelectorAll(r).hasClass("dummy")?f(this,ti).call(this,E,r.dataset.col):r.dataset.col,!1}),c==null&&$(`tbody tr[data-row=${l}]`,f(this,Wt).body).find("th,td").each((o,r)=>{var n=parseInt(r.dataset.col);if(t-1>=n&&t-1<=n+r.colSpan-1)return c=H.j.querySelectorAll(r).hasClass("dummy")?f(this,ti).call(this,E,r.dataset.col):r.dataset.col,!1}),c});Y(this,ji,(E,t)=>{var l=f(this,Wt).body.querySelector(`tbody [data-matrix-row="${E}"][data-col="${t}"]`),c=t+(l.colSpan||1),o=f(this,Wt).body.querySelector(`tbody [data-matrix-row="${E}"][data-col="${c}"]`);return H.j.querySelectorAll(o).hasClass("dummy")&&(c=f(this,ji).call(this,E,c)),c});Y(this,eo,(E,t)=>{var l=parseInt(E/f(this,Wt).template.length),c=$(`[data-matrix-row=${E}][data-col=${t}]`,f(this,Wt).body).not(".dummy").filter(":visible");return c.length==0&&(c=$(`[data-row=${l}][data-col=${t}]`,f(this,Wt).body).not(".dummy").filter(":visible")),c[0]});it(this,"refresh",()=>{f(this,Wt).selection.refresh()});Y(this,ro,E=>{E.altKey||E.shiftKey||E.ctrlKey||(E.preventDefault(),E.originalEvent.deltaY>0?f(this,Wt).scrollBy(1):f(this,Wt).scrollBy(-1))});Y(this,so,E=>{if(!(E.ctrlKey||E.altKey)&&!(E.target.tagName=="NG-ROW-INDICATOR"&&[H.SELECTTYPE.CELL,H.SELECTTYPE.AREA].includes(f(this,Wt).selection.type)))if(E.shiftKey){if([H.SELECTTYPE.COLS,H.SELECTTYPE.ROWS,H.SELECTTYPE.AREA].includes(f(this,Wt).selection.type)){var t=f(this,Wt).selection.getActiveCell();if(t){var l=t.closest("tr"),c=parseInt(t.dataset.row)*f(this,Wt).template.length+l.sectionRowIndex%f(this,Wt).template.length,o=parseInt(t.dataset.col),r=E.target.closest("th,td"),n=r.closest("tr"),s=parseInt(r.dataset.row)*f(this,Wt).template.length+n.sectionRowIndex%f(this,Wt).template.length,e=parseInt(r.dataset.col);f(this,Wt).selection.selectArea(c,o,s,e)}}}else{const i=E.target.closest("th,td"),u=f(this,Wt).view.getVisibleLastRow(),a=parseInt(i.closest("tr").dataset.row),h=!!i.closest("tbody.fixed"),p=f(this,Wt).shadowRoot.querySelector(".ng-container-body tr.nodata");if(!h&&$(p).height()<=0&&f(this,Wt).lastRowHidden&&u==a){const m=parseInt(i.closest("tr").dataset.matrixRow),d=parseInt(i.dataset.col);f(this,Wt).scrollBy(1);const b=f(this,eo).call(this,m,d);this.currentCell=b,setTimeout(()=>{b.focus()})}else this.currentCell=i}});Y(this,io,E=>{if(!(E.ctrlKey||E.altKey))if(["TH","TD"].includes(E.target.tagName)){if(["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(E.code))E.preventDefault(),this.moveCell(E);else if(["Enter"].includes(E.code)){E.preventDefault();const t=E.target.querySelector("ng-input");if(t){const l=t.shadowRoot.querySelector("input[type=text]");l.focus(),l.select()}}}else["NG-INPUT"].includes(E.target.tagName)&&["Enter"].includes(E.code)});it(this,"resetEvent",()=>{document.addEventListener("contextmenu",E=>E.preventDefault()),$(".ng-table tbody.bindable",f(this,Wt).body).off("wheel",f(this,ro)),$(".ng-table tbody",f(this,Wt).body).off("keydown","th,td",f(this,io)),$(".ng-table tbody",f(this,Wt).body).off("mousedown","th,td",f(this,so)),$(".ng-table tbody.bindable",f(this,Wt).body).on("wheel",f(this,ro)),$(".ng-table tbody",f(this,Wt).body).on("keydown","th,td",f(this,io)),$(".ng-table tbody",f(this,Wt).body).on("mousedown","th,td",f(this,so)),f(this,Wt).selection&&f(this,Wt).selection.resetEvent()});tt(this,Wt,E),tt(this,Es,-1),tt(this,As,-1),tt(this,Mi,-1),tt(this,Ts,-1),this.resetEvent()}get matrixRow(){return f(this,As)}get col(){return f(this,Ts)}get currentCell(){return f(this,Ri)}set currentCell(E){if(!E)return;tt(this,Ul,f(this,Ri)),tt(this,Ri,E),E.focus();var t=E.closest("tr");tt(this,lr,parseInt(t.dataset.row)*f(this,Wt).template.length+t.sectionRowIndex%f(this,Wt).template.length,Nu),tt(this,lr,parseInt(E.dataset.col),$u),tt(this,lr,E.cellIndex,Ou),tt(this,lr,E.dataset.bind,Lu),t.closest("tbody.fixed")||(f(this,Wt).row.at=E.dataset.row),f(this,Wt).selection.selectCell(f(this,lr,Iu),f(this,lr,ju));const l=E,c=parseInt(l.dataset.row),o=parseInt(l.dataset.matrixRow)%parseInt(l.dataset.row),r=parseInt(l.dataset.col),n=l.cellIndex,s=parseInt(f(this,Es)/f(this,Wt).template.length),e=parseInt(f(this,Es))%parseInt(f(this,Es)/f(this,Wt).template.length),i=f(this,Mi),u=f(this,to);if(c!=s||o!=e||r!=i){const a=new CustomEvent(H.EVENT.CELL_POS_CHANGED,{bubbles:!0,detail:{}});a.col=r,a.cellIndex=n,a.row=c,a.subrow=o,a.bind=l.dataset.bind,a.prev={col:i,cellIndex:u,col:i,row:s,subrow:e,bind:f(this,Ni)},f(this,Wt).dispatchEvent(a)}if(c!=s){const a=new CustomEvent(H.EVENT.ROW_POS_CHANGED,{bubbles:!0,detail:{}});a.col=r,a.cellIndex=n,a.row=c,a.subrow=o,a.bind=l.dataset.bind,a.prev={col:i,cellIndex:u,row:s,subrow:e,bind:f(this,Ni)},f(this,Wt).dispatchEvent(a)}}}Wt=new WeakMap,Ul=new WeakMap,Ri=new WeakMap,Es=new WeakMap,As=new WeakMap,Mi=new WeakMap,Ts=new WeakMap,Ii=new WeakMap,to=new WeakMap,Ni=new WeakMap,Oi=new WeakMap,lr=new WeakSet,Iu=function(){return f(this,As)},Nu=function(E){tt(this,Es,f(this,As)),tt(this,As,parseInt(E))},Hf=function(){return f(this,Ii)},Ou=function(E){tt(this,to,f(this,Ii)),tt(this,Ii,parseInt(E))},ju=function(){return f(this,Ts)},$u=function(E){tt(this,Mi,f(this,Ts)),tt(this,Ts,parseInt(E))},zf=function(){return f(this,Oi)},Lu=function(E){tt(this,Ni,f(this,Oi)),tt(this,Oi,E)},ti=new WeakMap,ji=new WeakMap,eo=new WeakMap,ro=new WeakMap,so=new WeakMap,io=new WeakMap;class Wu{constructor(E){Y(this,kt);Y(this,Sr);Y(this,$i);it(this,"getActiveCell",()=>{var E=this.selected.currentRow,t=this.selected.currentCol,l=parseInt(this.selected.currentMatrixRow%f(this,kt).template.length),c=$(`tbody.bindable [data-row=${E}]`,f(this,kt).body).find(`[data-col=${t}]`).not(".dummy").eq(l);return c.length>0?c[0]:null});it(this,"refresh",()=>{switch(this.type){case H.SELECTTYPE.ROW:this.selected.startRow=parseInt(f(this,kt).row.at*f(this,kt).template.length),this.selected.endRow=this.selected.startRow+f(this,kt).template.length-1;var t=[];$(`tbody tr[data-row=${parseInt(this.selected.startRow/f(this,kt).template.length)}] td`,f(this,kt).body).not(".dummy").not(".first").each((o,r)=>{parseInt(H.j.querySelectorAll(r).attr("tabindex"))>=0&&t.push(Number(r.dataset.col))}),this.selected.startCol=t.length>0?Math.min.apply(null,t):-1,this.selected.endCol=t.length>0?Math.max.apply(null,t):-1;break;case H.SELECTTYPE.ROWS:this.selected.startRow=parseInt(this.selected.startRow/f(this,kt).template.length)*f(this,kt).template.length,this.selected.endRow=parseInt(this.selected.endRow/f(this,kt).template.length)*f(this,kt).template.length-1+f(this,kt).template.length,this.selected.startCol=f(this,kt).firstCol,this.selected.endCol=f(this,kt).lastCol;break;case H.SELECTTYPE.COL:this.selected.startRow=0,this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length-1),this.selected.endCol=this.selected.startCol;var E=[];f(this,kt).template.each((o,r)=>{r.querySelectorAll("th,td").forEach(n=>{const s=parseInt(n.dataset.col),e=parseInt(n.colSpan||1);this.selected.startCol>=s&&this.selected.endCol<=s+e-1&&E.push(n)})});var t=[];E.forEach(o=>{t.push(parseInt(o.dataset.col)),t.push(parseInt(o.dataset.col)+parseInt(o.colSpan||1)-1)}),this.selected.startCol=Math.min.apply(null,t),this.selected.endCol=Math.max.apply(null,t);break;case H.SELECTTYPE.COLS:this.selected.startRow=0,this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length-1);var E=[];f(this,kt).template.each((o,r)=>{r.querySelectorAll("th,td").forEach(n=>{const s=parseInt(n.dataset.col),e=parseInt(n.colSpan||1);(this.selected.startCol>=s&&this.selected.startCol<=s+e-1||this.selected.endCol>=s&&this.selected.endCol<=s+e-1)&&E.push(n)})});var t=[];E.forEach(o=>{t.push(parseInt(o.dataset.col)),t.push(parseInt(o.dataset.col)+parseInt(o.colSpan||1)-1)}),this.selected.startCol=Math.min.apply(null,t),this.selected.endCol=Math.max.apply(null,t);break;case H.SELECTTYPE.CELL:this.selected.endRow=this.selected.startRow,this.selected.endCol=this.selected.startCol;break;case H.SELECTTYPE.AREA:break;case H.SELECTTYPE.NONE:this.selected.startRow=this.selected.endRow=this.selected.startCol=this.selected.endCol=-1;break}H.j.querySelectorAll("th,td",f(this,kt).body).removeClass("active").removeClass("multi-selected").removeClass("selected").removeClass("selected-current").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right"),H.j.querySelectorAll(".selected-current",f(this,kt).body).removeClass("selected-current"),H.j.querySelectorAll(`tr[data-row="${this.selected.currentRow}"] ng-row-indicator`,f(this,kt).body).addClass("selected-current"),H.j.querySelectorAll(`.col-indicator[data-col="${this.selected.currentCol}"]`,f(this,kt).body).addClass("selected-current"),$(`tr[data-row="${this.selected.currentRow}"] ng-row-indicator`,f(this,kt).body).closest("th,td").addClass("selected-current");var l=this.getActiveCell();l&&H.j.querySelectorAll(l).addClass("active"),$("tbody th,tbody td",f(this,kt).body).each((o,r)=>{var n=parseInt(r.dataset.col),s=parseInt(r.dataset.row)*f(this,kt).template.length+r.closest("tr").sectionRowIndex%f(this,kt).template.length;s==this.selected.currentMatrixRow&&n==this.selected.currentCol,s+r.rowSpan-1>=this.selected.startRow&&s<=this.selected.endRow&&n+r.colSpan-1>=this.selected.startCol&&n<=this.selected.endCol&&(H.j.querySelectorAll(r).addClass("selected"),this.selected.startRow==this.selected.endRow&&this.selected.startCol==this.selected.endCol?H.j.querySelectorAll(r).addClass("selected-top").addClass("selected-bottom").addClass("selected-left").addClass("selected-right"):(s==this.selected.startRow&&H.j.querySelectorAll(r).addClass("selected-top"),s+r.rowSpan-1==this.selected.endRow&&H.j.querySelectorAll(r).addClass("selected-bottom"),n==this.selected.startCol&&H.j.querySelectorAll(r).addClass("selected-left"),n+r.colSpan-1==this.selected.endCol&&H.j.querySelectorAll(r).addClass("selected-right"),H.j.querySelectorAll(r).addClass("multi-selected")))}),$("tbody.bindable tr",f(this,kt).body).each((o,r)=>{var n=r.querySelector("ng-row-indicator");if(n){n=n.closest("th,td");for(var s=parseInt(n.dataset.row),e=0;e<n.rowSpan;e++){var s=parseInt(n.dataset.row)*f(this,kt).template.length+r.sectionRowIndex%f(this,kt).template.length+e;s>=this.selected.startRow&&s<=this.selected.endRow&&H.j.querySelectorAll(n).addClass("selected-area")}}});for(var c=this.selected.startCol;c<=this.selected.endCol;c++)H.j.querySelectorAll(`.col-indicator[data-col="${c}"]`,f(this,kt).body).addClass("selected-area");(this.selected.oldStartRow!=this.selected.startRow||this.selected.oldEndRow!=this.selected.endRow||this.selected.oldStartCol!=this.selected.startCol||this.selected.oldEndCol!=this.selected.endCol)&&(f(this,Sr).oldStartRow=this.selected.oldStartRow,f(this,Sr).oldEndRow=this.selected.oldEndRow,f(this,Sr).oldStartCol=this.selected.oldStartCol,f(this,Sr).oldEndCol=this.selected.oldEndCol,f(this,Sr).startRow=this.selected.startRow,f(this,Sr).endRow=this.selected.endRow,f(this,Sr).startCol=this.selected.startCol,f(this,Sr).endCol=this.selected.endCol,f(this,kt).dispatchEvent(f(this,Sr))),this.selected.oldStartRow=this.selected.startRow,this.selected.oldEndRow=this.selected.endRow,this.selected.oldStartCol=this.selected.startCol,this.selected.oldEndCol=this.selected.endCol});it(this,"resetEvent",()=>{$(".ng-table tbody.bindable",f(this,kt).body).off("mousedown","th,td",f(this,no)).on("mousedown","th,td",f(this,no))});Y(this,Vl,()=>{this.resetEvent()});Y(this,no,E=>{if(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftKey)return;const t=E.target.closest("th,td"),l=t.closest("tr"),c=parseInt(t.dataset.row)*f(this,kt).template.length+l.sectionRowIndex%f(this,kt).template.length,o=parseInt(t.dataset.col);this.selected.currentCol=t.dataset.col,this.selected.currentRow=t.dataset.row,this.selected.currentMatrixRow=parseInt(t.dataset.row*f(this,kt).template.length)+parseInt(t.closest("tr").sectionRowIndex%f(this,kt).template.length);var r={row:-1,col:-1};const n=a=>{const h=a.target.closest("th,td"),p=h.closest("tr");if(p.sectionRowIndex==r.row&&h.dataset.col==r.col||$(h).find("NG-ROW-INDICATOR").length>0)return;const m=parseInt(h.dataset.row)*f(this,kt).template.length+p.sectionRowIndex%f(this,kt).template.length,d=parseInt(h.dataset.col);this.selectArea(c,o,m,d),r={row:p.sectionRowIndex,col:h.dataset.col}},s=a=>{f(this,kt).body.querySelector("ng-vscrollbar").stopScroll(),clearInterval(f(this,$i)),$(".ng-table tbody.bindable",f(this,kt).body).off("mousemove",n),$(".ng-table tbody.bindable",f(this,kt).body).off("mouseenter",e),$(".ng-table tbody.bindable",f(this,kt).body).off("mouseleave",i),$(document).off("mousemove",u),$(document).off("mouseup",s)},e=a=>{clearInterval(f(this,$i)),$(document).off("mousemove",u)},i=a=>{const h=$(".ng-container-body",f(this,kt).body),p=h.find("thead"),m=h.find("tfoot");var d;parseInt(a.pageY)>=parseInt(h.offset().top+h.height()-m.height())?d=1:parseInt(a.pageY)<=parseInt(h.offset().top+p.height())&&(d=-1),this.selected.col=this.selected.startCol,d&&($(document).on("mousemove",u),tt(this,$i,setInterval(()=>{if(d>0){this.selected.endRow=h.find("tbody.bindable tr:last-child")[0].sectionRowIndex+f(this,kt).dataManager.viewRecords.rawIndex*f(this,kt).template.length;const b=parseInt(this.selected.startRow/f(this,kt).template.length),g=parseInt(this.selected.endRow/f(this,kt).template.length);b!=g&&(this.selected.endRow=Math.floor(this.selected.endRow/f(this,kt).template.length)*f(this,kt).template.length+f(this,kt).template.length-1),this.selected.endRow>parseInt(f(this,kt).data.count()*f(this,kt).template.length)-1&&(this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length)-1)}else{this.selected.startRow=h.find("tbody.bindable tr:first-child")[0].sectionRowIndex+f(this,kt).dataManager.viewRecords.rawIndex*f(this,kt).template.length-f(this,kt).template.length;const b=parseInt(this.selected.startRow/f(this,kt).template.length),g=parseInt(this.selected.endRow/f(this,kt).template.length);b!=g&&(this.selected.startRow=Math.floor(this.selected.startRow/f(this,kt).template.length)*f(this,kt).template.length),this.selected.startRow<0&&(this.selected.startRow=0)}f(this,kt).scrollBy(d)},500)))},u=a=>{var h;if($(".col-indicator",f(this,kt).body).each((p,m)=>{var d=$(m).offset().left,b=$(m).width();if(a.pageX>d&&a.pageX<d+b)return h=m,!1}),h){let p=parseInt(h.dataset.col);if(f(this,kt).body.querySelector(`tbody.bindable [data-col="${p}"] ng-row-indicator`))return;$("th,td",f(this,kt).template).each((m,d)=>{p>=parseInt(d.dataset.col)&&p<=parseInt(d.dataset.col)+d.colSpan-1&&(p=p>=o?Math.max(p,parseInt(d.dataset.col)+d.colSpan-1):Math.min(p,parseInt(d.dataset.col)))}),p>=this.selected.startCol&&p<=this.selected.endCol?p>this.selected.col?this.selected.endCol=p:p<this.selected.col?this.selected.startCol=p:this.selected.startCol=this.selected.endCol=p:p>this.selected.endCol?this.selected.endCol=p:p<this.selected.startCol&&(this.selected.startCol=p)}};[H.SELECTTYPE.AREA,H.SELECTTYPE.ROWS,H.SELECTTYPE.COLS].includes(this.type)&&($(".ng-table tbody.bindable",f(this,kt).body).on("mousemove",n),$(".ng-table tbody.bindable",f(this,kt).body).on("mouseenter",e),$(".ng-table tbody.bindable",f(this,kt).body).on("mouseleave",i)),$(document).on("mouseup",s),this.rawIndex=f(this,kt).dataManager.viewRecords.rawIndex});it(this,"selectArea",(E,t,l,c)=>{var o=Math.min(E,l),r=Math.max(E,l),n=Math.min(t,c),s=Math.max(t,c);$("tbody.bindable th,tbody.bindable td",f(this,kt).body).each((e,i)=>{var u=i.closest("tr"),a=parseInt(i.dataset.row)*f(this,kt).template.length+u.sectionRowIndex%f(this,kt).template.length,h=parseInt(i.dataset.col);a+i.rowSpan-1>=o&&a<=r&&h+i.colSpan-1>=n&&h<=s&&(o=Math.min(a,o),n=Math.min(h,n),r=Math.max(a+i.rowSpan-1,r),s=Math.max(h+i.colSpan-1,s))}),this.selected.startRow=o,this.selected.endRow=r,this.selected.startCol=n,this.selected.endCol=s,this.refresh()});it(this,"selectCell",(E,t)=>{this.selected.currentCol=t,this.selected.currentMatrixRow=E,this.selected.currentRow=parseInt(E/f(this,kt).template.length),this.selectArea(E,t,E,t)});it(this,"clear",()=>{this.selected.clear()});tt(this,kt,E),tt(this,Sr,new CustomEvent("selectchanged",{bubbles:!0,detail:{}})),this.selected={currentRow:-1,currentMatrixRow:-1,currentCol:-1,startRow:-1,startCol:-1,endRow:-1,endCol:-1,oldStartRow:-1,oldStartCol:-1,oldEndRow:-1,oldEndCol:-1,clear:()=>{this.selected.startRow=this.selected.endRow=this.selected.startCol=this.selected.endCol=-1,H.j.querySelectorAll("th,td",f(this,kt).body).removeClass("selected").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right")}},f(this,Vl).call(this)}get type(){return f(this,kt).getAttribute("select-type")}set type(E){if(!Object.values(H.SELECTTYPE).includes(E))throw`invalid select type : ${E}`;Object.values(H.SELECTTYPE).forEach(t=>{H.j.querySelectorAll(".ng-table",f(this,kt).body).removeClass(`select-type-${t}`)}),H.j.querySelectorAll(".ng-table",f(this,kt).body).addClass(`select-type-${E}`),f(this,kt).cell.refresh()}get rows(){const E=[];for(var t=this.selected.startRow;t<=this.selected.endRow;t++)t>=0&&E.push(parseInt(t/f(this,kt).template.length));return[...new Set(E)]}get subrows(){const E=[];for(var t=this.selected.startRow;t<=this.selected.endRow;t++)t>=0&&E.push(parseInt(t%f(this,kt).template.length));return[...new Set(E)]}get cols(){const E=[],t=this.subrows;for(var l=this.selected.startCol;l<=this.selected.endCol;l++)for(var c of t)$(`[data-col="${l}"]`,f(this,kt).template[c]).length>0&&E.push(l);return[...new Set(E)]}get binds(){const E=[],t=this.subrows;for(var l=this.selected.startCol;l<=this.selected.endCol;l++)for(var c of t){const o=$(`[data-col="${l}"]`,f(this,kt).template[c]);o.length>0&&o[0].dataset.bind&&E.push(o[0].dataset.bind)}return[...new Set(E)]}get firstRow(){return parseInt(this.selected.startRow/f(this,kt).template.length)}get lastRow(){return parseInt(this.selected.endRow/f(this,kt).template.length)}get firstCol(){return this.selected.startCol}get lastCol(){return this.selected.endCol}}kt=new WeakMap,Sr=new WeakMap,$i=new WeakMap,Vl=new WeakMap,no=new WeakMap;class Xu{constructor(E){Y(this,Ot);Y(this,hs);Y(this,oo);Y(this,ao);Y(this,lo);Y(this,jr);Y(this,ho);Y(this,co);Y(this,dr,0);Y(this,uo,E=>{var t;return $(".ng-container-body tbody.bindable tr",f(this,Ot).body).each((l,c)=>{var o=$(c).offset();if(E>=o.top&&E<=o.top+$(c).height())return t=c,!1}),t});Y(this,Wl,E=>{var t=f(this,Yl).call(this,E);if(t>0){t>f(this,Ot).dataManager.viewRecords.rawIndex&&(t=f(this,Ot).dataManager.viewRecords.rawIndex);const c=f(this,Ot).template.clone(),o=c.clone(),r=c.clone();c.find("th,td").not("[fixed=left]").remove(),o.find("th,td").not("[fixed=right]").remove(),r.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const n=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-left")),s=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-right")),e=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-body")),i=f(this,Ot).view.getVisibleFirstRow();for(var l=0;l<t;l++)c.each((u,a)=>{a.dataset.row=i-t+l,n.before(a.outerHTML)}),o.each((u,a)=>{a.dataset.row=i-t+l,s.before(a.outerHTML)}),r.each((u,a)=>{a.dataset.row=i-t+l,e.before(a.outerHTML)})}return t});Y(this,Xl,E=>{var t=f(this,Gl).call(this,E);if(t>0){f(this,Ot).view.getVisibleLastRow()+t>=f(this,Ot).data.count()&&(t=f(this,Ot).data.count()-f(this,Ot).view.getVisibleLastRow()-1);const c=f(this,Ot).template.clone(),o=c.clone(),r=c.clone();c.find("th,td").not("[fixed=left]").remove(),o.find("th,td").not("[fixed=right]").remove(),r.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const n=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-left")),s=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-right")),e=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-body")),i=f(this,Ot).view.getVisibleLastRow()+1;for(var l=0;l<t;l++)c.each((u,a)=>{a.dataset.row=i+l,n.before(a.outerHTML)}),o.each((u,a)=>{a.dataset.row=i+l,s.before(a.outerHTML)}),r.each((u,a)=>{a.dataset.row=i+l,e.before(a.outerHTML)})}return t});Y(this,Yl,E=>{const t=f(this,Ot).view.getVisibleFirstRow(),l=f(this,dr)+E;if(t<=0)return 0;for(var c=0,o=0;o<l;)o+=f(this,Ot).view.getRowHeight(t-++c);return c});Y(this,Gl,E=>{const t=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY()+E,l=f(this,Ot).view.getVisibleFirstRow(),c=f(this,Ot).view.getVisibleLastRow();for(var o=0,r=0;o<t;)o+=f(this,Ot).view.getRowHeight(l+r++);return r+1-(c-l+1)});Y(this,Kl,()=>{const E=f(this,Ot).view.getVisibleFirstRow(),t=f(this,Ot).view.getVisibleLastRow();for(var l=E,c=0,o=E;o<t;o++)if(c+=f(this,Ot).view.getRowHeight(o),c>f(this,dr)*-1){c-=f(this,Ot).view.getRowHeight(o),l=o;break}if(l>E){for(var o=E;o<l;o++)f(this,Ot).body.querySelectorAll(`tbody.bindable tr[data-row="${o}"]`).forEach(n=>{$(n).remove()});tt(this,dr,(c*-1-f(this,dr))*-1),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(r=>{r.style.transform=`translateY(${f(this,dr)}px)`})}return l-E});Y(this,Zl,()=>{const E=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY(),t=f(this,Ot).view.getVisibleFirstRow(),l=f(this,Ot).view.getVisibleLastRow();for(var c=f(this,Ot).data.count(),o=0,r=t;r<=l;r++)if(o+=f(this,Ot).view.getRowHeight(r),o>E){c=r+1;break}for(r=c;r<=l;r++)f(this,Ot).body.querySelectorAll(`tbody.bindable tr[data-row="${r}"]`).forEach(n=>{$(n).remove()});return l-c});it(this,"scrollTop",()=>{tt(this,dr,0),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(E=>{E.style.transform=`translateY(${f(this,dr)}px)`})});Y(this,fo,E=>{clearInterval(f(this,hs)),tt(this,oo,E.touches[0].pageX),tt(this,ao,E.touches[0].pageX-$(".ng-container-body table",f(this,Ot).body).position().left),tt(this,lo,E.touches[0].pageY),tt(this,jr,E.touches[0].pageY),tt(this,co,new Date);const t=f(this,uo).call(this,E.touches[0].pageY);t&&tt(this,ho,parseInt(t.dataset.row))});Y(this,po,E=>{if(!(E.touches.length>1||E.changedTouches.length>1)){if(E.preventDefault(),Math.abs(E.changedTouches[0].pageY-f(this,jr))>0){if(E.changedTouches[0].pageY>f(this,jr)){if(f(this,dr)+E.changedTouches[0].pageY-f(this,jr)>0&&f(this,Ot).view.getVisibleFirstRow()!=0){const o=f(this,Wl).call(this,E.changedTouches[0].pageY-f(this,jr));if(o>0){for(var t=f(this,Ot).view.getVisibleFirstRow(),l=t;l<t+o;l++)tt(this,dr,f(this,dr)-f(this,Ot).view.getRowHeight(l));f(this,Ot).dataManager.viewRecords.rawIndex-=o,f(this,Ot).view.redrawV3()}}}else E.changedTouches[0].pageY<f(this,jr)&&f(this,Xl).call(this,f(this,jr)-E.changedTouches[0].pageY)>0&&f(this,Ot).view.redrawV3();tt(this,dr,f(this,dr)+(E.changedTouches[0].pageY-f(this,jr))),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(o=>{o.style.transform=`translateY(${f(this,dr)}px)`}),tt(this,jr,E.changedTouches[0].pageY)}else if(Math.abs(E.changedTouches[0].pageX-f(this,oo))>20){var c=E.changedTouches[0].pageX-f(this,ao);c>0&&(c=0),$(".ng-container-body table",f(this,Ot).body).css({left:c}),f(this,Ot).body.querySelector("ng-hscrollbar").adjustThumb2()}}});Y(this,mo,E=>{f(this,Ot).view.getVisibleFirstRow()==0&&f(this,dr)>0&&this.scrollTop();var t=f(this,Kl).call(this);f(this,Ot).dataManager.viewRecords.rawIndex+=t,f(this,Zl).call(this);const l=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY();for(var c=0,o=f(this,Ot).view.getVisibleFirstRow();o<=f(this,Ot).view.getVisibleLastRow();o++)c+=f(this,Ot).view.getRowHeight(o);$(".ng-container tbody.bindable tr.nodata",f(this,Ot).body).height(l-c),f(this,Ot).view.fitPage();const r=f(this,uo).call(this,E.changedTouches[0].pageY);if(!r||f(this,ho)==parseInt(r.dataset.row))return;const n=500,s=parseInt(new Date-f(this,co));if(s>n)return;const e=parseInt((n-s)/1*((f(this,Ot).data.count()-f(this,Ot).dataManager.viewRecords.rawIndex)/1)/(n*1)),i=f(this,Ot).dataManager.viewRecords.rawIndex+e*(E.changedTouches[0].pageY>f(this,lo)?-1:1);clearInterval(f(this,hs)),i>f(this,Ot).dataManager.viewRecords.rawIndex?tt(this,hs,setInterval(()=>{f(this,Ot).scrollBy(1),f(this,Ot).view.getVisibleLastRow()>=i&&clearInterval(f(this,hs))},10)):tt(this,hs,setInterval(()=>{f(this,Ot).scrollBy(-1),f(this,Ot).dataManager.viewRecords.rawIndex<=i&&clearInterval(f(this,hs))},10))});Y(this,go,E=>{});it(this,"resetEvent",()=>{$("tbody.bindable",f(this,Ot).body).off("touchstart",f(this,fo)),$("tbody.bindable",f(this,Ot).body).off("touchend",f(this,mo)),$("tbody.bindable",f(this,Ot).body).off("touchmove",f(this,po)),$("tbody.bindable",f(this,Ot).body).off("touchcancel",f(this,go)),$("tbody.bindable",f(this,Ot).body).on("touchstart",f(this,fo)),$("tbody.bindable",f(this,Ot).body).on("touchend",f(this,mo)),$("tbody.bindable",f(this,Ot).body).on("touchmove",f(this,po)),$("tbody.bindable",f(this,Ot).body).on("touchcancel",f(this,go))});tt(this,Ot,E),this.resetEvent()}}Ot=new WeakMap,hs=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=new WeakMap,jr=new WeakMap,ho=new WeakMap,co=new WeakMap,dr=new WeakMap,uo=new WeakMap,Wl=new WeakMap,Xl=new WeakMap,Yl=new WeakMap,Gl=new WeakMap,Kl=new WeakMap,Zl=new WeakMap,fo=new WeakMap,po=new WeakMap,mo=new WeakMap,go=new WeakMap;class Yu extends _r{constructor(){super();Y(this,Jl);Y(this,Ql);Y(this,Li);Y(this,bo);Y(this,Pi);it(this,"dataRefresh",t=>{var l=this.cell.closest("tr").data;for(var c of f(this,Pi).data.datasets){var t=l[c["data-bind"]];switch(typeof t){case"string":c.data=t.split(",");break;case"object":Array.isArray(t)&&(c.data=t);break}}$(f(this,Li)).height(28),setTimeout(()=>{f(this,bo).update()}),t||this.reset()})}connectedCallback(){tt(this,Jl,this.getRootNode().host),tt(this,Ql,this.closest("th,td")),this.shadowRoot.innerHTML=`
45
+ `)).then(()=>{setTimeout(()=>{H.j.querySelectorAll(".selected",f(this,Ge).body).addClass("copied")}),setTimeout(()=>{H.j.querySelectorAll(".copied",f(this,Ge).body).removeClass("copied")},1e3)}).catch(o=>{console.error("Failed to copy text: ",o)})});Y(this,zl,(E,t)=>{const l=parseInt(E/f(this,Ge).template.length),o=f(this,Ge).template[E%f(this,Ge).template.length].querySelector(`[data-col="${t}"]`);if(!o||!o.dataset)return"";if(o.dataset.expr)return f(this,Ge).exprFunction(o.dataset.expr).call(this,f(this,Ge).data.get(l),l);if(o.dataset.bind)return f(this,Ge).data.get(l,o.dataset.bind)});tt(this,Ge,E),$(f(this,Ge).body).on("keydown",f(this,Fl))}}Ge=new WeakMap,Fl=new WeakMap,ql=new WeakMap,Hl=new WeakMap,zl=new WeakMap;class Vu{constructor(E){Y(this,lr);Y(this,Wt);Y(this,Ul);Y(this,Ri);Y(this,Es);Y(this,As);Y(this,Mi);Y(this,Ts);Y(this,Ii);Y(this,to);Y(this,Ni);Y(this,Oi);it(this,"moveCell",E=>{var t=E.target.closest("th,td")||E.target.getRootNode().host.closest("th,td")||document.activeElement.closest("th,td"),l=t.closest("tr");l.sectionRowIndex;var c=parseInt(t.dataset.col);parseInt(l.dataset.row);var o=parseInt(l.dataset.matrixRow),r,n;switch(E.code){case"Tab":case"ArrowRight":case"ArrowLeft":r=o;break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":n=c;break}switch(E.code){case"Tab":E.preventDefault(),n=E.shiftKey?f(this,ti).call(this,o,c):f(this,ji).call(this,o,c);break;case"ArrowRight":n=f(this,ji).call(this,o,c);break;case"ArrowLeft":n=f(this,ti).call(this,o,c);break;case"ArrowDown":if(t.closest("tbody.fixed"))r=parseInt(t.dataset.matrixRow)+(t.rowSpan||1);else{const e=parseInt(t.dataset.row),i=f(this,Wt).view.getVisibleLastRow();f(this,Wt).isLastPage&&e==i-1&&$(".ng-container-body .nodata",f(this,Wt).shadowRoot).height()<=0||!f(this,Wt).isLastPage&&f(this,Wt).lastRowHidden&&e>=i-1||!f(this,Wt).isLastPage&&!f(this,Wt).lastRowHidden&&e>=i?(f(this,Wt).scrollBy(1),this.currentCell=t,setTimeout(()=>{t.focus()})):r=parseInt(t.dataset.matrixRow)+(t.rowSpan||1)}break;case"ArrowUp":t.closest("tbody.fixed")?r=parseInt(t.dataset.matrixRow)-(t.rowSpan||1):t.closest("tr").sectionRowIndex==0?f(this,Wt).isFirstPage||(f(this,Wt).scrollBy(-1),this.currentCell=t,setTimeout(()=>{t.focus()})):r=parseInt(t.dataset.matrixRow)-(t.rowSpan||1);break;case"PageDown":f(this,Wt).pageDown();break;case"PageUp":f(this,Wt).pageUp();break}if(r!=null&&n!=null&&isFinite(r)){var s=f(this,eo).call(this,r,n);s&&!s.querySelector("ng-row-indicator")&&(this.currentCell=s)}["Tab","ArrowLeft","ArrowRight"].includes(E.code)&&f(this,Wt).body.querySelector("ng-hscrollbar").refresh()});Y(this,ti,(E,t)=>{var l=parseInt(E/f(this,Wt).template.length),c;return $(`tbody tr[data-matrix-row=${E}]`,f(this,Wt).body).find("th,td").each((o,r)=>{var n=parseInt(r.dataset.col);if(t-1>=n&&t-1<=n+r.colSpan-1)return c=H.j.querySelectorAll(r).hasClass("dummy")?f(this,ti).call(this,E,r.dataset.col):r.dataset.col,!1}),c==null&&$(`tbody tr[data-row=${l}]`,f(this,Wt).body).find("th,td").each((o,r)=>{var n=parseInt(r.dataset.col);if(t-1>=n&&t-1<=n+r.colSpan-1)return c=H.j.querySelectorAll(r).hasClass("dummy")?f(this,ti).call(this,E,r.dataset.col):r.dataset.col,!1}),c});Y(this,ji,(E,t)=>{var l=f(this,Wt).body.querySelector(`tbody [data-matrix-row="${E}"][data-col="${t}"]`),c=t+(l.colSpan||1),o=f(this,Wt).body.querySelector(`tbody [data-matrix-row="${E}"][data-col="${c}"]`);return H.j.querySelectorAll(o).hasClass("dummy")&&(c=f(this,ji).call(this,E,c)),c});Y(this,eo,(E,t)=>{var l=parseInt(E/f(this,Wt).template.length),c=$(`[data-matrix-row=${E}][data-col=${t}]`,f(this,Wt).body).not(".dummy").filter(":visible");return c.length==0&&(c=$(`[data-row=${l}][data-col=${t}]`,f(this,Wt).body).not(".dummy").filter(":visible")),c[0]});it(this,"refresh",()=>{f(this,Wt).selection.refresh()});Y(this,ro,E=>{E.altKey||E.shiftKey||E.ctrlKey||(E.preventDefault(),E.originalEvent.deltaY>0?f(this,Wt).scrollBy(1):f(this,Wt).scrollBy(-1))});Y(this,so,E=>{if(!(E.ctrlKey||E.altKey)&&!(E.target.tagName=="NG-ROW-INDICATOR"&&[H.SELECTTYPE.CELL,H.SELECTTYPE.AREA].includes(f(this,Wt).selection.type)))if(E.shiftKey){if([H.SELECTTYPE.COLS,H.SELECTTYPE.ROWS,H.SELECTTYPE.AREA].includes(f(this,Wt).selection.type)){var t=f(this,Wt).selection.getActiveCell();if(t){var l=t.closest("tr"),c=parseInt(t.dataset.row)*f(this,Wt).template.length+l.sectionRowIndex%f(this,Wt).template.length,o=parseInt(t.dataset.col),r=E.target.closest("th,td"),n=r.closest("tr"),s=parseInt(r.dataset.row)*f(this,Wt).template.length+n.sectionRowIndex%f(this,Wt).template.length,e=parseInt(r.dataset.col);f(this,Wt).selection.selectArea(c,o,s,e)}}}else{const i=E.target.closest("th,td"),u=f(this,Wt).view.getVisibleLastRow(),a=parseInt(i.closest("tr").dataset.row),h=!!i.closest("tbody.fixed"),p=f(this,Wt).shadowRoot.querySelector(".ng-container-body tr.nodata");if(!h&&$(p).height()<=0&&f(this,Wt).lastRowHidden&&u==a){const m=parseInt(i.closest("tr").dataset.matrixRow),d=parseInt(i.dataset.col);f(this,Wt).scrollBy(1);const b=f(this,eo).call(this,m,d);this.currentCell=b,setTimeout(()=>{b.focus()})}else this.currentCell=i}});Y(this,io,E=>{if(!(E.ctrlKey||E.altKey))if(["TH","TD"].includes(E.target.tagName)){if(["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(E.code))E.preventDefault(),this.moveCell(E);else if(["Enter"].includes(E.code)){E.preventDefault();const t=E.target.querySelector("ng-input");if(t){const l=t.shadowRoot.querySelector("input[type=text]");l.focus(),l.select()}}}else["NG-INPUT"].includes(E.target.tagName)&&["Enter"].includes(E.code)});it(this,"resetEvent",()=>{document.addEventListener("contextmenu",E=>E.preventDefault()),$(".ng-table tbody.bindable",f(this,Wt).body).off("wheel",f(this,ro)),$(".ng-table tbody",f(this,Wt).body).off("keydown","th,td",f(this,io)),$(".ng-table tbody",f(this,Wt).body).off("mousedown","th,td",f(this,so)),$(".ng-table tbody.bindable",f(this,Wt).body).on("wheel",f(this,ro)),$(".ng-table tbody",f(this,Wt).body).on("keydown","th,td",f(this,io)),$(".ng-table tbody",f(this,Wt).body).on("mousedown","th,td",f(this,so)),f(this,Wt).selection&&f(this,Wt).selection.resetEvent()});tt(this,Wt,E),tt(this,Es,-1),tt(this,As,-1),tt(this,Mi,-1),tt(this,Ts,-1),this.resetEvent()}get matrixRow(){return f(this,As)}get col(){return f(this,Ts)}get currentCell(){return f(this,Ri)}set currentCell(E){if(!E)return;tt(this,Ul,f(this,Ri)),tt(this,Ri,E),E.focus();var t=E.closest("tr");tt(this,lr,parseInt(t.dataset.row)*f(this,Wt).template.length+t.sectionRowIndex%f(this,Wt).template.length,Nu),tt(this,lr,parseInt(E.dataset.col),$u),tt(this,lr,E.cellIndex,Ou),tt(this,lr,E.dataset.bind,Lu),t.closest("tbody.fixed")||(f(this,Wt).row.at=E.dataset.row),f(this,Wt).selection.selectCell(f(this,lr,Iu),f(this,lr,ju));const l=E,c=parseInt(l.dataset.row),o=parseInt(l.dataset.matrixRow)%parseInt(l.dataset.row),r=parseInt(l.dataset.col),n=l.cellIndex,s=parseInt(f(this,Es)/f(this,Wt).template.length),e=parseInt(f(this,Es))%parseInt(f(this,Es)/f(this,Wt).template.length),i=f(this,Mi),u=f(this,to);if(c!=s||o!=e||r!=i){const a=new CustomEvent(H.EVENT.CELL_POS_CHANGED,{bubbles:!0,detail:{}});a.col=r,a.cellIndex=n,a.row=c,a.subrow=o,a.bind=l.dataset.bind,a.prev={col:i,cellIndex:u,col:i,row:s,subrow:e,bind:f(this,Ni)},f(this,Wt).dispatchEvent(a)}if(c!=s){const a=new CustomEvent(H.EVENT.ROW_POS_CHANGED,{bubbles:!0,detail:{}});a.col=r,a.cellIndex=n,a.row=c,a.subrow=o,a.bind=l.dataset.bind,a.prev={col:i,cellIndex:u,row:s,subrow:e,bind:f(this,Ni)},f(this,Wt).dispatchEvent(a)}}}Wt=new WeakMap,Ul=new WeakMap,Ri=new WeakMap,Es=new WeakMap,As=new WeakMap,Mi=new WeakMap,Ts=new WeakMap,Ii=new WeakMap,to=new WeakMap,Ni=new WeakMap,Oi=new WeakMap,lr=new WeakSet,Iu=function(){return f(this,As)},Nu=function(E){tt(this,Es,f(this,As)),tt(this,As,parseInt(E))},qf=function(){return f(this,Ii)},Ou=function(E){tt(this,to,f(this,Ii)),tt(this,Ii,parseInt(E))},ju=function(){return f(this,Ts)},$u=function(E){tt(this,Mi,f(this,Ts)),tt(this,Ts,parseInt(E))},Hf=function(){return f(this,Oi)},Lu=function(E){tt(this,Ni,f(this,Oi)),tt(this,Oi,E)},ti=new WeakMap,ji=new WeakMap,eo=new WeakMap,ro=new WeakMap,so=new WeakMap,io=new WeakMap;class Wu{constructor(E){Y(this,kt);Y(this,Sr);Y(this,$i);it(this,"getActiveCell",()=>{var E=this.selected.currentRow,t=this.selected.currentCol,l=parseInt(this.selected.currentMatrixRow%f(this,kt).template.length),c=$(`tbody.bindable [data-row=${E}]`,f(this,kt).body).find(`[data-col=${t}]`).not(".dummy").eq(l);return c.length>0?c[0]:null});it(this,"refresh",()=>{switch(this.type){case H.SELECTTYPE.ROW:this.selected.startRow=parseInt(f(this,kt).row.at*f(this,kt).template.length),this.selected.endRow=this.selected.startRow+f(this,kt).template.length-1;var t=[];$(`tbody tr[data-row=${parseInt(this.selected.startRow/f(this,kt).template.length)}] td`,f(this,kt).body).not(".dummy").not(".first").each((o,r)=>{parseInt(H.j.querySelectorAll(r).attr("tabindex"))>=0&&t.push(Number(r.dataset.col))}),this.selected.startCol=t.length>0?Math.min.apply(null,t):-1,this.selected.endCol=t.length>0?Math.max.apply(null,t):-1;break;case H.SELECTTYPE.ROWS:this.selected.startRow=parseInt(this.selected.startRow/f(this,kt).template.length)*f(this,kt).template.length,this.selected.endRow=parseInt(this.selected.endRow/f(this,kt).template.length)*f(this,kt).template.length-1+f(this,kt).template.length,this.selected.startCol=f(this,kt).firstCol,this.selected.endCol=f(this,kt).lastCol;break;case H.SELECTTYPE.COL:this.selected.startRow=0,this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length-1),this.selected.endCol=this.selected.startCol;var E=[];f(this,kt).template.each((o,r)=>{r.querySelectorAll("th,td").forEach(n=>{const s=parseInt(n.dataset.col),e=parseInt(n.colSpan||1);this.selected.startCol>=s&&this.selected.endCol<=s+e-1&&E.push(n)})});var t=[];E.forEach(o=>{t.push(parseInt(o.dataset.col)),t.push(parseInt(o.dataset.col)+parseInt(o.colSpan||1)-1)}),this.selected.startCol=Math.min.apply(null,t),this.selected.endCol=Math.max.apply(null,t);break;case H.SELECTTYPE.COLS:this.selected.startRow=0,this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length-1);var E=[];f(this,kt).template.each((o,r)=>{r.querySelectorAll("th,td").forEach(n=>{const s=parseInt(n.dataset.col),e=parseInt(n.colSpan||1);(this.selected.startCol>=s&&this.selected.startCol<=s+e-1||this.selected.endCol>=s&&this.selected.endCol<=s+e-1)&&E.push(n)})});var t=[];E.forEach(o=>{t.push(parseInt(o.dataset.col)),t.push(parseInt(o.dataset.col)+parseInt(o.colSpan||1)-1)}),this.selected.startCol=Math.min.apply(null,t),this.selected.endCol=Math.max.apply(null,t);break;case H.SELECTTYPE.CELL:this.selected.endRow=this.selected.startRow,this.selected.endCol=this.selected.startCol;break;case H.SELECTTYPE.AREA:break;case H.SELECTTYPE.NONE:this.selected.startRow=this.selected.endRow=this.selected.startCol=this.selected.endCol=-1;break}H.j.querySelectorAll("th,td",f(this,kt).body).removeClass("active").removeClass("multi-selected").removeClass("selected").removeClass("selected-current").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right"),H.j.querySelectorAll(".selected-current",f(this,kt).body).removeClass("selected-current"),H.j.querySelectorAll(`tr[data-row="${this.selected.currentRow}"] ng-row-indicator`,f(this,kt).body).addClass("selected-current"),H.j.querySelectorAll(`.col-indicator[data-col="${this.selected.currentCol}"]`,f(this,kt).body).addClass("selected-current"),$(`tr[data-row="${this.selected.currentRow}"] ng-row-indicator`,f(this,kt).body).closest("th,td").addClass("selected-current");var l=this.getActiveCell();l&&H.j.querySelectorAll(l).addClass("active"),$("tbody th,tbody td",f(this,kt).body).each((o,r)=>{var n=parseInt(r.dataset.col),s=parseInt(r.dataset.row)*f(this,kt).template.length+r.closest("tr").sectionRowIndex%f(this,kt).template.length;s==this.selected.currentMatrixRow&&n==this.selected.currentCol,s+r.rowSpan-1>=this.selected.startRow&&s<=this.selected.endRow&&n+r.colSpan-1>=this.selected.startCol&&n<=this.selected.endCol&&(H.j.querySelectorAll(r).addClass("selected"),this.selected.startRow==this.selected.endRow&&this.selected.startCol==this.selected.endCol?H.j.querySelectorAll(r).addClass("selected-top").addClass("selected-bottom").addClass("selected-left").addClass("selected-right"):(s==this.selected.startRow&&H.j.querySelectorAll(r).addClass("selected-top"),s+r.rowSpan-1==this.selected.endRow&&H.j.querySelectorAll(r).addClass("selected-bottom"),n==this.selected.startCol&&H.j.querySelectorAll(r).addClass("selected-left"),n+r.colSpan-1==this.selected.endCol&&H.j.querySelectorAll(r).addClass("selected-right"),H.j.querySelectorAll(r).addClass("multi-selected")))}),$("tbody.bindable tr",f(this,kt).body).each((o,r)=>{var n=r.querySelector("ng-row-indicator");if(n){n=n.closest("th,td");for(var s=parseInt(n.dataset.row),e=0;e<n.rowSpan;e++){var s=parseInt(n.dataset.row)*f(this,kt).template.length+r.sectionRowIndex%f(this,kt).template.length+e;s>=this.selected.startRow&&s<=this.selected.endRow&&H.j.querySelectorAll(n).addClass("selected-area")}}});for(var c=this.selected.startCol;c<=this.selected.endCol;c++)H.j.querySelectorAll(`.col-indicator[data-col="${c}"]`,f(this,kt).body).addClass("selected-area");(this.selected.oldStartRow!=this.selected.startRow||this.selected.oldEndRow!=this.selected.endRow||this.selected.oldStartCol!=this.selected.startCol||this.selected.oldEndCol!=this.selected.endCol)&&(f(this,Sr).oldStartRow=this.selected.oldStartRow,f(this,Sr).oldEndRow=this.selected.oldEndRow,f(this,Sr).oldStartCol=this.selected.oldStartCol,f(this,Sr).oldEndCol=this.selected.oldEndCol,f(this,Sr).startRow=this.selected.startRow,f(this,Sr).endRow=this.selected.endRow,f(this,Sr).startCol=this.selected.startCol,f(this,Sr).endCol=this.selected.endCol,f(this,kt).dispatchEvent(f(this,Sr))),this.selected.oldStartRow=this.selected.startRow,this.selected.oldEndRow=this.selected.endRow,this.selected.oldStartCol=this.selected.startCol,this.selected.oldEndCol=this.selected.endCol});it(this,"resetEvent",()=>{$(".ng-table tbody.bindable",f(this,kt).body).off("mousedown","th,td",f(this,no)).on("mousedown","th,td",f(this,no))});Y(this,Vl,()=>{this.resetEvent()});Y(this,no,E=>{if(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftKey)return;const t=E.target.closest("th,td"),l=t.closest("tr"),c=parseInt(t.dataset.row)*f(this,kt).template.length+l.sectionRowIndex%f(this,kt).template.length,o=parseInt(t.dataset.col);this.selected.currentCol=t.dataset.col,this.selected.currentRow=t.dataset.row,this.selected.currentMatrixRow=parseInt(t.dataset.row*f(this,kt).template.length)+parseInt(t.closest("tr").sectionRowIndex%f(this,kt).template.length);var r={row:-1,col:-1};const n=a=>{const h=a.target.closest("th,td"),p=h.closest("tr");if(p.sectionRowIndex==r.row&&h.dataset.col==r.col||$(h).find("NG-ROW-INDICATOR").length>0)return;const m=parseInt(h.dataset.row)*f(this,kt).template.length+p.sectionRowIndex%f(this,kt).template.length,d=parseInt(h.dataset.col);this.selectArea(c,o,m,d),r={row:p.sectionRowIndex,col:h.dataset.col}},s=a=>{f(this,kt).body.querySelector("ng-vscrollbar").stopScroll(),clearInterval(f(this,$i)),$(".ng-table tbody.bindable",f(this,kt).body).off("mousemove",n),$(".ng-table tbody.bindable",f(this,kt).body).off("mouseenter",e),$(".ng-table tbody.bindable",f(this,kt).body).off("mouseleave",i),$(document).off("mousemove",u),$(document).off("mouseup",s)},e=a=>{clearInterval(f(this,$i)),$(document).off("mousemove",u)},i=a=>{const h=$(".ng-container-body",f(this,kt).body),p=h.find("thead"),m=h.find("tfoot");var d;parseInt(a.pageY)>=parseInt(h.offset().top+h.height()-m.height())?d=1:parseInt(a.pageY)<=parseInt(h.offset().top+p.height())&&(d=-1),this.selected.col=this.selected.startCol,d&&($(document).on("mousemove",u),tt(this,$i,setInterval(()=>{if(d>0){this.selected.endRow=h.find("tbody.bindable tr:last-child")[0].sectionRowIndex+f(this,kt).dataManager.viewRecords.rawIndex*f(this,kt).template.length;const b=parseInt(this.selected.startRow/f(this,kt).template.length),g=parseInt(this.selected.endRow/f(this,kt).template.length);b!=g&&(this.selected.endRow=Math.floor(this.selected.endRow/f(this,kt).template.length)*f(this,kt).template.length+f(this,kt).template.length-1),this.selected.endRow>parseInt(f(this,kt).data.count()*f(this,kt).template.length)-1&&(this.selected.endRow=parseInt(f(this,kt).data.count()*f(this,kt).template.length)-1)}else{this.selected.startRow=h.find("tbody.bindable tr:first-child")[0].sectionRowIndex+f(this,kt).dataManager.viewRecords.rawIndex*f(this,kt).template.length-f(this,kt).template.length;const b=parseInt(this.selected.startRow/f(this,kt).template.length),g=parseInt(this.selected.endRow/f(this,kt).template.length);b!=g&&(this.selected.startRow=Math.floor(this.selected.startRow/f(this,kt).template.length)*f(this,kt).template.length),this.selected.startRow<0&&(this.selected.startRow=0)}f(this,kt).scrollBy(d)},500)))},u=a=>{var h;if($(".col-indicator",f(this,kt).body).each((p,m)=>{var d=$(m).offset().left,b=$(m).width();if(a.pageX>d&&a.pageX<d+b)return h=m,!1}),h){let p=parseInt(h.dataset.col);if(f(this,kt).body.querySelector(`tbody.bindable [data-col="${p}"] ng-row-indicator`))return;$("th,td",f(this,kt).template).each((m,d)=>{p>=parseInt(d.dataset.col)&&p<=parseInt(d.dataset.col)+d.colSpan-1&&(p=p>=o?Math.max(p,parseInt(d.dataset.col)+d.colSpan-1):Math.min(p,parseInt(d.dataset.col)))}),p>=this.selected.startCol&&p<=this.selected.endCol?p>this.selected.col?this.selected.endCol=p:p<this.selected.col?this.selected.startCol=p:this.selected.startCol=this.selected.endCol=p:p>this.selected.endCol?this.selected.endCol=p:p<this.selected.startCol&&(this.selected.startCol=p)}};[H.SELECTTYPE.AREA,H.SELECTTYPE.ROWS,H.SELECTTYPE.COLS].includes(this.type)&&($(".ng-table tbody.bindable",f(this,kt).body).on("mousemove",n),$(".ng-table tbody.bindable",f(this,kt).body).on("mouseenter",e),$(".ng-table tbody.bindable",f(this,kt).body).on("mouseleave",i)),$(document).on("mouseup",s),this.rawIndex=f(this,kt).dataManager.viewRecords.rawIndex});it(this,"selectArea",(E,t,l,c)=>{var o=Math.min(E,l),r=Math.max(E,l),n=Math.min(t,c),s=Math.max(t,c);$("tbody.bindable th,tbody.bindable td",f(this,kt).body).each((e,i)=>{var u=i.closest("tr"),a=parseInt(i.dataset.row)*f(this,kt).template.length+u.sectionRowIndex%f(this,kt).template.length,h=parseInt(i.dataset.col);a+i.rowSpan-1>=o&&a<=r&&h+i.colSpan-1>=n&&h<=s&&(o=Math.min(a,o),n=Math.min(h,n),r=Math.max(a+i.rowSpan-1,r),s=Math.max(h+i.colSpan-1,s))}),this.selected.startRow=o,this.selected.endRow=r,this.selected.startCol=n,this.selected.endCol=s,this.refresh()});it(this,"selectCell",(E,t)=>{this.selected.currentCol=t,this.selected.currentMatrixRow=E,this.selected.currentRow=parseInt(E/f(this,kt).template.length),this.selectArea(E,t,E,t)});it(this,"clear",()=>{this.selected.clear()});tt(this,kt,E),tt(this,Sr,new CustomEvent("selectchanged",{bubbles:!0,detail:{}})),this.selected={currentRow:-1,currentMatrixRow:-1,currentCol:-1,startRow:-1,startCol:-1,endRow:-1,endCol:-1,oldStartRow:-1,oldStartCol:-1,oldEndRow:-1,oldEndCol:-1,clear:()=>{this.selected.startRow=this.selected.endRow=this.selected.startCol=this.selected.endCol=-1,H.j.querySelectorAll("th,td",f(this,kt).body).removeClass("selected").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right")}},f(this,Vl).call(this)}get type(){return f(this,kt).getAttribute("select-type")}set type(E){if(!Object.values(H.SELECTTYPE).includes(E))throw`invalid select type : ${E}`;Object.values(H.SELECTTYPE).forEach(t=>{H.j.querySelectorAll(".ng-table",f(this,kt).body).removeClass(`select-type-${t}`)}),H.j.querySelectorAll(".ng-table",f(this,kt).body).addClass(`select-type-${E}`),f(this,kt).cell.refresh()}get rows(){const E=[];for(var t=this.selected.startRow;t<=this.selected.endRow;t++)t>=0&&E.push(parseInt(t/f(this,kt).template.length));return[...new Set(E)]}get subrows(){const E=[];for(var t=this.selected.startRow;t<=this.selected.endRow;t++)t>=0&&E.push(parseInt(t%f(this,kt).template.length));return[...new Set(E)]}get cols(){const E=[],t=this.subrows;for(var l=this.selected.startCol;l<=this.selected.endCol;l++)for(var c of t)$(`[data-col="${l}"]`,f(this,kt).template[c]).length>0&&E.push(l);return[...new Set(E)]}get binds(){const E=[],t=this.subrows;for(var l=this.selected.startCol;l<=this.selected.endCol;l++)for(var c of t){const o=$(`[data-col="${l}"]`,f(this,kt).template[c]);o.length>0&&o[0].dataset.bind&&E.push(o[0].dataset.bind)}return[...new Set(E)]}get firstRow(){return parseInt(this.selected.startRow/f(this,kt).template.length)}get lastRow(){return parseInt(this.selected.endRow/f(this,kt).template.length)}get firstCol(){return this.selected.startCol}get lastCol(){return this.selected.endCol}}kt=new WeakMap,Sr=new WeakMap,$i=new WeakMap,Vl=new WeakMap,no=new WeakMap;class Xu{constructor(E){Y(this,Ot);Y(this,hs);Y(this,oo);Y(this,ao);Y(this,lo);Y(this,jr);Y(this,ho);Y(this,co);Y(this,dr,0);Y(this,uo,E=>{var t;return $(".ng-container-body tbody.bindable tr",f(this,Ot).body).each((l,c)=>{var o=$(c).offset();if(E>=o.top&&E<=o.top+$(c).height())return t=c,!1}),t});Y(this,Wl,E=>{var t=f(this,Yl).call(this,E);if(t>0){t>f(this,Ot).dataManager.viewRecords.rawIndex&&(t=f(this,Ot).dataManager.viewRecords.rawIndex);const c=f(this,Ot).template.clone(),o=c.clone(),r=c.clone();c.find("th,td").not("[fixed=left]").remove(),o.find("th,td").not("[fixed=right]").remove(),r.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const n=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-left")),s=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-right")),e=$("tbody.bindable tr:first-child",f(this,Ot).body.querySelector(".ng-container-body")),i=f(this,Ot).view.getVisibleFirstRow();for(var l=0;l<t;l++)c.each((u,a)=>{a.dataset.row=i-t+l,n.before(a.outerHTML)}),o.each((u,a)=>{a.dataset.row=i-t+l,s.before(a.outerHTML)}),r.each((u,a)=>{a.dataset.row=i-t+l,e.before(a.outerHTML)})}return t});Y(this,Xl,E=>{var t=f(this,Gl).call(this,E);if(t>0){f(this,Ot).view.getVisibleLastRow()+t>=f(this,Ot).data.count()&&(t=f(this,Ot).data.count()-f(this,Ot).view.getVisibleLastRow()-1);const c=f(this,Ot).template.clone(),o=c.clone(),r=c.clone();c.find("th,td").not("[fixed=left]").remove(),o.find("th,td").not("[fixed=right]").remove(),r.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const n=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-left")),s=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-right")),e=$("tr.nodata",f(this,Ot).body.querySelector(".ng-container-body")),i=f(this,Ot).view.getVisibleLastRow()+1;for(var l=0;l<t;l++)c.each((u,a)=>{a.dataset.row=i+l,n.before(a.outerHTML)}),o.each((u,a)=>{a.dataset.row=i+l,s.before(a.outerHTML)}),r.each((u,a)=>{a.dataset.row=i+l,e.before(a.outerHTML)})}return t});Y(this,Yl,E=>{const t=f(this,Ot).view.getVisibleFirstRow(),l=f(this,dr)+E;if(t<=0)return 0;for(var c=0,o=0;o<l;)o+=f(this,Ot).view.getRowHeight(t-++c);return c});Y(this,Gl,E=>{const t=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY()+E,l=f(this,Ot).view.getVisibleFirstRow(),c=f(this,Ot).view.getVisibleLastRow();for(var o=0,r=0;o<t;)o+=f(this,Ot).view.getRowHeight(l+r++);return r+1-(c-l+1)});Y(this,Kl,()=>{const E=f(this,Ot).view.getVisibleFirstRow(),t=f(this,Ot).view.getVisibleLastRow();for(var l=E,c=0,o=E;o<t;o++)if(c+=f(this,Ot).view.getRowHeight(o),c>f(this,dr)*-1){c-=f(this,Ot).view.getRowHeight(o),l=o;break}if(l>E){for(var o=E;o<l;o++)f(this,Ot).body.querySelectorAll(`tbody.bindable tr[data-row="${o}"]`).forEach(n=>{$(n).remove()});tt(this,dr,(c*-1-f(this,dr))*-1),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(r=>{r.style.transform=`translateY(${f(this,dr)}px)`})}return l-E});Y(this,Zl,()=>{const E=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY(),t=f(this,Ot).view.getVisibleFirstRow(),l=f(this,Ot).view.getVisibleLastRow();for(var c=f(this,Ot).data.count(),o=0,r=t;r<=l;r++)if(o+=f(this,Ot).view.getRowHeight(r),o>E){c=r+1;break}for(r=c;r<=l;r++)f(this,Ot).body.querySelectorAll(`tbody.bindable tr[data-row="${r}"]`).forEach(n=>{$(n).remove()});return l-c});it(this,"scrollTop",()=>{tt(this,dr,0),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(E=>{E.style.transform=`translateY(${f(this,dr)}px)`})});Y(this,fo,E=>{clearInterval(f(this,hs)),tt(this,oo,E.touches[0].pageX),tt(this,ao,E.touches[0].pageX-$(".ng-container-body table",f(this,Ot).body).position().left),tt(this,lo,E.touches[0].pageY),tt(this,jr,E.touches[0].pageY),tt(this,co,new Date);const t=f(this,uo).call(this,E.touches[0].pageY);t&&tt(this,ho,parseInt(t.dataset.row))});Y(this,po,E=>{if(!(E.touches.length>1||E.changedTouches.length>1)){if(E.preventDefault(),Math.abs(E.changedTouches[0].pageY-f(this,jr))>0){if(E.changedTouches[0].pageY>f(this,jr)){if(f(this,dr)+E.changedTouches[0].pageY-f(this,jr)>0&&f(this,Ot).view.getVisibleFirstRow()!=0){const o=f(this,Wl).call(this,E.changedTouches[0].pageY-f(this,jr));if(o>0){for(var t=f(this,Ot).view.getVisibleFirstRow(),l=t;l<t+o;l++)tt(this,dr,f(this,dr)-f(this,Ot).view.getRowHeight(l));f(this,Ot).dataManager.viewRecords.rawIndex-=o,f(this,Ot).view.redrawV3()}}}else E.changedTouches[0].pageY<f(this,jr)&&f(this,Xl).call(this,f(this,jr)-E.changedTouches[0].pageY)>0&&f(this,Ot).view.redrawV3();tt(this,dr,f(this,dr)+(E.changedTouches[0].pageY-f(this,jr))),f(this,Ot).body.querySelectorAll("tbody.bindable").forEach(o=>{o.style.transform=`translateY(${f(this,dr)}px)`}),tt(this,jr,E.changedTouches[0].pageY)}else if(Math.abs(E.changedTouches[0].pageX-f(this,oo))>20){var c=E.changedTouches[0].pageX-f(this,ao);c>0&&(c=0),$(".ng-container-body table",f(this,Ot).body).css({left:c}),f(this,Ot).body.querySelector("ng-hscrollbar").adjustThumb2()}}});Y(this,mo,E=>{f(this,Ot).view.getVisibleFirstRow()==0&&f(this,dr)>0&&this.scrollTop();var t=f(this,Kl).call(this);f(this,Ot).dataManager.viewRecords.rawIndex+=t,f(this,Zl).call(this);const l=f(this,Ot).view.getTotalSpace()-f(this,Ot).view.getTranslateY();for(var c=0,o=f(this,Ot).view.getVisibleFirstRow();o<=f(this,Ot).view.getVisibleLastRow();o++)c+=f(this,Ot).view.getRowHeight(o);$(".ng-container tbody.bindable tr.nodata",f(this,Ot).body).height(l-c),f(this,Ot).view.fitPage();const r=f(this,uo).call(this,E.changedTouches[0].pageY);if(!r||f(this,ho)==parseInt(r.dataset.row))return;const n=500,s=parseInt(new Date-f(this,co));if(s>n)return;const e=parseInt((n-s)/1*((f(this,Ot).data.count()-f(this,Ot).dataManager.viewRecords.rawIndex)/1)/(n*1)),i=f(this,Ot).dataManager.viewRecords.rawIndex+e*(E.changedTouches[0].pageY>f(this,lo)?-1:1);clearInterval(f(this,hs)),i>f(this,Ot).dataManager.viewRecords.rawIndex?tt(this,hs,setInterval(()=>{f(this,Ot).scrollBy(1),f(this,Ot).view.getVisibleLastRow()>=i&&clearInterval(f(this,hs))},10)):tt(this,hs,setInterval(()=>{f(this,Ot).scrollBy(-1),f(this,Ot).dataManager.viewRecords.rawIndex<=i&&clearInterval(f(this,hs))},10))});Y(this,go,E=>{});it(this,"resetEvent",()=>{$("tbody.bindable",f(this,Ot).body).off("touchstart",f(this,fo)),$("tbody.bindable",f(this,Ot).body).off("touchend",f(this,mo)),$("tbody.bindable",f(this,Ot).body).off("touchmove",f(this,po)),$("tbody.bindable",f(this,Ot).body).off("touchcancel",f(this,go)),$("tbody.bindable",f(this,Ot).body).on("touchstart",f(this,fo)),$("tbody.bindable",f(this,Ot).body).on("touchend",f(this,mo)),$("tbody.bindable",f(this,Ot).body).on("touchmove",f(this,po)),$("tbody.bindable",f(this,Ot).body).on("touchcancel",f(this,go))});tt(this,Ot,E),this.resetEvent()}}Ot=new WeakMap,hs=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=new WeakMap,jr=new WeakMap,ho=new WeakMap,co=new WeakMap,dr=new WeakMap,uo=new WeakMap,Wl=new WeakMap,Xl=new WeakMap,Yl=new WeakMap,Gl=new WeakMap,Kl=new WeakMap,Zl=new WeakMap,fo=new WeakMap,po=new WeakMap,mo=new WeakMap,go=new WeakMap;class Yu extends _r{constructor(){super();Y(this,Jl);Y(this,Ql);Y(this,Li);Y(this,bo);Y(this,Pi);it(this,"dataRefresh",t=>{var l=this.cell.closest("tr").data;for(var c of f(this,Pi).data.datasets){var t=l[c["data-bind"]];switch(typeof t){case"string":c.data=t.split(",");break;case"object":Array.isArray(t)&&(c.data=t);break}}$(f(this,Li)).height(28),setTimeout(()=>{f(this,bo).update()}),t||this.reset()})}connectedCallback(){tt(this,Jl,this.getRootNode().host),tt(this,Ql,this.closest("th,td")),this.shadowRoot.innerHTML=`
46
46
  <style>
47
47
  :host {
48
48
  height: 100%;
@@ -157,7 +157,7 @@
157
157
  </style>
158
158
 
159
159
  <div></div>
160
- `}}customElements.get("ng-col-mover-grip")||customElements.define("ng-col-mover-grip",Zu),customElements.get("ng-col-mover-indi")||customElements.define("ng-col-mover-indi",Ju);class Qu{constructor(E){Y(this,ve);Y(this,$r);Y(this,Fr);Y(this,xo);Y(this,kr);Y(this,zi);Y(this,qr);it(this,"resetEvent",()=>{$(document).off("mouseup",f(this,Ui)),$(".ng-table thead",f(this,ve).body).off("mousedown",f(this,ko)),f(this,ve).body.querySelectorAll(".ng-table thead").forEach(E=>{E.removeEventListener("click",f(this,_o))}),$(document).on("mouseup",f(this,Ui)),$(".ng-table thead",f(this,ve).body).on("mousedown",f(this,ko)),f(this,ve).body.querySelectorAll(".ng-table thead").forEach(E=>{E.addEventListener("click",f(this,_o))})});Y(this,_o,E=>{if(E.target.closest("ng-filter-button"))return;const t=E.currentTarget||E.target,l=getComputedStyle(t,":before"),c=getComputedStyle(t,":after");if(!(!l&&!c)){if(l){const i=Number(l.getPropertyValue("top").slice(0,-2)),u=6,a=Number(l.getPropertyValue("left").slice(0,-2));if(E.layerX>=a&&E.layerX<=a+6&&E.layerY>=i&&E.layerY<=i+u){var o=E.target.closest(".ng-container-left")||E.target.closest(".ng-container-body");if(o){var r=o.querySelectorAll("thead tr:nth-child(2) th:not(.dummy),thead tr:nth-child(2) td:not(.dummy)"),n=E.target.closest(".ng-container-left")?f(this,ve).body.querySelector(".ng-container-body"):f(this,ve).body.querySelector(".ng-container-right"),s=n.querySelector("thead tr:nth-child(2) th:first-child,thead tr:nth-child(2) td:first-child");const p=parseInt(r[r.length-1].dataset.col),m=r[r.length-1].colSpan;for(var e=0;e<m;e++)f(this,ve).body.querySelectorAll(`[data-col="${p+e}"] ng-col-expand:not(.expand)`).forEach(d=>{d.expand()});E.target.closest(".ng-container-body")?f(this,ve).body.querySelectorAll(".ng-container-right colgroup col:not(.dummy)").length==0?f(this,ve).columns.moveColumn(r[r.length-1],s):(f(this,ve).columns.moveColumn(r[r.length-1],s),f(this,ve).columns.moveColumn(r[r.length-1],s)):(f(this,ve).columns.moveColumn(r[r.length-1],s),f(this,ve).columns.moveColumn(r[r.length-1],s))}}}if(c){const i=Number(c.getPropertyValue("top").slice(0,-2)),u=6,a=Number(c.getPropertyValue("left").slice(0,-2));if(E.layerX>=a&&E.layerX<=a+6&&E.layerY>=i&&E.layerY<=i+u){var o=E.target.closest(".ng-container-body")||E.target.closest(".ng-container-right");if(o){var r=o.querySelector("thead tr:nth-child(2) th:first-child,thead tr:nth-child(2) td:first-child"),n=E.target.closest(".ng-container-body")?f(this,ve).body.querySelector(".ng-container-left"):f(this,ve).body.querySelector(".ng-container-body"),s=n.querySelectorAll("thead tr:nth-child(2) th:not(.dummy),thead tr:nth-child(2) td:not(.dummy)");const g=parseInt(r.dataset.col),S=r.colSpan;for(var e=0;e<S;e++)f(this,ve).body.querySelectorAll(`[data-col="${g+e}"] ng-col-expand:not(.expand)`).forEach(I=>{I.expand()});E.target.closest(".ng-container-right")?(f(this,ve).columns.moveColumn(r,s[s.length-1]),f(this,ve).columns.moveColumn(s[s.length-1],r)):(f(this,ve).columns.moveColumn(r,s[s.length-1]),f(this,ve).columns.moveColumn(r,s[s.length-1]))}}}}});Y(this,ou,E=>{if(!["INPUT"].includes(E.target.tagName)){var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.pageY=E.changedTouches[0].pageY,E.buttons=1,f(this,Co).call(this,E),$(document).on("touchmove",l=>f(this,So).call(this,l))}});Y(this,So,E=>{var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.pageY=E.changedTouches[0].pageY,E.clientX=E.changedTouches[0].clientX,f(this,Vi).call(this,E)});Y(this,au,E=>{E.clientX=E.changedTouches[0].clientX,f(this,Ui).call(this,E)});Y(this,ko,E=>{H.j.querySelectorAll(f(this,ve)).attr("col-movable")=="true"&&E.target.tagName!="NG-FILTER-BUTTON"&&(tt(this,zi,!0),setTimeout(()=>{f(this,zi)&&f(this,Co).call(this,E)},500))});Y(this,Co,E=>{if(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftkey||["INPUT"].includes(E.target.tagName))return;var t=E.pageX-$(E.target).offset().left;if(t<=3||$(E.target).width()-t<=3)return;E.target.closest(".ng-container-right")&&f(this,ve).body.querySelector("ng-hscrollbar").scrollToEnd();var l=E.target.closest("th,td");tt(this,kr,{col:parseInt(l.dataset.col),row:E.target.closest("tr").sectionRowIndex,target:l}),tt(this,xo,t+f(this,$r)[0].getBoundingClientRect().x);const c=f(this,$r)[0].shadowRoot.querySelector("span");c.innerHTML=$(E.target).html(),$(c).css({font:$(l).css("font")}),f(this,$r).show(),f(this,$r).width($(l).width()),f(this,$r).height($(l).height()),f(this,$r).offset({top:$(l).offset().top-1}),$(document).on("mousemove",f(this,Vi)),f(this,Eo).call(this,E.pageX);const o=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);f(this,Fr).height($(o).height())});Y(this,Ui,E=>{if(tt(this,zi,!1),$(document).off("mousemove",f(this,Vi)),$(document).off("touchmove",f(this,So)),f(this,qr)&&$(f(this,qr).target).css({cursor:f(this,qr).cursor}),f(this,kr)){var t=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);f(this,ve).columns.moveColumn(f(this,kr).target,t)}tt(this,qr,null),tt(this,kr,null),f(this,$r).hide(),f(this,Fr).hide()});Y(this,Vi,E=>{if(f(this,kr)!=null){f(this,qr)&&$(f(this,qr).target).css({cursor:f(this,qr).cursor}),tt(this,qr,{target:E.target,cursor:$(E.target).css("cursor")}),$(E.target).css({cursor:E.target.closest("thead")||E.target.tagName=="ng-col-mover-grip"?"move":"not-allowed"});var t=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);if(t)if(f(this,kr).col>parseInt(t.dataset.col)){var l=$(t).offset();f(this,Fr).show(),f(this,Fr).offset({left:parseInt(l.left-1),top:l.top})}else if(f(this,kr).col<parseInt(t.dataset.col)){var l=$(t).offset();f(this,Fr).show(),f(this,Fr).offset({left:parseInt(l.left+$(t).width()-1),top:l.top})}else f(this,Fr).hide();f(this,Eo).call(this,E.pageX)}});Y(this,Eo,E=>{f(this,$r).offset({left:E-f(this,xo)})});tt(this,ve,E),$(".ng-container",f(this,ve).body).append($("<ng-col-mover-grip></ng-col-mover-grip>").hide()).append($("<ng-col-mover-indi></ng-col-mover-indi>").hide()),tt(this,$r,$("ng-col-mover-grip",f(this,ve).body)),tt(this,Fr,$("ng-col-mover-indi",f(this,ve).body)),this.resetEvent()}}ve=new WeakMap,$r=new WeakMap,Fr=new WeakMap,xo=new WeakMap,kr=new WeakMap,zi=new WeakMap,qr=new WeakMap,_o=new WeakMap,ou=new WeakMap,So=new WeakMap,au=new WeakMap,ko=new WeakMap,Co=new WeakMap,Ui=new WeakMap,Vi=new WeakMap,Eo=new WeakMap;class td{constructor(E){Y(this,Ie);Y(this,Cr);Y(this,Er);Y(this,Rs);Y(this,Ms);Y(this,Hr);Y(this,Ar);Y(this,Is);Y(this,Ns,[]);it(this,"resetEvent",()=>{$(".ng-table > thead",f(this,Ie).body).off("mousemove",f(this,Ro)).off("mousedown",f(this,Mo)).off("dblclick",f(this,Ao)),$(document).off("mouseup",f(this,To)),$(".ng-table > thead",f(this,Ie).body).on("mousemove",f(this,Ro)).on("mousedown",f(this,Mo)).on("dblclick",f(this,Ao)),$(document).on("mouseup",f(this,To))});it(this,"autoFit",E=>{if(f(this,Ie).body)if(E){f(this,Ie).body.querySelector("ng-hscrollbar").scrollToHome(),tt(this,Ns,[]);var t=0;$(".ng-container-body col",f(this,Ie).body).each((c,o)=>{f(this,Ns).push({col:o,width:parseInt(o.getAttribute("width"))})}),f(this,Ns).forEach(c=>{t+=c.width}),$(".ng-container-body > table",f(this,Ie).body).css({width:"100%","min-width":"100%"});var l=$(".ng-container-body",f(this,Ie).body).width();l!=0&&f(this,Ns).forEach(c=>{var o=c.width*l/t;c.col.setAttribute("width",o)})}else $(".ng-container-body > table",f(this,Ie).body).css({width:"0","min-width":"0"}),f(this,Ns).forEach(c=>{c.col.setAttribute("width",c.width)})});Y(this,Ao,E=>{E.target.style.cursor=="col-resize"&&f(this,rh).call(this,E)});Y(this,To,E=>{tt(this,Ms,!1)});Y(this,Ro,E=>{if(!E.target.closest("ng-info")&&(E.target=E.target.closest("th,td"),!!E.target&&f(this,Ie).getAttribute("col-resizable")=="true"&&!(E.altKey||E.ctrlKey||E.shiftkey)))if(E.preventDefault(),E.offsetX<=2||E.offsetX>=E.target.offsetWidth-2){if(E.offsetX<=2&&f(this,Ie).tableUtils.isFirst(E.target)||E.offsetX>=E.target.offsetWidth-2&&f(this,Ie).tableUtils.isLast(E.target))return;E.target.style.cursor="col-resize"}else E.target.style.cursor="auto"});Y(this,lu,E=>{tt(this,Ms,!0),setTimeout(()=>{f(this,Ms)&&f(this,eh).call(this,E)},500)});Y(this,Mo,E=>{const t=E.target.closest("th,td");!t||t.style.cursor!="col-resize"||(tt(this,Ms,!0),setTimeout(()=>{f(this,Ms)&&f(this,Io).call(this,E)},500))});Y(this,eh,E=>{E.target=E.target.closest("th,td");var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.buttons=1,f(this,Io).call(this,E),f(this,Cr).is(":visible")?($(E.target).on("touchmove",l=>f(this,Wi).call(this,l)),$(E.target).on("touchend",l=>f(this,Yi).call(this,l))):($(E.target).off("touchmove",l=>f(this,Wi).call(this,l)),$(E.target).off("touchend",l=>f(this,Yi).call(this,l)))});Y(this,Io,E=>{if(E.target=E.target.closest("th,td"),!(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftkey)){if(tt(this,Is,!!E.target.closest(".ng-container-right")),E.pageX-$(E.target).offset().left<=3){var t=$(`.col-indicator[data-col=${E.target.dataset.col}]`,f(this,Ie).body).not(".dummy")[0];tt(this,Hr,f(this,Ie).tableUtils.prev(t)),tt(this,Ar,$(t))}else{if($(E.target).width()-E.offsetX>2)return;var l=parseInt(E.target.dataset.col)+E.target.colSpan-1,t=$(`.col-indicator[data-col=${l}]`,f(this,Ie).body).not(".dummy")[0];tt(this,Hr,$(t)),tt(this,Ar,f(this,Ie).tableUtils.next(t))}f(this,Cr).show(),f(this,Er).offset({top:$(".ng-container-body",f(this,Ie).body).offset().top,left:f(this,Ar).offset().left-1}),f(this,Er).height(f(this,Ie).body.querySelector(".ng-container-body").offsetHeight),f(this,Rs).offset({top:$(".ng-container-body",f(this,Ie).body).offset().top}),f(this,Gi).call(this,E.pageX),$(f(this,Cr)).off("mousemove",f(this,Xi)).off("mouseup",f(this,ri)).on("mousemove",f(this,Xi)).on("mouseup",f(this,ri))}});Y(this,Wi,E=>{f(this,Gi).call(this,E.changedTouches[0].pageX)});Y(this,Xi,E=>{f(this,Gi).call(this,E.pageX)});Y(this,Yi,E=>{$(E.target).off("touchmove",t=>f(this,Wi).call(this,t)),$(E.target).off("touchend",t=>f(this,Yi).call(this,t)),f(this,ri).call(this,E)});Y(this,ri,E=>{if(!f(this,Er).is(":visible"))return;var t;f(this,Is)?t=f(this,Ar).offset().left-f(this,Er).offset().left+f(this,Ar).width():t=f(this,Er).offset().left-f(this,Hr).offset().left+1,t<=1&&(t=0);const l=f(this,Is)?f(this,Ar)[0].dataset.col:f(this,Hr)[0].dataset.col;f(this,Ie).columns.width(l,t),$(f(this,Cr)).off("mousemove",f(this,Xi)),$(f(this,Cr)).off("mouseup",f(this,ri)),f(this,Cr).hide()});Y(this,Gi,E=>{!f(this,Is)&&E<f(this,Hr).offset().left&&(E=f(this,Hr).offset().left),f(this,Er).offset({left:E});var t=parseInt(f(this,Er).offset().left),l,c,o;f(this,Is)?(c=f(this,Ar).width()+f(this,Ar).offset().left-f(this,Er).offset().left,o=c<10?10:c-1,l=parseInt(f(this,Ar).width()+f(this,Ar).offset().left-f(this,Er).offset().left)):(c=parseInt(t-f(this,Hr).offset().left),o=c,l=parseInt(t-f(this,Hr).offset().left+1),t=t-o),l<=1&&(l=0),f(this,Rs).offset({left:t}),f(this,Rs).width(o),f(this,Rs).find("span").text(l)});Y(this,rh,E=>{var t=E.target.closest("th,td"),l=f(this,Ie).tableUtils.prev(t),c=f(this,Ie).tableUtils.next(t),o=f(this,Ie).getBand(t.dataset.col)==H.BAND.RIGHT?E.offsetX<=2?$(t):c:E.offsetX<=2?l:$(t);f(this,Ie).setColumnWidthFit(o[0].dataset.col)});tt(this,Ie,E),tt(this,Cr,$('<div class="resizer-col-panel"><div class="grip"></div><div class="tooltip"><div></div><span></span><div></div></div></div>').hide()),$(f(this,Ie).body).append(f(this,Cr)),tt(this,Er,f(this,Cr).find(".grip")),tt(this,Rs,f(this,Cr).find(".tooltip")),this.resetEvent()}}Ie=new WeakMap,Cr=new WeakMap,Er=new WeakMap,Rs=new WeakMap,Ms=new WeakMap,Hr=new WeakMap,Ar=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Ao=new WeakMap,To=new WeakMap,Ro=new WeakMap,lu=new WeakMap,Mo=new WeakMap,eh=new WeakMap,Io=new WeakMap,Wi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,ri=new WeakMap,Gi=new WeakMap,rh=new WeakMap;class ed{constructor(E){Y(this,ce);it(this,"count",()=>f(this,ce).activeTmpl.querySelectorAll("[data-bind]").length);it(this,"info",E=>{const t=l=>{if(!l)return null;const c=f(this,ce).body.querySelectorAll(`thead [data-col="${l.dataset.col}"]`);return{name:l.dataset.bind,type:(l.dataset.type||"string").toLocaleLowerCase(),desc:c.length>0?c[c.length-1].getAttribute("title"):null}};return E?t(f(this,ce).activeTmpl.querySelector(`[data-bind="${E}"]`)):Array.from(f(this,ce).activeTmpl.querySelectorAll("[data-bind]")).filter(l=>l.dataset.bind!=="rowState").map(l=>t(l))});Y(this,si,(E,t)=>{var l=Array.from(E.querySelectorAll("col"));return l[t]});Y(this,Lr,(E,t,l)=>{var c=[];if(!E)return c;for(var o=t;o<=l;o++)c=c.concat(Array.from(E.querySelectorAll(`[data-col="${o}"]:not(.dummy)`)));return c});Y(this,Ki,(E,t,l)=>{const c=(r,n)=>{const s=parseInt(n.dataset.col);return r.closest("thead,tbody,tfoot"),r.querySelector(`[data-col="${s}"]`)},o=(r,n)=>{const s=parseInt(n.dataset.col),e=n.colSpan||1,i=!r.closest("thead,tbody,tfoot");var u=r.querySelectorAll("th:not(.tmp),td:not(.tmp)");for(var a of u)if(parseInt(a.dataset.col)>s+e-1)return a};return parseInt(t.dataset.col)>parseInt(l.dataset.col)?c(E,l):o(E,l)});Y(this,No,E=>{const t={org:{thead:{cells:[]},tfoot:{cells:[]},tbody:{cells:[]},fixed:{cells:[]},cols:[]},thead:{cells:[]},tfoot:{cells:[]},tbody:{cells:[]},fixed:{cells:[]},template:{cells:[]},cols:[]},l=E.colSpan||1,c=E.closest("table"),o=parseInt(E.dataset.col),r=E.closest("tr").sectionRowIndex;$("thead tr",c).each((e,i)=>{if(i.sectionRowIndex<r&&i.sectionRowIndex!=0)return!0;t.thead.cells=t.thead.cells.concat(f(this,Lr).call(this,i,o,o+l-1))}),t.tfoot.cells=f(this,Lr).call(this,c.querySelector("tfoot"),o,o+l-1),t.tbody.cells=f(this,Lr).call(this,c.querySelector("tbody.bindable"),o,o+l-1),t.fixed.cells=f(this,Lr).call(this,c.querySelector("tbody.fixed"),o,o+l-1);const n=f(this,ce).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");t.org.thead.cells=f(this,Lr).call(this,n.currentTable.querySelector("thead"),o,o+l-1),t.org.tfoot.cells=f(this,Lr).call(this,n.currentTable.querySelector("tfoot"),o,o+l-1),t.org.tbody.cells=f(this,Lr).call(this,n.currentTable.querySelector("tbody.bindable"),o,o+l-1),t.org.fixed.cells=f(this,Lr).call(this,n.currentTable.querySelector("tbody.fixed"),o,o+l-1),f(this,ce).template.each((e,i)=>{t.template.cells=t.template.cells.concat(f(this,Lr).call(this,i,o,o+l-1))});for(var s=o;s<=o+l-1;s++)t.cols.push(f(this,si).call(this,f(this,ce).body,s));for(var s=o;s<=o+l-1;s++)t.org.cols.push(f(this,si).call(this,n.currentTable,s));return t});Y(this,sh,(E,t,l,c)=>{if(E.closest("tr").rowIndex!=t.closest("tr").rowIndex)return!1;const o=parseInt(E.dataset.col),r=E.colSpan;parseInt(t.dataset.col),t.colSpan;for(var n of[l.thead.cells,l.tfoot.cells,l.tbody.cells,l.fixed.cells,l.template.cells])for(var s of n){const e=parseInt(s.dataset.col),i=s.colSpan;if(e<o||e+i-1>o+r-1)return!1}return!0});it(this,"moveColumn",(E,t)=>{if(!E||!t)return!1;const l=f(this,ce).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout"),c=f(this,No).call(this,E),o=f(this,No).call(this,t),r=t.closest("table"),n=!!(E.closest(".ng-container-left")||t.closest(".ng-container-left")),s=!!(E.closest(".ng-container-right")||t.closest(".ng-container-right"));if(!f(this,sh).call(this,E,t,c,o))return!1;for(var e of[c.thead.cells,c.tfoot.cells,c.tbody.cells,c.fixed.cells])for(var i of e){H.j.querySelectorAll(i).addClass("tmp");const b=i.closest("tr").rowIndex,g=r.querySelectorAll("tr")[b];var u=f(this,Ki).call(this,g,E,t);u?g.insertBefore(i,u):g.appendChild(i)}for(var e of[c.org.thead.cells,c.org.tfoot.cells,c.org.tbody.cells,c.org.fixed.cells])for(var i of e){H.j.querySelectorAll(i).addClass("tmp");const S=i.closest("table"),C=i.closest("tr").rowIndex,I=S.querySelectorAll("tr")[C];var u=f(this,Ki).call(this,I,E,t);u?I.insertBefore(i,u):I.appendChild(i)}for(var i of c.template.cells){H.j.querySelectorAll(i).addClass("tmp");const g=i.closest("tr");var u=f(this,Ki).call(this,g,E,t);u?g.insertBefore(i,u):g.appendChild(i)}var a;parseInt(E.dataset.col)>parseInt(t.dataset.col)?a=parseInt(t.dataset.col):a=parseInt(t.dataset.col)+(t.colSpan||1)-1+(parseInt(E.dataset.col)>parseInt(t.dataset.col)?0:1);let h=f(this,si).call(this,f(this,ce).body,a);const p=t.closest("table")==h.closest("table");for(var m of c.cols)m&&(p?t.closest("table").querySelector("colgroup").insertBefore(m,h):t.closest("table").querySelector("colgroup").appendChild(m));for(var m of c.org.cols)h=f(this,si).call(this,l.currentTable,a),m&&m.closest("colgroup").insertBefore(m,h);for(var e of[c.thead.cells,c.tfoot.cells,c.tbody.cells,c.fixed.cells])for(var i of e)H.j.querySelectorAll(i).removeClass("tmp");for(var e of[c.org.thead.cells,c.org.tfoot.cells,c.org.tbody.cells,c.org.fixed.cells])for(var i of e)H.j.querySelectorAll(i).removeClass("tmp");for(var i of c.template.cells)H.j.querySelectorAll(i).removeClass("tmp");if(f(this,ce).body.querySelectorAll(".ng-container-left col").forEach(b=>{b.setAttribute("fixed","left")}),f(this,ce).body.querySelectorAll(".ng-container-left .col-indicator").forEach(b=>{b.setAttribute("fixed","left")}),f(this,ce).body.querySelectorAll(".ng-container-right col").forEach(b=>{b.setAttribute("fixed","right")}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{b.setAttribute("fixed","right")}),f(this,ce).body.querySelectorAll(".ng-container-body col").forEach(b=>{b.removeAttribute("fixed")}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{b.removeAttribute("fixed")}),l.currentTable.querySelectorAll("colgroup col").forEach(b=>{b.removeAttribute("fixed")}),$("th,td",f(this,ce).template).each((b,g)=>{g.removeAttribute("fixed")}),$("th,td",l.currentTable).each((b,g)=>{g.removeAttribute("fixed")}),f(this,ce).body.querySelectorAll(".ng-container-left .col-indicator").forEach(b=>{$(`[data-col="${b.dataset.col}"]`,f(this,ce).template).each((g,S)=>{S.setAttribute("fixed","left")}),$(`[data-col="${b.dataset.col}"]`,l.currentTable).each((g,S)=>{S.setAttribute("fixed","left")}),$("colgroup col",l.currentTable).each((g,S)=>{g<=parseInt(b.dataset.col)&&S.setAttribute("fixed","left")})}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{$(`[data-col="${b.dataset.col}"]`,f(this,ce).template).each((g,S)=>{S.setAttribute("fixed","right")}),$(`[data-col="${b.dataset.col}"]`,l.currentTable).each((g,S)=>{S.setAttribute("fixed","right")})}),f(this,ce).resetTemplate(),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{$("colgroup col",l.currentTable).each((g,S)=>{g>=parseInt(b.dataset.col)&&S.setAttribute("fixed","right")})}),n){var d=t.closest(".ng-container-body")?-E.offsetWidth:0;$(".ng-container-left .col-indicator",f(this,ce).body).each((b,g)=>{d+=g.offsetWidth}),$(".ng-container-left",f(this,ce).body).css({width:d,"min-width":d})}if(s){var d=t.closest(".ng-container-body")?-E.offsetWidth:0;$(".ng-container-right .col-indicator",f(this,ce).body).each((g,S)=>{d+=S.offsetWidth}),$(".ng-container-right",f(this,ce).body).css({width:d,"min-width":d})}f(this,ce).refreshData()});it(this,"width",(E,t)=>{t=parseFloat(t);const l=f(this,ce).body.querySelector(`colgroup col[data-col="${E}"]`),c=!!l.closest(".ng-container-left"),o=!!l.closest(".ng-container-right"),r=!!l.closest(".ng-container-body"),n=c?"left":o?"right":"body";if(r)if(f(this,ce).getAttribute("auto-fit-col")=="true"){var s=0;$(".ng-container-body .col-indicator",f(this,ce).body).not(`[data-col=${E}]`).each((u,a)=>{s+=a.offsetWidth});const i=$(".ng-container-body",f(this,ce).body).width();$(".ng-container-body col",f(this,ce).body).each((u,a)=>{var h=parseInt(E==a.dataset.col?t:a.getAttribute("width"))*i/s;a.setAttribute("width",h)})}else l.setAttribute("width",t);else{var e=0;$(`.ng-container-${n} .col-indicator`,f(this,ce).body).not(`[data-col=${E}]`).each((i,u)=>{e+=parseInt(u.offsetWidth)}),$(`.ng-container-${n}`,f(this,ce).body).css({width:parseInt(e+t),"min-width":parseInt(e+t)}),l.setAttribute("width",t)}});tt(this,ce,E)}}ce=new WeakMap,si=new WeakMap,Lr=new WeakMap,Ki=new WeakMap,No=new WeakMap,sh=new WeakMap;class rd extends Ve.trace.constructor{constructor(){super(),this.init("nine-grid","green")}}const sd=new rd;class id extends Qs{constructor(){super();Y(this,ih,10);Y(this,Zi);Y(this,De);Y(this,nr);Y(this,Oo);Y(this,Os);Y(this,ii);Y(this,Ji);it(this,"dataRefresh",t=>{f(this,nr)&&(f(this,nh).call(this)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid")),f(this,Zi).innerHTML=this.getDisplayText()||"Select",t||this.reset()});Y(this,nh,()=>{if(H.isNull(this.value))return!0;var t=this.multi?this.value.split(this.multiSeparator):[this.value];for(var l of t){var c=f(this,nr).findIndex(o=>l==o[f(this,Os)]);if(c<0)return!1}return!0});Y(this,oh,()=>{if(this.owner){if(tt(this,De,this.owner.shadowRoot.querySelector("ng-combo-panel")),this.owner.shadowRoot.querySelectorAll("ng-combo-panel").length>1)throw"too many ng-combo-panel";var t=this.getAttribute("data-source");t&&this.owner&&this.owner.exprFunction}});Y(this,ah,t=>{if(console.log(f(this,nr)),!!f(this,nr)){console.log(f(this,nr)),f(this,De).col=this.cell.dataset.col,f(this,De).row=this.cell.closest("tr").sectionRowIndex,f(this,nr).length>f(this,ih)?H.j.querySelectorAll(f(this,De)).addClass("expand"):H.j.querySelectorAll(f(this,De)).removeClass("expand"),this.multi?H.j.querySelectorAll(f(this,De)).addClass("multi"):H.j.querySelectorAll(f(this,De)).removeClass("multi"),f(this,De).refresh(this,f(this,nr),f(this,Os),f(this,Ji));var l=$(".btn1",this.shadowRoot).offset().left-$(this.owner).offset().left;l+$(f(this,De)).width()>$(this.owner).width()&&(l=$(".btn2",this.shadowRoot).offset().left-$(this.owner).offset().left-$(f(this,De)).width()+8),l<0&&(l=0);var c=Math.min(f(this,nr).length,f(this,Oo))*26;this.multi?(H.j.querySelectorAll(f(this,De)).hasClass("expand")&&(c+=12,c+=3,c+=24),c+=2,c+=3,c+=25):(H.j.querySelectorAll(f(this,De)).hasClass("expand")&&(c+=12,c+=3,c+=24),c+=3);var o=$(".btn1",this.shadowRoot).offset().top+$(".btn1",this.shadowRoot).height()-$(this.owner).offset().top+3;o+c>$(this.owner).height()&&(o-=c+$(".btn1",this.shadowRoot).height()+6);var r=this.getAttribute("template");r&&console.error("logic error !!!!"),$(f(this,De)).css({left:l,top:o,height:c,"min-height":c}).show(),H.j.querySelectorAll(f(this,De)).hasClass("expand")&&$("div",f(this,De)).eq(0).find("input").focus().val("")}});Y(this,lh,t=>{t.target.closest("ng-combo-panel")||(f(this,De).row=f(this,De).col=-1,$(f(this,De)).hide())});Y(this,hu,()=>"a")}connectedCallback(){this.multi=this.getAttribute("multi")=="true",this.multiSeparator=this.getAttribute("multi-separator")||",",tt(this,Oo,this.getAttribute("rows")||5),tt(this,Os,this.getAttribute("code")||"code"),tt(this,ii,this.getAttribute("codename")||"codename"),tt(this,Ji,(this.getAttribute("items")||f(this,ii)||"").split(",")),f(this,Ji).unshift("CHK");var t=this.querySelector("datalist");t&&(tt(this,nr,[]),t.querySelectorAll("option").forEach(n=>{const s=n.getAttribute(f(this,Os)),e=n.getAttribute(f(this,ii));s&&e&&f(this,nr).push({[f(this,Os)]:s,[f(this,ii)]:e})})),this.shadowRoot.innerHTML=`
160
+ `}}customElements.get("ng-col-mover-grip")||customElements.define("ng-col-mover-grip",Zu),customElements.get("ng-col-mover-indi")||customElements.define("ng-col-mover-indi",Ju);class Qu{constructor(E){Y(this,ve);Y(this,$r);Y(this,Fr);Y(this,xo);Y(this,kr);Y(this,zi);Y(this,qr);it(this,"resetEvent",()=>{$(document).off("mouseup",f(this,Ui)),$(".ng-table thead",f(this,ve).body).off("mousedown",f(this,ko)),f(this,ve).body.querySelectorAll(".ng-table thead").forEach(E=>{E.removeEventListener("click",f(this,_o))}),$(document).on("mouseup",f(this,Ui)),$(".ng-table thead",f(this,ve).body).on("mousedown",f(this,ko)),f(this,ve).body.querySelectorAll(".ng-table thead").forEach(E=>{E.addEventListener("click",f(this,_o))})});Y(this,_o,E=>{if(E.target.closest("ng-filter-button"))return;const t=E.currentTarget||E.target,l=getComputedStyle(t,":before"),c=getComputedStyle(t,":after");if(!(!l&&!c)){if(l){const i=Number(l.getPropertyValue("top").slice(0,-2)),u=6,a=Number(l.getPropertyValue("left").slice(0,-2));if(E.layerX>=a&&E.layerX<=a+6&&E.layerY>=i&&E.layerY<=i+u){var o=E.target.closest(".ng-container-left")||E.target.closest(".ng-container-body");if(o){var r=o.querySelectorAll("thead tr:nth-child(2) th:not(.dummy),thead tr:nth-child(2) td:not(.dummy)"),n=E.target.closest(".ng-container-left")?f(this,ve).body.querySelector(".ng-container-body"):f(this,ve).body.querySelector(".ng-container-right"),s=n.querySelector("thead tr:nth-child(2) th:first-child,thead tr:nth-child(2) td:first-child");const p=parseInt(r[r.length-1].dataset.col),m=r[r.length-1].colSpan;for(var e=0;e<m;e++)f(this,ve).body.querySelectorAll(`[data-col="${p+e}"] ng-col-expand:not(.expand)`).forEach(d=>{d.expand()});E.target.closest(".ng-container-body")?f(this,ve).body.querySelectorAll(".ng-container-right colgroup col:not(.dummy)").length==0?f(this,ve).columns.moveColumn(r[r.length-1],s):(f(this,ve).columns.moveColumn(r[r.length-1],s),f(this,ve).columns.moveColumn(r[r.length-1],s)):(f(this,ve).columns.moveColumn(r[r.length-1],s),f(this,ve).columns.moveColumn(r[r.length-1],s))}}}if(c){const i=Number(c.getPropertyValue("top").slice(0,-2)),u=6,a=Number(c.getPropertyValue("left").slice(0,-2));if(E.layerX>=a&&E.layerX<=a+6&&E.layerY>=i&&E.layerY<=i+u){var o=E.target.closest(".ng-container-body")||E.target.closest(".ng-container-right");if(o){var r=o.querySelector("thead tr:nth-child(2) th:first-child,thead tr:nth-child(2) td:first-child"),n=E.target.closest(".ng-container-body")?f(this,ve).body.querySelector(".ng-container-left"):f(this,ve).body.querySelector(".ng-container-body"),s=n.querySelectorAll("thead tr:nth-child(2) th:not(.dummy),thead tr:nth-child(2) td:not(.dummy)");const g=parseInt(r.dataset.col),S=r.colSpan;for(var e=0;e<S;e++)f(this,ve).body.querySelectorAll(`[data-col="${g+e}"] ng-col-expand:not(.expand)`).forEach(I=>{I.expand()});E.target.closest(".ng-container-right")?(f(this,ve).columns.moveColumn(r,s[s.length-1]),f(this,ve).columns.moveColumn(s[s.length-1],r)):(f(this,ve).columns.moveColumn(r,s[s.length-1]),f(this,ve).columns.moveColumn(r,s[s.length-1]))}}}}});Y(this,ou,E=>{if(!["INPUT"].includes(E.target.tagName)){var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.pageY=E.changedTouches[0].pageY,E.buttons=1,f(this,Co).call(this,E),$(document).on("touchmove",l=>f(this,So).call(this,l))}});Y(this,So,E=>{var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.pageY=E.changedTouches[0].pageY,E.clientX=E.changedTouches[0].clientX,f(this,Vi).call(this,E)});Y(this,au,E=>{E.clientX=E.changedTouches[0].clientX,f(this,Ui).call(this,E)});Y(this,ko,E=>{H.j.querySelectorAll(f(this,ve)).attr("col-movable")=="true"&&E.target.tagName!="NG-FILTER-BUTTON"&&(tt(this,zi,!0),setTimeout(()=>{f(this,zi)&&f(this,Co).call(this,E)},500))});Y(this,Co,E=>{if(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftkey||["INPUT"].includes(E.target.tagName))return;var t=E.pageX-$(E.target).offset().left;if(t<=3||$(E.target).width()-t<=3)return;E.target.closest(".ng-container-right")&&f(this,ve).body.querySelector("ng-hscrollbar").scrollToEnd();var l=E.target.closest("th,td");tt(this,kr,{col:parseInt(l.dataset.col),row:E.target.closest("tr").sectionRowIndex,target:l}),tt(this,xo,t+f(this,$r)[0].getBoundingClientRect().x);const c=f(this,$r)[0].shadowRoot.querySelector("span");c.innerHTML=$(E.target).html(),$(c).css({font:$(l).css("font")}),f(this,$r).show(),f(this,$r).width($(l).width()),f(this,$r).height($(l).height()),f(this,$r).offset({top:$(l).offset().top-1}),$(document).on("mousemove",f(this,Vi)),f(this,Eo).call(this,E.pageX);const o=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);f(this,Fr).height($(o).height())});Y(this,Ui,E=>{if(tt(this,zi,!1),$(document).off("mousemove",f(this,Vi)),$(document).off("touchmove",f(this,So)),f(this,qr)&&$(f(this,qr).target).css({cursor:f(this,qr).cursor}),f(this,kr)){var t=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);f(this,ve).columns.moveColumn(f(this,kr).target,t)}tt(this,qr,null),tt(this,kr,null),f(this,$r).hide(),f(this,Fr).hide()});Y(this,Vi,E=>{if(f(this,kr)!=null){f(this,qr)&&$(f(this,qr).target).css({cursor:f(this,qr).cursor}),tt(this,qr,{target:E.target,cursor:$(E.target).css("cursor")}),$(E.target).css({cursor:E.target.closest("thead")||E.target.tagName=="ng-col-mover-grip"?"move":"not-allowed"});var t=f(this,ve).tableUtils.getElement("thead",f(this,kr).row,E.clientX);if(t)if(f(this,kr).col>parseInt(t.dataset.col)){var l=$(t).offset();f(this,Fr).show(),f(this,Fr).offset({left:parseInt(l.left-1),top:l.top})}else if(f(this,kr).col<parseInt(t.dataset.col)){var l=$(t).offset();f(this,Fr).show(),f(this,Fr).offset({left:parseInt(l.left+$(t).width()-1),top:l.top})}else f(this,Fr).hide();f(this,Eo).call(this,E.pageX)}});Y(this,Eo,E=>{f(this,$r).offset({left:E-f(this,xo)})});tt(this,ve,E),$(".ng-container",f(this,ve).body).append($("<ng-col-mover-grip></ng-col-mover-grip>").hide()).append($("<ng-col-mover-indi></ng-col-mover-indi>").hide()),tt(this,$r,$("ng-col-mover-grip",f(this,ve).body)),tt(this,Fr,$("ng-col-mover-indi",f(this,ve).body)),this.resetEvent()}}ve=new WeakMap,$r=new WeakMap,Fr=new WeakMap,xo=new WeakMap,kr=new WeakMap,zi=new WeakMap,qr=new WeakMap,_o=new WeakMap,ou=new WeakMap,So=new WeakMap,au=new WeakMap,ko=new WeakMap,Co=new WeakMap,Ui=new WeakMap,Vi=new WeakMap,Eo=new WeakMap;class td{constructor(E){Y(this,Ie);Y(this,Cr);Y(this,Er);Y(this,Rs);Y(this,Ms);Y(this,Hr);Y(this,Ar);Y(this,Is);Y(this,Ns,[]);it(this,"resetEvent",()=>{$(".ng-table > thead",f(this,Ie).body).off("mousemove",f(this,Ro)).off("mousedown",f(this,Mo)).off("dblclick",f(this,Ao)),$(document).off("mouseup",f(this,To)),$(".ng-table > thead",f(this,Ie).body).on("mousemove",f(this,Ro)).on("mousedown",f(this,Mo)).on("dblclick",f(this,Ao)),$(document).on("mouseup",f(this,To))});it(this,"autoFit",E=>{if(f(this,Ie).body)if(E){f(this,Ie).body.querySelector("ng-hscrollbar").scrollToHome(),tt(this,Ns,[]);var t=0;$(".ng-container-body col",f(this,Ie).body).each((c,o)=>{f(this,Ns).push({col:o,width:parseInt(o.getAttribute("width"))})}),f(this,Ns).forEach(c=>{t+=c.width}),$(".ng-container-body > table",f(this,Ie).body).css({width:"100%","min-width":"100%"});var l=$(".ng-container-body",f(this,Ie).body).width();l!=0&&f(this,Ns).forEach(c=>{var o=c.width*l/t;c.col.setAttribute("width",o)})}else $(".ng-container-body > table",f(this,Ie).body).css({width:"0","min-width":"0"}),f(this,Ns).forEach(c=>{c.col.setAttribute("width",c.width)})});Y(this,Ao,E=>{E.target.style.cursor=="col-resize"&&f(this,rh).call(this,E)});Y(this,To,E=>{tt(this,Ms,!1)});Y(this,Ro,E=>{if(!E.target.closest("ng-info")&&(E.target=E.target.closest("th,td"),!!E.target&&f(this,Ie).getAttribute("col-resizable")=="true"&&!(E.altKey||E.ctrlKey||E.shiftkey)))if(E.preventDefault(),E.offsetX<=2||E.offsetX>=E.target.offsetWidth-2){if(E.offsetX<=2&&f(this,Ie).tableUtils.isFirst(E.target)||E.offsetX>=E.target.offsetWidth-2&&f(this,Ie).tableUtils.isLast(E.target))return;E.target.style.cursor="col-resize"}else E.target.style.cursor="auto"});Y(this,lu,E=>{tt(this,Ms,!0),setTimeout(()=>{f(this,Ms)&&f(this,eh).call(this,E)},500)});Y(this,Mo,E=>{const t=E.target.closest("th,td");!t||t.style.cursor!="col-resize"||(tt(this,Ms,!0),setTimeout(()=>{f(this,Ms)&&f(this,Io).call(this,E)},500))});Y(this,eh,E=>{E.target=E.target.closest("th,td");var t=E.target.getBoundingClientRect();E.offsetX=E.targetTouches[0].pageX-t.left,E.pageX=E.changedTouches[0].pageX,E.buttons=1,f(this,Io).call(this,E),f(this,Cr).is(":visible")?($(E.target).on("touchmove",l=>f(this,Wi).call(this,l)),$(E.target).on("touchend",l=>f(this,Yi).call(this,l))):($(E.target).off("touchmove",l=>f(this,Wi).call(this,l)),$(E.target).off("touchend",l=>f(this,Yi).call(this,l)))});Y(this,Io,E=>{if(E.target=E.target.closest("th,td"),!(E.buttons!=1||E.altKey||E.ctrlKey||E.shiftkey)){if(tt(this,Is,!!E.target.closest(".ng-container-right")),E.pageX-$(E.target).offset().left<=3){var t=$(`.col-indicator[data-col=${E.target.dataset.col}]`,f(this,Ie).body).not(".dummy")[0];tt(this,Hr,f(this,Ie).tableUtils.prev(t)),tt(this,Ar,$(t))}else{if($(E.target).width()-E.offsetX>2)return;var l=parseInt(E.target.dataset.col)+E.target.colSpan-1,t=$(`.col-indicator[data-col=${l}]`,f(this,Ie).body).not(".dummy")[0];tt(this,Hr,$(t)),tt(this,Ar,f(this,Ie).tableUtils.next(t))}f(this,Cr).show(),f(this,Er).offset({top:$(".ng-container-body",f(this,Ie).body).offset().top,left:f(this,Ar).offset().left-1}),f(this,Er).height(f(this,Ie).body.querySelector(".ng-container-body").offsetHeight),f(this,Rs).offset({top:$(".ng-container-body",f(this,Ie).body).offset().top}),f(this,Gi).call(this,E.pageX),$(f(this,Cr)).off("mousemove",f(this,Xi)).off("mouseup",f(this,ri)).on("mousemove",f(this,Xi)).on("mouseup",f(this,ri))}});Y(this,Wi,E=>{f(this,Gi).call(this,E.changedTouches[0].pageX)});Y(this,Xi,E=>{f(this,Gi).call(this,E.pageX)});Y(this,Yi,E=>{$(E.target).off("touchmove",t=>f(this,Wi).call(this,t)),$(E.target).off("touchend",t=>f(this,Yi).call(this,t)),f(this,ri).call(this,E)});Y(this,ri,E=>{if(!f(this,Er).is(":visible"))return;var t;f(this,Is)?t=f(this,Ar).offset().left-f(this,Er).offset().left+f(this,Ar).width():t=f(this,Er).offset().left-f(this,Hr).offset().left+1,t<=1&&(t=0);const l=f(this,Is)?f(this,Ar)[0].dataset.col:f(this,Hr)[0].dataset.col;f(this,Ie).columns.width(l,t),$(f(this,Cr)).off("mousemove",f(this,Xi)),$(f(this,Cr)).off("mouseup",f(this,ri)),f(this,Cr).hide()});Y(this,Gi,E=>{!f(this,Is)&&E<f(this,Hr).offset().left&&(E=f(this,Hr).offset().left),f(this,Er).offset({left:E});var t=parseInt(f(this,Er).offset().left),l,c,o;f(this,Is)?(c=f(this,Ar).width()+f(this,Ar).offset().left-f(this,Er).offset().left,o=c<10?10:c-1,l=parseInt(f(this,Ar).width()+f(this,Ar).offset().left-f(this,Er).offset().left)):(c=parseInt(t-f(this,Hr).offset().left),o=c,l=parseInt(t-f(this,Hr).offset().left+1),t=t-o),l<=1&&(l=0),f(this,Rs).offset({left:t}),f(this,Rs).width(o),f(this,Rs).find("span").text(l)});Y(this,rh,E=>{var t=E.target.closest("th,td"),l=f(this,Ie).tableUtils.prev(t),c=f(this,Ie).tableUtils.next(t),o=f(this,Ie).getBand(t.dataset.col)==H.BAND.RIGHT?E.offsetX<=2?$(t):c:E.offsetX<=2?l:$(t);f(this,Ie).setColumnWidthFit(o[0].dataset.col)});tt(this,Ie,E),tt(this,Cr,$('<div class="resizer-col-panel"><div class="grip"></div><div class="tooltip"><div></div><span></span><div></div></div></div>').hide()),$(f(this,Ie).body).append(f(this,Cr)),tt(this,Er,f(this,Cr).find(".grip")),tt(this,Rs,f(this,Cr).find(".tooltip")),this.resetEvent()}}Ie=new WeakMap,Cr=new WeakMap,Er=new WeakMap,Rs=new WeakMap,Ms=new WeakMap,Hr=new WeakMap,Ar=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Ao=new WeakMap,To=new WeakMap,Ro=new WeakMap,lu=new WeakMap,Mo=new WeakMap,eh=new WeakMap,Io=new WeakMap,Wi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,ri=new WeakMap,Gi=new WeakMap,rh=new WeakMap;class ed{constructor(E){Y(this,ce);it(this,"count",()=>f(this,ce).activeTmpl.querySelectorAll("[data-bind]").length);it(this,"info",E=>{const t=l=>{if(!l)return null;const c=f(this,ce).body.querySelectorAll(`thead [data-col="${l.dataset.col}"]`);return{name:l.dataset.bind,type:(l.dataset.type||"string").toLocaleLowerCase(),desc:c.length>0?c[c.length-1].getAttribute("title"):null}};return E?t(f(this,ce).activeTmpl.querySelector(`[data-bind="${E}"]`)):Array.from(f(this,ce).activeTmpl.querySelectorAll("[data-bind]")).filter(l=>l.dataset.bind!=="rowState").map(l=>t(l))});Y(this,si,(E,t)=>{var l=Array.from(E.querySelectorAll("col"));return l[t]});Y(this,Lr,(E,t,l)=>{var c=[];if(!E)return c;for(var o=t;o<=l;o++)c=c.concat(Array.from(E.querySelectorAll(`[data-col="${o}"]:not(.dummy)`)));return c});Y(this,Ki,(E,t,l)=>{const c=(r,n)=>{const s=parseInt(n.dataset.col);return r.closest("thead,tbody,tfoot"),r.querySelector(`[data-col="${s}"]`)},o=(r,n)=>{const s=parseInt(n.dataset.col),e=n.colSpan||1,i=!r.closest("thead,tbody,tfoot");var u=r.querySelectorAll("th:not(.tmp),td:not(.tmp)");for(var a of u)if(parseInt(a.dataset.col)>s+e-1)return a};return parseInt(t.dataset.col)>parseInt(l.dataset.col)?c(E,l):o(E,l)});Y(this,No,E=>{const t={org:{thead:{cells:[]},tfoot:{cells:[]},tbody:{cells:[]},fixed:{cells:[]},cols:[]},thead:{cells:[]},tfoot:{cells:[]},tbody:{cells:[]},fixed:{cells:[]},template:{cells:[]},cols:[]},l=E.colSpan||1,c=E.closest("table"),o=parseInt(E.dataset.col),r=E.closest("tr").sectionRowIndex;$("thead tr",c).each((e,i)=>{if(i.sectionRowIndex<r&&i.sectionRowIndex!=0)return!0;t.thead.cells=t.thead.cells.concat(f(this,Lr).call(this,i,o,o+l-1))}),t.tfoot.cells=f(this,Lr).call(this,c.querySelector("tfoot"),o,o+l-1),t.tbody.cells=f(this,Lr).call(this,c.querySelector("tbody.bindable"),o,o+l-1),t.fixed.cells=f(this,Lr).call(this,c.querySelector("tbody.fixed"),o,o+l-1);const n=f(this,ce).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");t.org.thead.cells=f(this,Lr).call(this,n.currentTable.querySelector("thead"),o,o+l-1),t.org.tfoot.cells=f(this,Lr).call(this,n.currentTable.querySelector("tfoot"),o,o+l-1),t.org.tbody.cells=f(this,Lr).call(this,n.currentTable.querySelector("tbody.bindable"),o,o+l-1),t.org.fixed.cells=f(this,Lr).call(this,n.currentTable.querySelector("tbody.fixed"),o,o+l-1),f(this,ce).template.each((e,i)=>{t.template.cells=t.template.cells.concat(f(this,Lr).call(this,i,o,o+l-1))});for(var s=o;s<=o+l-1;s++)t.cols.push(f(this,si).call(this,f(this,ce).body,s));for(var s=o;s<=o+l-1;s++)t.org.cols.push(f(this,si).call(this,n.currentTable,s));return t});Y(this,sh,(E,t,l,c)=>{if(E.closest("tr").rowIndex!=t.closest("tr").rowIndex)return!1;const o=parseInt(E.dataset.col),r=E.colSpan;parseInt(t.dataset.col),t.colSpan;for(var n of[l.thead.cells,l.tfoot.cells,l.tbody.cells,l.fixed.cells,l.template.cells])for(var s of n){const e=parseInt(s.dataset.col),i=s.colSpan;if(e<o||e+i-1>o+r-1)return!1}return!0});it(this,"moveColumn",(E,t)=>{if(!E||!t)return!1;const l=f(this,ce).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout"),c=f(this,No).call(this,E),o=f(this,No).call(this,t),r=t.closest("table"),n=!!(E.closest(".ng-container-left")||t.closest(".ng-container-left")),s=!!(E.closest(".ng-container-right")||t.closest(".ng-container-right"));if(!f(this,sh).call(this,E,t,c,o))return!1;for(var e of[c.thead.cells,c.tfoot.cells,c.tbody.cells,c.fixed.cells])for(var i of e){H.j.querySelectorAll(i).addClass("tmp");const b=i.closest("tr").rowIndex,g=r.querySelectorAll("tr")[b];var u=f(this,Ki).call(this,g,E,t);u?g.insertBefore(i,u):g.appendChild(i)}for(var e of[c.org.thead.cells,c.org.tfoot.cells,c.org.tbody.cells,c.org.fixed.cells])for(var i of e){H.j.querySelectorAll(i).addClass("tmp");const S=i.closest("table"),C=i.closest("tr").rowIndex,I=S.querySelectorAll("tr")[C];var u=f(this,Ki).call(this,I,E,t);u?I.insertBefore(i,u):I.appendChild(i)}for(var i of c.template.cells){H.j.querySelectorAll(i).addClass("tmp");const g=i.closest("tr");var u=f(this,Ki).call(this,g,E,t);u?g.insertBefore(i,u):g.appendChild(i)}var a;parseInt(E.dataset.col)>parseInt(t.dataset.col)?a=parseInt(t.dataset.col):a=parseInt(t.dataset.col)+(t.colSpan||1)-1+(parseInt(E.dataset.col)>parseInt(t.dataset.col)?0:1);let h=f(this,si).call(this,f(this,ce).body,a);const p=t.closest("table")==h.closest("table");for(var m of c.cols)m&&(p?t.closest("table").querySelector("colgroup").insertBefore(m,h):t.closest("table").querySelector("colgroup").appendChild(m));for(var m of c.org.cols)h=f(this,si).call(this,l.currentTable,a),m&&m.closest("colgroup").insertBefore(m,h);for(var e of[c.thead.cells,c.tfoot.cells,c.tbody.cells,c.fixed.cells])for(var i of e)H.j.querySelectorAll(i).removeClass("tmp");for(var e of[c.org.thead.cells,c.org.tfoot.cells,c.org.tbody.cells,c.org.fixed.cells])for(var i of e)H.j.querySelectorAll(i).removeClass("tmp");for(var i of c.template.cells)H.j.querySelectorAll(i).removeClass("tmp");if(f(this,ce).body.querySelectorAll(".ng-container-left col").forEach(b=>{b.setAttribute("fixed","left")}),f(this,ce).body.querySelectorAll(".ng-container-left .col-indicator").forEach(b=>{b.setAttribute("fixed","left")}),f(this,ce).body.querySelectorAll(".ng-container-right col").forEach(b=>{b.setAttribute("fixed","right")}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{b.setAttribute("fixed","right")}),f(this,ce).body.querySelectorAll(".ng-container-body col").forEach(b=>{b.removeAttribute("fixed")}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{b.removeAttribute("fixed")}),l.currentTable.querySelectorAll("colgroup col").forEach(b=>{b.removeAttribute("fixed")}),$("th,td",f(this,ce).template).each((b,g)=>{g.removeAttribute("fixed")}),$("th,td",l.currentTable).each((b,g)=>{g.removeAttribute("fixed")}),f(this,ce).body.querySelectorAll(".ng-container-left .col-indicator").forEach(b=>{$(`[data-col="${b.dataset.col}"]`,f(this,ce).template).each((g,S)=>{S.setAttribute("fixed","left")}),$(`[data-col="${b.dataset.col}"]`,l.currentTable).each((g,S)=>{S.setAttribute("fixed","left")}),$("colgroup col",l.currentTable).each((g,S)=>{g<=parseInt(b.dataset.col)&&S.setAttribute("fixed","left")})}),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{$(`[data-col="${b.dataset.col}"]`,f(this,ce).template).each((g,S)=>{S.setAttribute("fixed","right")}),$(`[data-col="${b.dataset.col}"]`,l.currentTable).each((g,S)=>{S.setAttribute("fixed","right")})}),f(this,ce).resetTemplate(),f(this,ce).body.querySelectorAll(".ng-container-right .col-indicator").forEach(b=>{$("colgroup col",l.currentTable).each((g,S)=>{g>=parseInt(b.dataset.col)&&S.setAttribute("fixed","right")})}),n){var d=t.closest(".ng-container-body")?-E.offsetWidth:0;$(".ng-container-left .col-indicator",f(this,ce).body).each((b,g)=>{d+=g.offsetWidth}),$(".ng-container-left",f(this,ce).body).css({width:d,"min-width":d})}if(s){var d=t.closest(".ng-container-body")?-E.offsetWidth:0;$(".ng-container-right .col-indicator",f(this,ce).body).each((g,S)=>{d+=S.offsetWidth}),$(".ng-container-right",f(this,ce).body).css({width:d,"min-width":d})}f(this,ce).refreshData()});it(this,"width",(E,t)=>{t=parseFloat(t);const l=f(this,ce).body.querySelector(`colgroup col[data-col="${E}"]`),c=!!l.closest(".ng-container-left"),o=!!l.closest(".ng-container-right"),r=!!l.closest(".ng-container-body"),n=c?"left":o?"right":"body";if(r)if(f(this,ce).getAttribute("auto-fit-col")=="true"){var s=0;$(".ng-container-body .col-indicator",f(this,ce).body).not(`[data-col=${E}]`).each((u,a)=>{s+=a.offsetWidth});const i=$(".ng-container-body",f(this,ce).body).width();$(".ng-container-body col",f(this,ce).body).each((u,a)=>{var h=parseInt(E==a.dataset.col?t:a.getAttribute("width"))*i/s;a.setAttribute("width",h)})}else l.setAttribute("width",t);else{var e=0;$(`.ng-container-${n} .col-indicator`,f(this,ce).body).not(`[data-col=${E}]`).each((i,u)=>{e+=parseInt(u.offsetWidth)}),$(`.ng-container-${n}`,f(this,ce).body).css({width:parseInt(e+t),"min-width":parseInt(e+t)}),l.setAttribute("width",t)}});tt(this,ce,E)}}ce=new WeakMap,si=new WeakMap,Lr=new WeakMap,Ki=new WeakMap,No=new WeakMap,sh=new WeakMap;class rd extends Ve.trace.constructor{constructor(){super(),this.init("nine-grid","green")}}new rd;class sd extends Qs{constructor(){super();Y(this,ih,10);Y(this,Zi);Y(this,De);Y(this,nr);Y(this,Oo);Y(this,Os);Y(this,ii);Y(this,Ji);it(this,"dataRefresh",t=>{f(this,nr)&&(f(this,nh).call(this)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid")),f(this,Zi).innerHTML=this.getDisplayText()||"Select",t||this.reset()});Y(this,nh,()=>{if(H.isNull(this.value))return!0;var t=this.multi?this.value.split(this.multiSeparator):[this.value];for(var l of t){var c=f(this,nr).findIndex(o=>l==o[f(this,Os)]);if(c<0)return!1}return!0});Y(this,oh,()=>{if(this.owner){if(tt(this,De,this.owner.shadowRoot.querySelector("ng-combo-panel")),this.owner.shadowRoot.querySelectorAll("ng-combo-panel").length>1)throw"too many ng-combo-panel";var t=this.getAttribute("data-source");t&&this.owner&&this.owner.exprFunction}});Y(this,ah,t=>{if(console.log(f(this,nr)),!!f(this,nr)){console.log(f(this,nr)),f(this,De).col=this.cell.dataset.col,f(this,De).row=this.cell.closest("tr").sectionRowIndex,f(this,nr).length>f(this,ih)?H.j.querySelectorAll(f(this,De)).addClass("expand"):H.j.querySelectorAll(f(this,De)).removeClass("expand"),this.multi?H.j.querySelectorAll(f(this,De)).addClass("multi"):H.j.querySelectorAll(f(this,De)).removeClass("multi"),f(this,De).refresh(this,f(this,nr),f(this,Os),f(this,Ji));var l=$(".btn1",this.shadowRoot).offset().left-$(this.owner).offset().left;l+$(f(this,De)).width()>$(this.owner).width()&&(l=$(".btn2",this.shadowRoot).offset().left-$(this.owner).offset().left-$(f(this,De)).width()+8),l<0&&(l=0);var c=Math.min(f(this,nr).length,f(this,Oo))*26;this.multi?(H.j.querySelectorAll(f(this,De)).hasClass("expand")&&(c+=12,c+=3,c+=24),c+=2,c+=3,c+=25):(H.j.querySelectorAll(f(this,De)).hasClass("expand")&&(c+=12,c+=3,c+=24),c+=3);var o=$(".btn1",this.shadowRoot).offset().top+$(".btn1",this.shadowRoot).height()-$(this.owner).offset().top+3;o+c>$(this.owner).height()&&(o-=c+$(".btn1",this.shadowRoot).height()+6);var r=this.getAttribute("template");r&&console.error("logic error !!!!"),$(f(this,De)).css({left:l,top:o,height:c,"min-height":c}).show(),H.j.querySelectorAll(f(this,De)).hasClass("expand")&&$("div",f(this,De)).eq(0).find("input").focus().val("")}});Y(this,lh,t=>{t.target.closest("ng-combo-panel")||(f(this,De).row=f(this,De).col=-1,$(f(this,De)).hide())});Y(this,hu,()=>"a")}connectedCallback(){this.multi=this.getAttribute("multi")=="true",this.multiSeparator=this.getAttribute("multi-separator")||",",tt(this,Oo,this.getAttribute("rows")||5),tt(this,Os,this.getAttribute("code")||"code"),tt(this,ii,this.getAttribute("codename")||"codename"),tt(this,Ji,(this.getAttribute("items")||f(this,ii)||"").split(",")),f(this,Ji).unshift("CHK");var t=this.querySelector("datalist");t&&(tt(this,nr,[]),t.querySelectorAll("option").forEach(n=>{const s=n.getAttribute(f(this,Os)),e=n.getAttribute(f(this,ii));s&&e&&f(this,nr).push({[f(this,Os)]:s,[f(this,ii)]:e})})),this.shadowRoot.innerHTML=`
161
161
  <style>
162
162
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngCombo.css";
163
163
  ${H.getCustomPath(this,"ngCombo.css")}
@@ -165,7 +165,7 @@
165
165
 
166
166
  <button class="btn1" type="button" data-bs-toggle="dropdown" aria-expanded="false" tabindex="-1"></button>
167
167
  <button class="btn2" tabindex="-1"></button>
168
- `,super.connectedCallback();const l=this.closest("th,td"),c=this.getAttribute("data-source");c&&this.owner&&this.owner.exprFunction&&(this.owner[c]?tt(this,nr,this.owner[c]):tt(this,nr,this.owner.exprFunction(c).call(this,this.owner.data.get(this.cell.dataset.row),this.cell.dataset.row))),l&&l.dataset&&f(this,nr)&&!l.dataset.expr&&(l.dataset.expr="comboExpr()"),f(this,oh).call(this),f(this,De),tt(this,Zi,this.shadowRoot.querySelector(".btn1"));var o=this.closest("th,td").dataset.col,r=this.closest("tr").sectionRowIndex;$(this.cell).on("keydown",n=>{n.code=="Enter"&&$(f(this,Zi)).trigger("click")}),$("button",this.shadowRoot).on("click",n=>{f(this,De).row==r&&f(this,De).col==o?f(this,lh).call(this,n):f(this,ah).call(this,n)})}get dataSource(){return f(this,nr)}}ih=new WeakMap,Zi=new WeakMap,De=new WeakMap,nr=new WeakMap,Oo=new WeakMap,Os=new WeakMap,ii=new WeakMap,Ji=new WeakMap,nh=new WeakMap,oh=new WeakMap,ah=new WeakMap,lh=new WeakMap,hu=new WeakMap;class nd extends HTMLElement{constructor(){super();Y(this,jo);Y(this,Be);Y(this,js);Y(this,ni);Y(this,Qi);Y(this,hh,()=>{$("input[type=checkbox]",this.shadowRoot).on("change",f(this,ch)),$("input[type=text]",this.shadowRoot).on("input",f(this,uh)),$("button#btnOk",this.shadowRoot).on("click",f(this,Lo))});Y(this,$o,t=>{["TH","TD"].includes(t.target.tagName)&&["Enter"].includes(t.code)&&(f(this,Be).multi?f(this,Lo).call(this,t):f(this,tn).call(this,t))});Y(this,ch,t=>{var l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK");l.data.getValidData().map(o=>{o.v[c]=$(t.target).prop("checked")?"Y":"N"}),l.refreshData()});Y(this,Lo,t=>{var l=this.shadowRoot.querySelector("nine-grid"),c=l.data.getValidData();const o=l.fields.indexOf("CHK"),r=l.fields.indexOf(f(this,js));var n=[];c.forEach(e=>{e.v[o]=="Y"&&n.push(e.v[r])});var s=t.target.closest("th,td");$(s).blur(),f(this,Be).value=n.join(f(this,Be).multiSeparator),$(this).hide(),f(this,Be).getRootNode().host.cell.currentCell=f(this,Be).closest("th,td")});Y(this,tn,t=>{if(t.target.tagName!="NG-CHECKBOX"&&(t.preventDefault(),t.stopPropagation()),!f(this,Be).multi){var l=this.shadowRoot.querySelector("nine-grid"),c=t.target.closest("th,td");$(c).blur(),f(this,Be).value=l.data.get(c.dataset.row)[f(this,js)],this.row=this.col=-1,$(this).hide(),f(this,Be).getRootNode().host.cell.currentCell=f(this,Be).closest("th,td")}});Y(this,cu,t=>{t.preventDefault(),t.stopPropagation(),$(this).hide()});Y(this,uh,t=>{var l=this.shadowRoot.querySelector("nine-grid");H.j.querySelectorAll(l).addClass("loading");var c=l.data.getValidDataNF();c.map(r=>{r.__ng.filtered=!1});var o=$(t.target).val().toLowerCase();c.filter(r=>{for(var n of f(this,Qi)){if(n=="CHK")continue;const s=l.fields.indexOf(n);if((String(r.v[s])||"").toLowerCase().indexOf(o)>=0)return!1}return!0}).map(r=>{r.__ng.filtered=!0}),l.data.resetRecords(),l.data.count()==0&&H.j.querySelectorAll(l).removeClass("loading"),f(this,ni)&&(clearTimeout(f(this,ni)),tt(this,ni,null)),tt(this,ni,setTimeout(()=>{l.dataManager.viewRecords.reset()},200))});it(this,"refresh",(t,l,c,o)=>{var r=this.shadowRoot.querySelector("nine-grid");$(this.shadowRoot).find("input[type=text]").val(""),$("input[type=checkbox]",this).prop("checked",!0),tt(this,Qi,o),$(".ng-table tbody",r.body).off("click","th,td",f(this,tn)),$(".ng-table tbody",r.body).on("click","th,td",f(this,tn)),tt(this,Be,t),tt(this,js,c),$("th,td",r.template).each((i,u)=>{$(u).hide()}),$("thead th",r).each((i,u)=>{$(u).hide()}),o.forEach((i,u)=>{$(`[data-col=${u}]`,r.template).each((a,h)=>{h.dataset.bind=i,$(h).show()}),$(`[data-col=${u}]`,r.body).each((a,h)=>{h.dataset.bind=i,$(h).show()})});const n=["CHK"];if(l.length>0)for(const i in l[0])n.push(i);if(r.fields.add(n),r.data.set(l),f(this,dh).call(this,o),$(".ng-container-left",r.body).css({width:f(this,Be).multi?30:0,"min-width":f(this,Be).multi?30:0}),f(this,Be).multi){var s=f(this,Be).value.split(f(this,Be).multiSeparator);const i=r.fields.indexOf("CHK"),u=r.fields.indexOf(f(this,js));r.data.getValidData().forEach(a=>{a.v[i]=s.includes(a.v[u])?"Y":"N"}),r.row.at=0}else{var e=r.fields.indexOf(f(this,js));r.row.at=r.data.getValidData().findIndex(i=>f(this,Be).value==i.v[e])}setTimeout(()=>{$(`tbody.bindable tr[data-row="${r.row.at}"]`,r.shadowRoot).find("td").eq(0).focus()}),$(".ng-table tbody",r.body).off("keydown","th,td",f(this,$o)),$(".ng-table tbody",r.body).on("keydown","th,td",f(this,$o))});Y(this,dh,()=>{var t=this.shadowRoot.querySelector("nine-grid");$("col",t.body).each((o,r)=>{r.setAttribute("width","0")}),$("th",t.body).each((o,r)=>{$(r).html("")}),f(this,Qi).forEach((o,r)=>{t.setColumnWidthFit(r,30,!1)});var l=f(this,Be).getAttribute("template");l&&console.error("logic error !!!!");var c=16+(H.j.querySelectorAll(this).hasClass("expand"),0)+20;H.j.querySelectorAll(this).hasClass("multi")?$("col",t.body).each((o,r)=>{c+=parseInt(r.getAttribute("width"))}):$(".ng-container-body col",t.body).each((o,r)=>{c+=parseInt(r.getAttribute("width"))}),c<$(f(this,Be)).width()&&(c=$(f(this,Be)).width()-8),c>$(f(this,Be).closest("nine-grid")).width()&&(c=$(f(this,Be).closest("nine-grid")).width()),$(this).css({width:c,"min-width":c}),$(".ng-container-body .ng-table",t.body).css({left:0})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,jo,this.getRootNode().host.closest("nine-grid"));const t=f(this,jo).getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
168
+ `,super.connectedCallback();const l=this.closest("th,td"),c=this.getAttribute("data-source");c&&this.owner&&this.owner.exprFunction&&(this.owner[c]?tt(this,nr,this.owner[c]):tt(this,nr,this.owner.exprFunction(c).call(this,this.owner.data.get(this.cell.dataset.row),this.cell.dataset.row))),l&&l.dataset&&f(this,nr)&&!l.dataset.expr&&(l.dataset.expr="comboExpr()"),f(this,oh).call(this),f(this,De),tt(this,Zi,this.shadowRoot.querySelector(".btn1"));var o=this.closest("th,td").dataset.col,r=this.closest("tr").sectionRowIndex;$(this.cell).on("keydown",n=>{n.code=="Enter"&&$(f(this,Zi)).trigger("click")}),$("button",this.shadowRoot).on("click",n=>{f(this,De).row==r&&f(this,De).col==o?f(this,lh).call(this,n):f(this,ah).call(this,n)})}get dataSource(){return f(this,nr)}}ih=new WeakMap,Zi=new WeakMap,De=new WeakMap,nr=new WeakMap,Oo=new WeakMap,Os=new WeakMap,ii=new WeakMap,Ji=new WeakMap,nh=new WeakMap,oh=new WeakMap,ah=new WeakMap,lh=new WeakMap,hu=new WeakMap;class id extends HTMLElement{constructor(){super();Y(this,jo);Y(this,Be);Y(this,js);Y(this,ni);Y(this,Qi);Y(this,hh,()=>{$("input[type=checkbox]",this.shadowRoot).on("change",f(this,ch)),$("input[type=text]",this.shadowRoot).on("input",f(this,uh)),$("button#btnOk",this.shadowRoot).on("click",f(this,Lo))});Y(this,$o,t=>{["TH","TD"].includes(t.target.tagName)&&["Enter"].includes(t.code)&&(f(this,Be).multi?f(this,Lo).call(this,t):f(this,tn).call(this,t))});Y(this,ch,t=>{var l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK");l.data.getValidData().map(o=>{o.v[c]=$(t.target).prop("checked")?"Y":"N"}),l.refreshData()});Y(this,Lo,t=>{var l=this.shadowRoot.querySelector("nine-grid"),c=l.data.getValidData();const o=l.fields.indexOf("CHK"),r=l.fields.indexOf(f(this,js));var n=[];c.forEach(e=>{e.v[o]=="Y"&&n.push(e.v[r])});var s=t.target.closest("th,td");$(s).blur(),f(this,Be).value=n.join(f(this,Be).multiSeparator),$(this).hide(),f(this,Be).getRootNode().host.cell.currentCell=f(this,Be).closest("th,td")});Y(this,tn,t=>{if(t.target.tagName!="NG-CHECKBOX"&&(t.preventDefault(),t.stopPropagation()),!f(this,Be).multi){var l=this.shadowRoot.querySelector("nine-grid"),c=t.target.closest("th,td");$(c).blur(),f(this,Be).value=l.data.get(c.dataset.row)[f(this,js)],this.row=this.col=-1,$(this).hide(),f(this,Be).getRootNode().host.cell.currentCell=f(this,Be).closest("th,td")}});Y(this,cu,t=>{t.preventDefault(),t.stopPropagation(),$(this).hide()});Y(this,uh,t=>{var l=this.shadowRoot.querySelector("nine-grid");H.j.querySelectorAll(l).addClass("loading");var c=l.data.getValidDataNF();c.map(r=>{r.__ng.filtered=!1});var o=$(t.target).val().toLowerCase();c.filter(r=>{for(var n of f(this,Qi)){if(n=="CHK")continue;const s=l.fields.indexOf(n);if((String(r.v[s])||"").toLowerCase().indexOf(o)>=0)return!1}return!0}).map(r=>{r.__ng.filtered=!0}),l.data.resetRecords(),l.data.count()==0&&H.j.querySelectorAll(l).removeClass("loading"),f(this,ni)&&(clearTimeout(f(this,ni)),tt(this,ni,null)),tt(this,ni,setTimeout(()=>{l.dataManager.viewRecords.reset()},200))});it(this,"refresh",(t,l,c,o)=>{var r=this.shadowRoot.querySelector("nine-grid");$(this.shadowRoot).find("input[type=text]").val(""),$("input[type=checkbox]",this).prop("checked",!0),tt(this,Qi,o),$(".ng-table tbody",r.body).off("click","th,td",f(this,tn)),$(".ng-table tbody",r.body).on("click","th,td",f(this,tn)),tt(this,Be,t),tt(this,js,c),$("th,td",r.template).each((i,u)=>{$(u).hide()}),$("thead th",r).each((i,u)=>{$(u).hide()}),o.forEach((i,u)=>{$(`[data-col=${u}]`,r.template).each((a,h)=>{h.dataset.bind=i,$(h).show()}),$(`[data-col=${u}]`,r.body).each((a,h)=>{h.dataset.bind=i,$(h).show()})});const n=["CHK"];if(l.length>0)for(const i in l[0])n.push(i);if(r.fields.add(n),r.data.set(l),f(this,dh).call(this,o),$(".ng-container-left",r.body).css({width:f(this,Be).multi?30:0,"min-width":f(this,Be).multi?30:0}),f(this,Be).multi){var s=f(this,Be).value.split(f(this,Be).multiSeparator);const i=r.fields.indexOf("CHK"),u=r.fields.indexOf(f(this,js));r.data.getValidData().forEach(a=>{a.v[i]=s.includes(a.v[u])?"Y":"N"}),r.row.at=0}else{var e=r.fields.indexOf(f(this,js));r.row.at=r.data.getValidData().findIndex(i=>f(this,Be).value==i.v[e])}setTimeout(()=>{$(`tbody.bindable tr[data-row="${r.row.at}"]`,r.shadowRoot).find("td").eq(0).focus()}),$(".ng-table tbody",r.body).off("keydown","th,td",f(this,$o)),$(".ng-table tbody",r.body).on("keydown","th,td",f(this,$o))});Y(this,dh,()=>{var t=this.shadowRoot.querySelector("nine-grid");$("col",t.body).each((o,r)=>{r.setAttribute("width","0")}),$("th",t.body).each((o,r)=>{$(r).html("")}),f(this,Qi).forEach((o,r)=>{t.setColumnWidthFit(r,30,!1)});var l=f(this,Be).getAttribute("template");l&&console.error("logic error !!!!");var c=16+(H.j.querySelectorAll(this).hasClass("expand"),0)+20;H.j.querySelectorAll(this).hasClass("multi")?$("col",t.body).each((o,r)=>{c+=parseInt(r.getAttribute("width"))}):$(".ng-container-body col",t.body).each((o,r)=>{c+=parseInt(r.getAttribute("width"))}),c<$(f(this,Be)).width()&&(c=$(f(this,Be)).width()-8),c>$(f(this,Be).closest("nine-grid")).width()&&(c=$(f(this,Be).closest("nine-grid")).width()),$(this).css({width:c,"min-width":c}),$(".ng-container-body .ng-table",t.body).css({left:0})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,jo,this.getRootNode().host.closest("nine-grid"));const t=f(this,jo).getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
169
169
  <style>
170
170
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngComboPanel.css";
171
171
  ${H.getCustomPath(this,"ngComboPanel.css")}
@@ -212,8 +212,8 @@
212
212
  <input id="chkAll" type="checkbox" checked><label for="chkAll">Select All</label>
213
213
  <button id="btnOk">OK</button>
214
214
  </div>
215
- `,f(this,hh).call(this)}}jo=new WeakMap,Be=new WeakMap,js=new WeakMap,ni=new WeakMap,Qi=new WeakMap,hh=new WeakMap,$o=new WeakMap,ch=new WeakMap,Lo=new WeakMap,tn=new WeakMap,cu=new WeakMap,uh=new WeakMap,dh=new WeakMap,customElements.get("ng-combo")||customElements.define("ng-combo",id),customElements.get("ng-combo-panel")||customElements.define("ng-combo-panel",nd);class od{constructor(E){Y(this,en);Y(this,Po);Y(this,rn);Y(this,oi);Y(this,sn);Y(this,Kr);it(this,"openMenu",(E,t)=>{var l=$(f(this,Kr)).css("font"),c=150;for(const o of f(this,rn))c=Math.max(c,H.measureTextSize(o.name,l).width+60);$(f(this,Kr)).css({width:c,top:t,left:E}),f(this,Kr).open(),f(this,oi)&&f(this,oi).show&&f(this,oi).show.call(this,{source:f(this,Po)})});Y(this,fh,E=>{tt(this,rn,f(this,Do).call(this,E.items,0)),tt(this,oi,E.events),tt(this,Kr,$(`<ng-context-menu-panel id="${E.id}"></ng-context-menu-panel>`)[0]),$(f(this,en).shadowRoot).append($(f(this,Kr)).hide()),f(this,Kr).init(f(this,rn)),$("li",f(this,Kr)).on("mousedown",t=>{E.callback&&(t.menuId=t.currentTarget.getAttribute("menu-id"),t.source=f(this,Po),E.callback(t)),$("ng-context-menu-panel",f(this,en).shadowRoot).hide()})});Y(this,Do,(E,t)=>{tt(this,sn,Math.max(t,f(this,sn))+1),E=f(this,ph).call(this,E);for(const l of E)l.level=t,l.hasOwnProperty("items")&&(l.items=f(this,Do).call(this,l.items,t+1));return E});Y(this,ph,E=>{if(Array.isArray(E))return E;var t=[];for(const c in E){var l=E[c];l.menuId=c,t.push(l)}return t});tt(this,sn,0),tt(this,en,E.owner),f(this,fh).call(this,E)}}en=new WeakMap,Po=new WeakMap,rn=new WeakMap,oi=new WeakMap,sn=new WeakMap,Kr=new WeakMap,fh=new WeakMap,Do=new WeakMap,ph=new WeakMap;class ad extends HTMLElement{constructor(){super();it(this,"init",t=>{var l=$("ul",this);$("li",l).remove(),f(this,Bo).call(this,l,t),$("li",this).on("mouseover",f(this,mh)),$("li",this).on("mouseout",c=>{H.j.querySelectorAll(c.currentTarget).removeClass("visible")})});it(this,"open",()=>{$(this).show()});Y(this,Bo,(t,l)=>{for(const n of l){var c=(n.hasOwnProperty("className")?n.className:"")+(n.hasOwnProperty("items")?" submenu":""),o=$(`<li menu-id='${n.menuId}' id="${n.name}" class="${c.trim()}"><span>${n.name}</span></li>`);if(t.append(o),n.hasOwnProperty("items")){var r=$("<ul></ul>");o.append(r),f(this,Bo).call(this,r,n.items)}}});Y(this,mh,t=>{H.j.querySelectorAll(t.currentTarget).addClass("visible");var l=$(this).css("font"),c=150;$("ul > li:visible > span",t.currentTarget).each((o,r)=>{c=Math.max(c,H.measureTextSize($(r).text(),l).width+60)}),$("ul",t.currentTarget).eq(0).css({width:c,top:-9,left:$(t.currentTarget.closest("ul")).width()-8,"z-index":Number($(this).css("z-index"))+1})})}connectedCallback(){this.innerHTML="<ul></ul>"}}Bo=new WeakMap,mh=new WeakMap,customElements.get("ng-context-menu-panel")||customElements.define("ng-context-menu-panel",ad);class ld{constructor(E){Y(this,zr);Y(this,Fo,()=>{$(".ng-table tbody",f(this,zr).shadowRoot).on("click","th,td",f(this,gh)),$(".ng-table thead",f(this,zr).shadowRoot).on("click","th,td",f(this,bh)),$(".ng-table tfoot",f(this,zr).shadowRoot).on("click","th,td",f(this,yh))});Y(this,gh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.CELL_CLICK:H.EVENT.CELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,o.row=l.dataset.row,o.subrow=parseInt(l.dataset.matrixRow)%parseInt(l.dataset.row),o.bind=l.dataset.bind,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});Y(this,bh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.HEADCELL_CLICK:H.EVENT.HEADCELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});Y(this,yh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.FOOTCELL_CLICK:H.EVENT.FOOTCELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});tt(this,zr,E),f(this,Fo).call(this),f(this,zr).addEventListener(H.EVENT.LAYOUT_CHANGED,t=>{f(this,Fo).call(this)})}}zr=new WeakMap,Fo=new WeakMap,gh=new WeakMap,bh=new WeakMap,yh=new WeakMap;class hd{constructor(E){Y(this,Zr);Y(this,qo);Y(this,cs);it(this,"count",()=>f(this,Zr).rawRecords.length);it(this,"has",E=>f(this,Zr).data.filter(E).length>0);it(this,"first",E=>(f(this,Zr).data.first(E).__ng||{rowidx:-1}).rowidx);it(this,"last",E=>(f(this,Zr).data.last(E).__ng||{rowidx:-1}).rowidx);tt(this,Zr,E),tt(this,qo,-1),tt(this,cs,-1)}get at(){return f(this,cs)}set at(E){tt(this,qo,f(this,cs)),tt(this,cs,parseInt(E)),f(this,Zr).owner.body.querySelector(`tbody.bindable tr[data-row="${f(this,cs)}"]`)||setTimeout(()=>{f(this,Zr).owner.scrollTo_V1(f(this,cs))})}}Zr=new WeakMap,qo=new WeakMap,cs=new WeakMap;class cd{constructor(E,t){Y(this,We);Y(this,Ft);Y(this,Pe);Y(this,Tr);Y(this,ai);Y(this,$s);it(this,"initialize",()=>{tt(this,$s,[]),$(f(this,We).template).each((E,t)=>{f(this,$s).push($(t).height())}),(f(this,Ft).rawRecords||[]).forEach(E=>{E.__ng.height=f(this,$s).slice()})});it(this,"set",E=>{this.clear(),this.add(E,!1)});it(this,"assign",E=>{this.source=E;for(var t=0;t<E.length;t++)f(this,Pe)[t].__ng._[H.ROW.ID]=E[t].__ng._[H.ROW.ID],tt(this,ai,Math.max(f(this,ai),E[t].__ng.rowid))});it(this,"getId",E=>E.__ng._[H.ROW.ID]);it(this,"reset",()=>{tt(this,Pe,[]),tt(this,Tr,[])});it(this,"refresh",()=>{f(this,Ft).viewRecords.reset()});it(this,"clearFilter",()=>(f(this,Ft).rawRecords.map(E=>{E.__ng.filtered=!1}),tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng.filtered)),f(this,Pe)));it(this,"refreshFilter",()=>(tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng.filtered)),f(this,on).call(this),f(this,Pe)));it(this,"setFilter",E=>{f(this,We).filtering.on();let t={};if(Array.isArray(E))for(let c in E[0])console.log(`::::::${c}::::::`),t[c]=Array.from(new Set(E.map(o=>o[c])));else t=E;this.clearFilter();for(let c in t){const o=t[c],r=f(this,Ft).owner.fields.indexOf(c);let n=!1;for(let s of this.getValidData())if(s.v[r]!=null){n=typeof s.v[r]=="number";break}if(n)for(var l=0;l<o.length;l++)o[l]=Number(o[l]);this.getValidData().filter(s=>o.nineBinarySearch(s.v[r]||"")<0).map(s=>{s.__ng.filtered=!0})}this.refreshFilter(),f(this,We).shadowRoot.querySelectorAll("ng-filter-button").forEach(c=>{c.filterOptions.forEach(o=>{o.data=[]})}),Object.entries(t).forEach(([c,o])=>{f(this,We).shadowRoot.querySelectorAll("ng-filter-button").forEach(r=>{let n=r.filterOptions;n.forEach(s=>{s.colnm===c&&(s.data=o)}),r.filterOptions=n})}),f(this,Ft).owner.scrollTo_V1(0),f(this,Ft).owner.paging.reset()});it(this,"indexOf",E=>f(this,nn).call(this,this.recordsNF(),E,this.records()));Y(this,nn,(E,t,l)=>{const c=E[t];return l.findIndex(o=>o.__ng._[H.ROW.ID]==c.__ng._[H.ROW.ID])});it(this,"moveRow",(E,t)=>{E!=t&&(H.move(f(this,Ft).rawRecords,this.total.indexOf(E),this.total.indexOf(t)),this.resetRecords(),f(this,Ft).owner.dataManager.viewRecords.reset())});it(this,"filter",E=>f(this,Pe).filter(E));it(this,"max",(E,t)=>{var l=(t?this.filter(t):f(this,Ft).rawRecords).map(c=>c[E]);return l&&l.length>0?l.reduce((c,o)=>c>o?c:o):null});it(this,"min",(E,t)=>{var l=(t?this.filter(t):f(this,Ft).rawRecords).map(c=>c[E]);return l&&l.length>0?l.reduce((c,o)=>c>o?o:c):null});it(this,"first",E=>this.filter(E).first());it(this,"last",E=>this.filter(E).last());it(this,"count",()=>this.getValidData().length);it(this,"countNF",()=>this.getValidDataNF().length);it(this,"onRowStateChanged",()=>{const E=this.getChangedData(),t=$("tbody td[data-bind=rowState]",f(this,Ft).owner.body);if(t.length<=0)return;const l=t.eq(0)[0].dataset.col,c=H.j.querySelectorAll(`thead th[data-col="${l}"]:not(.col-indicator)`,f(this,Ft).owner.body);c.removeClass("deleted").removeClass("added").removeClass("updated"),E.delete.length>0?c.addClass("deleted"):E.insert.length>0?c.addClass("added"):E.update.length>0&&c.addClass("updated"),f(this,Ft).owner.paging.refreshTotal()});Y(this,Ho,E=>(Array.isArray(E)||(E=[E]),E.forEach((t,l)=>{t.__ng=this.default,t.__ng.rowid=this.nextId,t.__ng.rowState=H.ROW_STATE.INSERT,t.__ng._[H.ROW.ID]=t.__ng.rowid}),this.onRowStateChanged(),E));it(this,"sort",E=>{f(this,Ft).rawRecords.sort(E),f(this,Tr).sort(E),f(this,Pe).sort(E),f(this,on).call(this),f(this,Ft).owner.refresh()});Y(this,on,()=>{f(this,Ft).rawRecords.forEach((t,l)=>{t.__ng._[H.ROW.INDEX]=l}),f(this,Ft).rawRecords.filter(t=>!t.__ng.deleted&&!t.__ng.filtered&&t.__ng.visible).forEach((t,l)=>{t.__ng._[H.ROW.ORDER]=l+1});const E=f(this,Ft).rawRecords.filter(t=>!t.__ng.deleted&&t.__ng._[H.ROW.PIN]);E.forEach((t,l)=>{t.__ng._[H.ROW.VISIBLE_ROW]=(E.length-l)*-1}),f(this,Pe).forEach((t,l)=>{t.__ng._[H.ROW.VISIBLE_ROW]=l});//!m.__ng.deleted && !m.__ng.pin && !m.__ng._[ninegrid.ROW.PIN] && !m.__ng.filtered && m.__ng.visible && m.__ng.paging;
216
- });it(this,"resetIndex",()=>{f(this,Ft).rawRecords.forEach((E,t)=>{E.__ng.ii=t,E.__ng.rowidx=t,E.__ng.rowidx1=t}),this.getValidData().forEach((E,t)=>{E.__ng.i=t,E.__ng.rowidx=t}),f(this,on).call(this)});it(this,"resetRecords",()=>{tt(this,Tr,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted)),tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng._[H.ROW.PIN]&&!E.__ng._[H.ROW.COLLAPSE]&&!E.__ng.filtered&&E.__ng.visible&&E.__ng.paging)),this.resetIndex()});Y(this,zo,E=>{Array.isArray(E)||(E=[E]);var t=[];return E.forEach(l=>{var c={v:[]};for(const o of f(this,We).fields.get())c.v.push(H.nvl(l[o],""));t.push(c)}),t});it(this,"exprFunction",E=>{let t="...args",l="let [data, currow] = args; currow = Number(currow); return "+E+";";return new Function(t,l)});it(this,"__ng",E=>{var t=this.getValidData();if(t.length==0)return null;try{return t[E].__ng}catch(l){console.error(l,t,E)}});it(this,"getValidData",()=>(f(this,Pe).length==0&&tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng._[H.ROW.PIN]&&!E.__ng._[H.ROW.COLLAPSE]&&E.__ng._[H.ROW.VISIBLE]&&!E.__ng.filtered&&E.__ng.visible&&E.__ng.paging)),f(this,Pe)));it(this,"getValidDataNF",()=>(f(this,Tr).length==0&&tt(this,Tr,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted)),f(this,Tr)));it(this,"conv",E=>{if(H.isNull(E))return E;if(Array.isArray(E)){var t=[];for(const r of E){for(var l={},c=0;c<f(this,We).fields.get().length;c++){const n=f(this,We).fields.get()[c];l[n]=r.v[c]}l.__ng=r.__ng,t.push(l)}return t}else{for(var o=E,l={},c=0;c<f(this,We).fields.get().length;c++){const s=f(this,We).fields.get()[c];l[s]=o.v[c]}return l.__ng=o.__ng,l}});it(this,"conv2",E=>{if(H.isNull(E))return E;if(Array.isArray(E)){var t=[];for(const r of E){for(var l={},c=0;c<f(this,We).fields.get().length;c++){const n=f(this,We).fields.get()[c];l[n]=r.v[c]}l.__ng=r.__ng,t.push(l)}return t}else{for(var o=E,l={},c=0;c<f(this,We).fields.get().length;c++){const s=f(this,We).fields.get()[c];l[s]=o.v[c]}return l.__ng=o.__ng,l}});it(this,"changeRowState",(E,t,l)=>{const c=o=>{[H.ROW_STATE.EMPTY,H.ROW_STATE.NORMAL].includes(E)&&(o.__ng.o={}),o.__ng.rowState=E};E||(E=H.ROW_STATE.EMPTY),!t&&!l&&(t=0,l=this.count()-1),t||(t=0),l||(l=t),l>=this.count()&&(l=this.count()-1),f(this,Pe).forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),f(this,Tr).forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),this.getValidDataNF().forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),this.onRowStateChanged(),f(this,Ft).viewRecords.reset()});it(this,"getCheckedData",E=>this.get().filter(t=>t.__ng.c[E]==!0));it(this,"search",(E,t)=>this.get().filter(l=>l[E]==t));Y(this,Uo,(E,t,l,c)=>{if(l==c)return;const o=new CustomEvent(H.EVENT.DATA_CHANGED,{bubbles:!0,detail:{}});o.row=E,o.bind=t,o.oldvalue=l,o.value=c,o.data=this.get(E),f(this,Ft).owner.dispatchEvent(o)});it(this,"add",(E,t)=>{E==null&&(E={}),t==null&&(t=!0);const l=f(this,zo).call(this,E);f(this,Ft).rawRecords=f(this,Ft).rawRecords.concat(f(this,Ho).call(this,l));const c=f(this,Ft).rawRecords.map(r=>r.__ng._[H.ROW.ORIGIN_ORDER]);if(c.length>0){const r=c.reduce(function(n,s){return n>s?n:s});f(this,Ft).rawRecords.forEach((n,s)=>{n.__ng._[H.ROW.ORIGIN_ORDER]<0&&(n.__ng._[H.ROW.ORIGIN_ORDER]=r+1+s)})}this.resetRecords();const o=this.count()-1;return t||this.changeRowState(H.ROW_STATE.EMPTY,o-l.length+1,o),f(this,Ft).viewRecords.reset(),o});it(this,"insert",(E,t,l)=>{E==null&&(E={}),t==null&&(t=0),l==null&&(l=!0);var c=f(this,zo).call(this,E);const o=f(this,Ft).rawRecords[t].__ng._[H.ROW.ORIGIN_ORDER];return f(this,Ft).rawRecords.filter(r=>r.__ng._[H.ROW.ORIGIN_ORDER]>=o).forEach(r=>{r.__ng._[H.ROW.ORIGIN_ORDER]+=c.length}),c=f(this,Ho).call(this,c),c.forEach((r,n)=>{r.__ng._[H.ROW.ORIGIN_ORDER]=o+n}),f(this,Ft).rawRecords.splice(t,0,...c),this.resetRecords(),l||this.changeRowState(H.ROW_STATE.EMPTY,t,t+c.length-1),f(this,Ft).viewRecords.reset(),t});Y(this,vh,E=>{var t=!1;E.sort((l,c)=>c-l).forEach(l=>{f(this,Pe)[l].__ng.rowState==H.ROW_STATE.INSERT?H.removeIf(f(this,Ft).rawRecords,c=>c.__ng.rowid==f(this,Pe)[l].__ng.rowid):(f(this,Ft).rawRecords.filter(c=>c.__ng.rowid==f(this,Pe)[l].__ng.rowid).map(c=>{c.__ng.deleted=!0,c.__ng.rowState=H.ROW_STATE.DELETE}),t=!0)}),t&&this.onRowStateChanged(),tt(this,Pe,f(this,Ft).rawRecords.filter(l=>!l.__ng.deleted&&!l.__ng.filtered)),tt(this,Tr,f(this,Ft).rawRecords.filter(l=>!l.__ng.deleted)),this.getValidDataNF().forEach((l,c)=>{l.__ng.rowidx=c}),this.getValidData().forEach((l,c)=>{l.__ng.rowidx=c}),f(this,Ft).viewRecords.reset()});it(this,"delete",E=>{var t=[];if(Array.isArray(E))t=E;else if(typeof E>"u"){if(f(this,Ft).owner.row.at<0)throw`invalid ${f(this,Ft).owner.row.at}`;t=[f(this,Ft).owner.row.at]}else if(typeof E=="number"||typeof E=="string")t=[E];else if(typeof E=="object"){const l=f(this,Pe).findIndex(c=>c.__ng._[H.ROW.ID]==E.__ng._[H.ROW.ID]);if(l<0)throw new Error(`${E.__ng._[H.ROW.ID]} not found.`);t=[l]}else throw`invalid ${E}`;f(this,vh).call(this,t)});it(this,"deleteFromId",E=>{var t=this.records();const l=t.findIndex(c=>c.__ng._[H.ROW.ID]==E);if(l<0)throw new Error(`${E} not found.`);this.delete(l)});Y(this,Vo,(E,t,l)=>{if(typeof l>"u")l=E.findIndex(e=>e.__ng._[H.ROW.ID]==t.__ng._[H.ROW.ID]);else if(typeof l=="number"||typeof l=="string")l=parseInt(l);else throw`invalid ${l}`;var c=E[l],o=!1;for(const e in t)if(!["__ng","rowState"].includes(e)){var r=f(this,We).fields.indexOf(e);if(!(r<0)){var n=c.v[r],s=t[e];c.v[r]=s,n!=s&&(c.__ng.rowState=H.ROW_STATE.UPDATE,o=!0,f(this,Uo).call(this,l,e,n,s))}}o&&this.onRowStateChanged(),f(this,Ft).owner.refreshData()});it(this,"update",(E,t)=>{f(this,Vo).call(this,f(this,Pe),E,t)});it(this,"setValue",(E,t,l,c)=>{f(this,Wo).call(this,E,t,l,c,!1)});it(this,"setValueNF",(E,t,l,c)=>{f(this,Wo).call(this,E,t,l,c,!0)});Y(this,Wo,(E,t,l,c,o)=>{E=parseInt(E),c==null&&(c=!0);const r=f(this,We).fields.indexOf(t);if(!(r<0)){var n=o?this.getValidDataNF()[E]:this.getValidData()[E],s=n.v[r];n.v[r]!=l&&n.__ng.rowState!=H.ROW_STATE.INSERT&&(n.__ng.o.hasOwnProperty(t)||(n.__ng.o[t]=s),c&&(n.__ng.rowState=H.ROW_STATE.UPDATE,this.onRowStateChanged())),n.v[r]=l,f(this,Ft).owner.refreshData(E),f(this,Uo).call(this,E,t,s,l)}});it(this,"setRecord",(E,t,l,c)=>{f(this,an).call(this,this.getValidData(),E,t,l,c,!1)});it(this,"setRecordNF",(E,t,l,c)=>{f(this,an).call(this,this.getValidDataNF(),E,t,l,c,!0)});Y(this,an,(E,t,l,c,o)=>{t=parseInt(t),l=parseInt(l),o==null&&(o=!0);var r=E[t];r.v[l],r.v[l]!=c&&r.__ng.rowState!=H.ROW_STATE.INSERT&&o&&(r.__ng.rowState=H.ROW_STATE.UPDATE),r.v[l]=c});it(this,"getChangedData",E=>E?this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==E)):{insert:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.INSERT)),update:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.UPDATE)),delete:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.DELETE))});it(this,"isChanged",()=>f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.INSERT||t.__ng.rowState==H.ROW_STATE.UPDATE||t.__ng.rowState==H.ROW_STATE.DELETE).length>0);Y(this,ln,(E,t,l)=>{if(!(!E||E.length<=0)){if(H.isNull(t))return this.conv2(E);if(t<0||t>=E.length)throw`invalid row : ${t}`;if(l!=null){var c=f(this,We).fields.indexOf(l);return c>=0?E[t].v[c]:null}var o=t==null?E:E[t];return this.conv(o)}});it(this,"get",(E,t)=>f(this,ln).call(this,this.getValidData(),E,t));it(this,"getNF",(E,t)=>f(this,ln).call(this,this.getValidDataNF(),E,t));it(this,"records",E=>H.isNull(E)?this.getValidData():this.getValidData(E));it(this,"recordsNF",E=>H.isNull(E)?this.getValidDataNF():this.getValidDataNF(E));it(this,"getRow",E=>this.getValidData()[E]);it(this,"getRowNF",E=>this.getValidDataNF()[E]);Y(this,Xo,(E,t)=>{var l=f(this,We).fields.indexOf(t);return l<0?[]:E.map(c=>c.v[l])});it(this,"getMap",E=>f(this,Xo).call(this,this.getValidData(),E));it(this,"getMapNF",E=>f(this,Xo).call(this,this.getValidDataNF(),E));it(this,"findIndex",E=>f(this,Yo).call(this,this.getValidData(),E));it(this,"findIndexNF",E=>f(this,Yo).call(this,this.getValidDataNF(),E));Y(this,Yo,function(E,t){return this.conv2(E).findIndex(t)});it(this,"findIndex_1",E=>f(this,Go).call(this,this.getValidData(),E));it(this,"findIndexNF_1",E=>f(this,Go).call(this,this.getValidDataNF(),E));Y(this,Go,function(E,t){let l=0,c=E.length-1,o;for(;l<=c;){if(o=parseInt((l+c)/2),t===E[o].__ng._[H.ROW.INDEX])return o;t<E[o].__ng._[H.ROW.INDEX]?c=o-1:l=o+1}return-1});tt(this,We,E),tt(this,Ft,t),tt(this,Pe,[]),tt(this,Tr,[]),tt(this,ai,0),this.all={get:(l,c)=>f(this,ln).call(this,this.recordsNF(),l,c),records:l=>this.recordsNF(l),count:()=>this.recordsNF().length,setRecord:(l,c,o,r)=>f(this,an).call(this,this.all.records(),l,c,o,r),indexOf:l=>f(this,nn).call(this,this.records(),l,this.recordsNF()),update:(l,c)=>f(this,Vo).call(this,this.records(),l,c)},this.total={indexOf:l=>f(this,nn).call(this,this.records(),l,f(this,Ft).rawRecords)},this.initialize()}get source(){return this.conv2(f(this,Ft).rawRecords)}set source(E){this.clear(),this.add(E,!1)}get nextId(){return++Mu(this,ai)._}get default(){return{rowState:H.ROW_STATE.EMPTY,deleted:!1,filtered:!1,pin:!1,expand:!0,visible:!0,paging:!0,height:f(this,$s).slice(),o:{},c:{},_:[0,0,0,0,H.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,f(this,$s).slice(),-1,{},{}]}}clear(){delete f(this,Ft).rawRecords,tt(this,Pe,[]),tt(this,Tr,[]),f(this,Ft).rawRecords=[],f(this,Ft).viewRecords.reset()}}We=new WeakMap,Ft=new WeakMap,Pe=new WeakMap,Tr=new WeakMap,ai=new WeakMap,$s=new WeakMap,nn=new WeakMap,Ho=new WeakMap,on=new WeakMap,zo=new WeakMap,Uo=new WeakMap,vh=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,an=new WeakMap,ln=new WeakMap,Xo=new WeakMap,Yo=new WeakMap,Go=new WeakMap;class ud{constructor(E){this.owner=E,this.row=new hd(this),this.data=new cd(E,this),this.setDataSource=l=>{this.data&&this.data.reset(),this.pageCnt=25,this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.viewRecords.touch=()=>{this.viewRecords.updateCnt=(this.viewRecords.updateCnt||0)+1},this.viewRecords.rawIndex=0,this.viewRecords.setPageCnt=c=>{this.pageCnt=c},this.viewRecords.reset=()=>{this.owner.view&&this.owner.view.redraw()},this.viewRecords.resetV2=()=>{this.owner.view.redrawV2()},this.data.set(l)},this.getRowState=c=>{var c=parseInt(c);if(!(c>=this.data.count()))return this.data.__ng(c).rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=l=>{this.row.at=l},this.pageUp=()=>{if(!this.owner.isFirstPage){var l=$(".ng-container-body",this.owner.body).height()-($(".ng-container-body thead",this.owner.body).height()||0)-($(".ng-container-body tfoot",this.owner.body).height()||0);l-=$(".ng-container-body tbody.fixed",this.owner.body).height();for(var c=0,o=this.viewRecords.rawIndex;c<l;){o--;for(var r=0;r<this.owner.template.length;r++){var n=parseInt(o*this.owner.template.length+r);c+=this.owner.matrix.getHeight(n)}}return this.scrollTo_V1(o+1)}},this.pageDown=()=>{if(this.owner.isLastPage||!$("ng-vscrollbar",this.owner.body).is(":visible"))return;const l=parseInt(Array.from(this.owner.body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)")).pop().dataset.row);return this.scrollTo_V1(l)},this.scrollTo_V1=l=>(l<0&&(l=0),l>=this.rawRecords.length&&(l=this.rawRecords.length-1),this.viewRecords.rawIndex=l,this.viewRecords.reset(),!(l<=0||l>=this.rawRecords.length-1)),this.scrollToV2=l=>(l<0&&(l=0),l>=this.rawRecords.length&&(l=this.rawRecords.length-1),this.viewRecords.rawIndex=l,this.viewRecords.resetV2(),!(l<=0||l>=this.rawRecords.length-1)),this.exprFunction=l=>{l=l.replaceAll("ninegrid.ROW.ORDER",H.ROW.ORDER);let c="...args",o="let [data, currow, all] = args; currow = Number(currow); return "+l+";";return new Function(c,o)},this.exprFunction2=l=>{this.owner.fields.get().forEach(r=>{const n=this.owner.fields.indexOf(r);l=l.replaceAll(`data.${r}`,`data.v[${n}]`)});let c="...args",o="let [data, currow, all] = args; currow = Number(currow); return "+l+";";return new Function(c,o)},this.getColumn=(l,c)=>this.data.get(l,c),this.setColumn=(l,c,o)=>{l=parseInt(l),this.data.get(l)[c]!=o&&this.data.get(l).__ng.rowState!=H.ROW_STATE.INSERT&&(this.data.get(l).__ng.rowState=H.ROW_STATE.UPDATE,this.data.onRowStateChanged()),this.setColumnSilent(l,c,o)},this.setColumnSilent=(l,c,o)=>{this.data.set(l,c,o)},this.setDataSource([]);for(var t in this.row)["first","last","count","add","insert","move","delete"].includes(t)||(this.data[t]=this.row[t])}}class dd extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const E=this.getAttribute("type")||"sphere",t=this.getAttribute("size")||this.getAttribute("width")||this.getAttribute("height")||"8",l=this.getAttribute("width")||this.getAttribute("size")||"8",c=this.getAttribute("height")||this.getAttribute("size")||"8",o=this.getAttribute("color")||"gray";var r="";switch(E){case"sphere":r=`<div class="ng-expand-icon-sphere" style="width: ${t}px; height: ${t}px; background: radial-gradient(circle farthest-corner at 33% 33%, white 0%, ${o} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%);" />`;break;case"circle":var n=Number(t)/2,s=this.getAttribute("stroke")||"#666",e=Number(this.getAttribute("stroke-width")||0),i=n+e,u=n+e;r=`
215
+ `,f(this,hh).call(this)}}jo=new WeakMap,Be=new WeakMap,js=new WeakMap,ni=new WeakMap,Qi=new WeakMap,hh=new WeakMap,$o=new WeakMap,ch=new WeakMap,Lo=new WeakMap,tn=new WeakMap,cu=new WeakMap,uh=new WeakMap,dh=new WeakMap,customElements.get("ng-combo")||customElements.define("ng-combo",sd),customElements.get("ng-combo-panel")||customElements.define("ng-combo-panel",id);class nd{constructor(E){Y(this,en);Y(this,Po);Y(this,rn);Y(this,oi);Y(this,sn);Y(this,Kr);it(this,"openMenu",(E,t)=>{var l=$(f(this,Kr)).css("font"),c=150;for(const o of f(this,rn))c=Math.max(c,H.measureTextSize(o.name,l).width+60);$(f(this,Kr)).css({width:c,top:t,left:E}),f(this,Kr).open(),f(this,oi)&&f(this,oi).show&&f(this,oi).show.call(this,{source:f(this,Po)})});Y(this,fh,E=>{tt(this,rn,f(this,Do).call(this,E.items,0)),tt(this,oi,E.events),tt(this,Kr,$(`<ng-context-menu-panel id="${E.id}"></ng-context-menu-panel>`)[0]),$(f(this,en).shadowRoot).append($(f(this,Kr)).hide()),f(this,Kr).init(f(this,rn)),$("li",f(this,Kr)).on("mousedown",t=>{E.callback&&(t.menuId=t.currentTarget.getAttribute("menu-id"),t.source=f(this,Po),E.callback(t)),$("ng-context-menu-panel",f(this,en).shadowRoot).hide()})});Y(this,Do,(E,t)=>{tt(this,sn,Math.max(t,f(this,sn))+1),E=f(this,ph).call(this,E);for(const l of E)l.level=t,l.hasOwnProperty("items")&&(l.items=f(this,Do).call(this,l.items,t+1));return E});Y(this,ph,E=>{if(Array.isArray(E))return E;var t=[];for(const c in E){var l=E[c];l.menuId=c,t.push(l)}return t});tt(this,sn,0),tt(this,en,E.owner),f(this,fh).call(this,E)}}en=new WeakMap,Po=new WeakMap,rn=new WeakMap,oi=new WeakMap,sn=new WeakMap,Kr=new WeakMap,fh=new WeakMap,Do=new WeakMap,ph=new WeakMap;class od extends HTMLElement{constructor(){super();it(this,"init",t=>{var l=$("ul",this);$("li",l).remove(),f(this,Bo).call(this,l,t),$("li",this).on("mouseover",f(this,mh)),$("li",this).on("mouseout",c=>{H.j.querySelectorAll(c.currentTarget).removeClass("visible")})});it(this,"open",()=>{$(this).show()});Y(this,Bo,(t,l)=>{for(const n of l){var c=(n.hasOwnProperty("className")?n.className:"")+(n.hasOwnProperty("items")?" submenu":""),o=$(`<li menu-id='${n.menuId}' id="${n.name}" class="${c.trim()}"><span>${n.name}</span></li>`);if(t.append(o),n.hasOwnProperty("items")){var r=$("<ul></ul>");o.append(r),f(this,Bo).call(this,r,n.items)}}});Y(this,mh,t=>{H.j.querySelectorAll(t.currentTarget).addClass("visible");var l=$(this).css("font"),c=150;$("ul > li:visible > span",t.currentTarget).each((o,r)=>{c=Math.max(c,H.measureTextSize($(r).text(),l).width+60)}),$("ul",t.currentTarget).eq(0).css({width:c,top:-9,left:$(t.currentTarget.closest("ul")).width()-8,"z-index":Number($(this).css("z-index"))+1})})}connectedCallback(){this.innerHTML="<ul></ul>"}}Bo=new WeakMap,mh=new WeakMap,customElements.get("ng-context-menu-panel")||customElements.define("ng-context-menu-panel",od);class ad{constructor(E){Y(this,zr);Y(this,Fo,()=>{$(".ng-table tbody",f(this,zr).shadowRoot).on("click","th,td",f(this,gh)),$(".ng-table thead",f(this,zr).shadowRoot).on("click","th,td",f(this,bh)),$(".ng-table tfoot",f(this,zr).shadowRoot).on("click","th,td",f(this,yh))});Y(this,gh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.CELL_CLICK:H.EVENT.CELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,o.row=l.dataset.row,o.subrow=parseInt(l.dataset.matrixRow)%parseInt(l.dataset.row),o.bind=l.dataset.bind,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});Y(this,bh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.HEADCELL_CLICK:H.EVENT.HEADCELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});Y(this,yh,E=>{if(![1,2].includes(E.detail))return;const t=["altKey","ctrlKey","shiftKey","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","button","buttons","whitch"],l=E.target.closest("th,td"),c=E.detail==1?H.EVENT.FOOTCELL_CLICK:H.EVENT.FOOTCELL_DBL_CLICK,o=new CustomEvent(c,{bubbles:!0,composed:!0,detail:{target:l}});o.col=l.dataset.col,H.copyProperty(o,E,t),f(this,zr).dispatchEvent(o)});tt(this,zr,E),f(this,Fo).call(this),f(this,zr).addEventListener(H.EVENT.LAYOUT_CHANGED,t=>{f(this,Fo).call(this)})}}zr=new WeakMap,Fo=new WeakMap,gh=new WeakMap,bh=new WeakMap,yh=new WeakMap;class ld{constructor(E){Y(this,Zr);Y(this,qo);Y(this,cs);it(this,"count",()=>f(this,Zr).rawRecords.length);it(this,"has",E=>f(this,Zr).data.filter(E).length>0);it(this,"first",E=>(f(this,Zr).data.first(E).__ng||{rowidx:-1}).rowidx);it(this,"last",E=>(f(this,Zr).data.last(E).__ng||{rowidx:-1}).rowidx);tt(this,Zr,E),tt(this,qo,-1),tt(this,cs,-1)}get at(){return f(this,cs)}set at(E){tt(this,qo,f(this,cs)),tt(this,cs,parseInt(E)),f(this,Zr).owner.body.querySelector(`tbody.bindable tr[data-row="${f(this,cs)}"]`)||setTimeout(()=>{f(this,Zr).owner.scrollTo_V1(f(this,cs))})}}Zr=new WeakMap,qo=new WeakMap,cs=new WeakMap;class hd{constructor(E,t){Y(this,We);Y(this,Ft);Y(this,Pe);Y(this,Tr);Y(this,ai);Y(this,$s);it(this,"initialize",()=>{tt(this,$s,[]),$(f(this,We).template).each((E,t)=>{f(this,$s).push($(t).height())}),(f(this,Ft).rawRecords||[]).forEach(E=>{E.__ng.height=f(this,$s).slice()})});it(this,"set",E=>{this.clear(),this.add(E,!1)});it(this,"assign",E=>{this.source=E;for(var t=0;t<E.length;t++)f(this,Pe)[t].__ng._[H.ROW.ID]=E[t].__ng._[H.ROW.ID],tt(this,ai,Math.max(f(this,ai),E[t].__ng.rowid))});it(this,"getId",E=>E.__ng._[H.ROW.ID]);it(this,"reset",()=>{tt(this,Pe,[]),tt(this,Tr,[])});it(this,"refresh",()=>{f(this,Ft).viewRecords.reset()});it(this,"clearFilter",()=>(f(this,Ft).rawRecords.map(E=>{E.__ng.filtered=!1}),tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng.filtered)),f(this,Pe)));it(this,"refreshFilter",()=>(tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng.filtered)),f(this,on).call(this),f(this,Pe)));it(this,"setFilter",E=>{f(this,We).filtering.on();let t={};if(Array.isArray(E))for(let c in E[0])console.log(`::::::${c}::::::`),t[c]=Array.from(new Set(E.map(o=>o[c])));else t=E;this.clearFilter();for(let c in t){const o=t[c],r=f(this,Ft).owner.fields.indexOf(c);let n=!1;for(let s of this.getValidData())if(s.v[r]!=null){n=typeof s.v[r]=="number";break}if(n)for(var l=0;l<o.length;l++)o[l]=Number(o[l]);this.getValidData().filter(s=>o.nineBinarySearch(s.v[r]||"")<0).map(s=>{s.__ng.filtered=!0})}this.refreshFilter(),f(this,We).shadowRoot.querySelectorAll("ng-filter-button").forEach(c=>{c.filterOptions.forEach(o=>{o.data=[]})}),Object.entries(t).forEach(([c,o])=>{f(this,We).shadowRoot.querySelectorAll("ng-filter-button").forEach(r=>{let n=r.filterOptions;n.forEach(s=>{s.colnm===c&&(s.data=o)}),r.filterOptions=n})}),f(this,Ft).owner.scrollTo_V1(0),f(this,Ft).owner.paging.reset()});it(this,"indexOf",E=>f(this,nn).call(this,this.recordsNF(),E,this.records()));Y(this,nn,(E,t,l)=>{const c=E[t];return l.findIndex(o=>o.__ng._[H.ROW.ID]==c.__ng._[H.ROW.ID])});it(this,"moveRow",(E,t)=>{E!=t&&(H.move(f(this,Ft).rawRecords,this.total.indexOf(E),this.total.indexOf(t)),this.resetRecords(),f(this,Ft).owner.dataManager.viewRecords.reset())});it(this,"filter",E=>f(this,Pe).filter(E));it(this,"max",(E,t)=>{var l=(t?this.filter(t):f(this,Ft).rawRecords).map(c=>c[E]);return l&&l.length>0?l.reduce((c,o)=>c>o?c:o):null});it(this,"min",(E,t)=>{var l=(t?this.filter(t):f(this,Ft).rawRecords).map(c=>c[E]);return l&&l.length>0?l.reduce((c,o)=>c>o?o:c):null});it(this,"first",E=>this.filter(E).first());it(this,"last",E=>this.filter(E).last());it(this,"count",()=>this.getValidData().length);it(this,"countNF",()=>this.getValidDataNF().length);it(this,"onRowStateChanged",()=>{const E=this.getChangedData(),t=$("tbody td[data-bind=rowState]",f(this,Ft).owner.body);if(t.length<=0)return;const l=t.eq(0)[0].dataset.col,c=H.j.querySelectorAll(`thead th[data-col="${l}"]:not(.col-indicator)`,f(this,Ft).owner.body);c.removeClass("deleted").removeClass("added").removeClass("updated"),E.delete.length>0?c.addClass("deleted"):E.insert.length>0?c.addClass("added"):E.update.length>0&&c.addClass("updated"),f(this,Ft).owner.paging.refreshTotal()});Y(this,Ho,E=>(Array.isArray(E)||(E=[E]),E.forEach((t,l)=>{t.__ng=this.default,t.__ng.rowid=this.nextId,t.__ng.rowState=H.ROW_STATE.INSERT,t.__ng._[H.ROW.ID]=t.__ng.rowid}),this.onRowStateChanged(),E));it(this,"sort",E=>{f(this,Ft).rawRecords.sort(E),f(this,Tr).sort(E),f(this,Pe).sort(E),f(this,on).call(this),f(this,Ft).owner.refresh()});Y(this,on,()=>{f(this,Ft).rawRecords.forEach((t,l)=>{t.__ng._[H.ROW.INDEX]=l}),f(this,Ft).rawRecords.filter(t=>!t.__ng.deleted&&!t.__ng.filtered&&t.__ng.visible).forEach((t,l)=>{t.__ng._[H.ROW.ORDER]=l+1});const E=f(this,Ft).rawRecords.filter(t=>!t.__ng.deleted&&t.__ng._[H.ROW.PIN]);E.forEach((t,l)=>{t.__ng._[H.ROW.VISIBLE_ROW]=(E.length-l)*-1}),f(this,Pe).forEach((t,l)=>{t.__ng._[H.ROW.VISIBLE_ROW]=l});//!m.__ng.deleted && !m.__ng.pin && !m.__ng._[ninegrid.ROW.PIN] && !m.__ng.filtered && m.__ng.visible && m.__ng.paging;
216
+ });it(this,"resetIndex",()=>{f(this,Ft).rawRecords.forEach((E,t)=>{E.__ng.ii=t,E.__ng.rowidx=t,E.__ng.rowidx1=t}),this.getValidData().forEach((E,t)=>{E.__ng.i=t,E.__ng.rowidx=t}),f(this,on).call(this)});it(this,"resetRecords",()=>{tt(this,Tr,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted)),tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng._[H.ROW.PIN]&&!E.__ng._[H.ROW.COLLAPSE]&&!E.__ng.filtered&&E.__ng.visible&&E.__ng.paging)),this.resetIndex()});Y(this,zo,E=>{Array.isArray(E)||(E=[E]);var t=[];return E.forEach(l=>{var c={v:[]};for(const o of f(this,We).fields.get())c.v.push(H.nvl(l[o],""));t.push(c)}),t});it(this,"exprFunction",E=>{let t="...args",l="let [data, currow] = args; currow = Number(currow); return "+E+";";return new Function(t,l)});it(this,"__ng",E=>{var t=this.getValidData();if(t.length==0)return null;try{return t[E].__ng}catch(l){console.error(l,t,E)}});it(this,"getValidData",()=>(f(this,Pe).length==0&&tt(this,Pe,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted&&!E.__ng._[H.ROW.PIN]&&!E.__ng._[H.ROW.COLLAPSE]&&E.__ng._[H.ROW.VISIBLE]&&!E.__ng.filtered&&E.__ng.visible&&E.__ng.paging)),f(this,Pe)));it(this,"getValidDataNF",()=>(f(this,Tr).length==0&&tt(this,Tr,f(this,Ft).rawRecords.filter(E=>!E.__ng.deleted)),f(this,Tr)));it(this,"conv",E=>{if(H.isNull(E))return E;if(Array.isArray(E)){var t=[];for(const r of E){for(var l={},c=0;c<f(this,We).fields.get().length;c++){const n=f(this,We).fields.get()[c];l[n]=r.v[c]}l.__ng=r.__ng,t.push(l)}return t}else{for(var o=E,l={},c=0;c<f(this,We).fields.get().length;c++){const s=f(this,We).fields.get()[c];l[s]=o.v[c]}return l.__ng=o.__ng,l}});it(this,"conv2",E=>{if(H.isNull(E))return E;if(Array.isArray(E)){var t=[];for(const r of E){for(var l={},c=0;c<f(this,We).fields.get().length;c++){const n=f(this,We).fields.get()[c];l[n]=r.v[c]}l.__ng=r.__ng,t.push(l)}return t}else{for(var o=E,l={},c=0;c<f(this,We).fields.get().length;c++){const s=f(this,We).fields.get()[c];l[s]=o.v[c]}return l.__ng=o.__ng,l}});it(this,"changeRowState",(E,t,l)=>{const c=o=>{[H.ROW_STATE.EMPTY,H.ROW_STATE.NORMAL].includes(E)&&(o.__ng.o={}),o.__ng.rowState=E};E||(E=H.ROW_STATE.EMPTY),!t&&!l&&(t=0,l=this.count()-1),t||(t=0),l||(l=t),l>=this.count()&&(l=this.count()-1),f(this,Pe).forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),f(this,Tr).forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),this.getValidDataNF().forEach((o,r)=>{o.__ng.rowidx>=t&&o.__ng.rowidx<=l&&c(o)}),this.onRowStateChanged(),f(this,Ft).viewRecords.reset()});it(this,"getCheckedData",E=>this.get().filter(t=>t.__ng.c[E]==!0));it(this,"search",(E,t)=>this.get().filter(l=>l[E]==t));Y(this,Uo,(E,t,l,c)=>{if(l==c)return;const o=new CustomEvent(H.EVENT.DATA_CHANGED,{bubbles:!0,detail:{}});o.row=E,o.bind=t,o.oldvalue=l,o.value=c,o.data=this.get(E),f(this,Ft).owner.dispatchEvent(o)});it(this,"add",(E,t)=>{E==null&&(E={}),t==null&&(t=!0);const l=f(this,zo).call(this,E);f(this,Ft).rawRecords=f(this,Ft).rawRecords.concat(f(this,Ho).call(this,l));const c=f(this,Ft).rawRecords.map(r=>r.__ng._[H.ROW.ORIGIN_ORDER]);if(c.length>0){const r=c.reduce(function(n,s){return n>s?n:s});f(this,Ft).rawRecords.forEach((n,s)=>{n.__ng._[H.ROW.ORIGIN_ORDER]<0&&(n.__ng._[H.ROW.ORIGIN_ORDER]=r+1+s)})}this.resetRecords();const o=this.count()-1;return t||this.changeRowState(H.ROW_STATE.EMPTY,o-l.length+1,o),f(this,Ft).viewRecords.reset(),o});it(this,"insert",(E,t,l)=>{E==null&&(E={}),t==null&&(t=0),l==null&&(l=!0);var c=f(this,zo).call(this,E);const o=f(this,Ft).rawRecords[t].__ng._[H.ROW.ORIGIN_ORDER];return f(this,Ft).rawRecords.filter(r=>r.__ng._[H.ROW.ORIGIN_ORDER]>=o).forEach(r=>{r.__ng._[H.ROW.ORIGIN_ORDER]+=c.length}),c=f(this,Ho).call(this,c),c.forEach((r,n)=>{r.__ng._[H.ROW.ORIGIN_ORDER]=o+n}),f(this,Ft).rawRecords.splice(t,0,...c),this.resetRecords(),l||this.changeRowState(H.ROW_STATE.EMPTY,t,t+c.length-1),f(this,Ft).viewRecords.reset(),t});Y(this,vh,E=>{var t=!1;E.sort((l,c)=>c-l).forEach(l=>{f(this,Pe)[l].__ng.rowState==H.ROW_STATE.INSERT?H.removeIf(f(this,Ft).rawRecords,c=>c.__ng.rowid==f(this,Pe)[l].__ng.rowid):(f(this,Ft).rawRecords.filter(c=>c.__ng.rowid==f(this,Pe)[l].__ng.rowid).map(c=>{c.__ng.deleted=!0,c.__ng.rowState=H.ROW_STATE.DELETE}),t=!0)}),t&&this.onRowStateChanged(),tt(this,Pe,f(this,Ft).rawRecords.filter(l=>!l.__ng.deleted&&!l.__ng.filtered)),tt(this,Tr,f(this,Ft).rawRecords.filter(l=>!l.__ng.deleted)),this.getValidDataNF().forEach((l,c)=>{l.__ng.rowidx=c}),this.getValidData().forEach((l,c)=>{l.__ng.rowidx=c}),f(this,Ft).viewRecords.reset()});it(this,"delete",E=>{var t=[];if(Array.isArray(E))t=E;else if(typeof E>"u"){if(f(this,Ft).owner.row.at<0)throw`invalid ${f(this,Ft).owner.row.at}`;t=[f(this,Ft).owner.row.at]}else if(typeof E=="number"||typeof E=="string")t=[E];else if(typeof E=="object"){const l=f(this,Pe).findIndex(c=>c.__ng._[H.ROW.ID]==E.__ng._[H.ROW.ID]);if(l<0)throw new Error(`${E.__ng._[H.ROW.ID]} not found.`);t=[l]}else throw`invalid ${E}`;f(this,vh).call(this,t)});it(this,"deleteFromId",E=>{var t=this.records();const l=t.findIndex(c=>c.__ng._[H.ROW.ID]==E);if(l<0)throw new Error(`${E} not found.`);this.delete(l)});Y(this,Vo,(E,t,l)=>{if(typeof l>"u")l=E.findIndex(e=>e.__ng._[H.ROW.ID]==t.__ng._[H.ROW.ID]);else if(typeof l=="number"||typeof l=="string")l=parseInt(l);else throw`invalid ${l}`;var c=E[l],o=!1;for(const e in t)if(!["__ng","rowState"].includes(e)){var r=f(this,We).fields.indexOf(e);if(!(r<0)){var n=c.v[r],s=t[e];c.v[r]=s,n!=s&&(c.__ng.rowState=H.ROW_STATE.UPDATE,o=!0,f(this,Uo).call(this,l,e,n,s))}}o&&this.onRowStateChanged(),f(this,Ft).owner.refreshData()});it(this,"update",(E,t)=>{f(this,Vo).call(this,f(this,Pe),E,t)});it(this,"setValue",(E,t,l,c)=>{f(this,Wo).call(this,E,t,l,c,!1)});it(this,"setValueNF",(E,t,l,c)=>{f(this,Wo).call(this,E,t,l,c,!0)});Y(this,Wo,(E,t,l,c,o)=>{E=parseInt(E),c==null&&(c=!0);const r=f(this,We).fields.indexOf(t);if(!(r<0)){var n=o?this.getValidDataNF()[E]:this.getValidData()[E],s=n.v[r];n.v[r]!=l&&n.__ng.rowState!=H.ROW_STATE.INSERT&&(n.__ng.o.hasOwnProperty(t)||(n.__ng.o[t]=s),c&&(n.__ng.rowState=H.ROW_STATE.UPDATE,this.onRowStateChanged())),n.v[r]=l,f(this,Ft).owner.refreshData(E),f(this,Uo).call(this,E,t,s,l)}});it(this,"setRecord",(E,t,l,c)=>{f(this,an).call(this,this.getValidData(),E,t,l,c,!1)});it(this,"setRecordNF",(E,t,l,c)=>{f(this,an).call(this,this.getValidDataNF(),E,t,l,c,!0)});Y(this,an,(E,t,l,c,o)=>{t=parseInt(t),l=parseInt(l),o==null&&(o=!0);var r=E[t];r.v[l],r.v[l]!=c&&r.__ng.rowState!=H.ROW_STATE.INSERT&&o&&(r.__ng.rowState=H.ROW_STATE.UPDATE),r.v[l]=c});it(this,"getChangedData",E=>E?this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==E)):{insert:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.INSERT)),update:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.UPDATE)),delete:this.conv2(f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.DELETE))});it(this,"isChanged",()=>f(this,Ft).rawRecords.filter(t=>t.__ng.rowState==H.ROW_STATE.INSERT||t.__ng.rowState==H.ROW_STATE.UPDATE||t.__ng.rowState==H.ROW_STATE.DELETE).length>0);Y(this,ln,(E,t,l)=>{if(!(!E||E.length<=0)){if(H.isNull(t))return this.conv2(E);if(t<0||t>=E.length)throw`invalid row : ${t}`;if(l!=null){var c=f(this,We).fields.indexOf(l);return c>=0?E[t].v[c]:null}var o=t==null?E:E[t];return this.conv(o)}});it(this,"get",(E,t)=>f(this,ln).call(this,this.getValidData(),E,t));it(this,"getNF",(E,t)=>f(this,ln).call(this,this.getValidDataNF(),E,t));it(this,"records",E=>H.isNull(E)?this.getValidData():this.getValidData(E));it(this,"recordsNF",E=>H.isNull(E)?this.getValidDataNF():this.getValidDataNF(E));it(this,"getRow",E=>this.getValidData()[E]);it(this,"getRowNF",E=>this.getValidDataNF()[E]);Y(this,Xo,(E,t)=>{var l=f(this,We).fields.indexOf(t);return l<0?[]:E.map(c=>c.v[l])});it(this,"getMap",E=>f(this,Xo).call(this,this.getValidData(),E));it(this,"getMapNF",E=>f(this,Xo).call(this,this.getValidDataNF(),E));it(this,"findIndex",E=>f(this,Yo).call(this,this.getValidData(),E));it(this,"findIndexNF",E=>f(this,Yo).call(this,this.getValidDataNF(),E));Y(this,Yo,function(E,t){return this.conv2(E).findIndex(t)});it(this,"findIndex_1",E=>f(this,Go).call(this,this.getValidData(),E));it(this,"findIndexNF_1",E=>f(this,Go).call(this,this.getValidDataNF(),E));Y(this,Go,function(E,t){let l=0,c=E.length-1,o;for(;l<=c;){if(o=parseInt((l+c)/2),t===E[o].__ng._[H.ROW.INDEX])return o;t<E[o].__ng._[H.ROW.INDEX]?c=o-1:l=o+1}return-1});tt(this,We,E),tt(this,Ft,t),tt(this,Pe,[]),tt(this,Tr,[]),tt(this,ai,0),this.all={get:(l,c)=>f(this,ln).call(this,this.recordsNF(),l,c),records:l=>this.recordsNF(l),count:()=>this.recordsNF().length,setRecord:(l,c,o,r)=>f(this,an).call(this,this.all.records(),l,c,o,r),indexOf:l=>f(this,nn).call(this,this.records(),l,this.recordsNF()),update:(l,c)=>f(this,Vo).call(this,this.records(),l,c)},this.total={indexOf:l=>f(this,nn).call(this,this.records(),l,f(this,Ft).rawRecords)},this.initialize()}get source(){return this.conv2(f(this,Ft).rawRecords)}set source(E){this.clear(),this.add(E,!1)}get nextId(){return++Mu(this,ai)._}get default(){return{rowState:H.ROW_STATE.EMPTY,deleted:!1,filtered:!1,pin:!1,expand:!0,visible:!0,paging:!0,height:f(this,$s).slice(),o:{},c:{},_:[0,0,0,0,H.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,f(this,$s).slice(),-1,{},{}]}}clear(){delete f(this,Ft).rawRecords,tt(this,Pe,[]),tt(this,Tr,[]),f(this,Ft).rawRecords=[],f(this,Ft).viewRecords.reset()}}We=new WeakMap,Ft=new WeakMap,Pe=new WeakMap,Tr=new WeakMap,ai=new WeakMap,$s=new WeakMap,nn=new WeakMap,Ho=new WeakMap,on=new WeakMap,zo=new WeakMap,Uo=new WeakMap,vh=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,an=new WeakMap,ln=new WeakMap,Xo=new WeakMap,Yo=new WeakMap,Go=new WeakMap;class cd{constructor(E){this.owner=E,this.row=new ld(this),this.data=new hd(E,this),this.setDataSource=l=>{this.data&&this.data.reset(),this.pageCnt=25,this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.viewRecords.touch=()=>{this.viewRecords.updateCnt=(this.viewRecords.updateCnt||0)+1},this.viewRecords.rawIndex=0,this.viewRecords.setPageCnt=c=>{this.pageCnt=c},this.viewRecords.reset=()=>{this.owner.view&&this.owner.view.redraw()},this.viewRecords.resetV2=()=>{this.owner.view.redrawV2()},this.data.set(l)},this.getRowState=c=>{var c=parseInt(c);if(!(c>=this.data.count()))return this.data.__ng(c).rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=l=>{this.row.at=l},this.pageUp=()=>{if(!this.owner.isFirstPage){var l=$(".ng-container-body",this.owner.body).height()-($(".ng-container-body thead",this.owner.body).height()||0)-($(".ng-container-body tfoot",this.owner.body).height()||0);l-=$(".ng-container-body tbody.fixed",this.owner.body).height();for(var c=0,o=this.viewRecords.rawIndex;c<l;){o--;for(var r=0;r<this.owner.template.length;r++){var n=parseInt(o*this.owner.template.length+r);c+=this.owner.matrix.getHeight(n)}}return this.scrollTo_V1(o+1)}},this.pageDown=()=>{if(this.owner.isLastPage||!$("ng-vscrollbar",this.owner.body).is(":visible"))return;const l=parseInt(Array.from(this.owner.body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)")).pop().dataset.row);return this.scrollTo_V1(l)},this.scrollTo_V1=l=>(l<0&&(l=0),l>=this.rawRecords.length&&(l=this.rawRecords.length-1),this.viewRecords.rawIndex=l,this.viewRecords.reset(),!(l<=0||l>=this.rawRecords.length-1)),this.scrollToV2=l=>(l<0&&(l=0),l>=this.rawRecords.length&&(l=this.rawRecords.length-1),this.viewRecords.rawIndex=l,this.viewRecords.resetV2(),!(l<=0||l>=this.rawRecords.length-1)),this.exprFunction=l=>{l=l.replaceAll("ninegrid.ROW.ORDER",H.ROW.ORDER);let c="...args",o="let [data, currow, all] = args; currow = Number(currow); return "+l+";";return new Function(c,o)},this.exprFunction2=l=>{this.owner.fields.get().forEach(r=>{const n=this.owner.fields.indexOf(r);l=l.replaceAll(`data.${r}`,`data.v[${n}]`)});let c="...args",o="let [data, currow, all] = args; currow = Number(currow); return "+l+";";return new Function(c,o)},this.getColumn=(l,c)=>this.data.get(l,c),this.setColumn=(l,c,o)=>{l=parseInt(l),this.data.get(l)[c]!=o&&this.data.get(l).__ng.rowState!=H.ROW_STATE.INSERT&&(this.data.get(l).__ng.rowState=H.ROW_STATE.UPDATE,this.data.onRowStateChanged()),this.setColumnSilent(l,c,o)},this.setColumnSilent=(l,c,o)=>{this.data.set(l,c,o)},this.setDataSource([]);for(var t in this.row)["first","last","count","add","insert","move","delete"].includes(t)||(this.data[t]=this.row[t])}}class ud extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const E=this.getAttribute("type")||"sphere",t=this.getAttribute("size")||this.getAttribute("width")||this.getAttribute("height")||"8",l=this.getAttribute("width")||this.getAttribute("size")||"8",c=this.getAttribute("height")||this.getAttribute("size")||"8",o=this.getAttribute("color")||"gray";var r="";switch(E){case"sphere":r=`<div class="ng-expand-icon-sphere" style="width: ${t}px; height: ${t}px; background: radial-gradient(circle farthest-corner at 33% 33%, white 0%, ${o} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%);" />`;break;case"circle":var n=Number(t)/2,s=this.getAttribute("stroke")||"#666",e=Number(this.getAttribute("stroke-width")||0),i=n+e,u=n+e;r=`
217
217
  <svg class="ng-expand-icon-circle" viewBox="0 0 ${t} ${t}" width="${t}" height="${t}" xmlns="http://www.w3.org/2000/svg">
218
218
  <circle fill="${o}" stroke="${s}" stroke-width="${e}" cx="${i}" cy="${u}" r="${n}"/>
219
219
  </svg>
@@ -239,21 +239,21 @@
239
239
  </style>
240
240
 
241
241
  ${r}
242
- `,new MutationObserver((a,h)=>{for(var p of a)if(p.type=="attributes")switch(p.attributeName){case"color":switch(E){case"sphere":$("div",this.shadowRoot).css({background:`radial-gradient(circle farthest-corner at 33% 33%, white 0%, ${this.getAttribute(p.attributeName)} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%)`});break;case"circle":case"rect":case"check":case"svg":H.j.querySelectorAll("circle,rect,svg",this.shadowRoot).attr("fill",this.getAttribute(p.attributeName));break}break;case"src":switch(E){case"svg":this.shadowRoot.querySelector("div").innerHTML=this.getAttribute(p.attributeName);break;case"img":H.j.querySelectorAll("img",this.shadowRoot).attr("src",this.getAttribute(p.attributeName));break}break}}).observe(this,{childList:!1,subtree:!1,attributeOldValue:!0})}}class fd extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
242
+ `,new MutationObserver((a,h)=>{for(var p of a)if(p.type=="attributes")switch(p.attributeName){case"color":switch(E){case"sphere":$("div",this.shadowRoot).css({background:`radial-gradient(circle farthest-corner at 33% 33%, white 0%, ${this.getAttribute(p.attributeName)} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%)`});break;case"circle":case"rect":case"check":case"svg":H.j.querySelectorAll("circle,rect,svg",this.shadowRoot).attr("fill",this.getAttribute(p.attributeName));break}break;case"src":switch(E){case"svg":this.shadowRoot.querySelector("div").innerHTML=this.getAttribute(p.attributeName);break;case"img":H.j.querySelectorAll("img",this.shadowRoot).attr("src",this.getAttribute(p.attributeName));break}break}}).observe(this,{childList:!1,subtree:!1,attributeOldValue:!0})}}class dd extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
243
243
  <style>
244
244
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngExpandCheck.css";
245
245
  ${H.getCustomPath(this,"ngExpandCheck.css")}
246
246
  </style>
247
247
 
248
248
  <input type="checkbox" />
249
- `}}class pd extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
249
+ `}}class fd extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
250
250
  <style>
251
251
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngExpandButton.css";
252
252
  ${H.getCustomPath(this,"ngExpandButton.css")}
253
253
  </style>
254
254
 
255
255
  <button>...</button>
256
- `}}customElements.get("ng-expand-icon")||customElements.define("ng-expand-icon",dd),customElements.get("ng-expand-check")||customElements.define("ng-expand-check",fd),customElements.get("ng-expand-button")||customElements.define("ng-expand-button",pd);var pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function md(vt){return vt&&vt.__esModule&&Object.prototype.hasOwnProperty.call(vt,"default")?vt.default:vt}function Pl(vt){throw new Error('Could not dynamically require "'+vt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iu={exports:{}};/*! ExcelJS 19-10-2023 */var ku;function gd(){return ku||(ku=1,(function(vt,E){(function(t){vt.exports=t()})((function(){return(function t(l,c,o){function r(e,i){if(!c[e]){if(!l[e]){var u=typeof Pl=="function"&&Pl;if(!i&&u)return u(e,!0);if(n)return n(e,!0);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}var h=c[e]={exports:{}};l[e][0].call(h.exports,(function(p){return r(l[e][1][p]||p)}),h,h.exports,t,l,c,o)}return c[e].exports}for(var n=typeof Pl=="function"&&Pl,s=0;s<o.length;s++)r(o[s]);return r})({1:[function(t,l,c){const o=t("fs"),r=t("fast-csv"),n=t("dayjs/plugin/customParseFormat"),s=t("dayjs/plugin/utc"),e=t("dayjs").extend(n).extend(s),i=t("../utils/stream-buf"),{fs:{exists:u}}=t("../utils/utils"),a={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};l.exports=class{constructor(h){this.workbook=h,this.worksheet=null}async readFile(h,p){if(p=p||{},!await u(h))throw new Error("File not found: "+h);const m=o.createReadStream(h),d=await this.read(m,p);return m.close(),d}read(h,p){return p=p||{},new Promise((m,d)=>{const b=this.workbook.addWorksheet(p.sheetName),g=p.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],S=p.map||function(I){if(I==="")return null;const D=Number(I);if(!Number.isNaN(D)&&D!==1/0)return D;const z=g.reduce((B,F)=>{if(B)return B;const W=e(I,F,!0);return W.isValid()?W:null},null);if(z)return new Date(z.valueOf());const P=a[I];return P!==void 0?P:I},C=r.parse(p.parserOptions).on("data",I=>{b.addRow(I.map(S))}).on("end",()=>{C.emit("worksheet",b)});C.on("worksheet",m).on("error",d),h.pipe(C)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(h,p){return new Promise((m,d)=>{p=p||{};const b=this.workbook.getWorksheet(p.sheetName||p.sheetId),g=r.format(p.formatterOptions);h.on("finish",()=>{m()}),g.on("error",d),g.pipe(h);const{dateFormat:S,dateUTC:C}=p,I=p.map||(P=>{if(P){if(P.text||P.hyperlink)return P.hyperlink||P.text||"";if(P.formula||P.result)return P.result||"";if(P instanceof Date)return S?C?e.utc(P).format(S):e(P).format(S):C?e.utc(P).format():e(P).format();if(P.error)return P.error;if(typeof P=="object")return JSON.stringify(P)}return P}),D=p.includeEmptyRows===void 0||p.includeEmptyRows;let z=1;b&&b.eachRow((P,B)=>{if(D)for(;z++<B-1;)g.write([]);const{values:F}=P;F.shift(),g.write(F.map(I)),z=B}),g.end()})}writeFile(h,p){const m={encoding:(p=p||{}).encoding||"utf8"},d=o.createWriteStream(h,m);return this.write(d,p)}async writeBuffer(h){const p=new i;return await this.write(p,h),p.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(s,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=s,e)if(typeof e=="string"){const u=o.decodeAddress(e);this.nativeCol=u.col+i,this.nativeColOff=0,this.nativeRow=u.row+i,this.nativeRowOff=0}else e.nativeCol!==void 0?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):e.col!==void 0?(this.col=e.col+i,this.row=e.row+i):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(s){return s instanceof r||s==null?s:new r(s)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(s){this.nativeCol=Math.floor(s),this.nativeColOff=Math.floor((s-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(s){this.nativeRow=Math.floor(s),this.nativeRowOff=Math.floor((s-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(s){this.nativeCol=s.nativeCol,this.nativeColOff=s.nativeColOff,this.nativeRow=s.nativeRow,this.nativeRowOff=s.nativeRowOff}}l.exports=r},{"../utils/col-cache":19}],3:[function(t,l,c){const o=t("../utils/col-cache"),r=t("../utils/under-dash"),n=t("./enums"),{slideFormula:s}=t("../utils/shared-formula"),e=t("./note");class i{constructor(h,p,m){if(!h||!p)throw new Error("A Cell needs a Row");this._row=h,this._column=p,o.validateAddress(m),this._address=m,this._value=u.create(i.Types.Null,this),this.style=this._mergeStyle(h.style,p.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(h){this.style.numFmt=h}get font(){return this.style.font}set font(h){this.style.font=h}get alignment(){return this.style.alignment}set alignment(h){this.style.alignment=h}get border(){return this.style.border}set border(h){this.style.border=h}get fill(){return this.style.fill}set fill(h){this.style.fill=h}get protection(){return this.style.protection}set protection(h){this.style.protection=h}_mergeStyle(h,p,m){const d=h&&h.numFmt||p&&p.numFmt;d&&(m.numFmt=d);const b=h&&h.font||p&&p.font;b&&(m.font=b);const g=h&&h.alignment||p&&p.alignment;g&&(m.alignment=g);const S=h&&h.border||p&&p.border;S&&(m.border=S);const C=h&&h.fill||p&&p.fill;C&&(m.fill=C);const I=h&&h.protection||p&&p.protection;return I&&(m.protection=I),m}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===i.Types.Merge}merge(h,p){this._value.release(),this._value=u.create(i.Types.Merge,this,h),p||(this.style=h.style)}unmerge(){this.type===i.Types.Merge&&(this._value.release(),this._value=u.create(i.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(h){return this._value.type===i.Types.Merge&&this._value.isMergedTo(h)}get master(){return this.type===i.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===i.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(h){this.type!==i.Types.Merge?(this._value.release(),this._value=u.create(u.getType(h),this,h)):this._value.master.value=h}get note(){return this._comment&&this._comment.note}set note(h){this._comment=new e(h)}get text(){return this._value.toString()}get html(){return r.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(h){this.type===i.Types.String&&(this._value=u.create(i.Types.Hyperlink,this,{text:this._value.value,hyperlink:h}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:h}=this._row;return{sheetName:h.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(h){this.names=[h]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(h){const{definedNames:p}=this.workbook;p.removeAllNames(this.fullAddress),h.forEach(m=>{p.addEx(this.fullAddress,m)})}addName(h){this.workbook.definedNames.addEx(this.fullAddress,h)}removeName(h){this.workbook.definedNames.removeEx(this.fullAddress,h)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(h){this._dataValidations.add(this.address,h)}get model(){const{model:h}=this._value;return h.style=this.style,this._comment&&(h.comment=this._comment.model),h}set model(h){if(this._value.release(),this._value=u.create(h.type,this),this._value.model=h,h.comment)switch(h.comment.type){case"note":this._comment=e.fromModel(h.comment)}h.style?this.style=h.style:this.style={}}}i.Types=n.ValueType;const u={getType:a=>a==null?i.Types.Null:a instanceof String||typeof a=="string"?i.Types.String:typeof a=="number"?i.Types.Number:typeof a=="boolean"?i.Types.Boolean:a instanceof Date?i.Types.Date:a.text&&a.hyperlink?i.Types.Hyperlink:a.formula||a.sharedFormula?i.Types.Formula:a.richText?i.Types.RichText:a.sharedString?i.Types.SharedString:a.error?i.Types.Error:i.Types.JSON,types:[{t:i.Types.Null,f:class{constructor(a){this.model={address:a.address,type:i.Types.Null}}get value(){return null}set value(a){}get type(){return i.Types.Null}get effectiveType(){return i.Types.Null}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return""}release(){}toString(){return""}}},{t:i.Types.Number,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Number,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Number}get effectiveType(){return i.Types.Number}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.String,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.String}get effectiveType(){return i.Types.String}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:i.Types.Date,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Date,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Date}get effectiveType(){return i.Types.Date}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.Hyperlink,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Hyperlink,text:h?h.text:void 0,hyperlink:h?h.hyperlink:void 0},h&&h.tooltip&&(this.model.tooltip=h.tooltip)}get value(){const a={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(a.tooltip=this.model.tooltip),a}set value(a){this.model={text:a.text,hyperlink:a.hyperlink},a.tooltip&&(this.model.tooltip=a.tooltip)}get text(){return this.model.text}set text(a){this.model.text=a}get hyperlink(){return this.model.hyperlink}set hyperlink(a){this.model.hyperlink=a}get type(){return i.Types.Hyperlink}get effectiveType(){return i.Types.Hyperlink}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:i.Types.Formula,f:class{constructor(a,h){this.cell=a,this.model={address:a.address,type:i.Types.Formula,shareType:h?h.shareType:void 0,ref:h?h.ref:void 0,formula:h?h.formula:void 0,sharedFormula:h?h.sharedFormula:void 0,result:h?h.result:void 0}}_copyModel(a){const h={},p=m=>{const d=a[m];d&&(h[m]=d)};return p("formula"),p("result"),p("ref"),p("shareType"),p("sharedFormula"),h}get value(){return this._copyModel(this.model)}set value(a){this.model=this._copyModel(a)}validate(a){switch(u.getType(a)){case i.Types.Null:case i.Types.String:case i.Types.Number:case i.Types.Date:break;case i.Types.Hyperlink:case i.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(a){this.model.formula=a}get formulaType(){return this.model.formula?n.FormulaType.Master:this.model.sharedFormula?n.FormulaType.Shared:n.FormulaType.None}get result(){return this.model.result}set result(a){this.model.result=a}get type(){return i.Types.Formula}get effectiveType(){const a=this.model.result;return a==null?n.ValueType.Null:a instanceof String||typeof a=="string"?n.ValueType.String:typeof a=="number"?n.ValueType.Number:a instanceof Date?n.ValueType.Date:a.text&&a.hyperlink?n.ValueType.Hyperlink:a.formula?n.ValueType.Formula:n.ValueType.Null}get address(){return this.model.address}set address(a){this.model.address=a}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:a}=this.cell,h=a.findCell(this.model.sharedFormula);this._translatedFormula=h&&s(h.formula,h.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:i.Types.Merge,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Merge,master:h?h.address:void 0},this._master=h,h&&h.addMergeRef()}get value(){return this._master.value}set value(a){a instanceof i?(this._master&&this._master.releaseMergeRef(),a.addMergeRef(),this._master=a):this._master.value=a}isMergedTo(a){return a===this._master}get master(){return this._master}get type(){return i.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:i.Types.JSON,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:JSON.stringify(h),rawValue:h}}get value(){return this.model.rawValue}set value(a){this.model.rawValue=a,this.model.value=JSON.stringify(a)}get type(){return i.Types.String}get effectiveType(){return i.Types.String}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:i.Types.SharedString,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.SharedString,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.SharedString}get effectiveType(){return i.Types.SharedString}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.RichText,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}toString(){return this.model.value.richText.map(a=>a.text).join("")}get type(){return i.Types.RichText}get effectiveType(){return i.Types.RichText}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:i.Types.Boolean,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Boolean,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Boolean}get effectiveType(){return i.Types.Boolean}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.Error,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Error,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Error}get effectiveType(){return i.Types.Error}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((a,h)=>(a[h.t]=h.f,a),[]),create(a,h,p){const m=this.types[a];if(!m)throw new Error("Could not create Value of type "+a);return new m(h,p)}};l.exports=i},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(t,l,c){const o=t("../utils/under-dash"),r=t("./enums"),n=t("../utils/col-cache");class s{constructor(i,u,a){this._worksheet=i,this._number=u,a!==!1&&(this.defn=a)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return n.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(i){i?(this.key=i.key,this.width=i.width!==void 0?i.width:9,this.outlineLevel=i.outlineLevel,i.style?this.style=i.style:this.style={},this.header=i.header,this._hidden=!!i.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(i){i!==void 0?(this._header=i,this.headers.forEach((u,a)=>{this._worksheet.getCell(a+1,this.number).value=u})):this._header=void 0}get key(){return this._key}set key(i){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=i,i&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(i){this._hidden=i}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(i){this._outlineLevel=i}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(i){return this.width===i.width&&this.hidden===i.hidden&&this.outlineLevel===i.outlineLevel&&o.isEqual(this.style,i.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const i=this.style;return!i||!(i.font||i.numFmt||i.alignment||i.border||i.fill||i.protection)}get headerCount(){return this.headers.length}eachCell(i,u){const a=this.number;u||(u=i,i=null),this._worksheet.eachRow(i,(h,p)=>{u(h.getCell(a),p)})}get values(){const i=[];return this.eachCell((u,a)=>{u&&u.type!==r.ValueType.Null&&(i[a]=u.value)}),i}set values(i){if(!i)return;const u=this.number;let a=0;i.hasOwnProperty("0")&&(a=1),i.forEach((h,p)=>{this._worksheet.getCell(p+a,u).value=h})}_applyStyle(i,u){return this.style[i]=u,this.eachCell(a=>{a[i]=u}),u}get numFmt(){return this.style.numFmt}set numFmt(i){this._applyStyle("numFmt",i)}get font(){return this.style.font}set font(i){this._applyStyle("font",i)}get alignment(){return this.style.alignment}set alignment(i){this._applyStyle("alignment",i)}get protection(){return this.style.protection}set protection(i){this._applyStyle("protection",i)}get border(){return this.style.border}set border(i){this._applyStyle("border",i)}get fill(){return this.style.fill}set fill(i){this._applyStyle("fill",i)}static toModel(i){const u=[];let a=null;return i&&i.forEach((h,p)=>{h.isDefault?a&&(a=null):a&&h.equivalentTo(a)?a.max=p+1:(a={min:p+1,max:p+1,width:h.width!==void 0?h.width:9,style:h.style,isCustomWidth:h.isCustomWidth,hidden:h.hidden,outlineLevel:h.outlineLevel,collapsed:h.collapsed},u.push(a))}),u.length?u:void 0}static fromModel(i,u){const a=[];let h=1,p=0;for(u=(u=u||[]).sort((function(m,d){return m.min-d.min}));p<u.length;){const m=u[p++];for(;h<m.min;)a.push(new s(i,h++));for(;h<=m.max;)a.push(new s(i,h++,m))}return a.length?a:null}}l.exports=s},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(t,l,c){l.exports=class{constructor(o){this.model=o||{}}add(o,r){return this.model[o]=r}find(o){return this.model[o]}remove(o){this.model[o]=void 0}}},{}],6:[function(t,l,c){const o=t("../utils/under-dash"),r=t("../utils/col-cache"),n=t("../utils/cell-matrix"),s=t("./range"),e=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;l.exports=class{constructor(){this.matrixMap={}}getMatrix(i){return this.matrixMap[i]||(this.matrixMap[i]=new n)}add(i,u){const a=r.decodeEx(i);this.addEx(a,u)}addEx(i,u){const a=this.getMatrix(u);if(i.top)for(let h=i.left;h<=i.right;h++)for(let p=i.top;p<=i.bottom;p++){const m={sheetName:i.sheetName,address:r.n2l(h)+p,row:p,col:h};a.addCellEx(m)}else a.addCellEx(i)}remove(i,u){const a=r.decodeEx(i);this.removeEx(a,u)}removeEx(i,u){this.getMatrix(u).removeCellEx(i)}removeAllNames(i){o.each(this.matrixMap,u=>{u.removeCellEx(i)})}forEach(i){o.each(this.matrixMap,(u,a)=>{u.forEach(h=>{i(a,h)})})}getNames(i){return this.getNamesEx(r.decodeEx(i))}getNamesEx(i){return o.map(this.matrixMap,(u,a)=>u.findCellEx(i)&&a).filter(Boolean)}_explore(i,u){u.mark=!1;const{sheetName:a}=u,h=new s(u.row,u.col,u.row,u.col,a);let p,m;function d(g,S){const C=i.findCellAt(a,g,u.col);return!(!C||!C.mark)&&(h[S]=g,C.mark=!1,!0)}for(m=u.row-1;d(m,"top");m--);for(m=u.row+1;d(m,"bottom");m++);function b(g,S){const C=[];for(m=h.top;m<=h.bottom;m++){const I=i.findCellAt(a,m,g);if(!I||!I.mark)return!1;C.push(I)}h[S]=g;for(let I=0;I<C.length;I++)C[I].mark=!1;return!0}for(p=u.col-1;b(p,"left");p--);for(p=u.col+1;b(p,"right");p++);return h}getRanges(i,u){return(u=u||this.matrixMap[i])?(u.forEach(a=>{a.mark=!0}),{name:i,ranges:u.map(a=>a.mark&&this._explore(u,a)).filter(Boolean).map(a=>a.$shortRange)}):{name:i,ranges:[]}}normaliseMatrix(i,u){i.forEachInSheet(u,(a,h,p)=>{a&&(a.row===h&&a.col===p||(a.row=h,a.col=p,a.address=r.n2l(p)+h))})}spliceRows(i,u,a,h){o.each(this.matrixMap,p=>{p.spliceRows(i,u,a,h),this.normaliseMatrix(p,i)})}spliceColumns(i,u,a,h){o.each(this.matrixMap,p=>{p.spliceColumns(i,u,a,h),this.normaliseMatrix(p,i)})}get model(){return o.map(this.matrixMap,(i,u)=>this.getRanges(u,i)).filter(i=>i.ranges.length)}set model(i){const u=this.matrixMap={};i.forEach(a=>{const h=u[a.name]=new n;a.ranges.forEach(p=>{e.test(p.split("!").pop()||"")&&h.addCell(p)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(t,l,c){l.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(t,l,c){const o=t("../utils/col-cache"),r=t("./anchor");l.exports=class{constructor(n,s){this.worksheet=n,this.model=s}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(n){let{type:s,imageId:e,range:i,hyperlinks:u}=n;if(this.type=s,this.imageId=e,s==="image")if(typeof i=="string"){const a=o.decode(i);this.range={tl:new r(this.worksheet,{col:a.left,row:a.top},-1),br:new r(this.worksheet,{col:a.right,row:a.bottom},0),editAs:"oneCell"}}else this.range={tl:new r(this.worksheet,i.tl,0),br:i.br&&new r(this.worksheet,i.br,0),ext:i.ext,editAs:i.editAs,hyperlinks:u||i.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(t,l,c){const o=t("../utils/under-dash");class r{constructor(s){this.note=s}get model(){let s=null;switch(typeof this.note){case"string":s={type:"note",note:{texts:[{text:this.note}]}};break;default:s={type:"note",note:this.note}}return o.deepMerge({},r.DEFAULT_CONFIGS,s)}set model(s){const{note:e}=s,{texts:i}=e;i.length===1&&Object.keys(i[0]).length===1?this.note=i[0].text:this.note=e}static fromModel(s){const e=new r;return e.model=s,e}}r.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},l.exports=r},{"../utils/under-dash":26}],10:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(){this.decode(arguments)}setTLBR(s,e,i,u,a){if(arguments.length<4){const h=o.decodeAddress(s),p=o.decodeAddress(e);this.model={top:Math.min(h.row,p.row),left:Math.min(h.col,p.col),bottom:Math.max(h.row,p.row),right:Math.max(h.col,p.col),sheetName:i},this.setTLBR(h.row,h.col,p.row,p.col,a)}else this.model={top:Math.min(s,i),left:Math.min(e,u),bottom:Math.max(s,i),right:Math.max(e,u),sheetName:a}}decode(s){switch(s.length){case 5:this.setTLBR(s[0],s[1],s[2],s[3],s[4]);break;case 4:this.setTLBR(s[0],s[1],s[2],s[3]);break;case 3:this.setTLBR(s[0],s[1],s[2]);break;case 2:this.setTLBR(s[0],s[1]);break;case 1:{const e=s[0];if(e instanceof r)this.model={top:e.model.top,left:e.model.left,bottom:e.model.bottom,right:e.model.right,sheetName:e.sheetName};else if(e instanceof Array)this.decode(e);else if(e.top&&e.left&&e.bottom&&e.right)this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName};else{const i=o.decodeEx(e);i.top?this.model={top:i.top,left:i.left,bottom:i.bottom,right:i.right,sheetName:i.sheetName}:this.model={top:i.row,left:i.col,bottom:i.row,right:i.col,sheetName:i.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+s.length)}}get top(){return this.model.top||1}set top(s){this.model.top=s}get left(){return this.model.left||1}set left(s){this.model.left=s}get bottom(){return this.model.bottom||1}set bottom(s){this.model.bottom=s}get right(){return this.model.right||1}set right(s){this.model.right=s}get sheetName(){return this.model.sheetName}set sheetName(s){this.model.sheetName=s}get _serialisedSheetName(){const{sheetName:s}=this.model;return s?/^[a-zA-Z0-9]*$/.test(s)?s+"!":`'${s}'!`:""}expand(s,e,i,u){(!this.model.top||s<this.top)&&(this.top=s),(!this.model.left||e<this.left)&&(this.left=e),(!this.model.bottom||i>this.bottom)&&(this.bottom=i),(!this.model.right||u>this.right)&&(this.right=u)}expandRow(s){if(s){const{dimensions:e,number:i}=s;e&&this.expand(i,e.min,i,e.max)}}expandToAddress(s){const e=o.decodeEx(s);this.expand(e.row,e.col,e.row,e.col)}get tl(){return o.n2l(this.left)+this.top}get $t$l(){return`$${o.n2l(this.left)}$${this.top}`}get br(){return o.n2l(this.right)+this.bottom}get $b$r(){return`$${o.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&!(s.bottom<this.top)&&!(s.top>this.bottom)&&!(s.right<this.left)&&!(s.left>this.right)}contains(s){const e=o.decodeEx(s);return this.containsEx(e)}containsEx(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&s.row>=this.top&&s.row<=this.bottom&&s.col>=this.left&&s.col<=this.right}forEachAddress(s){for(let e=this.left;e<=this.right;e++)for(let i=this.top;i<=this.bottom;i++)s(o.encodeAddress(i,e),i,e)}}l.exports=r},{"../utils/col-cache":19}],11:[function(t,l,c){const o=t("../utils/under-dash"),r=t("./enums"),n=t("../utils/col-cache"),s=t("./cell");l.exports=class{constructor(e,i){this._worksheet=e,this._number=i,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let i=this._cells[e.col-1];if(!i){const u=this._worksheet.getColumn(e.col);i=new s(this,u,e.address),this._cells[e.col-1]=i}return i}getCell(e){if(typeof e=="string"){const i=this._worksheet.getColumnKey(e);e=i?i.number:n.l2n(e)}return this._cells[e-1]||this.getCellEx({address:n.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,i){const u=e+i;for(var a=arguments.length,h=new Array(a>2?a-2:0),p=2;p<a;p++)h[p-2]=arguments[p];const m=h.length-i,d=this._cells.length;let b,g,S;if(m<0)for(b=e+h.length;b<=d;b++)S=this._cells[b-1],g=this._cells[b-m-1],g?(S=this.getCell(b),S.value=g.value,S.style=g.style,S._comment=g._comment):S&&(S.value=null,S.style={},S._comment=void 0);else if(m>0)for(b=d;b>=u;b--)g=this._cells[b-1],g?(S=this.getCell(b+m),S.value=g.value,S.style=g.style,S._comment=g._comment):this._cells[b+m-1]=void 0;for(b=0;b<h.length;b++)S=this.getCell(e+b),S.value=h[b],S.style={},S._comment=void 0}eachCell(e,i){if(i||(i=e,e=null),e&&e.includeEmpty){const u=this._cells.length;for(let a=1;a<=u;a++)i(this.getCell(a),a)}else this._cells.forEach((u,a)=>{u&&u.type!==r.ValueType.Null&&i(u,a+1)})}addPageBreak(e,i){const u=this._worksheet,a=Math.max(0,e-1)||0,h=Math.max(0,i-1)||16838,p={id:this._number,max:h,man:1};a&&(p.min=a),u.rowBreaks.push(p)}get values(){const e=[];return this._cells.forEach(i=>{i&&i.type!==r.ValueType.Null&&(e[i.col]=i.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let i=0;e.hasOwnProperty("0")&&(i=1),e.forEach((u,a)=>{u!==void 0&&(this.getCellEx({address:n.encodeAddress(this._number,a+i),row:this._number,col:a+i}).value=u)})}else this._worksheet.eachColumnKey((i,u)=>{e[u]!==void 0&&(this.getCellEx({address:n.encodeAddress(this._number,i.number),row:this._number,col:i.number}).value=e[u])})}get hasValues(){return o.some(this._cells,e=>e&&e.type!==r.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,i=0;return this._cells.forEach(u=>{u&&u.type!==r.ValueType.Null&&((!e||e>u.col)&&(e=u.col),i<u.col&&(i=u.col))}),e>0?{min:e,max:i}:null}_applyStyle(e,i){return this.style[e]=i,this._cells.forEach(u=>{u&&(u[e]=i)}),i}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const e=[];let i=0,u=0;return this._cells.forEach(a=>{if(a){const h=a.model;h&&((!i||i>a.col)&&(i=a.col),u<a.col&&(u=a.col),e.push(h))}}),this.height||e.length?{cells:e,number:this.number,min:i,max:u,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(e){if(e.number!==this._number)throw new Error("Invalid row number in model");let i;this._cells=[],e.cells.forEach(u=>{switch(u.type){case s.Types.Merge:break;default:{let a;if(u.address)a=n.decodeAddress(u.address);else if(i){const{row:h}=i,p=i.col+1;a={row:h,col:p,address:n.encodeAddress(h,p),$col$row:`$${n.n2l(p)}$${h}`}}i=a,this.getCellEx(a).model=u;break}}}),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(s,e,i){this.table=s,this.column=e,this.index=i}_set(s,e){this.table.cacheState(),this.column[s]=e}get name(){return this.column.name}set name(s){this._set("name",s)}get filterButton(){return this.column.filterButton}set filterButton(s){this.column.filterButton=s}get style(){return this.column.style}set style(s){this.column.style=s}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(s){this._set("totalsRowLabel",s)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(s){this._set("totalsRowFunction",s)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(s){this._set("totalsRowResult",s)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(s){this._set("totalsRowFormula",s)}}l.exports=class{constructor(n,s){this.worksheet=n,s&&(this.table=s,this.validate(),this.store())}getFormula(n){switch(n.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${n.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${n.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${n.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${n.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${n.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${n.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${n.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${n.name}])`;case"custom":return n.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+n.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:n}=this,s=(m,d,b)=>{m[d]===void 0&&(m[d]=b)};s(n,"headerRow",!0),s(n,"totalsRow",!1),s(n,"style",{}),s(n.style,"theme","TableStyleMedium2"),s(n.style,"showFirstColumn",!1),s(n.style,"showLastColumn",!1),s(n.style,"showRowStripes",!1),s(n.style,"showColumnStripes",!1);const e=(m,d)=>{if(!m)throw new Error(d)};e(n.ref,"Table must have ref"),e(n.columns,"Table must have column definitions"),e(n.rows,"Table must have row definitions"),n.tl=o.decodeAddress(n.ref);const{row:i,col:u}=n.tl;e(i>0,"Table must be on valid row"),e(u>0,"Table must be on valid col");const{width:a,filterHeight:h,tableHeight:p}=this;n.autoFilterRef=o.encode(i,u,i+h-1,u+a-1),n.tableRef=o.encode(i,u,i+p-1,u+a-1),n.columns.forEach((m,d)=>{e(m.name,`Column ${d} must have a name`),d===0?s(m,"totalsRowLabel","Total"):(s(m,"totalsRowFunction","none"),m.totalsRowFormula=this.getFormula(m))})}store(){const n=(h,p)=>{p&&Object.keys(p).forEach(m=>{h[m]=p[m]})},{worksheet:s,table:e}=this,{row:i,col:u}=e.tl;let a=0;if(e.headerRow){const h=s.getRow(i+a++);e.columns.forEach((p,m)=>{const{style:d,name:b}=p,g=h.getCell(u+m);g.value=b,n(g,d)})}if(e.rows.forEach(h=>{const p=s.getRow(i+a++);h.forEach((m,d)=>{const b=p.getCell(u+d);b.value=m,n(b,e.columns[d].style)})}),e.totalsRow){const h=s.getRow(i+a++);e.columns.forEach((p,m)=>{const d=h.getCell(u+m);if(m===0)d.value=p.totalsRowLabel;else{const b=this.getFormula(p);d.value=b?{formula:p.totalsRowFormula,result:p.totalsRowResult}:null}n(d,p.style)})}}load(n){const{table:s}=this,{row:e,col:i}=s.tl;let u=0;if(s.headerRow){const a=n.getRow(e+u++);s.columns.forEach((h,p)=>{a.getCell(i+p).value=h.name})}if(s.rows.forEach(a=>{const h=n.getRow(e+u++);a.forEach((p,m)=>{h.getCell(i+m).value=p})}),s.totalsRow){const a=n.getRow(e+u++);s.columns.forEach((h,p)=>{const m=a.getCell(i+p);p===0?m.value=h.totalsRowLabel:this.getFormula(h)&&(m.value={formula:h.totalsRowFormula,result:h.totalsRowResult})})}}get model(){return this.table}set model(n){this.table=n}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const n=o.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let s=0;s<this._cache.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=0;i<this._cache.width;i++)e.getCell(n.col+i).value=null}else{for(let s=this.tableHeight;s<this._cache.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=0;i<this._cache.width;i++)e.getCell(n.col+i).value=null}for(let s=0;s<this.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=this.width;i<this._cache.width;i++)e.getCell(n.col+i).value=null}}this.store()}addRow(n,s){this.cacheState(),s===void 0?this.table.rows.push(n):this.table.rows.splice(s,0,n)}removeRows(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(n,s)}getColumn(n){const s=this.table.columns[n];return new r(this,s,n)}addColumn(n,s,e){this.cacheState(),e===void 0?(this.table.columns.push(n),this.table.rows.forEach((i,u)=>{i.push(s[u])})):(this.table.columns.splice(e,0,n),this.table.rows.forEach((i,u)=>{i.splice(e,0,s[u])}))}removeColumns(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(n,s),this.table.rows.forEach(e=>{e.splice(n,s)})}_assign(n,s,e){this.cacheState(),n[s]=e}get ref(){return this.table.ref}set ref(n){this._assign(this.table,"ref",n)}get name(){return this.table.name}set name(n){this.table.name=n}get displayName(){return this.table.displyName||this.table.name}set displayNamename(n){this.table.displayName=n}get headerRow(){return this.table.headerRow}set headerRow(n){this._assign(this.table,"headerRow",n)}get totalsRow(){return this.table.totalsRow}set totalsRow(n){this._assign(this.table,"totalsRow",n)}get theme(){return this.table.style.name}set theme(n){this.table.style.name=n}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(n){this.table.style.showFirstColumn=n}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(n){this.table.style.showLastColumn=n}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(n){this.table.style.showRowStripes=n}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(n){this.table.style.showColumnStripes=n}}},{"../utils/col-cache":19}],13:[function(t,l,c){const o=t("./worksheet"),r=t("./defined-names"),n=t("../xlsx/xlsx"),s=t("../csv/csv");l.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new r}get xlsx(){return this._xlsx||(this._xlsx=new n(this)),this._xlsx}get csv(){return this._csv||(this._csv=new s(this)),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,i){const u=this.nextId;i&&(typeof i=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),i={properties:{tabColor:{argb:i}}}):(i.argb||i.theme||i.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),i={properties:{tabColor:i}}));const a=this._worksheets.reduce((m,d)=>(d&&d.orderNo)>m?d.orderNo:m,0),h=Object.assign({},i,{id:u,name:e,orderNo:a+1,workbook:this}),p=new o(h);return this._worksheets[u]=p,p}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){const i=this.getWorksheet(e);i&&i.destroy()}getWorksheet(e){return e===void 0?this._worksheets.find(Boolean):typeof e=="number"?this._worksheets[e]:typeof e=="string"?this._worksheets.find(i=>i&&i.name===e):void 0}get worksheets(){return this._worksheets.slice(1).sort((e,i)=>e.orderNo-i.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(i=>{e(i,i.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){const i=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),i}getImage(e){return this.media[e]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(i=>{const{id:u,name:a,state:h}=i,p=e.sheets&&e.sheets.findIndex(m=>m.id===u);(this._worksheets[u]=new o({id:u,name:a,orderNo:p,state:h,workbook:this})).model=i}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(t,l,c){const o=t("../utils/under-dash"),r=t("../utils/col-cache"),n=t("./range"),s=t("./row"),e=t("./column"),i=t("./enums"),u=t("./image"),a=t("./table"),h=t("./data-validations"),p=t("../utils/encryptor"),{copyStyle:m}=t("../utils/copy-style");l.exports=class{constructor(d){d=d||{},this._workbook=d.workbook,this.id=d.id,this.orderNo=d.orderNo,this.name=d.name,this.state=d.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},d.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!d.pageSetup||!d.pageSetup.fitToWidth&&!d.pageSetup.fitToHeight||d.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},d.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},d.headerFooter),this.dataValidations=new h,this.views=d.views||[],this.autoFilter=d.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(d){if(d===void 0&&(d="sheet"+this.id),this._name!==d){if(typeof d!="string")throw new Error("The name has to be a string.");if(d==="")throw new Error("The name can't be empty.");if(d==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(d))throw new Error(`Worksheet name ${d} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(d))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+d);if(d&&d.length>31&&(console.warn(`Worksheet name ${d} exceeds 31 chars. This will be truncated`),d=d.substring(0,31)),this._workbook._worksheets.find(b=>b&&b.name.toLowerCase()===d.toLowerCase()))throw new Error("Worksheet name already exists: "+d);this._name=d}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const d=new n;return this._rows.forEach(b=>{if(b){const g=b.dimensions;g&&d.expand(b.number,g.min,b.number,g.max)}}),d}get columns(){return this._columns}set columns(d){this._headerRowCount=d.reduce((S,C)=>{const I=(C.header?1:C.headers&&C.headers.length)||0;return Math.max(S,I)},0);let b=1;const g=this._columns=[];d.forEach(S=>{const C=new e(this,b++,!1);g.push(C),C.defn=S})}getColumnKey(d){return this._keys[d]}setColumnKey(d,b){this._keys[d]=b}deleteColumnKey(d){delete this._keys[d]}eachColumnKey(d){o.each(this._keys,d)}getColumn(d){if(typeof d=="string"){const b=this._keys[d];if(b)return b;d=r.l2n(d)}if(this._columns||(this._columns=[]),d>this._columns.length){let b=this._columns.length+1;for(;b<=d;)this._columns.push(new e(this,b++))}return this._columns[d-1]}spliceColumns(d,b){const g=this._rows.length;for(var S=arguments.length,C=new Array(S>2?S-2:0),I=2;I<S;I++)C[I-2]=arguments[I];if(C.length>0)for(let B=0;B<g;B++){const F=[d,b];C.forEach(q=>{F.push(q[B]||null)});const W=this.getRow(B+1);W.splice.apply(W,F)}else this._rows.forEach(B=>{B&&B.splice(d,b)});const D=C.length-b,z=d+b,P=this._columns.length;if(D<0)for(let B=d+C.length;B<=P;B++)this.getColumn(B).defn=this.getColumn(B-D).defn;else if(D>0)for(let B=P;B>=z;B--)this.getColumn(B+D).defn=this.getColumn(B).defn;for(let B=d;B<d+C.length;B++)this.getColumn(B).defn=null;this.workbook.definedNames.spliceColumns(this.name,d,b,C.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let d=0;return this.eachRow(b=>{d=Math.max(d,b.cellCount)}),d}get actualColumnCount(){const d=[];let b=0;return this.eachRow(g=>{g.eachCell(S=>{let{col:C}=S;d[C]||(d[C]=!0,b++)})}),b}_commitRow(){}get _lastRowNumber(){const d=this._rows;let b=d.length;for(;b>0&&d[b-1]===void 0;)b--;return b}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(d){return this._rows[d-1]}findRows(d,b){return this._rows.slice(d-1,d-1+b)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let d=0;return this.eachRow(()=>{d++}),d}getRow(d){let b=this._rows[d-1];return b||(b=this._rows[d-1]=new s(this,d)),b}getRows(d,b){if(b<1)return;const g=[];for(let S=d;S<d+b;S++)g.push(this.getRow(S));return g}addRow(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const g=this._nextRow,S=this.getRow(g);return S.values=d,this._setStyleOption(g,b[0]==="i"?b:"n"),S}addRows(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const g=[];return d.forEach(S=>{g.push(this.addRow(S,b))}),g}insertRow(d,b){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(d,0,b),this._setStyleOption(d,g),this.getRow(d)}insertRows(d,b){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(d,0,...b),g!=="n")for(let S=0;S<b.length;S++)g[0]==="o"&&this.findRow(b.length+d+S)!==void 0?this._copyStyle(b.length+d+S,d+S,g[1]==="+"):g[0]==="i"&&this.findRow(d-1)!==void 0&&this._copyStyle(d-1,d+S,g[1]==="+");return this.getRows(d,b.length)}_setStyleOption(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";b[0]==="o"&&this.findRow(d+1)!==void 0?this._copyStyle(d+1,d,b[1]==="+"):b[0]==="i"&&this.findRow(d-1)!==void 0&&this._copyStyle(d-1,d,b[1]==="+")}_copyStyle(d,b){let g=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const S=this.getRow(d),C=this.getRow(b);C.style=m(S.style),S.eachCell({includeEmpty:g},(I,D)=>{C.getCell(D).style=m(I.style)}),C.height=S.height}duplicateRow(d,b){let g=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const S=this._rows[d-1],C=new Array(b).fill(S.values);this.spliceRows(d+1,g?0:b,...C);for(let I=0;I<b;I++){const D=this._rows[d+I];D.style=S.style,D.height=S.height,S.eachCell({includeEmpty:!0},(z,P)=>{D.getCell(P).style=z.style})}}spliceRows(d,b){const g=d+b;for(var S=arguments.length,C=new Array(S>2?S-2:0),I=2;I<S;I++)C[I-2]=arguments[I];const D=C.length,z=D-b,P=this._rows.length;let B,F;if(z<0)for(d===P&&(this._rows[P-1]=void 0),B=g;B<=P;B++)if(F=this._rows[B-1],F){const W=this.getRow(B+z);W.values=F.values,W.style=F.style,W.height=F.height,F.eachCell({includeEmpty:!0},(q,A)=>{W.getCell(A).style=q.style}),this._rows[B-1]=void 0}else this._rows[B+z-1]=void 0;else if(z>0)for(B=P;B>=g;B--)if(F=this._rows[B-1],F){const W=this.getRow(B+z);W.values=F.values,W.style=F.style,W.height=F.height,F.eachCell({includeEmpty:!0},(q,A)=>{if(W.getCell(A).style=q.style,q._value.constructor.name==="MergeValue"){const M=this.getRow(q._row._number+D).getCell(A),k=q._value._master,y=this.getRow(k._row._number+D).getCell(k._column._number);M.merge(y)}})}else this._rows[B+z-1]=void 0;for(B=0;B<D;B++){const W=this.getRow(d+B);W.style={},W.values=C[B]}this.workbook.definedNames.spliceRows(this.name,d,b,D)}eachRow(d,b){if(b||(b=d,d=void 0),d&&d.includeEmpty){const g=this._rows.length;for(let S=1;S<=g;S++)b(this.getRow(S),S)}else this._rows.forEach(g=>{g&&g.hasValues&&b(g,g.number)})}getSheetValues(){const d=[];return this._rows.forEach(b=>{b&&(d[b.number]=b.values)}),d}findCell(d,b){const g=r.getAddress(d,b),S=this._rows[g.row-1];return S?S.findCell(g.col):void 0}getCell(d,b){const g=r.getAddress(d,b);return this.getRow(g.row).getCellEx(g)}mergeCells(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);this._mergeCellsInternal(S)}mergeCellsWithoutStyle(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);this._mergeCellsInternal(S,!0)}_mergeCellsInternal(d,b){o.each(this._merges,S=>{if(S.intersects(d))throw new Error("Cannot merge already merged cells")});const g=this.getCell(d.top,d.left);for(let S=d.top;S<=d.bottom;S++)for(let C=d.left;C<=d.right;C++)(S>d.top||C>d.left)&&this.getCell(S,C).merge(g,b);this._merges[g.address]=d}_unMergeMaster(d){const b=this._merges[d.address];if(b){for(let g=b.top;g<=b.bottom;g++)for(let S=b.left;S<=b.right;S++)this.getCell(g,S).unmerge();delete this._merges[d.address]}}get hasMerges(){return o.some(this._merges,Boolean)}unMergeCells(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);for(let C=S.top;C<=S.bottom;C++)for(let I=S.left;I<=S.right;I++){const D=this.findCell(C,I);D&&(D.type===i.ValueType.Merge?this._unMergeMaster(D.master):this._merges[D.address]&&this._unMergeMaster(D))}}fillFormula(d,b,g){let S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared";const C=r.decode(d),{top:I,left:D,bottom:z,right:P}=C,B=P-D+1,F=r.encodeAddress(I,D),W=S==="shared";let q;q=typeof g=="function"?g:Array.isArray(g)?Array.isArray(g[0])?(M,k)=>g[M-I][k-D]:(M,k)=>g[(M-I)*B+(k-D)]:()=>{};let A=!0;for(let M=I;M<=z;M++)for(let k=D;k<=P;k++)A?(this.getCell(M,k).value={shareType:S,formula:b,ref:d,result:q(M,k)},A=!1):this.getCell(M,k).value=W?{sharedFormula:F,result:q(M,k)}:q(M,k)}addImage(d,b){const g={type:"image",imageId:d,range:b};this._media.push(new u(this,g))}getImages(){return this._media.filter(d=>d.type==="image")}addBackgroundImage(d){const b={type:"background",imageId:d};this._media.push(new u(this,b))}getBackgroundImageId(){const d=this._media.find(b=>b.type==="background");return d&&d.imageId}protect(d,b){return new Promise(g=>{this.sheetProtection={sheet:!0},b&&"spinCount"in b&&(b.spinCount=Number.isFinite(b.spinCount)?Math.round(Math.max(0,b.spinCount)):1e5),d&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=p.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=b&&"spinCount"in b?b.spinCount:1e5,this.sheetProtection.hashValue=p.convertPasswordToHash(d,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),b&&(this.sheetProtection=Object.assign(this.sheetProtection,b),!d&&"spinCount"in b&&delete this.sheetProtection.spinCount),g()})}unprotect(){this.sheetProtection=null}addTable(d){const b=new a(this,d);return this.tables[d.name]=b,b}getTable(d){return this.tables[d]}removeTable(d){delete this.tables[d]}getTables(){return Object.values(this.tables)}addConditionalFormatting(d){this.conditionalFormattings.push(d)}removeConditionalFormatting(d){typeof d=="number"?this.conditionalFormattings.splice(d,1):this.conditionalFormattings=d instanceof Function?this.conditionalFormattings.filter(d):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(d){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=d}get model(){const d={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(S=>S.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(S=>S.model),conditionalFormattings:this.conditionalFormattings};d.cols=e.toModel(this.columns);const b=d.rows=[],g=d.dimensions=new n;return this._rows.forEach(S=>{const C=S&&S.model;C&&(g.expand(C.number,C.min,C.number,C.max),b.push(C))}),d.merges=[],o.each(this._merges,S=>{d.merges.push(S.range)}),d}_parseRows(d){this._rows=[],d.rows.forEach(b=>{const g=new s(this,b.number);this._rows[g.number-1]=g,g.model=b})}_parseMergeCells(d){o.each(d.mergeCells,b=>{this.mergeCellsWithoutStyle(b)})}set model(d){this.name=d.name,this._columns=e.fromModel(this,d.cols),this._parseRows(d),this._parseMergeCells(d),this.dataValidations=new h(d.dataValidations),this.properties=d.properties,this.pageSetup=d.pageSetup,this.headerFooter=d.headerFooter,this.views=d.views,this.autoFilter=d.autoFilter,this._media=d.media.map(b=>new u(this,b)),this.sheetProtection=d.sheetProtection,this.tables=d.tables.reduce((b,g)=>{const S=new a;return S.model=g,b[g.name]=S,b},{}),this.conditionalFormattings=d.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(t,l,c){t("core-js/modules/es.promise"),t("core-js/modules/es.promise.finally"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.keys"),t("core-js/modules/es.object.values"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.async-iterator"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.includes"),t("core-js/modules/es.array.find-index"),t("core-js/modules/es.array.find"),t("core-js/modules/es.string.from-code-point"),t("core-js/modules/es.string.includes"),t("core-js/modules/es.number.is-nan"),t("regenerator-runtime/runtime");const o={Workbook:t("./doc/workbook")},r=t("./doc/enums");Object.keys(r).forEach(n=>{o[n]=r[n]}),l.exports=o},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(t,l,c){const o=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");c.bufferToString=function(r){return typeof r=="string"?r:o?o.decode(r):r.toString()}},{}],17:[function(t,l,c){const o=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:r}=t("buffer");c.stringToBuffer=function(n){return typeof n!="string"?n:o?r.from(o.encode(n).buffer):r.from(n)}},{buffer:220}],18:[function(t,l,c){const o=t("./under-dash"),r=t("./col-cache");l.exports=class{constructor(n){this.template=n,this.sheets={}}addCell(n){this.addCellEx(r.decodeEx(n))}getCell(n){return this.findCellEx(r.decodeEx(n),!0)}findCell(n){return this.findCellEx(r.decodeEx(n),!1)}findCellAt(n,s,e){const i=this.sheets[n],u=i&&i[s];return u&&u[e]}addCellEx(n){if(n.top)for(let s=n.top;s<=n.bottom;s++)for(let e=n.left;e<=n.right;e++)this.getCellAt(n.sheetName,s,e);else this.findCellEx(n,!0)}getCellEx(n){return this.findCellEx(n,!0)}findCellEx(n,s){const e=this.findSheet(n,s),i=this.findSheetRow(e,n,s);return this.findRowCell(i,n,s)}getCellAt(n,s,e){const i=this.sheets[n]||(this.sheets[n]=[]),u=i[s]||(i[s]=[]);return u[e]||(u[e]={sheetName:n,address:r.n2l(e)+s,row:s,col:e})}removeCellEx(n){const s=this.findSheet(n);if(!s)return;const e=this.findSheetRow(s,n);e&&delete e[n.col]}forEachInSheet(n,s){const e=this.sheets[n];e&&e.forEach((i,u)=>{i&&i.forEach((a,h)=>{a&&s(a,u,h)})})}forEach(n){o.each(this.sheets,(s,e)=>{this.forEachInSheet(e,n)})}map(n){const s=[];return this.forEach(e=>{s.push(n(e))}),s}findSheet(n,s){const e=n.sheetName;return this.sheets[e]?this.sheets[e]:s?this.sheets[e]=[]:void 0}findSheetRow(n,s,e){const{row:i}=s;return n&&n[i]?n[i]:e?n[i]=[]:void 0}findRowCell(n,s,e){const{col:i}=s;return n&&n[i]?n[i]:e?n[i]=this.template?Object.assign(s,JSON.parse(JSON.stringify(this.template))):s:void 0}spliceRows(n,s,e,i){const u=this.sheets[n];if(u){const a=[];for(let h=0;h<i;h++)a.push([]);u.splice(s,e,...a)}}spliceColumns(n,s,e,i){const u=this.sheets[n];if(u){const a=[];for(let h=0;h<i;h++)a.push(null);o.each(u,h=>{h.splice(s,e,...a)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(t,l,c){const o=/^[A-Z]+\d+$/,r={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:n=>n<=26?1:n<=676?2:3,_fill(n){let s,e,i,u,a,h=1;if(n>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&n>=1){for(;h<=26;)s=this._dictionary[h-1],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=1}if(this._l2nFill<2&&n>=2){for(h=27;h<=702;)e=h-27,i=e%26,u=Math.floor(e/26),s=this._dictionary[u]+this._dictionary[i],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=2}if(this._l2nFill<3&&n>=3){for(h=703;h<=16384;)e=h-703,i=e%26,u=Math.floor(e/26)%26,a=Math.floor(e/676),s=this._dictionary[a]+this._dictionary[u]+this._dictionary[i],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=3}},l2n(n){if(this._l2n[n]||this._fill(n.length),!this._l2n[n])throw new Error("Out of bounds. Invalid column letter: "+n);return this._l2n[n]},n2l(n){if(n<1||n>16384)throw new Error(n+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[n]||this._fill(this._level(n)),this._n2l[n]},_hash:{},validateAddress(n){if(!o.test(n))throw new Error("Invalid Address: "+n);return!0},decodeAddress(n){const s=n.length<5&&this._hash[n];if(s)return s;let e=!1,i="",u=0,a=!1,h="",p=0;for(let d,b=0;b<n.length;b++)if(d=n.charCodeAt(b),!a&&d>=65&&d<=90)e=!0,i+=n[b],u=26*u+d-64;else if(d>=48&&d<=57)a=!0,h+=n[b],p=10*p+d-48;else if(a&&e&&d!==36)break;if(e){if(u>16384)throw new Error("Out of bounds. Invalid column letter: "+i)}else u=void 0;a||(p=void 0);const m={address:n=i+h,col:u,row:p,$col$row:`$${i}$${h}`};return u<=100&&p<=100&&(this._hash[n]=m,this._hash[m.$col$row]=m),m},getAddress(n,s){if(s){const e=this.n2l(s)+n;return this.decodeAddress(e)}return this.decodeAddress(n)},decode(n){const s=n.split(":");if(s.length===2){const e=this.decodeAddress(s[0]),i=this.decodeAddress(s[1]),u={top:Math.min(e.row,i.row),left:Math.min(e.col,i.col),bottom:Math.max(e.row,i.row),right:Math.max(e.col,i.col)};return u.tl=this.n2l(u.left)+u.top,u.br=this.n2l(u.right)+u.bottom,u.dimensions=`${u.tl}:${u.br}`,u}return this.decodeAddress(n)},decodeEx(n){const s=n.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),e=s[1]||s[2],i=s[3],u=i.split(":");if(u.length>1){let h=this.decodeAddress(u[0]),p=this.decodeAddress(u[1]);const m=Math.min(h.row,p.row),d=Math.min(h.col,p.col),b=Math.max(h.row,p.row),g=Math.max(h.col,p.col);return h=this.n2l(d)+m,p=this.n2l(g)+b,{top:m,left:d,bottom:b,right:g,sheetName:e,tl:{address:h,col:d,row:m,$col$row:`$${this.n2l(d)}$${m}`,sheetName:e},br:{address:p,col:g,row:b,$col$row:`$${this.n2l(g)}$${b}`,sheetName:e},dimensions:`${h}:${p}`}}if(i.startsWith("#"))return e?{sheetName:e,error:i}:{error:i};const a=this.decodeAddress(i);return e?{sheetName:e,...a}:a},encodeAddress:(n,s)=>r.n2l(s)+n,encode(){switch(arguments.length){case 2:return r.encodeAddress(arguments[0],arguments[1]);case 4:return`${r.encodeAddress(arguments[0],arguments[1])}:${r.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(n,s){const[e,i,,u,a]=n,[h,p]=s;return h>=e&&h<=u&&p>=i&&p<=a}};l.exports=r},{}],20:[function(t,l,c){const o=(n,s)=>({...n,...s.reduce((e,i)=>(n[i]&&(e[i]={...n[i]}),e),{})}),r=function(n,s,e){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];n[e]&&(s[e]=o(n[e],i))};c.copyStyle=n=>{if(!n)return n;if(s=n,Object.keys(s).length===0)return{};var s;const e={...n};return r(n,e,"font",["color"]),r(n,e,"alignment"),r(n,e,"protection"),n.border&&(r(n,e,"border"),r(n.border,e.border,"top",["color"]),r(n.border,e.border,"left",["color"]),r(n.border,e.border,"bottom",["color"]),r(n.border,e.border,"right",["color"]),r(n.border,e.border,"diagonal",["color"])),n.fill&&(r(n,e,"fill",["fgColor","bgColor","center"]),n.fill.stops&&(e.fill.stops=n.fill.stops.map(i=>o(i,["color"])))),e}},{}],21:[function(t,l,c){(function(o){(function(){const r=t("crypto"),n={hash(s){const e=r.createHash(s);for(var i=arguments.length,u=new Array(i>1?i-1:0),a=1;a<i;a++)u[a-1]=arguments[a];return e.update(o.concat(u)),e.digest()},convertPasswordToHash(s,e,i,u){if(e=e.toLowerCase(),r.getHashes().indexOf(e)<0)throw new Error(`Hash algorithm '${e}' not supported!`);const a=o.from(s,"utf16le");let h=this.hash(e,o.from(i,"base64"),a);for(let p=0;p<u;p++){const m=o.alloc(4);m.writeUInt32LE(p,0),h=this.hash(e,h,m)}return h.toString("base64")},randomBytes:s=>r.randomBytes(s)};l.exports=n}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(t,l,c){const{SaxesParser:o}=t("saxes"),{PassThrough:r}=t("readable-stream"),{bufferToString:n}=t("./browser-buffer-decode");l.exports=async function*(s){s.pipe&&!s[Symbol.asyncIterator]&&(s=s.pipe(new r));const e=new o;let i;e.on("error",a=>{i=a});let u=[];e.on("opentag",a=>u.push({eventType:"opentag",value:a})),e.on("text",a=>u.push({eventType:"text",value:a})),e.on("closetag",a=>u.push({eventType:"closetag",value:a}));for await(const a of s){if(e.write(n(a)),i)throw i;yield u,u=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(t,l,c){const o=t("./col-cache"),r=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,n=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;l.exports={slideFormula:function(s,e,i){const u=o.decode(e),a=o.decode(i);return s.replace(r,(h,p,m,d,b)=>{if(b)return h;const g=n.exec(d);if(g){const S=g[1],C=g[2].toUpperCase(),I=g[3],D=g[4];if(C.length>3||C.length===3&&C>"XFD")return h;let z=o.l2n(C),P=parseInt(D,10);return S||(z+=a.col-u.col),I||(P+=a.row-u.row),(p||"")+(S||"")+o.n2l(z)+(I||"")+P}return h})}}},{"./col-cache":19}],24:[function(t,l,c){(function(o,r){(function(){const n=t("readable-stream"),s=t("./utils"),e=t("./string-buf");class i{constructor(d,b){this._data=d,this._encoding=b}get length(){return this.toBuffer().length}copy(d,b,g,S){return this.toBuffer().copy(d,b,g,S)}toBuffer(){return this._buffer||(this._buffer=r.from(this._data,this._encoding)),this._buffer}}class u{constructor(d){this._data=d}get length(){return this._data.length}copy(d,b,g,S){return this._data._buf.copy(d,b,g,S)}toBuffer(){return this._data.toBuffer()}}class a{constructor(d){this._data=d}get length(){return this._data.length}copy(d,b,g,S){this._data.copy(d,b,g,S)}toBuffer(){return this._data}}class h{constructor(d){this.size=d,this.buffer=r.alloc(d),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const d=r.alloc(this.iWrite-this.iRead);return this.buffer.copy(d,0,this.iRead,this.iWrite),d}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(d){let b;return d===0?null:d===void 0||d>=this.length?(b=this.toBuffer(),this.iRead=this.iWrite,b):(b=r.alloc(d),this.buffer.copy(b,0,this.iRead,d),this.iRead+=d,b)}write(d,b,g){const S=Math.min(g,this.size-this.iWrite);return d.copy(this.buffer,this.iWrite,b,b+S),this.iWrite+=S,S}}const p=function(m){m=m||{},this.bufSize=m.bufSize||1048576,this.buffers=[],this.batch=m.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};s.inherits(p,n.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return r.concat(this.buffers.map(m=>m.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const d=this.buffers[this.buffers.length-1];if(!d.full)return d}const m=new h(this.bufSize);return this.buffers.push(m),m},async _pipe(m){await Promise.all(this.pipes.map((function(d){return new Promise(b=>{d.write(m.toBuffer(),()=>{b()})})})))},_writeToBuffers(m){let d=0;const b=m.length;for(;d<b;)d+=this._getWritableBuffer().write(m,d,b-d)},async write(m,d,b){let g;if(d instanceof Function&&(b=d,d="utf8"),b=b||s.nop,m instanceof e)g=new u(m);else if(m instanceof r)g=new a(m);else{if(!(typeof m=="string"||m instanceof String||m instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");g=new i(m,d)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(g);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(g),o.nextTick(b)):(await this._pipe(g),b());else this.paused||this.emit("data",g.toBuffer()),this._writeToBuffers(g),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(m,d,b){const g=S=>{S?b(S):(this._flush(),this.pipes.forEach(C=>{C.end()}),this.emit("finish"))};m?this.write(m,d,g):g()},read(m){let d;if(m){for(d=[];m&&this.buffers.length&&!this.buffers[0].eod;){const b=this.buffers[0],g=b.read(m);m-=g.length,d.push(g),b.eod&&b.full&&this.buffers.shift()}return r.concat(d)}return d=this.buffers.map(b=>b.toBuffer()).filter(Boolean),this.buffers=[],r.concat(d)},setEncoding(m){this.encoding=m},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(m){this.pipes.push(m),!this.paused&&this.buffers.length&&this.end()},unpipe(m){this.pipes=this.pipes.filter(d=>d!==m)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),l.exports=p}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(t,l,c){(function(o){(function(){l.exports=class{constructor(r){this._buf=o.alloc(r&&r.size||16384),this._encoding=r&&r.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=o.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(r){r=r||0,this._buffer=void 0,this._inPos=r}_grow(r){let n=2*this._buf.length;for(;n<r;)n*=2;const s=o.alloc(n);this._buf.copy(s,0),this._buf=s}addText(r){this._buffer=void 0;let n=this._inPos+this._buf.write(r,this._inPos,this._encoding);for(;n>=this._buf.length-4;)this._grow(this._inPos+r.length),n=this._inPos+this._buf.write(r,this._inPos,this._encoding);this._inPos=n}addStringBuf(r){r.length&&(this._buffer=void 0,this.length+r.length>this.capacity&&this._grow(this.length+r.length),r._buf.copy(this._buf,this._inPos,0,r.length),this._inPos+=r.length)}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220}],26:[function(t,l,c){const{toString:o}=Object.prototype,r=/["&<>]/,n={each:function(s,e){s&&(Array.isArray(s)?s.forEach(e):Object.keys(s).forEach(i=>{e(s[i],i)}))},some:function(s,e){return!!s&&(Array.isArray(s)?s.some(e):Object.keys(s).some(i=>e(s[i],i)))},every:function(s,e){return!s||(Array.isArray(s)?s.every(e):Object.keys(s).every(i=>e(s[i],i)))},map:function(s,e){return s?Array.isArray(s)?s.map(e):Object.keys(s).map(i=>e(s[i],i)):[]},keyBy:(s,e)=>s.reduce((i,u)=>(i[u[e]]=u,i),{}),isEqual:function(s,e){const i=typeof s,u=typeof e,a=Array.isArray(s),h=Array.isArray(e);let p;if(i!==u)return!1;switch(typeof s){case"object":if(a||h)return!(!a||!h)&&s.length===e.length&&s.every((m,d)=>{const b=e[d];return n.isEqual(m,b)});if(s===null||e===null)return s===e;if(p=Object.keys(s),Object.keys(e).length!==p.length)return!1;for(const m of p)if(!e.hasOwnProperty(m))return!1;return n.every(s,(m,d)=>{const b=e[d];return n.isEqual(m,b)});default:return s===e}},escapeHtml(s){const e=r.exec(s);if(!e)return s;let i="",u="",a=0,h=e.index;for(;h<s.length;h++){switch(s.charAt(h)){case'"':u="&quot;";break;case"&":u="&amp;";break;case"'":u="&apos;";break;case"<":u="&lt;";break;case">":u="&gt;";break;default:continue}a!==h&&(i+=s.substring(a,h)),a=h+1,i+=u}return a!==h?i+s.substring(a,h):i},strcmp:(s,e)=>s<e?-1:s>e?1:0,isUndefined:s=>o.call(s)==="[object Undefined]",isObject:s=>o.call(s)==="[object Object]",deepMerge(){const s=arguments[0]||{},{length:e}=arguments;let i,u,a;function h(p,m){i=s[m],a=Array.isArray(p),n.isObject(p)||a?(a?(a=!1,u=i&&Array.isArray(i)?i:[]):u=i&&n.isObject(i)?i:{},s[m]=n.deepMerge(u,p)):n.isUndefined(p)||(s[m]=p)}for(let p=0;p<e;p++)n.each(arguments[p],h);return s}};l.exports=n},{}],27:[function(t,l,c){(function(o,r){(function(){const n=t("fs"),s=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,e={nop(){},promiseImmediate:i=>new Promise(u=>{o.setImmediate?r(()=>{u(i)}):setTimeout(()=>{u(i)},1)}),inherits:function(i,u,a,h){i.super_=u,h||(h=a,a=null),a&&Object.keys(a).forEach(m=>{Object.defineProperty(i,m,Object.getOwnPropertyDescriptor(a,m))});const p={constructor:{value:i,enumerable:!1,writable:!1,configurable:!0}};h&&Object.keys(h).forEach(m=>{p[m]=Object.getOwnPropertyDescriptor(h,m)}),i.prototype=Object.create(u.prototype,p)},dateToExcel:(i,u)=>25569+i.getTime()/864e5-(u?1462:0),excelToDate(i,u){const a=Math.round(24*(i-25569+(u?1462:0))*3600*1e3);return new Date(a)},parsePath(i){const u=i.lastIndexOf("/");return{path:i.substring(0,u),name:i.substring(u+1)}},getRelsPath(i){const u=e.parsePath(i);return`${u.path}/_rels/${u.name}.rels`},xmlEncode(i){const u=s.exec(i);if(!u)return i;let a="",h="",p=0,m=u.index;for(;m<i.length;m++){const d=i.charCodeAt(m);switch(d){case 34:h="&quot;";break;case 38:h="&amp;";break;case 39:h="&apos;";break;case 60:h="&lt;";break;case 62:h="&gt;";break;case 127:h="";break;default:if(d<=31&&(d<=8||d>=11&&d!==13)){h="";break}continue}p!==m&&(a+=i.substring(p,m)),p=m+1,h&&(a+=h)}return p!==m?a+i.substring(p,m):a},xmlDecode:i=>i.replace(/&([a-z]*);/g,u=>{switch(u){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":return'"';default:return u}}),validInt(i){const u=parseInt(i,10);return Number.isNaN(u)?0:u},isDateFmt(i){return i?(i=(i=i.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:i=>new Promise(u=>{n.access(i,n.constants.F_OK,a=>{u(!a)})})},toIsoDateString:i=>i.toIsoString().subsstr(0,10),parseBoolean:i=>i===!0||i==="true"||i===1||i==="1"};l.exports=e}).call(this)}).call(this,typeof pe<"u"?pe:typeof self<"u"?self:typeof window<"u"?window:{},t("timers").setImmediate)},{fs:216,timers:523}],28:[function(t,l,c){const o=t("./under-dash"),r=t("./utils");function n(i,u,a){i.push(` ${u}="${r.xmlEncode(a.toString())}"`)}function s(i,u){if(u){const a=[];o.each(u,(h,p)=>{h!==void 0&&n(a,p,h)}),i.push(a.join(""))}}class e{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(u){const a=this._xml;a.push("<?xml"),s(a,u),a.push(`?>
256
+ `}}customElements.get("ng-expand-icon")||customElements.define("ng-expand-icon",ud),customElements.get("ng-expand-check")||customElements.define("ng-expand-check",dd),customElements.get("ng-expand-button")||customElements.define("ng-expand-button",fd);var pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pd(vt){return vt&&vt.__esModule&&Object.prototype.hasOwnProperty.call(vt,"default")?vt.default:vt}function Pl(vt){throw new Error('Could not dynamically require "'+vt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iu={exports:{}};/*! ExcelJS 19-10-2023 */var ku;function md(){return ku||(ku=1,(function(vt,E){(function(t){vt.exports=t()})((function(){return(function t(l,c,o){function r(e,i){if(!c[e]){if(!l[e]){var u=typeof Pl=="function"&&Pl;if(!i&&u)return u(e,!0);if(n)return n(e,!0);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}var h=c[e]={exports:{}};l[e][0].call(h.exports,(function(p){return r(l[e][1][p]||p)}),h,h.exports,t,l,c,o)}return c[e].exports}for(var n=typeof Pl=="function"&&Pl,s=0;s<o.length;s++)r(o[s]);return r})({1:[function(t,l,c){const o=t("fs"),r=t("fast-csv"),n=t("dayjs/plugin/customParseFormat"),s=t("dayjs/plugin/utc"),e=t("dayjs").extend(n).extend(s),i=t("../utils/stream-buf"),{fs:{exists:u}}=t("../utils/utils"),a={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};l.exports=class{constructor(h){this.workbook=h,this.worksheet=null}async readFile(h,p){if(p=p||{},!await u(h))throw new Error("File not found: "+h);const m=o.createReadStream(h),d=await this.read(m,p);return m.close(),d}read(h,p){return p=p||{},new Promise((m,d)=>{const b=this.workbook.addWorksheet(p.sheetName),g=p.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],S=p.map||function(I){if(I==="")return null;const D=Number(I);if(!Number.isNaN(D)&&D!==1/0)return D;const z=g.reduce((B,F)=>{if(B)return B;const W=e(I,F,!0);return W.isValid()?W:null},null);if(z)return new Date(z.valueOf());const P=a[I];return P!==void 0?P:I},C=r.parse(p.parserOptions).on("data",I=>{b.addRow(I.map(S))}).on("end",()=>{C.emit("worksheet",b)});C.on("worksheet",m).on("error",d),h.pipe(C)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(h,p){return new Promise((m,d)=>{p=p||{};const b=this.workbook.getWorksheet(p.sheetName||p.sheetId),g=r.format(p.formatterOptions);h.on("finish",()=>{m()}),g.on("error",d),g.pipe(h);const{dateFormat:S,dateUTC:C}=p,I=p.map||(P=>{if(P){if(P.text||P.hyperlink)return P.hyperlink||P.text||"";if(P.formula||P.result)return P.result||"";if(P instanceof Date)return S?C?e.utc(P).format(S):e(P).format(S):C?e.utc(P).format():e(P).format();if(P.error)return P.error;if(typeof P=="object")return JSON.stringify(P)}return P}),D=p.includeEmptyRows===void 0||p.includeEmptyRows;let z=1;b&&b.eachRow((P,B)=>{if(D)for(;z++<B-1;)g.write([]);const{values:F}=P;F.shift(),g.write(F.map(I)),z=B}),g.end()})}writeFile(h,p){const m={encoding:(p=p||{}).encoding||"utf8"},d=o.createWriteStream(h,m);return this.write(d,p)}async writeBuffer(h){const p=new i;return await this.write(p,h),p.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(s,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=s,e)if(typeof e=="string"){const u=o.decodeAddress(e);this.nativeCol=u.col+i,this.nativeColOff=0,this.nativeRow=u.row+i,this.nativeRowOff=0}else e.nativeCol!==void 0?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):e.col!==void 0?(this.col=e.col+i,this.row=e.row+i):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(s){return s instanceof r||s==null?s:new r(s)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(s){this.nativeCol=Math.floor(s),this.nativeColOff=Math.floor((s-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(s){this.nativeRow=Math.floor(s),this.nativeRowOff=Math.floor((s-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(s){this.nativeCol=s.nativeCol,this.nativeColOff=s.nativeColOff,this.nativeRow=s.nativeRow,this.nativeRowOff=s.nativeRowOff}}l.exports=r},{"../utils/col-cache":19}],3:[function(t,l,c){const o=t("../utils/col-cache"),r=t("../utils/under-dash"),n=t("./enums"),{slideFormula:s}=t("../utils/shared-formula"),e=t("./note");class i{constructor(h,p,m){if(!h||!p)throw new Error("A Cell needs a Row");this._row=h,this._column=p,o.validateAddress(m),this._address=m,this._value=u.create(i.Types.Null,this),this.style=this._mergeStyle(h.style,p.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(h){this.style.numFmt=h}get font(){return this.style.font}set font(h){this.style.font=h}get alignment(){return this.style.alignment}set alignment(h){this.style.alignment=h}get border(){return this.style.border}set border(h){this.style.border=h}get fill(){return this.style.fill}set fill(h){this.style.fill=h}get protection(){return this.style.protection}set protection(h){this.style.protection=h}_mergeStyle(h,p,m){const d=h&&h.numFmt||p&&p.numFmt;d&&(m.numFmt=d);const b=h&&h.font||p&&p.font;b&&(m.font=b);const g=h&&h.alignment||p&&p.alignment;g&&(m.alignment=g);const S=h&&h.border||p&&p.border;S&&(m.border=S);const C=h&&h.fill||p&&p.fill;C&&(m.fill=C);const I=h&&h.protection||p&&p.protection;return I&&(m.protection=I),m}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===i.Types.Merge}merge(h,p){this._value.release(),this._value=u.create(i.Types.Merge,this,h),p||(this.style=h.style)}unmerge(){this.type===i.Types.Merge&&(this._value.release(),this._value=u.create(i.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(h){return this._value.type===i.Types.Merge&&this._value.isMergedTo(h)}get master(){return this.type===i.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===i.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(h){this.type!==i.Types.Merge?(this._value.release(),this._value=u.create(u.getType(h),this,h)):this._value.master.value=h}get note(){return this._comment&&this._comment.note}set note(h){this._comment=new e(h)}get text(){return this._value.toString()}get html(){return r.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(h){this.type===i.Types.String&&(this._value=u.create(i.Types.Hyperlink,this,{text:this._value.value,hyperlink:h}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:h}=this._row;return{sheetName:h.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(h){this.names=[h]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(h){const{definedNames:p}=this.workbook;p.removeAllNames(this.fullAddress),h.forEach(m=>{p.addEx(this.fullAddress,m)})}addName(h){this.workbook.definedNames.addEx(this.fullAddress,h)}removeName(h){this.workbook.definedNames.removeEx(this.fullAddress,h)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(h){this._dataValidations.add(this.address,h)}get model(){const{model:h}=this._value;return h.style=this.style,this._comment&&(h.comment=this._comment.model),h}set model(h){if(this._value.release(),this._value=u.create(h.type,this),this._value.model=h,h.comment)switch(h.comment.type){case"note":this._comment=e.fromModel(h.comment)}h.style?this.style=h.style:this.style={}}}i.Types=n.ValueType;const u={getType:a=>a==null?i.Types.Null:a instanceof String||typeof a=="string"?i.Types.String:typeof a=="number"?i.Types.Number:typeof a=="boolean"?i.Types.Boolean:a instanceof Date?i.Types.Date:a.text&&a.hyperlink?i.Types.Hyperlink:a.formula||a.sharedFormula?i.Types.Formula:a.richText?i.Types.RichText:a.sharedString?i.Types.SharedString:a.error?i.Types.Error:i.Types.JSON,types:[{t:i.Types.Null,f:class{constructor(a){this.model={address:a.address,type:i.Types.Null}}get value(){return null}set value(a){}get type(){return i.Types.Null}get effectiveType(){return i.Types.Null}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return""}release(){}toString(){return""}}},{t:i.Types.Number,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Number,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Number}get effectiveType(){return i.Types.Number}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.String,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.String}get effectiveType(){return i.Types.String}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:i.Types.Date,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Date,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Date}get effectiveType(){return i.Types.Date}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.Hyperlink,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Hyperlink,text:h?h.text:void 0,hyperlink:h?h.hyperlink:void 0},h&&h.tooltip&&(this.model.tooltip=h.tooltip)}get value(){const a={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(a.tooltip=this.model.tooltip),a}set value(a){this.model={text:a.text,hyperlink:a.hyperlink},a.tooltip&&(this.model.tooltip=a.tooltip)}get text(){return this.model.text}set text(a){this.model.text=a}get hyperlink(){return this.model.hyperlink}set hyperlink(a){this.model.hyperlink=a}get type(){return i.Types.Hyperlink}get effectiveType(){return i.Types.Hyperlink}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:i.Types.Formula,f:class{constructor(a,h){this.cell=a,this.model={address:a.address,type:i.Types.Formula,shareType:h?h.shareType:void 0,ref:h?h.ref:void 0,formula:h?h.formula:void 0,sharedFormula:h?h.sharedFormula:void 0,result:h?h.result:void 0}}_copyModel(a){const h={},p=m=>{const d=a[m];d&&(h[m]=d)};return p("formula"),p("result"),p("ref"),p("shareType"),p("sharedFormula"),h}get value(){return this._copyModel(this.model)}set value(a){this.model=this._copyModel(a)}validate(a){switch(u.getType(a)){case i.Types.Null:case i.Types.String:case i.Types.Number:case i.Types.Date:break;case i.Types.Hyperlink:case i.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(a){this.model.formula=a}get formulaType(){return this.model.formula?n.FormulaType.Master:this.model.sharedFormula?n.FormulaType.Shared:n.FormulaType.None}get result(){return this.model.result}set result(a){this.model.result=a}get type(){return i.Types.Formula}get effectiveType(){const a=this.model.result;return a==null?n.ValueType.Null:a instanceof String||typeof a=="string"?n.ValueType.String:typeof a=="number"?n.ValueType.Number:a instanceof Date?n.ValueType.Date:a.text&&a.hyperlink?n.ValueType.Hyperlink:a.formula?n.ValueType.Formula:n.ValueType.Null}get address(){return this.model.address}set address(a){this.model.address=a}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:a}=this.cell,h=a.findCell(this.model.sharedFormula);this._translatedFormula=h&&s(h.formula,h.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:i.Types.Merge,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Merge,master:h?h.address:void 0},this._master=h,h&&h.addMergeRef()}get value(){return this._master.value}set value(a){a instanceof i?(this._master&&this._master.releaseMergeRef(),a.addMergeRef(),this._master=a):this._master.value=a}isMergedTo(a){return a===this._master}get master(){return this._master}get type(){return i.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:i.Types.JSON,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:JSON.stringify(h),rawValue:h}}get value(){return this.model.rawValue}set value(a){this.model.rawValue=a,this.model.value=JSON.stringify(a)}get type(){return i.Types.String}get effectiveType(){return i.Types.String}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:i.Types.SharedString,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.SharedString,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.SharedString}get effectiveType(){return i.Types.SharedString}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.RichText,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.String,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}toString(){return this.model.value.richText.map(a=>a.text).join("")}get type(){return i.Types.RichText}get effectiveType(){return i.Types.RichText}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:i.Types.Boolean,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Boolean,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Boolean}get effectiveType(){return i.Types.Boolean}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:i.Types.Error,f:class{constructor(a,h){this.model={address:a.address,type:i.Types.Error,value:h}}get value(){return this.model.value}set value(a){this.model.value=a}get type(){return i.Types.Error}get effectiveType(){return i.Types.Error}get address(){return this.model.address}set address(a){this.model.address=a}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((a,h)=>(a[h.t]=h.f,a),[]),create(a,h,p){const m=this.types[a];if(!m)throw new Error("Could not create Value of type "+a);return new m(h,p)}};l.exports=i},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(t,l,c){const o=t("../utils/under-dash"),r=t("./enums"),n=t("../utils/col-cache");class s{constructor(i,u,a){this._worksheet=i,this._number=u,a!==!1&&(this.defn=a)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return n.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(i){i?(this.key=i.key,this.width=i.width!==void 0?i.width:9,this.outlineLevel=i.outlineLevel,i.style?this.style=i.style:this.style={},this.header=i.header,this._hidden=!!i.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(i){i!==void 0?(this._header=i,this.headers.forEach((u,a)=>{this._worksheet.getCell(a+1,this.number).value=u})):this._header=void 0}get key(){return this._key}set key(i){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=i,i&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(i){this._hidden=i}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(i){this._outlineLevel=i}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(i){return this.width===i.width&&this.hidden===i.hidden&&this.outlineLevel===i.outlineLevel&&o.isEqual(this.style,i.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const i=this.style;return!i||!(i.font||i.numFmt||i.alignment||i.border||i.fill||i.protection)}get headerCount(){return this.headers.length}eachCell(i,u){const a=this.number;u||(u=i,i=null),this._worksheet.eachRow(i,(h,p)=>{u(h.getCell(a),p)})}get values(){const i=[];return this.eachCell((u,a)=>{u&&u.type!==r.ValueType.Null&&(i[a]=u.value)}),i}set values(i){if(!i)return;const u=this.number;let a=0;i.hasOwnProperty("0")&&(a=1),i.forEach((h,p)=>{this._worksheet.getCell(p+a,u).value=h})}_applyStyle(i,u){return this.style[i]=u,this.eachCell(a=>{a[i]=u}),u}get numFmt(){return this.style.numFmt}set numFmt(i){this._applyStyle("numFmt",i)}get font(){return this.style.font}set font(i){this._applyStyle("font",i)}get alignment(){return this.style.alignment}set alignment(i){this._applyStyle("alignment",i)}get protection(){return this.style.protection}set protection(i){this._applyStyle("protection",i)}get border(){return this.style.border}set border(i){this._applyStyle("border",i)}get fill(){return this.style.fill}set fill(i){this._applyStyle("fill",i)}static toModel(i){const u=[];let a=null;return i&&i.forEach((h,p)=>{h.isDefault?a&&(a=null):a&&h.equivalentTo(a)?a.max=p+1:(a={min:p+1,max:p+1,width:h.width!==void 0?h.width:9,style:h.style,isCustomWidth:h.isCustomWidth,hidden:h.hidden,outlineLevel:h.outlineLevel,collapsed:h.collapsed},u.push(a))}),u.length?u:void 0}static fromModel(i,u){const a=[];let h=1,p=0;for(u=(u=u||[]).sort((function(m,d){return m.min-d.min}));p<u.length;){const m=u[p++];for(;h<m.min;)a.push(new s(i,h++));for(;h<=m.max;)a.push(new s(i,h++,m))}return a.length?a:null}}l.exports=s},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(t,l,c){l.exports=class{constructor(o){this.model=o||{}}add(o,r){return this.model[o]=r}find(o){return this.model[o]}remove(o){this.model[o]=void 0}}},{}],6:[function(t,l,c){const o=t("../utils/under-dash"),r=t("../utils/col-cache"),n=t("../utils/cell-matrix"),s=t("./range"),e=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;l.exports=class{constructor(){this.matrixMap={}}getMatrix(i){return this.matrixMap[i]||(this.matrixMap[i]=new n)}add(i,u){const a=r.decodeEx(i);this.addEx(a,u)}addEx(i,u){const a=this.getMatrix(u);if(i.top)for(let h=i.left;h<=i.right;h++)for(let p=i.top;p<=i.bottom;p++){const m={sheetName:i.sheetName,address:r.n2l(h)+p,row:p,col:h};a.addCellEx(m)}else a.addCellEx(i)}remove(i,u){const a=r.decodeEx(i);this.removeEx(a,u)}removeEx(i,u){this.getMatrix(u).removeCellEx(i)}removeAllNames(i){o.each(this.matrixMap,u=>{u.removeCellEx(i)})}forEach(i){o.each(this.matrixMap,(u,a)=>{u.forEach(h=>{i(a,h)})})}getNames(i){return this.getNamesEx(r.decodeEx(i))}getNamesEx(i){return o.map(this.matrixMap,(u,a)=>u.findCellEx(i)&&a).filter(Boolean)}_explore(i,u){u.mark=!1;const{sheetName:a}=u,h=new s(u.row,u.col,u.row,u.col,a);let p,m;function d(g,S){const C=i.findCellAt(a,g,u.col);return!(!C||!C.mark)&&(h[S]=g,C.mark=!1,!0)}for(m=u.row-1;d(m,"top");m--);for(m=u.row+1;d(m,"bottom");m++);function b(g,S){const C=[];for(m=h.top;m<=h.bottom;m++){const I=i.findCellAt(a,m,g);if(!I||!I.mark)return!1;C.push(I)}h[S]=g;for(let I=0;I<C.length;I++)C[I].mark=!1;return!0}for(p=u.col-1;b(p,"left");p--);for(p=u.col+1;b(p,"right");p++);return h}getRanges(i,u){return(u=u||this.matrixMap[i])?(u.forEach(a=>{a.mark=!0}),{name:i,ranges:u.map(a=>a.mark&&this._explore(u,a)).filter(Boolean).map(a=>a.$shortRange)}):{name:i,ranges:[]}}normaliseMatrix(i,u){i.forEachInSheet(u,(a,h,p)=>{a&&(a.row===h&&a.col===p||(a.row=h,a.col=p,a.address=r.n2l(p)+h))})}spliceRows(i,u,a,h){o.each(this.matrixMap,p=>{p.spliceRows(i,u,a,h),this.normaliseMatrix(p,i)})}spliceColumns(i,u,a,h){o.each(this.matrixMap,p=>{p.spliceColumns(i,u,a,h),this.normaliseMatrix(p,i)})}get model(){return o.map(this.matrixMap,(i,u)=>this.getRanges(u,i)).filter(i=>i.ranges.length)}set model(i){const u=this.matrixMap={};i.forEach(a=>{const h=u[a.name]=new n;a.ranges.forEach(p=>{e.test(p.split("!").pop()||"")&&h.addCell(p)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(t,l,c){l.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(t,l,c){const o=t("../utils/col-cache"),r=t("./anchor");l.exports=class{constructor(n,s){this.worksheet=n,this.model=s}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(n){let{type:s,imageId:e,range:i,hyperlinks:u}=n;if(this.type=s,this.imageId=e,s==="image")if(typeof i=="string"){const a=o.decode(i);this.range={tl:new r(this.worksheet,{col:a.left,row:a.top},-1),br:new r(this.worksheet,{col:a.right,row:a.bottom},0),editAs:"oneCell"}}else this.range={tl:new r(this.worksheet,i.tl,0),br:i.br&&new r(this.worksheet,i.br,0),ext:i.ext,editAs:i.editAs,hyperlinks:u||i.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(t,l,c){const o=t("../utils/under-dash");class r{constructor(s){this.note=s}get model(){let s=null;switch(typeof this.note){case"string":s={type:"note",note:{texts:[{text:this.note}]}};break;default:s={type:"note",note:this.note}}return o.deepMerge({},r.DEFAULT_CONFIGS,s)}set model(s){const{note:e}=s,{texts:i}=e;i.length===1&&Object.keys(i[0]).length===1?this.note=i[0].text:this.note=e}static fromModel(s){const e=new r;return e.model=s,e}}r.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},l.exports=r},{"../utils/under-dash":26}],10:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(){this.decode(arguments)}setTLBR(s,e,i,u,a){if(arguments.length<4){const h=o.decodeAddress(s),p=o.decodeAddress(e);this.model={top:Math.min(h.row,p.row),left:Math.min(h.col,p.col),bottom:Math.max(h.row,p.row),right:Math.max(h.col,p.col),sheetName:i},this.setTLBR(h.row,h.col,p.row,p.col,a)}else this.model={top:Math.min(s,i),left:Math.min(e,u),bottom:Math.max(s,i),right:Math.max(e,u),sheetName:a}}decode(s){switch(s.length){case 5:this.setTLBR(s[0],s[1],s[2],s[3],s[4]);break;case 4:this.setTLBR(s[0],s[1],s[2],s[3]);break;case 3:this.setTLBR(s[0],s[1],s[2]);break;case 2:this.setTLBR(s[0],s[1]);break;case 1:{const e=s[0];if(e instanceof r)this.model={top:e.model.top,left:e.model.left,bottom:e.model.bottom,right:e.model.right,sheetName:e.sheetName};else if(e instanceof Array)this.decode(e);else if(e.top&&e.left&&e.bottom&&e.right)this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName};else{const i=o.decodeEx(e);i.top?this.model={top:i.top,left:i.left,bottom:i.bottom,right:i.right,sheetName:i.sheetName}:this.model={top:i.row,left:i.col,bottom:i.row,right:i.col,sheetName:i.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+s.length)}}get top(){return this.model.top||1}set top(s){this.model.top=s}get left(){return this.model.left||1}set left(s){this.model.left=s}get bottom(){return this.model.bottom||1}set bottom(s){this.model.bottom=s}get right(){return this.model.right||1}set right(s){this.model.right=s}get sheetName(){return this.model.sheetName}set sheetName(s){this.model.sheetName=s}get _serialisedSheetName(){const{sheetName:s}=this.model;return s?/^[a-zA-Z0-9]*$/.test(s)?s+"!":`'${s}'!`:""}expand(s,e,i,u){(!this.model.top||s<this.top)&&(this.top=s),(!this.model.left||e<this.left)&&(this.left=e),(!this.model.bottom||i>this.bottom)&&(this.bottom=i),(!this.model.right||u>this.right)&&(this.right=u)}expandRow(s){if(s){const{dimensions:e,number:i}=s;e&&this.expand(i,e.min,i,e.max)}}expandToAddress(s){const e=o.decodeEx(s);this.expand(e.row,e.col,e.row,e.col)}get tl(){return o.n2l(this.left)+this.top}get $t$l(){return`$${o.n2l(this.left)}$${this.top}`}get br(){return o.n2l(this.right)+this.bottom}get $b$r(){return`$${o.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&!(s.bottom<this.top)&&!(s.top>this.bottom)&&!(s.right<this.left)&&!(s.left>this.right)}contains(s){const e=o.decodeEx(s);return this.containsEx(e)}containsEx(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&s.row>=this.top&&s.row<=this.bottom&&s.col>=this.left&&s.col<=this.right}forEachAddress(s){for(let e=this.left;e<=this.right;e++)for(let i=this.top;i<=this.bottom;i++)s(o.encodeAddress(i,e),i,e)}}l.exports=r},{"../utils/col-cache":19}],11:[function(t,l,c){const o=t("../utils/under-dash"),r=t("./enums"),n=t("../utils/col-cache"),s=t("./cell");l.exports=class{constructor(e,i){this._worksheet=e,this._number=i,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let i=this._cells[e.col-1];if(!i){const u=this._worksheet.getColumn(e.col);i=new s(this,u,e.address),this._cells[e.col-1]=i}return i}getCell(e){if(typeof e=="string"){const i=this._worksheet.getColumnKey(e);e=i?i.number:n.l2n(e)}return this._cells[e-1]||this.getCellEx({address:n.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,i){const u=e+i;for(var a=arguments.length,h=new Array(a>2?a-2:0),p=2;p<a;p++)h[p-2]=arguments[p];const m=h.length-i,d=this._cells.length;let b,g,S;if(m<0)for(b=e+h.length;b<=d;b++)S=this._cells[b-1],g=this._cells[b-m-1],g?(S=this.getCell(b),S.value=g.value,S.style=g.style,S._comment=g._comment):S&&(S.value=null,S.style={},S._comment=void 0);else if(m>0)for(b=d;b>=u;b--)g=this._cells[b-1],g?(S=this.getCell(b+m),S.value=g.value,S.style=g.style,S._comment=g._comment):this._cells[b+m-1]=void 0;for(b=0;b<h.length;b++)S=this.getCell(e+b),S.value=h[b],S.style={},S._comment=void 0}eachCell(e,i){if(i||(i=e,e=null),e&&e.includeEmpty){const u=this._cells.length;for(let a=1;a<=u;a++)i(this.getCell(a),a)}else this._cells.forEach((u,a)=>{u&&u.type!==r.ValueType.Null&&i(u,a+1)})}addPageBreak(e,i){const u=this._worksheet,a=Math.max(0,e-1)||0,h=Math.max(0,i-1)||16838,p={id:this._number,max:h,man:1};a&&(p.min=a),u.rowBreaks.push(p)}get values(){const e=[];return this._cells.forEach(i=>{i&&i.type!==r.ValueType.Null&&(e[i.col]=i.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let i=0;e.hasOwnProperty("0")&&(i=1),e.forEach((u,a)=>{u!==void 0&&(this.getCellEx({address:n.encodeAddress(this._number,a+i),row:this._number,col:a+i}).value=u)})}else this._worksheet.eachColumnKey((i,u)=>{e[u]!==void 0&&(this.getCellEx({address:n.encodeAddress(this._number,i.number),row:this._number,col:i.number}).value=e[u])})}get hasValues(){return o.some(this._cells,e=>e&&e.type!==r.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,i=0;return this._cells.forEach(u=>{u&&u.type!==r.ValueType.Null&&((!e||e>u.col)&&(e=u.col),i<u.col&&(i=u.col))}),e>0?{min:e,max:i}:null}_applyStyle(e,i){return this.style[e]=i,this._cells.forEach(u=>{u&&(u[e]=i)}),i}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const e=[];let i=0,u=0;return this._cells.forEach(a=>{if(a){const h=a.model;h&&((!i||i>a.col)&&(i=a.col),u<a.col&&(u=a.col),e.push(h))}}),this.height||e.length?{cells:e,number:this.number,min:i,max:u,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(e){if(e.number!==this._number)throw new Error("Invalid row number in model");let i;this._cells=[],e.cells.forEach(u=>{switch(u.type){case s.Types.Merge:break;default:{let a;if(u.address)a=n.decodeAddress(u.address);else if(i){const{row:h}=i,p=i.col+1;a={row:h,col:p,address:n.encodeAddress(h,p),$col$row:`$${n.n2l(p)}$${h}`}}i=a,this.getCellEx(a).model=u;break}}}),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(t,l,c){const o=t("../utils/col-cache");class r{constructor(s,e,i){this.table=s,this.column=e,this.index=i}_set(s,e){this.table.cacheState(),this.column[s]=e}get name(){return this.column.name}set name(s){this._set("name",s)}get filterButton(){return this.column.filterButton}set filterButton(s){this.column.filterButton=s}get style(){return this.column.style}set style(s){this.column.style=s}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(s){this._set("totalsRowLabel",s)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(s){this._set("totalsRowFunction",s)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(s){this._set("totalsRowResult",s)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(s){this._set("totalsRowFormula",s)}}l.exports=class{constructor(n,s){this.worksheet=n,s&&(this.table=s,this.validate(),this.store())}getFormula(n){switch(n.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${n.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${n.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${n.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${n.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${n.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${n.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${n.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${n.name}])`;case"custom":return n.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+n.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:n}=this,s=(m,d,b)=>{m[d]===void 0&&(m[d]=b)};s(n,"headerRow",!0),s(n,"totalsRow",!1),s(n,"style",{}),s(n.style,"theme","TableStyleMedium2"),s(n.style,"showFirstColumn",!1),s(n.style,"showLastColumn",!1),s(n.style,"showRowStripes",!1),s(n.style,"showColumnStripes",!1);const e=(m,d)=>{if(!m)throw new Error(d)};e(n.ref,"Table must have ref"),e(n.columns,"Table must have column definitions"),e(n.rows,"Table must have row definitions"),n.tl=o.decodeAddress(n.ref);const{row:i,col:u}=n.tl;e(i>0,"Table must be on valid row"),e(u>0,"Table must be on valid col");const{width:a,filterHeight:h,tableHeight:p}=this;n.autoFilterRef=o.encode(i,u,i+h-1,u+a-1),n.tableRef=o.encode(i,u,i+p-1,u+a-1),n.columns.forEach((m,d)=>{e(m.name,`Column ${d} must have a name`),d===0?s(m,"totalsRowLabel","Total"):(s(m,"totalsRowFunction","none"),m.totalsRowFormula=this.getFormula(m))})}store(){const n=(h,p)=>{p&&Object.keys(p).forEach(m=>{h[m]=p[m]})},{worksheet:s,table:e}=this,{row:i,col:u}=e.tl;let a=0;if(e.headerRow){const h=s.getRow(i+a++);e.columns.forEach((p,m)=>{const{style:d,name:b}=p,g=h.getCell(u+m);g.value=b,n(g,d)})}if(e.rows.forEach(h=>{const p=s.getRow(i+a++);h.forEach((m,d)=>{const b=p.getCell(u+d);b.value=m,n(b,e.columns[d].style)})}),e.totalsRow){const h=s.getRow(i+a++);e.columns.forEach((p,m)=>{const d=h.getCell(u+m);if(m===0)d.value=p.totalsRowLabel;else{const b=this.getFormula(p);d.value=b?{formula:p.totalsRowFormula,result:p.totalsRowResult}:null}n(d,p.style)})}}load(n){const{table:s}=this,{row:e,col:i}=s.tl;let u=0;if(s.headerRow){const a=n.getRow(e+u++);s.columns.forEach((h,p)=>{a.getCell(i+p).value=h.name})}if(s.rows.forEach(a=>{const h=n.getRow(e+u++);a.forEach((p,m)=>{h.getCell(i+m).value=p})}),s.totalsRow){const a=n.getRow(e+u++);s.columns.forEach((h,p)=>{const m=a.getCell(i+p);p===0?m.value=h.totalsRowLabel:this.getFormula(h)&&(m.value={formula:h.totalsRowFormula,result:h.totalsRowResult})})}}get model(){return this.table}set model(n){this.table=n}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const n=o.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let s=0;s<this._cache.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=0;i<this._cache.width;i++)e.getCell(n.col+i).value=null}else{for(let s=this.tableHeight;s<this._cache.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=0;i<this._cache.width;i++)e.getCell(n.col+i).value=null}for(let s=0;s<this.tableHeight;s++){const e=this.worksheet.getRow(n.row+s);for(let i=this.width;i<this._cache.width;i++)e.getCell(n.col+i).value=null}}this.store()}addRow(n,s){this.cacheState(),s===void 0?this.table.rows.push(n):this.table.rows.splice(s,0,n)}removeRows(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(n,s)}getColumn(n){const s=this.table.columns[n];return new r(this,s,n)}addColumn(n,s,e){this.cacheState(),e===void 0?(this.table.columns.push(n),this.table.rows.forEach((i,u)=>{i.push(s[u])})):(this.table.columns.splice(e,0,n),this.table.rows.forEach((i,u)=>{i.splice(e,0,s[u])}))}removeColumns(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(n,s),this.table.rows.forEach(e=>{e.splice(n,s)})}_assign(n,s,e){this.cacheState(),n[s]=e}get ref(){return this.table.ref}set ref(n){this._assign(this.table,"ref",n)}get name(){return this.table.name}set name(n){this.table.name=n}get displayName(){return this.table.displyName||this.table.name}set displayNamename(n){this.table.displayName=n}get headerRow(){return this.table.headerRow}set headerRow(n){this._assign(this.table,"headerRow",n)}get totalsRow(){return this.table.totalsRow}set totalsRow(n){this._assign(this.table,"totalsRow",n)}get theme(){return this.table.style.name}set theme(n){this.table.style.name=n}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(n){this.table.style.showFirstColumn=n}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(n){this.table.style.showLastColumn=n}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(n){this.table.style.showRowStripes=n}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(n){this.table.style.showColumnStripes=n}}},{"../utils/col-cache":19}],13:[function(t,l,c){const o=t("./worksheet"),r=t("./defined-names"),n=t("../xlsx/xlsx"),s=t("../csv/csv");l.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new r}get xlsx(){return this._xlsx||(this._xlsx=new n(this)),this._xlsx}get csv(){return this._csv||(this._csv=new s(this)),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,i){const u=this.nextId;i&&(typeof i=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),i={properties:{tabColor:{argb:i}}}):(i.argb||i.theme||i.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),i={properties:{tabColor:i}}));const a=this._worksheets.reduce((m,d)=>(d&&d.orderNo)>m?d.orderNo:m,0),h=Object.assign({},i,{id:u,name:e,orderNo:a+1,workbook:this}),p=new o(h);return this._worksheets[u]=p,p}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){const i=this.getWorksheet(e);i&&i.destroy()}getWorksheet(e){return e===void 0?this._worksheets.find(Boolean):typeof e=="number"?this._worksheets[e]:typeof e=="string"?this._worksheets.find(i=>i&&i.name===e):void 0}get worksheets(){return this._worksheets.slice(1).sort((e,i)=>e.orderNo-i.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(i=>{e(i,i.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){const i=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),i}getImage(e){return this.media[e]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(i=>{const{id:u,name:a,state:h}=i,p=e.sheets&&e.sheets.findIndex(m=>m.id===u);(this._worksheets[u]=new o({id:u,name:a,orderNo:p,state:h,workbook:this})).model=i}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(t,l,c){const o=t("../utils/under-dash"),r=t("../utils/col-cache"),n=t("./range"),s=t("./row"),e=t("./column"),i=t("./enums"),u=t("./image"),a=t("./table"),h=t("./data-validations"),p=t("../utils/encryptor"),{copyStyle:m}=t("../utils/copy-style");l.exports=class{constructor(d){d=d||{},this._workbook=d.workbook,this.id=d.id,this.orderNo=d.orderNo,this.name=d.name,this.state=d.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},d.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!d.pageSetup||!d.pageSetup.fitToWidth&&!d.pageSetup.fitToHeight||d.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},d.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},d.headerFooter),this.dataValidations=new h,this.views=d.views||[],this.autoFilter=d.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(d){if(d===void 0&&(d="sheet"+this.id),this._name!==d){if(typeof d!="string")throw new Error("The name has to be a string.");if(d==="")throw new Error("The name can't be empty.");if(d==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(d))throw new Error(`Worksheet name ${d} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(d))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+d);if(d&&d.length>31&&(console.warn(`Worksheet name ${d} exceeds 31 chars. This will be truncated`),d=d.substring(0,31)),this._workbook._worksheets.find(b=>b&&b.name.toLowerCase()===d.toLowerCase()))throw new Error("Worksheet name already exists: "+d);this._name=d}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const d=new n;return this._rows.forEach(b=>{if(b){const g=b.dimensions;g&&d.expand(b.number,g.min,b.number,g.max)}}),d}get columns(){return this._columns}set columns(d){this._headerRowCount=d.reduce((S,C)=>{const I=(C.header?1:C.headers&&C.headers.length)||0;return Math.max(S,I)},0);let b=1;const g=this._columns=[];d.forEach(S=>{const C=new e(this,b++,!1);g.push(C),C.defn=S})}getColumnKey(d){return this._keys[d]}setColumnKey(d,b){this._keys[d]=b}deleteColumnKey(d){delete this._keys[d]}eachColumnKey(d){o.each(this._keys,d)}getColumn(d){if(typeof d=="string"){const b=this._keys[d];if(b)return b;d=r.l2n(d)}if(this._columns||(this._columns=[]),d>this._columns.length){let b=this._columns.length+1;for(;b<=d;)this._columns.push(new e(this,b++))}return this._columns[d-1]}spliceColumns(d,b){const g=this._rows.length;for(var S=arguments.length,C=new Array(S>2?S-2:0),I=2;I<S;I++)C[I-2]=arguments[I];if(C.length>0)for(let B=0;B<g;B++){const F=[d,b];C.forEach(q=>{F.push(q[B]||null)});const W=this.getRow(B+1);W.splice.apply(W,F)}else this._rows.forEach(B=>{B&&B.splice(d,b)});const D=C.length-b,z=d+b,P=this._columns.length;if(D<0)for(let B=d+C.length;B<=P;B++)this.getColumn(B).defn=this.getColumn(B-D).defn;else if(D>0)for(let B=P;B>=z;B--)this.getColumn(B+D).defn=this.getColumn(B).defn;for(let B=d;B<d+C.length;B++)this.getColumn(B).defn=null;this.workbook.definedNames.spliceColumns(this.name,d,b,C.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let d=0;return this.eachRow(b=>{d=Math.max(d,b.cellCount)}),d}get actualColumnCount(){const d=[];let b=0;return this.eachRow(g=>{g.eachCell(S=>{let{col:C}=S;d[C]||(d[C]=!0,b++)})}),b}_commitRow(){}get _lastRowNumber(){const d=this._rows;let b=d.length;for(;b>0&&d[b-1]===void 0;)b--;return b}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(d){return this._rows[d-1]}findRows(d,b){return this._rows.slice(d-1,d-1+b)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let d=0;return this.eachRow(()=>{d++}),d}getRow(d){let b=this._rows[d-1];return b||(b=this._rows[d-1]=new s(this,d)),b}getRows(d,b){if(b<1)return;const g=[];for(let S=d;S<d+b;S++)g.push(this.getRow(S));return g}addRow(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const g=this._nextRow,S=this.getRow(g);return S.values=d,this._setStyleOption(g,b[0]==="i"?b:"n"),S}addRows(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const g=[];return d.forEach(S=>{g.push(this.addRow(S,b))}),g}insertRow(d,b){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(d,0,b),this._setStyleOption(d,g),this.getRow(d)}insertRows(d,b){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(d,0,...b),g!=="n")for(let S=0;S<b.length;S++)g[0]==="o"&&this.findRow(b.length+d+S)!==void 0?this._copyStyle(b.length+d+S,d+S,g[1]==="+"):g[0]==="i"&&this.findRow(d-1)!==void 0&&this._copyStyle(d-1,d+S,g[1]==="+");return this.getRows(d,b.length)}_setStyleOption(d){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";b[0]==="o"&&this.findRow(d+1)!==void 0?this._copyStyle(d+1,d,b[1]==="+"):b[0]==="i"&&this.findRow(d-1)!==void 0&&this._copyStyle(d-1,d,b[1]==="+")}_copyStyle(d,b){let g=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const S=this.getRow(d),C=this.getRow(b);C.style=m(S.style),S.eachCell({includeEmpty:g},(I,D)=>{C.getCell(D).style=m(I.style)}),C.height=S.height}duplicateRow(d,b){let g=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const S=this._rows[d-1],C=new Array(b).fill(S.values);this.spliceRows(d+1,g?0:b,...C);for(let I=0;I<b;I++){const D=this._rows[d+I];D.style=S.style,D.height=S.height,S.eachCell({includeEmpty:!0},(z,P)=>{D.getCell(P).style=z.style})}}spliceRows(d,b){const g=d+b;for(var S=arguments.length,C=new Array(S>2?S-2:0),I=2;I<S;I++)C[I-2]=arguments[I];const D=C.length,z=D-b,P=this._rows.length;let B,F;if(z<0)for(d===P&&(this._rows[P-1]=void 0),B=g;B<=P;B++)if(F=this._rows[B-1],F){const W=this.getRow(B+z);W.values=F.values,W.style=F.style,W.height=F.height,F.eachCell({includeEmpty:!0},(q,A)=>{W.getCell(A).style=q.style}),this._rows[B-1]=void 0}else this._rows[B+z-1]=void 0;else if(z>0)for(B=P;B>=g;B--)if(F=this._rows[B-1],F){const W=this.getRow(B+z);W.values=F.values,W.style=F.style,W.height=F.height,F.eachCell({includeEmpty:!0},(q,A)=>{if(W.getCell(A).style=q.style,q._value.constructor.name==="MergeValue"){const M=this.getRow(q._row._number+D).getCell(A),k=q._value._master,y=this.getRow(k._row._number+D).getCell(k._column._number);M.merge(y)}})}else this._rows[B+z-1]=void 0;for(B=0;B<D;B++){const W=this.getRow(d+B);W.style={},W.values=C[B]}this.workbook.definedNames.spliceRows(this.name,d,b,D)}eachRow(d,b){if(b||(b=d,d=void 0),d&&d.includeEmpty){const g=this._rows.length;for(let S=1;S<=g;S++)b(this.getRow(S),S)}else this._rows.forEach(g=>{g&&g.hasValues&&b(g,g.number)})}getSheetValues(){const d=[];return this._rows.forEach(b=>{b&&(d[b.number]=b.values)}),d}findCell(d,b){const g=r.getAddress(d,b),S=this._rows[g.row-1];return S?S.findCell(g.col):void 0}getCell(d,b){const g=r.getAddress(d,b);return this.getRow(g.row).getCellEx(g)}mergeCells(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);this._mergeCellsInternal(S)}mergeCellsWithoutStyle(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);this._mergeCellsInternal(S,!0)}_mergeCellsInternal(d,b){o.each(this._merges,S=>{if(S.intersects(d))throw new Error("Cannot merge already merged cells")});const g=this.getCell(d.top,d.left);for(let S=d.top;S<=d.bottom;S++)for(let C=d.left;C<=d.right;C++)(S>d.top||C>d.left)&&this.getCell(S,C).merge(g,b);this._merges[g.address]=d}_unMergeMaster(d){const b=this._merges[d.address];if(b){for(let g=b.top;g<=b.bottom;g++)for(let S=b.left;S<=b.right;S++)this.getCell(g,S).unmerge();delete this._merges[d.address]}}get hasMerges(){return o.some(this._merges,Boolean)}unMergeCells(){for(var d=arguments.length,b=new Array(d),g=0;g<d;g++)b[g]=arguments[g];const S=new n(b);for(let C=S.top;C<=S.bottom;C++)for(let I=S.left;I<=S.right;I++){const D=this.findCell(C,I);D&&(D.type===i.ValueType.Merge?this._unMergeMaster(D.master):this._merges[D.address]&&this._unMergeMaster(D))}}fillFormula(d,b,g){let S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared";const C=r.decode(d),{top:I,left:D,bottom:z,right:P}=C,B=P-D+1,F=r.encodeAddress(I,D),W=S==="shared";let q;q=typeof g=="function"?g:Array.isArray(g)?Array.isArray(g[0])?(M,k)=>g[M-I][k-D]:(M,k)=>g[(M-I)*B+(k-D)]:()=>{};let A=!0;for(let M=I;M<=z;M++)for(let k=D;k<=P;k++)A?(this.getCell(M,k).value={shareType:S,formula:b,ref:d,result:q(M,k)},A=!1):this.getCell(M,k).value=W?{sharedFormula:F,result:q(M,k)}:q(M,k)}addImage(d,b){const g={type:"image",imageId:d,range:b};this._media.push(new u(this,g))}getImages(){return this._media.filter(d=>d.type==="image")}addBackgroundImage(d){const b={type:"background",imageId:d};this._media.push(new u(this,b))}getBackgroundImageId(){const d=this._media.find(b=>b.type==="background");return d&&d.imageId}protect(d,b){return new Promise(g=>{this.sheetProtection={sheet:!0},b&&"spinCount"in b&&(b.spinCount=Number.isFinite(b.spinCount)?Math.round(Math.max(0,b.spinCount)):1e5),d&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=p.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=b&&"spinCount"in b?b.spinCount:1e5,this.sheetProtection.hashValue=p.convertPasswordToHash(d,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),b&&(this.sheetProtection=Object.assign(this.sheetProtection,b),!d&&"spinCount"in b&&delete this.sheetProtection.spinCount),g()})}unprotect(){this.sheetProtection=null}addTable(d){const b=new a(this,d);return this.tables[d.name]=b,b}getTable(d){return this.tables[d]}removeTable(d){delete this.tables[d]}getTables(){return Object.values(this.tables)}addConditionalFormatting(d){this.conditionalFormattings.push(d)}removeConditionalFormatting(d){typeof d=="number"?this.conditionalFormattings.splice(d,1):this.conditionalFormattings=d instanceof Function?this.conditionalFormattings.filter(d):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(d){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=d}get model(){const d={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(S=>S.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(S=>S.model),conditionalFormattings:this.conditionalFormattings};d.cols=e.toModel(this.columns);const b=d.rows=[],g=d.dimensions=new n;return this._rows.forEach(S=>{const C=S&&S.model;C&&(g.expand(C.number,C.min,C.number,C.max),b.push(C))}),d.merges=[],o.each(this._merges,S=>{d.merges.push(S.range)}),d}_parseRows(d){this._rows=[],d.rows.forEach(b=>{const g=new s(this,b.number);this._rows[g.number-1]=g,g.model=b})}_parseMergeCells(d){o.each(d.mergeCells,b=>{this.mergeCellsWithoutStyle(b)})}set model(d){this.name=d.name,this._columns=e.fromModel(this,d.cols),this._parseRows(d),this._parseMergeCells(d),this.dataValidations=new h(d.dataValidations),this.properties=d.properties,this.pageSetup=d.pageSetup,this.headerFooter=d.headerFooter,this.views=d.views,this.autoFilter=d.autoFilter,this._media=d.media.map(b=>new u(this,b)),this.sheetProtection=d.sheetProtection,this.tables=d.tables.reduce((b,g)=>{const S=new a;return S.model=g,b[g.name]=S,b},{}),this.conditionalFormattings=d.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(t,l,c){t("core-js/modules/es.promise"),t("core-js/modules/es.promise.finally"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.keys"),t("core-js/modules/es.object.values"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.async-iterator"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.includes"),t("core-js/modules/es.array.find-index"),t("core-js/modules/es.array.find"),t("core-js/modules/es.string.from-code-point"),t("core-js/modules/es.string.includes"),t("core-js/modules/es.number.is-nan"),t("regenerator-runtime/runtime");const o={Workbook:t("./doc/workbook")},r=t("./doc/enums");Object.keys(r).forEach(n=>{o[n]=r[n]}),l.exports=o},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(t,l,c){const o=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");c.bufferToString=function(r){return typeof r=="string"?r:o?o.decode(r):r.toString()}},{}],17:[function(t,l,c){const o=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:r}=t("buffer");c.stringToBuffer=function(n){return typeof n!="string"?n:o?r.from(o.encode(n).buffer):r.from(n)}},{buffer:220}],18:[function(t,l,c){const o=t("./under-dash"),r=t("./col-cache");l.exports=class{constructor(n){this.template=n,this.sheets={}}addCell(n){this.addCellEx(r.decodeEx(n))}getCell(n){return this.findCellEx(r.decodeEx(n),!0)}findCell(n){return this.findCellEx(r.decodeEx(n),!1)}findCellAt(n,s,e){const i=this.sheets[n],u=i&&i[s];return u&&u[e]}addCellEx(n){if(n.top)for(let s=n.top;s<=n.bottom;s++)for(let e=n.left;e<=n.right;e++)this.getCellAt(n.sheetName,s,e);else this.findCellEx(n,!0)}getCellEx(n){return this.findCellEx(n,!0)}findCellEx(n,s){const e=this.findSheet(n,s),i=this.findSheetRow(e,n,s);return this.findRowCell(i,n,s)}getCellAt(n,s,e){const i=this.sheets[n]||(this.sheets[n]=[]),u=i[s]||(i[s]=[]);return u[e]||(u[e]={sheetName:n,address:r.n2l(e)+s,row:s,col:e})}removeCellEx(n){const s=this.findSheet(n);if(!s)return;const e=this.findSheetRow(s,n);e&&delete e[n.col]}forEachInSheet(n,s){const e=this.sheets[n];e&&e.forEach((i,u)=>{i&&i.forEach((a,h)=>{a&&s(a,u,h)})})}forEach(n){o.each(this.sheets,(s,e)=>{this.forEachInSheet(e,n)})}map(n){const s=[];return this.forEach(e=>{s.push(n(e))}),s}findSheet(n,s){const e=n.sheetName;return this.sheets[e]?this.sheets[e]:s?this.sheets[e]=[]:void 0}findSheetRow(n,s,e){const{row:i}=s;return n&&n[i]?n[i]:e?n[i]=[]:void 0}findRowCell(n,s,e){const{col:i}=s;return n&&n[i]?n[i]:e?n[i]=this.template?Object.assign(s,JSON.parse(JSON.stringify(this.template))):s:void 0}spliceRows(n,s,e,i){const u=this.sheets[n];if(u){const a=[];for(let h=0;h<i;h++)a.push([]);u.splice(s,e,...a)}}spliceColumns(n,s,e,i){const u=this.sheets[n];if(u){const a=[];for(let h=0;h<i;h++)a.push(null);o.each(u,h=>{h.splice(s,e,...a)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(t,l,c){const o=/^[A-Z]+\d+$/,r={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:n=>n<=26?1:n<=676?2:3,_fill(n){let s,e,i,u,a,h=1;if(n>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&n>=1){for(;h<=26;)s=this._dictionary[h-1],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=1}if(this._l2nFill<2&&n>=2){for(h=27;h<=702;)e=h-27,i=e%26,u=Math.floor(e/26),s=this._dictionary[u]+this._dictionary[i],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=2}if(this._l2nFill<3&&n>=3){for(h=703;h<=16384;)e=h-703,i=e%26,u=Math.floor(e/26)%26,a=Math.floor(e/676),s=this._dictionary[a]+this._dictionary[u]+this._dictionary[i],this._n2l[h]=s,this._l2n[s]=h,h++;this._l2nFill=3}},l2n(n){if(this._l2n[n]||this._fill(n.length),!this._l2n[n])throw new Error("Out of bounds. Invalid column letter: "+n);return this._l2n[n]},n2l(n){if(n<1||n>16384)throw new Error(n+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[n]||this._fill(this._level(n)),this._n2l[n]},_hash:{},validateAddress(n){if(!o.test(n))throw new Error("Invalid Address: "+n);return!0},decodeAddress(n){const s=n.length<5&&this._hash[n];if(s)return s;let e=!1,i="",u=0,a=!1,h="",p=0;for(let d,b=0;b<n.length;b++)if(d=n.charCodeAt(b),!a&&d>=65&&d<=90)e=!0,i+=n[b],u=26*u+d-64;else if(d>=48&&d<=57)a=!0,h+=n[b],p=10*p+d-48;else if(a&&e&&d!==36)break;if(e){if(u>16384)throw new Error("Out of bounds. Invalid column letter: "+i)}else u=void 0;a||(p=void 0);const m={address:n=i+h,col:u,row:p,$col$row:`$${i}$${h}`};return u<=100&&p<=100&&(this._hash[n]=m,this._hash[m.$col$row]=m),m},getAddress(n,s){if(s){const e=this.n2l(s)+n;return this.decodeAddress(e)}return this.decodeAddress(n)},decode(n){const s=n.split(":");if(s.length===2){const e=this.decodeAddress(s[0]),i=this.decodeAddress(s[1]),u={top:Math.min(e.row,i.row),left:Math.min(e.col,i.col),bottom:Math.max(e.row,i.row),right:Math.max(e.col,i.col)};return u.tl=this.n2l(u.left)+u.top,u.br=this.n2l(u.right)+u.bottom,u.dimensions=`${u.tl}:${u.br}`,u}return this.decodeAddress(n)},decodeEx(n){const s=n.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),e=s[1]||s[2],i=s[3],u=i.split(":");if(u.length>1){let h=this.decodeAddress(u[0]),p=this.decodeAddress(u[1]);const m=Math.min(h.row,p.row),d=Math.min(h.col,p.col),b=Math.max(h.row,p.row),g=Math.max(h.col,p.col);return h=this.n2l(d)+m,p=this.n2l(g)+b,{top:m,left:d,bottom:b,right:g,sheetName:e,tl:{address:h,col:d,row:m,$col$row:`$${this.n2l(d)}$${m}`,sheetName:e},br:{address:p,col:g,row:b,$col$row:`$${this.n2l(g)}$${b}`,sheetName:e},dimensions:`${h}:${p}`}}if(i.startsWith("#"))return e?{sheetName:e,error:i}:{error:i};const a=this.decodeAddress(i);return e?{sheetName:e,...a}:a},encodeAddress:(n,s)=>r.n2l(s)+n,encode(){switch(arguments.length){case 2:return r.encodeAddress(arguments[0],arguments[1]);case 4:return`${r.encodeAddress(arguments[0],arguments[1])}:${r.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(n,s){const[e,i,,u,a]=n,[h,p]=s;return h>=e&&h<=u&&p>=i&&p<=a}};l.exports=r},{}],20:[function(t,l,c){const o=(n,s)=>({...n,...s.reduce((e,i)=>(n[i]&&(e[i]={...n[i]}),e),{})}),r=function(n,s,e){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];n[e]&&(s[e]=o(n[e],i))};c.copyStyle=n=>{if(!n)return n;if(s=n,Object.keys(s).length===0)return{};var s;const e={...n};return r(n,e,"font",["color"]),r(n,e,"alignment"),r(n,e,"protection"),n.border&&(r(n,e,"border"),r(n.border,e.border,"top",["color"]),r(n.border,e.border,"left",["color"]),r(n.border,e.border,"bottom",["color"]),r(n.border,e.border,"right",["color"]),r(n.border,e.border,"diagonal",["color"])),n.fill&&(r(n,e,"fill",["fgColor","bgColor","center"]),n.fill.stops&&(e.fill.stops=n.fill.stops.map(i=>o(i,["color"])))),e}},{}],21:[function(t,l,c){(function(o){(function(){const r=t("crypto"),n={hash(s){const e=r.createHash(s);for(var i=arguments.length,u=new Array(i>1?i-1:0),a=1;a<i;a++)u[a-1]=arguments[a];return e.update(o.concat(u)),e.digest()},convertPasswordToHash(s,e,i,u){if(e=e.toLowerCase(),r.getHashes().indexOf(e)<0)throw new Error(`Hash algorithm '${e}' not supported!`);const a=o.from(s,"utf16le");let h=this.hash(e,o.from(i,"base64"),a);for(let p=0;p<u;p++){const m=o.alloc(4);m.writeUInt32LE(p,0),h=this.hash(e,h,m)}return h.toString("base64")},randomBytes:s=>r.randomBytes(s)};l.exports=n}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(t,l,c){const{SaxesParser:o}=t("saxes"),{PassThrough:r}=t("readable-stream"),{bufferToString:n}=t("./browser-buffer-decode");l.exports=async function*(s){s.pipe&&!s[Symbol.asyncIterator]&&(s=s.pipe(new r));const e=new o;let i;e.on("error",a=>{i=a});let u=[];e.on("opentag",a=>u.push({eventType:"opentag",value:a})),e.on("text",a=>u.push({eventType:"text",value:a})),e.on("closetag",a=>u.push({eventType:"closetag",value:a}));for await(const a of s){if(e.write(n(a)),i)throw i;yield u,u=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(t,l,c){const o=t("./col-cache"),r=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,n=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;l.exports={slideFormula:function(s,e,i){const u=o.decode(e),a=o.decode(i);return s.replace(r,(h,p,m,d,b)=>{if(b)return h;const g=n.exec(d);if(g){const S=g[1],C=g[2].toUpperCase(),I=g[3],D=g[4];if(C.length>3||C.length===3&&C>"XFD")return h;let z=o.l2n(C),P=parseInt(D,10);return S||(z+=a.col-u.col),I||(P+=a.row-u.row),(p||"")+(S||"")+o.n2l(z)+(I||"")+P}return h})}}},{"./col-cache":19}],24:[function(t,l,c){(function(o,r){(function(){const n=t("readable-stream"),s=t("./utils"),e=t("./string-buf");class i{constructor(d,b){this._data=d,this._encoding=b}get length(){return this.toBuffer().length}copy(d,b,g,S){return this.toBuffer().copy(d,b,g,S)}toBuffer(){return this._buffer||(this._buffer=r.from(this._data,this._encoding)),this._buffer}}class u{constructor(d){this._data=d}get length(){return this._data.length}copy(d,b,g,S){return this._data._buf.copy(d,b,g,S)}toBuffer(){return this._data.toBuffer()}}class a{constructor(d){this._data=d}get length(){return this._data.length}copy(d,b,g,S){this._data.copy(d,b,g,S)}toBuffer(){return this._data}}class h{constructor(d){this.size=d,this.buffer=r.alloc(d),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const d=r.alloc(this.iWrite-this.iRead);return this.buffer.copy(d,0,this.iRead,this.iWrite),d}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(d){let b;return d===0?null:d===void 0||d>=this.length?(b=this.toBuffer(),this.iRead=this.iWrite,b):(b=r.alloc(d),this.buffer.copy(b,0,this.iRead,d),this.iRead+=d,b)}write(d,b,g){const S=Math.min(g,this.size-this.iWrite);return d.copy(this.buffer,this.iWrite,b,b+S),this.iWrite+=S,S}}const p=function(m){m=m||{},this.bufSize=m.bufSize||1048576,this.buffers=[],this.batch=m.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};s.inherits(p,n.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return r.concat(this.buffers.map(m=>m.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const d=this.buffers[this.buffers.length-1];if(!d.full)return d}const m=new h(this.bufSize);return this.buffers.push(m),m},async _pipe(m){await Promise.all(this.pipes.map((function(d){return new Promise(b=>{d.write(m.toBuffer(),()=>{b()})})})))},_writeToBuffers(m){let d=0;const b=m.length;for(;d<b;)d+=this._getWritableBuffer().write(m,d,b-d)},async write(m,d,b){let g;if(d instanceof Function&&(b=d,d="utf8"),b=b||s.nop,m instanceof e)g=new u(m);else if(m instanceof r)g=new a(m);else{if(!(typeof m=="string"||m instanceof String||m instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");g=new i(m,d)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(g);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(g),o.nextTick(b)):(await this._pipe(g),b());else this.paused||this.emit("data",g.toBuffer()),this._writeToBuffers(g),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(m,d,b){const g=S=>{S?b(S):(this._flush(),this.pipes.forEach(C=>{C.end()}),this.emit("finish"))};m?this.write(m,d,g):g()},read(m){let d;if(m){for(d=[];m&&this.buffers.length&&!this.buffers[0].eod;){const b=this.buffers[0],g=b.read(m);m-=g.length,d.push(g),b.eod&&b.full&&this.buffers.shift()}return r.concat(d)}return d=this.buffers.map(b=>b.toBuffer()).filter(Boolean),this.buffers=[],r.concat(d)},setEncoding(m){this.encoding=m},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(m){this.pipes.push(m),!this.paused&&this.buffers.length&&this.end()},unpipe(m){this.pipes=this.pipes.filter(d=>d!==m)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),l.exports=p}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(t,l,c){(function(o){(function(){l.exports=class{constructor(r){this._buf=o.alloc(r&&r.size||16384),this._encoding=r&&r.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=o.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(r){r=r||0,this._buffer=void 0,this._inPos=r}_grow(r){let n=2*this._buf.length;for(;n<r;)n*=2;const s=o.alloc(n);this._buf.copy(s,0),this._buf=s}addText(r){this._buffer=void 0;let n=this._inPos+this._buf.write(r,this._inPos,this._encoding);for(;n>=this._buf.length-4;)this._grow(this._inPos+r.length),n=this._inPos+this._buf.write(r,this._inPos,this._encoding);this._inPos=n}addStringBuf(r){r.length&&(this._buffer=void 0,this.length+r.length>this.capacity&&this._grow(this.length+r.length),r._buf.copy(this._buf,this._inPos,0,r.length),this._inPos+=r.length)}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220}],26:[function(t,l,c){const{toString:o}=Object.prototype,r=/["&<>]/,n={each:function(s,e){s&&(Array.isArray(s)?s.forEach(e):Object.keys(s).forEach(i=>{e(s[i],i)}))},some:function(s,e){return!!s&&(Array.isArray(s)?s.some(e):Object.keys(s).some(i=>e(s[i],i)))},every:function(s,e){return!s||(Array.isArray(s)?s.every(e):Object.keys(s).every(i=>e(s[i],i)))},map:function(s,e){return s?Array.isArray(s)?s.map(e):Object.keys(s).map(i=>e(s[i],i)):[]},keyBy:(s,e)=>s.reduce((i,u)=>(i[u[e]]=u,i),{}),isEqual:function(s,e){const i=typeof s,u=typeof e,a=Array.isArray(s),h=Array.isArray(e);let p;if(i!==u)return!1;switch(typeof s){case"object":if(a||h)return!(!a||!h)&&s.length===e.length&&s.every((m,d)=>{const b=e[d];return n.isEqual(m,b)});if(s===null||e===null)return s===e;if(p=Object.keys(s),Object.keys(e).length!==p.length)return!1;for(const m of p)if(!e.hasOwnProperty(m))return!1;return n.every(s,(m,d)=>{const b=e[d];return n.isEqual(m,b)});default:return s===e}},escapeHtml(s){const e=r.exec(s);if(!e)return s;let i="",u="",a=0,h=e.index;for(;h<s.length;h++){switch(s.charAt(h)){case'"':u="&quot;";break;case"&":u="&amp;";break;case"'":u="&apos;";break;case"<":u="&lt;";break;case">":u="&gt;";break;default:continue}a!==h&&(i+=s.substring(a,h)),a=h+1,i+=u}return a!==h?i+s.substring(a,h):i},strcmp:(s,e)=>s<e?-1:s>e?1:0,isUndefined:s=>o.call(s)==="[object Undefined]",isObject:s=>o.call(s)==="[object Object]",deepMerge(){const s=arguments[0]||{},{length:e}=arguments;let i,u,a;function h(p,m){i=s[m],a=Array.isArray(p),n.isObject(p)||a?(a?(a=!1,u=i&&Array.isArray(i)?i:[]):u=i&&n.isObject(i)?i:{},s[m]=n.deepMerge(u,p)):n.isUndefined(p)||(s[m]=p)}for(let p=0;p<e;p++)n.each(arguments[p],h);return s}};l.exports=n},{}],27:[function(t,l,c){(function(o,r){(function(){const n=t("fs"),s=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,e={nop(){},promiseImmediate:i=>new Promise(u=>{o.setImmediate?r(()=>{u(i)}):setTimeout(()=>{u(i)},1)}),inherits:function(i,u,a,h){i.super_=u,h||(h=a,a=null),a&&Object.keys(a).forEach(m=>{Object.defineProperty(i,m,Object.getOwnPropertyDescriptor(a,m))});const p={constructor:{value:i,enumerable:!1,writable:!1,configurable:!0}};h&&Object.keys(h).forEach(m=>{p[m]=Object.getOwnPropertyDescriptor(h,m)}),i.prototype=Object.create(u.prototype,p)},dateToExcel:(i,u)=>25569+i.getTime()/864e5-(u?1462:0),excelToDate(i,u){const a=Math.round(24*(i-25569+(u?1462:0))*3600*1e3);return new Date(a)},parsePath(i){const u=i.lastIndexOf("/");return{path:i.substring(0,u),name:i.substring(u+1)}},getRelsPath(i){const u=e.parsePath(i);return`${u.path}/_rels/${u.name}.rels`},xmlEncode(i){const u=s.exec(i);if(!u)return i;let a="",h="",p=0,m=u.index;for(;m<i.length;m++){const d=i.charCodeAt(m);switch(d){case 34:h="&quot;";break;case 38:h="&amp;";break;case 39:h="&apos;";break;case 60:h="&lt;";break;case 62:h="&gt;";break;case 127:h="";break;default:if(d<=31&&(d<=8||d>=11&&d!==13)){h="";break}continue}p!==m&&(a+=i.substring(p,m)),p=m+1,h&&(a+=h)}return p!==m?a+i.substring(p,m):a},xmlDecode:i=>i.replace(/&([a-z]*);/g,u=>{switch(u){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":return'"';default:return u}}),validInt(i){const u=parseInt(i,10);return Number.isNaN(u)?0:u},isDateFmt(i){return i?(i=(i=i.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:i=>new Promise(u=>{n.access(i,n.constants.F_OK,a=>{u(!a)})})},toIsoDateString:i=>i.toIsoString().subsstr(0,10),parseBoolean:i=>i===!0||i==="true"||i===1||i==="1"};l.exports=e}).call(this)}).call(this,typeof pe<"u"?pe:typeof self<"u"?self:typeof window<"u"?window:{},t("timers").setImmediate)},{fs:216,timers:523}],28:[function(t,l,c){const o=t("./under-dash"),r=t("./utils");function n(i,u,a){i.push(` ${u}="${r.xmlEncode(a.toString())}"`)}function s(i,u){if(u){const a=[];o.each(u,(h,p)=>{h!==void 0&&n(a,p,h)}),i.push(a.join(""))}}class e{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(u){const a=this._xml;a.push("<?xml"),s(a,u),a.push(`?>
257
257
  `)}openNode(u,a){const h=this.tos,p=this._xml;h&&this.open&&p.push(">"),this._stack.push(u),p.push("<"),p.push(u),s(p,a),this.leaf=!0,this.open=!0}addAttribute(u,a){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");a!==void 0&&n(this._xml,u,a)}addAttributes(u){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");s(this._xml,u)}writeText(u){const a=this._xml;this.open&&(a.push(">"),this.open=!1),this.leaf=!1,a.push(r.xmlEncode(u.toString()))}writeXml(u){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(u)}closeNode(){const u=this._stack.pop(),a=this._xml;this.leaf?a.push("/>"):(a.push("</"),a.push(u),a.push(">")),this.open=!1,this.leaf=!1}leafNode(u,a,h){this.openNode(u,a),h!==void 0&&this.writeText(h),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const u=this._rollbacks.pop();this._xml.length>u.xml&&this._xml.splice(u.xml,this._xml.length-u.xml),this._stack.length>u.stack&&this._stack.splice(u.stack,this._stack.length-u.stack),this.leaf=u.leaf,this.open=u.open}get xml(){return this.closeAll(),this._xml.join("")}}e.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},l.exports=e},{"./under-dash":26,"./utils":27}],29:[function(t,l,c){(function(o){(function(){const r=t("events"),n=t("jszip"),s=t("./stream-buf"),{stringToBuffer:e}=t("./browser-buffer-encode");class i extends r.EventEmitter{constructor(a){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},a),this.zip=new n,this.stream=new s}append(a,h){h.hasOwnProperty("base64")&&h.base64?this.zip.file(h.name,a,{base64:!0}):(o.browser&&typeof a=="string"&&(a=e(a)),this.zip.file(h.name,a))}async finalize(){const a=await this.zip.generateAsync(this.options);this.stream.end(a),this.emit("finish")}read(a){return this.stream.read(a)}setEncoding(a){return this.stream.setEncoding(a)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(a,h){return this.stream.pipe(a,h)}unpipe(a){return this.stream.unpipe(a)}unshift(a){return this.stream.unshift(a)}wrap(a){return this.stream.wrap(a)}}l.exports={ZipWriter:i}}).call(this)}).call(this,t("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(t,l,c){l.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(t,l,c){l.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(t,l,c){const o=t("../../utils/parse-sax"),r=t("../../utils/xml-stream");class n{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,i){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(e=>{e instanceof n?e.reset():e.xform&&e.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(const i of e)for(const{eventType:u,value:a}of i)if(u==="opentag")this.parseOpen(a);else if(u==="text")this.parseText(a);else if(u==="closetag"&&!this.parseClose(a.name))return this.model;return this.model}async parseStream(e){return this.parse(o(e))}get xml(){return this.toXml(this.model)}toXml(e){const i=new r;return this.render(i,e),i.xml}static toAttribute(e,i){let u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(u)return i}else if(u||e!==i)return e.toString()}static toStringAttribute(e,i){let u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return n.toAttribute(e,i,u)}static toStringValue(e,i){return e===void 0?i:e}static toBoolAttribute(e,i){let u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(u)return i}else if(u||e!==i)return e?"1":"0"}static toBoolValue(e,i){return e===void 0?i:e==="1"}static toIntAttribute(e,i){let u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return n.toAttribute(e,i,u)}static toIntValue(e,i){return e===void 0?i:parseInt(e,10)}static toFloatAttribute(e,i){let u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return n.toAttribute(e,i,u)}static toFloatValue(e,i){return e===void 0?i:parseFloat(e)}}l.exports=n},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(t,l,c){const o=t("../base-xform"),r=t("../../../utils/col-cache");function n(e){try{return r.decodeEx(e),!0}catch{return!1}}function s(e){const i=[];let u=!1,a="";return e.split(",").forEach(h=>{if(!h)return;const p=(h.match(/'/g)||[]).length;if(!p)return void(u?a+=h+",":n(h)&&i.push(h));const m=p%2==0;!u&&m&&n(h)?i.push(h):u&&!m?(u=!1,n(a+h)&&i.push(a+h),a=""):(u=!0,a+=h+",")}),i}l.exports=class extends o{render(e,i){e.openNode("definedName",{name:i.name,localSheetId:i.localSheetId}),e.writeText(i.ranges.join(",")),e.closeNode()}parseOpen(e){switch(e.name){case"definedName":return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:s(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(t,l,c){const o=t("../../../utils/utils"),r=t("../base-xform");l.exports=class extends r{render(n,s){n.leafNode("sheet",{sheetId:s.id,name:s.name,state:s.state,"r:id":s.rId})}parseOpen(n){return n.name==="sheet"&&(this.model={name:o.xmlDecode(n.attributes.name),id:parseInt(n.attributes.sheetId,10),state:n.attributes.state,rId:n.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){r.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:n.fullCalcOnLoad?1:void 0})}parseOpen(r){return r.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){r.leafNode("workbookPr",{date1904:n.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(r){return r.name==="workbookPr"&&(this.model={date1904:r.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){const s={xWindow:n.x||0,yWindow:n.y||0,windowWidth:n.width||12e3,windowHeight:n.height||24e3,firstSheet:n.firstSheet,activeTab:n.activeTab};n.visibility&&n.visibility!=="visible"&&(s.visibility=n.visibility),r.leafNode("workbookView",s)}parseOpen(r){if(r.name==="workbookView"){const n=this.model={},s=function(i,u,a){const h=u!==void 0?n[i]=u:a;h!==void 0&&(n[i]=h)},e=function(i,u,a){const h=u!==void 0?n[i]=parseInt(u,10):a;h!==void 0&&(n[i]=h)};return e("x",r.attributes.xWindow,0),e("y",r.attributes.yWindow,0),e("width",r.attributes.windowWidth,25e3),e("height",r.attributes.windowHeight,1e4),s("visibility",r.attributes.visibility,"visible"),e("activeTab",r.attributes.activeTab,void 0),e("firstSheet",r.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../../../utils/col-cache"),n=t("../../../utils/xml-stream"),s=t("../base-xform"),e=t("../static-xform"),i=t("../list-xform"),u=t("./defined-name-xform"),a=t("./sheet-xform"),h=t("./workbook-view-xform"),p=t("./workbook-properties-xform"),m=t("./workbook-calc-properties-xform");class d extends s{constructor(){super(),this.map={fileVersion:d.STATIC_XFORMS.fileVersion,workbookPr:new p,bookViews:new i({tag:"bookViews",count:!1,childXform:new h}),sheets:new i({tag:"sheets",count:!1,childXform:new a}),definedNames:new i({tag:"definedNames",count:!1,childXform:new u}),calcPr:new m}}prepare(g){g.sheets=g.worksheets;const S=[];let C=0;g.sheets.forEach(I=>{if(I.pageSetup&&I.pageSetup.printArea&&I.pageSetup.printArea.split("&&").forEach(D=>{const z=D.split(":"),P={name:"_xlnm.Print_Area",ranges:[`'${I.name}'!$${z[0]}:$${z[1]}`],localSheetId:C};S.push(P)}),I.pageSetup&&(I.pageSetup.printTitlesRow||I.pageSetup.printTitlesColumn)){const D=[];if(I.pageSetup.printTitlesColumn){const P=I.pageSetup.printTitlesColumn.split(":");D.push(`'${I.name}'!$${P[0]}:$${P[1]}`)}if(I.pageSetup.printTitlesRow){const P=I.pageSetup.printTitlesRow.split(":");D.push(`'${I.name}'!$${P[0]}:$${P[1]}`)}const z={name:"_xlnm.Print_Titles",ranges:D,localSheetId:C};S.push(z)}C++}),S.length&&(g.definedNames=g.definedNames.concat(S)),(g.media||[]).forEach((I,D)=>{I.name=I.type+(D+1)})}render(g,S){g.openXml(n.StdDocAttributes),g.openNode("workbook",d.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(g),this.map.workbookPr.render(g,S.properties),this.map.bookViews.render(g,S.views),this.map.sheets.render(g,S.sheets),this.map.definedNames.render(g,S.definedNames),this.map.calcPr.render(g,S.calcProperties),g.closeNode()}parseOpen(g){if(this.parser)return this.parser.parseOpen(g),!0;switch(g.name){case"workbook":return!0;default:return this.parser=this.map[g.name],this.parser&&this.parser.parseOpen(g),!0}}parseText(g){this.parser&&this.parser.parseText(g)}parseClose(g){if(this.parser)return this.parser.parseClose(g)||(this.parser=void 0),!0;switch(g){case"workbook":return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(g){const S=(g.workbookRels||[]).reduce((P,B)=>(P[B.Id]=B,P),{}),C=[];let I,D=0;(g.sheets||[]).forEach(P=>{const B=S[P.rId];B&&(I=g.worksheetHash["xl/"+B.Target.replace(/^(\s|\/xl\/)+/,"")],I&&(I.name=P.name,I.id=P.id,I.state=P.state,C[D++]=I))});const z=[];o.each(g.definedNames,P=>{if(P.name==="_xlnm.Print_Area"){if(I=C[P.localSheetId],I){I.pageSetup||(I.pageSetup={});const B=r.decodeEx(P.ranges[0]);I.pageSetup.printArea=I.pageSetup.printArea?`${I.pageSetup.printArea}&&${B.dimensions}`:B.dimensions}}else if(P.name==="_xlnm.Print_Titles"){if(I=C[P.localSheetId],I){I.pageSetup||(I.pageSetup={});const B=P.ranges.join(","),F=/\$/g,W=/\$\d+:\$\d+/,q=B.match(W);if(q&&q.length){const k=q[0];I.pageSetup.printTitlesRow=k.replace(F,"")}const A=/\$[A-Z]+:\$[A-Z]+/,M=B.match(A);if(M&&M.length){const k=M[0];I.pageSetup.printTitlesColumn=k.replace(F,"")}}}else z.push(P)}),g.definedNames=z,g.media.forEach((P,B)=>{P.index=B})}}d.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},d.STATIC_XFORMS={fileVersion:new e({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},l.exports=d},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(t,l,c){const o=t("../strings/rich-text-xform"),r=t("../../../utils/utils"),n=t("../base-xform"),s=l.exports=function(e){this.model=e};r.inherits(s,n,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new o),this._richTextXform},render(e,i){i=i||this.model,e.openNode("comment",{ref:i.ref,authorId:0}),e.openNode("text"),i&&i.note&&i.note.texts&&i.note.texts.forEach(u=>{this.richTextXform.render(e,u)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"comment":return this.model={type:"note",note:{texts:[]},...e.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../../../utils/utils"),n=t("../base-xform"),s=t("./comment-xform"),e=l.exports=function(){this.map={comment:new s}};r.inherits(e,n,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(i,u){u=u||this.model,i.openXml(o.StdDocAttributes),i.openNode("comments",e.COMMENTS_ATTRIBUTES),i.openNode("authors"),i.leafNode("author",null,"Author"),i.closeNode(),i.openNode("commentList"),u.comments.forEach(a=>{this.map.comment.render(i,a)}),i.closeNode(),i.closeNode()},parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(i),!0;default:return!1}},parseText(i){this.parser&&this.parser.parseText(i)},parseClose(i){switch(i){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(i),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{constructor(r){super(),this._model=r}get tag(){return this._model&&this._model.tag}render(r,n,s){(n===s[2]||this.tag==="x:SizeWithCells"&&n===s[1])&&r.leafNode(this.tag)}parseOpen(r){switch(r.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{constructor(r){super(),this._model=r}get tag(){return this._model&&this._model.tag}render(r,n){r.leafNode(this.tag,null,n)}parseOpen(r){switch(r.name){case this.tag:return this.text="",!0;default:return!1}}parseText(r){this.text=r}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"x:Anchor"}getAnchorRect(r){const n=Math.floor(r.left),s=Math.floor(68*(r.left-n)),e=Math.floor(r.top),i=Math.floor(18*(r.top-e)),u=Math.floor(r.right),a=Math.floor(68*(r.right-u)),h=Math.floor(r.bottom);return[n,s,e,i,u,a,h,Math.floor(18*(r.bottom-h))]}getDefaultRect(r){const n=r.col,s=Math.max(r.row-2,0);return[n,6,s,14,n+2,2,s+4,16]}render(r,n){const s=n.anchor?this.getAnchorRect(n.anchor):this.getDefaultRect(n.refAddress);r.leafNode("x:Anchor",null,s.join(", "))}parseOpen(r){switch(r.name){case this.tag:return this.text="",!0;default:return!1}}parseText(r){this.text=r}parseClose(){return!1}}},{"../base-xform":32}],44:[function(t,l,c){const o=t("../base-xform"),r=t("./vml-anchor-xform"),n=t("./style/vml-protection-xform"),s=t("./style/vml-position-xform"),e=["twoCells","oneCells","absolute"];l.exports=class extends o{constructor(){super(),this.map={"x:Anchor":new r,"x:Locked":new n({tag:"x:Locked"}),"x:LockText":new n({tag:"x:LockText"}),"x:SizeWithCells":new s({tag:"x:SizeWithCells"}),"x:MoveWithCells":new s({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(i,u){const{protection:a,editAs:h}=u.note;i.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(i,h,e),this.map["x:SizeWithCells"].render(i,h,e),this.map["x:Anchor"].render(i,u),this.map["x:Locked"].render(i,a.locked),i.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(i,a.lockText),i.leafNode("x:Row",null,u.refAddress.row-1),i.leafNode("x:Column",null,u.refAddress.col-1),i.closeNode()}parseOpen(i){switch(i.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const i=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),u=Object.keys(i).length;this.model.editAs=e[u],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("./vml-shape-xform");class s extends r{constructor(){super(),this.map={"v:shape":new n}}get tag(){return"xml"}render(i,u){i.openXml(o.StdDocAttributes),i.openNode(this.tag,s.DRAWING_ATTRIBUTES),i.openNode("o:shapelayout",{"v:ext":"edit"}),i.leafNode("o:idmap",{"v:ext":"edit",data:1}),i.closeNode(),i.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),i.leafNode("v:stroke",{joinstyle:"miter"}),i.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),i.closeNode(),u.comments.forEach((a,h)=>{this.map["v:shape"].render(i,a,h)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(i){case this.tag:return!1;default:return!0}}reconcile(i,u){i.anchors.forEach(a=>{a.br?this.map["xdr:twoCellAnchor"].reconcile(a,u):this.map["xdr:oneCellAnchor"].reconcile(a,u)})}}s.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},l.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(t,l,c){const o=t("../base-xform"),r=t("./vml-textbox-xform"),n=t("./vml-client-data-xform");class s extends o{constructor(){super(),this.map={"v:textbox":new r,"x:ClientData":new n}}get tag(){return"v:shape"}render(i,u,a){i.openNode("v:shape",s.V_SHAPE_ATTRIBUTES(u,a)),i.leafNode("v:fill",{color2:"infoBackground [80]"}),i.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),i.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(i,u),this.map["x:ClientData"].render(i,u),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset(),this.model={margins:{insetmode:i.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}s.V_SHAPE_ATTRIBUTES=(e,i)=>({id:"_x0000_s"+(1025+i),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":e.note.margins&&e.note.margins.insetmode}),l.exports=s},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"v:textbox"}conversionUnit(r,n,s){return`${parseFloat(r)*n.toFixed(2)}${s}`}reverseConversionUnit(r){return(r||"").split(",").map(n=>Number(parseFloat(this.conversionUnit(parseFloat(n),.1,"")).toFixed(2)))}render(r,n){const s={style:"mso-direction-alt:auto"};if(n&&n.note){let{inset:e}=n.note&&n.note.margins;Array.isArray(e)&&(e=e.map(i=>this.conversionUnit(i,10,"mm")).join(",")),e&&(s.inset=e)}r.openNode("v:textbox",s),r.leafNode("div",{style:"text-align:left"}),r.closeNode()}parseOpen(r){switch(r.name){case this.tag:return this.model={inset:this.reverseConversionUnit(r.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(r){switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(t,l,c){const o=t("./base-xform");l.exports=class extends o{createNewModel(r){return{}}parseOpen(r){return this.parser=this.parser||this.map[r.name],this.parser?(this.parser.parseOpen(r),!0):r.name===this.tag&&(this.model=this.createNewModel(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}onParserClose(r,n){this.model[r]=n.model}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.onParserClose(r,this.parser),this.parser=void 0),!0):r!==this.tag}}},{"./base-xform":32}],49:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){r.openNode("HeadingPairs"),r.openNode("vt:vector",{size:2,baseType:"variant"}),r.openNode("vt:variant"),r.leafNode("vt:lpstr",void 0,"Worksheets"),r.closeNode(),r.openNode("vt:variant"),r.leafNode("vt:i4",void 0,n.length),r.closeNode(),r.closeNode(),r.closeNode()}parseOpen(r){return r.name==="HeadingPairs"}parseText(){}parseClose(r){return r!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){r.openNode("TitlesOfParts"),r.openNode("vt:vector",{size:n.length,baseType:"lpstr"}),n.forEach(s=>{r.leafNode("vt:lpstr",void 0,s.name)}),r.closeNode(),r.closeNode()}parseOpen(r){return r.name==="TitlesOfParts"}parseText(){}parseClose(r){return r!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("../simple/string-xform"),s=t("./app-heading-pairs-xform"),e=t("./app-titles-of-parts-xform");class i extends r{constructor(){super(),this.map={Company:new n({tag:"Company"}),Manager:new n({tag:"Manager"}),HeadingPairs:new s,TitleOfParts:new e}}render(a,h){a.openXml(o.StdDocAttributes),a.openNode("Properties",i.PROPERTY_ATTRIBUTES),a.leafNode("Application",void 0,"Microsoft Excel"),a.leafNode("DocSecurity",void 0,"0"),a.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(a,h.worksheets),this.map.TitleOfParts.render(a,h.worksheets),this.map.Company.render(a,h.company||""),this.map.Manager.render(a,h.manager),a.leafNode("LinksUpToDate",void 0,"false"),a.leafNode("SharedDoc",void 0,"false"),a.leafNode("HyperlinksChanged",void 0,"false"),a.leafNode("AppVersion",void 0,"16.0300"),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"Properties":return!0;default:return this.parser=this.map[a.name],!!this.parser&&(this.parser.parseOpen(a),!0)}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}i.DateFormat=function(u){return u.toISOString().replace(/[.]\d{3,6}/,"")},i.DateAttrs={"xsi:type":"dcterms:W3CDTF"},i.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},l.exports=i},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform");class n extends r{render(e,i){e.openXml(o.StdDocAttributes),e.openNode("Types",n.PROPERTY_ATTRIBUTES);const u={};(i.media||[]).forEach(a=>{if(a.type==="image"){const h=a.extension;u[h]||(u[h]=!0,e.leafNode("Default",{Extension:h,ContentType:"image/"+h}))}}),e.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),e.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),e.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),i.worksheets.forEach(a=>{const h=`/xl/worksheets/sheet${a.id}.xml`;e.leafNode("Override",{PartName:h,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),e.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),e.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),i.sharedStrings&&i.sharedStrings.count&&e.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),i.tables&&i.tables.forEach(a=>{e.leafNode("Override",{PartName:"/xl/tables/"+a.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),i.drawings&&i.drawings.forEach(a=>{e.leafNode("Override",{PartName:`/xl/drawings/${a.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),i.commentRefs&&(e.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),i.commentRefs.forEach(a=>{let{commentName:h}=a;e.leafNode("Override",{PartName:`/xl/${h}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),e.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),e.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}n.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},l.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("../simple/date-xform"),s=t("../simple/string-xform"),e=t("../simple/integer-xform");class i extends r{constructor(){super(),this.map={"dc:creator":new s({tag:"dc:creator"}),"dc:title":new s({tag:"dc:title"}),"dc:subject":new s({tag:"dc:subject"}),"dc:description":new s({tag:"dc:description"}),"dc:identifier":new s({tag:"dc:identifier"}),"dc:language":new s({tag:"dc:language"}),"cp:keywords":new s({tag:"cp:keywords"}),"cp:category":new s({tag:"cp:category"}),"cp:lastModifiedBy":new s({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new n({tag:"cp:lastPrinted",format:i.DateFormat}),"cp:revision":new e({tag:"cp:revision"}),"cp:version":new s({tag:"cp:version"}),"cp:contentStatus":new s({tag:"cp:contentStatus"}),"cp:contentType":new s({tag:"cp:contentType"}),"dcterms:created":new n({tag:"dcterms:created",attrs:i.DateAttrs,format:i.DateFormat}),"dcterms:modified":new n({tag:"dcterms:modified",attrs:i.DateAttrs,format:i.DateFormat})}}render(a,h){a.openXml(o.StdDocAttributes),a.openNode("cp:coreProperties",i.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(a,h.creator),this.map["dc:title"].render(a,h.title),this.map["dc:subject"].render(a,h.subject),this.map["dc:description"].render(a,h.description),this.map["dc:identifier"].render(a,h.identifier),this.map["dc:language"].render(a,h.language),this.map["cp:keywords"].render(a,h.keywords),this.map["cp:category"].render(a,h.category),this.map["cp:lastModifiedBy"].render(a,h.lastModifiedBy),this.map["cp:lastPrinted"].render(a,h.lastPrinted),this.map["cp:revision"].render(a,h.revision),this.map["cp:version"].render(a,h.version),this.map["cp:contentStatus"].render(a,h.contentStatus),this.map["cp:contentType"].render(a,h.contentType),this.map["dcterms:created"].render(a,h.created),this.map["dcterms:modified"].render(a,h.modified),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[a.name],this.parser)return this.parser.parseOpen(a),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(a))}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}i.DateFormat=function(u){return u.toISOString().replace(/[.]\d{3}/,"")},i.DateAttrs={"xsi:type":"dcterms:W3CDTF"},i.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},l.exports=i},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{render(r,n){r.leafNode("Relationship",n)}parseOpen(r){switch(r.name){case"Relationship":return this.model=r.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("./relationship-xform");class s extends r{constructor(){super(),this.map={Relationship:new n}}render(i,u){u=u||this._values,i.openXml(o.StdDocAttributes),i.openNode("Relationships",s.RELATIONSHIPS_ATTRIBUTES),u.forEach(a=>{this.map.Relationship.render(i,a)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[i.name],this.parser)return this.parser.parseOpen(i),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(i))}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(i){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+i)}}}s.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},l.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset(),this.model={range:{editAs:r.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(r){this.parser&&this.parser.parseText(r)}reconcilePicture(r,n){if(r&&r.rId){const s=n.rels[r.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(s){const e=s[1],i=n.mediaIndex[e];return n.media[i]}}}}},{"../base-xform":32}],57:[function(t,l,c){const o=t("../base-xform"),r=t("./blip-xform");l.exports=class extends o{constructor(){super(),this.map={"a:blip":new r}}get tag(){return"xdr:blipFill"}render(n,s){n.openNode(this.tag),this.map["a:blip"].render(n,s),n.openNode("a:stretch"),n.leafNode("a:fillRect"),n.closeNode(),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(){}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"a:blip"}render(r,n){r.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":n.rId,cstate:"print"})}parseOpen(r){switch(r.name){case this.tag:return this.model={rId:r.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(r){switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"xdr:cNvPicPr"}render(r){r.openNode(this.tag),r.leafNode("a:picLocks",{noChangeAspect:"1"}),r.closeNode()}parseOpen(r){switch(r.name){case this.tag:default:return!0}}parseText(){}parseClose(r){switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(t,l,c){const o=t("../base-xform"),r=t("./hlink-click-xform"),n=t("./ext-lst-xform");l.exports=class extends o{constructor(){super(),this.map={"a:hlinkClick":new r,"a:extLst":new n}}get tag(){return"xdr:cNvPr"}render(s,e){s.openNode(this.tag,{id:e.index,name:"Picture "+e.index}),this.map["a:hlinkClick"].render(s,e),this.map["a:extLst"].render(s,e),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case this.tag:this.reset();break;default:this.parser=this.map[s.name],this.parser&&this.parser.parseOpen(s)}return!0}parseText(){}parseClose(s){if(this.parser)return this.parser.parseClose(s)||(this.parser=void 0),!0;switch(s){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(t,l,c){const o=t("../base-xform"),r=t("../simple/integer-xform");l.exports=class extends o{constructor(n){super(),this.tag=n.tag,this.map={"xdr:col":new r({tag:"xdr:col",zero:!0}),"xdr:colOff":new r({tag:"xdr:colOff",zero:!0}),"xdr:row":new r({tag:"xdr:row",zero:!0}),"xdr:rowOff":new r({tag:"xdr:rowOff",zero:!0})}}render(n,s){n.openNode(this.tag),this.map["xdr:col"].render(n,s.nativeCol),this.map["xdr:colOff"].render(n,s.nativeColOff),this.map["xdr:row"].render(n,s.nativeRow),this.map["xdr:rowOff"].render(n,s.nativeRowOff),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(t,l,c){const o=t("../../../utils/col-cache"),r=t("../../../utils/xml-stream"),n=t("../base-xform"),s=t("./two-cell-anchor-xform"),e=t("./one-cell-anchor-xform");class i extends n{constructor(){super(),this.map={"xdr:twoCellAnchor":new s,"xdr:oneCellAnchor":new e}}prepare(a){a.anchors.forEach((h,p)=>{h.anchorType=(function(m){return(typeof m.range=="string"?o.decode(m.range):m.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"})(h),this.map[h.anchorType].prepare(h,{index:p})})}get tag(){return"xdr:wsDr"}render(a,h){a.openXml(r.StdDocAttributes),a.openNode(this.tag,i.DRAWING_ATTRIBUTES),h.anchors.forEach(p=>{this.map[p.anchorType].render(a,p)}),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:return!0}}reconcile(a,h){a.anchors.forEach(p=>{p.br?this.map["xdr:twoCellAnchor"].reconcile(p,h):this.map["xdr:oneCellAnchor"].reconcile(p,h)})}}i.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},l.exports=i},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"a:extLst"}render(r){r.openNode(this.tag),r.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),r.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),r.closeNode(),r.closeNode()}parseOpen(r){switch(r.name){case this.tag:default:return!0}}parseText(){}parseClose(r){switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.map={}}render(r,n){r.openNode(this.tag);const s=Math.floor(9525*n.width),e=Math.floor(9525*n.height);r.addAttribute("cx",s),r.addAttribute("cy",e),r.closeNode()}parseOpen(r){return r.name===this.tag&&(this.model={width:parseInt(r.attributes.cx||"0",10)/9525,height:parseInt(r.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"a:hlinkClick"}render(r,n){n.hyperlinks&&n.hyperlinks.rId&&r.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":n.hyperlinks.rId,tooltip:n.hyperlinks.tooltip})}parseOpen(r){switch(r.name){case this.tag:return this.model={hyperlinks:{rId:r.attributes["r:id"],tooltip:r.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(t,l,c){const o=t("../base-xform"),r=t("./c-nv-pr-xform"),n=t("./c-nv-pic-pr-xform");l.exports=class extends o{constructor(){super(),this.map={"xdr:cNvPr":new r,"xdr:cNvPicPr":new n}}get tag(){return"xdr:nvPicPr"}render(s,e){s.openNode(this.tag),this.map["xdr:cNvPr"].render(s,e),this.map["xdr:cNvPicPr"].render(s,e),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case this.tag:this.reset();break;default:this.parser=this.map[s.name],this.parser&&this.parser.parseOpen(s)}return!0}parseText(){}parseClose(s){if(this.parser)return this.parser.parseClose(s)||(this.parser=void 0),!0;switch(s){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(t,l,c){const o=t("./base-cell-anchor-xform"),r=t("../static-xform"),n=t("./cell-position-xform"),s=t("./ext-xform"),e=t("./pic-xform");l.exports=class extends o{constructor(){super(),this.map={"xdr:from":new n({tag:"xdr:from"}),"xdr:ext":new s({tag:"xdr:ext"}),"xdr:pic":new e,"xdr:clientData":new r({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(i,u){this.map["xdr:pic"].prepare(i.picture,u)}render(i,u){i.openNode(this.tag,{editAs:u.range.editAs||"oneCell"}),this.map["xdr:from"].render(i,u.range.tl),this.map["xdr:ext"].render(i,u.range.ext),this.map["xdr:pic"].render(i,u.picture),this.map["xdr:clientData"].render(i,{}),i.closeNode()}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(i,u){i.medium=this.reconcilePicture(i.picture,u)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(t,l,c){const o=t("../base-xform"),r=t("../static-xform"),n=t("./blip-fill-xform"),s=t("./nv-pic-pr-xform"),e=t("./sp-pr");l.exports=class extends o{constructor(){super(),this.map={"xdr:nvPicPr":new s,"xdr:blipFill":new n,"xdr:spPr":new r(e)}}get tag(){return"xdr:pic"}prepare(i,u){i.index=u.index+1}render(i,u){i.openNode(this.tag),this.map["xdr:nvPicPr"].render(i,u),this.map["xdr:blipFill"].render(i,u),this.map["xdr:spPr"].render(i,u),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset();break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(){}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(i){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(t,l,c){l.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(t,l,c){const o=t("./base-cell-anchor-xform"),r=t("../static-xform"),n=t("./cell-position-xform"),s=t("./pic-xform");l.exports=class extends o{constructor(){super(),this.map={"xdr:from":new n({tag:"xdr:from"}),"xdr:to":new n({tag:"xdr:to"}),"xdr:pic":new s,"xdr:clientData":new r({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(e,i){this.map["xdr:pic"].prepare(e.picture,i)}render(e,i){e.openNode(this.tag,{editAs:i.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,i.range.tl),this.map["xdr:to"].render(e,i.range.br),this.map["xdr:pic"].render(e,i.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(e,i){e.medium=this.reconcilePicture(e.picture,i)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(t,l,c){const o=t("./base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.always=!!r.always,this.count=r.count,this.empty=r.empty,this.$count=r.$count||"count",this.$=r.$,this.childXform=r.childXform,this.maxItems=r.maxItems}prepare(r,n){const{childXform:s}=this;r&&r.forEach((e,i)=>{n.index=i,s.prepare(e,n)})}render(r,n){if(this.always||n&&n.length){r.openNode(this.tag,this.$),this.count&&r.addAttribute(this.$count,n&&n.length||0);const{childXform:s}=this;(n||[]).forEach((e,i)=>{s.render(r,e,i)}),r.closeNode()}else this.empty&&r.leafNode(this.tag)}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(r)&&(this.parser=this.childXform,!0)}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(r,n){if(r){const{childXform:s}=this;r.forEach(e=>{s.reconcile(e,n)})}}}},{"./base-xform":32}],72:[function(t,l,c){const o=t("../../../utils/col-cache"),r=t("../base-xform");l.exports=class extends r{get tag(){return"autoFilter"}render(n,s){if(s)if(typeof s=="string")n.leafNode("autoFilter",{ref:s});else{const e=function(a){return typeof a=="string"?a:o.getAddress(a.row,a.column).address},i=e(s.from),u=e(s.to);i&&u&&n.leafNode("autoFilter",{ref:`${i}:${u}`})}}parseOpen(n){n.name==="autoFilter"&&(this.model=n.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(t,l,c){const o=t("../../../utils/utils"),r=t("../base-xform"),n=t("../../../doc/range"),s=t("../../../doc/enums"),e=t("../strings/rich-text-xform");function i(u){if(u==null)return s.ValueType.Null;if(u instanceof String||typeof u=="string")return s.ValueType.String;if(typeof u=="number")return s.ValueType.Number;if(typeof u=="boolean")return s.ValueType.Boolean;if(u instanceof Date)return s.ValueType.Date;if(u.text&&u.hyperlink)return s.ValueType.Hyperlink;if(u.formula)return s.ValueType.Formula;if(u.error)return s.ValueType.Error;throw new Error("I could not understand type of value")}l.exports=class extends r{constructor(){super(),this.richTextXForm=new e}get tag(){return"c"}prepare(u,a){const h=a.styles.addStyleModel(u.style||{},(function(p){switch(p.type){case s.ValueType.Formula:return i(p.result);default:return p.type}})(u));switch(h&&(u.styleId=h),u.comment&&a.comments.push({...u.comment,ref:u.address}),u.type){case s.ValueType.String:case s.ValueType.RichText:a.sharedStrings&&(u.ssId=a.sharedStrings.add(u.value));break;case s.ValueType.Date:a.date1904&&(u.date1904=!0);break;case s.ValueType.Hyperlink:a.sharedStrings&&u.text!==void 0&&u.text!==null&&(u.ssId=a.sharedStrings.add(u.text)),a.hyperlinks.push({address:u.address,target:u.hyperlink,tooltip:u.tooltip});break;case s.ValueType.Merge:a.merges.add(u);break;case s.ValueType.Formula:if(a.date1904&&(u.date1904=!0),u.shareType==="shared"&&(u.si=a.siFormulae++),u.formula)a.formulae[u.address]=u;else if(u.sharedFormula){const p=a.formulae[u.sharedFormula];if(!p)throw new Error("Shared Formula master must exist above and or left of clone for cell "+u.address);p.si===void 0?(p.shareType="shared",p.si=a.siFormulae++,p.range=new n(p.address,u.address)):p.range&&p.range.expandToAddress(u.address),u.si=p.si}}}renderFormula(u,a){let h=null;switch(a.shareType){case"shared":h={t:"shared",ref:a.ref||a.range.range,si:a.si};break;case"array":h={t:"array",ref:a.ref};break;default:a.si!==void 0&&(h={t:"shared",si:a.si})}switch(i(a.result)){case s.ValueType.Null:u.leafNode("f",h,a.formula);break;case s.ValueType.String:u.addAttribute("t","str"),u.leafNode("f",h,a.formula),u.leafNode("v",null,a.result);break;case s.ValueType.Number:u.leafNode("f",h,a.formula),u.leafNode("v",null,a.result);break;case s.ValueType.Boolean:u.addAttribute("t","b"),u.leafNode("f",h,a.formula),u.leafNode("v",null,a.result?1:0);break;case s.ValueType.Error:u.addAttribute("t","e"),u.leafNode("f",h,a.formula),u.leafNode("v",null,a.result.error);break;case s.ValueType.Date:u.leafNode("f",h,a.formula),u.leafNode("v",null,o.dateToExcel(a.result,a.date1904));break;default:throw new Error("I could not understand type of value")}}render(u,a){if(a.type!==s.ValueType.Null||a.styleId){switch(u.openNode("c"),u.addAttribute("r",a.address),a.styleId&&u.addAttribute("s",a.styleId),a.type){case s.ValueType.Null:break;case s.ValueType.Number:u.leafNode("v",null,a.value);break;case s.ValueType.Boolean:u.addAttribute("t","b"),u.leafNode("v",null,a.value?"1":"0");break;case s.ValueType.Error:u.addAttribute("t","e"),u.leafNode("v",null,a.value.error);break;case s.ValueType.String:case s.ValueType.RichText:a.ssId!==void 0?(u.addAttribute("t","s"),u.leafNode("v",null,a.ssId)):a.value&&a.value.richText?(u.addAttribute("t","inlineStr"),u.openNode("is"),a.value.richText.forEach(h=>{this.richTextXForm.render(u,h)}),u.closeNode("is")):(u.addAttribute("t","str"),u.leafNode("v",null,a.value));break;case s.ValueType.Date:u.leafNode("v",null,o.dateToExcel(a.value,a.date1904));break;case s.ValueType.Hyperlink:a.ssId!==void 0?(u.addAttribute("t","s"),u.leafNode("v",null,a.ssId)):(u.addAttribute("t","str"),u.leafNode("v",null,a.text));break;case s.ValueType.Formula:this.renderFormula(u,a);break;case s.ValueType.Merge:}u.closeNode()}}parseOpen(u){if(this.parser)return this.parser.parseOpen(u),!0;switch(u.name){case"c":return this.model={address:u.attributes.r},this.t=u.attributes.t,u.attributes.s&&(this.model.styleId=parseInt(u.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=u.attributes.si,this.model.shareType=u.attributes.t,this.model.ref=u.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(u),!0;default:return!1}}parseText(u){if(this.parser)this.parser.parseText(u);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+u:u;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+u:u:this.model.value=this.model.value?this.model.value+u:u}}parseClose(u){switch(u){case"c":{const{model:a}=this;if(a.formula||a.shareType)a.type=s.ValueType.Formula,a.value&&(this.t==="str"?a.result=o.xmlDecode(a.value):this.t==="b"?a.result=parseInt(a.value,10)!==0:this.t==="e"?a.result={error:a.value}:a.result=parseFloat(a.value),a.value=void 0);else if(a.value!==void 0)switch(this.t){case"s":a.type=s.ValueType.String,a.value=parseInt(a.value,10);break;case"str":a.type=s.ValueType.String,a.value=o.xmlDecode(a.value);break;case"inlineStr":a.type=s.ValueType.String;break;case"b":a.type=s.ValueType.Boolean,a.value=parseInt(a.value,10)!==0;break;case"e":a.type=s.ValueType.Error,a.value={error:a.value};break;default:a.type=s.ValueType.Number,a.value=parseFloat(a.value)}else a.styleId?a.type=s.ValueType.Null:a.type=s.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(u),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(u),!0)}}reconcile(u,a){const h=u.styleId&&a.styles&&a.styles.getStyleModel(u.styleId);switch(h&&(u.style=h),u.styleId!==void 0&&(u.styleId=void 0),u.type){case s.ValueType.String:typeof u.value=="number"&&a.sharedStrings&&(u.value=a.sharedStrings.getString(u.value)),u.value.richText&&(u.type=s.ValueType.RichText);break;case s.ValueType.Number:h&&o.isDateFmt(h.numFmt)&&(u.type=s.ValueType.Date,u.value=o.excelToDate(u.value,a.date1904));break;case s.ValueType.Formula:u.result!==void 0&&h&&o.isDateFmt(h.numFmt)&&(u.result=o.excelToDate(u.result,a.date1904)),u.shareType==="shared"&&(u.ref?a.formulae[u.si]=u.address:(u.sharedFormula=a.formulae[u.si],delete u.shareType),delete u.si)}const p=a.hyperlinkMap[u.address];p&&(u.type===s.ValueType.Formula?(u.text=u.result,u.result=void 0):(u.text=u.value,u.value=void 0),u.type=s.ValueType.Hyperlink,u.hyperlink=p);const m=a.commentsMap&&a.commentsMap[u.address];m&&(u.comment=m)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{get tag(){return"x14:cfIcon"}render(r,n){r.leafNode(this.tag,{iconSet:n.iconSet,iconId:n.iconId})}parseOpen(r){let{attributes:n}=r;this.model={iconSet:n.iconSet,iconId:o.toIntValue(n.iconId)}}parseClose(r){return r!==this.tag}}},{"../../base-xform":32}],75:[function(t,l,c){const{v4:o}=t("uuid"),r=t("../../base-xform"),n=t("../../composite-xform"),s=t("./databar-ext-xform"),e=t("./icon-set-ext-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class u extends n{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new s,"x14:iconSet":this.iconSetXform=new e}}get tag(){return"x14:cfRule"}static isExt(h){return h.type==="dataBar"?s.isExt(h):!(h.type!=="iconSet"||!h.custom&&!i[h.iconSet])}prepare(h){u.isExt(h)&&(h.x14Id=`{${o()}}`.toUpperCase())}render(h,p){if(u.isExt(p))switch(p.type){case"dataBar":this.renderDataBar(h,p);break;case"iconSet":this.renderIconSet(h,p)}}renderDataBar(h,p){h.openNode(this.tag,{type:"dataBar",id:p.x14Id}),this.databarXform.render(h,p),h.closeNode()}renderIconSet(h,p){h.openNode(this.tag,{type:"iconSet",priority:p.priority,id:p.x14Id||`{${o()}}`}),this.iconSetXform.render(h,p),h.closeNode()}createNewModel(h){let{attributes:p}=h;return{type:p.type,x14Id:p.id,priority:r.toIntValue(p.priority)}}onParserClose(h,p){Object.assign(this.model,p.model)}}l.exports=u},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(t,l,c){const o=t("../../composite-xform"),r=t("./f-ext-xform");l.exports=class extends o{constructor(){super(),this.map={"xm:f":this.fExtXform=new r}}get tag(){return"x14:cfvo"}render(n,s){n.openNode(this.tag,{type:s.type}),s.value!==void 0&&this.fExtXform.render(n,s.value),n.closeNode()}createNewModel(n){return{type:n.attributes.type}}onParserClose(n,s){switch(n){case"xm:f":this.model.value=s.model?parseFloat(s.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(t,l,c){const o=t("../../composite-xform"),r=t("./sqref-ext-xform"),n=t("./cf-rule-ext-xform");l.exports=class extends o{constructor(){super(),this.map={"xm:sqref":this.sqRef=new r,"x14:cfRule":this.cfRule=new n}}get tag(){return"x14:conditionalFormatting"}prepare(s,e){s.rules.forEach(i=>{this.cfRule.prepare(i,e)})}render(s,e){e.rules.some(n.isExt)&&(s.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),e.rules.filter(n.isExt).forEach(i=>this.cfRule.render(s,i)),this.sqRef.render(s,e.ref),s.closeNode())}createNewModel(){return{rules:[]}}onParserClose(s,e){switch(s){case"xm:sqref":this.model.ref=e.model;break;case"x14:cfRule":this.model.rules.push(e.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(t,l,c){const o=t("../../composite-xform"),r=t("./cf-rule-ext-xform"),n=t("./conditional-formatting-ext-xform");l.exports=class extends o{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new n}}get tag(){return"x14:conditionalFormattings"}hasContent(s){return s.hasExtContent===void 0&&(s.hasExtContent=s.some(e=>e.rules.some(r.isExt))),s.hasExtContent}prepare(s,e){s.forEach(i=>{this.cfXform.prepare(i,e)})}render(s,e){this.hasContent(e)&&(s.openNode(this.tag),e.forEach(i=>this.cfXform.render(s,i)),s.closeNode())}createNewModel(){return[]}onParserClose(s,e){this.model.push(e.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(t,l,c){const o=t("../../base-xform"),r=t("../../composite-xform"),n=t("../../style/color-xform"),s=t("./cfvo-ext-xform");l.exports=class extends r{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new s,"x14:borderColor":this.borderColorXform=new n("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new n("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new n("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new n("x14:axisColor")}}static isExt(e){return!e.gradient}get tag(){return"x14:dataBar"}render(e,i){e.openNode(this.tag,{minLength:o.toIntAttribute(i.minLength,0,!0),maxLength:o.toIntAttribute(i.maxLength,100,!0),border:o.toBoolAttribute(i.border,!1),gradient:o.toBoolAttribute(i.gradient,!0),negativeBarColorSameAsPositive:o.toBoolAttribute(i.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:o.toBoolAttribute(i.negativeBarBorderColorSameAsPositive,!0),axisPosition:o.toAttribute(i.axisPosition,"auto"),direction:o.toAttribute(i.direction,"leftToRight")}),i.cfvo.forEach(u=>{this.cfvoXform.render(e,u)}),this.borderColorXform.render(e,i.borderColor),this.negativeBorderColorXform.render(e,i.negativeBorderColor),this.negativeFillColorXform.render(e,i.negativeFillColor),this.axisColorXform.render(e,i.axisColor),e.closeNode()}createNewModel(e){let{attributes:i}=e;return{cfvo:[],minLength:o.toIntValue(i.minLength,0),maxLength:o.toIntValue(i.maxLength,100),border:o.toBoolValue(i.border,!1),gradient:o.toBoolValue(i.gradient,!0),negativeBarColorSameAsPositive:o.toBoolValue(i.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:o.toBoolValue(i.negativeBarBorderColorSameAsPositive,!0),axisPosition:o.toStringValue(i.axisPosition,"auto"),direction:o.toStringValue(i.direction,"leftToRight")}}onParserClose(e,i){const[,u]=e.split(":");switch(u){case"cfvo":this.model.cfvo.push(i.model);break;default:this.model[u]=i.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{get tag(){return"xm:f"}render(r,n){r.leafNode(this.tag,null,n)}parseOpen(){this.model=""}parseText(r){this.model+=r}parseClose(r){return r!==this.tag}}},{"../../base-xform":32}],81:[function(t,l,c){const o=t("../../base-xform"),r=t("../../composite-xform"),n=t("./cfvo-ext-xform"),s=t("./cf-icon-ext-xform");l.exports=class extends r{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new n,"x14:cfIcon":this.cfIconXform=new s}}get tag(){return"x14:iconSet"}render(e,i){e.openNode(this.tag,{iconSet:o.toStringAttribute(i.iconSet),reverse:o.toBoolAttribute(i.reverse,!1),showValue:o.toBoolAttribute(i.showValue,!0),custom:o.toBoolAttribute(i.icons,!1)}),i.cfvo.forEach(u=>{this.cfvoXform.render(e,u)}),i.icons&&i.icons.forEach((u,a)=>{u.iconId=a,this.cfIconXform.render(e,u)}),e.closeNode()}createNewModel(e){let{attributes:i}=e;return{cfvo:[],iconSet:o.toStringValue(i.iconSet,"3TrafficLights"),reverse:o.toBoolValue(i.reverse,!1),showValue:o.toBoolValue(i.showValue,!0)}}onParserClose(e,i){const[,u]=e.split(":");switch(u){case"cfvo":this.model.cfvo.push(i.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(i.model);break;default:this.model[u]=i.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{get tag(){return"xm:sqref"}render(r,n){r.leafNode(this.tag,null,n)}parseOpen(){this.model=""}parseText(r){this.model+=r}parseClose(r){return r!==this.tag}}},{"../../base-xform":32}],83:[function(t,l,c){const o=t("../../base-xform"),r=t("../../composite-xform"),n=t("../../../../doc/range"),s=t("./databar-xform"),e=t("./ext-lst-ref-xform"),i=t("./formula-xform"),u=t("./color-scale-xform"),a=t("./icon-set-xform"),h={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},p=d=>{const{type:b,operator:g}=d;switch(b){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:b};default:return{type:b,operator:g}}};class m extends r{constructor(){super(),this.map={dataBar:this.databarXform=new s,extLst:this.extLstRefXform=new e,formula:this.formulaXform=new i,colorScale:this.colorScaleXform=new u,iconSet:this.iconSetXform=new a}}get tag(){return"cfRule"}static isPrimitive(b){return b.type!=="iconSet"||!b.custom&&!h[b.iconSet]}render(b,g){switch(g.type){case"expression":this.renderExpression(b,g);break;case"cellIs":this.renderCellIs(b,g);break;case"top10":this.renderTop10(b,g);break;case"aboveAverage":this.renderAboveAverage(b,g);break;case"dataBar":this.renderDataBar(b,g);break;case"colorScale":this.renderColorScale(b,g);break;case"iconSet":this.renderIconSet(b,g);break;case"containsText":this.renderText(b,g);break;case"timePeriod":this.renderTimePeriod(b,g)}}renderExpression(b,g){b.openNode(this.tag,{type:"expression",dxfId:g.dxfId,priority:g.priority}),this.formulaXform.render(b,g.formulae[0]),b.closeNode()}renderCellIs(b,g){b.openNode(this.tag,{type:"cellIs",dxfId:g.dxfId,priority:g.priority,operator:g.operator}),g.formulae.forEach(S=>{this.formulaXform.render(b,S)}),b.closeNode()}renderTop10(b,g){b.leafNode(this.tag,{type:"top10",dxfId:g.dxfId,priority:g.priority,percent:o.toBoolAttribute(g.percent,!1),bottom:o.toBoolAttribute(g.bottom,!1),rank:o.toIntValue(g.rank,10,!0)})}renderAboveAverage(b,g){b.leafNode(this.tag,{type:"aboveAverage",dxfId:g.dxfId,priority:g.priority,aboveAverage:o.toBoolAttribute(g.aboveAverage,!0)})}renderDataBar(b,g){b.openNode(this.tag,{type:"dataBar",priority:g.priority}),this.databarXform.render(b,g),this.extLstRefXform.render(b,g),b.closeNode()}renderColorScale(b,g){b.openNode(this.tag,{type:"colorScale",priority:g.priority}),this.colorScaleXform.render(b,g),b.closeNode()}renderIconSet(b,g){m.isPrimitive(g)&&(b.openNode(this.tag,{type:"iconSet",priority:g.priority}),this.iconSetXform.render(b,g),b.closeNode())}renderText(b,g){b.openNode(this.tag,{type:g.operator,dxfId:g.dxfId,priority:g.priority,operator:o.toStringAttribute(g.operator,"containsText")});const S=(C=>{if(C.formulae&&C.formulae[0])return C.formulae[0];const I=new n(C.ref),{tl:D}=I;switch(C.operator){case"containsText":return`NOT(ISERROR(SEARCH("${C.text}",${D})))`;case"containsBlanks":return`LEN(TRIM(${D}))=0`;case"notContainsBlanks":return`LEN(TRIM(${D}))>0`;case"containsErrors":return`ISERROR(${D})`;case"notContainsErrors":return`NOT(ISERROR(${D}))`;default:return}})(g);S&&this.formulaXform.render(b,S),b.closeNode()}renderTimePeriod(b,g){b.openNode(this.tag,{type:"timePeriod",dxfId:g.dxfId,priority:g.priority,timePeriod:g.timePeriod});const S=(C=>{if(C.formulae&&C.formulae[0])return C.formulae[0];const I=new n(C.ref),{tl:D}=I;switch(C.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${D},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${D},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${D},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${D},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${D},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${D},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${D},1)=TODAY()-1`;case"today":return`FLOOR(${D},1)=TODAY()`;case"tomorrow":return`FLOOR(${D},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${D},1)<=6,FLOOR(${D},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${D})=MONTH(EDATE(TODAY(),0-1)),YEAR(${D})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${D})=MONTH(TODAY()),YEAR(${D})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${D})=MONTH(EDATE(TODAY(),0+1)),YEAR(${D})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(g);S&&this.formulaXform.render(b,S),b.closeNode()}createNewModel(b){let{attributes:g}=b;return{...p(g),dxfId:o.toIntValue(g.dxfId),priority:o.toIntValue(g.priority),timePeriod:g.timePeriod,percent:o.toBoolValue(g.percent),bottom:o.toBoolValue(g.bottom),rank:o.toIntValue(g.rank),aboveAverage:o.toBoolValue(g.aboveAverage)}}onParserClose(b,g){switch(b){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,g.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(g.model)}}}l.exports=m},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{get tag(){return"cfvo"}render(r,n){r.leafNode(this.tag,{type:n.type,val:n.value})}parseOpen(r){this.model={type:r.attributes.type,value:o.toFloatValue(r.attributes.val)}}parseClose(r){return r!==this.tag}}},{"../../base-xform":32}],85:[function(t,l,c){const o=t("../../composite-xform"),r=t("../../style/color-xform"),n=t("./cfvo-xform");l.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new n,color:this.colorXform=new r}}get tag(){return"colorScale"}render(s,e){s.openNode(this.tag),e.cfvo.forEach(i=>{this.cfvoXform.render(s,i)}),e.color.forEach(i=>{this.colorXform.render(s,i)}),s.closeNode()}createNewModel(s){return{cfvo:[],color:[]}}onParserClose(s,e){this.model[s].push(e.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(t,l,c){const o=t("../../composite-xform"),r=t("./cf-rule-xform");l.exports=class extends o{constructor(){super(),this.map={cfRule:new r}}get tag(){return"conditionalFormatting"}render(n,s){s.rules.some(r.isPrimitive)&&(n.openNode(this.tag,{sqref:s.ref}),s.rules.forEach(e=>{r.isPrimitive(e)&&(e.ref=s.ref,this.map.cfRule.render(n,e))}),n.closeNode())}createNewModel(n){let{attributes:s}=n;return{ref:s.sqref,rules:[]}}onParserClose(n,s){this.model.rules.push(s.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(t,l,c){const o=t("../../base-xform"),r=t("./conditional-formatting-xform");l.exports=class extends o{constructor(){super(),this.cfXform=new r}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(n,s){let e=n.reduce((i,u)=>Math.max(i,...u.rules.map(a=>a.priority||0)),1);n.forEach(i=>{i.rules.forEach(u=>{u.priority||(u.priority=e++),u.style&&(u.dxfId=s.styles.addDxfStyle(u.style))})})}render(n,s){s.forEach(e=>{this.cfXform.render(n,e)})}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(!!this.parser.parseClose(n)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(n,s){n.forEach(e=>{e.rules.forEach(i=>{i.dxfId!==void 0&&(i.style=s.styles.getDxfStyle(i.dxfId),delete i.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(t,l,c){const o=t("../../composite-xform"),r=t("../../style/color-xform"),n=t("./cfvo-xform");l.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new n,color:this.colorXform=new r}}get tag(){return"dataBar"}render(s,e){s.openNode(this.tag),e.cfvo.forEach(i=>{this.cfvoXform.render(s,i)}),this.colorXform.render(s,e.color),s.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(s,e){switch(s){case"cfvo":this.model.cfvo.push(e.model);break;case"color":this.model.color=e.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(t,l,c){const o=t("../../base-xform"),r=t("../../composite-xform");class n extends o{get tag(){return"x14:id"}render(i,u){i.leafNode(this.tag,null,u)}parseOpen(){this.model=""}parseText(i){this.model+=i}parseClose(i){return i!==this.tag}}class s extends r{constructor(){super(),this.map={"x14:id":this.idXform=new n}}get tag(){return"ext"}render(i,u){i.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(i,u.x14Id),i.closeNode()}createNewModel(){return{}}onParserClose(i,u){this.model.x14Id=u.model}}l.exports=class extends r{constructor(){super(),this.map={ext:new s}}get tag(){return"extLst"}render(e,i){e.openNode(this.tag),this.map.ext.render(e,i),e.closeNode()}createNewModel(){return{}}onParserClose(e,i){Object.assign(this.model,i.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(t,l,c){const o=t("../../base-xform");l.exports=class extends o{get tag(){return"formula"}render(r,n){r.leafNode(this.tag,null,n)}parseOpen(){this.model=""}parseText(r){this.model+=r}parseClose(r){return r!==this.tag}}},{"../../base-xform":32}],91:[function(t,l,c){const o=t("../../base-xform"),r=t("../../composite-xform"),n=t("./cfvo-xform");l.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new n}}get tag(){return"iconSet"}render(s,e){s.openNode(this.tag,{iconSet:o.toStringAttribute(e.iconSet,"3TrafficLights"),reverse:o.toBoolAttribute(e.reverse,!1),showValue:o.toBoolAttribute(e.showValue,!0)}),e.cfvo.forEach(i=>{this.cfvoXform.render(s,i)}),s.closeNode()}createNewModel(s){let{attributes:e}=s;return{iconSet:o.toStringValue(e.iconSet,"3TrafficLights"),reverse:o.toBoolValue(e.reverse),showValue:o.toBoolValue(e.showValue),cfvo:[]}}onParserClose(s,e){this.model[s].push(e.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(t,l,c){const o=t("../../../utils/utils"),r=t("../base-xform");l.exports=class extends r{get tag(){return"col"}prepare(n,s){const e=s.styles.addStyleModel(n.style||{});e&&(n.styleId=e)}render(n,s){n.openNode("col"),n.addAttribute("min",s.min),n.addAttribute("max",s.max),s.width&&n.addAttribute("width",s.width),s.styleId&&n.addAttribute("style",s.styleId),s.hidden&&n.addAttribute("hidden","1"),s.bestFit&&n.addAttribute("bestFit","1"),s.outlineLevel&&n.addAttribute("outlineLevel",s.outlineLevel),s.collapsed&&n.addAttribute("collapsed","1"),n.addAttribute("customWidth","1"),n.closeNode()}parseOpen(n){if(n.name==="col"){const s=this.model={min:parseInt(n.attributes.min||"0",10),max:parseInt(n.attributes.max||"0",10),width:n.attributes.width===void 0?void 0:parseFloat(n.attributes.width||"0")};return n.attributes.style&&(s.styleId=parseInt(n.attributes.style,10)),o.parseBoolean(n.attributes.hidden)&&(s.hidden=!0),o.parseBoolean(n.attributes.bestFit)&&(s.bestFit=!0),n.attributes.outlineLevel&&(s.outlineLevel=parseInt(n.attributes.outlineLevel,10)),o.parseBoolean(n.attributes.collapsed)&&(s.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(n,s){n.styleId&&(n.style=s.styles.getStyleModel(n.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../../../utils/utils"),n=t("../../../utils/col-cache"),s=t("../base-xform"),e=t("../../../doc/range");function i(a,h,p,m){const d=h[p];d!==void 0?a[p]=d:m!==void 0&&(a[p]=m)}function u(a,h,p,m){const d=h[p];d!==void 0&&(a[p]=r.parseBoolean(d))}l.exports=class extends s{get tag(){return"dataValidations"}render(a,h){const p=(function(m){const d=o.map(m,(S,C)=>({address:C,dataValidation:S,marked:!1})).sort((S,C)=>o.strcmp(S.address,C.address)),b=o.keyBy(d,"address"),g=(S,C,I)=>{for(let D=0;D<C;D++){const z=n.encodeAddress(S.row+D,I);if(!m[z]||!o.isEqual(m[S.address],m[z]))return!1}return!0};return d.map(S=>{if(!S.marked){const C=n.decodeEx(S.address);if(C.dimensions)return b[C.dimensions].marked=!0,{...S.dataValidation,sqref:S.address};let I=1,D=n.encodeAddress(C.row+I,C.col);for(;m[D]&&o.isEqual(S.dataValidation,m[D]);)I++,D=n.encodeAddress(C.row+I,C.col);let z=1;for(;g(C,I,C.col+z);)z++;for(let P=0;P<I;P++)for(let B=0;B<z;B++)D=n.encodeAddress(C.row+P,C.col+B),b[D].marked=!0;if(I>1||z>1){const P=C.row+(I-1),B=C.col+(z-1);return{...S.dataValidation,sqref:`${S.address}:${n.encodeAddress(P,B)}`}}return{...S.dataValidation,sqref:S.address}}return null}).filter(Boolean)})(h);p.length&&(a.openNode("dataValidations",{count:p.length}),p.forEach(m=>{a.openNode("dataValidation"),m.type!=="any"&&(a.addAttribute("type",m.type),m.operator&&m.type!=="list"&&m.operator!=="between"&&a.addAttribute("operator",m.operator),m.allowBlank&&a.addAttribute("allowBlank","1")),m.showInputMessage&&a.addAttribute("showInputMessage","1"),m.promptTitle&&a.addAttribute("promptTitle",m.promptTitle),m.prompt&&a.addAttribute("prompt",m.prompt),m.showErrorMessage&&a.addAttribute("showErrorMessage","1"),m.errorStyle&&a.addAttribute("errorStyle",m.errorStyle),m.errorTitle&&a.addAttribute("errorTitle",m.errorTitle),m.error&&a.addAttribute("error",m.error),a.addAttribute("sqref",m.sqref),(m.formulae||[]).forEach((d,b)=>{a.openNode("formula"+(b+1)),m.type==="date"?a.writeText(r.dateToExcel(new Date(d))):a.writeText(d),a.closeNode()}),a.closeNode()}),a.closeNode())}parseOpen(a){switch(a.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=a.attributes.sqref;const h={type:a.attributes.type||"any",formulae:[]};switch(a.attributes.type&&u(h,a.attributes,"allowBlank"),u(h,a.attributes,"showInputMessage"),u(h,a.attributes,"showErrorMessage"),h.type){case"any":case"list":case"custom":break;default:i(h,a.attributes,"operator","between")}return i(h,a.attributes,"promptTitle"),i(h,a.attributes,"prompt"),i(h,a.attributes,"errorStyle"),i(h,a.attributes,"errorTitle"),i(h,a.attributes,"error"),this._dataValidation=h,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(a){this._formula&&this._formula.push(a)}parseClose(a){switch(a){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(h=>{h.includes(":")?new e(h).forEachAddress(p=>{this.model[p]=this._dataValidation}):this.model[h]=this._dataValidation}),!0;case"formula1":case"formula2":{let h=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":h=parseInt(h,10);break;case"decimal":h=parseFloat(h);break;case"date":h=r.excelToDate(parseFloat(h))}return this._dataValidation.formulae.push(h),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"dimension"}render(r,n){n&&r.leafNode("dimension",{ref:n})}parseOpen(r){return r.name==="dimension"&&(this.model=r.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"drawing"}render(r,n){n&&r.leafNode(this.tag,{"r:id":n.rId})}parseOpen(r){switch(r.name){case this.tag:return this.model={rId:r.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(t,l,c){const o=t("../composite-xform"),r=t("./cf-ext/conditional-formattings-ext-xform");class n extends o{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new r}}get tag(){return"ext"}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,i){this.conditionalFormattings.prepare(e.conditionalFormattings,i)}render(e,i){e.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(e,i.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,i){this.model[e]=i.model}}l.exports=class extends o{constructor(){super(),this.map={ext:this.ext=new n}}get tag(){return"extLst"}prepare(s,e){this.ext.prepare(s,e)}hasContent(s){return this.ext.hasContent(s)}render(s,e){this.hasContent(e)&&(s.openNode("extLst"),this.ext.render(s,e),s.closeNode())}createNewModel(){return{}}onParserClose(s,e){Object.assign(this.model,e.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"headerFooter"}render(r,n){if(n){r.addRollback();let s=!1;r.openNode("headerFooter"),n.differentFirst&&(r.addAttribute("differentFirst","1"),s=!0),n.differentOddEven&&(r.addAttribute("differentOddEven","1"),s=!0),n.oddHeader&&typeof n.oddHeader=="string"&&(r.leafNode("oddHeader",null,n.oddHeader),s=!0),n.oddFooter&&typeof n.oddFooter=="string"&&(r.leafNode("oddFooter",null,n.oddFooter),s=!0),n.evenHeader&&typeof n.evenHeader=="string"&&(r.leafNode("evenHeader",null,n.evenHeader),s=!0),n.evenFooter&&typeof n.evenFooter=="string"&&(r.leafNode("evenFooter",null,n.evenFooter),s=!0),n.firstHeader&&typeof n.firstHeader=="string"&&(r.leafNode("firstHeader",null,n.firstHeader),s=!0),n.firstFooter&&typeof n.firstFooter=="string"&&(r.leafNode("firstFooter",null,n.firstFooter),s=!0),s?(r.closeNode(),r.commit()):r.rollback()}}parseOpen(r){switch(r.name){case"headerFooter":return this.model={},r.attributes.differentFirst&&(this.model.differentFirst=parseInt(r.attributes.differentFirst,0)===1),r.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(r.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(r){switch(this.currentNode){case"oddHeader":this.model.oddHeader=r;break;case"oddFooter":this.model.oddFooter=r;break;case"evenHeader":this.model.evenHeader=r;break;case"evenFooter":this.model.evenFooter=r;break;case"firstHeader":this.model.firstHeader=r;break;case"firstFooter":this.model.firstFooter=r}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"hyperlink"}render(r,n){this.isInternalLink(n)?r.leafNode("hyperlink",{ref:n.address,"r:id":n.rId,tooltip:n.tooltip,location:n.target}):r.leafNode("hyperlink",{ref:n.address,"r:id":n.rId,tooltip:n.tooltip})}parseOpen(r){return r.name==="hyperlink"&&(this.model={address:r.attributes.ref,rId:r.attributes["r:id"],tooltip:r.attributes.tooltip},r.attributes.location&&(this.model.target=r.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(r){return r.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(r.target)}}},{"../base-xform":32}],99:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"mergeCell"}render(r,n){r.leafNode("mergeCell",{ref:n})}parseOpen(r){return r.name==="mergeCell"&&(this.model=r.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../../../doc/range"),n=t("../../../utils/col-cache"),s=t("../../../doc/enums");l.exports=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{const i=`${e.master}:${e.address}`;this.merges[e.master]=new r(i)}}get mergeCells(){return o.map(this.merges,e=>e.range)}reconcile(e,i){o.each(e,u=>{const a=n.decode(u);for(let h=a.top;h<=a.bottom;h++){const p=i[h-1];for(let m=a.left;m<=a.right;m++){const d=p.cells[m-1];d?d.type===s.ValueType.Merge&&(d.master=a.tl):p.cells[m]={type:s.ValueType.Null,address:n.encodeAddress(h,m)}}}})}getMasterAddress(e){const i=this.hash[e];return i&&i.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(t,l,c){const o=t("../base-xform"),r=n=>n!==void 0;l.exports=class extends o{get tag(){return"outlinePr"}render(n,s){return!(!s||!r(s.summaryBelow)&&!r(s.summaryRight))&&(n.leafNode(this.tag,{summaryBelow:r(s.summaryBelow)?Number(s.summaryBelow):void 0,summaryRight:r(s.summaryRight)?Number(s.summaryRight):void 0}),!0)}parseOpen(n){return n.name===this.tag&&(this.model={summaryBelow:r(n.attributes.summaryBelow)?!!Number(n.attributes.summaryBelow):void 0,summaryRight:r(n.attributes.summaryRight)?!!Number(n.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"brk"}render(r,n){r.leafNode("brk",n)}parseOpen(r){return r.name==="brk"&&(this.model=r.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../base-xform");l.exports=class extends r{get tag(){return"pageMargins"}render(n,s){if(s){const e={left:s.left,right:s.right,top:s.top,bottom:s.bottom,header:s.header,footer:s.footer};o.some(e,i=>i!==void 0)&&n.leafNode(this.tag,e)}}parseOpen(n){switch(n.name){case this.tag:return this.model={left:parseFloat(n.attributes.left||.7),right:parseFloat(n.attributes.right||.7),top:parseFloat(n.attributes.top||.75),bottom:parseFloat(n.attributes.bottom||.75),header:parseFloat(n.attributes.header||.3),footer:parseFloat(n.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"pageSetUpPr"}render(r,n){return!(!n||!n.fitToPage)&&(r.leafNode(this.tag,{fitToPage:n.fitToPage?"1":void 0}),!0)}parseOpen(r){return r.name===this.tag&&(this.model={fitToPage:r.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../base-xform");function n(u){return u?"1":void 0}function s(u){switch(u){case"overThenDown":return u;default:return}}function e(u){switch(u){case"atEnd":case"asDisplyed":return u;default:return}}function i(u){switch(u){case"dash":case"blank":case"NA":return u;default:return}}l.exports=class extends r{get tag(){return"pageSetup"}render(u,a){if(a){const h={paperSize:a.paperSize,orientation:a.orientation,horizontalDpi:a.horizontalDpi,verticalDpi:a.verticalDpi,pageOrder:s(a.pageOrder),blackAndWhite:n(a.blackAndWhite),draft:n(a.draft),cellComments:e(a.cellComments),errors:i(a.errors),scale:a.scale,fitToWidth:a.fitToWidth,fitToHeight:a.fitToHeight,firstPageNumber:a.firstPageNumber,useFirstPageNumber:n(a.firstPageNumber),usePrinterDefaults:n(a.usePrinterDefaults),copies:a.copies};o.some(h,p=>p!==void 0)&&u.leafNode(this.tag,h)}}parseOpen(u){switch(u.name){case this.tag:return this.model={paperSize:(a=u.attributes.paperSize,a!==void 0?parseInt(a,10):void 0),orientation:u.attributes.orientation||"portrait",horizontalDpi:parseInt(u.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(u.attributes.verticalDpi||"4294967295",10),pageOrder:u.attributes.pageOrder||"downThenOver",blackAndWhite:u.attributes.blackAndWhite==="1",draft:u.attributes.draft==="1",cellComments:u.attributes.cellComments||"None",errors:u.attributes.errors||"displayed",scale:parseInt(u.attributes.scale||"100",10),fitToWidth:parseInt(u.attributes.fitToWidth||"1",10),fitToHeight:parseInt(u.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(u.attributes.firstPageNumber||"1",10),useFirstPageNumber:u.attributes.useFirstPageNumber==="1",usePrinterDefaults:u.attributes.usePrinterDefaults==="1",copies:parseInt(u.attributes.copies||"1",10)},!0;default:return!1}var a}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"picture"}render(r,n){n&&r.leafNode(this.tag,{"r:id":n.rId})}parseOpen(r){switch(r.name){case this.tag:return this.model={rId:r.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../base-xform");function n(s){return s?"1":void 0}l.exports=class extends r{get tag(){return"printOptions"}render(s,e){if(e){const i={headings:n(e.showRowColHeaders),gridLines:n(e.showGridLines),horizontalCentered:n(e.horizontalCentered),verticalCentered:n(e.verticalCentered)};o.some(i,u=>u!==void 0)&&s.leafNode(this.tag,i)}}parseOpen(s){switch(s.name){case this.tag:return this.model={showRowColHeaders:s.attributes.headings==="1",showGridLines:s.attributes.gridLines==="1",horizontalCentered:s.attributes.horizontalCentered==="1",verticalCentered:s.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(t,l,c){const o=t("./page-breaks-xform"),r=t("../list-xform");l.exports=class extends r{constructor(){super({tag:"rowBreaks",count:!0,childXform:new o})}render(n,s){if(s&&s.length){n.openNode(this.tag,this.$),this.count&&(n.addAttribute(this.$count,s.length),n.addAttribute("manualBreakCount",s.length));const{childXform:e}=this;s.forEach(i=>{e.render(n,i)}),n.closeNode()}else this.empty&&n.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(t,l,c){const o=t("../base-xform"),r=t("../../../utils/utils"),n=t("./cell-xform");l.exports=class extends o{constructor(s){super(),this.maxItems=s&&s.maxItems,this.map={c:new n}}get tag(){return"row"}prepare(s,e){const i=e.styles.addStyleModel(s.style);i&&(s.styleId=i);const u=this.map.c;s.cells.forEach(a=>{u.prepare(a,e)})}render(s,e,i){s.openNode("row"),s.addAttribute("r",e.number),e.height&&(s.addAttribute("ht",e.height),s.addAttribute("customHeight","1")),e.hidden&&s.addAttribute("hidden","1"),e.min>0&&e.max>0&&e.min<=e.max&&s.addAttribute("spans",`${e.min}:${e.max}`),e.styleId&&(s.addAttribute("s",e.styleId),s.addAttribute("customFormat","1")),s.addAttribute("x14ac:dyDescent","0.25"),e.outlineLevel&&s.addAttribute("outlineLevel",e.outlineLevel),e.collapsed&&s.addAttribute("collapsed","1");const u=this.map.c;e.cells.forEach(a=>{u.render(s,a,i)}),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;if(s.name==="row"){this.numRowsSeen+=1;const e=s.attributes.spans?s.attributes.spans.split(":").map(u=>parseInt(u,10)):[void 0,void 0],i=this.model={number:parseInt(s.attributes.r,10),min:e[0],max:e[1],cells:[]};return s.attributes.s&&(i.styleId=parseInt(s.attributes.s,10)),r.parseBoolean(s.attributes.hidden)&&(i.hidden=!0),r.parseBoolean(s.attributes.bestFit)&&(i.bestFit=!0),s.attributes.ht&&(i.height=parseFloat(s.attributes.ht)),s.attributes.outlineLevel&&(i.outlineLevel=parseInt(s.attributes.outlineLevel,10)),r.parseBoolean(s.attributes.collapsed)&&(i.collapsed=!0),!0}return this.parser=this.map[s.name],!!this.parser&&(this.parser.parseOpen(s),!0)}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser){if(!this.parser.parseClose(s)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(s,e){s.style=s.styleId?e.styles.getStyleModel(s.styleId):{},s.styleId!==void 0&&(s.styleId=void 0);const i=this.map.c;s.cells.forEach(u=>{i.reconcile(u,e)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../base-xform");l.exports=class extends r{get tag(){return"sheetFormatPr"}render(n,s){if(s){const e={defaultRowHeight:s.defaultRowHeight,outlineLevelRow:s.outlineLevelRow,outlineLevelCol:s.outlineLevelCol,"x14ac:dyDescent":s.dyDescent};s.defaultColWidth&&(e.defaultColWidth=s.defaultColWidth),s.defaultRowHeight&&s.defaultRowHeight===15||(e.customHeight="1"),o.some(e,i=>i!==void 0)&&n.leafNode("sheetFormatPr",e)}}parseOpen(n){return n.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(n.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(n.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(n.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(n.attributes.outlineLevelCol||"0",10)},n.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(n.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(t,l,c){const o=t("../base-xform"),r=t("../style/color-xform"),n=t("./page-setup-properties-xform"),s=t("./outline-properties-xform");l.exports=class extends o{constructor(){super(),this.map={tabColor:new r("tabColor"),pageSetUpPr:new n,outlinePr:new s}}get tag(){return"sheetPr"}render(e,i){if(i){e.addRollback(),e.openNode("sheetPr");let u=!1;u=this.map.tabColor.render(e,i.tabColor)||u,u=this.map.pageSetUpPr.render(e,i.pageSetup)||u,u=this.map.outlinePr.render(e,i.outlineProperties)||u,u?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../base-xform");function n(e,i){return e?i:void 0}function s(e,i){return e===i||void 0}l.exports=class extends r{get tag(){return"sheetProtection"}render(e,i){if(i){const u={sheet:n(i.sheet,"1"),selectLockedCells:i.selectLockedCells===!1?"1":void 0,selectUnlockedCells:i.selectUnlockedCells===!1?"1":void 0,formatCells:n(i.formatCells,"0"),formatColumns:n(i.formatColumns,"0"),formatRows:n(i.formatRows,"0"),insertColumns:n(i.insertColumns,"0"),insertRows:n(i.insertRows,"0"),insertHyperlinks:n(i.insertHyperlinks,"0"),deleteColumns:n(i.deleteColumns,"0"),deleteRows:n(i.deleteRows,"0"),sort:n(i.sort,"0"),autoFilter:n(i.autoFilter,"0"),pivotTables:n(i.pivotTables,"0")};i.sheet&&(u.algorithmName=i.algorithmName,u.hashValue=i.hashValue,u.saltValue=i.saltValue,u.spinCount=i.spinCount,u.objects=n(i.objects===!1,"1"),u.scenarios=n(i.scenarios===!1,"1")),o.some(u,a=>a!==void 0)&&e.leafNode(this.tag,u)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:s(e.attributes.sheet,"1"),objects:e.attributes.objects!=="1"&&void 0,scenarios:e.attributes.scenarios!=="1"&&void 0,selectLockedCells:e.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:e.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:s(e.attributes.formatCells,"0"),formatColumns:s(e.attributes.formatColumns,"0"),formatRows:s(e.attributes.formatRows,"0"),insertColumns:s(e.attributes.insertColumns,"0"),insertRows:s(e.attributes.insertRows,"0"),insertHyperlinks:s(e.attributes.insertHyperlinks,"0"),deleteColumns:s(e.attributes.deleteColumns,"0"),deleteRows:s(e.attributes.deleteRows,"0"),sort:s(e.attributes.sort,"0"),autoFilter:s(e.attributes.autoFilter,"0"),pivotTables:s(e.attributes.pivotTables,"0")},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(t,l,c){const o=t("../../../utils/col-cache"),r=t("../base-xform"),n={frozen:"frozen",frozenSplit:"frozen",split:"split"};l.exports=class extends r{get tag(){return"sheetView"}prepare(s){switch(s.state){case"frozen":case"split":break;default:s.state="normal"}}render(s,e){s.openNode("sheetView",{workbookViewId:e.workbookViewId||0});const i=function(m,d,b){b&&s.addAttribute(m,d)};let u,a,h,p;switch(i("rightToLeft","1",e.rightToLeft===!0),i("tabSelected","1",e.tabSelected),i("showRuler","0",e.showRuler===!1),i("showRowColHeaders","0",e.showRowColHeaders===!1),i("showGridLines","0",e.showGridLines===!1),i("zoomScale",e.zoomScale,e.zoomScale),i("zoomScaleNormal",e.zoomScaleNormal,e.zoomScaleNormal),i("view",e.style,e.style),e.state){case"frozen":a=e.xSplit||0,h=e.ySplit||0,u=e.topLeftCell||o.getAddress(h+1,a+1).address,p=(e.xSplit&&e.ySplit?"bottomRight":e.xSplit&&"topRight")||"bottomLeft",s.leafNode("pane",{xSplit:e.xSplit||void 0,ySplit:e.ySplit||void 0,topLeftCell:u,activePane:p,state:"frozen"}),s.leafNode("selection",{pane:p,activeCell:e.activeCell,sqref:e.activeCell});break;case"split":e.activePane==="topLeft"&&(e.activePane=void 0),s.leafNode("pane",{xSplit:e.xSplit||void 0,ySplit:e.ySplit||void 0,topLeftCell:e.topLeftCell,activePane:e.activePane}),s.leafNode("selection",{pane:e.activePane,activeCell:e.activeCell,sqref:e.activeCell});break;case"normal":e.activeCell&&s.leafNode("selection",{activeCell:e.activeCell,sqref:e.activeCell})}s.closeNode()}parseOpen(s){switch(s.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(s.attributes.workbookViewId,10),rightToLeft:s.attributes.rightToLeft==="1",tabSelected:s.attributes.tabSelected==="1",showRuler:s.attributes.showRuler!=="0",showRowColHeaders:s.attributes.showRowColHeaders!=="0",showGridLines:s.attributes.showGridLines!=="0",zoomScale:parseInt(s.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(s.attributes.zoomScaleNormal||"100",10),style:s.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(s.attributes.xSplit||"0",10),ySplit:parseInt(s.attributes.ySplit||"0",10),topLeftCell:s.attributes.topLeftCell,activePane:s.attributes.activePane||"topLeft",state:s.attributes.state},!0;case"selection":{const e=s.attributes.pane||"topLeft";return this.selections[e]={pane:e,activeCell:s.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(s){let e,i;switch(s){case"sheetView":return this.sheetView&&this.pane?(e=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:n[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(e.activePane=this.pane.activePane),i=this.selections[this.pane.activePane],i&&i.activeCell&&(e.activeCell=i.activeCell),this.sheetView.style&&(e.style=this.sheetView.style)):(e=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},i=this.selections.topLeft,i&&i.activeCell&&(e.activeCell=i.activeCell),this.sheetView.style&&(e.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"tablePart"}render(r,n){n&&r.leafNode(this.tag,{"r:id":n.rId})}parseOpen(r){switch(r.name){case this.tag:return this.model={rId:r.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../../../utils/col-cache"),n=t("../../../utils/xml-stream"),s=t("../../rel-type"),e=t("./merges"),i=t("../base-xform"),u=t("../list-xform"),a=t("./row-xform"),h=t("./col-xform"),p=t("./dimension-xform"),m=t("./hyperlink-xform"),d=t("./merge-cell-xform"),b=t("./data-validations-xform"),g=t("./sheet-properties-xform"),S=t("./sheet-format-properties-xform"),C=t("./sheet-view-xform"),I=t("./sheet-protection-xform"),D=t("./page-margins-xform"),z=t("./page-setup-xform"),P=t("./print-options-xform"),B=t("./auto-filter-xform"),F=t("./picture-xform"),W=t("./drawing-xform"),q=t("./table-part-xform"),A=t("./row-breaks-xform"),M=t("./header-footer-xform"),k=t("./cf/conditional-formattings-xform"),y=t("./ext-lst-xform"),w=(_,T)=>{if(!T||!T.length)return _;if(!_||!_.length)return T;const O={},j={};return _.forEach(V=>{O[V.ref]=V,V.rules.forEach(X=>{const{x14Id:J}=X;J&&(j[J]=X)})}),T.forEach(V=>{V.rules.forEach(X=>{const J=j[X.x14Id];J?((L,G)=>{Object.keys(G).forEach(N=>{const R=L[N],U=G[N];R===void 0&&U!==void 0&&(L[N]=U)})})(J,X):O[V.ref]?O[V.ref].rules.push(X):_.push({ref:V.ref,rules:[X]})})}),_};class x extends i{constructor(T){super();const{maxRows:O,maxCols:j,ignoreNodes:V}=T||{};this.ignoreNodes=V||[],this.map={sheetPr:new g,dimension:new p,sheetViews:new u({tag:"sheetViews",count:!1,childXform:new C}),sheetFormatPr:new S,cols:new u({tag:"cols",count:!1,childXform:new h}),sheetData:new u({tag:"sheetData",count:!1,empty:!0,childXform:new a({maxItems:j}),maxItems:O}),autoFilter:new B,mergeCells:new u({tag:"mergeCells",count:!0,childXform:new d}),rowBreaks:new A,hyperlinks:new u({tag:"hyperlinks",count:!1,childXform:new m}),pageMargins:new D,dataValidations:new b,pageSetup:new z,headerFooter:new M,printOptions:new P,picture:new F,drawing:new W,sheetProtection:new I,tableParts:new u({tag:"tableParts",count:!0,childXform:new q}),conditionalFormatting:new k,extLst:new y}}prepare(T,O){O.merges=new e,T.hyperlinks=O.hyperlinks=[],T.comments=O.comments=[],O.formulae={},O.siFormulae=0,this.map.cols.prepare(T.cols,O),this.map.sheetData.prepare(T.rows,O),this.map.conditionalFormatting.prepare(T.conditionalFormattings,O),T.mergeCells=O.merges.mergeCells;const j=T.rels=[];function V(L){return"rId"+(L.length+1)}if(T.hyperlinks.forEach(L=>{const G=V(j);L.rId=G,j.push({Id:G,Type:s.Hyperlink,Target:L.target,TargetMode:"External"})}),T.comments.length>0){const L={Id:V(j),Type:s.Comments,Target:`../comments${T.id}.xml`};j.push(L);const G={Id:V(j),Type:s.VmlDrawing,Target:`../drawings/vmlDrawing${T.id}.vml`};j.push(G),T.comments.forEach(N=>{N.refAddress=r.decodeAddress(N.ref)}),O.commentRefs.push({commentName:"comments"+T.id,vmlDrawing:"vmlDrawing"+T.id})}const X=[];let J;T.media.forEach(L=>{if(L.type==="background"){const G=V(j);J=O.media[L.imageId],j.push({Id:G,Type:s.Image,Target:`../media/${J.name}.${J.extension}`}),T.background={rId:G},T.image=O.media[L.imageId]}else if(L.type==="image"){let{drawing:G}=T;J=O.media[L.imageId],G||(G=T.drawing={rId:V(j),name:"drawing"+ ++O.drawingsCount,anchors:[],rels:[]},O.drawings.push(G),j.push({Id:G.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${G.name}.xml`}));let N=this.preImageId===L.imageId?X[L.imageId]:X[G.rels.length];N||(N=V(G.rels),X[G.rels.length]=N,G.rels.push({Id:N,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${J.name}.${J.extension}`}));const R={picture:{rId:N},range:L.range};if(L.hyperlinks&&L.hyperlinks.hyperlink){const U=V(G.rels);X[G.rels.length]=U,R.picture.hyperlinks={tooltip:L.hyperlinks.tooltip,rId:U},G.rels.push({Id:U,Type:s.Hyperlink,Target:L.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=L.imageId,G.anchors.push(R)}}),T.tables.forEach(L=>{const G=V(j);L.rId=G,j.push({Id:G,Type:s.Table,Target:"../tables/"+L.target}),L.columns.forEach(N=>{const{style:R}=N;R&&(N.dxfId=O.styles.addDxfStyle(R))})}),this.map.extLst.prepare(T,O)}render(T,O){T.openXml(n.StdDocAttributes),T.openNode("worksheet",x.WORKSHEET_ATTRIBUTES);const j=O.properties?{defaultRowHeight:O.properties.defaultRowHeight,dyDescent:O.properties.dyDescent,outlineLevelCol:O.properties.outlineLevelCol,outlineLevelRow:O.properties.outlineLevelRow}:void 0;O.properties&&O.properties.defaultColWidth&&(j.defaultColWidth=O.properties.defaultColWidth);const V={outlineProperties:O.properties&&O.properties.outlineProperties,tabColor:O.properties&&O.properties.tabColor,pageSetup:O.pageSetup&&O.pageSetup.fitToPage?{fitToPage:O.pageSetup.fitToPage}:void 0},X=O.pageSetup&&O.pageSetup.margins,J={showRowColHeaders:O.pageSetup&&O.pageSetup.showRowColHeaders,showGridLines:O.pageSetup&&O.pageSetup.showGridLines,horizontalCentered:O.pageSetup&&O.pageSetup.horizontalCentered,verticalCentered:O.pageSetup&&O.pageSetup.verticalCentered},L=O.sheetProtection;this.map.sheetPr.render(T,V),this.map.dimension.render(T,O.dimensions),this.map.sheetViews.render(T,O.views),this.map.sheetFormatPr.render(T,j),this.map.cols.render(T,O.cols),this.map.sheetData.render(T,O.rows),this.map.sheetProtection.render(T,L),this.map.autoFilter.render(T,O.autoFilter),this.map.mergeCells.render(T,O.mergeCells),this.map.conditionalFormatting.render(T,O.conditionalFormattings),this.map.dataValidations.render(T,O.dataValidations),this.map.hyperlinks.render(T,O.hyperlinks),this.map.printOptions.render(T,J),this.map.pageMargins.render(T,X),this.map.pageSetup.render(T,O.pageSetup),this.map.headerFooter.render(T,O.headerFooter),this.map.rowBreaks.render(T,O.rowBreaks),this.map.drawing.render(T,O.drawing),this.map.picture.render(T,O.background),this.map.tableParts.render(T,O.tables),this.map.extLst.render(T,O),O.rels&&O.rels.forEach(G=>{G.Type===s.VmlDrawing&&T.leafNode("legacyDrawing",{"r:id":G.Id})}),T.closeNode()}parseOpen(T){return this.parser?(this.parser.parseOpen(T),!0):T.name==="worksheet"?(o.each(this.map,O=>{O.reset()}),!0):(this.map[T.name]&&!this.ignoreNodes.includes(T.name)&&(this.parser=this.map[T.name],this.parser.parseOpen(T)),!0)}parseText(T){this.parser&&this.parser.parseText(T)}parseClose(T){if(this.parser)return this.parser.parseClose(T)||(this.parser=void 0),!0;switch(T){case"worksheet":{const O=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(O.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(O.outlineProperties=this.map.sheetPr.model.outlineProperties);const j={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},V=Object.assign(j,this.map.pageSetup.model,this.map.printOptions.model),X=w(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:O,views:this.map.sheetViews.model,pageSetup:V,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:X},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(T,O){const j=(T.relationships||[]).reduce((X,J)=>{if(X[J.Id]=J,J.Type===s.Comments&&(T.comments=O.comments[J.Target].comments),J.Type===s.VmlDrawing&&T.comments&&T.comments.length){const L=O.vmlDrawings[J.Target].comments;T.comments.forEach((G,N)=>{G.note=Object.assign({},G.note,L[N])})}return X},{});if(O.commentsMap=(T.comments||[]).reduce((X,J)=>(J.ref&&(X[J.ref]=J),X),{}),O.hyperlinkMap=(T.hyperlinks||[]).reduce((X,J)=>(J.rId&&(X[J.address]=j[J.rId].Target),X),{}),O.formulae={},T.rows=T.rows&&T.rows.filter(Boolean)||[],T.rows.forEach(X=>{X.cells=X.cells&&X.cells.filter(Boolean)||[]}),this.map.cols.reconcile(T.cols,O),this.map.sheetData.reconcile(T.rows,O),this.map.conditionalFormatting.reconcile(T.conditionalFormattings,O),T.media=[],T.drawing){const X=j[T.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(X){const J=X[1];O.drawings[J].anchors.forEach(L=>{if(L.medium){const G={type:"image",imageId:L.medium.index,range:L.range,hyperlinks:L.picture.hyperlinks};T.media.push(G)}})}}const V=T.background&&j[T.background.rId];if(V){const X=V.Target.split("/media/")[1],J=O.mediaIndex&&O.mediaIndex[X];J!==void 0&&T.media.push({type:"background",imageId:J})}T.tables=(T.tables||[]).map(X=>{const J=j[X.rId];return O.tables[J.Target]}),delete T.relationships,delete T.hyperlinks,delete T.comments}}x.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},l.exports=x},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.attr=r.attr}render(r,n){n&&(r.openNode(this.tag),r.closeNode())}parseOpen(r){r.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.attr=r.attr,this.attrs=r.attrs,this._format=r.format||function(n){try{return Number.isNaN(n.getTime())?"":n.toISOString()}catch{return""}},this._parse=r.parse||function(n){return new Date(n)}}render(r,n){n&&(r.openNode(this.tag),this.attrs&&r.addAttributes(this.attrs),this.attr?r.addAttribute(this.attr,this._format(n)):r.writeText(this._format(n)),r.closeNode())}parseOpen(r){r.name===this.tag&&(this.attr?this.model=this._parse(r.attributes[this.attr]):this.text=[])}parseText(r){this.attr||this.text.push(r)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.attr=r.attr,this.attrs=r.attrs,this.zero=r.zero}render(r,n){(n||this.zero)&&(r.openNode(this.tag),this.attrs&&r.addAttributes(this.attrs),this.attr?r.addAttribute(this.attr,n):r.writeText(n),r.closeNode())}parseOpen(r){return r.name===this.tag&&(this.attr?this.model=parseInt(r.attributes[this.attr],10):this.text=[],!0)}parseText(r){this.attr||this.text.push(r)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.tag=r.tag,this.attr=r.attr,this.attrs=r.attrs}render(r,n){n!==void 0&&(r.openNode(this.tag),this.attrs&&r.addAttributes(this.attrs),this.attr?r.addAttribute(this.attr,n):r.writeText(n),r.closeNode())}parseOpen(r){r.name===this.tag&&(this.attr?this.model=r.attributes[this.attr]:this.text=[])}parseText(r){this.attr||this.text.push(r)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(t,l,c){const o=t("./base-xform"),r=t("../../utils/xml-stream");l.exports=class extends o{constructor(n){super(),this._model=n}render(n){if(!this._xml){const s=new r;(function e(i,u){i.openNode(u.tag,u.$),u.c&&u.c.forEach(a=>{e(i,a)}),u.t&&i.writeText(u.t),i.closeNode()})(s,this._model),this._xml=s.xml}n.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(n){switch(n){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(t,l,c){const o=t("./text-xform"),r=t("./rich-text-xform"),n=t("../base-xform");l.exports=class extends n{constructor(){super(),this.map={r:new r,t:new o}}get tag(){return"rPh"}render(s,e){if(s.openNode(this.tag,{sb:e.sb||0,eb:e.eb||0}),e&&e.hasOwnProperty("richText")&&e.richText){const{r:i}=this.map;e.richText.forEach(u=>{i.render(s,u)})}else e&&this.map.t.render(s,e.text);s.closeNode()}parseOpen(s){const{name:e}=s;return this.parser?(this.parser.parseOpen(s),!0):e===this.tag?(this.model={sb:parseInt(s.attributes.sb,10),eb:parseInt(s.attributes.eb,10)},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(s),!0))}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser){if(!this.parser.parseClose(s)){switch(s){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(s){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(t,l,c){const o=t("./text-xform"),r=t("../style/font-xform"),n=t("../base-xform");class s extends n{constructor(i){super(),this.model=i}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new o)}get fontXform(){return this._fontXform||(this._fontXform=new r(s.FONT_OPTIONS))}render(i,u){u=u||this.model,i.openNode("r"),u.font&&this.fontXform.render(i,u.font),this.textXform.render(i,u.text),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(i),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(i),!0;default:return!1}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){switch(i){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(i),!0}}}s.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},l.exports=s},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(t,l,c){const o=t("./text-xform"),r=t("./rich-text-xform"),n=t("./phonetic-text-xform"),s=t("../base-xform");l.exports=class extends s{constructor(e){super(),this.model=e,this.map={r:new r,t:new o,rPh:new n}}get tag(){return"si"}render(e,i){e.openNode(this.tag),i&&i.hasOwnProperty("richText")&&i.richText?i.richText.length?i.richText.forEach(u=>{this.map.r.render(e,u)}):this.map.t.render(e,""):i!=null&&this.map.t.render(e,i),e.closeNode()}parseOpen(e){const{name:i}=e;return this.parser?(this.parser.parseOpen(e),!0):i===this.tag?(this.model={},!0):(this.parser=this.map[i],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let i=this.model.richText;i||(i=this.model.richText=[]),i.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("./shared-string-xform");l.exports=class extends r{constructor(s){super(),this.model=s||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new n)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(s){return this.model.values[s]}add(s){return s.richText?this.addRichText(s):this.addText(s)}addText(s){let e=this.hash[s];return e===void 0&&(e=this.hash[s]=this.model.values.length,this.model.values.push(s)),this.model.count++,e}addRichText(s){const e=this.sharedStringXform.toXml(s);let i=this.rich[e];return i===void 0&&(i=this.rich[e]=this.model.values.length,this.model.values.push(s)),this.model.count++,i}render(s,e){e=e||this._values,s.openXml(o.StdDocAttributes),s.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.count,uniqueCount:e.values.length});const i=this.sharedStringXform;e.values.forEach(u=>{i.render(s,u)}),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(s),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(s))}}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser)return this.parser.parseClose(s)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(s){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+s)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"t"}render(r,n){r.openNode("t"),/^\s|\n|\s$/.test(n)&&r.addAttribute("xml:space","preserve"),r.writeText(n),r.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(r,n)=>String.fromCharCode(parseInt(n,16)))}parseOpen(r){switch(r.name){case"t":return this._text=[],!0;default:return!1}}parseText(r){this._text.push(r)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(t,l,c){const o=t("../../../doc/enums"),r=t("../../../utils/utils"),n=t("../base-xform"),s={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((i,u)=>(i[u]=!0,i),{}),horizontal(i){return this.horizontalValues[i]?i:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((i,u)=>(i[u]=!0,i),{}),vertical(i){return i==="middle"?"center":this.verticalValues[i]?i:void 0},wrapText:i=>!!i||void 0,shrinkToFit:i=>!!i||void 0,textRotation(i){switch(i){case"vertical":return i;default:return(i=r.validInt(i))>=-90&&i<=90?i:void 0}},indent:i=>(i=r.validInt(i),Math.max(0,i)),readingOrder(i){switch(i){case"ltr":return o.ReadingOrder.LeftToRight;case"rtl":return o.ReadingOrder.RightToLeft;default:return}}},e={toXml(i){if(i=s.textRotation(i)){if(i==="vertical")return 255;const u=Math.round(i);if(u>=0&&u<=90)return u;if(u<0&&u>=-90)return 90-u}},toModel(i){const u=r.validInt(i);if(u!==void 0){if(u===255)return"vertical";if(u>=0&&u<=90)return u;if(u>90&&u<=180)return 90-u}}};l.exports=class extends n{get tag(){return"alignment"}render(i,u){i.addRollback(),i.openNode("alignment");let a=!1;function h(p,m){m&&(i.addAttribute(p,m),a=!0)}h("horizontal",s.horizontal(u.horizontal)),h("vertical",s.vertical(u.vertical)),h("wrapText",!!s.wrapText(u.wrapText)&&"1"),h("shrinkToFit",!!s.shrinkToFit(u.shrinkToFit)&&"1"),h("indent",s.indent(u.indent)),h("textRotation",e.toXml(u.textRotation)),h("readingOrder",s.readingOrder(u.readingOrder)),i.closeNode(),a?i.commit():i.rollback()}parseOpen(i){const u={};let a=!1;function h(p,m,d){p&&(u[m]=d,a=!0)}h(i.attributes.horizontal,"horizontal",i.attributes.horizontal),h(i.attributes.vertical,"vertical",i.attributes.vertical==="center"?"middle":i.attributes.vertical),h(i.attributes.wrapText,"wrapText",r.parseBoolean(i.attributes.wrapText)),h(i.attributes.shrinkToFit,"shrinkToFit",r.parseBoolean(i.attributes.shrinkToFit)),h(i.attributes.indent,"indent",parseInt(i.attributes.indent,10)),h(i.attributes.textRotation,"textRotation",e.toModel(i.attributes.textRotation)),h(i.attributes.readingOrder,"readingOrder",i.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=a?u:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(t,l,c){const o=t("../base-xform"),r=t("../../../utils/utils"),n=t("./color-xform");class s extends o{constructor(i){super(),this.name=i,this.map={color:new n}}get tag(){return this.name}render(i,u,a){const h=u&&u.color||a||this.defaultColor;i.openNode(this.name),u&&u.style&&(i.addAttribute("style",u.style),h&&this.map.color.render(i,h)),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.name:{const{style:u}=i.attributes;return this.model=u?{style:u}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(i),!0;default:return!1}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return this.parser?(this.parser.parseClose(i)||(this.parser=void 0),!0):(i===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(i){return s.validStyleValues[i]}}s.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((e,i)=>(e[i]=!0,e),{}),l.exports=class extends o{constructor(){super(),this.map={top:new s("top"),left:new s("left"),bottom:new s("bottom"),right:new s("right"),diagonal:new s("diagonal")}}render(e,i){const{color:u}=i;function a(h,p){h&&!h.color&&i.color&&(h={...h,color:i.color}),p.render(e,h,u)}e.openNode("border"),i.diagonal&&i.diagonal.style&&(i.diagonal.up&&e.addAttribute("diagonalUp","1"),i.diagonal.down&&e.addAttribute("diagonalDown","1")),a(i.left,this.map.left),a(i.right,this.map.right),a(i.top,this.map.top),a(i.bottom,this.map.bottom),a(i.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"border":return this.reset(),this.diagonalUp=r.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=r.parseBoolean(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e==="border"){const i=this.model={},u=function(a,h,p){h&&(p&&Object.assign(h,p),i[a]=h)};u("left",this.map.left.model),u("right",this.map.right.model),u("top",this.map.top.model),u("bottom",this.map.bottom.model),u("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{constructor(r){super(),this.name=r||"color"}get tag(){return this.name}render(r,n){return!!n&&(r.openNode(this.name),n.argb?r.addAttribute("rgb",n.argb):n.theme!==void 0?(r.addAttribute("theme",n.theme),n.tint!==void 0&&r.addAttribute("tint",n.tint)):n.indexed!==void 0?r.addAttribute("indexed",n.indexed):r.addAttribute("auto","1"),r.closeNode(),!0)}parseOpen(r){return r.name===this.name&&(r.attributes.rgb?this.model={argb:r.attributes.rgb}:r.attributes.theme?(this.model={theme:parseInt(r.attributes.theme,10)},r.attributes.tint&&(this.model.tint=parseFloat(r.attributes.tint))):r.attributes.indexed?this.model={indexed:parseInt(r.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(t,l,c){const o=t("../base-xform"),r=t("./alignment-xform"),n=t("./border-xform"),s=t("./fill-xform"),e=t("./font-xform"),i=t("./numfmt-xform"),u=t("./protection-xform");l.exports=class extends o{constructor(){super(),this.map={alignment:new r,border:new n,fill:new s,font:new e,numFmt:new i,protection:new u}}get tag(){return"dxf"}render(a,h){if(a.openNode(this.tag),h.font&&this.map.font.render(a,h.font),h.numFmt&&h.numFmtId){const p={id:h.numFmtId,formatCode:h.numFmt};this.map.numFmt.render(a,p)}h.fill&&this.map.fill.render(a,h.fill),h.alignment&&this.map.alignment.render(a,h.alignment),h.border&&this.map.border.render(a,h.border),h.protection&&this.map.protection.render(a,h.protection),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a),!0}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.parser=void 0),!0):a!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(t,l,c){const o=t("../base-xform"),r=t("./color-xform");class n extends o{constructor(){super(),this.map={color:new r}}get tag(){return"stop"}render(a,h){a.openNode("stop"),a.addAttribute("position",h.position),this.map.color.render(a,h.color),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"stop":return this.model={position:parseFloat(a.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(a),!0;default:return!1}}parseText(){}parseClose(a){return!!this.parser&&(this.parser.parseClose(a)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class s extends o{constructor(){super(),this.map={fgColor:new r("fgColor"),bgColor:new r("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(a,h){a.openNode("patternFill"),a.addAttribute("patternType",h.pattern),h.fgColor&&this.map.fgColor.render(a,h.fgColor),h.bgColor&&this.map.bgColor.render(a,h.bgColor),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"patternFill":return this.model={type:"pattern",pattern:a.attributes.patternType},!0;default:return this.parser=this.map[a.name],!!this.parser&&(this.parser.parseOpen(a),!0)}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(this.parser.parseClose(a)||(this.parser.model&&(this.model[a]=this.parser.model),this.parser=void 0),!0)}}class e extends o{constructor(){super(),this.map={stop:new n}}get name(){return"gradient"}get tag(){return"gradientFill"}render(a,h){switch(a.openNode("gradientFill"),h.gradient){case"angle":a.addAttribute("degree",h.degree);break;case"path":a.addAttribute("type","path"),h.center.left&&(a.addAttribute("left",h.center.left),h.center.right===void 0&&a.addAttribute("right",h.center.left)),h.center.right&&a.addAttribute("right",h.center.right),h.center.top&&(a.addAttribute("top",h.center.top),h.center.bottom===void 0&&a.addAttribute("bottom",h.center.top)),h.center.bottom&&a.addAttribute("bottom",h.center.bottom)}const p=this.map.stop;h.stops.forEach(m=>{p.render(a,m)}),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"gradientFill":{const h=this.model={stops:[]};return a.attributes.degree?(h.gradient="angle",h.degree=parseInt(a.attributes.degree,10)):a.attributes.type==="path"&&(h.gradient="path",h.center={left:a.attributes.left?parseFloat(a.attributes.left):0,top:a.attributes.top?parseFloat(a.attributes.top):0},a.attributes.right!==a.attributes.left&&(h.center.right=a.attributes.right?parseFloat(a.attributes.right):0),a.attributes.bottom!==a.attributes.top&&(h.center.bottom=a.attributes.bottom?parseFloat(a.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(a),!0;default:return!1}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(this.parser.parseClose(a)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class i extends o{constructor(){super(),this.map={patternFill:new s,gradientFill:new e}}get tag(){return"fill"}render(a,h){switch(a.addRollback(),a.openNode("fill"),h.type){case"pattern":this.map.patternFill.render(a,h);break;case"gradient":this.map.gradientFill.render(a,h);break;default:return void a.rollback()}a.closeNode(),a.commit()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"fill":return this.model={},!0;default:return this.parser=this.map[a.name],!!this.parser&&(this.parser.parseOpen(a),!0)}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(this.parser.parseClose(a)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(a){return i.validPatternValues[a]}}i.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((u,a)=>(u[a]=!0,u),{}),i.StopXform=n,i.PatternFillXform=s,i.GradientFillXform=e,l.exports=i},{"../base-xform":32,"./color-xform":128}],131:[function(t,l,c){const o=t("./color-xform"),r=t("../simple/boolean-xform"),n=t("../simple/integer-xform"),s=t("../simple/string-xform"),e=t("./underline-xform"),i=t("../../../utils/under-dash"),u=t("../base-xform");class a extends u{constructor(p){super(),this.options=p||a.OPTIONS,this.map={b:{prop:"bold",xform:new r({tag:"b",attr:"val"})},i:{prop:"italic",xform:new r({tag:"i",attr:"val"})},u:{prop:"underline",xform:new e},charset:{prop:"charset",xform:new n({tag:"charset",attr:"val"})},color:{prop:"color",xform:new o},condense:{prop:"condense",xform:new r({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new r({tag:"extend",attr:"val"})},family:{prop:"family",xform:new n({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new r({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new s({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new s({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new r({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new r({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new n({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new s({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(p,m){const{map:d}=this;p.openNode(this.options.tagName),i.each(this.map,(b,g)=>{d[g].xform.render(p,m[b.prop])}),p.closeNode()}parseOpen(p){if(this.parser)return this.parser.parseOpen(p),!0;if(this.map[p.name])return this.parser=this.map[p.name].xform,this.parser.parseOpen(p);switch(p.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(p){this.parser&&this.parser.parseText(p)}parseClose(p){if(this.parser&&!this.parser.parseClose(p)){const m=this.map[p];return this.parser.model&&(this.model[m.prop]=this.parser.model),this.parser=void 0,!0}switch(p){case this.options.tagName:return!1;default:return!0}}}a.OPTIONS={tagName:"font",fontNameTag:"name"},l.exports=a},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(t,l,c){const o=t("../../../utils/under-dash"),r=t("../../defaultnumformats"),n=t("../base-xform"),s=(function(){const i={};return o.each(r,(u,a)=>{u.f&&(i[u.f]=parseInt(a,10))}),i})();class e extends n{constructor(u,a){super(),this.id=u,this.formatCode=a}get tag(){return"numFmt"}render(u,a){u.leafNode("numFmt",{numFmtId:a.id,formatCode:a.formatCode})}parseOpen(u){switch(u.name){case"numFmt":return this.model={id:parseInt(u.attributes.numFmtId,10),formatCode:u.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}e.getDefaultFmtId=function(i){return s[i]},e.getDefaultFmtCode=function(i){return r[i]&&r[i].f},l.exports=e},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(t,l,c){const o=t("../base-xform"),r={boolean:(n,s)=>n===void 0?s:n};l.exports=class extends o{get tag(){return"protection"}render(n,s){n.addRollback(),n.openNode("protection");let e=!1;function i(u,a){a!==void 0&&(n.addAttribute(u,a),e=!0)}i("locked",r.boolean(s.locked,!0)?void 0:"0"),i("hidden",r.boolean(s.hidden,!1)?"1":void 0),n.closeNode(),e?n.commit():n.rollback()}parseOpen(n){const s={locked:n.attributes.locked!=="0",hidden:n.attributes.hidden==="1"},e=!s.locked||s.hidden;this.model=e?s:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(t,l,c){const o=t("../base-xform"),r=t("./alignment-xform"),n=t("./protection-xform");l.exports=class extends o{constructor(s){super(),this.xfId=!(!s||!s.xfId),this.map={alignment:new r,protection:new n}}get tag(){return"xf"}render(s,e){s.openNode("xf",{numFmtId:e.numFmtId||0,fontId:e.fontId||0,fillId:e.fillId||0,borderId:e.borderId||0}),this.xfId&&s.addAttribute("xfId",e.xfId||0),e.numFmtId&&s.addAttribute("applyNumberFormat","1"),e.fontId&&s.addAttribute("applyFont","1"),e.fillId&&s.addAttribute("applyFill","1"),e.borderId&&s.addAttribute("applyBorder","1"),e.alignment&&s.addAttribute("applyAlignment","1"),e.protection&&s.addAttribute("applyProtection","1"),e.alignment&&this.map.alignment.render(s,e.alignment),e.protection&&this.map.protection.render(s,e.protection),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case"xf":return this.model={numFmtId:parseInt(s.attributes.numFmtId,10),fontId:parseInt(s.attributes.fontId,10),fillId:parseInt(s.attributes.fillId,10),borderId:parseInt(s.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(s.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(s),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(s),!0;default:return!1}}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){return this.parser?(this.parser.parseClose(s)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):s!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(t,l,c){const o=t("../../../doc/enums"),r=t("../../../utils/xml-stream"),n=t("../base-xform"),s=t("../static-xform"),e=t("../list-xform"),i=t("./font-xform"),u=t("./fill-xform"),a=t("./border-xform"),h=t("./numfmt-xform"),p=t("./style-xform"),m=t("./dxf-xform");class d extends n{constructor(g){super(),this.map={numFmts:new e({tag:"numFmts",count:!0,childXform:new h}),fonts:new e({tag:"fonts",count:!0,childXform:new i,$:{"x14ac:knownFonts":1}}),fills:new e({tag:"fills",count:!0,childXform:new u}),borders:new e({tag:"borders",count:!0,childXform:new a}),cellStyleXfs:new e({tag:"cellStyleXfs",count:!0,childXform:new p}),cellXfs:new e({tag:"cellXfs",count:!0,childXform:new p({xfId:!0})}),dxfs:new e({tag:"dxfs",always:!0,count:!0,childXform:new m}),numFmt:new h,font:new i,fill:new u,border:new a,style:new p({xfId:!0}),cellStyles:d.STATIC_XFORMS.cellStyles,tableStyles:d.STATIC_XFORMS.tableStyles,extLst:d.STATIC_XFORMS.extLst},g&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(g,S){S=S||this.model,g.openXml(r.StdDocAttributes),g.openNode("styleSheet",d.STYLESHEET_ATTRIBUTES),this.index?(S.numFmts&&S.numFmts.length&&(g.openNode("numFmts",{count:S.numFmts.length}),S.numFmts.forEach(C=>{g.writeXml(C)}),g.closeNode()),S.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),g.openNode("fonts",{count:S.fonts.length,"x14ac:knownFonts":1}),S.fonts.forEach(C=>{g.writeXml(C)}),g.closeNode(),g.openNode("fills",{count:S.fills.length}),S.fills.forEach(C=>{g.writeXml(C)}),g.closeNode(),g.openNode("borders",{count:S.borders.length}),S.borders.forEach(C=>{g.writeXml(C)}),g.closeNode(),this.map.cellStyleXfs.render(g,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),g.openNode("cellXfs",{count:S.styles.length}),S.styles.forEach(C=>{g.writeXml(C)}),g.closeNode()):(this.map.numFmts.render(g,S.numFmts),this.map.fonts.render(g,S.fonts),this.map.fills.render(g,S.fills),this.map.borders.render(g,S.borders),this.map.cellStyleXfs.render(g,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(g,S.styles)),d.STATIC_XFORMS.cellStyles.render(g),this.map.dxfs.render(g,S.dxfs),d.STATIC_XFORMS.tableStyles.render(g),d.STATIC_XFORMS.extLst.render(g),g.closeNode()}parseOpen(g){if(this.parser)return this.parser.parseOpen(g),!0;switch(g.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[g.name],this.parser&&this.parser.parseOpen(g),!0}}parseText(g){this.parser&&this.parser.parseText(g)}parseClose(g){if(this.parser)return this.parser.parseClose(g)||(this.parser=void 0),!0;switch(g){case"styleSheet":{this.model={};const S=(C,I)=>{I.model&&I.model.length&&(this.model[C]=I.model)};if(S("numFmts",this.map.numFmts),S("fonts",this.map.fonts),S("fills",this.map.fills),S("borders",this.map.borders),S("styles",this.map.cellXfs),S("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const C=this.index.numFmt;this.model.numFmts.forEach(I=>{C[I.id]=I.formatCode})}return!1}default:return!0}}addStyleModel(g,S){if(!g)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(g))return this.weakMap.get(g);const C={};if(S=S||o.ValueType.Number,g.numFmt)C.numFmtId=this._addNumFmtStr(g.numFmt);else switch(S){case o.ValueType.Number:C.numFmtId=this._addNumFmtStr("General");break;case o.ValueType.Date:C.numFmtId=this._addNumFmtStr("mm-dd-yy")}g.font&&(C.fontId=this._addFont(g.font)),g.border&&(C.borderId=this._addBorder(g.border)),g.fill&&(C.fillId=this._addFill(g.fill)),g.alignment&&(C.alignment=g.alignment),g.protection&&(C.protection=g.protection);const I=this._addStyle(C);return this.weakMap&&this.weakMap.set(g,I),I}getStyleModel(g){const S=this.model.styles[g];if(!S)return null;let C=this.index.model[g];if(C)return C;if(C=this.index.model[g]={},S.numFmtId){const D=this.index.numFmt[S.numFmtId]||h.getDefaultFmtCode(S.numFmtId);D&&(C.numFmt=D)}function I(D,z,P){if(P||P===0){const B=z[P];B&&(C[D]=B)}}return I("font",this.model.fonts,S.fontId),I("border",this.model.borders,S.borderId),I("fill",this.model.fills,S.fillId),S.alignment&&(C.alignment=S.alignment),S.protection&&(C.protection=S.protection),C}addDxfStyle(g){return g.numFmt&&(g.numFmtId=this._addNumFmtStr(g.numFmt)),this.model.dxfs.push(g),this.model.dxfs.length-1}getDxfStyle(g){return this.model.dxfs[g]}_addStyle(g){const S=this.map.style.toXml(g);let C=this.index.style[S];return C===void 0&&(C=this.index.style[S]=this.model.styles.length,this.model.styles.push(S)),C}_addNumFmtStr(g){let S=h.getDefaultFmtId(g);if(S!==void 0||(S=this.index.numFmt[g],S!==void 0))return S;S=this.index.numFmt[g]=164+this.model.numFmts.length;const C=this.map.numFmt.toXml({id:S,formatCode:g});return this.model.numFmts.push(C),S}_addFont(g){const S=this.map.font.toXml(g);let C=this.index.font[S];return C===void 0&&(C=this.index.font[S]=this.model.fonts.length,this.model.fonts.push(S)),C}_addBorder(g){const S=this.map.border.toXml(g);let C=this.index.border[S];return C===void 0&&(C=this.index.border[S]=this.model.borders.length,this.model.borders.push(S)),C}_addFill(g){const S=this.map.fill.toXml(g);let C=this.index.fill[S];return C===void 0&&(C=this.index.fill[S]=this.model.fills.length,this.model.fills.push(S)),C}}d.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},d.STATIC_XFORMS={cellStyles:new s({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new s({tag:"dxfs",$:{count:0}}),tableStyles:new s({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new s({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},d.Mock=class extends d{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(b){return b.autodrain(),Promise.resolve()}addStyleModel(b,g){switch(g){case o.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const b={numFmtId:h.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(b)}return this._dateStyleId}getStyleModel(){return{}}},l.exports=d},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(t,l,c){const o=t("../base-xform");class r extends o{constructor(s){super(),this.model=s}get tag(){return"u"}render(s,e){if((e=e||this.model)===!0)s.leafNode("u");else{const i=r.Attributes[e];i&&s.leafNode("u",i)}}parseOpen(s){s.name==="u"&&(this.model=s.attributes.val||!0)}parseText(){}parseClose(){return!1}}r.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},l.exports=r},{"../base-xform":32}],137:[function(t,l,c){const o=t("../base-xform"),r=t("./filter-column-xform");l.exports=class extends o{constructor(){super(),this.map={filterColumn:new r}}get tag(){return"autoFilter"}prepare(n){n.columns.forEach((s,e)=>{this.map.filterColumn.prepare(s,{index:e})})}render(n,s){return n.openNode(this.tag,{ref:s.autoFilterRef}),s.columns.forEach(e=>{this.map.filterColumn.render(n,e)}),n.closeNode(),!0}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:return this.model={autoFilterRef:n.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[n.name],this.parser)return this.parseOpen(n),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(n){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+n)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"customFilter"}render(r,n){r.leafNode(this.tag,{val:n.val,operator:n.operator})}parseOpen(r){return r.name===this.tag&&(this.model={val:r.attributes.val,operator:r.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(t,l,c){const o=t("../base-xform"),r=t("../list-xform"),n=t("./custom-filter-xform"),s=t("./filter-xform");l.exports=class extends o{constructor(){super(),this.map={customFilters:new r({tag:"customFilters",count:!1,empty:!0,childXform:new n}),filters:new r({tag:"filters",count:!1,empty:!0,childXform:new s})}}get tag(){return"filterColumn"}prepare(e,i){e.colId=i.index.toString()}render(e,i){return i.customFilters?(e.openNode(this.tag,{colId:i.colId,hiddenButton:i.filterButton?"0":"1"}),this.map.customFilters.render(e,i.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:i.colId,hiddenButton:i.filterButton?"0":"1"}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{attributes:i}=e;switch(e.name){case this.tag:return this.model={filterButton:i.hiddenButton==="0"},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"filter"}render(r,n){r.leafNode(this.tag,{val:n.val})}parseOpen(r){return r.name===this.tag&&(this.model={val:r.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"tableColumn"}prepare(r,n){r.id=n.index+1}render(r,n){return r.leafNode(this.tag,{id:n.id.toString(),name:n.name,totalsRowLabel:n.totalsRowLabel,totalsRowFunction:n.totalsRowFunction,dxfId:n.dxfId}),!0}parseOpen(r){if(r.name===this.tag){const{attributes:n}=r;return this.model={name:n.name,totalsRowLabel:n.totalsRowLabel,totalsRowFunction:n.totalsRowFunction,dxfId:n.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(t,l,c){const o=t("../base-xform");l.exports=class extends o{get tag(){return"tableStyleInfo"}render(r,n){return r.leafNode(this.tag,{name:n.theme?n.theme:void 0,showFirstColumn:n.showFirstColumn?"1":"0",showLastColumn:n.showLastColumn?"1":"0",showRowStripes:n.showRowStripes?"1":"0",showColumnStripes:n.showColumnStripes?"1":"0"}),!0}parseOpen(r){if(r.name===this.tag){const{attributes:n}=r;return this.model={theme:n.name?n.name:null,showFirstColumn:n.showFirstColumn==="1",showLastColumn:n.showLastColumn==="1",showRowStripes:n.showRowStripes==="1",showColumnStripes:n.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(t,l,c){const o=t("../../../utils/xml-stream"),r=t("../base-xform"),n=t("../list-xform"),s=t("./auto-filter-xform"),e=t("./table-column-xform"),i=t("./table-style-info-xform");class u extends r{constructor(){super(),this.map={autoFilter:new s,tableColumns:new n({tag:"tableColumns",count:!0,empty:!0,childXform:new e}),tableStyleInfo:new i}}prepare(h,p){this.map.autoFilter.prepare(h),this.map.tableColumns.prepare(h.columns,p)}get tag(){return"table"}render(h,p){h.openXml(o.StdDocAttributes),h.openNode(this.tag,{...u.TABLE_ATTRIBUTES,id:p.id,name:p.name,displayName:p.displayName||p.name,ref:p.tableRef,totalsRowCount:p.totalsRow?"1":void 0,totalsRowShown:p.totalsRow?void 0:"1",headerRowCount:p.headerRow?"1":"0"}),this.map.autoFilter.render(h,p),this.map.tableColumns.render(h,p.columns),this.map.tableStyleInfo.render(h,p.style),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;const{name:p,attributes:m}=h;switch(p){case this.tag:this.reset(),this.model={name:m.name,displayName:m.displayName||m.name,tableRef:m.ref,totalsRow:m.totalsRowCount==="1",headerRow:m.headerRowCount==="1"};break;default:this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h)}return!0}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser)return this.parser.parseClose(h)||(this.parser=void 0),!0;switch(h){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((p,m)=>{this.model.columns[m].filterButton=p.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(h,p){h.columns.forEach(m=>{m.dxfId!==void 0&&(m.style=p.styles.getDxfStyle(m.dxfId))})}}u.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},l.exports=u},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(t,l,c){(function(o,r){(function(){const n=t("fs"),s=t("jszip"),{PassThrough:e}=t("readable-stream"),i=t("../utils/zip-stream"),u=t("../utils/stream-buf"),a=t("../utils/utils"),h=t("../utils/xml-stream"),{bufferToString:p}=t("../utils/browser-buffer-decode"),m=t("./xform/style/styles-xform"),d=t("./xform/core/core-xform"),b=t("./xform/strings/shared-strings-xform"),g=t("./xform/core/relationships-xform"),S=t("./xform/core/content-types-xform"),C=t("./xform/core/app-xform"),I=t("./xform/book/workbook-xform"),D=t("./xform/sheet/worksheet-xform"),z=t("./xform/drawing/drawing-xform"),P=t("./xform/table/table-xform"),B=t("./xform/comment/comments-xform"),F=t("./xform/comment/vml-notes-xform"),W=t("./xml/theme1");class q{constructor(M){this.workbook=M}async readFile(M,k){if(!await a.fs.exists(M))throw new Error("File not found: "+M);const y=n.createReadStream(M);try{const w=await this.read(y,k);return y.close(),w}catch(w){throw y.close(),w}}parseRels(M){return new g().parseStream(M)}parseWorkbook(M){return new I().parseStream(M)}parseSharedStrings(M){return new b().parseStream(M)}reconcile(M,k){const y=new I,w=new D(k),x=new z,_=new P;y.reconcile(M);const T={media:M.media,mediaIndex:M.mediaIndex};Object.keys(M.drawings).forEach(V=>{const X=M.drawings[V],J=M.drawingRels[V];J&&(T.rels=J.reduce((L,G)=>(L[G.Id]=G,L),{}),(X.anchors||[]).forEach(L=>{const G=L.picture&&L.picture.hyperlinks;G&&T.rels[G.rId]&&(G.hyperlink=T.rels[G.rId].Target,delete G.rId)}),x.reconcile(X,T))});const O={styles:M.styles};Object.values(M.tables).forEach(V=>{_.reconcile(V,O)});const j={styles:M.styles,sharedStrings:M.sharedStrings,media:M.media,mediaIndex:M.mediaIndex,date1904:M.properties&&M.properties.date1904,drawings:M.drawings,comments:M.comments,tables:M.tables,vmlDrawings:M.vmlDrawings};M.worksheets.forEach(V=>{V.relationships=M.worksheetRels[V.sheetNo],w.reconcile(V,j)}),delete M.worksheetHash,delete M.worksheetRels,delete M.globalRels,delete M.sharedStrings,delete M.workbookRels,delete M.sheetDefs,delete M.styles,delete M.mediaIndex,delete M.drawings,delete M.drawingRels,delete M.vmlDrawings}async _processWorksheetEntry(M,k,y,w,x){const _=new D(w),T=await _.parseStream(M);T.sheetNo=y,k.worksheetHash[x]=T,k.worksheets.push(T)}async _processCommentEntry(M,k,y){const w=new B,x=await w.parseStream(M);k.comments[`../${y}.xml`]=x}async _processTableEntry(M,k,y){const w=new P,x=await w.parseStream(M);k.tables[`../tables/${y}.xml`]=x}async _processWorksheetRelsEntry(M,k,y){const w=new g,x=await w.parseStream(M);k.worksheetRels[y]=x}async _processMediaEntry(M,k,y){const w=y.lastIndexOf(".");if(w>=1){const x=y.substr(w+1),_=y.substr(0,w);await new Promise((T,O)=>{const j=new u;j.on("finish",()=>{k.mediaIndex[y]=k.media.length,k.mediaIndex[_]=k.media.length;const V={type:"image",name:_,extension:x,buffer:j.toBuffer()};k.media.push(V),T()}),M.on("error",V=>{O(V)}),M.pipe(j)})}}async _processDrawingEntry(M,k,y){const w=new z,x=await w.parseStream(M);k.drawings[y]=x}async _processDrawingRelsEntry(M,k,y){const w=new g,x=await w.parseStream(M);k.drawingRels[y]=x}async _processVmlDrawingEntry(M,k,y){const w=new F,x=await w.parseStream(M);k.vmlDrawings[`../drawings/${y}.vml`]=x}async _processThemeEntry(M,k,y){await new Promise((w,x)=>{const _=new u;M.on("error",x),_.on("error",x),_.on("finish",()=>{k.themes[y]=_.read().toString(),w()}),M.pipe(_)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(M,k){!M[Symbol.asyncIterator]&&M.pipe&&(M=M.pipe(new e));const y=[];for await(const w of M)y.push(w);return this.load(r.concat(y),k)}async load(M,k){let y;y=k&&k.base64?r.from(M.toString(),"base64"):M;const w={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},x=await s.loadAsync(y);for(const _ of Object.values(x.files))if(!_.dir){let T,O=_.name;if(O[0]==="/"&&(O=O.substr(1)),O.match(/xl\/media\//)||O.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))T=new e,T.write(await _.async("nodebuffer"));else{let j;T=new e({writableObjectMode:!0,readableObjectMode:!0}),j=o.browser?p(await _.async("nodebuffer")):await _.async("string");const V=16384;for(let X=0;X<j.length;X+=V)T.write(j.substring(X,X+V))}switch(T.end(),O){case"_rels/.rels":w.globalRels=await this.parseRels(T);break;case"xl/workbook.xml":{const j=await this.parseWorkbook(T);w.sheets=j.sheets,w.definedNames=j.definedNames,w.views=j.views,w.properties=j.properties,w.calcProperties=j.calcProperties;break}case"xl/_rels/workbook.xml.rels":w.workbookRels=await this.parseRels(T);break;case"xl/sharedStrings.xml":w.sharedStrings=new b,await w.sharedStrings.parseStream(T);break;case"xl/styles.xml":w.styles=new m,await w.styles.parseStream(T);break;case"docProps/app.xml":{const j=new C,V=await j.parseStream(T);w.company=V.company,w.manager=V.manager;break}case"docProps/core.xml":{const j=new d,V=await j.parseStream(T);Object.assign(w,V);break}default:{let j=O.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(j){await this._processWorksheetEntry(T,w,j[1],k,O);break}if(j=O.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),j){await this._processWorksheetRelsEntry(T,w,j[1]);break}if(j=O.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),j){await this._processThemeEntry(T,w,j[1]);break}if(j=O.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),j){await this._processMediaEntry(T,w,j[1]);break}if(j=O.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),j){await this._processDrawingEntry(T,w,j[1]);break}if(j=O.match(/xl\/(comments\d+)[.]xml/),j){await this._processCommentEntry(T,w,j[1]);break}if(j=O.match(/xl\/tables\/(table\d+)[.]xml/),j){await this._processTableEntry(T,w,j[1]);break}if(j=O.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),j){await this._processDrawingRelsEntry(T,w,j[1]);break}if(j=O.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),j){await this._processVmlDrawingEntry(T,w,j[1]);break}}}}return this.reconcile(w,k),this.workbook.model=w,this.workbook}async addMedia(M,k){await Promise.all(k.media.map(async y=>{if(y.type==="image"){const w=`xl/media/${y.name}.${y.extension}`;if(y.filename){const x=await(function(_,T){return new Promise((O,j)=>{n.readFile(_,T,(V,X)=>{V?j(V):O(X)})})})(y.filename);return M.append(x,{name:w})}if(y.buffer)return M.append(y.buffer,{name:w});if(y.base64){const x=y.base64,_=x.substring(x.indexOf(",")+1);return M.append(_,{name:w,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(M,k){const y=new z,w=new g;k.worksheets.forEach(x=>{const{drawing:_}=x;if(_){y.prepare(_,{});let T=y.toXml(_);M.append(T,{name:`xl/drawings/${_.name}.xml`}),T=w.toXml(_.rels),M.append(T,{name:`xl/drawings/_rels/${_.name}.xml.rels`})}})}addTables(M,k){const y=new P;k.worksheets.forEach(w=>{const{tables:x}=w;x.forEach(_=>{y.prepare(_,{});const T=y.toXml(_);M.append(T,{name:"xl/tables/"+_.target})})})}async addContentTypes(M,k){const y=new S().toXml(k);M.append(y,{name:"[Content_Types].xml"})}async addApp(M,k){const y=new C().toXml(k);M.append(y,{name:"docProps/app.xml"})}async addCore(M,k){const y=new d;M.append(y.toXml(k),{name:"docProps/core.xml"})}async addThemes(M,k){const y=k.themes||{theme1:W};Object.keys(y).forEach(w=>{const x=y[w],_=`xl/theme/${w}.xml`;M.append(x,{name:_})})}async addOfficeRels(M){const k=new g().toXml([{Id:"rId1",Type:q.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:q.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:q.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);M.append(k,{name:"_rels/.rels"})}async addWorkbookRels(M,k){let y=1;const w=[{Id:"rId"+y++,Type:q.RelType.Styles,Target:"styles.xml"},{Id:"rId"+y++,Type:q.RelType.Theme,Target:"theme/theme1.xml"}];k.sharedStrings.count&&w.push({Id:"rId"+y++,Type:q.RelType.SharedStrings,Target:"sharedStrings.xml"}),k.worksheets.forEach(_=>{_.rId="rId"+y++,w.push({Id:_.rId,Type:q.RelType.Worksheet,Target:`worksheets/sheet${_.id}.xml`})});const x=new g().toXml(w);M.append(x,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(M,k){k.sharedStrings&&k.sharedStrings.count&&M.append(k.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(M,k){const{xml:y}=k.styles;y&&M.append(y,{name:"xl/styles.xml"})}async addWorkbook(M,k){const y=new I;M.append(y.toXml(k),{name:"xl/workbook.xml"})}async addWorksheets(M,k){const y=new D,w=new g,x=new B,_=new F;k.worksheets.forEach(T=>{let O=new h;y.render(O,T),M.append(O.xml,{name:`xl/worksheets/sheet${T.id}.xml`}),T.rels&&T.rels.length&&(O=new h,w.render(O,T.rels),M.append(O.xml,{name:`xl/worksheets/_rels/sheet${T.id}.xml.rels`})),T.comments.length>0&&(O=new h,x.render(O,T),M.append(O.xml,{name:`xl/comments${T.id}.xml`}),O=new h,_.render(O,T),M.append(O.xml,{name:`xl/drawings/vmlDrawing${T.id}.vml`}))})}_finalize(M){return new Promise((k,y)=>{M.on("finish",()=>{k(this)}),M.on("error",y),M.finalize()})}prepareModel(M,k){M.creator=M.creator||"ExcelJS",M.lastModifiedBy=M.lastModifiedBy||"ExcelJS",M.created=M.created||new Date,M.modified=M.modified||new Date,M.useSharedStrings=k.useSharedStrings===void 0||k.useSharedStrings,M.useStyles=k.useStyles===void 0||k.useStyles,M.sharedStrings=new b,M.styles=M.useStyles?new m(!0):new m.Mock;const y=new I,w=new D;y.prepare(M);const x={sharedStrings:M.sharedStrings,styles:M.styles,date1904:M.properties.date1904,drawingsCount:0,media:M.media};x.drawings=M.drawings=[],x.commentRefs=M.commentRefs=[];let _=0;M.tables=[],M.worksheets.forEach(T=>{T.tables.forEach(O=>{_++,O.target=`table${_}.xml`,O.id=_,M.tables.push(O)}),w.prepare(T,x)})}async write(M,k){k=k||{};const{model:y}=this.workbook,w=new i.ZipWriter(k.zip);return w.pipe(M),this.prepareModel(y,k),await this.addContentTypes(w,y),await this.addOfficeRels(w,y),await this.addWorkbookRels(w,y),await this.addWorksheets(w,y),await this.addSharedStrings(w,y),await this.addDrawings(w,y),await this.addTables(w,y),await Promise.all([this.addThemes(w,y),this.addStyles(w,y)]),await this.addMedia(w,y),await Promise.all([this.addApp(w,y),this.addCore(w,y)]),await this.addWorkbook(w,y),this._finalize(w)}writeFile(M,k){const y=n.createWriteStream(M);return new Promise((w,x)=>{y.on("finish",()=>{w()}),y.on("error",_=>{x(_)}),this.write(y,k).then(()=>{y.end()}).catch(_=>{x(_)})})}async writeBuffer(M){const k=new u;return await this.write(k,M),k.read()}}q.RelType=t("./rel-type"),l.exports=q}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(t,l,c){l.exports=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
258
258
  <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`},{}],146:[function(t,l,c){(function(o){(function(){Object.defineProperty(c,"__esModule",{value:!0}),c.CsvFormatterStream=void 0;const r=t("stream"),n=t("./formatter");class s extends r.Transform{constructor(i){super({writableObjectMode:i.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=i,this.rowFormatter=new n.RowFormatter(i),this.hasWrittenBOM=!i.writeBOM}transform(i){return this.rowFormatter.rowTransform=i,this}_transform(i,u,a){let h=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(i,(p,m)=>p?(h=!0,a(p)):(m&&m.forEach(d=>{this.push(o.from(d,"utf8"))}),h=!0,a()))}catch(p){if(h)throw p;a(p)}}_flush(i){this.rowFormatter.finish((u,a)=>u?i(u):(a&&a.forEach(h=>{this.push(o.from(h,"utf8"))}),i()))}}c.CsvFormatterStream=s}).call(this)}).call(this,t("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(t,l,c){Object.defineProperty(c,"__esModule",{value:!0}),c.FormatterOptions=void 0,c.FormatterOptions=class{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=`
259
259
  `,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,o||{}),(o==null?void 0:o.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(o==null?void 0:o.quote)===!0?this.quote='"':(o==null?void 0:o.quote)===!1&&(this.quote=""),typeof(o==null?void 0:o.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((r=o.writeHeaders)===null||r===void 0||r),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(t,l,c){var o=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c,"__esModule",{value:!0}),c.FieldFormatter=void 0;const r=o(t("lodash.isboolean")),n=o(t("lodash.isnil")),s=o(t("lodash.escaperegexp"));c.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,"g");const i=`[${e.delimiter}${s.default(e.rowDelimiter)}|\r|
@@ -309,7 +309,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
309
309
  * @author Louis-Dominique Dubeau
310
310
  * @license MIT
311
311
  * @copyright Louis-Dominique Dubeau
312
- */function o(r){return r>=65&&r<=90||r===95||r>=97&&r<=122||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||r>=65536&&r<=983039}Object.defineProperty(c,"__esModule",{value:!0}),c.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",c.NC_NAME_CHAR="-"+c.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",c.NC_NAME_START_CHAR_RE=new RegExp("^["+c.NC_NAME_START_CHAR+"]$","u"),c.NC_NAME_CHAR_RE=new RegExp("^["+c.NC_NAME_CHAR+"]$","u"),c.NC_NAME_RE=new RegExp("^["+c.NC_NAME_START_CHAR+"]["+c.NC_NAME_CHAR+"]*$","u"),c.isNCNameStartChar=o,c.isNCNameChar=function(r){return o(r)||r===45||r===46||r>=48&&r<=57||r===183||r>=768&&r<=879||r>=8255&&r<=8256}},{}]},{},[15])(15)}))})(iu)),iu.exports}var bd=gd();const yd=md(bd);class vd{constructor(E,t){Y(this,Ne);Y(this,Ko);Y(this,hn);Y(this,us);it(this,"export",()=>{var E={fileName:(f(this,Ne).getAttribute("caption")||"export").replace(/[`~!@#$%^&*|\\\'\";:\/?]/gi,""),afterFunc:()=>{}},t=H.nvl(E.fileName,"temp");const l=async(p,m)=>{console.log("export...."),p.xlsx.writeBuffer().then(d=>{var b=new Blob([d],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});const g=window.URL.createObjectURL(b),S=document.createElement("a");document.body.appendChild(S),S.href=g,S.download=m+".xlsx",S.click(),setTimeout(()=>{window.URL.revokeObjectURL(g),document.body.removeChild(S),console.log("completed")},0)})},c=()=>({type:"pattern",pattern:"solid",fgColor:{argb:"FFCCCCCC"}}),o=()=>({top:{style:"thin",color:{argb:"FF999999"}},left:{style:"thin",color:{argb:"FF999999"}},bottom:{style:"thin",color:{argb:"FF999999"}},right:{style:"thin",color:{argb:"FF999999"}}}),r=p=>{var m=$(".ng-container-body thead tr:not(.col-indicator-rowgroup)",f(this,Ne).body).length+1+f(this,Ne).template.length,d=f(this,Ne).data.get(p);$(f(this,Ne).template).each((b,g)=>{var S=parseInt(p*f(this,Ne).template.length)+m+b;if(b==0){var C=s.getCell(S,1);C.alignment={horizontal:"center",vertical:"middle",wrapText:!0},C.dataValidation={type:"list",allowBlank:!0,formulae:['"NONE,INSERT,UPDATE,DELETE"']},C.fill=c(),C.border=o(),f(this,Ne).template.length>1&&s.mergeCells(S,1,S+f(this,Ne).template.length-1,1)}$("th,td",g).not(".dummy").not(".first").not(".last").each((I,D)=>{var z=parseInt(D.dataset.index),P=s.getCell(S,z),B="";if(H.isNull(D.dataset.expr))H.isNull(D.dataset.bind)||(B=d[D.dataset.bind]||"");else try{B=f(this,Ne).exprFunction(D.dataset.expr).call(this,d,p)}catch(A){console.error(A,p,D.dataset.bind,D.dataset.expr)}P.value=B;var F=D.querySelector("ng-combo");if(F){var W=F.getAttribute("data-source");if(W){const A=F.getAttribute("value");W=f(this,Ne).exprFunction(W).call(this,d,p);const M=[...new Set(W.map(k=>k[A].replaceAll(","," ")))];M.length>0&&(P.dataValidation={type:"list",allowBlank:!0,formulae:['"'+M.join(",")+'"']})}}var q=D.querySelector("ng-radio");if(q){var W=q.getAttribute("data-source");if(W){q.getAttribute("value"),W=f(this,Ne).exprFunction(W).call(this,d,p);const M=[...new Set(W.map(k=>k.value))];M.length>0&&(P.dataValidation={type:"list",allowBlank:!0,formulae:['"'+M.join(",")+'"']})}}P.alignment={horizontal:D.getAttribute("text-align")||"left",vertical:"middle",wrapText:!0},(D.colSpan>1||D.rowSpan>1)&&s.mergeCells(S,z,S+D.rowSpan-1,z+D.colSpan-1)})})};$(f(this,hn)).html("generate..."),f(this,us).setAttribute("max",f(this,Ne).data.count()),f(this,us).setAttribute("value",0);const n=new yd.Workbook,s=n.addWorksheet("Sheet1");var e=0;s.getColumn(++e).width=10,$(".col-indicator-rowgroup .col-indicator:not(.dummy)",f(this,Ne).body).not(".first").not(".last").each((p,m)=>{if(p==0)return!0;m.dataset.index=++e,$(`[data-col="${m.dataset.col}"]`,f(this,Ne).template).each((d,b)=>{b.dataset.index=e}),f(this,Ne).body.querySelectorAll(`thead [data-col="${m.dataset.col}"]`).forEach(d=>{d.dataset.index=e}),s.getColumn(e).width=$(m).width()/7}),$(f(this,Ne).template).each((p,m)=>{var d=p+1;if(p==0){var b=s.getCell(d,1);b.fill=c(),b.border=o(),f(this,Ne).template.length>1&&s.mergeCells(d,1,d+f(this,Ne).template.length-1,1)}$("th:not(.dummy),td:not(.dummy)",m).not(".first").not(".last").each((g,S)=>{var C=parseInt(S.dataset.index),I=s.getCell(d,C);["rowState"].includes(S.dataset.bind)||(I.value=S.dataset.bind),(S.colSpan>1||S.rowSpan>1)&&s.mergeCells(d,C,d+S.rowSpan-1,C+S.colSpan-1),I.font={size:6},I.fill=c(),I.border=o()})}),$("thead tr:not(.col-indicator-rowgroup)",f(this,Ne).body).each((p,m)=>{var d=m.sectionRowIndex+f(this,Ne).template.length;if(p==0){var b=s.getCell(d,1);b.value="CRUD",b.alignment={horizontal:"center",vertical:"middle",wrapText:!0},b.fill=c(),b.border=o(),f(this,Ne).template.length>1&&s.mergeCells(d,1,d+f(this,Ne).template.length-1,1)}$("th:not(.dummy),td:not(.dummy)",m).not(".first").not(".last").each((g,S)=>{var C=parseInt(S.dataset.index),I=s.getCell(d,C);I.value=$(S).text(),(S.colSpan>1||S.rowSpan>1)&&s.mergeCells(d,C,d+S.rowSpan-1,C+S.colSpan-1),I.alignment={horizontal:"center",vertical:"middle",wrapText:!0},I.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFEEEEEE"}},I.border={top:{style:"thin",color:{argb:"FFCCCCCC"}},left:{style:"thin",color:{argb:"FFCCCCCC"}},bottom:{style:"thin",color:{argb:"FFCCCCCC"}},right:{style:"thin",color:{argb:"FFCCCCCC"}}}})});for(var i=f(this,Ne).data.getValidData(),u=0,a=0;a<i.length;a++)setTimeout(()=>{r(u++),f(this,us).setAttribute("value",u+1),$(f(this,hn)).html(u+1>=i.length?"downloading...":"processing... "+u.toLocaleString()+" / "+i.length.toLocaleString())});var h=setInterval(()=>{parseInt(f(this,us).getAttribute("value"))>=parseInt(f(this,us).getAttribute("max"))&&(clearInterval(h),setTimeout(()=>{l(n,t).then(p=>{}),E.afterFunc&&E.afterFunc.call(f(this,Ne))}),setTimeout(()=>{f(this,Ko).close()}))},500)});it(this,"exportPdf",()=>{console.log("exportPdf")});tt(this,Ne,E),tt(this,Ko,t),tt(this,hn,t.querySelector("#message-box")),tt(this,us,t.querySelector("#progress-bar"))}}Ne=new WeakMap,Ko=new WeakMap,hn=new WeakMap,us=new WeakMap;class Cu extends HTMLElement{constructor(){super();Y(this,li);Y(this,cn);Y(this,Zo);Y(this,uu);Y(this,du,{});Y(this,wh,()=>{});it(this,"exportExcel",()=>{f(this,cn).data.count()>500&&(f(this,li).showModal(),$(".title",f(this,li)).html("Export Excel")),f(this,Zo).export()});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,cn,this.getRootNode().host),this.shadowRoot.innerHTML=`
312
+ */function o(r){return r>=65&&r<=90||r===95||r>=97&&r<=122||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||r>=65536&&r<=983039}Object.defineProperty(c,"__esModule",{value:!0}),c.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",c.NC_NAME_CHAR="-"+c.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",c.NC_NAME_START_CHAR_RE=new RegExp("^["+c.NC_NAME_START_CHAR+"]$","u"),c.NC_NAME_CHAR_RE=new RegExp("^["+c.NC_NAME_CHAR+"]$","u"),c.NC_NAME_RE=new RegExp("^["+c.NC_NAME_START_CHAR+"]["+c.NC_NAME_CHAR+"]*$","u"),c.isNCNameStartChar=o,c.isNCNameChar=function(r){return o(r)||r===45||r===46||r>=48&&r<=57||r===183||r>=768&&r<=879||r>=8255&&r<=8256}},{}]},{},[15])(15)}))})(iu)),iu.exports}var gd=md();const bd=pd(gd);class yd{constructor(E,t){Y(this,Ne);Y(this,Ko);Y(this,hn);Y(this,us);it(this,"export",()=>{var E={fileName:(f(this,Ne).getAttribute("caption")||"export").replace(/[`~!@#$%^&*|\\\'\";:\/?]/gi,""),afterFunc:()=>{}},t=H.nvl(E.fileName,"temp");const l=async(p,m)=>{console.log("export...."),p.xlsx.writeBuffer().then(d=>{var b=new Blob([d],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});const g=window.URL.createObjectURL(b),S=document.createElement("a");document.body.appendChild(S),S.href=g,S.download=m+".xlsx",S.click(),setTimeout(()=>{window.URL.revokeObjectURL(g),document.body.removeChild(S),console.log("completed")},0)})},c=()=>({type:"pattern",pattern:"solid",fgColor:{argb:"FFCCCCCC"}}),o=()=>({top:{style:"thin",color:{argb:"FF999999"}},left:{style:"thin",color:{argb:"FF999999"}},bottom:{style:"thin",color:{argb:"FF999999"}},right:{style:"thin",color:{argb:"FF999999"}}}),r=p=>{var m=$(".ng-container-body thead tr:not(.col-indicator-rowgroup)",f(this,Ne).body).length+1+f(this,Ne).template.length,d=f(this,Ne).data.get(p);$(f(this,Ne).template).each((b,g)=>{var S=parseInt(p*f(this,Ne).template.length)+m+b;if(b==0){var C=s.getCell(S,1);C.alignment={horizontal:"center",vertical:"middle",wrapText:!0},C.dataValidation={type:"list",allowBlank:!0,formulae:['"NONE,INSERT,UPDATE,DELETE"']},C.fill=c(),C.border=o(),f(this,Ne).template.length>1&&s.mergeCells(S,1,S+f(this,Ne).template.length-1,1)}$("th,td",g).not(".dummy").not(".first").not(".last").each((I,D)=>{var z=parseInt(D.dataset.index),P=s.getCell(S,z),B="";if(H.isNull(D.dataset.expr))H.isNull(D.dataset.bind)||(B=d[D.dataset.bind]||"");else try{B=f(this,Ne).exprFunction(D.dataset.expr).call(this,d,p)}catch(A){console.error(A,p,D.dataset.bind,D.dataset.expr)}P.value=B;var F=D.querySelector("ng-combo");if(F){var W=F.getAttribute("data-source");if(W){const A=F.getAttribute("value");W=f(this,Ne).exprFunction(W).call(this,d,p);const M=[...new Set(W.map(k=>k[A].replaceAll(","," ")))];M.length>0&&(P.dataValidation={type:"list",allowBlank:!0,formulae:['"'+M.join(",")+'"']})}}var q=D.querySelector("ng-radio");if(q){var W=q.getAttribute("data-source");if(W){q.getAttribute("value"),W=f(this,Ne).exprFunction(W).call(this,d,p);const M=[...new Set(W.map(k=>k.value))];M.length>0&&(P.dataValidation={type:"list",allowBlank:!0,formulae:['"'+M.join(",")+'"']})}}P.alignment={horizontal:D.getAttribute("text-align")||"left",vertical:"middle",wrapText:!0},(D.colSpan>1||D.rowSpan>1)&&s.mergeCells(S,z,S+D.rowSpan-1,z+D.colSpan-1)})})};$(f(this,hn)).html("generate..."),f(this,us).setAttribute("max",f(this,Ne).data.count()),f(this,us).setAttribute("value",0);const n=new bd.Workbook,s=n.addWorksheet("Sheet1");var e=0;s.getColumn(++e).width=10,$(".col-indicator-rowgroup .col-indicator:not(.dummy)",f(this,Ne).body).not(".first").not(".last").each((p,m)=>{if(p==0)return!0;m.dataset.index=++e,$(`[data-col="${m.dataset.col}"]`,f(this,Ne).template).each((d,b)=>{b.dataset.index=e}),f(this,Ne).body.querySelectorAll(`thead [data-col="${m.dataset.col}"]`).forEach(d=>{d.dataset.index=e}),s.getColumn(e).width=$(m).width()/7}),$(f(this,Ne).template).each((p,m)=>{var d=p+1;if(p==0){var b=s.getCell(d,1);b.fill=c(),b.border=o(),f(this,Ne).template.length>1&&s.mergeCells(d,1,d+f(this,Ne).template.length-1,1)}$("th:not(.dummy),td:not(.dummy)",m).not(".first").not(".last").each((g,S)=>{var C=parseInt(S.dataset.index),I=s.getCell(d,C);["rowState"].includes(S.dataset.bind)||(I.value=S.dataset.bind),(S.colSpan>1||S.rowSpan>1)&&s.mergeCells(d,C,d+S.rowSpan-1,C+S.colSpan-1),I.font={size:6},I.fill=c(),I.border=o()})}),$("thead tr:not(.col-indicator-rowgroup)",f(this,Ne).body).each((p,m)=>{var d=m.sectionRowIndex+f(this,Ne).template.length;if(p==0){var b=s.getCell(d,1);b.value="CRUD",b.alignment={horizontal:"center",vertical:"middle",wrapText:!0},b.fill=c(),b.border=o(),f(this,Ne).template.length>1&&s.mergeCells(d,1,d+f(this,Ne).template.length-1,1)}$("th:not(.dummy),td:not(.dummy)",m).not(".first").not(".last").each((g,S)=>{var C=parseInt(S.dataset.index),I=s.getCell(d,C);I.value=$(S).text(),(S.colSpan>1||S.rowSpan>1)&&s.mergeCells(d,C,d+S.rowSpan-1,C+S.colSpan-1),I.alignment={horizontal:"center",vertical:"middle",wrapText:!0},I.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFEEEEEE"}},I.border={top:{style:"thin",color:{argb:"FFCCCCCC"}},left:{style:"thin",color:{argb:"FFCCCCCC"}},bottom:{style:"thin",color:{argb:"FFCCCCCC"}},right:{style:"thin",color:{argb:"FFCCCCCC"}}}})});for(var i=f(this,Ne).data.getValidData(),u=0,a=0;a<i.length;a++)setTimeout(()=>{r(u++),f(this,us).setAttribute("value",u+1),$(f(this,hn)).html(u+1>=i.length?"downloading...":"processing... "+u.toLocaleString()+" / "+i.length.toLocaleString())});var h=setInterval(()=>{parseInt(f(this,us).getAttribute("value"))>=parseInt(f(this,us).getAttribute("max"))&&(clearInterval(h),setTimeout(()=>{l(n,t).then(p=>{}),E.afterFunc&&E.afterFunc.call(f(this,Ne))}),setTimeout(()=>{f(this,Ko).close()}))},500)});it(this,"exportPdf",()=>{console.log("exportPdf")});tt(this,Ne,E),tt(this,Ko,t),tt(this,hn,t.querySelector("#message-box")),tt(this,us,t.querySelector("#progress-bar"))}}Ne=new WeakMap,Ko=new WeakMap,hn=new WeakMap,us=new WeakMap;class Cu extends HTMLElement{constructor(){super();Y(this,li);Y(this,cn);Y(this,Zo);Y(this,uu);Y(this,du,{});Y(this,wh,()=>{});it(this,"exportExcel",()=>{f(this,cn).data.count()>500&&(f(this,li).showModal(),$(".title",f(this,li)).html("Export Excel")),f(this,Zo).export()});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,cn,this.getRootNode().host),this.shadowRoot.innerHTML=`
313
313
  <style>
314
314
  @import "https://cdn.jsdelivr.net/npm/ninegrid/ninegrid.css";
315
315
 
@@ -349,7 +349,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
349
349
  </div>
350
350
  <progress id="progress-bar" value="0" max="100">50%</progress>
351
351
  </nx-dialog>
352
- `,tt(this,li,this.shadowRoot.querySelector("dialog")),tt(this,Zo,new vd(f(this,cn),f(this,li))),f(this,wh).call(this)}}li=new WeakMap,cn=new WeakMap,Zo=new WeakMap,uu=new WeakMap,du=new WeakMap,wh=new WeakMap,customElements.get("ng-export")||customElements.define("ng-export",Cu);class wd{constructor(E){Y(this,Jo);Y(this,hr);it(this,"add",E=>{f(this,hr).push(...E),f(this,Qo).call(this)});Y(this,Qo,()=>{tt(this,hr,[...new Set(f(this,hr))]),["","__ng"].forEach(E=>{const t=f(this,hr).indexOf(E);t>-1&&f(this,hr).splice(t,1)}),f(this,hr).sort((E,t)=>E.length<t.length?1:-1)});Y(this,xh,()=>{tt(this,hr,[]);const E=f(this,Jo).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");if(E){for(const t of E.tables)$("[data-bind]",t).each((l,c)=>{f(this,hr).push(c.dataset.bind)}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(l=>{$(`[${l}]`,t).each((c,o)=>{var r=o.getAttribute(l);if(r.indexOf("data.")<0){const n=r.search(/[(]/g);if(n>0)try{r=String(window[r.substring(0,n).trim()])}catch{r=""}}r.split("data.").forEach(n=>{if(n.trim()!=""){const s=n.search(/[^_A-Za-z0-9]/g);s>=0?f(this,hr).push(n.substring(0,s)):r.startsWith("data.")&&f(this,hr).push(n.replace("data.",""))}})})});f(this,Qo).call(this)}});tt(this,Jo,E),f(this,xh).call(this)}get(){return f(this,hr)}indexOf(E){return f(this,hr).indexOf(E)}includes(E){return f(this,hr).includes(E)}}Jo=new WeakMap,hr=new WeakMap,Qo=new WeakMap,xh=new WeakMap;class xd extends HTMLElement{constructor(){super();Y(this,_h);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,_h,this.getRootNode().host),this.shadowRoot.innerHTML=`
352
+ `,tt(this,li,this.shadowRoot.querySelector("dialog")),tt(this,Zo,new yd(f(this,cn),f(this,li))),f(this,wh).call(this)}}li=new WeakMap,cn=new WeakMap,Zo=new WeakMap,uu=new WeakMap,du=new WeakMap,wh=new WeakMap,customElements.get("ng-export")||customElements.define("ng-export",Cu);class vd{constructor(E){Y(this,Jo);Y(this,hr);it(this,"add",E=>{f(this,hr).push(...E),f(this,Qo).call(this)});Y(this,Qo,()=>{tt(this,hr,[...new Set(f(this,hr))]),["","__ng"].forEach(E=>{const t=f(this,hr).indexOf(E);t>-1&&f(this,hr).splice(t,1)}),f(this,hr).sort((E,t)=>E.length<t.length?1:-1)});Y(this,xh,()=>{tt(this,hr,[]);const E=f(this,Jo).shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");if(E){for(const t of E.tables)$("[data-bind]",t).each((l,c)=>{f(this,hr).push(c.dataset.bind)}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(l=>{$(`[${l}]`,t).each((c,o)=>{var r=o.getAttribute(l);if(r.indexOf("data.")<0){const n=r.search(/[(]/g);if(n>0)try{r=String(window[r.substring(0,n).trim()])}catch{r=""}}r.split("data.").forEach(n=>{if(n.trim()!=""){const s=n.search(/[^_A-Za-z0-9]/g);s>=0?f(this,hr).push(n.substring(0,s)):r.startsWith("data.")&&f(this,hr).push(n.replace("data.",""))}})})});f(this,Qo).call(this)}});tt(this,Jo,E),f(this,xh).call(this)}get(){return f(this,hr)}indexOf(E){return f(this,hr).indexOf(E)}includes(E){return f(this,hr).includes(E)}}Jo=new WeakMap,hr=new WeakMap,Qo=new WeakMap,xh=new WeakMap;class wd extends HTMLElement{constructor(){super();Y(this,_h);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,_h,this.getRootNode().host),this.shadowRoot.innerHTML=`
353
353
  <style>
354
354
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngFoot.css";
355
355
  ${H.getCustomPath(this,"ngFoot.css")}
@@ -357,7 +357,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
357
357
 
358
358
  <ng-layout></ng-layout>
359
359
  <ng-paging></ng-paging>
360
- `}}_h=new WeakMap;class _d extends HTMLElement{constructor(){super();Y(this,un);Y(this,ds);Y(this,Ur);Y(this,fs);it(this,"add",t=>{f(this,ds).push(...t);var l=0;for(const c of f(this,ds)){l++;const o=c.querySelector("caption"),r=o?o.innerHTML:`Sheet${l}`;$(f(this,Ur)).append(`<button class="ng-button" value="${l-1}" title="${r.replaceAll('"',"'")}">${r}</button>`)}f(this,ds).length<=1&&$(f(this,Ur)).hide(),H.j.querySelectorAll(f(this,Ur).querySelector("button")).addClass("ng-active"),$("button",f(this,Ur)).on("click",f(this,Sh))});it(this,"resize",()=>{const t=$(f(this,Ur)).width()>$(this).width();$(f(this,Ur)).css({width:t?"100%":"unset","justify-content":t?"space-evenly":"unset"})});Y(this,Sh,t=>{if(H.j.querySelectorAll(t.currentTarget).hasClass("ng-active"))return;const l=f(this,fs);tt(this,fs,parseInt(t.currentTarget.value)),f(this,un).changeRayout(f(this,fs)),H.j.querySelectorAll("button",f(this,Ur)).removeClass("ng-active"),H.j.querySelectorAll(t.currentTarget).addClass("ng-active");var c=new CustomEvent(H.EVENT.LAYOUT_CHANGED,{bubbles:!0,detail:{}});c.oldIndex=l,c.newIndex=f(this,fs),f(this,un).dispatchEvent(c)});tt(this,ds,[]),tt(this,fs,0)}connectedCallback(){tt(this,un,this.getRootNode().host.getRootNode().host),this.innerHTML='<div class="ng-wrap"></div>',tt(this,Ur,this.querySelector(".ng-wrap"))}get tables(){return f(this,ds)}get currentTable(){return f(this,ds)[f(this,fs)]}}un=new WeakMap,ds=new WeakMap,Ur=new WeakMap,fs=new WeakMap,Sh=new WeakMap,customElements.get("ng-layout")||customElements.define("ng-layout",_d),customElements.get("ng-foot")||customElements.define("ng-foot",xd);class Sd extends HTMLElement{constructor(){super();Y(this,ta);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,ta,this.getRootNode().host),!H.j.querySelectorAll(f(this,ta)).hasClass("simple")&&(this.shadowRoot.innerHTML=`
360
+ `}}_h=new WeakMap;class xd extends HTMLElement{constructor(){super();Y(this,un);Y(this,ds);Y(this,Ur);Y(this,fs);it(this,"add",t=>{f(this,ds).push(...t);var l=0;for(const c of f(this,ds)){l++;const o=c.querySelector("caption"),r=o?o.innerHTML:`Sheet${l}`;$(f(this,Ur)).append(`<button class="ng-button" value="${l-1}" title="${r.replaceAll('"',"'")}">${r}</button>`)}f(this,ds).length<=1&&$(f(this,Ur)).hide(),H.j.querySelectorAll(f(this,Ur).querySelector("button")).addClass("ng-active"),$("button",f(this,Ur)).on("click",f(this,Sh))});it(this,"resize",()=>{const t=$(f(this,Ur)).width()>$(this).width();$(f(this,Ur)).css({width:t?"100%":"unset","justify-content":t?"space-evenly":"unset"})});Y(this,Sh,t=>{if(H.j.querySelectorAll(t.currentTarget).hasClass("ng-active"))return;const l=f(this,fs);tt(this,fs,parseInt(t.currentTarget.value)),f(this,un).changeRayout(f(this,fs)),H.j.querySelectorAll("button",f(this,Ur)).removeClass("ng-active"),H.j.querySelectorAll(t.currentTarget).addClass("ng-active");var c=new CustomEvent(H.EVENT.LAYOUT_CHANGED,{bubbles:!0,detail:{}});c.oldIndex=l,c.newIndex=f(this,fs),f(this,un).dispatchEvent(c)});tt(this,ds,[]),tt(this,fs,0)}connectedCallback(){tt(this,un,this.getRootNode().host.getRootNode().host),this.innerHTML='<div class="ng-wrap"></div>',tt(this,Ur,this.querySelector(".ng-wrap"))}get tables(){return f(this,ds)}get currentTable(){return f(this,ds)[f(this,fs)]}}un=new WeakMap,ds=new WeakMap,Ur=new WeakMap,fs=new WeakMap,Sh=new WeakMap,customElements.get("ng-layout")||customElements.define("ng-layout",xd),customElements.get("ng-foot")||customElements.define("ng-foot",wd);class _d extends HTMLElement{constructor(){super();Y(this,ta);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,ta,this.getRootNode().host),!H.j.querySelectorAll(f(this,ta)).hasClass("simple")&&(this.shadowRoot.innerHTML=`
361
361
  <style>
362
362
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngHead.css";
363
363
  ${H.getCustomPath(this,"ngHead.css")}
@@ -366,7 +366,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
366
366
  <ng-menu></ng-menu>
367
367
  <ng-title></ng-title>
368
368
  <ng-custom></ng-custom>
369
- `)}}ta=new WeakMap;class kd extends HTMLElement{constructor(){super();Y(this,dn)}connectedCallback(){this.getRootNode().host&&(tt(this,dn,this.getRootNode().host.getRootNode().host),this.innerHTML=`<span>${f(this,dn).getAttribute("caption")}</span>`,$("span",this).on("dblclick",t=>{const l='<font color="green">https://www.ninegrid.net</font>';t.currentTarget.innerHTML=t.currentTarget.innerHTML==l?`<span>${f(this,dn).getAttribute("caption")}</span>`:l}))}}dn=new WeakMap;class Cd extends HTMLElement{constructor(){super();Y(this,kh);it(this,"add",t=>{this.querySelector("div:first-child").append(t)})}connectedCallback(){this.getRootNode().host&&(tt(this,kh,this.getRootNode().host.getRootNode().host),this.innerHTML="<div></div>")}}kh=new WeakMap,customElements.get("ng-title")||customElements.define("ng-title",kd),customElements.get("ng-custom")||customElements.define("ng-custom",Cd),customElements.get("ng-head")||customElements.define("ng-head",Sd);class Dl extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){new MutationObserver((E,t)=>{for(var l of E)if(l.type=="attributes")switch(l.attributeName){case"stroke":this.shadowRoot.querySelector("polyline").setAttribute(l.attributeName,this.getAttribute(l.attributeName));break;case"fill":this.shadowRoot.querySelector("circle,rect,svg").setAttribute(l.attributeName,this.getAttribute(l.attributeName));break;case"start-fill":case"end-fill":var c=this.getAttribute("start-fill")||"rgba(255, 255, 255, 0.85)",o=this.getAttribute("end-fill")||"rgba(30, 30, 40, 0.85)";$(l.target).css({background:`radial-gradient(circle farthest-corner at 33% 33%, ${c} 0%, ${o} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%)`});break}}).observe(this,{childList:!1,subtree:!1,attributeOldValue:!0})}}class Ed extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12";this.getAttribute("stroke"),this.shadowRoot.innerHTML=`
369
+ `)}}ta=new WeakMap;class Sd extends HTMLElement{constructor(){super();Y(this,dn)}connectedCallback(){this.getRootNode().host&&(tt(this,dn,this.getRootNode().host.getRootNode().host),this.innerHTML=`<span>${f(this,dn).getAttribute("caption")}</span>`,$("span",this).on("dblclick",t=>{const l='<font color="green">https://www.ninegrid.net</font>';t.currentTarget.innerHTML=t.currentTarget.innerHTML==l?`<span>${f(this,dn).getAttribute("caption")}</span>`:l}))}}dn=new WeakMap;class kd extends HTMLElement{constructor(){super();Y(this,kh);it(this,"add",t=>{this.querySelector("div:first-child").append(t)})}connectedCallback(){this.getRootNode().host&&(tt(this,kh,this.getRootNode().host.getRootNode().host),this.innerHTML="<div></div>")}}kh=new WeakMap,customElements.get("ng-title")||customElements.define("ng-title",Sd),customElements.get("ng-custom")||customElements.define("ng-custom",kd),customElements.get("ng-head")||customElements.define("ng-head",_d);class Dl extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){new MutationObserver((E,t)=>{for(var l of E)if(l.type=="attributes")switch(l.attributeName){case"stroke":this.shadowRoot.querySelector("polyline").setAttribute(l.attributeName,this.getAttribute(l.attributeName));break;case"fill":this.shadowRoot.querySelector("circle,rect,svg").setAttribute(l.attributeName,this.getAttribute(l.attributeName));break;case"start-fill":case"end-fill":var c=this.getAttribute("start-fill")||"rgba(255, 255, 255, 0.85)",o=this.getAttribute("end-fill")||"rgba(30, 30, 40, 0.85)";$(l.target).css({background:`radial-gradient(circle farthest-corner at 33% 33%, ${c} 0%, ${o} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%)`});break}}).observe(this,{childList:!1,subtree:!1,attributeOldValue:!0})}}class Cd extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12";this.getAttribute("stroke"),this.shadowRoot.innerHTML=`
370
370
  <style>
371
371
  :host {
372
372
  width: ${E}px;
@@ -382,7 +382,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
382
382
  <svg xmlns="http://www.w3.org/2000/svg" width="${E}" height="${E}" fill="currentColor" viewBox="0 0 16 16">
383
383
  <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z"/>
384
384
  </svg>
385
- `,super.connectedCallback()}}class Ad extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12";this.getAttribute("fill"),this.shadowRoot.innerHTML=`
385
+ `,super.connectedCallback()}}class Ed extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12";this.getAttribute("fill"),this.shadowRoot.innerHTML=`
386
386
  <style>
387
387
  :host {
388
388
  }
@@ -391,7 +391,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
391
391
  <svg viewBox="0 0 ${E} ${E}" width="${E}" height="${E}" xmlns="http://www.w3.org/2000/svg">
392
392
  <rect width="${E}" height="${E}" x="0" y="0" rx="0" ry="0" fill="#ccc" />
393
393
  </svg>
394
- `,super.connectedCallback()}}class Td extends Dl{constructor(){super()}connectedCallback(){var E=Number(this.getAttribute("size")||12),t=E/2,l=this.getAttribute("fill")||"black",c=this.getAttribute("stroke")||"#666",o=Number(this.getAttribute("stroke-width")||0),r=t+o,n=t+o;this.shadowRoot.innerHTML=`
394
+ `,super.connectedCallback()}}class Ad extends Dl{constructor(){super()}connectedCallback(){var E=Number(this.getAttribute("size")||12),t=E/2,l=this.getAttribute("fill")||"black",c=this.getAttribute("stroke")||"#666",o=Number(this.getAttribute("stroke-width")||0),r=t+o,n=t+o;this.shadowRoot.innerHTML=`
395
395
  <style>
396
396
  :host {
397
397
  }
@@ -400,7 +400,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
400
400
  <svg viewBox="0 0 ${E} ${E}" width="${E}" height="${E}" xmlns="http://www.w3.org/2000/svg">
401
401
  <circle fill="${l}" stroke="${c}" stroke-width="${o}" cx="${r}" cy="${n}" r="${t}"/>
402
402
  </svg>
403
- `,super.connectedCallback()}}class Rd extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12",t=this.getAttribute("start-fill")||"rgba(255, 255, 255, 0.85)",l=this.getAttribute("end-fill")||"rgba(0, 0, 0, 0.85)";this.shadowRoot.innerHTML=`
403
+ `,super.connectedCallback()}}class Td extends Dl{constructor(){super()}connectedCallback(){var E=this.getAttribute("size")||"12",t=this.getAttribute("start-fill")||"rgba(255, 255, 255, 0.85)",l=this.getAttribute("end-fill")||"rgba(0, 0, 0, 0.85)";this.shadowRoot.innerHTML=`
404
404
  <style>
405
405
  :host {
406
406
  position: absolute;
@@ -410,7 +410,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
410
410
  background: radial-gradient(circle farthest-corner at 33% 33%, ${t} 0%, ${l} 80%), radial-gradient(circle farthest-corner at 45% 45%, rgba(0, 0, 0, 0) 50%, #000000 80%);
411
411
  }
412
412
  </style>
413
- `,super.connectedCallback()}}customElements.get("ng-check")||customElements.define("ng-check",Ed),customElements.get("ng-rect")||customElements.define("ng-rect",Ad),customElements.get("ng-circle")||customElements.define("ng-circle",Td),customElements.get("ng-sphere")||customElements.define("ng-sphere",Rd);class Md extends _r{constructor(){super();Y(this,Ls);it(this,"dataRefresh",t=>{var l=this.getAttribute("src"),c=l?this.getExprValue(l,this.cell.closest("tr").data,this.cell.dataset.row):"";l=c||this.getDisplayText(),f(this,Ls).src=l,l?$(f(this,Ls)).show():$(f(this,Ls)).hide(),t||this.reset()});it(this,"r",(t,l)=>{const c=this.getAttribute("icon-src")||l.getAttribute("icon-src");var o=c?this.getExprValue(c,l.closest("tr").data,l.dataset.row):"";f(this,Ls).src=o||this.value})}connectedCallback(){const t=this.getAttribute("border")||"unset",l=this.getAttribute("border-radius")||"unset",c=this.getAttribute("link");for(var o=[],r=0;r<this.attributes.length;r++)["alt","width","height"].includes(this.attributes[r].name)&&o.push(`${this.attributes[r].name}="${this.attributes[r].value}"`);this.shadowRoot.innerHTML=`
413
+ `,super.connectedCallback()}}customElements.get("ng-check")||customElements.define("ng-check",Cd),customElements.get("ng-rect")||customElements.define("ng-rect",Ed),customElements.get("ng-circle")||customElements.define("ng-circle",Ad),customElements.get("ng-sphere")||customElements.define("ng-sphere",Td);class Rd extends _r{constructor(){super();Y(this,Ls);it(this,"dataRefresh",t=>{var l=this.getAttribute("src"),c=l?this.getExprValue(l,this.cell.closest("tr").data,this.cell.dataset.row):"";l=c||this.getDisplayText(),f(this,Ls).src=l,l?$(f(this,Ls)).show():$(f(this,Ls)).hide(),t||this.reset()});it(this,"r",(t,l)=>{const c=this.getAttribute("icon-src")||l.getAttribute("icon-src");var o=c?this.getExprValue(c,l.closest("tr").data,l.dataset.row):"";f(this,Ls).src=o||this.value})}connectedCallback(){const t=this.getAttribute("border")||"unset",l=this.getAttribute("border-radius")||"unset",c=this.getAttribute("link");for(var o=[],r=0;r<this.attributes.length;r++)["alt","width","height"].includes(this.attributes[r].name)&&o.push(`${this.attributes[r].name}="${this.attributes[r].value}"`);this.shadowRoot.innerHTML=`
414
414
  <style>
415
415
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngImg.css";
416
416
  ${H.getCustomPath(this,"ngImg.css")}
@@ -428,7 +428,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
428
428
  <div class="ng-wrap">
429
429
  <img ${o.join(" ")} class="renderer" />
430
430
  </div>
431
- `,super.connectedCallback(),tt(this,Ls,this.shadowRoot.querySelector("img"))}}Ls=new WeakMap;class Id extends _r{constructor(){super();Y(this,fn);Y(this,Ch);it(this,"dataRefresh",t=>{const l=this.getAttribute("src");var c=l?this.getExprValue(l,this.cell.closest("tr").data,this.cell.dataset.row):"";f(this,fn).innerHTML=c||this.getDisplayText(),t||this.reset()});it(this,"r",(t,l)=>{const c=this.getAttribute("icon-src")||l.getAttribute("icon-src");var o=c?this.getExprValue(c,l.closest("tr").data,l.dataset.row):"";f(this,fn).innerHTML=o||this.value});tt(this,Ch,this.getAttribute("src"))}connectedCallback(){const t=this.getAttribute("border")||"unset",l=this.getAttribute("border-radius")||"unset",c=this.getAttribute("link");this.shadowRoot.innerHTML=`
431
+ `,super.connectedCallback(),tt(this,Ls,this.shadowRoot.querySelector("img"))}}Ls=new WeakMap;class Md extends _r{constructor(){super();Y(this,fn);Y(this,Ch);it(this,"dataRefresh",t=>{const l=this.getAttribute("src");var c=l?this.getExprValue(l,this.cell.closest("tr").data,this.cell.dataset.row):"";f(this,fn).innerHTML=c||this.getDisplayText(),t||this.reset()});it(this,"r",(t,l)=>{const c=this.getAttribute("icon-src")||l.getAttribute("icon-src");var o=c?this.getExprValue(c,l.closest("tr").data,l.dataset.row):"";f(this,fn).innerHTML=o||this.value});tt(this,Ch,this.getAttribute("src"))}connectedCallback(){const t=this.getAttribute("border")||"unset",l=this.getAttribute("border-radius")||"unset",c=this.getAttribute("link");this.shadowRoot.innerHTML=`
432
432
  <style>
433
433
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngSvg.css";
434
434
  ${H.getCustomPath(this,"ngSvg.css")}
@@ -444,7 +444,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
444
444
  </style>
445
445
 
446
446
  <div class="ng-wrap"></div>
447
- `,super.connectedCallback(),tt(this,fn,this.shadowRoot.querySelector("div"))}}fn=new WeakMap,Ch=new WeakMap,customElements.get("ng-img")||customElements.define("ng-img",Md),customElements.get("ng-svg")||customElements.define("ng-svg",Id);class Nd{constructor(E){Y(this,Eh);it(this,"importExcel",()=>{f(this,Ah).call(this)});Y(this,Ah,()=>{this.input||(this.input=document.createElement("input"),this.input.type="file",this.input.onchange=f(this,Th)),this.input.click()});Y(this,Th,E=>{var t=E.target.files;if(t.length<1){alert("select a file...");return}var l=t[0],c=new FileReader;c.onload=f(this,Rh),c.readAsDataURL(l),c.onloadend=f(this,Mh)});Y(this,Rh,E=>{var t=/^data:(.*);base64,(.*)$/.exec(E.target.result);if(t==null)throw"Could not parse result";t[1],t[2]});Y(this,Mh,E=>{var t=E.target.result;const l=new ExcelJS.Workbook;l.xlsx.load(t).then(()=>{l.worksheets.forEach(c=>{c.eachRow((o,r)=>{r%10==0&&console.log(r)})})})});tt(this,Eh,E)}}Eh=new WeakMap,Ah=new WeakMap,Th=new WeakMap,Rh=new WeakMap,Mh=new WeakMap;class Od extends HTMLElement{constructor(){super();Y(this,ea);Y(this,pn);Y(this,Ih,()=>{$("div.panel",this.shadowRoot).show(),$(f(this,pn)).css({overflow:"visible"})});it(this,"close",()=>{$("div.panel",this.shadowRoot).hide(),$(f(this,pn)).css({overflow:"unset"})});Y(this,ra,()=>{f(this,ea).body.querySelectorAll("ng-info").forEach(t=>{var l=t.shadowRoot.querySelector("div.panel");$(l).is(":visible")&&($(l).hide(),$(t.closest("th,td")).css({overflow:"unset"}))})});this.attachShadow({mode:"open"})}connectedCallback(){const t=this.innerHTML;this.shadowRoot.innerHTML=`
447
+ `,super.connectedCallback(),tt(this,fn,this.shadowRoot.querySelector("div"))}}fn=new WeakMap,Ch=new WeakMap,customElements.get("ng-img")||customElements.define("ng-img",Rd),customElements.get("ng-svg")||customElements.define("ng-svg",Md);class Id{constructor(E){Y(this,Eh);it(this,"importExcel",()=>{f(this,Ah).call(this)});Y(this,Ah,()=>{this.input||(this.input=document.createElement("input"),this.input.type="file",this.input.onchange=f(this,Th)),this.input.click()});Y(this,Th,E=>{var t=E.target.files;if(t.length<1){alert("select a file...");return}var l=t[0],c=new FileReader;c.onload=f(this,Rh),c.readAsDataURL(l),c.onloadend=f(this,Mh)});Y(this,Rh,E=>{var t=/^data:(.*);base64,(.*)$/.exec(E.target.result);if(t==null)throw"Could not parse result";t[1],t[2]});Y(this,Mh,E=>{var t=E.target.result;const l=new ExcelJS.Workbook;l.xlsx.load(t).then(()=>{l.worksheets.forEach(c=>{c.eachRow((o,r)=>{r%10==0&&console.log(r)})})})});tt(this,Eh,E)}}Eh=new WeakMap,Ah=new WeakMap,Th=new WeakMap,Rh=new WeakMap,Mh=new WeakMap;class Nd extends HTMLElement{constructor(){super();Y(this,ea);Y(this,pn);Y(this,Ih,()=>{$("div.panel",this.shadowRoot).show(),$(f(this,pn)).css({overflow:"visible"})});it(this,"close",()=>{$("div.panel",this.shadowRoot).hide(),$(f(this,pn)).css({overflow:"unset"})});Y(this,ra,()=>{f(this,ea).body.querySelectorAll("ng-info").forEach(t=>{var l=t.shadowRoot.querySelector("div.panel");$(l).is(":visible")&&($(l).hide(),$(t.closest("th,td")).css({overflow:"unset"}))})});this.attachShadow({mode:"open"})}connectedCallback(){const t=this.innerHTML;this.shadowRoot.innerHTML=`
448
448
  <style>
449
449
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngInfo.css";
450
450
  ${H.getCustomPath(this,"ngInfo.css")}
@@ -458,7 +458,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
458
458
  <div class="panel">
459
459
  ${t}
460
460
  </div>
461
- `,tt(this,ea,this.getRootNode().host),tt(this,pn,this.closest("th,td")),$("svg.icon",this.shadowRoot).on("click",l=>{l.preventDefault(),l.stopPropagation(),$("div.panel",this.shadowRoot).is(":visible")?f(this,ra).call(this):(f(this,ra).call(this),f(this,Ih).call(this))}),$(this).on("click",l=>{l.stopPropagation()})}}ea=new WeakMap,pn=new WeakMap,Ih=new WeakMap,ra=new WeakMap,customElements.get("ng-info")||customElements.define("ng-info",Od);class jd extends Qs{constructor(){super();Y(this,Jr);it(this,"dataRefresh",t=>{f(this,Nh).call(this,this.value)?(f(this,Jr).value=H.nvl(this.value,"#ffffff"),H.j.querySelectorAll(this).removeClass("invalid")):(f(this,Jr).value="#ffffff",H.j.querySelectorAll(this).addClass("invalid")),f(this,Jr).setAttribute("title",this.value),t||this.reset()});Y(this,Nh,t=>{if(H.isNull(t))return!0;if(typeof t!="string"||t.length!=7||!t.startsWith("#"))return!1;var l=parseInt(t.substr(1,2),16),c=parseInt(t.substr(3,2),16),o=parseInt(t.substr(5,2),16);return!(l<0||l>255||c<0||c>255||o<0||o>255)})}connectedCallback(){this.shadowRoot.innerHTML=`
461
+ `,tt(this,ea,this.getRootNode().host),tt(this,pn,this.closest("th,td")),$("svg.icon",this.shadowRoot).on("click",l=>{l.preventDefault(),l.stopPropagation(),$("div.panel",this.shadowRoot).is(":visible")?f(this,ra).call(this):(f(this,ra).call(this),f(this,Ih).call(this))}),$(this).on("click",l=>{l.stopPropagation()})}}ea=new WeakMap,pn=new WeakMap,Ih=new WeakMap,ra=new WeakMap,customElements.get("ng-info")||customElements.define("ng-info",Nd);class Od extends Qs{constructor(){super();Y(this,Jr);it(this,"dataRefresh",t=>{f(this,Nh).call(this,this.value)?(f(this,Jr).value=H.nvl(this.value,"#ffffff"),H.j.querySelectorAll(this).removeClass("invalid")):(f(this,Jr).value="#ffffff",H.j.querySelectorAll(this).addClass("invalid")),f(this,Jr).setAttribute("title",this.value),t||this.reset()});Y(this,Nh,t=>{if(H.isNull(t))return!0;if(typeof t!="string"||t.length!=7||!t.startsWith("#"))return!1;var l=parseInt(t.substr(1,2),16),c=parseInt(t.substr(3,2),16),o=parseInt(t.substr(5,2),16);return!(l<0||l>255||c<0||c>255||o<0||o>255)})}connectedCallback(){this.shadowRoot.innerHTML=`
462
462
  <style>
463
463
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngInputColor.css";
464
464
  ${H.getCustomPath(this,"ngInputColor.css")}
@@ -466,7 +466,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
466
466
 
467
467
  <input type="color" required />
468
468
  <button tabindex="-1"></button>
469
- `,super.connectedCallback(),tt(this,Jr,this.shadowRoot.querySelector("input")),$("button",this.shadowRoot).on("click",t=>{$("input",this.shadowRoot).trigger("click")}),$(this.cell).on("keydown",t=>{switch(t.target.tagName){case"TH":case"TD":["Enter"].includes(t.code)&&$(f(this,Jr)).trigger("click");break}}),f(this,Jr).addEventListener("keydown",t=>{["Enter"].includes(t.code)?$(f(this,Jr)).trigger("click"):["Escape"].includes(t.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(t))})}}Jr=new WeakMap,Nh=new WeakMap,customElements.get("ng-input-color")||customElements.define("ng-input-color",jd);class $d extends Qs{constructor(){super();Y(this,Qr);Y(this,hi);it(this,"dataRefresh",t=>{var l=this.value;switch(f(this,Qr).type){case"date":l=l.substr(0,10);break;case"datetime-local":l=l.substr(0,16);break;case"time":var c=new Date(l);c!="Invalid Date"&&(l=("00"+c.getHours()).slice(-2)+":"+("00"+c.getMinutes()).slice(-2));break;case"month":var c=new Date(l);c!="Invalid Date"&&(l=("0000"+c.getFullYear()).slice(-4)+"-"+("00"+(c.getMonth()+1)).slice(-2));break}f(this,Qr).value=l,f(this,Oh).call(this,l)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid"),t||this.reset()});Y(this,Oh,t=>{if(H.isNull(t))return!0;if(typeof t!="string")return!1;var l=!0;switch(f(this,Qr).type){case"date":case"datetime-local":var c=Number(t.substr(0,4)),o=Number(t.substr(5,2)),r=Number(t.substr(8,2));if(isNaN(c)||isNaN(o)||isNaN(r))l=!1;else if(o<1||o>12||r<1||r>31)l=!1;else if([4,6,9,11].includes(o)&&r==31)l=!1;else if(o==2){var n=c%4==0&&(c%100!=0||c%400==0);(r>29||r==29&&!n)&&(l=!1)}break}if(l)switch(f(this,Qr).type){case"datetime-local":var s=t.substr(10,1),e=Number(t.substr(11,2)),i=Number(t.substr(14,2));(s!="T"||isNaN(e)||isNaN(i)||e<0||e>23||i<0||i>59)&&(l=!1);break;case"month":var c=Number(t.substr(0,4)),o=Number(t.substr(5,2));(isNaN(c)||isNaN(o)||o<1||o>12)&&(l=!1);break;case"week":var c=Number(t.substr(0,4)),u=t.substr(5,1),a=Number(t.substr(6,2));(u!="W"||isNaN(c)||isNaN(a)||a<=0||a>53)&&(l=!1);break}return l});if(tt(this,hi,this.getAttribute("type")||"date"),!["date","datetime-local","time","week","month"].includes(f(this,hi)))throw`invalid type : ${f(this,hi)}`}connectedCallback(){const t=parseInt(this.closest("tr").style.height,10)-1;for(var l=[],c=0;c<this.attributes.length;c++)["value","max","min","step"].includes(this.attributes[c].name)&&l.push(`${this.attributes[c].name}="${this.attributes[c].value}"`);this.shadowRoot.innerHTML=`
469
+ `,super.connectedCallback(),tt(this,Jr,this.shadowRoot.querySelector("input")),$("button",this.shadowRoot).on("click",t=>{$("input",this.shadowRoot).trigger("click")}),$(this.cell).on("keydown",t=>{switch(t.target.tagName){case"TH":case"TD":["Enter"].includes(t.code)&&$(f(this,Jr)).trigger("click");break}}),f(this,Jr).addEventListener("keydown",t=>{["Enter"].includes(t.code)?$(f(this,Jr)).trigger("click"):["Escape"].includes(t.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(t))})}}Jr=new WeakMap,Nh=new WeakMap,customElements.get("ng-input-color")||customElements.define("ng-input-color",Od);class jd extends Qs{constructor(){super();Y(this,Qr);Y(this,hi);it(this,"dataRefresh",t=>{var l=this.value;switch(f(this,Qr).type){case"date":l=l.substr(0,10);break;case"datetime-local":l=l.substr(0,16);break;case"time":var c=new Date(l);c!="Invalid Date"&&(l=("00"+c.getHours()).slice(-2)+":"+("00"+c.getMinutes()).slice(-2));break;case"month":var c=new Date(l);c!="Invalid Date"&&(l=("0000"+c.getFullYear()).slice(-4)+"-"+("00"+(c.getMonth()+1)).slice(-2));break}f(this,Qr).value=l,f(this,Oh).call(this,l)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid"),t||this.reset()});Y(this,Oh,t=>{if(H.isNull(t))return!0;if(typeof t!="string")return!1;var l=!0;switch(f(this,Qr).type){case"date":case"datetime-local":var c=Number(t.substr(0,4)),o=Number(t.substr(5,2)),r=Number(t.substr(8,2));if(isNaN(c)||isNaN(o)||isNaN(r))l=!1;else if(o<1||o>12||r<1||r>31)l=!1;else if([4,6,9,11].includes(o)&&r==31)l=!1;else if(o==2){var n=c%4==0&&(c%100!=0||c%400==0);(r>29||r==29&&!n)&&(l=!1)}break}if(l)switch(f(this,Qr).type){case"datetime-local":var s=t.substr(10,1),e=Number(t.substr(11,2)),i=Number(t.substr(14,2));(s!="T"||isNaN(e)||isNaN(i)||e<0||e>23||i<0||i>59)&&(l=!1);break;case"month":var c=Number(t.substr(0,4)),o=Number(t.substr(5,2));(isNaN(c)||isNaN(o)||o<1||o>12)&&(l=!1);break;case"week":var c=Number(t.substr(0,4)),u=t.substr(5,1),a=Number(t.substr(6,2));(u!="W"||isNaN(c)||isNaN(a)||a<=0||a>53)&&(l=!1);break}return l});if(tt(this,hi,this.getAttribute("type")||"date"),!["date","datetime-local","time","week","month"].includes(f(this,hi)))throw`invalid type : ${f(this,hi)}`}connectedCallback(){const t=parseInt(this.closest("tr").style.height,10)-1;for(var l=[],c=0;c<this.attributes.length;c++)["value","max","min","step"].includes(this.attributes[c].name)&&l.push(`${this.attributes[c].name}="${this.attributes[c].value}"`);this.shadowRoot.innerHTML=`
470
470
  <style>
471
471
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngInputDate.css";
472
472
  ${H.getCustomPath(this,"ngInputDate.css")}
@@ -489,7 +489,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
489
489
  ${l.join(" ")}
490
490
  required
491
491
  />
492
- `,super.connectedCallback(),tt(this,Qr,this.shadowRoot.querySelector("input")),$(this.cell).on("keydown",o=>{switch(o.target.tagName){case"TH":case"TD":["Enter"].includes(o.code)&&f(this,Qr).focus();break}}),f(this,Qr).addEventListener("keydown",o=>{["Enter","Escape"].includes(o.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown"].includes(o.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(o))})}}Qr=new WeakMap,hi=new WeakMap,Oh=new WeakMap,customElements.get("ng-input-date")||customElements.define("ng-input-date",$d);class Ld extends Qs{constructor(){super();Y(this,Ze);Y(this,ps);Y(this,Vr);Y(this,Ps);Y(this,mn);Y(this,ts);it(this,"dataRefresh",t=>{f(this,Ze).value=this.value,H.j.querySelectorAll(f(this,Ze)).removeClass("invalid"),f(this,ps)=="number"&&(isNaN(this.value)||f(this,mn)&&Number(f(this,Ze).value)>Number(f(this,mn))||f(this,Ps)&&Number(f(this,Ze).value)<Number(f(this,Ps))?H.j.querySelectorAll(f(this,Ze)).addClass("invalid"):f(this,ts)&&f(this,Ze).value.indexOf(".")>=0&&f(this,Ze).value.substring(f(this,Ze).value.indexOf(".")+1).length>Number(f(this,ts))&&H.j.querySelectorAll(f(this,Ze)).addClass("invalid")),f(this,Vr)&&H.getByteLength(this.value)>Number(f(this,Vr))&&H.j.querySelectorAll(f(this,Ze)).addClass("invalid"),t||this.reset()});Y(this,jh,t=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(t.code)){if(f(this,ps)=="number"){let o=[];if(f(this,ts)&&Number(f(this,ts))>0&&o.push("."),f(this,Ps)&&Number(f(this,Ps))>=0&&o.push("-"),!(t.keyCode>=48&&t.keyCode<=57||t.keyCode>=96&&t.keyCode<=105)&&!o.includes(t.key)&&t.preventDefault(),f(this,ts)&&(t.keyCode>=48&&t.keyCode<=57||t.keyCode>=96&&t.keyCode<=105)&&t.target.selectionStart==t.target.selectionEnd){var l=t.target.value,c=l.indexOf(".");if(c>=0){var l=l.substr(c+1,l.length);l.length>=Number(f(this,ts))&&t.preventDefault()}}}f(this,Vr)&&H.getByteLength(t.target.value)>=Number(f(this,Vr))&&t.target.selectionStart==t.target.selectionEnd&&t.preventDefault()}});if(tt(this,ps,this.getAttribute("type")||"text"),tt(this,Vr,this.getAttribute("maxbyte")),tt(this,Ps,this.getAttribute("min")),tt(this,mn,this.getAttribute("max")),tt(this,ts,this.getAttribute("scale")),!["text","number"].includes(f(this,ps)))throw`invalid type : ${f(this,ps)}`}connectedCallback(){for(var t=[],l=0;l<this.attributes.length;l++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[l].name)&&t.push(`${this.attributes[l].name}="${this.attributes[l].value}"`);this.shadowRoot.innerHTML=`
492
+ `,super.connectedCallback(),tt(this,Qr,this.shadowRoot.querySelector("input")),$(this.cell).on("keydown",o=>{switch(o.target.tagName){case"TH":case"TD":["Enter"].includes(o.code)&&f(this,Qr).focus();break}}),f(this,Qr).addEventListener("keydown",o=>{["Enter","Escape"].includes(o.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown"].includes(o.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(o))})}}Qr=new WeakMap,hi=new WeakMap,Oh=new WeakMap,customElements.get("ng-input-date")||customElements.define("ng-input-date",jd);class $d extends Qs{constructor(){super();Y(this,Ze);Y(this,ps);Y(this,Vr);Y(this,Ps);Y(this,mn);Y(this,ts);it(this,"dataRefresh",t=>{f(this,Ze).value=this.value,H.j.querySelectorAll(f(this,Ze)).removeClass("invalid"),f(this,ps)=="number"&&(isNaN(this.value)||f(this,mn)&&Number(f(this,Ze).value)>Number(f(this,mn))||f(this,Ps)&&Number(f(this,Ze).value)<Number(f(this,Ps))?H.j.querySelectorAll(f(this,Ze)).addClass("invalid"):f(this,ts)&&f(this,Ze).value.indexOf(".")>=0&&f(this,Ze).value.substring(f(this,Ze).value.indexOf(".")+1).length>Number(f(this,ts))&&H.j.querySelectorAll(f(this,Ze)).addClass("invalid")),f(this,Vr)&&H.getByteLength(this.value)>Number(f(this,Vr))&&H.j.querySelectorAll(f(this,Ze)).addClass("invalid"),t||this.reset()});Y(this,jh,t=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(t.code)){if(f(this,ps)=="number"){let o=[];if(f(this,ts)&&Number(f(this,ts))>0&&o.push("."),f(this,Ps)&&Number(f(this,Ps))>=0&&o.push("-"),!(t.keyCode>=48&&t.keyCode<=57||t.keyCode>=96&&t.keyCode<=105)&&!o.includes(t.key)&&t.preventDefault(),f(this,ts)&&(t.keyCode>=48&&t.keyCode<=57||t.keyCode>=96&&t.keyCode<=105)&&t.target.selectionStart==t.target.selectionEnd){var l=t.target.value,c=l.indexOf(".");if(c>=0){var l=l.substr(c+1,l.length);l.length>=Number(f(this,ts))&&t.preventDefault()}}}f(this,Vr)&&H.getByteLength(t.target.value)>=Number(f(this,Vr))&&t.target.selectionStart==t.target.selectionEnd&&t.preventDefault()}});if(tt(this,ps,this.getAttribute("type")||"text"),tt(this,Vr,this.getAttribute("maxbyte")),tt(this,Ps,this.getAttribute("min")),tt(this,mn,this.getAttribute("max")),tt(this,ts,this.getAttribute("scale")),!["text","number"].includes(f(this,ps)))throw`invalid type : ${f(this,ps)}`}connectedCallback(){for(var t=[],l=0;l<this.attributes.length;l++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[l].name)&&t.push(`${this.attributes[l].name}="${this.attributes[l].value}"`);this.shadowRoot.innerHTML=`
493
493
  <style>
494
494
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngInputText.css";
495
495
  ${H.getCustomPath(this,"ngInputText.css")}
@@ -499,7 +499,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
499
499
  ${t.join(" ")}
500
500
  ondragstart="return false;"
501
501
  >
502
- `,super.connectedCallback(),tt(this,Ze,this.shadowRoot.querySelector("input")),f(this,Ze).addEventListener("keydown",f(this,jh)),f(this,Ze).addEventListener("compositionstart",c=>{c.target.selectionStart==c.target.selectionEnd&&f(this,Vr)&&H.getByteLength(c.target.value)>=Number(f(this,Vr))&&(c.target.value=H.cut(c.target.value,Number(f(this,Vr))),this.value=c.target.value)}),f(this,Ze).addEventListener("compositionupdate",c=>{f(this,ps)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ze).addEventListener("compositionend",c=>{}),f(this,Ze).addEventListener("keydown",c=>{c.isComposing||c.keyCode===229||(["Enter","Escape"].includes(c.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown"].includes(c.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(c)))})}}Ze=new WeakMap,ps=new WeakMap,Vr=new WeakMap,Ps=new WeakMap,mn=new WeakMap,ts=new WeakMap,jh=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",Ld);class Pd{constructor(E){Y(this,je);Y(this,ci);Y(this,gn);Y(this,bn);Y(this,yn);it(this,"getHeight",E=>{const t=parseInt(E/f(this,je).template.length);if(t<0||t>=f(this,je).data.count())return 32;const l=f(this,je).data.__ng(t);return l?l.height[parseInt(E%f(this,je).template.length)]:32});it(this,"setHeight",(E,t)=>{f(this,je).data.get(parseInt(E/f(this,je).template.length)).__ng.height[parseInt(E%f(this,je).template.length)]=t});Y(this,ui,E=>typeof E=="object"&&E.tagName=="TR"?parseInt(E.getAttribute("data-row"))*f(this,je).template.length+E.sectionRowIndex%f(this,je).template.length:E);it(this,"attr",(E,t,l,c)=>{t=f(this,ui).call(this,t);var o=parseInt(t/f(this,je).template.length),r=f(this,je).data.get(o,"rowid"),n=t%f(this,je).template.length,s=H.decode(E,"head",f(this,gn),"foot",f(this,yn),f(this,bn)),e=s.findIndex(u=>u.rowid==r&&u.subrow==n);if(c)if(e<0){var i={rowid:r,subrow:n,cells:[]};i[l]=c,s.push(i)}else s[e][l]=c;else return e<0?null:s[e][l]});it(this,"height",(E,t,l)=>{var c=this.attr(E,t,"height",l);return c||(c=$(f(this,je).template[f(this,ui).call(this,t)%f(this,je).template.length]).height()),c});it(this,"attr2",(E,t,l,c,o)=>{l=f(this,ui).call(this,l);var r=parseInt(l/f(this,je).template.length),n=E&&E.hasOwnProperty("rowid")?E[r].rowid:null,s=l%f(this,je).template.length,e=H.decode(t,"head",f(this,gn),"foot",f(this,yn),f(this,bn)),i=e.findIndex(a=>a.rowid==n&&a.subrow==s);if(o)if(i<0){var u={rowid:n,subrow:s,cells:[]};u[c]=o,e.push(u)}else e[i][c]=o;else return i<0?null:e[i][c]});it(this,"height2",(E,t,l,c)=>{var o=this.attr2(E,t,l,"height",c);return o||(o=$(f(this,je).template[f(this,ui).call(this,l)%f(this,je).template.length]).height()),o});tt(this,je,E),tt(this,ci,-1),tt(this,gn,[]),tt(this,bn,[]),tt(this,yn,[]),this.head={attr:(t,l,c)=>this.attr("head",t,l,c),height:(t,l)=>this.height("head",t,l)},this.body={attr:(t,l,c)=>this.attr("body",t,l,c),height:(t,l)=>this.height("body",t,l),height2:(t,l,c)=>this.height2(t,"body",l,c)},this.foot={attr:(t,l,c)=>this.attr("foot",t,l,c),height:(t,l)=>this.height("foot",t,l)}}get row(){return f(this,ci)}set row(E){tt(this,ci,parseInt(E)),f(this,je).selection.selectedStartRow==f(this,je).selection.selectedEndRow&&(f(this,je).selection.selectedStartRow=f(this,je).selection.selectedEndRow=f(this,je).selection.startRow=f(this,ci))}}je=new WeakMap,ci=new WeakMap,gn=new WeakMap,bn=new WeakMap,yn=new WeakMap,ui=new WeakMap;class Dd extends HTMLElement{constructor(){super();Y(this,es);Y(this,rs);it(this,"popup",()=>{setTimeout(()=>{f(this,rs).data.assign(f(this,es).data.get()),this.shadowRoot.querySelector("dialog").showModal()},100)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,es,this.getRootNode().host),this.shadowRoot.innerHTML=`
502
+ `,super.connectedCallback(),tt(this,Ze,this.shadowRoot.querySelector("input")),f(this,Ze).addEventListener("keydown",f(this,jh)),f(this,Ze).addEventListener("compositionstart",c=>{c.target.selectionStart==c.target.selectionEnd&&f(this,Vr)&&H.getByteLength(c.target.value)>=Number(f(this,Vr))&&(c.target.value=H.cut(c.target.value,Number(f(this,Vr))),this.value=c.target.value)}),f(this,Ze).addEventListener("compositionupdate",c=>{f(this,ps)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ze).addEventListener("compositionend",c=>{}),f(this,Ze).addEventListener("keydown",c=>{c.isComposing||c.keyCode===229||(["Enter","Escape"].includes(c.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown"].includes(c.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(c)))})}}Ze=new WeakMap,ps=new WeakMap,Vr=new WeakMap,Ps=new WeakMap,mn=new WeakMap,ts=new WeakMap,jh=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",$d);class Ld{constructor(E){Y(this,je);Y(this,ci);Y(this,gn);Y(this,bn);Y(this,yn);it(this,"getHeight",E=>{const t=parseInt(E/f(this,je).template.length);if(t<0||t>=f(this,je).data.count())return 32;const l=f(this,je).data.__ng(t);return l?l.height[parseInt(E%f(this,je).template.length)]:32});it(this,"setHeight",(E,t)=>{f(this,je).data.get(parseInt(E/f(this,je).template.length)).__ng.height[parseInt(E%f(this,je).template.length)]=t});Y(this,ui,E=>typeof E=="object"&&E.tagName=="TR"?parseInt(E.getAttribute("data-row"))*f(this,je).template.length+E.sectionRowIndex%f(this,je).template.length:E);it(this,"attr",(E,t,l,c)=>{t=f(this,ui).call(this,t);var o=parseInt(t/f(this,je).template.length),r=f(this,je).data.get(o,"rowid"),n=t%f(this,je).template.length,s=H.decode(E,"head",f(this,gn),"foot",f(this,yn),f(this,bn)),e=s.findIndex(u=>u.rowid==r&&u.subrow==n);if(c)if(e<0){var i={rowid:r,subrow:n,cells:[]};i[l]=c,s.push(i)}else s[e][l]=c;else return e<0?null:s[e][l]});it(this,"height",(E,t,l)=>{var c=this.attr(E,t,"height",l);return c||(c=$(f(this,je).template[f(this,ui).call(this,t)%f(this,je).template.length]).height()),c});it(this,"attr2",(E,t,l,c,o)=>{l=f(this,ui).call(this,l);var r=parseInt(l/f(this,je).template.length),n=E&&E.hasOwnProperty("rowid")?E[r].rowid:null,s=l%f(this,je).template.length,e=H.decode(t,"head",f(this,gn),"foot",f(this,yn),f(this,bn)),i=e.findIndex(a=>a.rowid==n&&a.subrow==s);if(o)if(i<0){var u={rowid:n,subrow:s,cells:[]};u[c]=o,e.push(u)}else e[i][c]=o;else return i<0?null:e[i][c]});it(this,"height2",(E,t,l,c)=>{var o=this.attr2(E,t,l,"height",c);return o||(o=$(f(this,je).template[f(this,ui).call(this,l)%f(this,je).template.length]).height()),o});tt(this,je,E),tt(this,ci,-1),tt(this,gn,[]),tt(this,bn,[]),tt(this,yn,[]),this.head={attr:(t,l,c)=>this.attr("head",t,l,c),height:(t,l)=>this.height("head",t,l)},this.body={attr:(t,l,c)=>this.attr("body",t,l,c),height:(t,l)=>this.height("body",t,l),height2:(t,l,c)=>this.height2(t,"body",l,c)},this.foot={attr:(t,l,c)=>this.attr("foot",t,l,c),height:(t,l)=>this.height("foot",t,l)}}get row(){return f(this,ci)}set row(E){tt(this,ci,parseInt(E)),f(this,je).selection.selectedStartRow==f(this,je).selection.selectedEndRow&&(f(this,je).selection.selectedStartRow=f(this,je).selection.selectedEndRow=f(this,je).selection.startRow=f(this,ci))}}je=new WeakMap,ci=new WeakMap,gn=new WeakMap,bn=new WeakMap,yn=new WeakMap,ui=new WeakMap;class Pd extends HTMLElement{constructor(){super();Y(this,es);Y(this,rs);it(this,"popup",()=>{setTimeout(()=>{f(this,rs).data.assign(f(this,es).data.get()),this.shadowRoot.querySelector("dialog").showModal()},100)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,es,this.getRootNode().host),this.shadowRoot.innerHTML=`
503
503
  <style>
504
504
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
505
505
  :host {
@@ -514,14 +514,14 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
514
514
  ${f(this,es).originFormat}
515
515
  </nx-dialog>
516
516
  `,tt(this,rs,this.shadowRoot.querySelector("nine-grid")),f(this,rs).removeAttribute("display-row-count"),$(".reset",this.shadowRoot).on("click",t=>{f(this,rs).data.assign(f(this,es).data.get())}),$(".apply",this.shadowRoot).on("click",t=>{var l=f(this,rs).data.getChangedData();f(this,es).data.add(l.insert);for(var c of l.update)f(this,es).data.update(c);for(var c of l.delete)f(this,es).data.delete(c);f(this,rs).data.changeRowState()}),this.shadowRoot.addEventListener("click",t=>{f(this,rs).data.isChanged()&&(t.stopImmediatePropagation(),H.confirm(`There is changed data.
517
- Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"}).then(l=>{l&&$(".apply",this.shadowRoot).trigger("click"),this.shadowRoot.querySelector("nx-dialog").close()}))})}}es=new WeakMap,rs=new WeakMap,customElements.get("ng-max-popup")||customElements.define("ng-max-popup",Dd);class Bd extends HTMLElement{constructor(){super();Y(this,Lt);Y(this,sa);Y(this,$h);tt(this,sa,new Nd(f(this,Lt))),tt(this,$h,new Cu(f(this,Lt)))}connectedCallback(){tt(this,Lt,this.getRootNode().host.getRootNode().host),this.innerHTML="";var t=new od({owner:f(this,Lt),items:{filtering:{name:"Filtering",className:"ng-menu-filtering"},maximize:{name:"Maximize",className:"maximize"},export:{name:"export",items:{"export-excel":{name:"Excel",className:"export-excel"},"export-pdf":{name:"Pdf",className:"export-pdf",disabled:function(l,c){return!0}}}},import:{name:"import",className:"import",disabled:function(l,c){return!0}},properties:{name:"options",items:{"show-title-bar":{name:"title bar show/hide",className:"show-title-bar"},"show-menu-icon":{name:"menu icon show/hide",className:"show-menu-icon"},"show-status-bar":{name:"status bar show/hide",className:"show-status-bar"},"show-tfoot":{name:"table footer show/hide",className:"show-tfoot",disabled:function(l,c){return!($(".ng-table tfoot",this.getRootNode().host).length>0)}},"select-type":{name:"select type",items:{[`select-type-${H.SELECTTYPE.ROW}`]:{name:"row",className:`select-type select-type-${H.SELECTTYPE.ROW}`},[`select-type-${H.SELECTTYPE.ROWS}`]:{name:"multi row",className:`select-type select-type-${H.SELECTTYPE.ROWS}`},[`select-type-${H.SELECTTYPE.COL}`]:{name:"column",className:`select-type select-type-${H.SELECTTYPE.COL}`},[`select-type-${H.SELECTTYPE.COLS}`]:{name:"multi column",className:`select-type select-type-${H.SELECTTYPE.COLS}`},[`select-type-${H.SELECTTYPE.CELL}`]:{name:"cell",className:`select-type select-type-${H.SELECTTYPE.CELL}`},[`select-type-${H.SELECTTYPE.AREA}`]:{name:"area",className:`select-type select-type-${H.SELECTTYPE.AREA}`},[`select-type-${H.SELECTTYPE.NONE}`]:{name:"none",className:`select-type select-type-${H.SELECTTYPE.NONE}`}}},"paging-type":{name:"paging type",items:{[`paging-type-${H.PAGINGTYPE.NONE}`]:{name:"none",className:`paging-type paging-type-${H.PAGINGTYPE.NONE}`},[`paging-type-${H.PAGINGTYPE.CLIENT}`]:{name:"client",className:`paging-type paging-type-${H.PAGINGTYPE.CLIENT}`},[`paging-type-${H.PAGINGTYPE.SERVER}`]:{name:"server",className:`paging-type paging-type-${H.PAGINGTYPE.SERVER}`},"paging-count":{name:"entries per page",items:{[`paging-count-${H.PAGINGCOUNT.AUTO}`]:{name:"auto",className:`paging-count paging-count-${H.PAGINGCOUNT.AUTO}`},[`paging-count-${H.PAGINGCOUNT.NUM_1}`]:{name:"1",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_1}`},[`paging-count-${H.PAGINGCOUNT.NUM_5}`]:{name:"5",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_5}`},[`paging-count-${H.PAGINGCOUNT.NUM_10}`]:{name:"10",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_10}`},[`paging-count-${H.PAGINGCOUNT.NUM_20}`]:{name:"20",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_20}`},[`paging-count-${H.PAGINGCOUNT.NUM_30}`]:{name:"30",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_30}`},[`paging-count-${H.PAGINGCOUNT.NUM_50}`]:{name:"50",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_50}`},[`paging-count-${H.PAGINGCOUNT.NUM_100}`]:{name:"100",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_100}`},[`paging-count-${H.PAGINGCOUNT.NUM_1000}`]:{name:"1000",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_1000}`},[`paging-count-${H.PAGINGCOUNT.NUM_10000}`]:{name:"10000",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_10000}`}}}}},"auto-fit-col":{name:"auto fit columns",className:"auto-fit-col"}}}},callback:l=>{switch(l.menuId){case"maximize":$("ng-max-popup",f(this,Lt).shadowRoot).remove(),$(f(this,Lt).shadowRoot).append($("<ng-max-popup></ng-max-popup>")),f(this,Lt).shadowRoot.querySelector("ng-max-popup").popup();break;case"import":f(this,sa).importExcel();break;case"export-excel":f(this,Lt).export();break;case"export-pdf":$("ng-export",f(this,Lt).shadowRoot).remove(),$(f(this,Lt).shadowRoot).append($("<ng-export></ng-export>")),f(this,Lt).shadowRoot.querySelector("ng-export").exportPdf();break;case"detail":break;case"filtering":f(this,Lt).filtering.isFiltering()?f(this,Lt).filtering.off():f(this,Lt).filtering.on();break;case`select-type-${H.SELECTTYPE.ROW}`:case`select-type-${H.SELECTTYPE.ROWS}`:case`select-type-${H.SELECTTYPE.COL}`:case`select-type-${H.SELECTTYPE.COLS}`:case`select-type-${H.SELECTTYPE.CELL}`:case`select-type-${H.SELECTTYPE.AREA}`:case`select-type-${H.SELECTTYPE.NONE}`:f(this,Lt).setAttribute("select-type",l.menuId.replace("select-type-",""));break;case"show-title-bar":f(this,Lt).setAttribute("show-title-bar",f(this,Lt).getAttribute("show-title-bar")=="true"?"false":"true");break;case"show-menu-icon":f(this,Lt).setAttribute("show-menu-icon",f(this,Lt).getAttribute("show-menu-icon")=="true"?"false":"true");break;case"show-status-bar":f(this,Lt).setAttribute("show-status-bar",f(this,Lt).getAttribute("show-status-bar")=="true"?"false":"true");break;case`paging-type-${H.PAGINGTYPE.NONE}`:case`paging-type-${H.PAGINGTYPE.CLIENT}`:case`paging-type-${H.PAGINGTYPE.SERVER}`:f(this,Lt).setAttribute("paging-type",l.menuId.replace("paging-type-",""));break;case`paging-count-${H.PAGINGCOUNT.AUTO}`:case`paging-count-${H.PAGINGCOUNT.NUM_1}`:case`paging-count-${H.PAGINGCOUNT.NUM_5}`:case`paging-count-${H.PAGINGCOUNT.NUM_10}`:case`paging-count-${H.PAGINGCOUNT.NUM_20}`:case`paging-count-${H.PAGINGCOUNT.NUM_30}`:case`paging-count-${H.PAGINGCOUNT.NUM_50}`:case`paging-count-${H.PAGINGCOUNT.NUM_100}`:case`paging-count-${H.PAGINGCOUNT.NUM_1000}`:case`paging-count-${H.PAGINGCOUNT.NUM_10000}`:f(this,Lt).setAttribute("paging-count",l.menuId.replace("paging-count-",""));break;case"col-indicator-type":f(this,Lt).setAttribute("col-indicator-type",f(this,Lt).getAttribute("col-indicator-type")==H.COLINDICATORTYPE.EXPAND?H.COLINDICATORTYPE.COLLAPSE:H.COLINDICATORTYPE.EXPAND);break;case"auto-fit-col":f(this,Lt).setAttribute("auto-fit-col",f(this,Lt).getAttribute("auto-fit-col")=="true"?"false":"true");break;case"show-tfoot":f(this,Lt).setAttribute("show-tfoot",f(this,Lt).getAttribute("show-tfoot")=="true"?"false":"true");break;default:console.log(l.menuId)}},events:{show:l=>{H.j.querySelectorAll(f(this,Lt)).hasClass("ng-maximize")?H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-title-bar")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-title-bar",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-title-bar",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-menu-icon")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-menu-icon",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-menu-icon",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-status-bar")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-status-bar",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-status-bar",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll("ng-context-menu-panel .select-type",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .select-type-${f(this,Lt).getAttribute("select-type")}`,f(this,Lt).shadowRoot).addClass("on"),H.j.querySelectorAll("ng-context-menu-panel .paging-type",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .paging-type-${f(this,Lt).getAttribute("paging-type")}`,f(this,Lt).shadowRoot).addClass("on"),H.j.querySelectorAll("ng-context-menu-panel .paging-count",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .paging-count-${f(this,Lt).getAttribute("paging-count")}`,f(this,Lt).shadowRoot).addClass("on"),f(this,Lt).filtering.isFiltering()?H.j.querySelectorAll("ng-context-menu-panel .ng-menu-filtering",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .ng-menu-filtering",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("auto-fit-col")=="true"?H.j.querySelectorAll("ng-context-menu-panel .auto-fit-col",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .auto-fit-col",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("col-indicator-type")==H.COLINDICATORTYPE.EXPAND?H.j.querySelectorAll("ng-context-menu-panel .col-indicator-type",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .col-indicator-type",f(this,Lt).shadowRoot).removeClass("on");const c=f(this,Lt).body.querySelector(".ng-table tfoot"),o=H.j.querySelectorAll("ng-context-menu-panel .show-tfoot",f(this,Lt).shadowRoot);c?(o.removeClass("disabled"),c.style.visibility=="collapse"?o.removeClass("on"):o.addClass("on")):o.addClass("disabled"),typeof ExcelJS>"u"&&H.j.querySelectorAll("ng-context-menu-panel .import,ng-context-menu-panel .export-excel",f(this,Lt).shadowRoot).addClass("disabled"),H.j.querySelectorAll("ng-context-menu-panel .import,ng-context-menu-panel .export-pdf",f(this,Lt).shadowRoot).addClass("disabled"),f(this,Lt).closest("dialog")?H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).addClass("disabled"):H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).removeClass("disabled")},hide:()=>{}}});$(f(this,Lt).shadowRoot.querySelector("ng-head").shadowRoot.querySelector("ng-menu")).on("click",l=>{t.openMenu(l.offsetX,l.offsetY)})}}Lt=new WeakMap,sa=new WeakMap,$h=new WeakMap,customElements.get("ng-menu")||customElements.define("ng-menu",Bd);class Fd extends HTMLElement{constructor(){super();Y(this,Fe);Y(this,ia);Y(this,na);Y(this,Rr);Y(this,oa);Y(this,Xe);Y(this,rr);Y(this,Ds);it(this,"refreshTotal",()=>{});Y(this,Lh,()=>{f(this,Fe).data.getValidDataNF().map(t=>{t.__ng.paging=!0}),f(this,Fe).data.resetRecords()});Y(this,vn,()=>{this.type==H.PAGINGTYPE.CLIENT?$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Fe).data.countNF().toLocaleString()}`):this.type==H.PAGINGTYPE.SERVER?$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Ds).toLocaleString()}`):this.type==H.PAGINGTYPE.NONE&&$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Ds).toLocaleString()}`),f(this,rr)==0?$("span",this).eq(0).html(""):$("span",this).eq(0).html(`${f(this,Xe).toLocaleString()} <i>of</i> ${f(this,rr).toLocaleString()}`),H.j.querySelectorAll(".ng-paging-first",this).attr("disabled",f(this,Xe)==1||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-prev",this).attr("disabled",f(this,Xe)==1||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-next",this).attr("disabled",f(this,Xe)==f(this,rr)||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-last",this).attr("disabled",f(this,Xe)==f(this,rr)||f(this,rr)<1)});Y(this,Ph,()=>{this.type==H.PAGINGTYPE.CLIENT?this.movePage(Math.ceil(f(this,Fe).data.countNF()/f(this,Rr))):this.type==H.PAGINGTYPE.SERVER&&this.movePage(Math.ceil(f(this,Ds)/f(this,Rr)))});it(this,"movePage",t=>{if(!(!f(this,Fe)||!f(this,Fe).data||isNaN(t))){if(this.type==H.PAGINGTYPE.SERVER&&(H.j.querySelectorAll(".ng-paging-first",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-prev",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-next",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-last",this).attr("disabled",!0)),tt(this,oa,f(this,Xe)),tt(this,Xe,t),this.type==H.PAGINGTYPE.CLIENT){var l=f(this,Fe).data.getValidDataNF();if(tt(this,rr,Math.ceil(l.length/f(this,Rr))),l.length==0)tt(this,rr,0);else if(t<1||t>f(this,rr))throw`1invalid page ${t} of ${f(this,rr)}`;f(this,vn).call(this),l.map(o=>{o.__ng.paging=!1});for(var c=(f(this,Xe)-1)*f(this,Rr);c<Math.min(f(this,Xe)*f(this,Rr),f(this,Fe).data.countNF());c++)l[c].__ng.paging=!0;f(this,Fe).data.resetRecords(),f(this,Fe).scrollTo_V1(0)}this.type==H.PAGINGTYPE.SERVER&&f(this,oa)!=f(this,Xe)&&(this.onpagechanged.pageIndex=f(this,Xe),this.onpagechanged.pageCnt=f(this,Rr),f(this,Fe).dispatchEvent(this.onpagechanged))}});it(this,"reset",()=>{this.refresh()});it(this,"refresh",()=>{switch(this.type){case H.PAGINGTYPE.NONE:f(this,Lh).call(this),$(".ng-container tbody tr.bindable:not(.nodata)",f(this,Fe).body).remove(),f(this,Fe).scrollTo_V1(0);break;case H.PAGINGTYPE.CLIENT:this.movePage(1),f(this,Fe).refresh();break;case H.PAGINGTYPE.SERVER:break}f(this,vn).call(this)});tt(this,Fe,this.getRootNode().host.getRootNode().host),tt(this,Xe,0),tt(this,rr,0),tt(this,Ds,0),this.onpagechanged=new CustomEvent("pagechanged",{bubbles:!0,detail:{}})}connectedCallback(){this.innerHTML=`
517
+ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"}).then(l=>{l&&$(".apply",this.shadowRoot).trigger("click"),this.shadowRoot.querySelector("nx-dialog").close()}))})}}es=new WeakMap,rs=new WeakMap,customElements.get("ng-max-popup")||customElements.define("ng-max-popup",Pd);class Dd extends HTMLElement{constructor(){super();Y(this,Lt);Y(this,sa);Y(this,$h);tt(this,sa,new Id(f(this,Lt))),tt(this,$h,new Cu(f(this,Lt)))}connectedCallback(){tt(this,Lt,this.getRootNode().host.getRootNode().host),this.innerHTML="";var t=new nd({owner:f(this,Lt),items:{filtering:{name:"Filtering",className:"ng-menu-filtering"},maximize:{name:"Maximize",className:"maximize"},export:{name:"export",items:{"export-excel":{name:"Excel",className:"export-excel"},"export-pdf":{name:"Pdf",className:"export-pdf",disabled:function(l,c){return!0}}}},import:{name:"import",className:"import",disabled:function(l,c){return!0}},properties:{name:"options",items:{"show-title-bar":{name:"title bar show/hide",className:"show-title-bar"},"show-menu-icon":{name:"menu icon show/hide",className:"show-menu-icon"},"show-status-bar":{name:"status bar show/hide",className:"show-status-bar"},"show-tfoot":{name:"table footer show/hide",className:"show-tfoot",disabled:function(l,c){return!($(".ng-table tfoot",this.getRootNode().host).length>0)}},"select-type":{name:"select type",items:{[`select-type-${H.SELECTTYPE.ROW}`]:{name:"row",className:`select-type select-type-${H.SELECTTYPE.ROW}`},[`select-type-${H.SELECTTYPE.ROWS}`]:{name:"multi row",className:`select-type select-type-${H.SELECTTYPE.ROWS}`},[`select-type-${H.SELECTTYPE.COL}`]:{name:"column",className:`select-type select-type-${H.SELECTTYPE.COL}`},[`select-type-${H.SELECTTYPE.COLS}`]:{name:"multi column",className:`select-type select-type-${H.SELECTTYPE.COLS}`},[`select-type-${H.SELECTTYPE.CELL}`]:{name:"cell",className:`select-type select-type-${H.SELECTTYPE.CELL}`},[`select-type-${H.SELECTTYPE.AREA}`]:{name:"area",className:`select-type select-type-${H.SELECTTYPE.AREA}`},[`select-type-${H.SELECTTYPE.NONE}`]:{name:"none",className:`select-type select-type-${H.SELECTTYPE.NONE}`}}},"paging-type":{name:"paging type",items:{[`paging-type-${H.PAGINGTYPE.NONE}`]:{name:"none",className:`paging-type paging-type-${H.PAGINGTYPE.NONE}`},[`paging-type-${H.PAGINGTYPE.CLIENT}`]:{name:"client",className:`paging-type paging-type-${H.PAGINGTYPE.CLIENT}`},[`paging-type-${H.PAGINGTYPE.SERVER}`]:{name:"server",className:`paging-type paging-type-${H.PAGINGTYPE.SERVER}`},"paging-count":{name:"entries per page",items:{[`paging-count-${H.PAGINGCOUNT.AUTO}`]:{name:"auto",className:`paging-count paging-count-${H.PAGINGCOUNT.AUTO}`},[`paging-count-${H.PAGINGCOUNT.NUM_1}`]:{name:"1",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_1}`},[`paging-count-${H.PAGINGCOUNT.NUM_5}`]:{name:"5",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_5}`},[`paging-count-${H.PAGINGCOUNT.NUM_10}`]:{name:"10",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_10}`},[`paging-count-${H.PAGINGCOUNT.NUM_20}`]:{name:"20",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_20}`},[`paging-count-${H.PAGINGCOUNT.NUM_30}`]:{name:"30",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_30}`},[`paging-count-${H.PAGINGCOUNT.NUM_50}`]:{name:"50",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_50}`},[`paging-count-${H.PAGINGCOUNT.NUM_100}`]:{name:"100",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_100}`},[`paging-count-${H.PAGINGCOUNT.NUM_1000}`]:{name:"1000",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_1000}`},[`paging-count-${H.PAGINGCOUNT.NUM_10000}`]:{name:"10000",className:`paging-count paging-count-${H.PAGINGCOUNT.NUM_10000}`}}}}},"auto-fit-col":{name:"auto fit columns",className:"auto-fit-col"}}}},callback:l=>{switch(l.menuId){case"maximize":$("ng-max-popup",f(this,Lt).shadowRoot).remove(),$(f(this,Lt).shadowRoot).append($("<ng-max-popup></ng-max-popup>")),f(this,Lt).shadowRoot.querySelector("ng-max-popup").popup();break;case"import":f(this,sa).importExcel();break;case"export-excel":f(this,Lt).export();break;case"export-pdf":$("ng-export",f(this,Lt).shadowRoot).remove(),$(f(this,Lt).shadowRoot).append($("<ng-export></ng-export>")),f(this,Lt).shadowRoot.querySelector("ng-export").exportPdf();break;case"detail":break;case"filtering":f(this,Lt).filtering.isFiltering()?f(this,Lt).filtering.off():f(this,Lt).filtering.on();break;case`select-type-${H.SELECTTYPE.ROW}`:case`select-type-${H.SELECTTYPE.ROWS}`:case`select-type-${H.SELECTTYPE.COL}`:case`select-type-${H.SELECTTYPE.COLS}`:case`select-type-${H.SELECTTYPE.CELL}`:case`select-type-${H.SELECTTYPE.AREA}`:case`select-type-${H.SELECTTYPE.NONE}`:f(this,Lt).setAttribute("select-type",l.menuId.replace("select-type-",""));break;case"show-title-bar":f(this,Lt).setAttribute("show-title-bar",f(this,Lt).getAttribute("show-title-bar")=="true"?"false":"true");break;case"show-menu-icon":f(this,Lt).setAttribute("show-menu-icon",f(this,Lt).getAttribute("show-menu-icon")=="true"?"false":"true");break;case"show-status-bar":f(this,Lt).setAttribute("show-status-bar",f(this,Lt).getAttribute("show-status-bar")=="true"?"false":"true");break;case`paging-type-${H.PAGINGTYPE.NONE}`:case`paging-type-${H.PAGINGTYPE.CLIENT}`:case`paging-type-${H.PAGINGTYPE.SERVER}`:f(this,Lt).setAttribute("paging-type",l.menuId.replace("paging-type-",""));break;case`paging-count-${H.PAGINGCOUNT.AUTO}`:case`paging-count-${H.PAGINGCOUNT.NUM_1}`:case`paging-count-${H.PAGINGCOUNT.NUM_5}`:case`paging-count-${H.PAGINGCOUNT.NUM_10}`:case`paging-count-${H.PAGINGCOUNT.NUM_20}`:case`paging-count-${H.PAGINGCOUNT.NUM_30}`:case`paging-count-${H.PAGINGCOUNT.NUM_50}`:case`paging-count-${H.PAGINGCOUNT.NUM_100}`:case`paging-count-${H.PAGINGCOUNT.NUM_1000}`:case`paging-count-${H.PAGINGCOUNT.NUM_10000}`:f(this,Lt).setAttribute("paging-count",l.menuId.replace("paging-count-",""));break;case"col-indicator-type":f(this,Lt).setAttribute("col-indicator-type",f(this,Lt).getAttribute("col-indicator-type")==H.COLINDICATORTYPE.EXPAND?H.COLINDICATORTYPE.COLLAPSE:H.COLINDICATORTYPE.EXPAND);break;case"auto-fit-col":f(this,Lt).setAttribute("auto-fit-col",f(this,Lt).getAttribute("auto-fit-col")=="true"?"false":"true");break;case"show-tfoot":f(this,Lt).setAttribute("show-tfoot",f(this,Lt).getAttribute("show-tfoot")=="true"?"false":"true");break;default:console.log(l.menuId)}},events:{show:l=>{H.j.querySelectorAll(f(this,Lt)).hasClass("ng-maximize")?H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-title-bar")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-title-bar",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-title-bar",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-menu-icon")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-menu-icon",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-menu-icon",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("show-status-bar")=="true"?H.j.querySelectorAll("ng-context-menu-panel .show-status-bar",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .show-status-bar",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll("ng-context-menu-panel .select-type",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .select-type-${f(this,Lt).getAttribute("select-type")}`,f(this,Lt).shadowRoot).addClass("on"),H.j.querySelectorAll("ng-context-menu-panel .paging-type",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .paging-type-${f(this,Lt).getAttribute("paging-type")}`,f(this,Lt).shadowRoot).addClass("on"),H.j.querySelectorAll("ng-context-menu-panel .paging-count",f(this,Lt).shadowRoot).removeClass("on"),H.j.querySelectorAll(`ng-context-menu-panel .paging-count-${f(this,Lt).getAttribute("paging-count")}`,f(this,Lt).shadowRoot).addClass("on"),f(this,Lt).filtering.isFiltering()?H.j.querySelectorAll("ng-context-menu-panel .ng-menu-filtering",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .ng-menu-filtering",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("auto-fit-col")=="true"?H.j.querySelectorAll("ng-context-menu-panel .auto-fit-col",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .auto-fit-col",f(this,Lt).shadowRoot).removeClass("on"),f(this,Lt).getAttribute("col-indicator-type")==H.COLINDICATORTYPE.EXPAND?H.j.querySelectorAll("ng-context-menu-panel .col-indicator-type",f(this,Lt).shadowRoot).addClass("on"):H.j.querySelectorAll("ng-context-menu-panel .col-indicator-type",f(this,Lt).shadowRoot).removeClass("on");const c=f(this,Lt).body.querySelector(".ng-table tfoot"),o=H.j.querySelectorAll("ng-context-menu-panel .show-tfoot",f(this,Lt).shadowRoot);c?(o.removeClass("disabled"),c.style.visibility=="collapse"?o.removeClass("on"):o.addClass("on")):o.addClass("disabled"),typeof ExcelJS>"u"&&H.j.querySelectorAll("ng-context-menu-panel .import,ng-context-menu-panel .export-excel",f(this,Lt).shadowRoot).addClass("disabled"),H.j.querySelectorAll("ng-context-menu-panel .import,ng-context-menu-panel .export-pdf",f(this,Lt).shadowRoot).addClass("disabled"),f(this,Lt).closest("dialog")?H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).addClass("disabled"):H.j.querySelectorAll("ng-context-menu-panel .maximize",f(this,Lt).shadowRoot).removeClass("disabled")},hide:()=>{}}});$(f(this,Lt).shadowRoot.querySelector("ng-head").shadowRoot.querySelector("ng-menu")).on("click",l=>{t.openMenu(l.offsetX,l.offsetY)})}}Lt=new WeakMap,sa=new WeakMap,$h=new WeakMap,customElements.get("ng-menu")||customElements.define("ng-menu",Dd);class Bd extends HTMLElement{constructor(){super();Y(this,Fe);Y(this,ia);Y(this,na);Y(this,Rr);Y(this,oa);Y(this,Xe);Y(this,rr);Y(this,Ds);it(this,"refreshTotal",()=>{});Y(this,Lh,()=>{f(this,Fe).data.getValidDataNF().map(t=>{t.__ng.paging=!0}),f(this,Fe).data.resetRecords()});Y(this,vn,()=>{this.type==H.PAGINGTYPE.CLIENT?$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Fe).data.countNF().toLocaleString()}`):this.type==H.PAGINGTYPE.SERVER?$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Ds).toLocaleString()}`):this.type==H.PAGINGTYPE.NONE&&$("span",this).eq(1).html(`<b>Total</b> : ${f(this,Ds).toLocaleString()}`),f(this,rr)==0?$("span",this).eq(0).html(""):$("span",this).eq(0).html(`${f(this,Xe).toLocaleString()} <i>of</i> ${f(this,rr).toLocaleString()}`),H.j.querySelectorAll(".ng-paging-first",this).attr("disabled",f(this,Xe)==1||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-prev",this).attr("disabled",f(this,Xe)==1||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-next",this).attr("disabled",f(this,Xe)==f(this,rr)||f(this,rr)<1),H.j.querySelectorAll(".ng-paging-last",this).attr("disabled",f(this,Xe)==f(this,rr)||f(this,rr)<1)});Y(this,Ph,()=>{this.type==H.PAGINGTYPE.CLIENT?this.movePage(Math.ceil(f(this,Fe).data.countNF()/f(this,Rr))):this.type==H.PAGINGTYPE.SERVER&&this.movePage(Math.ceil(f(this,Ds)/f(this,Rr)))});it(this,"movePage",t=>{if(!(!f(this,Fe)||!f(this,Fe).data||isNaN(t))){if(this.type==H.PAGINGTYPE.SERVER&&(H.j.querySelectorAll(".ng-paging-first",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-prev",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-next",this).attr("disabled",!0),H.j.querySelectorAll(".ng-paging-last",this).attr("disabled",!0)),tt(this,oa,f(this,Xe)),tt(this,Xe,t),this.type==H.PAGINGTYPE.CLIENT){var l=f(this,Fe).data.getValidDataNF();if(tt(this,rr,Math.ceil(l.length/f(this,Rr))),l.length==0)tt(this,rr,0);else if(t<1||t>f(this,rr))throw`1invalid page ${t} of ${f(this,rr)}`;f(this,vn).call(this),l.map(o=>{o.__ng.paging=!1});for(var c=(f(this,Xe)-1)*f(this,Rr);c<Math.min(f(this,Xe)*f(this,Rr),f(this,Fe).data.countNF());c++)l[c].__ng.paging=!0;f(this,Fe).data.resetRecords(),f(this,Fe).scrollTo_V1(0)}this.type==H.PAGINGTYPE.SERVER&&f(this,oa)!=f(this,Xe)&&(this.onpagechanged.pageIndex=f(this,Xe),this.onpagechanged.pageCnt=f(this,Rr),f(this,Fe).dispatchEvent(this.onpagechanged))}});it(this,"reset",()=>{this.refresh()});it(this,"refresh",()=>{switch(this.type){case H.PAGINGTYPE.NONE:f(this,Lh).call(this),$(".ng-container tbody tr.bindable:not(.nodata)",f(this,Fe).body).remove(),f(this,Fe).scrollTo_V1(0);break;case H.PAGINGTYPE.CLIENT:this.movePage(1),f(this,Fe).refresh();break;case H.PAGINGTYPE.SERVER:break}f(this,vn).call(this)});tt(this,Fe,this.getRootNode().host.getRootNode().host),tt(this,Xe,0),tt(this,rr,0),tt(this,Ds,0),this.onpagechanged=new CustomEvent("pagechanged",{bubbles:!0,detail:{}})}connectedCallback(){this.innerHTML=`
518
518
  <button class="ng-paging-last" disabled></button>
519
519
  <button class="ng-paging-next" disabled></button>
520
520
  <span></span>
521
521
  <button class="ng-paging-prev" disabled></button>
522
522
  <button class="ng-paging-first" disabled></button>
523
523
  <span></span>
524
- `,$(".ng-paging-first",this).on("click",t=>this.movePage(1)),$(".ng-paging-prev",this).on("click",t=>this.movePage(f(this,Xe)-1)),$(".ng-paging-next",this).on("click",t=>this.movePage(f(this,Xe)+1)),$(".ng-paging-last",this).on("click",t=>f(this,Ph).call(this))}get type(){return f(this,Fe).getAttribute("paging-type")}set type(t){if(!Object.values(H.PAGINGTYPE).includes(t))throw`invalid page type : ${t}`;switch(t){case H.PAGINGTYPE.NONE:$(this).children().show(),$(this).children().not("span:last-child").hide();break;case H.PAGINGTYPE.CLIENT:$(this).children().show();break;case H.PAGINGTYPE.SERVER:$(this).children().show();break}this.refresh()}get currentPage(){return f(this,Xe)}set currentPage(t){if(this.type!=H.PAGINGTYPE.SERVER)throw'"currentPage" is only allowed when the paging type is server.';tt(this,Xe,t)}get totalCount(){return f(this,rr)}set totalCount(t){tt(this,Ds,t),f(this,Xe)<=0&&tt(this,Xe,1),tt(this,rr,Math.ceil(t/f(this,Rr))),f(this,vn).call(this)}get linesPerPage(){return f(this,Rr)}get count(){return f(this,ia)}set count(t){setTimeout(()=>{if(tt(this,ia,t),t==H.PAGINGCOUNT.AUTO){var l=$(".ng-container-body",f(this,Fe).body).height()-($(".ng-container-body thead",f(this,Fe).body).height()||0)-($(".ng-container-body tfoot",f(this,Fe).body).height()||0),c=0;$(f(this,Fe).template).each((o,r)=>c+=$(r).height()),tt(this,Rr,Math.floor(l/c))}else tt(this,Rr,Number(t));switch(this.type){case H.PAGINGTYPE.NONE:this.refresh();break;case H.PAGINGTYPE.CLIENT:this.refresh();break;case H.PAGINGTYPE.SERVER:this.movePage(1);break}})}get url(){return f(this,na)}set url(t){tt(this,na,t)}}Fe=new WeakMap,ia=new WeakMap,na=new WeakMap,Rr=new WeakMap,oa=new WeakMap,Xe=new WeakMap,rr=new WeakMap,Ds=new WeakMap,Lh=new WeakMap,vn=new WeakMap,Ph=new WeakMap,customElements.get("ng-paging")||customElements.define("ng-paging",Fd);class qd extends _r{constructor(){super();Y(this,di);Y(this,aa);it(this,"dataRefresh",t=>{f(this,di).value=this.value,f(this,aa).innerHTML=this.getDisplayText(),t||this.reset()})}connectedCallback(){const t=this.getAttribute("back-color")||"transparent",l=this.getAttribute("bar-color")||"green",c=this.getAttribute("show-text")||"true",o=this.getAttribute("text-color")||"unset",r=this.getAttribute("text-shadow")||"unset";for(var n=[],s=0;s<this.attributes.length;s++)["min","max","value"].includes(this.attributes[s].name)&&n.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);this.shadowRoot.innerHTML=`
524
+ `,$(".ng-paging-first",this).on("click",t=>this.movePage(1)),$(".ng-paging-prev",this).on("click",t=>this.movePage(f(this,Xe)-1)),$(".ng-paging-next",this).on("click",t=>this.movePage(f(this,Xe)+1)),$(".ng-paging-last",this).on("click",t=>f(this,Ph).call(this))}get type(){return f(this,Fe).getAttribute("paging-type")}set type(t){if(!Object.values(H.PAGINGTYPE).includes(t))throw`invalid page type : ${t}`;switch(t){case H.PAGINGTYPE.NONE:$(this).children().show(),$(this).children().not("span:last-child").hide();break;case H.PAGINGTYPE.CLIENT:$(this).children().show();break;case H.PAGINGTYPE.SERVER:$(this).children().show();break}this.refresh()}get currentPage(){return f(this,Xe)}set currentPage(t){if(this.type!=H.PAGINGTYPE.SERVER)throw'"currentPage" is only allowed when the paging type is server.';tt(this,Xe,t)}get totalCount(){return f(this,rr)}set totalCount(t){tt(this,Ds,t),f(this,Xe)<=0&&tt(this,Xe,1),tt(this,rr,Math.ceil(t/f(this,Rr))),f(this,vn).call(this)}get linesPerPage(){return f(this,Rr)}get count(){return f(this,ia)}set count(t){setTimeout(()=>{if(tt(this,ia,t),t==H.PAGINGCOUNT.AUTO){var l=$(".ng-container-body",f(this,Fe).body).height()-($(".ng-container-body thead",f(this,Fe).body).height()||0)-($(".ng-container-body tfoot",f(this,Fe).body).height()||0),c=0;$(f(this,Fe).template).each((o,r)=>c+=$(r).height()),tt(this,Rr,Math.floor(l/c))}else tt(this,Rr,Number(t));switch(this.type){case H.PAGINGTYPE.NONE:this.refresh();break;case H.PAGINGTYPE.CLIENT:this.refresh();break;case H.PAGINGTYPE.SERVER:this.movePage(1);break}})}get url(){return f(this,na)}set url(t){tt(this,na,t)}}Fe=new WeakMap,ia=new WeakMap,na=new WeakMap,Rr=new WeakMap,oa=new WeakMap,Xe=new WeakMap,rr=new WeakMap,Ds=new WeakMap,Lh=new WeakMap,vn=new WeakMap,Ph=new WeakMap,customElements.get("ng-paging")||customElements.define("ng-paging",Bd);class Fd extends _r{constructor(){super();Y(this,di);Y(this,aa);it(this,"dataRefresh",t=>{f(this,di).value=this.value,f(this,aa).innerHTML=this.getDisplayText(),t||this.reset()})}connectedCallback(){const t=this.getAttribute("back-color")||"transparent",l=this.getAttribute("bar-color")||"green",c=this.getAttribute("show-text")||"true",o=this.getAttribute("text-color")||"unset",r=this.getAttribute("text-shadow")||"unset";for(var n=[],s=0;s<this.attributes.length;s++)["min","max","value"].includes(this.attributes[s].name)&&n.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);this.shadowRoot.innerHTML=`
525
525
  <style>
526
526
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngProgress.css";
527
527
  ${H.getCustomPath(this,"ngProgress.css")}
@@ -543,7 +543,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
543
543
  <progress ${n.join(" ")}></progress>
544
544
  <span></span>
545
545
  </div>
546
- `,super.connectedCallback(),tt(this,di,this.shadowRoot.querySelector("progress")),tt(this,aa,this.shadowRoot.querySelector("span")),f(this,di).getAttribute("max")||f(this,di).setAttribute("max",100)}}di=new WeakMap,aa=new WeakMap,customElements.get("ng-progress")||customElements.define("ng-progress",qd);class Hd extends Qs{constructor(){super();Y(this,Bs);Y(this,Pr);Y(this,Fs);Y(this,fi);it(this,"dataRefresh",t=>{f(this,Pr)&&(f(this,Dh).call(this)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid")),$(f(this,Bs)).each((l,c)=>{$(c).prop("checked",this.value==c.getAttribute("value"))}),t||this.reset()});Y(this,Dh,()=>{if(H.isNull(this.value))return!0;var t=f(this,Pr).findIndex(l=>this.value==l[f(this,Fs)]);return!(t<0)});Y(this,Bh,()=>{})}async connectedCallback(){tt(this,Fs,this.getAttribute("code")||"code"),tt(this,fi,this.getAttribute("codename")||"codename");var t=this.querySelector("datalist");t&&(tt(this,Pr,[]),t.querySelectorAll("option").forEach(n=>{const s=n.getAttribute(f(this,Fs)),e=n.getAttribute(f(this,fi));s&&e&&f(this,Pr).push({[f(this,Fs)]:s,[f(this,fi)]:e})})),this.owner=this.getRootNode().host,this.cell=this.closest("th,td");const l=this.closest("th,td").getAttribute("text-align")||"center",c=l=="left"?"flex-start":l=="right"?"flex-end":"center";var o=this.getAttribute("data-source");o&&this.owner&&this.owner.exprFunction&&(this.owner[o]?tt(this,Pr,this.owner[o]):tt(this,Pr,this.owner.exprFunction(o).call(this,this.owner.data.get(this.cell.dataset.row),this.cell.dataset.row)));var r="";f(this,Pr)&&f(this,Pr).forEach(n=>{r+=`<label><input type="radio" value="${n[f(this,Fs)]}"><span>${n[f(this,fi)]}</span></label>`}),this.shadowRoot.innerHTML=`
546
+ `,super.connectedCallback(),tt(this,di,this.shadowRoot.querySelector("progress")),tt(this,aa,this.shadowRoot.querySelector("span")),f(this,di).getAttribute("max")||f(this,di).setAttribute("max",100)}}di=new WeakMap,aa=new WeakMap,customElements.get("ng-progress")||customElements.define("ng-progress",Fd);class qd extends Qs{constructor(){super();Y(this,Bs);Y(this,Pr);Y(this,Fs);Y(this,fi);it(this,"dataRefresh",t=>{f(this,Pr)&&(f(this,Dh).call(this)?H.j.querySelectorAll(this).removeClass("invalid"):H.j.querySelectorAll(this).addClass("invalid")),$(f(this,Bs)).each((l,c)=>{$(c).prop("checked",this.value==c.getAttribute("value"))}),t||this.reset()});Y(this,Dh,()=>{if(H.isNull(this.value))return!0;var t=f(this,Pr).findIndex(l=>this.value==l[f(this,Fs)]);return!(t<0)});Y(this,Bh,()=>{})}async connectedCallback(){tt(this,Fs,this.getAttribute("code")||"code"),tt(this,fi,this.getAttribute("codename")||"codename");var t=this.querySelector("datalist");t&&(tt(this,Pr,[]),t.querySelectorAll("option").forEach(n=>{const s=n.getAttribute(f(this,Fs)),e=n.getAttribute(f(this,fi));s&&e&&f(this,Pr).push({[f(this,Fs)]:s,[f(this,fi)]:e})})),this.owner=this.getRootNode().host,this.cell=this.closest("th,td");const l=this.closest("th,td").getAttribute("text-align")||"center",c=l=="left"?"flex-start":l=="right"?"flex-end":"center";var o=this.getAttribute("data-source");o&&this.owner&&this.owner.exprFunction&&(this.owner[o]?tt(this,Pr,this.owner[o]):tt(this,Pr,this.owner.exprFunction(o).call(this,this.owner.data.get(this.cell.dataset.row),this.cell.dataset.row)));var r="";f(this,Pr)&&f(this,Pr).forEach(n=>{r+=`<label><input type="radio" value="${n[f(this,Fs)]}"><span>${n[f(this,fi)]}</span></label>`}),this.shadowRoot.innerHTML=`
547
547
  <style>
548
548
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRadio.css";
549
549
  ${H.getCustomPath(this,"ngRadio.css")}
@@ -556,7 +556,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
556
556
  <div class="ng-wrap">
557
557
  ${r}
558
558
  </div>
559
- `,super.connectedCallback(),f(this,Bh).call(this),tt(this,Bs,this.shadowRoot.querySelectorAll("input")),$(this.cell).on("keydown",n=>{switch(n.preventDefault(),n.code){case"Space":var s=-1;$(f(this,Bs)).each((e,i)=>{if(this.value==i.getAttribute("value"))return s=e,!1}),s=s==f(this,Bs).length-1?0:s>=0?s+1:0,this.value=f(this,Bs)[s].getAttribute("value");break}})}get dataSource(){return f(this,Pr)}}Bs=new WeakMap,Pr=new WeakMap,Fs=new WeakMap,fi=new WeakMap,Dh=new WeakMap,Bh=new WeakMap,customElements.get("ng-radio")||customElements.define("ng-radio",Hd);class zd extends _r{constructor(){super();Y(this,wn);it(this,"dataRefresh",t=>{f(this,wn)&&(f(this,wn).innerHTML=this.getDisplayText(),t||this.reset())})}connectedCallback(){this.getAttribute("link")=="true";const t=this.closest("th,td").getAttribute("text-align")||"left",l=t=="left"?"flex-start":t=="right"?"flex-end":"center";if(this.cell=this.closest("th,td"),!this.cell)return;const c=this.getAttribute("color")||this.cell.getAttribute("color")||"";this.shadowRoot.innerHTML=`
559
+ `,super.connectedCallback(),f(this,Bh).call(this),tt(this,Bs,this.shadowRoot.querySelectorAll("input")),$(this.cell).on("keydown",n=>{switch(n.preventDefault(),n.code){case"Space":var s=-1;$(f(this,Bs)).each((e,i)=>{if(this.value==i.getAttribute("value"))return s=e,!1}),s=s==f(this,Bs).length-1?0:s>=0?s+1:0,this.value=f(this,Bs)[s].getAttribute("value");break}})}get dataSource(){return f(this,Pr)}}Bs=new WeakMap,Pr=new WeakMap,Fs=new WeakMap,fi=new WeakMap,Dh=new WeakMap,Bh=new WeakMap,customElements.get("ng-radio")||customElements.define("ng-radio",qd);class Hd extends _r{constructor(){super();Y(this,wn);it(this,"dataRefresh",t=>{f(this,wn)&&(f(this,wn).innerHTML=this.getDisplayText(),t||this.reset())})}connectedCallback(){this.getAttribute("link")=="true";const t=this.closest("th,td").getAttribute("text-align")||"left",l=t=="left"?"flex-start":t=="right"?"flex-end":"center";if(this.cell=this.closest("th,td"),!this.cell)return;const c=this.getAttribute("color")||this.cell.getAttribute("color")||"";this.shadowRoot.innerHTML=`
560
560
  <style>
561
561
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRenderer.css";
562
562
  ${H.getCustomPath(this,"ngRenderer.css")}
@@ -572,7 +572,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
572
572
  <div class="ng-wrap">
573
573
  <span class="renderer"></span>
574
574
  </div>
575
- `,super.connectedCallback(),tt(this,wn,this.shadowRoot.querySelector("span.renderer"))}}wn=new WeakMap,customElements.get("ng-renderer")||customElements.define("ng-renderer",zd);class Ud extends _r{constructor(){super();it(this,"dataRefresh",t=>{!this.owner||!this.cell||!this.data||t||this.reset()});Y(this,Fh,()=>{this.shadowRoot.querySelector("svg.dtl").addEventListener("click",t=>{$("ng-row-detail-popup",this.owner.shadowRoot).remove(),$(this.owner.shadowRoot).append($("<ng-row-detail-popup></ng-row-detail-popup>")),this.owner.shadowRoot.querySelector("ng-row-detail-popup").popup(this.cell.dataset.row)})})}connectedCallback(){this.shadowRoot.innerHTML=`
575
+ `,super.connectedCallback(),tt(this,wn,this.shadowRoot.querySelector("span.renderer"))}}wn=new WeakMap,customElements.get("ng-renderer")||customElements.define("ng-renderer",Hd);class zd extends _r{constructor(){super();it(this,"dataRefresh",t=>{!this.owner||!this.cell||!this.data||t||this.reset()});Y(this,Fh,()=>{this.shadowRoot.querySelector("svg.dtl").addEventListener("click",t=>{$("ng-row-detail-popup",this.owner.shadowRoot).remove(),$(this.owner.shadowRoot).append($("<ng-row-detail-popup></ng-row-detail-popup>")),this.owner.shadowRoot.querySelector("ng-row-detail-popup").popup(this.cell.dataset.row)})})}connectedCallback(){this.shadowRoot.innerHTML=`
576
576
  <style>
577
577
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowDetail.css";
578
578
  ${H.getCustomPath(this,"ngRowDetail.css")}
@@ -583,7 +583,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
583
583
  <path d="m6 10 8-8"></path>
584
584
  <path d="M14 9.048V14H2V2h5"></path>
585
585
  </svg>
586
- `,super.connectedCallback(),f(this,Fh).call(this)}}Fh=new WeakMap;class Vd extends HTMLElement{constructor(){super();Y(this,sr);Y(this,cr);Y(this,pi);it(this,"popup",t=>{var l=f(this,sr).body.querySelector(`tr[data-row="${t}"]`).data;tt(this,pi,l.__ng._[H.ROW.INDEX]),$(".title",this.shadowRoot).html(f(this,sr).getAttribute("caption")||"Details"),$(".sub-title",this.shadowRoot).html(`(${(Number(t)+1).toLocaleString()} of ${f(this,sr).data.count().toLocaleString()})`);var c=$("colgroup",f(this,cr)),o=500,r=$(".ng-container-body thead tr",f(this,sr).body).not(".col-indicator-rowgroup").length,n=f(this,sr).template.length,s=0;$(`tr [data-row=${t}]`,f(this,sr).body).not(".dummy").not(".first").not(".last").each((h,p)=>{s=Math.max(s,parseInt(p.getAttribute("data-col"))+parseInt(p.getAttribute("colspan")||1))});for(var e=0;e<r;e++){var i=o*.3/r;c.append(`<col width="${i}" />`)}for(var e=0;e<n;e++){var i=o*.7/n;c.append(`<col width="${i}" />`)}for(var e=0;e<s;e++){let p=$("<tr></tr>");for(var u=0;u<r;u++){const m=f(this,sr).body.querySelectorAll(`thead [data-col="${e}"]:not(.dummy):not(.first):not(.last):not(.col-indicator)`)[u];if(m){const d=m.getAttribute("rowspan")||1,b=m.getAttribute("colspan")||1,g=m.cloneNode(!0);g.setAttribute("rowspan",b),g.setAttribute("colspan",d),g.removeAttribute("fixed"),$(g).height($(m).height()),p.append(g)}}for(var u=0;u<n;u++){const d=f(this,sr).body.querySelectorAll(`[data-row="${t}"][data-col="${e}"]:not(.dummy):not(.first):not(.last)`)[u];if(d){const b=d.getAttribute("rowspan")||1,g=d.getAttribute("colspan")||1;if($("ng-row-indicator,ng-row-state,ng-row-pin,ng-row-detail",d).length>0){p=null;break}const S=d.cloneNode(!0);S.setAttribute("data-row",0),S.setAttribute("rowspan",g),S.setAttribute("colspan",b),S.removeAttribute("fixed"),p.append(S);for(const C of d.children){const I=C.getAttribute("data-source");I&&(f(this,cr)[I]=f(this,sr)[I])}}}p&&p.html()&&$("tbody.bindable tr.nodata",f(this,cr).shadowRoot).before(p)}$("ng-row-indicator",f(this,cr)).closest("tr").remove();var a=0;$("tbody.bindable tr:not(.nodata)",f(this,cr).shadowRoot).each((h,p)=>{$("th,td",p).each((m,d)=>{d.dataset.col=a,a+=d.colSpan||1})}),f(this,cr).shadowRoot.querySelector(".ng-body").style.height="100vh",f(this,cr).createTemplate(),this.shadowRoot.querySelector("dialog").showModal(),setTimeout(()=>{f(this,cr).data.source=[Object.assign({},f(this,sr).data.getNF(f(this,pi)))]})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,sr,this.getRootNode().host);const t=f(this,sr).getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
586
+ `,super.connectedCallback(),f(this,Fh).call(this)}}Fh=new WeakMap;class Ud extends HTMLElement{constructor(){super();Y(this,sr);Y(this,cr);Y(this,pi);it(this,"popup",t=>{var l=f(this,sr).body.querySelector(`tr[data-row="${t}"]`).data;tt(this,pi,l.__ng._[H.ROW.INDEX]),$(".title",this.shadowRoot).html(f(this,sr).getAttribute("caption")||"Details"),$(".sub-title",this.shadowRoot).html(`(${(Number(t)+1).toLocaleString()} of ${f(this,sr).data.count().toLocaleString()})`);var c=$("colgroup",f(this,cr)),o=500,r=$(".ng-container-body thead tr",f(this,sr).body).not(".col-indicator-rowgroup").length,n=f(this,sr).template.length,s=0;$(`tr [data-row=${t}]`,f(this,sr).body).not(".dummy").not(".first").not(".last").each((h,p)=>{s=Math.max(s,parseInt(p.getAttribute("data-col"))+parseInt(p.getAttribute("colspan")||1))});for(var e=0;e<r;e++){var i=o*.3/r;c.append(`<col width="${i}" />`)}for(var e=0;e<n;e++){var i=o*.7/n;c.append(`<col width="${i}" />`)}for(var e=0;e<s;e++){let p=$("<tr></tr>");for(var u=0;u<r;u++){const m=f(this,sr).body.querySelectorAll(`thead [data-col="${e}"]:not(.dummy):not(.first):not(.last):not(.col-indicator)`)[u];if(m){const d=m.getAttribute("rowspan")||1,b=m.getAttribute("colspan")||1,g=m.cloneNode(!0);g.setAttribute("rowspan",b),g.setAttribute("colspan",d),g.removeAttribute("fixed"),$(g).height($(m).height()),p.append(g)}}for(var u=0;u<n;u++){const d=f(this,sr).body.querySelectorAll(`[data-row="${t}"][data-col="${e}"]:not(.dummy):not(.first):not(.last)`)[u];if(d){const b=d.getAttribute("rowspan")||1,g=d.getAttribute("colspan")||1;if($("ng-row-indicator,ng-row-state,ng-row-pin,ng-row-detail",d).length>0){p=null;break}const S=d.cloneNode(!0);S.setAttribute("data-row",0),S.setAttribute("rowspan",g),S.setAttribute("colspan",b),S.removeAttribute("fixed"),p.append(S);for(const C of d.children){const I=C.getAttribute("data-source");I&&(f(this,cr)[I]=f(this,sr)[I])}}}p&&p.html()&&$("tbody.bindable tr.nodata",f(this,cr).shadowRoot).before(p)}$("ng-row-indicator",f(this,cr)).closest("tr").remove();var a=0;$("tbody.bindable tr:not(.nodata)",f(this,cr).shadowRoot).each((h,p)=>{$("th,td",p).each((m,d)=>{d.dataset.col=a,a+=d.colSpan||1})}),f(this,cr).shadowRoot.querySelector(".ng-body").style.height="100vh",f(this,cr).createTemplate(),this.shadowRoot.querySelector("dialog").showModal(),setTimeout(()=>{f(this,cr).data.source=[Object.assign({},f(this,sr).data.getNF(f(this,pi)))]})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,sr,this.getRootNode().host);const t=f(this,sr).getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
587
587
  <style>
588
588
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
589
589
  nine-grid {
@@ -602,17 +602,17 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
602
602
  </nine-grid>
603
603
  </nx-dialog>
604
604
  `,tt(this,cr,this.shadowRoot.querySelector("nine-grid")),f(this,cr).fields.add(f(this,sr).fields.get()),$(".reset",this.shadowRoot).on("click",l=>{f(this,cr).data.set(f(this,sr).data.getNF(f(this,pi)))}),$(".apply",this.shadowRoot).on("click",l=>{f(this,sr).data.all.update(f(this,cr).data.get(0),f(this,pi)),this.shadowRoot.querySelector("dialog").close()}),$(".close",this.shadowRoot).onFirst("click",l=>{f(this,cr).data.isChanged()&&(l.stopImmediatePropagation(),H.confirm(`There is changed data.
605
- Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"}).then(c=>{c&&$(".apply",this.shadowRoot).trigger("click"),this.shadowRoot.querySelector("nx-dialog").close()}))})}}sr=new WeakMap,cr=new WeakMap,pi=new WeakMap,customElements.get("ng-row-detail")||customElements.define("ng-row-detail",Ud),customElements.get("ng-row-detail-popup")||customElements.define("ng-row-detail-popup",Vd);const xn=class xn extends _r{constructor(){super();it(this,"dataRefresh",t=>{t||this.reset()});Y(this,qh,t=>{const l=parseInt(this.cell.dataset.row),c=this.owner.body.querySelector(`.ng-container-body tr[data-row="${l}"]`);t.dataTransfer.setDragImage(c,0,0),t.dataTransfer.effectAllowed="copyMove",xn.dragData={tr:this.cell.closest("tr"),id:this.owner.id,row:l,bind:this.cell.dataset.bind}});xn.scrollInterval=this.getAttribute("scroll-interval")||300}connectedCallback(){this.shadowRoot.innerHTML=`
605
+ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"}).then(c=>{c&&$(".apply",this.shadowRoot).trigger("click"),this.shadowRoot.querySelector("nx-dialog").close()}))})}}sr=new WeakMap,cr=new WeakMap,pi=new WeakMap,customElements.get("ng-row-detail")||customElements.define("ng-row-detail",zd),customElements.get("ng-row-detail-popup")||customElements.define("ng-row-detail-popup",Ud);const xn=class xn extends _r{constructor(){super();it(this,"dataRefresh",t=>{t||this.reset()});Y(this,qh,t=>{const l=parseInt(this.cell.dataset.row),c=this.owner.body.querySelector(`.ng-container-body tr[data-row="${l}"]`);t.dataTransfer.setDragImage(c,0,0),t.dataTransfer.effectAllowed="copyMove",xn.dragData={tr:this.cell.closest("tr"),id:this.owner.id,row:l,bind:this.cell.dataset.bind}});xn.scrollInterval=this.getAttribute("scroll-interval")||300}connectedCallback(){this.shadowRoot.innerHTML=`
606
606
  <style>
607
607
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowDrag.css";
608
608
  ${H.getCustomPath(this,"ngRowDrag.css")}
609
609
  </style>
610
- `,super.connectedCallback(),this.cell.setAttribute("draggable","true"),this.cell.addEventListener("dragstart",f(this,qh))}};qh=new WeakMap,it(xn,"dragData"),it(xn,"scrollInterval");let ar=xn;class Wd{constructor(E){Y(this,He);it(this,"resetEvent",()=>{$(".ng-table tbody.bindable",f(this,He).body).off("dragleave",f(this,da)).off("dragenter",f(this,ua)).off("dragover",f(this,ca)).off("drop",f(this,pa)).off("dragend",f(this,fa)).on("dragleave",f(this,da)).on("dragenter",f(this,ua)).on("dragover",f(this,ca)).on("drop",f(this,pa)).on("dragend",f(this,fa))});Y(this,la,E=>{[".ng-container-left",".ng-container-body",".ng-container-right"].forEach(t=>{const l=f(this,He).body.querySelectorAll(`${t} tr[data-row="${E}"]`);H.j.querySelectorAll("th,td",l[0]).addClass("ng-dragover-up")})});Y(this,ha,E=>{[".ng-container-left",".ng-container-body",".ng-container-right"].forEach(t=>{f(this,He).body.querySelectorAll(`${t} tr[data-row="${E}"]`).forEach((l,c)=>{l.querySelectorAll("th,td").forEach(o=>{c+(o.rowSpan||1)==f(this,He).template.length&&H.j.querySelectorAll(o).addClass("ng-dragover-down")})})})});Y(this,ca,E=>{E.preventDefault();const t=ar.dragData.tr.getRootNode().host,l=E.currentTarget.getRootNode().host,c=parseInt(ar.dragData.tr.dataset.row),o=parseInt(E.target.closest("th,td").dataset.row);if(H.j.querySelectorAll("th,td",t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),H.j.querySelectorAll("th,td",l.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),t.id==l.id)o<c?(f(this,la).call(this,o),ar.dragData.targetRow=o):o>c&&(f(this,ha).call(this,o),ar.dragData.targetRow=o-1);else{const r=f(this,He).body.querySelector(`tr[data-row="${o}"]`),s=E.pageY-$(r).offset().top<f(this,He).view.getRowHeight(o)/2;s?f(this,la).call(this,o):f(this,ha).call(this,o),ar.dragData.targetRow=s?o:o+1}});Y(this,ms);Y(this,ua,E=>{E.preventDefault();const t=parseInt(E.target.closest("tr").dataset.row);[f(this,He).view.getVisibleFirstRow(),f(this,He).view.getVisibleLastRow()].includes(t)&&setTimeout(()=>{if(!f(this,ms)){const l=t==f(this,He).view.getVisibleLastRow()?1:-1;tt(this,ms,setInterval(()=>{f(this,He).scrollBy(l)},ar.scrollInterval))}})});Y(this,da,E=>{E.preventDefault(),clearInterval(f(this,ms)),tt(this,ms,null)});Y(this,fa,E=>{});Y(this,pa,E=>{E.preventDefault(),clearInterval(f(this,ms)),tt(this,ms,null),f(this,He).body.querySelectorAll(".ng-container-left .ng-tmp").forEach(a=>{$(a).remove()});const t=H.nvl(document.getElementById(ar.dragData.id),f(this,He)),l=ar.dragData.row,c=ar.dragData.bind,o=E.target.closest("tr"),r=E.target.getRootNode().host,n=parseInt(o.dataset.row),s=r.body.querySelector("ng-row-drag")?r.body.querySelector("ng-row-drag").cell.dataset.bind:null;if(H.j.querySelectorAll("th,td",t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),H.j.querySelectorAll("th,td",r.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),t.id==r.id&&l==n)return;const e=new CustomEvent(H.EVENT.CAN_ROW_MOVE,{bubbles:!0,cancelable:!0,detail:{}});if(e.sourceGrid=t,e.targetGrid=r,e.sourceRow=l,e.targetRow=ar.dragData.targetRow,f(this,He).dispatchEvent(e)&&(t.id==r.id?E.altKey?f(this,He).data.insert(f(this,He).data.get(l),n):f(this,He).data.moveRow(l,n):(r.data.insert(t.data.get(l),ar.dragData.targetRow),E.altKey||t.data.delete(l))),c){const a=t.fields.indexOf(c);for(var i=0;i<t.data.all.count();i++)t.data.all.setRecord(i,a,i+1)}if(s&&t.id!=r.id){const a=r.fields.indexOf(s);for(var i=0;i<r.data.all.count();i++)r.data.all.setRecord(i,a,i+1)}f(this,He).dataManager.viewRecords.reset();const u=new CustomEvent(H.EVENT.ROW_MOVED,{bubbles:!0,detail:{}});u.sourceGrid=t,u.targetGrid=r,u.sourceRow=l,u.targetRow=ar.dragData.targetRow,f(this,He).dispatchEvent(u),ar.dragData=null});tt(this,He,E),this.resetEvent()}}He=new WeakMap,la=new WeakMap,ha=new WeakMap,ca=new WeakMap,ms=new WeakMap,ua=new WeakMap,da=new WeakMap,fa=new WeakMap,pa=new WeakMap,customElements.get("ng-row-drag")||customElements.define("ng-row-drag",ar);class Xd extends HTMLElement{constructor(){super();Y(this,or);Y(this,gr);Y(this,mi);Y(this,Hh,()=>{const l=`data.${H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-bind")}.replaceAll("\\n", "<br>")`;H.j.querySelectorAll(this).addClass("expand"),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr",l),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).attr("data-expr",l),f(this,ma).call(this)});Y(this,zh,()=>{H.j.querySelectorAll(this).removeClass("expand"),f(this,mi)?(H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr",f(this,mi)),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).attr("data-expr",f(this,mi))):(H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).removeAttr("data-expr"),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).removeAttr("data-expr")),f(this,ma).call(this)});Y(this,ma,()=>{var t=[];f(this,or).body.querySelectorAll("thead ng-row-expand.expand").forEach(o=>{const r=o.closest("th,td").dataset.col;t.push(`th[data-col="${r}"],td[data-col="${r}"]`)});for(var l=[],c=0;c<f(this,or).template.length;c++)l.push($(t.join(","),f(this,or).template.eq(c)));f(this,or).setRowHeightFitAll(l)});this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
610
+ `,super.connectedCallback(),this.cell.setAttribute("draggable","true"),this.cell.addEventListener("dragstart",f(this,qh))}};qh=new WeakMap,it(xn,"dragData"),it(xn,"scrollInterval");let ar=xn;class Vd{constructor(E){Y(this,He);it(this,"resetEvent",()=>{$(".ng-table tbody.bindable",f(this,He).body).off("dragleave",f(this,da)).off("dragenter",f(this,ua)).off("dragover",f(this,ca)).off("drop",f(this,pa)).off("dragend",f(this,fa)).on("dragleave",f(this,da)).on("dragenter",f(this,ua)).on("dragover",f(this,ca)).on("drop",f(this,pa)).on("dragend",f(this,fa))});Y(this,la,E=>{[".ng-container-left",".ng-container-body",".ng-container-right"].forEach(t=>{const l=f(this,He).body.querySelectorAll(`${t} tr[data-row="${E}"]`);H.j.querySelectorAll("th,td",l[0]).addClass("ng-dragover-up")})});Y(this,ha,E=>{[".ng-container-left",".ng-container-body",".ng-container-right"].forEach(t=>{f(this,He).body.querySelectorAll(`${t} tr[data-row="${E}"]`).forEach((l,c)=>{l.querySelectorAll("th,td").forEach(o=>{c+(o.rowSpan||1)==f(this,He).template.length&&H.j.querySelectorAll(o).addClass("ng-dragover-down")})})})});Y(this,ca,E=>{E.preventDefault();const t=ar.dragData.tr.getRootNode().host,l=E.currentTarget.getRootNode().host,c=parseInt(ar.dragData.tr.dataset.row),o=parseInt(E.target.closest("th,td").dataset.row);if(H.j.querySelectorAll("th,td",t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),H.j.querySelectorAll("th,td",l.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),t.id==l.id)o<c?(f(this,la).call(this,o),ar.dragData.targetRow=o):o>c&&(f(this,ha).call(this,o),ar.dragData.targetRow=o-1);else{const r=f(this,He).body.querySelector(`tr[data-row="${o}"]`),s=E.pageY-$(r).offset().top<f(this,He).view.getRowHeight(o)/2;s?f(this,la).call(this,o):f(this,ha).call(this,o),ar.dragData.targetRow=s?o:o+1}});Y(this,ms);Y(this,ua,E=>{E.preventDefault();const t=parseInt(E.target.closest("tr").dataset.row);[f(this,He).view.getVisibleFirstRow(),f(this,He).view.getVisibleLastRow()].includes(t)&&setTimeout(()=>{if(!f(this,ms)){const l=t==f(this,He).view.getVisibleLastRow()?1:-1;tt(this,ms,setInterval(()=>{f(this,He).scrollBy(l)},ar.scrollInterval))}})});Y(this,da,E=>{E.preventDefault(),clearInterval(f(this,ms)),tt(this,ms,null)});Y(this,fa,E=>{});Y(this,pa,E=>{E.preventDefault(),clearInterval(f(this,ms)),tt(this,ms,null),f(this,He).body.querySelectorAll(".ng-container-left .ng-tmp").forEach(a=>{$(a).remove()});const t=H.nvl(document.getElementById(ar.dragData.id),f(this,He)),l=ar.dragData.row,c=ar.dragData.bind,o=E.target.closest("tr"),r=E.target.getRootNode().host,n=parseInt(o.dataset.row),s=r.body.querySelector("ng-row-drag")?r.body.querySelector("ng-row-drag").cell.dataset.bind:null;if(H.j.querySelectorAll("th,td",t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),H.j.querySelectorAll("th,td",r.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"),t.id==r.id&&l==n)return;const e=new CustomEvent(H.EVENT.CAN_ROW_MOVE,{bubbles:!0,cancelable:!0,detail:{}});if(e.sourceGrid=t,e.targetGrid=r,e.sourceRow=l,e.targetRow=ar.dragData.targetRow,f(this,He).dispatchEvent(e)&&(t.id==r.id?E.altKey?f(this,He).data.insert(f(this,He).data.get(l),n):f(this,He).data.moveRow(l,n):(r.data.insert(t.data.get(l),ar.dragData.targetRow),E.altKey||t.data.delete(l))),c){const a=t.fields.indexOf(c);for(var i=0;i<t.data.all.count();i++)t.data.all.setRecord(i,a,i+1)}if(s&&t.id!=r.id){const a=r.fields.indexOf(s);for(var i=0;i<r.data.all.count();i++)r.data.all.setRecord(i,a,i+1)}f(this,He).dataManager.viewRecords.reset();const u=new CustomEvent(H.EVENT.ROW_MOVED,{bubbles:!0,detail:{}});u.sourceGrid=t,u.targetGrid=r,u.sourceRow=l,u.targetRow=ar.dragData.targetRow,f(this,He).dispatchEvent(u),ar.dragData=null});tt(this,He,E),this.resetEvent()}}He=new WeakMap,la=new WeakMap,ha=new WeakMap,ca=new WeakMap,ms=new WeakMap,ua=new WeakMap,da=new WeakMap,fa=new WeakMap,pa=new WeakMap,customElements.get("ng-row-drag")||customElements.define("ng-row-drag",ar);class Wd extends HTMLElement{constructor(){super();Y(this,or);Y(this,gr);Y(this,mi);Y(this,Hh,()=>{const l=`data.${H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-bind")}.replaceAll("\\n", "<br>")`;H.j.querySelectorAll(this).addClass("expand"),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr",l),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).attr("data-expr",l),f(this,ma).call(this)});Y(this,zh,()=>{H.j.querySelectorAll(this).removeClass("expand"),f(this,mi)?(H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr",f(this,mi)),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).attr("data-expr",f(this,mi))):(H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).removeAttr("data-expr"),H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).body).removeAttr("data-expr")),f(this,ma).call(this)});Y(this,ma,()=>{var t=[];f(this,or).body.querySelectorAll("thead ng-row-expand.expand").forEach(o=>{const r=o.closest("th,td").dataset.col;t.push(`th[data-col="${r}"],td[data-col="${r}"]`)});for(var l=[],c=0;c<f(this,or).template.length;c++)l.push($(t.join(","),f(this,or).template.eq(c)));f(this,or).setRowHeightFitAll(l)});this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
611
611
  <style>
612
612
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowExpand.css";
613
613
  ${H.getCustomPath(this,"ngRowExpand.css")}
614
614
  </style>
615
- `,tt(this,or,this.getRootNode().host),tt(this,gr,this.closest("th,td")),!(!f(this,or)||!f(this,gr))&&(tt(this,mi,H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr")),f(this,gr).querySelector("ng-col-expand")&&H.j.querySelectorAll(this).addClass("padding"),$(this).on("click",t=>{t.preventDefault(),t.stopPropagation(),H.j.querySelectorAll(this).hasClass("expand")?f(this,zh).call(this):f(this,Hh).call(this)}),$(this).on("click",t=>{t.stopPropagation()}))}}or=new WeakMap,gr=new WeakMap,mi=new WeakMap,Hh=new WeakMap,zh=new WeakMap,ma=new WeakMap,customElements.get("ng-combo")||customElements.define("ng-combo",Xd);class Yd extends _r{constructor(){super();Y(this,ga);it(this,"refresh",()=>{var t=this.closest("tr").sectionRowIndex,l=-3;$(".row-resizer",this.shadowRoot).each((c,o)=>{var r=$("tr",this.closest("tbody")).not(".nodata").eq(t+c);l+=r.length>0?r.height():$(this.owner.template).eq(c).height(),$(o).offset({top:$(this).offset().top+l})})});it(this,"dataRefresh",t=>{if(!(!this.owner||!this.cell||!this.data)){var l=parseInt(this.cell.dataset.row);switch(this.data.__ng.rowState){case H.ROW_STATE.INSERT:H.j.querySelectorAll(this).addClass("added").removeClass("updated");break;case H.ROW_STATE.UPDATE:H.j.querySelectorAll(this).addClass("updated");break;default:H.j.querySelectorAll(this).removeClass("added").removeClass("updated");break}f(this,ga).innerHTML=this.getDisplayText(l+1),t||this.reset()}});Y(this,Uh,()=>{if(!H.j.querySelectorAll(this.closest("tbody")).hasClass("fixed"))for(var t=this.cell.rowSpan,l=this.closest("tr"),c=0;c<t;c++){var o=$(`<ng-row-resizer rowIndex=${l.sectionRowIndex+c}></ng-row-resizer>`);o[0].cell=this.cell,$(".wrap",this.shadowRoot).append(o)}this.owner&&this.owner.getAttribute("row-resizable")!="true"&&$(".row-resizer",this.shadowRoot).hide()})}connectedCallback(){this.shadowRoot.innerHTML=`
615
+ `,tt(this,or,this.getRootNode().host),tt(this,gr,this.closest("th,td")),!(!f(this,or)||!f(this,gr))&&(tt(this,mi,H.j.querySelectorAll(`[data-col="${f(this,gr).dataset.col}"]`,f(this,or).tmpl).attr("data-expr")),f(this,gr).querySelector("ng-col-expand")&&H.j.querySelectorAll(this).addClass("padding"),$(this).on("click",t=>{t.preventDefault(),t.stopPropagation(),H.j.querySelectorAll(this).hasClass("expand")?f(this,zh).call(this):f(this,Hh).call(this)}),$(this).on("click",t=>{t.stopPropagation()}))}}or=new WeakMap,gr=new WeakMap,mi=new WeakMap,Hh=new WeakMap,zh=new WeakMap,ma=new WeakMap,customElements.get("ng-combo")||customElements.define("ng-combo",Wd);class Xd extends _r{constructor(){super();Y(this,ga);it(this,"refresh",()=>{var t=this.closest("tr").sectionRowIndex,l=-3;$(".row-resizer",this.shadowRoot).each((c,o)=>{var r=$("tr",this.closest("tbody")).not(".nodata").eq(t+c);l+=r.length>0?r.height():$(this.owner.template).eq(c).height(),$(o).offset({top:$(this).offset().top+l})})});it(this,"dataRefresh",t=>{if(!(!this.owner||!this.cell||!this.data)){var l=parseInt(this.cell.dataset.row);switch(this.data.__ng.rowState){case H.ROW_STATE.INSERT:H.j.querySelectorAll(this).addClass("added").removeClass("updated");break;case H.ROW_STATE.UPDATE:H.j.querySelectorAll(this).addClass("updated");break;default:H.j.querySelectorAll(this).removeClass("added").removeClass("updated");break}f(this,ga).innerHTML=this.getDisplayText(l+1),t||this.reset()}});Y(this,Uh,()=>{if(!H.j.querySelectorAll(this.closest("tbody")).hasClass("fixed"))for(var t=this.cell.rowSpan,l=this.closest("tr"),c=0;c<t;c++){var o=$(`<ng-row-resizer rowIndex=${l.sectionRowIndex+c}></ng-row-resizer>`);o[0].cell=this.cell,$(".wrap",this.shadowRoot).append(o)}this.owner&&this.owner.getAttribute("row-resizable")!="true"&&$(".row-resizer",this.shadowRoot).hide()})}connectedCallback(){this.shadowRoot.innerHTML=`
616
616
  <style>
617
617
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowIndicator.css";
618
618
  ${H.getCustomPath(this,"ngRowIndicator.css")}
@@ -638,7 +638,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
638
638
  </svg>
639
639
  </div>
640
640
  </div>
641
- `,super.connectedCallback(),this.cell.removeAttribute("tabindex"),this.cell.dataset.bind="rowState",this.cell.dataset.expr=H.nvl(this.cell.dataset.expr,"data.__ng._[ninegrid.ROW.ORDER]"),this.cell.setAttribute("text-align","center"),tt(this,ga,this.shadowRoot.querySelector("span")),f(this,Uh).call(this)}}ga=new WeakMap,Uh=new WeakMap;class Gd extends HTMLElement{constructor(){super();Y(this,fr);Y(this,ss);Y(this,ba);Y(this,br);Y(this,qs);Y(this,gi);Y(this,fu);Y(this,is);Y(this,Vh);Y(this,Wh,()=>{if(f(this,fr)){var t=f(this,fr).querySelector("div.resizer-row-panel");t?tt(this,br,$(t)):(tt(this,br,$('<div class="resizer-row-panel"><div class="grip"></div><div class="tooltip"><div></div><span></span><div></div></div></div>').hide()),$(f(this,fr).body).append(f(this,br))),tt(this,qs,$(".grip",f(this,br))),tt(this,gi,$(".tooltip",f(this,br))),$(this).on("mousedown",l=>{H.j.querySelectorAll(f(this,ss).closest("tbody")).hasClass("fixed")||tt(this,ba,setTimeout(()=>{f(this,Xh).call(this,l)},500))}).on("dblclick",l=>{H.j.querySelectorAll(f(this,ss).closest("tbody")).hasClass("fixed")||f(this,Yh).call(this,l)}),$(document).on("mouseup",l=>{clearTimeout(f(this,ba))})}});Y(this,Xh,t=>{if(!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=parseInt(t.target.getAttribute("rowIndex"));l<0||(f(this,ss).busy=!0,tt(this,Vh,t.target),tt(this,is,$(".ng-container-body table tbody.bindable tr",f(this,fr).body).eq(l)),f(this,br).show(),f(this,qs).width(f(this,fr).body.querySelector(".ng-container").offsetWidth),f(this,wa).call(this,t.pageY),$(f(this,br)).on("mousemove",f(this,ya)),$(f(this,br)).on("mouseup",f(this,va)))}});Y(this,ya,t=>{t.altKey||t.ctrlKey||t.shiftKey||f(this,wa).call(this,t.pageY)});Y(this,va,t=>{var l=f(this,qs).offset().top-f(this,is).offset().top;l<=1&&(l=0),l=f(this,fr).tableUtils.height(f(this,is)[0].sectionRowIndex,l);var c=parseInt(f(this,is)[0].dataset.row*f(this,fr).template.length+f(this,is)[0].sectionRowIndex%f(this,fr).template.length);f(this,fr).matrix.setHeight(c,l),f(this,ss).querySelector("ng-row-indicator").refresh(),$(f(this,br)).off("mousemove",f(this,ya)),$(f(this,br)).off("mouseup",f(this,va)),f(this,br).hide(),f(this,fr).view.redraw(),f(this,ss).busy=!1});Y(this,wa,t=>{var l=$(".ng-container-body table tbody.bindable",f(this,fr).body);if(!(t<l.offset().top)){f(this,qs).offset({top:t});var c=parseInt(f(this,qs).offset().top),o=parseInt(c-f(this,is).offset().top);o<=1&&(o=0),f(this,gi).height(o),f(this,gi).offset({top:f(this,is).offset().top-1}),f(this,gi).find("span").text(o)}});Y(this,Yh,t=>{})}connectedCallback(){tt(this,ss,this.cell),tt(this,fr,f(this,ss).getRootNode().host),this.setAttribute("class","row-resizer"),f(this,Wh).call(this)}}fr=new WeakMap,ss=new WeakMap,ba=new WeakMap,br=new WeakMap,qs=new WeakMap,gi=new WeakMap,fu=new WeakMap,is=new WeakMap,Vh=new WeakMap,Wh=new WeakMap,Xh=new WeakMap,ya=new WeakMap,va=new WeakMap,wa=new WeakMap,Yh=new WeakMap,customElements.get("ng-row-indicator")||customElements.define("ng-row-indicator",Yd),customElements.get("ng-row-resizer")||customElements.define("ng-row-resizer",Gd);class Kd extends _r{constructor(){super();it(this,"dataRefresh",t=>{!this.owner||!this.cell||!this.data||(this.cell.closest("tbody.fixed")?H.j.querySelectorAll(this).addClass("pin"):H.j.querySelectorAll(this).removeClass("pin"),t||this.reset())});Y(this,Gh,()=>{H.isMobile()||this.shadowRoot.querySelector("svg").addEventListener("click",t=>{const l=this.cell.closest("tr").dataset.row;this.cell.closest("tbody.fixed")?this.owner.pin.remove(l):this.owner.pin.add(this.data.__ng._[H.ROW.INDEX])})})}connectedCallback(){this.shadowRoot.innerHTML=`
641
+ `,super.connectedCallback(),this.cell.removeAttribute("tabindex"),this.cell.dataset.bind="rowState",this.cell.dataset.expr=H.nvl(this.cell.dataset.expr,"data.__ng._[ninegrid.ROW.ORDER]"),this.cell.setAttribute("text-align","center"),tt(this,ga,this.shadowRoot.querySelector("span")),f(this,Uh).call(this)}}ga=new WeakMap,Uh=new WeakMap;class Yd extends HTMLElement{constructor(){super();Y(this,fr);Y(this,ss);Y(this,ba);Y(this,br);Y(this,qs);Y(this,gi);Y(this,fu);Y(this,is);Y(this,Vh);Y(this,Wh,()=>{if(f(this,fr)){var t=f(this,fr).querySelector("div.resizer-row-panel");t?tt(this,br,$(t)):(tt(this,br,$('<div class="resizer-row-panel"><div class="grip"></div><div class="tooltip"><div></div><span></span><div></div></div></div>').hide()),$(f(this,fr).body).append(f(this,br))),tt(this,qs,$(".grip",f(this,br))),tt(this,gi,$(".tooltip",f(this,br))),$(this).on("mousedown",l=>{H.j.querySelectorAll(f(this,ss).closest("tbody")).hasClass("fixed")||tt(this,ba,setTimeout(()=>{f(this,Xh).call(this,l)},500))}).on("dblclick",l=>{H.j.querySelectorAll(f(this,ss).closest("tbody")).hasClass("fixed")||f(this,Yh).call(this,l)}),$(document).on("mouseup",l=>{clearTimeout(f(this,ba))})}});Y(this,Xh,t=>{if(!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=parseInt(t.target.getAttribute("rowIndex"));l<0||(f(this,ss).busy=!0,tt(this,Vh,t.target),tt(this,is,$(".ng-container-body table tbody.bindable tr",f(this,fr).body).eq(l)),f(this,br).show(),f(this,qs).width(f(this,fr).body.querySelector(".ng-container").offsetWidth),f(this,wa).call(this,t.pageY),$(f(this,br)).on("mousemove",f(this,ya)),$(f(this,br)).on("mouseup",f(this,va)))}});Y(this,ya,t=>{t.altKey||t.ctrlKey||t.shiftKey||f(this,wa).call(this,t.pageY)});Y(this,va,t=>{var l=f(this,qs).offset().top-f(this,is).offset().top;l<=1&&(l=0),l=f(this,fr).tableUtils.height(f(this,is)[0].sectionRowIndex,l);var c=parseInt(f(this,is)[0].dataset.row*f(this,fr).template.length+f(this,is)[0].sectionRowIndex%f(this,fr).template.length);f(this,fr).matrix.setHeight(c,l),f(this,ss).querySelector("ng-row-indicator").refresh(),$(f(this,br)).off("mousemove",f(this,ya)),$(f(this,br)).off("mouseup",f(this,va)),f(this,br).hide(),f(this,fr).view.redraw(),f(this,ss).busy=!1});Y(this,wa,t=>{var l=$(".ng-container-body table tbody.bindable",f(this,fr).body);if(!(t<l.offset().top)){f(this,qs).offset({top:t});var c=parseInt(f(this,qs).offset().top),o=parseInt(c-f(this,is).offset().top);o<=1&&(o=0),f(this,gi).height(o),f(this,gi).offset({top:f(this,is).offset().top-1}),f(this,gi).find("span").text(o)}});Y(this,Yh,t=>{})}connectedCallback(){tt(this,ss,this.cell),tt(this,fr,f(this,ss).getRootNode().host),this.setAttribute("class","row-resizer"),f(this,Wh).call(this)}}fr=new WeakMap,ss=new WeakMap,ba=new WeakMap,br=new WeakMap,qs=new WeakMap,gi=new WeakMap,fu=new WeakMap,is=new WeakMap,Vh=new WeakMap,Wh=new WeakMap,Xh=new WeakMap,ya=new WeakMap,va=new WeakMap,wa=new WeakMap,Yh=new WeakMap,customElements.get("ng-row-indicator")||customElements.define("ng-row-indicator",Xd),customElements.get("ng-row-resizer")||customElements.define("ng-row-resizer",Yd);class Gd extends _r{constructor(){super();it(this,"dataRefresh",t=>{!this.owner||!this.cell||!this.data||(this.cell.closest("tbody.fixed")?H.j.querySelectorAll(this).addClass("pin"):H.j.querySelectorAll(this).removeClass("pin"),t||this.reset())});Y(this,Gh,()=>{H.isMobile()||this.shadowRoot.querySelector("svg").addEventListener("click",t=>{const l=this.cell.closest("tr").dataset.row;this.cell.closest("tbody.fixed")?this.owner.pin.remove(l):this.owner.pin.add(this.data.__ng._[H.ROW.INDEX])})})}connectedCallback(){this.shadowRoot.innerHTML=`
642
642
  <style>
643
643
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowPin.css";
644
644
  ${H.getCustomPath(this,"ngRowPin.css")}
@@ -647,12 +647,12 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
647
647
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false" aria-hidden="true">
648
648
  <path d="M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146"/>
649
649
  </svg>
650
- `,super.connectedCallback(),f(this,Gh).call(this)}}Gh=new WeakMap;class Zd{constructor(E){Y(this,Le);Y(this,pr);it(this,"initialize",()=>{f(this,pr).forEach(E=>{E.__ng._[H.ROW.PIN]=!1}),tt(this,pr,[]),f(this,Le).data.resetRecords()});it(this,"add",E=>{var t=f(this,Le).data.getNF(E);t.__ng._[H.ROW.PIN]=!0,f(this,pr).push(t);var l=f(this,Le).template.clone(),c=f(this,Le).template.clone(),o=f(this,Le).template.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove(),l.each((r,n)=>{$(".ng-container-left tbody.fixed",f(this,Le).body).append(n.outerHTML)}),c.each((r,n)=>{$(".ng-container-right tbody.fixed",f(this,Le).body).append(n.outerHTML)}),o.each((r,n)=>{$(".ng-container-body tbody.fixed",f(this,Le).body).append(n.outerHTML)}),$("tbody.fixed tr:not([data-index])",f(this,Le).body).each((r,n)=>{n.dataset.index=t.__ng._[H.ROW.INDEX],n.data=t}),$("tbody.fixed tr",f(this,Le).body).each((r,n)=>{n.dataset.row=(f(this,pr).length-parseInt(n.sectionRowIndex/f(this,Le).template.length))*-1}),$("tbody.fixed tr",f(this,Le).body).each((r,n)=>{n.dataset.matrixRow=parseInt(n.dataset.row)*f(this,Le).template.length+parseInt(n.sectionRowIndex%f(this,Le).template.length),H.j.querySelectorAll("th,td",n).attr("data-index",n.dataset.index),H.j.querySelectorAll("th,td",n).attr("data-row",n.dataset.row),H.j.querySelectorAll("th,td",n).attr("data-matrix-row",n.dataset.matrixRow)}),f(this,Le).data.resetRecords(),f(this,Le).dataManager.viewRecords.reset()});it(this,"remove",E=>{var t=f(this,Le).body.querySelector(`.ng-container-body tbody.fixed tr[data-row="${E}"]`).data,l=f(this,pr).findIndex(c=>c.__ng.rowid==t.__ng.rowid);l>=0&&($(`.ng-container-left tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),$(`.ng-container-right tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),$(`.ng-container-body tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),f(this,pr)[l].__ng._[H.ROW.PIN]=!1,f(this,pr).splice(l,1)),f(this,Le).data.resetRecords(),f(this,Le).dataManager.viewRecords.reset()});it(this,"get",E=>E==null?f(this,pr):f(this,pr)[E]);it(this,"includes",E=>{if(!isNaN(E))return f(this,pr).findIndex(t=>t.__ng.i==E)>=0});it(this,"count",()=>f(this,pr).length);tt(this,Le,E),tt(this,pr,[])}}Le=new WeakMap,pr=new WeakMap,customElements.get("ng-row-pin")||customElements.define("ng-row-pin",Kd);class Jd extends _r{constructor(){super();it(this,"dataRefresh",t=>{switch(this.data.__ng.rowState){case H.ROW_STATE.INSERT:H.j.querySelectorAll(this).addClass("added").removeClass("updated");break;case H.ROW_STATE.UPDATE:H.j.querySelectorAll(this).addClass("updated");break;default:H.j.querySelectorAll(this).removeClass("added").removeClass("updated");break}t||this.reset()})}connectedCallback(){this.shadowRoot.innerHTML=`
650
+ `,super.connectedCallback(),f(this,Gh).call(this)}}Gh=new WeakMap;class Kd{constructor(E){Y(this,Le);Y(this,pr);it(this,"initialize",()=>{f(this,pr).forEach(E=>{E.__ng._[H.ROW.PIN]=!1}),tt(this,pr,[]),f(this,Le).data.resetRecords()});it(this,"add",E=>{var t=f(this,Le).data.getNF(E);t.__ng._[H.ROW.PIN]=!0,f(this,pr).push(t);var l=f(this,Le).template.clone(),c=f(this,Le).template.clone(),o=f(this,Le).template.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove(),l.each((r,n)=>{$(".ng-container-left tbody.fixed",f(this,Le).body).append(n.outerHTML)}),c.each((r,n)=>{$(".ng-container-right tbody.fixed",f(this,Le).body).append(n.outerHTML)}),o.each((r,n)=>{$(".ng-container-body tbody.fixed",f(this,Le).body).append(n.outerHTML)}),$("tbody.fixed tr:not([data-index])",f(this,Le).body).each((r,n)=>{n.dataset.index=t.__ng._[H.ROW.INDEX],n.data=t}),$("tbody.fixed tr",f(this,Le).body).each((r,n)=>{n.dataset.row=(f(this,pr).length-parseInt(n.sectionRowIndex/f(this,Le).template.length))*-1}),$("tbody.fixed tr",f(this,Le).body).each((r,n)=>{n.dataset.matrixRow=parseInt(n.dataset.row)*f(this,Le).template.length+parseInt(n.sectionRowIndex%f(this,Le).template.length),H.j.querySelectorAll("th,td",n).attr("data-index",n.dataset.index),H.j.querySelectorAll("th,td",n).attr("data-row",n.dataset.row),H.j.querySelectorAll("th,td",n).attr("data-matrix-row",n.dataset.matrixRow)}),f(this,Le).data.resetRecords(),f(this,Le).dataManager.viewRecords.reset()});it(this,"remove",E=>{var t=f(this,Le).body.querySelector(`.ng-container-body tbody.fixed tr[data-row="${E}"]`).data,l=f(this,pr).findIndex(c=>c.__ng.rowid==t.__ng.rowid);l>=0&&($(`.ng-container-left tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),$(`.ng-container-right tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),$(`.ng-container-body tbody.fixed tr[data-row=${E}]`,f(this,Le).body).remove(),f(this,pr)[l].__ng._[H.ROW.PIN]=!1,f(this,pr).splice(l,1)),f(this,Le).data.resetRecords(),f(this,Le).dataManager.viewRecords.reset()});it(this,"get",E=>E==null?f(this,pr):f(this,pr)[E]);it(this,"includes",E=>{if(!isNaN(E))return f(this,pr).findIndex(t=>t.__ng.i==E)>=0});it(this,"count",()=>f(this,pr).length);tt(this,Le,E),tt(this,pr,[])}}Le=new WeakMap,pr=new WeakMap,customElements.get("ng-row-pin")||customElements.define("ng-row-pin",Gd);class Zd extends _r{constructor(){super();it(this,"dataRefresh",t=>{switch(this.data.__ng.rowState){case H.ROW_STATE.INSERT:H.j.querySelectorAll(this).addClass("added").removeClass("updated");break;case H.ROW_STATE.UPDATE:H.j.querySelectorAll(this).addClass("updated");break;default:H.j.querySelectorAll(this).removeClass("added").removeClass("updated");break}t||this.reset()})}connectedCallback(){this.shadowRoot.innerHTML=`
651
651
  <style>
652
652
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngRowState.css";
653
653
  ${H.getCustomPath(this,"ngRowState.css")}
654
654
  </style>
655
- `,super.connectedCallback(),this.cell.dataset.bind="rowState"}}customElements.get("ng-row-state")||customElements.define("ng-row-state",Jd);class Qd extends HTMLElement{constructor(){super();Y(this,kn);Y(this,Dt);Y(this,Wr);Y(this,ge);Y(this,yr);Y(this,vr);Y(this,_n);it(this,"refresh",()=>{if(!f(this,Dt))return;var t=$(".ng-container-body",f(this,Dt).body),l=$(".ng-scroll-thumb",this.shadowRoot),c=$("table > thead",t),o=f(this,Dt).dataManager.viewRecords.rawIndex,r=$(f(this,ge).track).height(),n=$(f(this,ge).thumb).height();Number(f(this,Dt).getAttribute("display-row-count")||0)>=f(this,Dt).dataManager.rawRecords.length||parseInt($(".ng-container .ng-table tr.nodata",f(this,Dt).body).height())>0&&(f(this,Dt).dataManager.rawRecords.length==0||f(this,Dt).dataManager.viewRecords.rawIndex==0)?$(this).hide():$(this).show();var e=Math.min(r*(t.height()-c.height())/(f(this,Dt).template.height()*f(this,Dt).template.length*f(this,Dt).data.count()),r);l[0].dataset.height=e,e<16&&(e=16);var i=r-f(this,bi).call(this);if(i!=0){e>=r?l.css({top:0,height:e-20}):l.css({height:e});var u;if(f(this,Dt).isFirstPage)u=0;else if(f(this,Dt).isLastPage)u=r-n-2;else{var a=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length);u=parseInt(o*i/(f(this,Dt).data.count()-a+1)),u>r-n-3&&(u=r-n-3)}f(this,ge).thumb.style.top=u+"px",f(this,ge).top.disabled=!!f(this,Dt).isFirstPage,f(this,ge).bottom.disabled=!!f(this,Dt).isLastPage,$(this).is(":visible")&&$("ng-hscrollbar",f(this,Dt).body).is(":visible")?$(".ng-scroll-edge",f(this,Dt).body).show():$(".ng-scroll-edge",f(this,Dt).body).hide()}});it(this,"refreshV2",()=>{if(f(this,Dt)){var t=$(".ng-scroll-thumb",this.shadowRoot),l=f(this,Dt).dataManager.viewRecords.rawIndex,c=this.trackHeight,o=this.thumbHeight,r=Math.min(c*(this.bodyHeight-this.theadHeight)/(this.templateHeight*f(this,Dt).template.length*f(this,Dt).data.count()),c);t[0].dataset.height=r,r<16&&(r=16);var n=c-f(this,bi).call(this),s;if(f(this,Dt).isFirstPage)s=0;else if(f(this,Dt).isLastPage)s=c-o-2;else{var e=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length);s=parseInt(l*n/(f(this,Dt).data.count()-e+1)),s>c-o-3&&(s=c-o-3)}f(this,ge).thumb.style.top=s+"px",f(this,ge).top.disabled=!!f(this,Dt).isFirstPage,f(this,ge).bottom.disabled=!!f(this,Dt).isLastPage}});it(this,"delayScroll",(t,l,c,o)=>{clearInterval(f(this,yr)),clearInterval(f(this,vr)),f(this,Dt).scrollBy(t),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{f(this,Dt).scrollBy(t)?o&&o.call():clearInterval(f(this,vr))},c))},l))});it(this,"stopScroll",()=>{clearInterval(f(this,yr)),clearInterval(f(this,vr))});Y(this,Kh,()=>{var t=l=>{clearInterval(f(this,yr)),clearInterval(f(this,vr)),f(this,Dt).scrollBy(l),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{f(this,Dt).scrollBy(l)},10))},500))};$(f(this,ge).top).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(-1)}),$(f(this,ge).bottom).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(1)}),$(f(this,ge).top).on("touchstart",l=>{t(-1)}),$(f(this,ge).bottom).on("touchstart",l=>{t(1)}),f(this,ge).top.ontouchend=f(this,ge).bottom.ontouchend=f(this,ge).track.ontouchend=f(this,ge).top.onmouseup=f(this,ge).top.onmouseleave=f(this,ge).bottom.onmouseup=f(this,ge).bottom.onmouseleave=f(this,ge).track.onmouseup=f(this,ge).track.onmouseleave=l=>{clearInterval(f(this,yr)),clearInterval(f(this,vr))},$(f(this,ge).track).on("mousedown",f(this,xa)),$(f(this,ge).track).on("touchstart",f(this,Zh)),$(f(this,ge).thumb).on("mousedown",f(this,Sa)),$(f(this,ge).thumb).on("touchstart",f(this,Jh)),document.addEventListener("mouseup",l=>{f(this,Wr)&&tt(this,Wr,!1),document.removeEventListener("mousemove",f(this,Sn)),typeof this.onDragStop=="function"&&this.onDragStop()}),document.addEventListener("touchend",l=>{tt(this,Wr,!1),document.removeEventListener("touchmove",f(this,_a)),typeof this.onDragStop=="function"&&this.onDragStop()})});Y(this,Zh,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,xa).call(this,t)});Y(this,xa,t=>{if(!f(this,Wr)&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftKey)){t.preventDefault();var l=f(this,ge).thumb.getBoundingClientRect();clearInterval(f(this,yr)),clearInterval(f(this,vr)),t.clientY>l.y?f(this,Dt).pageDown():f(this,Dt).pageUp(),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{var c=f(this,ge).thumb.getBoundingClientRect();if(t.clientY>c.y&&t.clientY<c.y+c.height)clearInterval(f(this,vr));else{var o=t.clientY>c.y?f(this,Dt).pageDown():f(this,Dt).pageUp();o||clearInterval(f(this,vr))}},10))},500))}});Y(this,Jh,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Sa).call(this,t),document.addEventListener("touchmove",f(this,_a))});Y(this,_a,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Sn).call(this,t)});Y(this,Sa,t=>{tt(this,Wr,!0),this.shiftY=t.offsetY+f(this,ge).track.getBoundingClientRect().y,this.trackHeight=$(f(this,ge).track).height(),this.thumbHeight=$(f(this,ge).thumb).height(),this.nodataHeight=$(".ng-container .ng-table tr.nodata",f(this,Dt).body).height(),this.bodyHeight=$(".ng-container-body",f(this,Dt).body).height(),this.templateHeight=f(this,Dt).template.height(),this.theadHeight=$(".ng-container-body table > thead",f(this,Dt).body).height()||0,this.tfootHeight=$(".ng-container-body table > tfoot",f(this,Dt).body).height()||0,this.fixedHeight=$(".ng-container-body tbody.fixed",f(this,Dt).body).height(),this.tableHeight=$(".ng-container-body .ng-table",f(this,Dt).body).height(),tt(this,_n,!0),document.addEventListener("mousemove",f(this,Sn)),typeof this.onDragStart=="function"&&this.onDragStart()});Y(this,pu,t=>{if(!f(this,Wr))return;t.preventDefault(),f(this,_n)&&(H.j.querySelectorAll("th,td",f(this,Dt).body).removeClass("active").removeClass("multi-selected").removeClass("selected").removeClass("selected-current").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right"),tt(this,_n,!1));var l=this.trackHeight;let c=f(this,bi).call(this);var o=t.clientY-this.shiftY;o<0&&(o=0),o+this.thumbHeight>l&&(o=parseInt(l-c));var r=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length),n=parseInt(o*(f(this,Dt).data.count()+1-r)/parseInt(l-c));if(f(this,Dt).dataManager.viewRecords.rawIndex!=n)f(this,Dt).scrollToV2(n);else{var s=l-c,e=o/s,i=f(this,Dt).matrix.totalHeight,u=e*(i-this.bodyHeight),a=f(this,Dt).matrix.cumulativeHeights[n]||0,h=u-a;Ue(this,kn,su).call(this,h)}});Y(this,Sn,t=>{if(f(this,Wr)){t.preventDefault();var l=this.trackHeight,c=f(this,bi).call(this),o=Math.max(0,Math.min(t.clientY-this.shiftY,l-c)),r=f(this,Dt).data.count(),n=o/(l-c),s=Math.floor(n*(r-1));if(f(this,Dt).dataManager.viewRecords.rawIndex!==s)f(this,Dt).scrollToV2(s),Ue(this,kn,su).call(this,0);else{var e=o%(l/r);Ue(this,kn,su).call(this,e)}}});Y(this,bi,()=>parseInt(f(this,ge).thumb.dataset.height));this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Dt,this.getRootNode().host),f(this,Dt)&&(this.shadowRoot.innerHTML=`
655
+ `,super.connectedCallback(),this.cell.dataset.bind="rowState"}}customElements.get("ng-row-state")||customElements.define("ng-row-state",Zd);class Jd extends HTMLElement{constructor(){super();Y(this,kn);Y(this,Dt);Y(this,Wr);Y(this,ge);Y(this,yr);Y(this,vr);Y(this,_n);it(this,"refresh",()=>{if(!f(this,Dt))return;var t=$(".ng-container-body",f(this,Dt).body),l=$(".ng-scroll-thumb",this.shadowRoot),c=$("table > thead",t),o=f(this,Dt).dataManager.viewRecords.rawIndex,r=$(f(this,ge).track).height(),n=$(f(this,ge).thumb).height();Number(f(this,Dt).getAttribute("display-row-count")||0)>=f(this,Dt).dataManager.rawRecords.length||parseInt($(".ng-container .ng-table tr.nodata",f(this,Dt).body).height())>0&&(f(this,Dt).dataManager.rawRecords.length==0||f(this,Dt).dataManager.viewRecords.rawIndex==0)?$(this).hide():$(this).show();var e=Math.min(r*(t.height()-c.height())/(f(this,Dt).template.height()*f(this,Dt).template.length*f(this,Dt).data.count()),r);l[0].dataset.height=e,e<16&&(e=16);var i=r-f(this,bi).call(this);if(i!=0){e>=r?l.css({top:0,height:e-20}):l.css({height:e});var u;if(f(this,Dt).isFirstPage)u=0;else if(f(this,Dt).isLastPage)u=r-n-2;else{var a=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length);u=parseInt(o*i/(f(this,Dt).data.count()-a+1)),u>r-n-3&&(u=r-n-3)}f(this,ge).thumb.style.top=u+"px",f(this,ge).top.disabled=!!f(this,Dt).isFirstPage,f(this,ge).bottom.disabled=!!f(this,Dt).isLastPage,$(this).is(":visible")&&$("ng-hscrollbar",f(this,Dt).body).is(":visible")?$(".ng-scroll-edge",f(this,Dt).body).show():$(".ng-scroll-edge",f(this,Dt).body).hide()}});it(this,"refreshV2",()=>{if(f(this,Dt)){var t=$(".ng-scroll-thumb",this.shadowRoot),l=f(this,Dt).dataManager.viewRecords.rawIndex,c=this.trackHeight,o=this.thumbHeight,r=Math.min(c*(this.bodyHeight-this.theadHeight)/(this.templateHeight*f(this,Dt).template.length*f(this,Dt).data.count()),c);t[0].dataset.height=r,r<16&&(r=16);var n=c-f(this,bi).call(this),s;if(f(this,Dt).isFirstPage)s=0;else if(f(this,Dt).isLastPage)s=c-o-2;else{var e=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length);s=parseInt(l*n/(f(this,Dt).data.count()-e+1)),s>c-o-3&&(s=c-o-3)}f(this,ge).thumb.style.top=s+"px",f(this,ge).top.disabled=!!f(this,Dt).isFirstPage,f(this,ge).bottom.disabled=!!f(this,Dt).isLastPage}});it(this,"delayScroll",(t,l,c,o)=>{clearInterval(f(this,yr)),clearInterval(f(this,vr)),f(this,Dt).scrollBy(t),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{f(this,Dt).scrollBy(t)?o&&o.call():clearInterval(f(this,vr))},c))},l))});it(this,"stopScroll",()=>{clearInterval(f(this,yr)),clearInterval(f(this,vr))});Y(this,Kh,()=>{var t=l=>{clearInterval(f(this,yr)),clearInterval(f(this,vr)),f(this,Dt).scrollBy(l),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{f(this,Dt).scrollBy(l)},10))},500))};$(f(this,ge).top).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(-1)}),$(f(this,ge).bottom).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(1)}),$(f(this,ge).top).on("touchstart",l=>{t(-1)}),$(f(this,ge).bottom).on("touchstart",l=>{t(1)}),f(this,ge).top.ontouchend=f(this,ge).bottom.ontouchend=f(this,ge).track.ontouchend=f(this,ge).top.onmouseup=f(this,ge).top.onmouseleave=f(this,ge).bottom.onmouseup=f(this,ge).bottom.onmouseleave=f(this,ge).track.onmouseup=f(this,ge).track.onmouseleave=l=>{clearInterval(f(this,yr)),clearInterval(f(this,vr))},$(f(this,ge).track).on("mousedown",f(this,xa)),$(f(this,ge).track).on("touchstart",f(this,Zh)),$(f(this,ge).thumb).on("mousedown",f(this,Sa)),$(f(this,ge).thumb).on("touchstart",f(this,Jh)),document.addEventListener("mouseup",l=>{f(this,Wr)&&tt(this,Wr,!1),document.removeEventListener("mousemove",f(this,Sn)),typeof this.onDragStop=="function"&&this.onDragStop()}),document.addEventListener("touchend",l=>{tt(this,Wr,!1),document.removeEventListener("touchmove",f(this,_a)),typeof this.onDragStop=="function"&&this.onDragStop()})});Y(this,Zh,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,xa).call(this,t)});Y(this,xa,t=>{if(!f(this,Wr)&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftKey)){t.preventDefault();var l=f(this,ge).thumb.getBoundingClientRect();clearInterval(f(this,yr)),clearInterval(f(this,vr)),t.clientY>l.y?f(this,Dt).pageDown():f(this,Dt).pageUp(),tt(this,yr,setInterval(()=>{clearInterval(f(this,yr)),tt(this,vr,setInterval(()=>{var c=f(this,ge).thumb.getBoundingClientRect();if(t.clientY>c.y&&t.clientY<c.y+c.height)clearInterval(f(this,vr));else{var o=t.clientY>c.y?f(this,Dt).pageDown():f(this,Dt).pageUp();o||clearInterval(f(this,vr))}},10))},500))}});Y(this,Jh,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Sa).call(this,t),document.addEventListener("touchmove",f(this,_a))});Y(this,_a,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Sn).call(this,t)});Y(this,Sa,t=>{tt(this,Wr,!0),this.shiftY=t.offsetY+f(this,ge).track.getBoundingClientRect().y,this.trackHeight=$(f(this,ge).track).height(),this.thumbHeight=$(f(this,ge).thumb).height(),this.nodataHeight=$(".ng-container .ng-table tr.nodata",f(this,Dt).body).height(),this.bodyHeight=$(".ng-container-body",f(this,Dt).body).height(),this.templateHeight=f(this,Dt).template.height(),this.theadHeight=$(".ng-container-body table > thead",f(this,Dt).body).height()||0,this.tfootHeight=$(".ng-container-body table > tfoot",f(this,Dt).body).height()||0,this.fixedHeight=$(".ng-container-body tbody.fixed",f(this,Dt).body).height(),this.tableHeight=$(".ng-container-body .ng-table",f(this,Dt).body).height(),tt(this,_n,!0),document.addEventListener("mousemove",f(this,Sn)),typeof this.onDragStart=="function"&&this.onDragStart()});Y(this,pu,t=>{if(!f(this,Wr))return;t.preventDefault(),f(this,_n)&&(H.j.querySelectorAll("th,td",f(this,Dt).body).removeClass("active").removeClass("multi-selected").removeClass("selected").removeClass("selected-current").removeClass("selected-area").removeClass("selected-top").removeClass("selected-bottom").removeClass("selected-left").removeClass("selected-right"),tt(this,_n,!1));var l=this.trackHeight;let c=f(this,bi).call(this);var o=t.clientY-this.shiftY;o<0&&(o=0),o+this.thumbHeight>l&&(o=parseInt(l-c));var r=parseInt($(".ng-container-body tbody.bindable tr",f(this,Dt).body).not(".nodata").length/f(this,Dt).template.length),n=parseInt(o*(f(this,Dt).data.count()+1-r)/parseInt(l-c));if(f(this,Dt).dataManager.viewRecords.rawIndex!=n)f(this,Dt).scrollToV2(n);else{var s=l-c,e=o/s,i=f(this,Dt).matrix.totalHeight,u=e*(i-this.bodyHeight),a=f(this,Dt).matrix.cumulativeHeights[n]||0,h=u-a;Ue(this,kn,su).call(this,h)}});Y(this,Sn,t=>{if(f(this,Wr)){t.preventDefault();var l=this.trackHeight,c=f(this,bi).call(this),o=Math.max(0,Math.min(t.clientY-this.shiftY,l-c)),r=f(this,Dt).data.count(),n=o/(l-c),s=Math.floor(n*(r-1));if(f(this,Dt).dataManager.viewRecords.rawIndex!==s)f(this,Dt).scrollToV2(s),Ue(this,kn,su).call(this,0);else{var e=o%(l/r);Ue(this,kn,su).call(this,e)}}});Y(this,bi,()=>parseInt(f(this,ge).thumb.dataset.height));this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Dt,this.getRootNode().host),f(this,Dt)&&(this.shadowRoot.innerHTML=`
656
656
  <style>
657
657
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngVScrollBar.css";
658
658
  ${H.getCustomPath(this,"ngVScrollBar.css")}
@@ -661,7 +661,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
661
661
  <button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
662
662
  <div class='ng-scroll-track'> <div class='ng-scroll-thumb'></div> </div>
663
663
  <button class='ng-scroll-bottom'><div class='ng-scroll-icon'></div></button>
664
- `,tt(this,ge,{track:this.shadowRoot.querySelector(".ng-scroll-track"),thumb:this.shadowRoot.querySelector(".ng-scroll-thumb"),top:this.shadowRoot.querySelector(".ng-scroll-top"),bottom:this.shadowRoot.querySelector(".ng-scroll-bottom")}),f(this,Wr),this.shiftX,f(this,Kh).call(this))}}Dt=new WeakMap,Wr=new WeakMap,ge=new WeakMap,yr=new WeakMap,vr=new WeakMap,_n=new WeakMap,Kh=new WeakMap,Zh=new WeakMap,xa=new WeakMap,Jh=new WeakMap,_a=new WeakMap,Sa=new WeakMap,pu=new WeakMap,Sn=new WeakMap,kn=new WeakSet,su=function(t){const l=f(this,Dt).body.querySelector(".ng-container-body tbody.bindable");sd.log(t),l&&(l.style.transform=`translateY(-${Math.max(0,t)}px)`)},bi=new WeakMap;class tf extends HTMLElement{constructor(){super();Y(this,Je);Y(this,gs);Y(this,ae);Y(this,Xr);Y(this,Yr);it(this,"refresh",()=>{if(f(this,Je)){var t=$(".ng-container-body",f(this,Je).body),l=$("table",t),c=$(".ng-scroll-track",this.shadowRoot),o=$(".ng-scroll-thumb",this.shadowRoot);t.width()!=0&&l.width()>t.width()?$(f(this,Je).body.querySelector(".ng-container-bottom")).show():$(f(this,Je).body.querySelector(".ng-container-bottom")).hide(),o.width(Math.min(c.width()*t.width()/l.width(),c.width()));var r=parseInt(Math.abs(l.position().left)*c.width()/l.width());r<0&&(r=0),r+o.width()>c.width()&&(r=c.width()-o.width()),o.css({left:r}),H.j.querySelectorAll(".ng-scroll-left",this.shadowRoot).attr("disabled",r==0),H.j.querySelectorAll(".ng-scroll-right",this.shadowRoot).attr("disabled",r==c.width()-o.width());var n=f(this,Je).body.querySelector("ng-vscrollbar");$(this).is(":visible")&&$(n).is(":visible")?$(".ng-scroll-edge",f(this,Je).body).show():$(".ng-scroll-edge",f(this,Je).body).hide()}});it(this,"scrollToHome",()=>{f(this,Hs).call(this,0)});it(this,"scrollToEnd",()=>{var t=f(this,ae).track.getBoundingClientRect(),l=f(this,ae).thumb.getBoundingClientRect(),c=t.width-l.width;f(this,Hs).call(this,c)});Y(this,Hs,t=>{if(f(this,ae)){var l=$("table",f(this,ae).container),c=f(this,ae).track.getBoundingClientRect(),o=f(this,ae).thumb.getBoundingClientRect();t<0&&(t=0),t+o.width>c.width&&(t=c.width-o.width),t=parseInt(t),f(this,ae).thumb.style.left=t+"px",f(this,ae).left.disabled=t==0,f(this,ae).right.disabled=t==parseInt(c.width-o.width);var r=$(f(this,ae).container).width(),n=$(l).width(),s=-t*(n-r)/(c.width-o.width);return-s>n-r&&(s=n-r),-s+5>n-r&&(s=-(n-r)),r>=n&&(s=0),$(l).css({left:s}),!(t==0||t==c.width-o.width)}});it(this,"adjustThumb2",()=>{var t=$(".ng-container-body > table",f(this,Je).body),l=$(".ng-scroll-track",this.shadowRoot),c=$(".ng-scroll-thumb",this.shadowRoot),o=parseInt(Math.abs(t.position().left)*l.width()/t.width());o<0&&(o=0),o+c.width()>l.width()&&(o=l.width()-c.width()),c.css({left:o}),H.j.querySelectorAll(".ng-scroll-left",this.shadowRoot).attr("disabled",o==0),H.j.querySelectorAll(".ng-scroll-right",this.shadowRoot).attr("disabled",o==l.width()-c.width())});Y(this,Qh,()=>{var t=l=>{clearInterval(f(this,Xr)),clearInterval(f(this,Yr));var c=f(this,ae).track.getBoundingClientRect(),o=f(this,ae).thumb.getBoundingClientRect();f(this,Hs).call(this,o.x-c.x+l),tt(this,Xr,setInterval(()=>{clearInterval(f(this,Xr)),tt(this,Yr,setInterval(()=>{var r=f(this,ae).thumb.getBoundingClientRect();f(this,Hs).call(this,r.x-c.x+l)||clearInterval(f(this,Yr))},10))},500))};f(this,ae).left.ontouchend=f(this,ae).right.ontouchend=f(this,ae).track.ontouchend=f(this,ae).left.onmouseup=f(this,ae).left.onmouseleave=f(this,ae).right.onmouseup=f(this,ae).right.onmouseleave=f(this,ae).track.onmouseup,f(this,ae).track.onmouseleave=l=>{clearInterval(f(this,Xr)),clearInterval(f(this,Yr))},$(f(this,ae).left).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(-10)}),$(f(this,ae).right).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(10)}),$(f(this,ae).left).on("touchstart",l=>{t(-10)}),$(f(this,ae).right).on("touchstart",l=>{t(10)}),$(f(this,ae).track).on("mousedown",f(this,Ca)),$(f(this,ae).track).on("touchstart",f(this,tc)),$(f(this,ae).thumb).on("mousedown",f(this,Ea)),$(f(this,ae).thumb).on("touchstart",f(this,ec)),document.addEventListener("touchend",l=>{tt(this,gs,!1),clearInterval(f(this,Xr)),clearInterval(f(this,Yr)),$(document).off("touchmove",f(this,Aa)),typeof this.onDragStop=="function"&&this.onDragStop()}),document.addEventListener("mouseup",l=>{tt(this,gs,!1),clearInterval(f(this,Xr)),clearInterval(f(this,Yr)),document.removeEventListener("mousemove",f(this,Cn)),typeof this.onDragStop=="function"&&this.onDragStop()})});Y(this,ka,t=>{var l=f(this,ae).thumb.getBoundingClientRect(),c=parseInt($(".ng-container-body > table",f(this,Je).body).position().left),o=0;t>l.x?$(".ng-container-body .col-indicator",f(this,Je).body).each((r,n)=>{if(o+=parseInt($(n).width())+2,o>Math.abs(c)+1)return!1}):$(".ng-container-body .col-indicator",f(this,Je).body).each((r,n)=>{if(o+parseInt($(n).width())+2>=Math.abs(c))return!1;o+=parseInt($(n).width())+2}),$(".ng-container-body > table",f(this,Je).body).css({left:-o}),this.refresh()});Y(this,tc,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Ca).call(this,t)});Y(this,Ca,t=>{f(this,gs)||t.buttons!=1||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),f(this,ka).call(this,t.clientX),tt(this,Xr,setInterval(()=>{clearInterval(f(this,Xr)),tt(this,Yr,setInterval(()=>{var l=f(this,ae).thumb.getBoundingClientRect();t.clientX>l.x&&t.clientX<l.x+l.width?clearInterval(f(this,Yr)):f(this,ka).call(this,t.clientX)},10))},500)))});Y(this,ec,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Ea).call(this,t),document.addEventListener("touchmove",f(this,Aa))});Y(this,Ea,t=>{tt(this,gs,!0);var l=Math.min($(f(this,ae).track).width()*$(f(this,Je).body.querySelector(".ng-container-body")).width()/$(f(this,Je).body.querySelector(".ng-container-body > table")).width(),$(f(this,ae).track).width());$(f(this,ae).thumb).width(parseInt(l)),$(f(this,ae).thumb).css({width:parseInt(l),"min-width":parseInt(l)}),this.shiftX=t.offsetX+f(this,ae).track.getBoundingClientRect().x,document.addEventListener("mousemove",f(this,Cn)),typeof this.onDragStart=="function"&&this.onDragStart()});Y(this,Aa,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Cn).call(this,t)});Y(this,Cn,t=>{f(this,gs)&&f(this,Hs).call(this,t.pageX-this.shiftX)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Je,this.getRootNode().host),this.shadowRoot.innerHTML=`
664
+ `,tt(this,ge,{track:this.shadowRoot.querySelector(".ng-scroll-track"),thumb:this.shadowRoot.querySelector(".ng-scroll-thumb"),top:this.shadowRoot.querySelector(".ng-scroll-top"),bottom:this.shadowRoot.querySelector(".ng-scroll-bottom")}),f(this,Wr),this.shiftX,f(this,Kh).call(this))}}Dt=new WeakMap,Wr=new WeakMap,ge=new WeakMap,yr=new WeakMap,vr=new WeakMap,_n=new WeakMap,Kh=new WeakMap,Zh=new WeakMap,xa=new WeakMap,Jh=new WeakMap,_a=new WeakMap,Sa=new WeakMap,pu=new WeakMap,Sn=new WeakMap,kn=new WeakSet,su=function(t){const l=f(this,Dt).body.querySelector(".ng-container-body tbody.bindable");l&&(l.style.transform=`translateY(-${t}px)`)},bi=new WeakMap;class Qd extends HTMLElement{constructor(){super();Y(this,Je);Y(this,gs);Y(this,ae);Y(this,Xr);Y(this,Yr);it(this,"refresh",()=>{if(f(this,Je)){var t=$(".ng-container-body",f(this,Je).body),l=$("table",t),c=$(".ng-scroll-track",this.shadowRoot),o=$(".ng-scroll-thumb",this.shadowRoot);t.width()!=0&&l.width()>t.width()?$(f(this,Je).body.querySelector(".ng-container-bottom")).show():$(f(this,Je).body.querySelector(".ng-container-bottom")).hide(),o.width(Math.min(c.width()*t.width()/l.width(),c.width()));var r=parseInt(Math.abs(l.position().left)*c.width()/l.width());r<0&&(r=0),r+o.width()>c.width()&&(r=c.width()-o.width()),o.css({left:r}),H.j.querySelectorAll(".ng-scroll-left",this.shadowRoot).attr("disabled",r==0),H.j.querySelectorAll(".ng-scroll-right",this.shadowRoot).attr("disabled",r==c.width()-o.width());var n=f(this,Je).body.querySelector("ng-vscrollbar");$(this).is(":visible")&&$(n).is(":visible")?$(".ng-scroll-edge",f(this,Je).body).show():$(".ng-scroll-edge",f(this,Je).body).hide()}});it(this,"scrollToHome",()=>{f(this,Hs).call(this,0)});it(this,"scrollToEnd",()=>{var t=f(this,ae).track.getBoundingClientRect(),l=f(this,ae).thumb.getBoundingClientRect(),c=t.width-l.width;f(this,Hs).call(this,c)});Y(this,Hs,t=>{if(f(this,ae)){var l=$("table",f(this,ae).container),c=f(this,ae).track.getBoundingClientRect(),o=f(this,ae).thumb.getBoundingClientRect();t<0&&(t=0),t+o.width>c.width&&(t=c.width-o.width),t=parseInt(t),f(this,ae).thumb.style.left=t+"px",f(this,ae).left.disabled=t==0,f(this,ae).right.disabled=t==parseInt(c.width-o.width);var r=$(f(this,ae).container).width(),n=$(l).width(),s=-t*(n-r)/(c.width-o.width);return-s>n-r&&(s=n-r),-s+5>n-r&&(s=-(n-r)),r>=n&&(s=0),$(l).css({left:s}),!(t==0||t==c.width-o.width)}});it(this,"adjustThumb2",()=>{var t=$(".ng-container-body > table",f(this,Je).body),l=$(".ng-scroll-track",this.shadowRoot),c=$(".ng-scroll-thumb",this.shadowRoot),o=parseInt(Math.abs(t.position().left)*l.width()/t.width());o<0&&(o=0),o+c.width()>l.width()&&(o=l.width()-c.width()),c.css({left:o}),H.j.querySelectorAll(".ng-scroll-left",this.shadowRoot).attr("disabled",o==0),H.j.querySelectorAll(".ng-scroll-right",this.shadowRoot).attr("disabled",o==l.width()-c.width())});Y(this,Qh,()=>{var t=l=>{clearInterval(f(this,Xr)),clearInterval(f(this,Yr));var c=f(this,ae).track.getBoundingClientRect(),o=f(this,ae).thumb.getBoundingClientRect();f(this,Hs).call(this,o.x-c.x+l),tt(this,Xr,setInterval(()=>{clearInterval(f(this,Xr)),tt(this,Yr,setInterval(()=>{var r=f(this,ae).thumb.getBoundingClientRect();f(this,Hs).call(this,r.x-c.x+l)||clearInterval(f(this,Yr))},10))},500))};f(this,ae).left.ontouchend=f(this,ae).right.ontouchend=f(this,ae).track.ontouchend=f(this,ae).left.onmouseup=f(this,ae).left.onmouseleave=f(this,ae).right.onmouseup=f(this,ae).right.onmouseleave=f(this,ae).track.onmouseup,f(this,ae).track.onmouseleave=l=>{clearInterval(f(this,Xr)),clearInterval(f(this,Yr))},$(f(this,ae).left).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(-10)}),$(f(this,ae).right).on("mousedown",l=>{l.buttons!=1||l.altKey||l.ctrlKey||l.shiftKey||t(10)}),$(f(this,ae).left).on("touchstart",l=>{t(-10)}),$(f(this,ae).right).on("touchstart",l=>{t(10)}),$(f(this,ae).track).on("mousedown",f(this,Ca)),$(f(this,ae).track).on("touchstart",f(this,tc)),$(f(this,ae).thumb).on("mousedown",f(this,Ea)),$(f(this,ae).thumb).on("touchstart",f(this,ec)),document.addEventListener("touchend",l=>{tt(this,gs,!1),clearInterval(f(this,Xr)),clearInterval(f(this,Yr)),$(document).off("touchmove",f(this,Aa)),typeof this.onDragStop=="function"&&this.onDragStop()}),document.addEventListener("mouseup",l=>{tt(this,gs,!1),clearInterval(f(this,Xr)),clearInterval(f(this,Yr)),document.removeEventListener("mousemove",f(this,Cn)),typeof this.onDragStop=="function"&&this.onDragStop()})});Y(this,ka,t=>{var l=f(this,ae).thumb.getBoundingClientRect(),c=parseInt($(".ng-container-body > table",f(this,Je).body).position().left),o=0;t>l.x?$(".ng-container-body .col-indicator",f(this,Je).body).each((r,n)=>{if(o+=parseInt($(n).width())+2,o>Math.abs(c)+1)return!1}):$(".ng-container-body .col-indicator",f(this,Je).body).each((r,n)=>{if(o+parseInt($(n).width())+2>=Math.abs(c))return!1;o+=parseInt($(n).width())+2}),$(".ng-container-body > table",f(this,Je).body).css({left:-o}),this.refresh()});Y(this,tc,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Ca).call(this,t)});Y(this,Ca,t=>{f(this,gs)||t.buttons!=1||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),f(this,ka).call(this,t.clientX),tt(this,Xr,setInterval(()=>{clearInterval(f(this,Xr)),tt(this,Yr,setInterval(()=>{var l=f(this,ae).thumb.getBoundingClientRect();t.clientX>l.x&&t.clientX<l.x+l.width?clearInterval(f(this,Yr)):f(this,ka).call(this,t.clientX)},10))},500)))});Y(this,ec,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Ea).call(this,t),document.addEventListener("touchmove",f(this,Aa))});Y(this,Ea,t=>{tt(this,gs,!0);var l=Math.min($(f(this,ae).track).width()*$(f(this,Je).body.querySelector(".ng-container-body")).width()/$(f(this,Je).body.querySelector(".ng-container-body > table")).width(),$(f(this,ae).track).width());$(f(this,ae).thumb).width(parseInt(l)),$(f(this,ae).thumb).css({width:parseInt(l),"min-width":parseInt(l)}),this.shiftX=t.offsetX+f(this,ae).track.getBoundingClientRect().x,document.addEventListener("mousemove",f(this,Cn)),typeof this.onDragStart=="function"&&this.onDragStart()});Y(this,Aa,t=>{var l=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-l.left,t.offsetY=t.targetTouches[0].pageY-l.top,t.pageX=t.changedTouches[0].pageX,t.pageY=t.changedTouches[0].pageY,t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,t.buttons=1,f(this,Cn).call(this,t)});Y(this,Cn,t=>{f(this,gs)&&f(this,Hs).call(this,t.pageX-this.shiftX)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Je,this.getRootNode().host),this.shadowRoot.innerHTML=`
665
665
  <style>
666
666
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngHScrollBar.css";
667
667
  ${H.getCustomPath(this,"ngHScrollBar.css")}
@@ -670,15 +670,15 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
670
670
  <button class='ng-scroll-left' disabled><div class='ng-scroll-icon'></div></button>
671
671
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
672
672
  <button class='ng-scroll-right'><div class='ng-scroll-icon'></div></button>
673
- `,tt(this,ae,{container:f(this,Je).shadowRoot.querySelector(".ng-container-body"),track:this.shadowRoot.querySelector(".ng-scroll-track"),thumb:this.shadowRoot.querySelector(".ng-scroll-thumb"),left:this.shadowRoot.querySelector(".ng-scroll-left"),right:this.shadowRoot.querySelector(".ng-scroll-right")}),f(this,gs),this.shiftX,f(this,Qh).call(this)}}Je=new WeakMap,gs=new WeakMap,ae=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,Hs=new WeakMap,Qh=new WeakMap,ka=new WeakMap,tc=new WeakMap,Ca=new WeakMap,ec=new WeakMap,Ea=new WeakMap,Aa=new WeakMap,Cn=new WeakMap,customElements.get("ng-hscrollbar")||customElements.define("ng-hscrollbar",tf),customElements.get("ng-vscrollbar")||customElements.define("ng-vscrollbar",Qd);class ef{constructor(E){Y(this,Ye);Y(this,ns);it(this,"initialize",()=>{f(this,Ra).call(this),f(this,Ta).call(this)});Y(this,Ta,()=>{tt(this,ns,[]),$(".ng-table thead",f(this,Ye).body).off("click","th,td",f(this,Ma)),$(".ng-table thead",f(this,Ye).body).on("click","th,td",f(this,Ma))});Y(this,Ra,()=>{f(this,Ye).data.sort((E,t)=>E.__ng._[H.ROW.ORIGIN_ORDER]-t.__ng._[H.ROW.ORIGIN_ORDER])});Y(this,Ma,E=>{if(E.target.tagName!="NG-CHECKBOX"&&(E.target=E.target.closest("th,td"),!(E.offsetX<=2)&&!(E.offsetX>=E.target.offsetWidth-2)&&E.target.closest("tr").sectionRowIndex+E.target.rowSpan==E.target.closest("thead").rows.length))switch(E.detail){case 1:H.j.querySelectorAll(f(this,Ye)).addClass("loading"),setTimeout(()=>{f(this,rc).call(this,E),H.j.querySelectorAll(f(this,Ye)).removeClass("loading")});break;case 2:console.log("double click action here");break;default:console.log("higher multi-click actions can be added as needed");break}});Y(this,rc,E=>{var t=E.target.closest("th,td"),l=t.dataset.col,c,o;$(f(this,Ye).template).find(`[data-col="${l}"]`).each((r,n)=>{if(n.dataset.bind)return o=n.dataset.bind,n.dataset.expr&&(c=f(this,Ye).exprFunction(n.dataset.expr)),!1}),o&&(!E.ctrlKey&&!E.shiftKey&&(H.j.querySelectorAll(`thead th:not([data-col="${l}"],thead td:not([data-col="${l}"])`,f(this,Ye).body).removeClass("asc").removeClass("desc"),f(this,ns).splice(0,f(this,ns).length)),H.removeIf(f(this,ns),r=>r.colnm==o),!H.j.querySelectorAll(t).hasClass("asc")&&!H.j.querySelectorAll(t).hasClass("desc")?(H.j.querySelectorAll(t).removeClass("desc").addClass("asc"),f(this,ns).push({colnm:o,asc:!0,"expr-func":c})):H.j.querySelectorAll(t).hasClass("asc")?(H.j.querySelectorAll(t).removeClass("asc").addClass("desc"),f(this,ns).push({colnm:o,asc:!1,"expr-func":c})):H.j.querySelectorAll(t).removeClass("asc").removeClass("desc"),!H.j.querySelectorAll("thead th,thead td",f(this,Ye).body).hasClass("asc")&&!H.j.querySelectorAll("thead th,thead td",f(this,Ye).body).hasClass("desc")?f(this,Ra).call(this):f(this,Ye).data.sort((r,n)=>f(this,sc).call(this,r,n)),f(this,Ye).paging.type==H.PAGINGTYPE.CLIENT?f(this,Ye).paging.movePage(1):f(this,Ye).view.redraw())});Y(this,sc,(E,t)=>{for(var l of f(this,ns))if(l["expr-func"]){const c=f(this,Ye).data.conv(E),o=f(this,Ye).data.conv(t);if(l["expr-func"](c,c.__ng._[H.ROW.INDEX])>l["expr-func"](o,o.__ng._[H.ROW.INDEX]))return l.asc?1:-1;if(l["expr-func"](c,c.__ng._[H.ROW.INDEX])<l["expr-func"](o,o.__ng._[H.ROW.INDEX]))return l.asc?-1:1}else{const c=f(this,Ye).fields.indexOf(l.colnm);if(E.v[c]>t.v[c])return l.asc?1:-1;if(E.v[c]<t.v[c])return l.asc?-1:1}return 0});tt(this,Ye,E),f(this,Ta).call(this)}}Ye=new WeakMap,ns=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Ma=new WeakMap,rc=new WeakMap,sc=new WeakMap;class rf{constructor(E){Y(this,Gt);it(this,"getDisplayValue3",(E,t)=>{const l=parseInt(E/f(this,Gt).template.length),o=f(this,Gt).template[E%f(this,Gt).template.length].querySelector(`[data-col="${t}"]`);if(!o||!o.dataset)return"";if(o.dataset.expr)return f(this,Gt).exprFunction(o.dataset.expr).call(this,f(this,Gt).data.get(l),l);if(o.dataset.bind)return f(this,Gt).data.get(l,o.dataset.bind)});it(this,"getDisplayValue2",(E,t,l,c,o)=>{var r=f(this,Gt).data.get(E);return this.getDisplayValue(r,E,l,c,o)});it(this,"getDisplayValue",(E,t,l,c,o)=>{var r={code:0,value:""};if(c)r.value=c(E,t);else if(o==null)r.value=E[l];else switch(o.tagName){case"NG-COMBO":var n=o.getAttribute("multi")=="true",s=o.getAttribute("multi-separator")||",",e=o.getAttribute("key")||"key",i=o.getAttribute("value")||e,u=o.dataSource,a=[];if(n)E[l].split(s).forEach(p=>{var m=u.findIndex(d=>p==d[e]);m>=0?a.push(u[m][i]):r.code=-1});else{var h=u.findIndex(p=>E[l]==p[e]);h>=0?a.push(u[h][i]):r.code=-1}r.value=a.length>0?a.join(s):E[l];break;case"NG-CHECKBOX":r.value=E[l],r.value!=null&&r.value!=""&&(r.code=o.dataSource.map(p=>p.value).includes(r.value)?0:-1);break;case"NG-RADIO":r.value=E[l],r.value!=null&&r.value!=""&&!H.isNull(o.dataSource)&&(r.code=o.dataSource.map(p=>p[o.getAttribute("key")||"key"]).includes(r.value)?0:-1);break;default:r.value=E[l];break}return r});it(this,"setRowHeightFitAll",E=>{f(this,ic).call(this,null,E)});Y(this,ic,(E,t)=>{if(!t){t=[];for(var l=0;l<f(this,Gt).template.length;l++)t.push($("th,td",f(this,Gt).template.eq(l)))}for(var c=$(f(this,Gt)).css("font"),o=[],l=0;l<t.length;l++){var r=[];t[l].each((u,a)=>{r.push($(a).css("font")||c)}),o.push(r)}if(E==null)H.j.querySelectorAll(f(this,Gt)).addClass("loading"),setTimeout(()=>{for(var i=0;i<f(this,Gt).data.count();i++)for(var u=0;u<f(this,Gt).template.length;u++){var a=i*f(this,Gt).template.length+u,h=parseInt(a%f(this,Gt).template.length),p=0;$(f(this,Gt).template).eq(a%f(this,Gt).template.length).each((d,b)=>{p=$(b).height()||32});var m=t[h].length==0?p:f(this,Ia).call(this,a,t[h],o[h])+12;f(this,Gt).matrix.setHeight(a,p?Math.max(m,p):m)}f(this,Gt).view.redraw(),H.j.querySelectorAll(f(this,Gt)).removeClass("loading")});else{var n=0;$(f(this,Gt).template).eq(E%f(this,Gt).template.length).each((i,u)=>{n=$(u).height()||32});var s=parseInt(E%f(this,Gt).template.length),e=t[s].length==0?n:f(this,Ia).call(this,E,t[s],o[s])+12;f(this,Gt).matrix.setHeight(E,n?Math.max(e,n):e),f(this,Gt).view.redraw()}});Y(this,Ia,(E,t,l)=>{var c=parseInt(E/f(this,Gt).template.length),o=0,r=f(this,Gt).data.getRow(c);return t.each((n,s)=>{const e=s.dataset.bind,i=f(this,Gt).fields.indexOf(e),u=String(r.v[i]);e&&u.includes(`
674
- `)&&(o=Math.max(o,H.measureTextSize(u,l[n]).height))}),o});Y(this,Na,E=>{var t=0;return $(`[data-col=${E}]`,f(this,Gt).template).each((l,c)=>{var o=$(c).css("font");o||(o=$(f(this,Gt)).css("font"));var r=this.getExprFunc(E,c.dataset.bind),n=c.querySelector("ng-combo"),s=0;for(var e of f(this,Gt).data.getValidData()){n&&(n.owner=f(this,Gt));var i=this.getDisplayValue2(s++,E,c.dataset.bind,r,n).value;i&&(t=Math.max(t,H.measureTextSize(i,o).width))}}),t+=$(`[data-col=${E}] ng-combo`,f(this,Gt).template).length>0?40:0,t==0?0:t+8});tt(this,Gt,E),this.___init=()=>{for(var t in this)this[t]instanceof Function&&(f(this,Gt)[t]=this[t].bind(f(this,Gt)))},this.___getColumnInfos=t=>{var l=[];return $(`[data-col=${t}]`,f(this,Gt).template).each((c,o)=>{o.dataset&&o.dataset.bind&&l.push({colnm:o.dataset.bind,font:$(o).css("font")})}),l},this.___getBindCols=t=>{var l=[];return $(`[data-bind=${t}]`,f(this,Gt).template).each((c,o)=>{l.push(parseInt(o.dataset.col))}),l},this.getBand=t=>{const l=$(`.col-indicator[data-col=${t}]`,f(this,Gt).body);if(l.closest(".ng-container-body").length>0)return H.BAND.BODY;if(l.closest(".ng-container-left").length>0)return H.BAND.LEFT;if(l.closest(".ng-container-right").length>0)return H.BAND.RIGHT},this.setColumnWidth=(t,l)=>{l=parseInt(l);const c=this.getBand(t);if(f(this,Gt).body.querySelector(`colgroup [data-col="${t}"]:not(.cdummy)`).setAttribute("width",l),c!=H.BAND.BODY){var l=0;$(`.ng-container-${c} col`,f(this,Gt).body).each((r,n)=>{l+=parseInt(n.getAttribute("width"))}),$(`.ng-container-${c}`,f(this,Gt).body).css({width:l,"min-width":l})}},this.getExprFunc=(t,l)=>{const c=H.j.querySelectorAll(l?`[data-col="${t}"][data-bind="${l}"]`:`[data-col="${t}"]`,f(this,Gt).tmpl).elem(),o=c?c.getAttribute("data-expr"):null;return o?f(this,Gt).exprFunction(o):null},this.setColumnWidthFit=(t,l,c)=>{if(c==null&&(c=!0),c)H.j.querySelectorAll(f(this,Gt)).addClass("loading"),setTimeout(()=>{var r=f(this,Na).call(this,t);this.setColumnWidth(t,l?Math.max(r,l):r),H.j.querySelectorAll(f(this,Gt)).removeClass("loading")});else{var o=f(this,Na).call(this,t);this.setColumnWidth(t,l?Math.max(o,l):o)}},this.insertCol=(t,l,c)=>{if(!["string","number"].includes(typeof t))throw`invalid argument : "${t}"`;if(typeof t=="string"){var o=this.___getBindCols(t);if(o.length<=0)throw`invalid argument : "${t}"`;t=o[0]}var r=u=>{var a=$(`.col-indicator[data-col=${u}]`,f(this,Gt).body);if(a.length<=0)throw"missing col";return $(l).find("col").each((h,p)=>{var m=p.getAttribute("width")||100;const d=document.createElement("th");d.setAttribute("scope","col"),H.j.querySelectorAll(d).addClass("col-indicator"),$(d).html("<div></div>").insertBefore(a).css({width:m,"min-width":m})}),a},n=r(t),s=(u,a)=>{var h=$(l).find(`${u} tr`),p=$(`${u} tr`,n.closest("table")).not(".col-indicator-rowgroup").not(".nodata"),m=0;$("th,td",h.eq(0)).each((b,g)=>{m+=g.colSpan});var d=0;p.each((b,g)=>{var S=$(g).find(`[data-col=${a}]`);if(S.length>0)$(h).eq(d).find("th,td").each((C,I)=>{g.insertBefore(I,S[0])}),d++;else for(var b=a-1;b>=0;b--){var S=$(`[data-col=${b}]`,g);if(S.length>0){S[0].colSpan+=m;break}}})},e=(u,a)=>{var h=$(l).find(`${u} tr`),p=$(`${u} tr`,n.closest("table")).not(".col-indicator-rowgroup").not(".nodata"),m=0;$("th,td",h.eq(0)).each((d,b)=>{m+=b.colSpan}),p.each((d,b)=>{var g=$(b).find(`[data-col=${a}]`);if(g.length>0)$(h).eq(parseInt(b.sectionRowIndex%f(this,Gt).template.length)).find("th,td").each((S,C)=>{b.insertBefore($(C).clone()[0],g[0])});else for(var d=a-1;d>=0;d--){var g=$(`[data-col=${d}]`,b);if(g.length>0){g[0].colSpan+=m;break}}})},i=(u,a)=>{var h=$(l).find(`${u} tr`),p=f(this,Gt).template,m=0;$("th,td",h.eq(0)).each((b,g)=>{m+=g.colSpan});var d=0;p.each((b,g)=>{var S=$(g).find(`[data-col=${a}]`);if(S.length>0)$(h).eq(d).find("th,td").each((C,I)=>{g.insertBefore(I,S[0])}),d++;else for(var b=a-1;b>=0;b--){var S=$(`[data-col=${b}]`,g);if(S.length>0){S[0].colSpan+=m;break}}})};s("thead",t),s("tfoot",t),e("tbody",t),i("tbody",t),f(this,Gt).resetTemplate(),f(this,Gt).dataManager.viewRecords.touch()},this.___init()}}Gt=new WeakMap,ic=new WeakMap,Ia=new WeakMap,Na=new WeakMap;class sf{constructor(E){this.___owner=E,this.columns_BAK={getBindCol:(t,l)=>this.___getBindCol(t,l),insert:(t,l,c)=>this.___insertCol(t,l,c)},this.___getBindCol=(t,l)=>{l==null&&(l=!0);var c=[];return $(this.___owner.template).find("th,td").each((o,r)=>{r.dataset.bind==t&&c.push(parseInt(r.dataset.col))}),c.length>0?l?c[0]:c[c.length-1]:-1},this.___insertCol=(t,l,c)=>{if(!["string","number"].includes(typeof t))throw`invalid argument : "${t}"`;typeof t=="string"&&(t=this.___getBindCol(t));var o=s=>{var e=$(`.col-indicator[data-col=${s}]`,this.___owner.body);return e.length>0&&$(l).find("col").each((i,u)=>{var a=u.getAttribute("width")||100;const h=document.createElement("th");h.setAttribute("scope","col"),H.j.querySelectorAll(h).addClass("col-indicator"),$(h).html("<div></div>").insertBefore(e).css({width:a,"min-width":a})}),e},r=o(t);if(r.length<=0)throw"missing col";var n=(s,e)=>{r.closest("table").find(`${s} tr`).each((i,u)=>{if(s=="thead"&&u.rowIndex==0)return!0;var a=$(u).find(`th[data-col=${e}],td[data-col=${e}]`);if(a.length>0){var h=i%this.___owner.template.length;$(l).find(`${s} tr`).eq(h).find("th,td").each((m,d)=>{u.insertBefore(d,a[0])})}else for(var p=e-1;p>=0;p--){var a=$(u).find(`th[data-col=${p}],td[data-col=${p}]`);if(a.length>0){$(l).find(`${s} tr`).eq(0).find("th,td").each((d,b)=>{a[0].colSpan+=b.colSpan});break}}})};n("thead",t),n("tfoot",t),n("tbody.bindable",t),this.___owner.template.each((s,e)=>{var i=$(e).find(`th[data-col=${t}],td[data-col=${t}]`);if(i.length>0){var u=s%this.___owner.template.length;$(l).find("tbody.bindable tr").eq(u).find("th,td").each((h,p)=>{e.insertBefore(p,i[0])})}else for(var a=t-1;a>=0;a--){var i=$(e).find(`th[data-col=${a}],td[data-col=${a}]`);if(i.length>0){$(l).find("tbody.bindable tr").eq(0).find("th,td").each((p,m)=>{i[0].colSpan+=m.colSpan});break}}}),this.___owner.resetTemplate()},this.height=(t,l)=>{var c=$(".ng-table tbody.bindable tr",this.___owner.body);return c.each((o,r)=>{t==r.sectionRowIndex&&($("canvas.chart",r).css({height:l-4}),$(r).css({height:l}))}),l=0,c.each((o,r)=>{t==r.sectionRowIndex&&(l=Math.max($(r).height(),l))}),l=parseInt(l),c.each((o,r)=>{t==r.sectionRowIndex&&($(r).css({height:l}),$(r).height(l))}),l},this.getElement=(t,l,c)=>{var o;return $(`.ng-table ${t} th,.ng-table ${t} td`,this.___owner.body).each((r,n)=>{var s=$(n).offset();if(c>=s.left&&c<=s.left+$(n).width()&&l==n.closest("tr").sectionRowIndex)return o=n,!1}),o},this.getElements=(t,l)=>{var c=[];return $(`.ng-table ${t} th,.ng-table ${t} td`,this.___owner.body).each((o,r)=>{var n=$(r).offset();l>=n.left&&l<=n.left+$(r).width()&&c.push(r)}),c},this.mergeCell=(t,l,c,o)=>{t=Math.min(t,l),l=Math.max(t,l),c=Math.min(c,o),o=Math.max(c,o);for(var r=c;r<=o;r++)$(".ng-table tbody.bindable",this.___owner.body).rowspan(r,t,l);$(".ng-table tbody.bindable",this.___owner.body).colspan(t,c,o)},this.prev=t=>{var l=t.closest("tr");if(l){var c=l.closest("tbody")?"tbody.bindable":l.closest("thead")?"thead":"tfoot",o=$(t).prev(t.tagName);if(o.length<=0){var r=!!t.closest(".ng-container-right"),n=!!t.closest(".ng-container-body");n?o=$(".ng-container-left > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:not(.dummy):last-child,td:not(.dummy):last-child"):r&&(o=$(".ng-container-body > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:not(.dummy):last-child,td:not(.dummy):last-child"))}return o}},this.next=t=>{var l=t.closest("tr");if(l){var c=l.closest("tbody")?"tbody.bindable":l.closest("thead")?"thead":"tfoot",o=$(t).next(t.tagName);if(o.length<=0){var r=!!t.closest(".ng-container-left"),n=!!t.closest(".ng-container-body");n?o=$(".ng-container-right > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:first-child,td:first-child"):r&&(o=$(".ng-container-body > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:first-child,td:first-child"))}return o}},this.isFirst=t=>{var l=this.prev(t);return!l||l.length<=0},this.isLast=t=>{var l=this.next(t);return!l||l.length<=0}}get rows(){for(var E=this.___owner.body.querySelector(".ng-container-body .ng-table").rows,t=this.___owner.body.querySelector(".ng-container-left .ng-table").rows,l=this.___owner.body.querySelector(".ng-container-right .ng-table").rows,c=[],o=0;o<t.length;o++)c.push(t[o]);for(var o=0;o<E.length;o++)c.push(E[o]);for(var o=0;o<l.length;o++)c.push(l[o]);return c}}class nf extends Qs{constructor(){super();Y(this,bs);it(this,"dataRefresh",t=>{$(f(this,bs)).val(this.value),t||this.reset()})}connectedCallback(){if(this.shadowRoot.innerHTML=`
673
+ `,tt(this,ae,{container:f(this,Je).shadowRoot.querySelector(".ng-container-body"),track:this.shadowRoot.querySelector(".ng-scroll-track"),thumb:this.shadowRoot.querySelector(".ng-scroll-thumb"),left:this.shadowRoot.querySelector(".ng-scroll-left"),right:this.shadowRoot.querySelector(".ng-scroll-right")}),f(this,gs),this.shiftX,f(this,Qh).call(this)}}Je=new WeakMap,gs=new WeakMap,ae=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,Hs=new WeakMap,Qh=new WeakMap,ka=new WeakMap,tc=new WeakMap,Ca=new WeakMap,ec=new WeakMap,Ea=new WeakMap,Aa=new WeakMap,Cn=new WeakMap,customElements.get("ng-hscrollbar")||customElements.define("ng-hscrollbar",Qd),customElements.get("ng-vscrollbar")||customElements.define("ng-vscrollbar",Jd);class tf{constructor(E){Y(this,Ye);Y(this,ns);it(this,"initialize",()=>{f(this,Ra).call(this),f(this,Ta).call(this)});Y(this,Ta,()=>{tt(this,ns,[]),$(".ng-table thead",f(this,Ye).body).off("click","th,td",f(this,Ma)),$(".ng-table thead",f(this,Ye).body).on("click","th,td",f(this,Ma))});Y(this,Ra,()=>{f(this,Ye).data.sort((E,t)=>E.__ng._[H.ROW.ORIGIN_ORDER]-t.__ng._[H.ROW.ORIGIN_ORDER])});Y(this,Ma,E=>{if(E.target.tagName!="NG-CHECKBOX"&&(E.target=E.target.closest("th,td"),!(E.offsetX<=2)&&!(E.offsetX>=E.target.offsetWidth-2)&&E.target.closest("tr").sectionRowIndex+E.target.rowSpan==E.target.closest("thead").rows.length))switch(E.detail){case 1:H.j.querySelectorAll(f(this,Ye)).addClass("loading"),setTimeout(()=>{f(this,rc).call(this,E),H.j.querySelectorAll(f(this,Ye)).removeClass("loading")});break;case 2:console.log("double click action here");break;default:console.log("higher multi-click actions can be added as needed");break}});Y(this,rc,E=>{var t=E.target.closest("th,td"),l=t.dataset.col,c,o;$(f(this,Ye).template).find(`[data-col="${l}"]`).each((r,n)=>{if(n.dataset.bind)return o=n.dataset.bind,n.dataset.expr&&(c=f(this,Ye).exprFunction(n.dataset.expr)),!1}),o&&(!E.ctrlKey&&!E.shiftKey&&(H.j.querySelectorAll(`thead th:not([data-col="${l}"],thead td:not([data-col="${l}"])`,f(this,Ye).body).removeClass("asc").removeClass("desc"),f(this,ns).splice(0,f(this,ns).length)),H.removeIf(f(this,ns),r=>r.colnm==o),!H.j.querySelectorAll(t).hasClass("asc")&&!H.j.querySelectorAll(t).hasClass("desc")?(H.j.querySelectorAll(t).removeClass("desc").addClass("asc"),f(this,ns).push({colnm:o,asc:!0,"expr-func":c})):H.j.querySelectorAll(t).hasClass("asc")?(H.j.querySelectorAll(t).removeClass("asc").addClass("desc"),f(this,ns).push({colnm:o,asc:!1,"expr-func":c})):H.j.querySelectorAll(t).removeClass("asc").removeClass("desc"),!H.j.querySelectorAll("thead th,thead td",f(this,Ye).body).hasClass("asc")&&!H.j.querySelectorAll("thead th,thead td",f(this,Ye).body).hasClass("desc")?f(this,Ra).call(this):f(this,Ye).data.sort((r,n)=>f(this,sc).call(this,r,n)),f(this,Ye).paging.type==H.PAGINGTYPE.CLIENT?f(this,Ye).paging.movePage(1):f(this,Ye).view.redraw())});Y(this,sc,(E,t)=>{for(var l of f(this,ns))if(l["expr-func"]){const c=f(this,Ye).data.conv(E),o=f(this,Ye).data.conv(t);if(l["expr-func"](c,c.__ng._[H.ROW.INDEX])>l["expr-func"](o,o.__ng._[H.ROW.INDEX]))return l.asc?1:-1;if(l["expr-func"](c,c.__ng._[H.ROW.INDEX])<l["expr-func"](o,o.__ng._[H.ROW.INDEX]))return l.asc?-1:1}else{const c=f(this,Ye).fields.indexOf(l.colnm);if(E.v[c]>t.v[c])return l.asc?1:-1;if(E.v[c]<t.v[c])return l.asc?-1:1}return 0});tt(this,Ye,E),f(this,Ta).call(this)}}Ye=new WeakMap,ns=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Ma=new WeakMap,rc=new WeakMap,sc=new WeakMap;class ef{constructor(E){Y(this,Gt);it(this,"getDisplayValue3",(E,t)=>{const l=parseInt(E/f(this,Gt).template.length),o=f(this,Gt).template[E%f(this,Gt).template.length].querySelector(`[data-col="${t}"]`);if(!o||!o.dataset)return"";if(o.dataset.expr)return f(this,Gt).exprFunction(o.dataset.expr).call(this,f(this,Gt).data.get(l),l);if(o.dataset.bind)return f(this,Gt).data.get(l,o.dataset.bind)});it(this,"getDisplayValue2",(E,t,l,c,o)=>{var r=f(this,Gt).data.get(E);return this.getDisplayValue(r,E,l,c,o)});it(this,"getDisplayValue",(E,t,l,c,o)=>{var r={code:0,value:""};if(c)r.value=c(E,t);else if(o==null)r.value=E[l];else switch(o.tagName){case"NG-COMBO":var n=o.getAttribute("multi")=="true",s=o.getAttribute("multi-separator")||",",e=o.getAttribute("key")||"key",i=o.getAttribute("value")||e,u=o.dataSource,a=[];if(n)E[l].split(s).forEach(p=>{var m=u.findIndex(d=>p==d[e]);m>=0?a.push(u[m][i]):r.code=-1});else{var h=u.findIndex(p=>E[l]==p[e]);h>=0?a.push(u[h][i]):r.code=-1}r.value=a.length>0?a.join(s):E[l];break;case"NG-CHECKBOX":r.value=E[l],r.value!=null&&r.value!=""&&(r.code=o.dataSource.map(p=>p.value).includes(r.value)?0:-1);break;case"NG-RADIO":r.value=E[l],r.value!=null&&r.value!=""&&!H.isNull(o.dataSource)&&(r.code=o.dataSource.map(p=>p[o.getAttribute("key")||"key"]).includes(r.value)?0:-1);break;default:r.value=E[l];break}return r});it(this,"setRowHeightFitAll",E=>{f(this,ic).call(this,null,E)});Y(this,ic,(E,t)=>{if(!t){t=[];for(var l=0;l<f(this,Gt).template.length;l++)t.push($("th,td",f(this,Gt).template.eq(l)))}for(var c=$(f(this,Gt)).css("font"),o=[],l=0;l<t.length;l++){var r=[];t[l].each((u,a)=>{r.push($(a).css("font")||c)}),o.push(r)}if(E==null)H.j.querySelectorAll(f(this,Gt)).addClass("loading"),setTimeout(()=>{for(var i=0;i<f(this,Gt).data.count();i++)for(var u=0;u<f(this,Gt).template.length;u++){var a=i*f(this,Gt).template.length+u,h=parseInt(a%f(this,Gt).template.length),p=0;$(f(this,Gt).template).eq(a%f(this,Gt).template.length).each((d,b)=>{p=$(b).height()||32});var m=t[h].length==0?p:f(this,Ia).call(this,a,t[h],o[h])+12;f(this,Gt).matrix.setHeight(a,p?Math.max(m,p):m)}f(this,Gt).view.redraw(),H.j.querySelectorAll(f(this,Gt)).removeClass("loading")});else{var n=0;$(f(this,Gt).template).eq(E%f(this,Gt).template.length).each((i,u)=>{n=$(u).height()||32});var s=parseInt(E%f(this,Gt).template.length),e=t[s].length==0?n:f(this,Ia).call(this,E,t[s],o[s])+12;f(this,Gt).matrix.setHeight(E,n?Math.max(e,n):e),f(this,Gt).view.redraw()}});Y(this,Ia,(E,t,l)=>{var c=parseInt(E/f(this,Gt).template.length),o=0,r=f(this,Gt).data.getRow(c);return t.each((n,s)=>{const e=s.dataset.bind,i=f(this,Gt).fields.indexOf(e),u=String(r.v[i]);e&&u.includes(`
674
+ `)&&(o=Math.max(o,H.measureTextSize(u,l[n]).height))}),o});Y(this,Na,E=>{var t=0;return $(`[data-col=${E}]`,f(this,Gt).template).each((l,c)=>{var o=$(c).css("font");o||(o=$(f(this,Gt)).css("font"));var r=this.getExprFunc(E,c.dataset.bind),n=c.querySelector("ng-combo"),s=0;for(var e of f(this,Gt).data.getValidData()){n&&(n.owner=f(this,Gt));var i=this.getDisplayValue2(s++,E,c.dataset.bind,r,n).value;i&&(t=Math.max(t,H.measureTextSize(i,o).width))}}),t+=$(`[data-col=${E}] ng-combo`,f(this,Gt).template).length>0?40:0,t==0?0:t+8});tt(this,Gt,E),this.___init=()=>{for(var t in this)this[t]instanceof Function&&(f(this,Gt)[t]=this[t].bind(f(this,Gt)))},this.___getColumnInfos=t=>{var l=[];return $(`[data-col=${t}]`,f(this,Gt).template).each((c,o)=>{o.dataset&&o.dataset.bind&&l.push({colnm:o.dataset.bind,font:$(o).css("font")})}),l},this.___getBindCols=t=>{var l=[];return $(`[data-bind=${t}]`,f(this,Gt).template).each((c,o)=>{l.push(parseInt(o.dataset.col))}),l},this.getBand=t=>{const l=$(`.col-indicator[data-col=${t}]`,f(this,Gt).body);if(l.closest(".ng-container-body").length>0)return H.BAND.BODY;if(l.closest(".ng-container-left").length>0)return H.BAND.LEFT;if(l.closest(".ng-container-right").length>0)return H.BAND.RIGHT},this.setColumnWidth=(t,l)=>{l=parseInt(l);const c=this.getBand(t);if(f(this,Gt).body.querySelector(`colgroup [data-col="${t}"]:not(.cdummy)`).setAttribute("width",l),c!=H.BAND.BODY){var l=0;$(`.ng-container-${c} col`,f(this,Gt).body).each((r,n)=>{l+=parseInt(n.getAttribute("width"))}),$(`.ng-container-${c}`,f(this,Gt).body).css({width:l,"min-width":l})}},this.getExprFunc=(t,l)=>{const c=H.j.querySelectorAll(l?`[data-col="${t}"][data-bind="${l}"]`:`[data-col="${t}"]`,f(this,Gt).tmpl).elem(),o=c?c.getAttribute("data-expr"):null;return o?f(this,Gt).exprFunction(o):null},this.setColumnWidthFit=(t,l,c)=>{if(c==null&&(c=!0),c)H.j.querySelectorAll(f(this,Gt)).addClass("loading"),setTimeout(()=>{var r=f(this,Na).call(this,t);this.setColumnWidth(t,l?Math.max(r,l):r),H.j.querySelectorAll(f(this,Gt)).removeClass("loading")});else{var o=f(this,Na).call(this,t);this.setColumnWidth(t,l?Math.max(o,l):o)}},this.insertCol=(t,l,c)=>{if(!["string","number"].includes(typeof t))throw`invalid argument : "${t}"`;if(typeof t=="string"){var o=this.___getBindCols(t);if(o.length<=0)throw`invalid argument : "${t}"`;t=o[0]}var r=u=>{var a=$(`.col-indicator[data-col=${u}]`,f(this,Gt).body);if(a.length<=0)throw"missing col";return $(l).find("col").each((h,p)=>{var m=p.getAttribute("width")||100;const d=document.createElement("th");d.setAttribute("scope","col"),H.j.querySelectorAll(d).addClass("col-indicator"),$(d).html("<div></div>").insertBefore(a).css({width:m,"min-width":m})}),a},n=r(t),s=(u,a)=>{var h=$(l).find(`${u} tr`),p=$(`${u} tr`,n.closest("table")).not(".col-indicator-rowgroup").not(".nodata"),m=0;$("th,td",h.eq(0)).each((b,g)=>{m+=g.colSpan});var d=0;p.each((b,g)=>{var S=$(g).find(`[data-col=${a}]`);if(S.length>0)$(h).eq(d).find("th,td").each((C,I)=>{g.insertBefore(I,S[0])}),d++;else for(var b=a-1;b>=0;b--){var S=$(`[data-col=${b}]`,g);if(S.length>0){S[0].colSpan+=m;break}}})},e=(u,a)=>{var h=$(l).find(`${u} tr`),p=$(`${u} tr`,n.closest("table")).not(".col-indicator-rowgroup").not(".nodata"),m=0;$("th,td",h.eq(0)).each((d,b)=>{m+=b.colSpan}),p.each((d,b)=>{var g=$(b).find(`[data-col=${a}]`);if(g.length>0)$(h).eq(parseInt(b.sectionRowIndex%f(this,Gt).template.length)).find("th,td").each((S,C)=>{b.insertBefore($(C).clone()[0],g[0])});else for(var d=a-1;d>=0;d--){var g=$(`[data-col=${d}]`,b);if(g.length>0){g[0].colSpan+=m;break}}})},i=(u,a)=>{var h=$(l).find(`${u} tr`),p=f(this,Gt).template,m=0;$("th,td",h.eq(0)).each((b,g)=>{m+=g.colSpan});var d=0;p.each((b,g)=>{var S=$(g).find(`[data-col=${a}]`);if(S.length>0)$(h).eq(d).find("th,td").each((C,I)=>{g.insertBefore(I,S[0])}),d++;else for(var b=a-1;b>=0;b--){var S=$(`[data-col=${b}]`,g);if(S.length>0){S[0].colSpan+=m;break}}})};s("thead",t),s("tfoot",t),e("tbody",t),i("tbody",t),f(this,Gt).resetTemplate(),f(this,Gt).dataManager.viewRecords.touch()},this.___init()}}Gt=new WeakMap,ic=new WeakMap,Ia=new WeakMap,Na=new WeakMap;class rf{constructor(E){this.___owner=E,this.columns_BAK={getBindCol:(t,l)=>this.___getBindCol(t,l),insert:(t,l,c)=>this.___insertCol(t,l,c)},this.___getBindCol=(t,l)=>{l==null&&(l=!0);var c=[];return $(this.___owner.template).find("th,td").each((o,r)=>{r.dataset.bind==t&&c.push(parseInt(r.dataset.col))}),c.length>0?l?c[0]:c[c.length-1]:-1},this.___insertCol=(t,l,c)=>{if(!["string","number"].includes(typeof t))throw`invalid argument : "${t}"`;typeof t=="string"&&(t=this.___getBindCol(t));var o=s=>{var e=$(`.col-indicator[data-col=${s}]`,this.___owner.body);return e.length>0&&$(l).find("col").each((i,u)=>{var a=u.getAttribute("width")||100;const h=document.createElement("th");h.setAttribute("scope","col"),H.j.querySelectorAll(h).addClass("col-indicator"),$(h).html("<div></div>").insertBefore(e).css({width:a,"min-width":a})}),e},r=o(t);if(r.length<=0)throw"missing col";var n=(s,e)=>{r.closest("table").find(`${s} tr`).each((i,u)=>{if(s=="thead"&&u.rowIndex==0)return!0;var a=$(u).find(`th[data-col=${e}],td[data-col=${e}]`);if(a.length>0){var h=i%this.___owner.template.length;$(l).find(`${s} tr`).eq(h).find("th,td").each((m,d)=>{u.insertBefore(d,a[0])})}else for(var p=e-1;p>=0;p--){var a=$(u).find(`th[data-col=${p}],td[data-col=${p}]`);if(a.length>0){$(l).find(`${s} tr`).eq(0).find("th,td").each((d,b)=>{a[0].colSpan+=b.colSpan});break}}})};n("thead",t),n("tfoot",t),n("tbody.bindable",t),this.___owner.template.each((s,e)=>{var i=$(e).find(`th[data-col=${t}],td[data-col=${t}]`);if(i.length>0){var u=s%this.___owner.template.length;$(l).find("tbody.bindable tr").eq(u).find("th,td").each((h,p)=>{e.insertBefore(p,i[0])})}else for(var a=t-1;a>=0;a--){var i=$(e).find(`th[data-col=${a}],td[data-col=${a}]`);if(i.length>0){$(l).find("tbody.bindable tr").eq(0).find("th,td").each((p,m)=>{i[0].colSpan+=m.colSpan});break}}}),this.___owner.resetTemplate()},this.height=(t,l)=>{var c=$(".ng-table tbody.bindable tr",this.___owner.body);return c.each((o,r)=>{t==r.sectionRowIndex&&($("canvas.chart",r).css({height:l-4}),$(r).css({height:l}))}),l=0,c.each((o,r)=>{t==r.sectionRowIndex&&(l=Math.max($(r).height(),l))}),l=parseInt(l),c.each((o,r)=>{t==r.sectionRowIndex&&($(r).css({height:l}),$(r).height(l))}),l},this.getElement=(t,l,c)=>{var o;return $(`.ng-table ${t} th,.ng-table ${t} td`,this.___owner.body).each((r,n)=>{var s=$(n).offset();if(c>=s.left&&c<=s.left+$(n).width()&&l==n.closest("tr").sectionRowIndex)return o=n,!1}),o},this.getElements=(t,l)=>{var c=[];return $(`.ng-table ${t} th,.ng-table ${t} td`,this.___owner.body).each((o,r)=>{var n=$(r).offset();l>=n.left&&l<=n.left+$(r).width()&&c.push(r)}),c},this.mergeCell=(t,l,c,o)=>{t=Math.min(t,l),l=Math.max(t,l),c=Math.min(c,o),o=Math.max(c,o);for(var r=c;r<=o;r++)$(".ng-table tbody.bindable",this.___owner.body).rowspan(r,t,l);$(".ng-table tbody.bindable",this.___owner.body).colspan(t,c,o)},this.prev=t=>{var l=t.closest("tr");if(l){var c=l.closest("tbody")?"tbody.bindable":l.closest("thead")?"thead":"tfoot",o=$(t).prev(t.tagName);if(o.length<=0){var r=!!t.closest(".ng-container-right"),n=!!t.closest(".ng-container-body");n?o=$(".ng-container-left > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:not(.dummy):last-child,td:not(.dummy):last-child"):r&&(o=$(".ng-container-body > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:not(.dummy):last-child,td:not(.dummy):last-child"))}return o}},this.next=t=>{var l=t.closest("tr");if(l){var c=l.closest("tbody")?"tbody.bindable":l.closest("thead")?"thead":"tfoot",o=$(t).next(t.tagName);if(o.length<=0){var r=!!t.closest(".ng-container-left"),n=!!t.closest(".ng-container-body");n?o=$(".ng-container-right > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:first-child,td:first-child"):r&&(o=$(".ng-container-body > table > "+c+" > tr",this.___owner.body).eq(l.sectionRowIndex).find("th:first-child,td:first-child"))}return o}},this.isFirst=t=>{var l=this.prev(t);return!l||l.length<=0},this.isLast=t=>{var l=this.next(t);return!l||l.length<=0}}get rows(){for(var E=this.___owner.body.querySelector(".ng-container-body .ng-table").rows,t=this.___owner.body.querySelector(".ng-container-left .ng-table").rows,l=this.___owner.body.querySelector(".ng-container-right .ng-table").rows,c=[],o=0;o<t.length;o++)c.push(t[o]);for(var o=0;o<E.length;o++)c.push(E[o]);for(var o=0;o<l.length;o++)c.push(l[o]);return c}}class sf extends Qs{constructor(){super();Y(this,bs);it(this,"dataRefresh",t=>{$(f(this,bs)).val(this.value),t||this.reset()})}connectedCallback(){if(this.shadowRoot.innerHTML=`
675
675
  <style>
676
676
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngTextArea.css";
677
677
  ${H.getCustomPath(this,"ngTextArea.css")}
678
678
  </style>
679
679
 
680
680
  <textarea ondragstart="return false"></textarea>
681
- `,super.connectedCallback(),!!this.owner){if(tt(this,bs,this.shadowRoot.querySelector("textarea")),this.owner.shadowRoot.querySelector("ng-textarea-detail")||$(this.owner.shadowRoot).append($("<ng-textarea-detail></ng-textarea-detail>")),!this.cell.getAttribute("onButtonClick")&&!this.getAttribute("onButtonClick")){const t=this.shadowRoot.querySelector("ng-expand-button");t&&$("button",t.shadowRoot).on("click",l=>{this.owner.shadowRoot.querySelector("ng-textarea-detail").popup(this.cell.dataset.row,this.cell.dataset.bind,$(f(this,bs)).val())})}$(this.cell).on("keydown",t=>{switch(t.target.tagName){case"TH":case"TD":["Enter"].includes(t.code)&&(f(this,bs).focus(),f(this,bs).select());break}}),f(this,bs).addEventListener("keydown",t=>{t.isComposing||t.keyCode===229||(["Escape"].includes(t.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown"].includes(t.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(t)))})}}}bs=new WeakMap;class of extends HTMLElement{constructor(){super();Y(this,Oa);Y(this,ja);Y(this,$a);Y(this,La);it(this,"popup",(t,l,c)=>{tt(this,ja,t),tt(this,$a,l),tt(this,La,c),$("textarea",this.shadowRoot).val(c),this.shadowRoot.querySelector("nx-dialog").showModal()});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Oa,this.getRootNode().host),this.shadowRoot.innerHTML=`
681
+ `,super.connectedCallback(),!!this.owner){if(tt(this,bs,this.shadowRoot.querySelector("textarea")),this.owner.shadowRoot.querySelector("ng-textarea-detail")||$(this.owner.shadowRoot).append($("<ng-textarea-detail></ng-textarea-detail>")),!this.cell.getAttribute("onButtonClick")&&!this.getAttribute("onButtonClick")){const t=this.shadowRoot.querySelector("ng-expand-button");t&&$("button",t.shadowRoot).on("click",l=>{this.owner.shadowRoot.querySelector("ng-textarea-detail").popup(this.cell.dataset.row,this.cell.dataset.bind,$(f(this,bs)).val())})}$(this.cell).on("keydown",t=>{switch(t.target.tagName){case"TH":case"TD":["Enter"].includes(t.code)&&(f(this,bs).focus(),f(this,bs).select());break}}),f(this,bs).addEventListener("keydown",t=>{t.isComposing||t.keyCode===229||(["Escape"].includes(t.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown"].includes(t.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(t)))})}}}bs=new WeakMap;class nf extends HTMLElement{constructor(){super();Y(this,Oa);Y(this,ja);Y(this,$a);Y(this,La);it(this,"popup",(t,l,c)=>{tt(this,ja,t),tt(this,$a,l),tt(this,La,c),$("textarea",this.shadowRoot).val(c),this.shadowRoot.querySelector("nx-dialog").showModal()});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Oa,this.getRootNode().host),this.shadowRoot.innerHTML=`
682
682
  <style>
683
683
  textarea {
684
684
  width: 100%;
@@ -698,7 +698,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
698
698
  <nx-dialog>
699
699
  <textarea></textarea>
700
700
  </nx-dialog>
701
- `,$(".reset",this.shadowRoot).on("click",t=>{$("textarea",this.shadowRoot).val(f(this,La))}),$(".apply",this.shadowRoot).on("click",t=>{f(this,Oa).data.setValue(f(this,ja),f(this,$a),$("textarea",this.shadowRoot).val()),this.shadowRoot.querySelector("dialog").close()})}}Oa=new WeakMap,ja=new WeakMap,$a=new WeakMap,La=new WeakMap,customElements.get("ng-textarea")||customElements.define("ng-textarea",nf),customElements.get("ng-textarea-detail")||customElements.define("ng-textarea-detail",of);class af extends _r{constructor(){super();Y(this,yi);Y(this,Pa);Y(this,Da);it(this,"dataRefresh",t=>{const l=this.value;for(var c="",o=1;o<l;o++)c+='<div class="ng-pad-item"></div>';f(this,Pa).innerHTML=c,f(this,Da).innerHTML=this.getDisplayText(),f(this,nc).call(this),t||this.reset(),$(".ng-icon",this.shadowRoot).off("click",f(this,Ba)),$(".ng-icon",this.shadowRoot).on("click",f(this,Ba))});Y(this,Ba,t=>{f(this,oc).call(this),H.j.querySelectorAll(t.target).removeClass("ng-expand-on").removeClass("ng-expand-off"),H.j.querySelectorAll(t.target).addClass(f(this,yi,$l)?"ng-expand-on":"ng-expand-off")});Y(this,nc,()=>{const t=this.row;if(isNaN(t))return;const l=f(this,cc).call(this,t),c=this.value,o=f(this,uc).call(this,t+1),r=f(this,qa).call(this,t);H.j.querySelectorAll(".ng-icon",this.shadowRoot).removeClass("ng-expand-on").removeClass("ng-expand-off").removeClass("ng-node").removeClass("ng-icon-up").removeClass("ng-icon-down").removeClass("ng-icon-none").addClass(l?f(this,yi,$l)?"ng-expand-on":"ng-expand-off":"ng-node");const n=H.j.querySelectorAll(".ng-icon",this.shadowRoot);t==0?r?n.addClass("ng-icon-none"):n.addClass("ng-icon-down"):r&&n.addClass("ng-icon-up");for(var s=$(".ng-pad-item",this.shadowRoot),e=f(this,Fa).call(this,t),i=s.length;e>=0;){i--;var u=f(this,qa).call(this,e);u&&s.eq(i).addClass("ng-pad-item-none"),e=f(this,Fa).call(this,e)}c<o?f(this,yi,$l)?H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-down"):H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-none"):H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-none")});Y(this,oc,()=>{f(this,ac).call(this,!f(this,yi,$l))});Y(this,ac,t=>{this.data.__ng._[H.ROW.EXPAND]=t,f(this,lc).call(this,t),this.owner.data.resetRecords(),this.owner.dataManager.viewRecords.reset()});Y(this,lc,t=>{var l=this.owner.data.getValidDataNF();const c=this.owner.data.findIndexNF_1(this.data.__ng._[H.ROW.INDEX]);if(!(c<0))for(var o=this.owner.fields.indexOf(this.cell.dataset.bind),r=this.value,n=this.owner.data.getRow(this.row),s=n.__ng._[H.ROW.EXPAND],e=c+1;e<l.length;e++){var i=l[e].v[o];if(i>n.v[o]?s=n.__ng._[H.ROW.EXPAND]:i<n.v[o]&&(s=null),i<=r)break;if(s==null)l[e].__ng._[H.ROW.COLLAPSE]=!t;else if(s&&t){l[e].__ng._[H.ROW.COLLAPSE]=!1;//!b;
701
+ `,$(".reset",this.shadowRoot).on("click",t=>{$("textarea",this.shadowRoot).val(f(this,La))}),$(".apply",this.shadowRoot).on("click",t=>{f(this,Oa).data.setValue(f(this,ja),f(this,$a),$("textarea",this.shadowRoot).val()),this.shadowRoot.querySelector("dialog").close()})}}Oa=new WeakMap,ja=new WeakMap,$a=new WeakMap,La=new WeakMap,customElements.get("ng-textarea")||customElements.define("ng-textarea",sf),customElements.get("ng-textarea-detail")||customElements.define("ng-textarea-detail",nf);class of extends _r{constructor(){super();Y(this,yi);Y(this,Pa);Y(this,Da);it(this,"dataRefresh",t=>{const l=this.value;for(var c="",o=1;o<l;o++)c+='<div class="ng-pad-item"></div>';f(this,Pa).innerHTML=c,f(this,Da).innerHTML=this.getDisplayText(),f(this,nc).call(this),t||this.reset(),$(".ng-icon",this.shadowRoot).off("click",f(this,Ba)),$(".ng-icon",this.shadowRoot).on("click",f(this,Ba))});Y(this,Ba,t=>{f(this,oc).call(this),H.j.querySelectorAll(t.target).removeClass("ng-expand-on").removeClass("ng-expand-off"),H.j.querySelectorAll(t.target).addClass(f(this,yi,$l)?"ng-expand-on":"ng-expand-off")});Y(this,nc,()=>{const t=this.row;if(isNaN(t))return;const l=f(this,cc).call(this,t),c=this.value,o=f(this,uc).call(this,t+1),r=f(this,qa).call(this,t);H.j.querySelectorAll(".ng-icon",this.shadowRoot).removeClass("ng-expand-on").removeClass("ng-expand-off").removeClass("ng-node").removeClass("ng-icon-up").removeClass("ng-icon-down").removeClass("ng-icon-none").addClass(l?f(this,yi,$l)?"ng-expand-on":"ng-expand-off":"ng-node");const n=H.j.querySelectorAll(".ng-icon",this.shadowRoot);t==0?r?n.addClass("ng-icon-none"):n.addClass("ng-icon-down"):r&&n.addClass("ng-icon-up");for(var s=$(".ng-pad-item",this.shadowRoot),e=f(this,Fa).call(this,t),i=s.length;e>=0;){i--;var u=f(this,qa).call(this,e);u&&s.eq(i).addClass("ng-pad-item-none"),e=f(this,Fa).call(this,e)}c<o?f(this,yi,$l)?H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-down"):H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-none"):H.j.querySelectorAll(".ng-line",this.shadowRoot).addClass("ng-line-none")});Y(this,oc,()=>{f(this,ac).call(this,!f(this,yi,$l))});Y(this,ac,t=>{this.data.__ng._[H.ROW.EXPAND]=t,f(this,lc).call(this,t),this.owner.data.resetRecords(),this.owner.dataManager.viewRecords.reset()});Y(this,lc,t=>{var l=this.owner.data.getValidDataNF();const c=this.owner.data.findIndexNF_1(this.data.__ng._[H.ROW.INDEX]);if(!(c<0))for(var o=this.owner.fields.indexOf(this.cell.dataset.bind),r=this.value,n=this.owner.data.getRow(this.row),s=n.__ng._[H.ROW.EXPAND],e=c+1;e<l.length;e++){var i=l[e].v[o];if(i>n.v[o]?s=n.__ng._[H.ROW.EXPAND]:i<n.v[o]&&(s=null),i<=r)break;if(s==null)l[e].__ng._[H.ROW.COLLAPSE]=!t;else if(s&&t){l[e].__ng._[H.ROW.COLLAPSE]=!1;//!b;
702
702
  }else if(s&&!t){l[e].__ng._[H.ROW.COLLAPSE]=!0;//!b;
703
703
  }else if(!s&&t){l[e].__ng._[H.ROW.COLLAPSE]=!0;//!b;
704
704
  }else if(!s&&!t){l[e].__ng._[H.ROW.COLLAPSE]=!0;//!b;
@@ -717,7 +717,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
717
717
  <div></div>
718
718
  <span class="text">${this.displayValue}</span>
719
719
  </div>
720
- `,super.connectedCallback(),tt(this,Pa,this.shadowRoot.querySelector("div.ng-pad")),tt(this,Da,this.shadowRoot.querySelector("span"))}get prevLevel(){var t=parseInt(this.closest("tr").sectionRowIndex/this.owner.template.length);if(!this.owner.dataManager.viewRecords)return-1;if(t!=0){var l=this.owner.data.getNF(t-1);return l[this.cell.dataset.bind]}else for(var c=parseInt(this.cell.dataset.row)-1;c>=0;c--){var o=this.owner.data.get(c);if(!o.__ng._[H.ROW.EXPAND])return o[this.cell.dataset.bind]}return-1}}Pa=new WeakMap,Da=new WeakMap,Ba=new WeakMap,yi=new WeakSet,$l=function(){return this.data.__ng._[H.ROW.EXPAND]},nc=new WeakMap,oc=new WeakMap,ac=new WeakMap,lc=new WeakMap,mu=new WeakMap,Fa=new WeakMap,qa=new WeakMap,hc=new WeakMap,cc=new WeakMap,uc=new WeakMap,customElements.get("ng-tree-item")||customElements.define("ng-tree-item",af);class lf{constructor(E){Y(this,yt);Y(this,Ke);Y(this,wr);Y(this,vi);Y(this,wi,[]);it(this,"init",()=>{tt(this,wr,{body:$(".ng-container-body",f(this,yt).body).height()||0,thead:$(".ng-container-body thead",f(this,yt).body).height()||0,tfoot:$(".ng-container-body tfoot",f(this,yt).body).height()||0}),!f(this,vi)&&($(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(f(this,wr).body),tt(this,vi,!0))});it(this,"redraw",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),f(this,yt).dataManager&&(tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,dc).call(this),f(this,En).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refresh())});it(this,"redrawV2",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,fc).call(this),f(this,En).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refreshV2()});it(this,"redrawV3",()=>{this.init(),tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,En).call(this)});Y(this,Ha,()=>{var E=0;return $(".ng-container-body tbody.fixed tr",f(this,yt).body).each((t,l)=>{l.data&&l.data.__ng&&(E+=f(this,yt).matrix.getHeight(l.data.__ng.height[parseInt(t%f(this,yt).template.length)]))}),E});Y(this,za,()=>{var E=f(this,Ha).call(this);const t=parseInt(f(this,Ke)*f(this,yt).template.length);return $(".ng-container-body tbody.bindable tr:not(.nodata)",f(this,yt).body).each((l,c)=>{E+=f(this,yt).matrix.getHeight(t+l)}),E});Y(this,Ua,()=>{const E=parseInt(f(this,yt).getAttribute("display-row-count"));if(f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple"))return 1;if([H.PAGINGTYPE.CLIENT,H.PAGINGTYPE.SERVER].includes(f(this,yt).paging.type))return f(this,yt).paging.linesPerPage;if(!isNaN(E))return f(this,Ke)+E>f(this,yt).data.count()&&(tt(this,Ke,E>=f(this,yt).data.count()?0:f(this,yt).data.count()-E),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke)),E;const t=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,Ha).call(this);for(var l=0,c=0;c<t;)c+=this.getRowHeight(f(this,Ke)+l++);if(f(this,Ke)+l>f(this,yt).data.count()){l=0,c=0;for(var o=f(this,yt).data.count()-1;o>=0&&c<t;o--)c+=this.getRowHeight(o),l++;c>t&&l--,tt(this,Ke,f(this,yt).data.count()-l),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke)}return l});Y(this,Va,()=>{var E=f(this,Ua).call(this),t=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not("tr.nodata").length/(f(this,yt).template.length||1);const l=f(this,yt).template.clone(),c=l.clone(),o=l.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const r=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-left")),n=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-right")),s=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-body"));for(var e=t;e<E;e++)l.each((u,a)=>{r.before(a.outerHTML)}),c.each((u,a)=>{n.before(a.outerHTML)}),o.each((u,a)=>{s.before(a.outerHTML)});return;var i;if(i.length>0)var t});Y(this,Wa,()=>{var E=Math.min(f(this,Ua).call(this),f(this,yt).data.count());$(".ng-container tbody.bindable tr:not(.nodata)",f(this,yt).body).each((t,l)=>{parseInt(l.sectionRowIndex/f(this,yt).template.length)>=E&&$(l).remove()}),f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{f(this,Ke)+parseInt(t.sectionRowIndex/f(this,yt).template.length)>=f(this,yt).data.count()&&$(t).remove()})});Y(this,dc,()=>{f(this,Va).call(this),f(this,Wa).call(this);var E=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,za).call(this);if(f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(E=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(E),f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple")){$("tr.nodata",f(this,yt).body).height(0);var E=47;$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata").each((l,c)=>{E+=$(c).height()}),$(f(this,yt).closest("dialog")).height(E)}});Y(this,fc,()=>{f(this,Va).call(this),f(this,Wa).call(this),f(this,yt).isLastPage});Y(this,pc,()=>{for(const E of f(this,wi))clearTimeout(E);tt(this,wi,[]),f(this,wi).push(setTimeout(()=>{tt(this,vi,!1);var E=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata"),t=$(".ng-container-left tbody.bindable tr",f(this,yt).body).not(".nodata"),l=$(".ng-container-right tbody.bindable tr",f(this,yt).body).not(".nodata");if(E.length>0){var c=parseInt(E[0].dataset.row*f(this,yt).template.length);E.each((r,n)=>{var s=f(this,yt).matrix.getHeight(c+r);$("canvas.chart",n).css({height:s-4}),$("canvas.chart",t.eq(r)).css({height:s-4}),$("canvas.chart",l.eq(r)).css({height:s-4}),$(n).css({height:s}).height(s),t.eq(r).css({height:s}).height(s),l.eq(r).css({height:s}).height(s)})}f(this,yt).cell.refresh(),$("ng-row-indicator",f(this,yt).body).each((r,n)=>{n.refresh()});var o=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,za).call(this);f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(o=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(o),f(this,yt).refreshBindRows(),f(this,yt).refreshData(),f(this,yt).paging.totalCount=f(this,yt).data.countNF(),f(this,yt).body.querySelector("ng-vscrollbar").refresh(),H.j.querySelectorAll(".ng-table tbody tr",f(this,yt).body).removeClass("hover"),H.j.querySelectorAll(f(this,yt)).removeClass("loading"),H.j.querySelectorAll("ng-filter-panel").removeClass("loading")},300)),f(this,wi).push(setTimeout(()=>{f(this,yt).refreshDataV2()}))});Y(this,En,()=>{var E=[];f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)").forEach(t=>{E.push(f(this,Ke)+parseInt(t.sectionRowIndex/f(this,yt).template.length))}),E=[...new Set(E)],f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{const l=parseInt(t.sectionRowIndex/f(this,yt).template.length);t.dataset.row=E[l],t.dataset.matrixRow=parseInt(E[l]*f(this,yt).template.length)+parseInt(t.sectionRowIndex%f(this,yt).template.length);for(const c of t.cells)c.dataset.row=t.dataset.row,c.dataset.matrixRow=t.dataset.matrixRow}),E.forEach(t=>{const l=f(this,yt).data.get(t);f(this,yt).body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${t}"]`).forEach(c=>{c.data=l})}),tt(this,Ke,parseInt(f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-of-type").getAttribute("data-row"))),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke),f(this,pc).call(this),f(this,yt).isFirstPage=f(this,Ke)==0,f(this,yt).isLastPage=E[E.length-1]==f(this,yt).data.count()-1});it(this,"getVisibleFirstRow",()=>{var E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-child");return parseInt(E.dataset.row)});it(this,"getVisibleLastRow",()=>{var E=f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)");return E.length>0?parseInt(E[E.length-1].dataset.row):-1});it(this,"getRowHeight",E=>{let t=0;for(var l=0;l<f(this,yt).template.length;l++)t+=f(this,yt).matrix.getHeight(parseInt(E*f(this,yt).template.length+l));return t});it(this,"getTranslateY",()=>{const E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable");return!E||!E.style||!E.style.transform?0:parseFloat(E.style.transform.replace("translateY(","").replace(")",""))});it(this,"getTotalSpace",()=>$(f(this,yt).body.querySelector(".ng-container-body")).height()-($(f(this,yt).body.querySelector(".ng-container-body thead")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tfoot")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tbody.fixed")).height()||0));it(this,"fitPage",()=>{const E=this.getVisibleLastRow(),t=this.getTotalSpace();if(E==f(this,yt).data.count()-1){for(var l=0,c=E;c>=0;c--)if(l+=this.getRowHeight(c),l>t){f(this,yt).scrollTo(c+1);break}}});it(this,"selectArea",(E,t,l,c)=>{const o=f(this,zs).call(this,E),r=f(this,zs).call(this,l),n=f(this,Us).call(this,t),s=f(this,Us).call(this,c),e=parseInt(o*f(this,yt).template.length),i=parseInt(r*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=o,o>=0&&r>=0?f(this,yt).selection.selectArea(e,n,i,s):this.clearSelection()});it(this,"selectRow",(E,t)=>{const l=f(this,zs).call(this,E),c=H.isNull(t)?l:f(this,zs).call(this,t),o=parseInt(l*f(this,yt).template.length),r=parseInt(c*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=l,l>=0&&c>=0?f(this,yt).selection.selectArea(o,f(this,yt).firstCol,r,f(this,yt).lastCol):this.clearSelection()});it(this,"selectCol",(E,t)=>{const l=f(this,Us).call(this,E),c=H.isNull(t)?l:f(this,Us).call(this,t),o=0,r=parseInt(f(this,yt).data.count()*f(this,yt).template.length-1);l>=0&&c>=0?f(this,yt).selection.selectArea(o,l,r,c):this.clearSelection()});it(this,"selectCell",(E,t,l)=>{const c=f(this,zs).call(this,E),o=f(this,Us).call(this,t),r=parseInt(c*f(this,yt).template.length)+H.nvl(l,0);f(this,yt).row.at=c,c>=0?f(this,yt).selection.selectArea(r,o,r,o):this.clearSelection()});Y(this,zs,E=>{if(typeof E=="number")return E;if(typeof E=="function")return f(this,yt).data.findIndex(E);throw`invalid ${E}`});Y(this,Us,E=>{if(typeof E=="number")return E;if(typeof E=="string"&&f(this,yt).fields.includes(E))return parseInt($(`[data-bind="${E}"]`,f(this,yt).template)[0].dataset.col);throw`invalid ${E}`});it(this,"moveTo",E=>{f(this,yt).scrollTo(E)});tt(this,yt,E),tt(this,vi,!1),this.init()}}yt=new WeakMap,Ke=new WeakMap,wr=new WeakMap,vi=new WeakMap,wi=new WeakMap,Ha=new WeakMap,za=new WeakMap,Ua=new WeakMap,Va=new WeakMap,Wa=new WeakMap,dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,En=new WeakMap,zs=new WeakMap,Us=new WeakMap;class hf{constructor(E){Y(this,Qe);Y(this,Vs);it(this,"initialize",()=>{tt(this,Vs,!1),f(this,Qe).data.clearFilter()});it(this,"isFiltering",()=>f(this,Vs));it(this,"on",E=>{tt(this,Vs,!0);const t=f(this,mc).call(this);f(this,Qe).body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach(l=>{var o,r;const c=(o=l.closest("tr"))==null?void 0:o.sectionRowIndex;if(c!==void 0&&c+l.rowSpan-1===t){const n=Array.from(f(this,Qe).activeTmpl.querySelectorAll(`[data-col="${l.dataset.col}"]`)).map(s=>s.dataset.bind?{colnm:s.dataset.bind,data:[]}:null).filter(Boolean);if(n.length>0){(r=l.querySelector("ng-filter-button"))==null||r.remove();const s=document.createElement("ng-filter-button");l.appendChild(s),s.filterOptions=n}}})});it(this,"off",()=>{tt(this,Vs,!1),f(this,Qe).body.querySelectorAll(".ng-table ng-filter-button").forEach(E=>{E.remove()})});it(this,"set",E=>{this.on();let t=Array.isArray(E)?Object.fromEntries(Object.keys(E[0]).map(l=>[l,[...new Set(E.map(c=>c[l]))]])):E;f(this,Qe).data.clearFilter(),Object.entries(t).forEach(([l,c])=>{const o=f(this,Qe).fields.indexOf(l);f(this,Qe).data.getValidData().some(r=>typeof r.v[o]=="number")&&(c=c.map(Number)),f(this,Qe).data.getValidData().filter(r=>c.nineBinarySearch(r.v[o]||"")<0).forEach(r=>{r.__ng.filtered=!0})}),f(this,Qe).data.refreshFilter(),f(this,Qe).shadowRoot.querySelectorAll("ng-filter-button").forEach(l=>{l.filterOptions.forEach(c=>{c.data=[]})}),Object.entries(t).forEach(([l,c])=>{f(this,Qe).shadowRoot.querySelectorAll("ng-filter-button").forEach(o=>{let r=o.filterOptions;r.forEach(n=>{n.colnm===l&&(n.data=c)}),o.filterOptions=r})}),f(this,Qe).scrollTo_V1(0),f(this,Qe).paging.reset()});Y(this,mc,(E="thead")=>[...f(this,Qe).body.querySelectorAll(`.ng-table ${E}`)].reduce((t,l)=>Math.max(l.rows.length-1,t),0));tt(this,Qe,E),tt(this,Vs,!1);const t=document.createElement("ng-filter-panel");t.style.display="none",f(this,Qe).shadowRoot.appendChild(t)}}Qe=new WeakMap,Vs=new WeakMap,mc=new WeakMap;class cf extends HTMLElement{constructor(){super();Y(this,Xa);Y(this,An);Y(this,Ya,t=>{var o;t.preventDefault(),t.stopPropagation();const l=f(this,Xa).shadowRoot.querySelector("ng-filter-panel"),c=(o=this.closest("th,td"))==null?void 0:o.dataset.col;l.col===c?l.close():l.open(this)})}connectedCallback(){tt(this,Xa,this.getRootNode().host),this.removeEventListener("click",f(this,Ya)),this.addEventListener("click",f(this,Ya))}get filterOptions(){return f(this,An)}set filterOptions(t){tt(this,An,t),this.classList.toggle("filtered",f(this,An).some(l=>l.data.length>0))}}Xa=new WeakMap,An=new WeakMap,Ya=new WeakMap;class uf extends HTMLElement{constructor(){super();Y(this,Mr);Y(this,Ga);Y(this,Ka);Y(this,gc,t=>{const l=this.shadowRoot.querySelector("nine-grid");this.classList.add("loading"),setTimeout(()=>{const[c,o,r,n]=["LVL","CHK","COLNM","DATA"].map(u=>l.fields.indexOf(u)),s=l.data.getValidDataNF().filter(u=>u.v[c]===2&&u.v[o]==="Y"),e=s.length>0?[...new Set(s.map(u=>u.v[r]))].map(u=>({colnm:u,data:[...new Set(l.data.getValidData().filter(a=>a.v[o]==="Y"&&a.v[r]===u).map(a=>a.v[n]||""))].sort()})):[];f(this,Ga).filterOptions=e;const i=Object.fromEntries([...f(this,Mr).body.querySelectorAll("ng-filter-button")].flatMap(u=>u.filterOptions).filter(u=>u.data.length>0).map(u=>[u.colnm,u.data]));f(this,Mr).filtering.set(i),this.classList.remove("loading"),this.style.display="none"})});Y(this,bc,t=>{this.style.display="none"});Y(this,yc,t=>{const l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK"),o=t.target.checked;l.data.getValidData().forEach(r=>{r.v[c]=o?"Y":"N"}),l.refreshData()});Y(this,vc,t=>{const l=this.shadowRoot.querySelector("nine-grid");l.classList.add("loading");const c=l.dataManager.rawRecords;c.forEach(s=>{s.__ng.filtered=!1});const o=t.target.value.toLowerCase(),[r,n]=["LVL","DATA"].map(s=>l.fields.indexOf(s));c.forEach(s=>{s.__ng.filtered=s.v[r]===2&&!String(s.v[n]||"").toLowerCase().includes(o)}),l.data.resetRecords(),clearTimeout(f(this,Ka)),tt(this,Ka,setTimeout(()=>{l.dataManager.viewRecords.reset(),l.dataManager.viewRecords.touch()},200))});it(this,"close",()=>{this.col=null,this.style.display="none"});it(this,"open",t=>{const l=t.closest("th,td"),{left:c}=t.getBoundingClientRect(),{left:o,width:r,top:n}=f(this,Mr).getBoundingClientRect(),{top:s,height:e}=l.getBoundingClientRect(),{width:i}=this.getBoundingClientRect();let u=Math.max(0,c-o);u=Math.min(u,r-i-5);const a=s+e-n;Object.assign(this.style,{left:`${u}px`,top:`${a}px`,display:"flex"}),this.classList.add("loading"),this.shadowRoot.querySelector("input[type=text]").value="",setTimeout(()=>{const h=f(this,Mr).data.getValidDataNF(),p=l.dataset.col;this.col=p,tt(this,Ga,t);const m=t.filterOptions.map((g,S)=>{const C=`<span class="group">${l.textContent}${t.filterOptions.length>1?` #${S+1} (${g.colnm})`:""}</span>`,I=f(this,Mr).activeTmpl.querySelector(`[data-col="${p}"][data-bind="${g.colnm}"]`),D=I==null?void 0:I.getAttribute("data-expr"),z=D?f(this,Mr).exprFunction(D):null,P=h.map(B=>{const F=f(this,Mr).fields.indexOf(g.colnm);return D?{v:B.v[F],v2:z(f(this,Mr).data.conv(B),B.__ng.rowidx,f(this,Mr).data)}:{v:B.v[F],v2:B.v[F]}});return[{LVL:1,CHK:"N",DATA2:C},...[...new Set(P.map(JSON.stringify))].map(JSON.parse).sort((B,F)=>(B.v2||"")>(F.v2||"")?1:(B.v2||"")<(F.v2||"")?-1:0).map(B=>({LVL:2,DATA:B.v,DATA2:B.v2||` <span class="empty">(empty)</span> ${B.v}`,COLNM:g.colnm,CHK:g.data.length===0||g.data.nineBinarySearch(B.v||"")>=0?"Y":"N"}))]}).flat(),d=this.shadowRoot.querySelector("nine-grid");d.fields.add(["DATA","DATA2","COLNM"]),d.data.set(m);const b=this.shadowRoot.querySelector("input[type=checkbox]");b.checked=d.data.getValidData().every(g=>!(g.LVL===2&&g.CHK!=="Y")),this.shadowRoot.querySelector("input").focus(),this.classList.remove("loading")})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Mr,this.getRootNode().host);const t=this.getRootNode().host.closest("nine-grid").getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
720
+ `,super.connectedCallback(),tt(this,Pa,this.shadowRoot.querySelector("div.ng-pad")),tt(this,Da,this.shadowRoot.querySelector("span"))}get prevLevel(){var t=parseInt(this.closest("tr").sectionRowIndex/this.owner.template.length);if(!this.owner.dataManager.viewRecords)return-1;if(t!=0){var l=this.owner.data.getNF(t-1);return l[this.cell.dataset.bind]}else for(var c=parseInt(this.cell.dataset.row)-1;c>=0;c--){var o=this.owner.data.get(c);if(!o.__ng._[H.ROW.EXPAND])return o[this.cell.dataset.bind]}return-1}}Pa=new WeakMap,Da=new WeakMap,Ba=new WeakMap,yi=new WeakSet,$l=function(){return this.data.__ng._[H.ROW.EXPAND]},nc=new WeakMap,oc=new WeakMap,ac=new WeakMap,lc=new WeakMap,mu=new WeakMap,Fa=new WeakMap,qa=new WeakMap,hc=new WeakMap,cc=new WeakMap,uc=new WeakMap,customElements.get("ng-tree-item")||customElements.define("ng-tree-item",of);class af{constructor(E){Y(this,yt);Y(this,Ke);Y(this,wr);Y(this,vi);Y(this,wi,[]);it(this,"init",()=>{tt(this,wr,{body:$(".ng-container-body",f(this,yt).body).height()||0,thead:$(".ng-container-body thead",f(this,yt).body).height()||0,tfoot:$(".ng-container-body tfoot",f(this,yt).body).height()||0}),!f(this,vi)&&($(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(f(this,wr).body),tt(this,vi,!0))});it(this,"redraw",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),f(this,yt).dataManager&&(tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,dc).call(this),f(this,En).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refresh())});it(this,"redrawV2",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,fc).call(this),f(this,En).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refreshV2()});it(this,"redrawV3",()=>{this.init(),tt(this,Ke,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,En).call(this)});Y(this,Ha,()=>{var E=0;return $(".ng-container-body tbody.fixed tr",f(this,yt).body).each((t,l)=>{l.data&&l.data.__ng&&(E+=f(this,yt).matrix.getHeight(l.data.__ng.height[parseInt(t%f(this,yt).template.length)]))}),E});Y(this,za,()=>{var E=f(this,Ha).call(this);const t=parseInt(f(this,Ke)*f(this,yt).template.length);return $(".ng-container-body tbody.bindable tr:not(.nodata)",f(this,yt).body).each((l,c)=>{E+=f(this,yt).matrix.getHeight(t+l)}),E});Y(this,Ua,()=>{const E=parseInt(f(this,yt).getAttribute("display-row-count"));if(f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple"))return 1;if([H.PAGINGTYPE.CLIENT,H.PAGINGTYPE.SERVER].includes(f(this,yt).paging.type))return f(this,yt).paging.linesPerPage;if(!isNaN(E))return f(this,Ke)+E>f(this,yt).data.count()&&(tt(this,Ke,E>=f(this,yt).data.count()?0:f(this,yt).data.count()-E),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke)),E;const t=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,Ha).call(this);for(var l=0,c=0;c<t;)c+=this.getRowHeight(f(this,Ke)+l++);if(f(this,Ke)+l>f(this,yt).data.count()){l=0,c=0;for(var o=f(this,yt).data.count()-1;o>=0&&c<t;o--)c+=this.getRowHeight(o),l++;c>t&&l--,tt(this,Ke,f(this,yt).data.count()-l),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke)}return l});Y(this,Va,()=>{var E=f(this,Ua).call(this),t=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not("tr.nodata").length/(f(this,yt).template.length||1);const l=f(this,yt).template.clone(),c=l.clone(),o=l.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const r=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-left")),n=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-right")),s=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-body"));for(var e=t;e<E;e++)l.each((u,a)=>{r.before(a.outerHTML)}),c.each((u,a)=>{n.before(a.outerHTML)}),o.each((u,a)=>{s.before(a.outerHTML)});return;var i;if(i.length>0)var t});Y(this,Wa,()=>{var E=Math.min(f(this,Ua).call(this),f(this,yt).data.count());$(".ng-container tbody.bindable tr:not(.nodata)",f(this,yt).body).each((t,l)=>{parseInt(l.sectionRowIndex/f(this,yt).template.length)>=E&&$(l).remove()}),f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{f(this,Ke)+parseInt(t.sectionRowIndex/f(this,yt).template.length)>=f(this,yt).data.count()&&$(t).remove()})});Y(this,dc,()=>{f(this,Va).call(this),f(this,Wa).call(this);var E=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,za).call(this);if(f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(E=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(E),f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple")){$("tr.nodata",f(this,yt).body).height(0);var E=47;$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata").each((l,c)=>{E+=$(c).height()}),$(f(this,yt).closest("dialog")).height(E)}});Y(this,fc,()=>{f(this,Va).call(this),f(this,Wa).call(this),f(this,yt).isLastPage});Y(this,pc,()=>{for(const E of f(this,wi))clearTimeout(E);tt(this,wi,[]),f(this,wi).push(setTimeout(()=>{tt(this,vi,!1);var E=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata"),t=$(".ng-container-left tbody.bindable tr",f(this,yt).body).not(".nodata"),l=$(".ng-container-right tbody.bindable tr",f(this,yt).body).not(".nodata");if(E.length>0){var c=parseInt(E[0].dataset.row*f(this,yt).template.length);E.each((r,n)=>{var s=f(this,yt).matrix.getHeight(c+r);$("canvas.chart",n).css({height:s-4}),$("canvas.chart",t.eq(r)).css({height:s-4}),$("canvas.chart",l.eq(r)).css({height:s-4}),$(n).css({height:s}).height(s),t.eq(r).css({height:s}).height(s),l.eq(r).css({height:s}).height(s)})}f(this,yt).cell.refresh(),$("ng-row-indicator",f(this,yt).body).each((r,n)=>{n.refresh()});var o=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,za).call(this);f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(o=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(o),f(this,yt).refreshBindRows(),f(this,yt).refreshData(),f(this,yt).paging.totalCount=f(this,yt).data.countNF(),f(this,yt).body.querySelector("ng-vscrollbar").refresh(),H.j.querySelectorAll(".ng-table tbody tr",f(this,yt).body).removeClass("hover"),H.j.querySelectorAll(f(this,yt)).removeClass("loading"),H.j.querySelectorAll("ng-filter-panel").removeClass("loading")},300)),f(this,wi).push(setTimeout(()=>{f(this,yt).refreshDataV2()}))});Y(this,En,()=>{var E=[];f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)").forEach(t=>{E.push(f(this,Ke)+parseInt(t.sectionRowIndex/f(this,yt).template.length))}),E=[...new Set(E)],f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{const l=parseInt(t.sectionRowIndex/f(this,yt).template.length);t.dataset.row=E[l],t.dataset.matrixRow=parseInt(E[l]*f(this,yt).template.length)+parseInt(t.sectionRowIndex%f(this,yt).template.length);for(const c of t.cells)c.dataset.row=t.dataset.row,c.dataset.matrixRow=t.dataset.matrixRow}),E.forEach(t=>{const l=f(this,yt).data.get(t);f(this,yt).body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${t}"]`).forEach(c=>{c.data=l})}),tt(this,Ke,parseInt(f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-of-type").getAttribute("data-row"))),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ke),f(this,pc).call(this),f(this,yt).isFirstPage=f(this,Ke)==0,f(this,yt).isLastPage=E[E.length-1]==f(this,yt).data.count()-1});it(this,"getVisibleFirstRow",()=>{var E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-child");return parseInt(E.dataset.row)});it(this,"getVisibleLastRow",()=>{var E=f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)");return E.length>0?parseInt(E[E.length-1].dataset.row):-1});it(this,"getRowHeight",E=>{let t=0;for(var l=0;l<f(this,yt).template.length;l++)t+=f(this,yt).matrix.getHeight(parseInt(E*f(this,yt).template.length+l));return t});it(this,"getTranslateY",()=>{const E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable");return!E||!E.style||!E.style.transform?0:parseFloat(E.style.transform.replace("translateY(","").replace(")",""))});it(this,"getTotalSpace",()=>$(f(this,yt).body.querySelector(".ng-container-body")).height()-($(f(this,yt).body.querySelector(".ng-container-body thead")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tfoot")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tbody.fixed")).height()||0));it(this,"fitPage",()=>{const E=this.getVisibleLastRow(),t=this.getTotalSpace();if(E==f(this,yt).data.count()-1){for(var l=0,c=E;c>=0;c--)if(l+=this.getRowHeight(c),l>t){f(this,yt).scrollTo(c+1);break}}});it(this,"selectArea",(E,t,l,c)=>{const o=f(this,zs).call(this,E),r=f(this,zs).call(this,l),n=f(this,Us).call(this,t),s=f(this,Us).call(this,c),e=parseInt(o*f(this,yt).template.length),i=parseInt(r*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=o,o>=0&&r>=0?f(this,yt).selection.selectArea(e,n,i,s):this.clearSelection()});it(this,"selectRow",(E,t)=>{const l=f(this,zs).call(this,E),c=H.isNull(t)?l:f(this,zs).call(this,t),o=parseInt(l*f(this,yt).template.length),r=parseInt(c*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=l,l>=0&&c>=0?f(this,yt).selection.selectArea(o,f(this,yt).firstCol,r,f(this,yt).lastCol):this.clearSelection()});it(this,"selectCol",(E,t)=>{const l=f(this,Us).call(this,E),c=H.isNull(t)?l:f(this,Us).call(this,t),o=0,r=parseInt(f(this,yt).data.count()*f(this,yt).template.length-1);l>=0&&c>=0?f(this,yt).selection.selectArea(o,l,r,c):this.clearSelection()});it(this,"selectCell",(E,t,l)=>{const c=f(this,zs).call(this,E),o=f(this,Us).call(this,t),r=parseInt(c*f(this,yt).template.length)+H.nvl(l,0);f(this,yt).row.at=c,c>=0?f(this,yt).selection.selectArea(r,o,r,o):this.clearSelection()});Y(this,zs,E=>{if(typeof E=="number")return E;if(typeof E=="function")return f(this,yt).data.findIndex(E);throw`invalid ${E}`});Y(this,Us,E=>{if(typeof E=="number")return E;if(typeof E=="string"&&f(this,yt).fields.includes(E))return parseInt($(`[data-bind="${E}"]`,f(this,yt).template)[0].dataset.col);throw`invalid ${E}`});it(this,"moveTo",E=>{f(this,yt).scrollTo(E)});tt(this,yt,E),tt(this,vi,!1),this.init()}}yt=new WeakMap,Ke=new WeakMap,wr=new WeakMap,vi=new WeakMap,wi=new WeakMap,Ha=new WeakMap,za=new WeakMap,Ua=new WeakMap,Va=new WeakMap,Wa=new WeakMap,dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,En=new WeakMap,zs=new WeakMap,Us=new WeakMap;class lf{constructor(E){Y(this,Qe);Y(this,Vs);it(this,"initialize",()=>{tt(this,Vs,!1),f(this,Qe).data.clearFilter()});it(this,"isFiltering",()=>f(this,Vs));it(this,"on",E=>{tt(this,Vs,!0);const t=f(this,mc).call(this);f(this,Qe).body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach(l=>{var o,r;const c=(o=l.closest("tr"))==null?void 0:o.sectionRowIndex;if(c!==void 0&&c+l.rowSpan-1===t){const n=Array.from(f(this,Qe).activeTmpl.querySelectorAll(`[data-col="${l.dataset.col}"]`)).map(s=>s.dataset.bind?{colnm:s.dataset.bind,data:[]}:null).filter(Boolean);if(n.length>0){(r=l.querySelector("ng-filter-button"))==null||r.remove();const s=document.createElement("ng-filter-button");l.appendChild(s),s.filterOptions=n}}})});it(this,"off",()=>{tt(this,Vs,!1),f(this,Qe).body.querySelectorAll(".ng-table ng-filter-button").forEach(E=>{E.remove()})});it(this,"set",E=>{this.on();let t=Array.isArray(E)?Object.fromEntries(Object.keys(E[0]).map(l=>[l,[...new Set(E.map(c=>c[l]))]])):E;f(this,Qe).data.clearFilter(),Object.entries(t).forEach(([l,c])=>{const o=f(this,Qe).fields.indexOf(l);f(this,Qe).data.getValidData().some(r=>typeof r.v[o]=="number")&&(c=c.map(Number)),f(this,Qe).data.getValidData().filter(r=>c.nineBinarySearch(r.v[o]||"")<0).forEach(r=>{r.__ng.filtered=!0})}),f(this,Qe).data.refreshFilter(),f(this,Qe).shadowRoot.querySelectorAll("ng-filter-button").forEach(l=>{l.filterOptions.forEach(c=>{c.data=[]})}),Object.entries(t).forEach(([l,c])=>{f(this,Qe).shadowRoot.querySelectorAll("ng-filter-button").forEach(o=>{let r=o.filterOptions;r.forEach(n=>{n.colnm===l&&(n.data=c)}),o.filterOptions=r})}),f(this,Qe).scrollTo_V1(0),f(this,Qe).paging.reset()});Y(this,mc,(E="thead")=>[...f(this,Qe).body.querySelectorAll(`.ng-table ${E}`)].reduce((t,l)=>Math.max(l.rows.length-1,t),0));tt(this,Qe,E),tt(this,Vs,!1);const t=document.createElement("ng-filter-panel");t.style.display="none",f(this,Qe).shadowRoot.appendChild(t)}}Qe=new WeakMap,Vs=new WeakMap,mc=new WeakMap;class hf extends HTMLElement{constructor(){super();Y(this,Xa);Y(this,An);Y(this,Ya,t=>{var o;t.preventDefault(),t.stopPropagation();const l=f(this,Xa).shadowRoot.querySelector("ng-filter-panel"),c=(o=this.closest("th,td"))==null?void 0:o.dataset.col;l.col===c?l.close():l.open(this)})}connectedCallback(){tt(this,Xa,this.getRootNode().host),this.removeEventListener("click",f(this,Ya)),this.addEventListener("click",f(this,Ya))}get filterOptions(){return f(this,An)}set filterOptions(t){tt(this,An,t),this.classList.toggle("filtered",f(this,An).some(l=>l.data.length>0))}}Xa=new WeakMap,An=new WeakMap,Ya=new WeakMap;class cf extends HTMLElement{constructor(){super();Y(this,Mr);Y(this,Ga);Y(this,Ka);Y(this,gc,t=>{const l=this.shadowRoot.querySelector("nine-grid");this.classList.add("loading"),setTimeout(()=>{const[c,o,r,n]=["LVL","CHK","COLNM","DATA"].map(u=>l.fields.indexOf(u)),s=l.data.getValidDataNF().filter(u=>u.v[c]===2&&u.v[o]==="Y"),e=s.length>0?[...new Set(s.map(u=>u.v[r]))].map(u=>({colnm:u,data:[...new Set(l.data.getValidData().filter(a=>a.v[o]==="Y"&&a.v[r]===u).map(a=>a.v[n]||""))].sort()})):[];f(this,Ga).filterOptions=e;const i=Object.fromEntries([...f(this,Mr).body.querySelectorAll("ng-filter-button")].flatMap(u=>u.filterOptions).filter(u=>u.data.length>0).map(u=>[u.colnm,u.data]));f(this,Mr).filtering.set(i),this.classList.remove("loading"),this.style.display="none"})});Y(this,bc,t=>{this.style.display="none"});Y(this,yc,t=>{const l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK"),o=t.target.checked;l.data.getValidData().forEach(r=>{r.v[c]=o?"Y":"N"}),l.refreshData()});Y(this,vc,t=>{const l=this.shadowRoot.querySelector("nine-grid");l.classList.add("loading");const c=l.dataManager.rawRecords;c.forEach(s=>{s.__ng.filtered=!1});const o=t.target.value.toLowerCase(),[r,n]=["LVL","DATA"].map(s=>l.fields.indexOf(s));c.forEach(s=>{s.__ng.filtered=s.v[r]===2&&!String(s.v[n]||"").toLowerCase().includes(o)}),l.data.resetRecords(),clearTimeout(f(this,Ka)),tt(this,Ka,setTimeout(()=>{l.dataManager.viewRecords.reset(),l.dataManager.viewRecords.touch()},200))});it(this,"close",()=>{this.col=null,this.style.display="none"});it(this,"open",t=>{const l=t.closest("th,td"),{left:c}=t.getBoundingClientRect(),{left:o,width:r,top:n}=f(this,Mr).getBoundingClientRect(),{top:s,height:e}=l.getBoundingClientRect(),{width:i}=this.getBoundingClientRect();let u=Math.max(0,c-o);u=Math.min(u,r-i-5);const a=s+e-n;Object.assign(this.style,{left:`${u}px`,top:`${a}px`,display:"flex"}),this.classList.add("loading"),this.shadowRoot.querySelector("input[type=text]").value="",setTimeout(()=>{const h=f(this,Mr).data.getValidDataNF(),p=l.dataset.col;this.col=p,tt(this,Ga,t);const m=t.filterOptions.map((g,S)=>{const C=`<span class="group">${l.textContent}${t.filterOptions.length>1?` #${S+1} (${g.colnm})`:""}</span>`,I=f(this,Mr).activeTmpl.querySelector(`[data-col="${p}"][data-bind="${g.colnm}"]`),D=I==null?void 0:I.getAttribute("data-expr"),z=D?f(this,Mr).exprFunction(D):null,P=h.map(B=>{const F=f(this,Mr).fields.indexOf(g.colnm);return D?{v:B.v[F],v2:z(f(this,Mr).data.conv(B),B.__ng.rowidx,f(this,Mr).data)}:{v:B.v[F],v2:B.v[F]}});return[{LVL:1,CHK:"N",DATA2:C},...[...new Set(P.map(JSON.stringify))].map(JSON.parse).sort((B,F)=>(B.v2||"")>(F.v2||"")?1:(B.v2||"")<(F.v2||"")?-1:0).map(B=>({LVL:2,DATA:B.v,DATA2:B.v2||` <span class="empty">(empty)</span> ${B.v}`,COLNM:g.colnm,CHK:g.data.length===0||g.data.nineBinarySearch(B.v||"")>=0?"Y":"N"}))]}).flat(),d=this.shadowRoot.querySelector("nine-grid");d.fields.add(["DATA","DATA2","COLNM"]),d.data.set(m);const b=this.shadowRoot.querySelector("input[type=checkbox]");b.checked=d.data.getValidData().every(g=>!(g.LVL===2&&g.CHK!=="Y")),this.shadowRoot.querySelector("input").focus(),this.classList.remove("loading")})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Mr,this.getRootNode().host);const t=this.getRootNode().host.closest("nine-grid").getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
721
721
  <style>
722
722
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngFilterPanel.css";
723
723
  ${H.getCustomPath(this,"ngFilterPanel.css")}
@@ -750,7 +750,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
750
750
  <button id="btnOk">OK</button>
751
751
  <button id="btnCancel">Cancel</button>
752
752
  </div>
753
- `,this.shadowRoot.querySelector("input[type=text]").addEventListener("input",f(this,vc)),this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change",f(this,yc)),this.shadowRoot.querySelector("#btnOk").addEventListener("click",f(this,gc)),this.shadowRoot.querySelector("#btnCancel").addEventListener("click",f(this,bc))}}Mr=new WeakMap,Ga=new WeakMap,Ka=new WeakMap,gc=new WeakMap,bc=new WeakMap,yc=new WeakMap,vc=new WeakMap,customElements.get("ng-filter-button")||customElements.define("ng-filter-button",cf),customElements.get("ng-filter-panel")||customElements.define("ng-filter-panel",uf);class Kn extends HTMLElement{constructor(){super();Y(this,Za,!1);Y(this,xi);Y(this,Ja);Y(this,Tn);Y(this,os);it(this,"export",()=>{const t=this.shadowRoot.querySelector("ng-export");t&&t.remove();const l=document.createElement("ng-export");this.shadowRoot.appendChild(l),setTimeout(()=>{l.exportExcel()})});it(this,"maximize",()=>{const t=this.shadowRoot.querySelector("ng-max-popup");t&&t.remove();const l=document.createElement("ng-max-popup");this.shadowRoot.appendChild(l),setTimeout(()=>{l.popup()})});it(this,"refreshData",t=>{if(t==null){var l=[];$(".ng-container-body tbody.bindable tr",this.body).not(".nodata").each((r,n)=>{l.push(this.dataManager.viewRecords.rawIndex+parseInt(n.sectionRowIndex/this.template.length))}),l=[...new Set(l)],l.forEach(r=>{const n=this.data.get(r);this.body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${r}"]`).forEach(s=>{s.data=n})});var c=[];$(".ng-container-body tbody.fixed tr",this.body).not(".nodata").each((r,n)=>{c.push({INDEX:n.data.__ng._[H.ROW.INDEX],ROW:n.dataset.row})}),c.forEach(r=>{const n=this.data.getNF(r.INDEX);this.body.querySelectorAll(`.ng-container tbody.fixed tr[data-row="${r.ROW}"]`).forEach(s=>{s.data=n})})}else{t=parseInt(t);const r=t<0?this.data.getNF(this.body.querySelector(`tbody.fixed tr[data-row="${t}"]`).dataset.index):this.data.get(t);this.body.querySelectorAll(`.ng-container tbody tr[data-row="${t}"]`).forEach(n=>{n.data=r})}(t==null?$(".ng-container tbody tr th,.ng-container tbody tr td",this.body):$(`.ng-container tbody tr[data-row=${t}] th,.ng-container tbody tr[data-row=${t}] td`,this.body)).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.dataset.row&&n.children[0].dataRefresh()}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.children[0].dataRefresh()})});it(this,"refreshDataV2",()=>{$(".ng-container tbody tr th,.ng-container tbody tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.dataset.row&&c.children[0].dataRefresh(!0)}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.children[0].dataRefresh(!0)})});Y(this,Qa,t=>{this.dataManager&&(this.data.clear(),this.dataManager.setDataSource(t),this.refresh(),this.paging&&this.paging.refresh(),this.scrollTo_V1(0))});it(this,"changeRayout",t=>{$(".ng-container-left",this.body).children().remove(),$(".ng-container-right",this.body).children().remove(),$(".ng-container-body",this.body).children().remove(),$(".ng-container-body",this.shadowRoot).append(f(this,os)[t]),f(this,rl).call(this),this.createTemplate(),f(this,tl).call(this),this.resetTemplate(),f(this,el).call(this),this.cell.resetEvent(),this.touchEvent.resetEvent(),f(this,xi).resetEvent(),f(this,Ja).resetEvent(),f(this,Tn)&&f(this,Tn).resetEvent(),this.sorting&&this.sorting.initialize(),this.filtering&&this.filtering.initialize(),this.pin&&this.pin.initialize(),this.data.initialize(),setTimeout(()=>{this.paging&&this.paging.refresh(),this.scrollTo_V1(0)})});Y(this,tl,()=>{this.elements={table:$(this.body.querySelector(".ng-container-body > table")),hscrollbar:$(this.body.querySelector("ng-hscrollbar")),vscrollbar:$(this.body.querySelector("ng-vscrollbar")),bodyLeft:$(this.body.querySelector(".ng-container-left")),bodyBody:$(this.body.querySelector(".ng-container-body")),bodyRight:$(this.body.querySelector(".ng-container-right"))},this.elements.table.show();var t=this.elements.table.clone();this.elements.bodyLeft.html(t.clone()),$("col,th,td",this.elements.bodyLeft).not("[fixed=left]").remove();var l=0;if($("col",this.elements.bodyLeft).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyLeft.css({width:l,"min-width":l}),this.elements.bodyRight.html(t.clone()),$("col,th,td",this.elements.bodyRight).not("[fixed=right]").remove(),l=0,$("col",this.elements.bodyRight).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyRight.css({width:l,"min-width":l}),this.elements.bodyBody.html(t.clone()),this.elements.bodyBody.find("[fixed=left]").remove(),this.elements.bodyBody.find("[fixed=right]").remove(),this.elements.bodyLeft.find("tbody tr").remove(),this.elements.bodyRight.find("tbody tr").remove(),this.elements.bodyBody.find("tbody tr").remove(),this.elements.bodyBody.find("table").width(0),$(".ng-container .ng-table tr.nodata",this.body).length<=0){var c='<tr class="nodata"></tr>';this.elements.bodyLeft.find("tbody.bindable").append(c),this.elements.bodyRight.find("tbody.bindable").append(c),this.elements.bodyBody.find("tbody.bindable").append(c)}});Y(this,wc,()=>{if(!this.template)return 0;var t=0;return this.template.each((l,c)=>{t+=$(c).height()}),t});Y(this,ys,()=>{const t=parseInt(this.getAttribute("display-row-count"));if(isNaN(t))return;const l=this.shadowRoot.querySelector("ng-head");l&&setTimeout(()=>{const c=parseInt(window.getComputedStyle(l).getPropertyValue("padding-bottom"),10);var o=($(l).height()||0)+($("ng-foot",this.shadowRoot).height()||0)+($(".ng-container-body thead",this.shadowRoot).height()||0)+($(".ng-container-body tfoot:visible",this.shadowRoot).height()||0)+($(".ng-container-bottom:visible",this.shadowRoot).height()||0)+c+(f(this,wc).call(this)||0)*t+3;$(this).height(o)})});Y(this,xc,()=>{if(f(this,Za))return;this.originFormat=this.outerHTML,this.uuid=H.randomUUID(),this.id||(this.id=this.uuid),$("table",this).each((r,n)=>{if($("colgroup",n).length==0){var s=0;$("tbody tr",n).eq(0).find("th,td").each((i,u)=>{s+=u.colSpan||1}),$(n).prepend("<colgroup></colgroup>");for(var e=Math.max(parseInt(($(n).width()-16)/s)-1,100),r=0;r<s;r++)$("colgroup",n).append(`<col width="${e}" />`)}n.querySelector("thead")||$("colgroup",n).after("<thead></thead>"),$("tbody th,tbody td",n).each((i,u)=>{u.innerHTML.trim()==""&&(u.innerHTML="<ng-renderer>")}),$("thead th,thead td,tfoot th,tfoot td",n).each((i,u)=>{u.dataset&&u.dataset.expr&&(u.innerHTML="<ng-renderer>"),u.getAttribute("title")||u.setAttribute("title",u.innerHTML)}),$("datalist_BAK",n).each((i,u)=>{if(u.parentNode.getAttribute("data-source"))return!0;const a=[];u.querySelectorAll("option").forEach(m=>{for(var d={},b=0;b<m.attributes.length;b++)d[m.attributes[b].name]=m.attributes[b].value;a.push(d)}),window[this.id]||(window[this.id]=this),window[this.id]["code"+i]=a;const h=u.closest("th,td");if(h){const m=h.getAttribute("key")||"key",d=h.getAttribute("value")||"value",b=h.getAttribute("multi-separator")||",";var p=`window["${this.id}"]["code${i}"]`;u.parentNode.setAttribute("data-source",p),h.dataset.expr=`ninegrid.binarySearchValue(${p}, "${m}", data["${h.dataset.bind}"].split("${b}"), "${d}")`}}),$(n).hide(),f(this,os).push(n),H.j.querySelectorAll(this).hasClass("simple")||f(this,kc).call(this,n)});const t=`
753
+ `,this.shadowRoot.querySelector("input[type=text]").addEventListener("input",f(this,vc)),this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change",f(this,yc)),this.shadowRoot.querySelector("#btnOk").addEventListener("click",f(this,gc)),this.shadowRoot.querySelector("#btnCancel").addEventListener("click",f(this,bc))}}Mr=new WeakMap,Ga=new WeakMap,Ka=new WeakMap,gc=new WeakMap,bc=new WeakMap,yc=new WeakMap,vc=new WeakMap,customElements.get("ng-filter-button")||customElements.define("ng-filter-button",hf),customElements.get("ng-filter-panel")||customElements.define("ng-filter-panel",cf);class Kn extends HTMLElement{constructor(){super();Y(this,Za,!1);Y(this,xi);Y(this,Ja);Y(this,Tn);Y(this,os);it(this,"export",()=>{const t=this.shadowRoot.querySelector("ng-export");t&&t.remove();const l=document.createElement("ng-export");this.shadowRoot.appendChild(l),setTimeout(()=>{l.exportExcel()})});it(this,"maximize",()=>{const t=this.shadowRoot.querySelector("ng-max-popup");t&&t.remove();const l=document.createElement("ng-max-popup");this.shadowRoot.appendChild(l),setTimeout(()=>{l.popup()})});it(this,"refreshData",t=>{if(t==null){var l=[];$(".ng-container-body tbody.bindable tr",this.body).not(".nodata").each((r,n)=>{l.push(this.dataManager.viewRecords.rawIndex+parseInt(n.sectionRowIndex/this.template.length))}),l=[...new Set(l)],l.forEach(r=>{const n=this.data.get(r);this.body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${r}"]`).forEach(s=>{s.data=n})});var c=[];$(".ng-container-body tbody.fixed tr",this.body).not(".nodata").each((r,n)=>{c.push({INDEX:n.data.__ng._[H.ROW.INDEX],ROW:n.dataset.row})}),c.forEach(r=>{const n=this.data.getNF(r.INDEX);this.body.querySelectorAll(`.ng-container tbody.fixed tr[data-row="${r.ROW}"]`).forEach(s=>{s.data=n})})}else{t=parseInt(t);const r=t<0?this.data.getNF(this.body.querySelector(`tbody.fixed tr[data-row="${t}"]`).dataset.index):this.data.get(t);this.body.querySelectorAll(`.ng-container tbody tr[data-row="${t}"]`).forEach(n=>{n.data=r})}(t==null?$(".ng-container tbody tr th,.ng-container tbody tr td",this.body):$(`.ng-container tbody tr[data-row=${t}] th,.ng-container tbody tr[data-row=${t}] td`,this.body)).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.dataset.row&&n.children[0].dataRefresh()}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.children[0].dataRefresh()})});it(this,"refreshDataV2",()=>{$(".ng-container tbody tr th,.ng-container tbody tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.dataset.row&&c.children[0].dataRefresh(!0)}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.children[0].dataRefresh(!0)})});Y(this,Qa,t=>{this.dataManager&&(this.data.clear(),this.dataManager.setDataSource(t),this.refresh(),this.paging&&this.paging.refresh(),this.scrollTo_V1(0))});it(this,"changeRayout",t=>{$(".ng-container-left",this.body).children().remove(),$(".ng-container-right",this.body).children().remove(),$(".ng-container-body",this.body).children().remove(),$(".ng-container-body",this.shadowRoot).append(f(this,os)[t]),f(this,rl).call(this),this.createTemplate(),f(this,tl).call(this),this.resetTemplate(),f(this,el).call(this),this.cell.resetEvent(),this.touchEvent.resetEvent(),f(this,xi).resetEvent(),f(this,Ja).resetEvent(),f(this,Tn)&&f(this,Tn).resetEvent(),this.sorting&&this.sorting.initialize(),this.filtering&&this.filtering.initialize(),this.pin&&this.pin.initialize(),this.data.initialize(),setTimeout(()=>{this.paging&&this.paging.refresh(),this.scrollTo_V1(0)})});Y(this,tl,()=>{this.elements={table:$(this.body.querySelector(".ng-container-body > table")),hscrollbar:$(this.body.querySelector("ng-hscrollbar")),vscrollbar:$(this.body.querySelector("ng-vscrollbar")),bodyLeft:$(this.body.querySelector(".ng-container-left")),bodyBody:$(this.body.querySelector(".ng-container-body")),bodyRight:$(this.body.querySelector(".ng-container-right"))},this.elements.table.show();var t=this.elements.table.clone();this.elements.bodyLeft.html(t.clone()),$("col,th,td",this.elements.bodyLeft).not("[fixed=left]").remove();var l=0;if($("col",this.elements.bodyLeft).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyLeft.css({width:l,"min-width":l}),this.elements.bodyRight.html(t.clone()),$("col,th,td",this.elements.bodyRight).not("[fixed=right]").remove(),l=0,$("col",this.elements.bodyRight).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyRight.css({width:l,"min-width":l}),this.elements.bodyBody.html(t.clone()),this.elements.bodyBody.find("[fixed=left]").remove(),this.elements.bodyBody.find("[fixed=right]").remove(),this.elements.bodyLeft.find("tbody tr").remove(),this.elements.bodyRight.find("tbody tr").remove(),this.elements.bodyBody.find("tbody tr").remove(),this.elements.bodyBody.find("table").width(0),$(".ng-container .ng-table tr.nodata",this.body).length<=0){var c='<tr class="nodata"></tr>';this.elements.bodyLeft.find("tbody.bindable").append(c),this.elements.bodyRight.find("tbody.bindable").append(c),this.elements.bodyBody.find("tbody.bindable").append(c)}});Y(this,wc,()=>{if(!this.template)return 0;var t=0;return this.template.each((l,c)=>{t+=$(c).height()}),t});Y(this,ys,()=>{const t=parseInt(this.getAttribute("display-row-count"));if(isNaN(t))return;const l=this.shadowRoot.querySelector("ng-head");l&&setTimeout(()=>{const c=parseInt(window.getComputedStyle(l).getPropertyValue("padding-bottom"),10);var o=($(l).height()||0)+($("ng-foot",this.shadowRoot).height()||0)+($(".ng-container-body thead",this.shadowRoot).height()||0)+($(".ng-container-body tfoot:visible",this.shadowRoot).height()||0)+($(".ng-container-bottom:visible",this.shadowRoot).height()||0)+c+(f(this,wc).call(this)||0)*t+3;$(this).height(o)})});Y(this,xc,()=>{if(f(this,Za))return;this.originFormat=this.outerHTML,this.uuid=H.randomUUID(),this.id||(this.id=this.uuid),$("table",this).each((r,n)=>{if($("colgroup",n).length==0){var s=0;$("tbody tr",n).eq(0).find("th,td").each((i,u)=>{s+=u.colSpan||1}),$(n).prepend("<colgroup></colgroup>");for(var e=Math.max(parseInt(($(n).width()-16)/s)-1,100),r=0;r<s;r++)$("colgroup",n).append(`<col width="${e}" />`)}n.querySelector("thead")||$("colgroup",n).after("<thead></thead>"),$("tbody th,tbody td",n).each((i,u)=>{u.innerHTML.trim()==""&&(u.innerHTML="<ng-renderer>")}),$("thead th,thead td,tfoot th,tfoot td",n).each((i,u)=>{u.dataset&&u.dataset.expr&&(u.innerHTML="<ng-renderer>"),u.getAttribute("title")||u.setAttribute("title",u.innerHTML)}),$("datalist_BAK",n).each((i,u)=>{if(u.parentNode.getAttribute("data-source"))return!0;const a=[];u.querySelectorAll("option").forEach(m=>{for(var d={},b=0;b<m.attributes.length;b++)d[m.attributes[b].name]=m.attributes[b].value;a.push(d)}),window[this.id]||(window[this.id]=this),window[this.id]["code"+i]=a;const h=u.closest("th,td");if(h){const m=h.getAttribute("key")||"key",d=h.getAttribute("value")||"value",b=h.getAttribute("multi-separator")||",";var p=`window["${this.id}"]["code${i}"]`;u.parentNode.setAttribute("data-source",p),h.dataset.expr=`ninegrid.binarySearchValue(${p}, "${m}", data["${h.dataset.bind}"].split("${b}"), "${d}")`}}),$(n).hide(),f(this,os).push(n),H.j.querySelectorAll(this).hasClass("simple")||f(this,kc).call(this,n)});const t=`
754
754
  <style>
755
755
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
756
756
  ${H.getCustomPath(this,"ninegrid.css")}
@@ -775,7 +775,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
775
775
  <div class='ng-etc2'></div>
776
776
  </div>
777
777
  <ng-foot></ng-foot>
778
- `;this.comboExpr=(r,n,s)=>{const e=s.querySelector("ng-combo");if(!e)return"";const i=e.getAttribute("code")||"code",u=e.getAttribute("codename")||"codename",a=e.getAttribute("multi-separator")||",";return H.binarySearchValue(e.dataSource,i,r[s.dataset.bind],u,a)};for(const r of f(this,os))$(H.j.querySelectorAll("tbody",r).addClass("bindable").elem()).before('<tbody class="fixed"></tbody>');$(this.shadowRoot).append(t),$(".ng-container-body",this.shadowRoot).append(f(this,os)[0]),this.body=this.shadowRoot.querySelector(".ng-body"),this.querySelectorAll("nx-buttons *").forEach(r=>{r.grid=this}),$(this.shadowRoot.querySelector("ng-head").shadowRoot.querySelector("ng-custom")).append(this.querySelectorAll("nx-buttons")),f(this,rl).call(this),this.createTemplate(),f(this,tl).call(this),this.resetTemplate(),f(this,_c).call(this);const l=this.shadowRoot.querySelector("ng-foot");this.paging=l.shadowRoot.querySelector("ng-paging"),this.layout=l.shadowRoot.querySelector("ng-layout"),this.layout&&this.layout.add(f(this,os)),new Uu(this),this.pin=new Zd(this),this.fields=new wd(this),this.cell=new Vu(this),this.touchEvent=new Xu(this),this.selection=new Wu(this),this.tables=new rf(this),this.dataManager=new ud(this),this.view=new lf(this),this.tableUtils=new sf(this),this.columns=new ed(this);for(var c in this.dataManager)this.dataManager[c]instanceof Function&&!["xxx"].includes(c)?this[c]=this.dataManager[c].bind(this):["data","row","tree"].includes(c)&&(this[c]=this.dataManager[c]);for(var c in this.tableUtils)["columns"].includes(c)&&(this[c]=this.tableUtils[c]);for(var c in this.cell)this.cell[c]instanceof Function&&!["refresh"].includes(c)||["xx"].includes(c)&&(this[c]=this.cell[c]);H.j.querySelectorAll(this).hasClass("simple")||(this.filtering=new hf(this)),!H.j.querySelectorAll(this).hasClass("combo")&&!H.j.querySelectorAll(this).hasClass("filter")&&$(this.shadowRoot).append($("<ng-combo-panel></ng-combo-panel").hide()),this.sorting=new ef(this),this.matrix=new Pd(this),tt(this,xi,new td(this)),tt(this,Ja,new Qu(this)),H.j.querySelectorAll(this).hasClass("simple")||tt(this,Tn,new Wd(this)),f(this,el).call(this),this.refresh(),this.body.querySelector(".ng-container-body .nodata")&&new ResizeObserver((r,n)=>{this.body.querySelector("ng-vscrollbar").refresh()}).observe(this.body.querySelector(".ng-container-body .nodata")),!H.j.querySelectorAll(this).hasClass("filter")&&!H.j.querySelectorAll(this).hasClass("combo")&&($(this.body).on("mousedown",r=>{this.shadowRoot.querySelectorAll("ng-combo-panel,ng-filter-panel,ng-context-menu-panel").forEach(n=>{$(n).is(":visible")&&$(n).hide()})}),$(this).on("click",r=>{r.target.shadowRoot.querySelectorAll("ng-info").forEach(n=>{n.close()})})),new ld(this),this.classList.contains("simple")||setTimeout(()=>{this.dispatchEvent(new CustomEvent(H.EVENT.LOAD,{bubbles:!0,detail:{}}))},100);const o=this.shadowRoot.querySelector("ng-head");o&&o.shadowRoot.querySelectorAll("nx-buttons button").forEach(r=>{r.addEventListener("click",n=>{const s=new CustomEvent(H.EVENT.BUTTON_CLICK,{bubbles:!0,detail:{target:r}});this.dispatchEvent(s)})}),tt(this,Za,!0)});Y(this,el,()=>{this.lastRowHidden=isNaN(parseInt(H.j.querySelectorAll(this).attr("display-row-count"))),this.paging||(this.paging={}),H.j.querySelectorAll(this).attr("col-indicator-type",H.j.querySelectorAll(this).attr("col-indicator-type")||H.COLINDICATORTYPE.COLLAPSE),H.j.querySelectorAll(this).attr("auto-fit-col",H.j.querySelectorAll(this).attr("auto-fit-col")||"false"),H.j.querySelectorAll(this).attr("col-resizable",H.j.querySelectorAll(this).attr("col-resizable")||"true"),H.j.querySelectorAll(this).attr("row-resizable",H.j.querySelectorAll(this).attr("row-resizable")||"false"),H.j.querySelectorAll(this).attr("col-movable",H.j.querySelectorAll(this).attr("col-movable")||"false"),H.j.querySelectorAll(this).attr("enable-fixed-col",H.j.querySelectorAll(this).attr("enable-fixed-col")||"false"),H.j.querySelectorAll(this).attr("show-title-bar",H.j.querySelectorAll(this).attr("show-title-bar")||"false"),H.j.querySelectorAll(this).attr("show-menu-icon",H.j.querySelectorAll(this).attr("show-menu-icon")||"false"),H.j.querySelectorAll(this).attr("show-status-bar",H.j.querySelectorAll(this).attr("show-status-bar")||"false"),H.j.querySelectorAll(this).attr("show-thead",H.j.querySelectorAll(this).attr("show-thead")||"true"),H.j.querySelectorAll(this).attr("show-tfoot",H.j.querySelectorAll(this).attr("show-tfoot")||"true"),H.j.querySelectorAll(this).attr("select-type",H.j.querySelectorAll(this).attr("select-type")||H.SELECTTYPE.CELL),H.j.querySelectorAll(this).attr("paging-type",H.j.querySelectorAll(this).attr("paging-type")||H.PAGINGTYPE.NONE),H.j.querySelectorAll(this).attr("paging-count",H.j.querySelectorAll(this).attr("paging-count")||H.PAGINGCOUNT.AUTO)});Y(this,_c,()=>{new ResizeObserver(l=>{this.view&&this.view.redraw(),this.refreshScroll(),this.refreshBindRows(),$("tbody.bindable tr:not([data-matrix-row])",this.body).not(".nodata").length>0&&this.dataManager.viewRecords.reset()}).observe(this);const t=new MutationObserver((l,c)=>{this.body.querySelector("ng-hscrollbar").refresh()});$("colgroup",this.body).each((l,c)=>{t.observe(c,{childList:!0,subtree:!0,attributeOldValue:!0})}),this.body.querySelector("ng-hscrollbar").refresh(),new ResizeObserver((l,c)=>{if(this.getAttribute("auto-fit-col")=="true"){let n=[];var o=0;$(".ng-container-body col",this.body).each((e,i)=>{n.push({col:i,width:Number(H.j.querySelectorAll(i).attr("width"))})}),n.forEach(e=>{o+=e.width});const s=$(".ng-container-body",this.body).width();s!=0&&n.forEach(e=>{var i=e.width*s/o;H.j.querySelectorAll(e.col).attr("width",i)})}this.body.querySelector("ng-hscrollbar").refresh();const r=this.shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");r&&r.resize(),f(this,ys).call(this)}).observe(this.body.querySelector(".ng-container-body"))});it(this,"createTemplate",()=>{this.template=$(".ng-container-body tbody.bindable tr:not(.nodata)",this.body).clone(),this.tmpl=this.body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)"),this.activeTmpl=this.body.querySelector(".ng-container-body tbody.bindable tr:not(.nodata)")});it(this,"resetTemplate",()=>{var t=0;["left","body","right"].forEach(o=>{$(`.ng-container-${o} colgroup col`,this.body).each((r,n)=>{n.dataset.col=t++})});var l=[];$(".col-indicator",this.body).each((o,r)=>{l.push({from:parseInt(r.dataset.col),to:o}),r.innerHTML=`<div>${H.num2ExcelCol(o)}</div>`}),this.template.find("th,td").each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)}),$(".ng-table th,.ng-table td",this.body).each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)});const c=this.shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");c&&($("th,td",c.currentTable).each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)}),$(".last",c.currentTable).each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")})),this.template.find(".last").each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")}),$(".last",this.body).each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")})});Y(this,as,(t,l)=>{var c=$(l+" tr",t),o=$(l+" th,"+l+" td",t),r=c.length,n=0;o.each((e,i)=>{n+=i.colSpan});var s=Array.from(Array(r),()=>Array(n).fill(null));c.each((e,i)=>{var u=i.sectionRowIndex,a=0;$(i).find("th,td").each((h,p)=>{for(var m=0;m<s[u].length;m++)if(s[u][m]==null){a=m;break}for(var m=0;m<p.rowSpan;m++)for(var d=0;d<p.colSpan;d++)try{s[u+m][a+d]=m==0&&d==0?"1":"0"}catch(g){console.error(g)}})}),c.each((e,i)=>{var u=i.sectionRowIndex;$(i).find("th,td").not(".dummy").each((a,h)=>{for(var p=0;p<s[u].length;p++)if(s[u][p]=="1"){h.dataset.col=p,s[u][p]="0";break}})})});Y(this,Sc,()=>{const t='<th data-col="@col" class="col-indicator" scope="col"><div>@text</div></th>';var l=this.body.querySelector(".ng-container-body > table > thead");if(!l||l.querySelector(".col-indicator-rowgroup"))return;const c=H.j.querySelectorAll(l.insertRow(0)).attr("role","row").addClass("col-indicator-rowgroup").elem();var o=0;$(".ng-container-body > table > tbody.bindable > tr",this.body).eq(0).find("th,td").each((n,s)=>{if(!H.j.querySelectorAll(s).hasClass("dummy"))for(var e=0;e<s.colSpan;e++)$(c).append(t.replace("@col",o).replace("@text",H.num2ExcelCol(o++)))});var r=[];$("colgroup col",this.body).each((n,s)=>{r.push({width:parseInt(H.j.querySelectorAll(s).attr("width")),background:H.j.querySelectorAll(s).attr("background-color")})}),$("thead .col-indicator",this.body).each((n,s)=>{if(!r[n])return!1;$(s).css({width:r[n].width,"min-width":r[n].width,"background-color":r[n].background,"border-top-color":r[n].background}),H.j.querySelectorAll(s).attr("background-color",r[n].background)})});Y(this,rl,()=>{var t=this.body.querySelector(".ng-container-body > table");if(t){t.querySelectorAll("tbody tr").forEach(c=>{c.style.height||(c.style.height="32px")});var l=t.querySelector("thead");l.length<=0&&$("<thead></thead>").appendTo(t),H.j.querySelectorAll(t).attr("role","table").addClass("ng-table"),H.j.querySelectorAll("tbody th,tbody td",t).attr("tabindex",0),H.j.querySelectorAll("thead,tbody,tfoot",t).attr("role","rowgroup"),H.j.querySelectorAll("tr",t).attr("role","row"),H.j.querySelectorAll("tbody > tr",t).attr("role","gridcell"),H.j.querySelectorAll("th,td",t).attr("scope","col"),f(this,as).call(this,$(t),"thead"),f(this,as).call(this,$(t),"tbody.bindable"),f(this,as).call(this,$(t),"tbody.fixed"),f(this,as).call(this,$(t),"tfoot"),f(this,Sc).call(this),t.querySelectorAll("col").forEach((c,o)=>{H.j.querySelectorAll(`[data-col="${o}"]`,t).attr("fixed",H.j.querySelectorAll(c).attr("fixed"))})}});Y(this,kc,t=>{f(this,as).call(this,t,"thead"),f(this,as).call(this,t,"tbody"),f(this,as).call(this,t,"tfoot"),$("colgroup col[fixed=left]",t).index($(".dummy[fixed=left]",t)),$("tr",t).each((l,c)=>{}),$("colgroup",t).prepend('<col width="0" fixed="left" class="first" />'),$("tr",t).each((l,c)=>{$(c).prepend('<td class="first"></td>')}),$("colgroup",t).append('<col width="0" fixed="right" class="last" />'),$("tr",t).each((l,c)=>{$(c).append('<td class="last"></td>')})});Y(this,sl,()=>{var t=[];return $("th,td",this.template).not(".dummy").not(".first").each((l,c)=>{c.querySelector("ng-row-indicator")||t.push(Number(c.dataset.col))}),t});it(this,"selectArea",(t,l,c,o)=>{const r=f(this,Ws).call(this,t),n=f(this,Ws).call(this,c),s=f(this,Xs).call(this,l),e=f(this,Xs).call(this,o),i=parseInt(r*this.template.length),u=parseInt(n*this.template.length)+this.template.length-1;this.row.at=r,r>=0&&n>=0?this.selection.selectArea(i,s,u,e):this.clearSelection()});it(this,"selectRow",(t,l)=>{const c=f(this,Ws).call(this,t),o=H.isNull(oRow2)?c:f(this,Ws).call(this,l),r=parseInt(c*this.template.length),n=parseInt(o*this.template.length)+this.template.length-1;this.row.at=c,c>=0&&o>=0?this.selection.selectArea(r,this.firstCol,n,this.lastCol):this.clearSelection()});it(this,"selectCol",(t,l)=>{const c=f(this,Xs).call(this,t),o=H.isNull(l)?c:f(this,Xs).call(this,l),r=0,n=parseInt(this.data.count()*this.template.length-1);c>=0&&o>=0?this.selection.selectArea(r,c,n,o):this.clearSelection()});it(this,"selectCell",(t,l,c)=>{const o=f(this,Ws).call(this,t),r=f(this,Xs).call(this,l),n=parseInt(o*this.template.length)+H.nvl(c,0);this.row.at=o,o>=0?this.selection.selectArea(n,r,n,r):this.clearSelection()});Y(this,Ws,t=>{if(typeof t=="number")return t;if(typeof t=="function")return this.data.findIndex(t);throw`invalid ${t}`});Y(this,Xs,t=>{if(typeof t=="number")return t;if(typeof t=="string"&&this.fields.includes(t))return parseInt($(`[data-bind="${t}"]`,this.template)[0].dataset.col);throw`invalid ${t}`});it(this,"scrollTo",t=>{this.row.at=t});it(this,"scrollBy",t=>this.dataManager.scrollTo_V1(this.dataManager.viewRecords.rawIndex+t));it(this,"scrollFirst",()=>{this.scrollTo(0)});it(this,"scrollLast",()=>{this.scrollTo(this.data.count()-1)});this.attachShadow({mode:"open"}),H.extendElementPrototype(),tt(this,os,[]),this.refreshBindRows=()=>{this.bindRows=[],this.bindMatrixRows=[],H.j.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)",this.body).elements.forEach(o=>{this.bindRows.push(parseInt(o.dataset.row)),this.bindMatrixRows.push(parseInt(o.dataset.matrixRow))}),this.bindRows=[...new Set(this.bindRows)],this.bindMatrixRows=[...new Set(this.bindMatrixRows)];var t=$(`.ng-container-body tr[data-row="${this.bindRows[this.bindRows.length-1]}"]`,this.body);if(t.length>0){var l=$(".ng-container-body",this.body);$("tfoot",l),t.eq(0).position().top;var c=0;t.each((o,r)=>{c+=$(r).height()})}},this.refresh=()=>{this.refreshScroll()},this.refreshScroll=()=>{},this.setCurrCell=t=>{this.currCell=t}}connectedCallback(){$(()=>{f(this,xc).call(this)}),document.addEventListener("DOMContentLoaded",t=>{}),$(document.body).on("mousedown",t=>{t.target.closest("ng-combo-panel")||$("ng-combo-panel").hide()})}disconnectedCallback(){}adoptedCallback(){}get currentRow(){return this.row.at}get dataSource(){return this.dataManager.rawRecords}set dataSource(t){this.dataManager?f(this,Qa).call(this,t):setTimeout(()=>{f(this,Qa).call(this,t)},300)}get layouts(){return f(this,os)}attributeChangedCallback(t,l,c){switch(t){case"lang":break;case"caption":const o=this.shadowRoot.querySelector("ng-head");o&&$("span:first-child",o.shadowRoot.querySelector("ng-title")).html(v);break;case"display-row-count":this.lastRowHidden=!!isNaN(parseInt(c));break;case"row-resizable":c=="true"?$(".row-resizer",this.shadowRoot).show():$(".row-resizer",this.shadowRoot).hide();break;case"col-indicator-type":H.j.querySelectorAll(".ng-table thead .col-indicator-rowgroup",this.body).removeClass(H.COLINDICATORTYPE.EXPAND).removeClass(H.COLINDICATORTYPE.COLLAPSE).addClass(c),f(this,ys).call(this);break;case"auto-fit-col":f(this,xi)&&f(this,xi).autoFit(c=="true"),f(this,ys).call(this);break;case"enable-fixed-col":c=="true"?H.j.querySelectorAll(this).addClass(t):H.j.querySelectorAll(this).removeClass(t);break;case"select-type":this.selection&&(this.selection.type=c);break;case"paging-type":this.paging&&(this.paging.type=c);break;case"paging-count":this.paging&&(this.paging.count=c);break;case"show-menu-icon":case"show-title-bar":const r=H.j.querySelectorAll(this).attr("show-title-bar")=="true",n=H.j.querySelectorAll(this).attr("show-menu-icon")=="true",s=this.shadowRoot.querySelector("ng-head");if(!s)break;const e=s.shadowRoot.querySelector("ng-menu");r?(H.j.querySelectorAll(s).addClass("expand"),$(s.shadowRoot).children().not("style").show(),n||H.j.querySelectorAll(e).hide()):n?H.j.querySelectorAll(s).removeClass("expand").show():H.j.querySelectorAll(s).hide(),f(this,ys).call(this);break;case"show-tfoot":$("tfoot",this.body).css({visibility:c=="true"?"unset":"collapse"}),f(this,ys).call(this);break;case"show-status-bar":c=="true"?H.j.querySelectorAll("ng-foot",this.shadowRoot).addClass("expand"):H.j.querySelectorAll("ng-foot",this.shadowRoot).removeClass("expand"),f(this,ys).call(this);break}}get firstCol(){return Math.min.apply(null,f(this,sl).call(this))}get lastCol(){return Math.max.apply(null,f(this,sl).call(this))}}Za=new WeakMap,xi=new WeakMap,Ja=new WeakMap,Tn=new WeakMap,os=new WeakMap,Qa=new WeakMap,tl=new WeakMap,wc=new WeakMap,ys=new WeakMap,xc=new WeakMap,el=new WeakMap,_c=new WeakMap,as=new WeakMap,Sc=new WeakMap,rl=new WeakMap,kc=new WeakMap,sl=new WeakMap,Ws=new WeakMap,Xs=new WeakMap,it(Kn,"observedAttributes",["lang","caption","display-row-count","row-resizable","col-indicator-type","auto-fit-col","enable-fixed-col","select-type","paging-type","paging-count","show-menu-icon","show-title-bar","show-tfoot","show-status-bar"]),customElements.get("nine-grid")||customElements.define("nine-grid",Kn);class df extends Kn{constructor(){super()}connectedCallback(){super.connectedCallback()}}customElements.get("ng-source")||customElements.define("ng-source",df);class ff extends HTMLElement{constructor(){super();Y(this,vs);it(this,"showModal",()=>{this.querySelector("dialog").showModal()});it(this,"close",()=>{$(".head",this).off("mousedown",f(this,il)),$(".head",this).off("touchstart",f(this,ol)),$(document).off("mouseup",f(this,nl)),$(document).off("touchend",f(this,al)),$(document).off("mousemove",f(this,Rn)),$(document).off("touchmove",f(this,Mn)),this.querySelector("dialog").close()});Y(this,Cc,()=>{$(".close",this).on("click",t=>{H.j.querySelectorAll("dialog",this).addClass("out"),setTimeout(()=>{this.close()},300)}),$(".close2",this).on("click",t=>{this.close()}),$(".head",this).on("mousedown",f(this,il)),$(".head",this).on("touchstart",f(this,ol)),$(document).on("mouseup",f(this,nl)),$(document).on("touchend",f(this,al))});Y(this,il,t=>{if(!t.target.closest("buttons")&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,vs,{x:t.clientX-l.x,y:t.clientY-l.y}),$(document).on("mousemove",f(this,Rn))}});Y(this,Rn,t=>{$(this.querySelector("dialog")).offset({left:t.pageX-f(this,vs).x,top:t.pageY-f(this,vs).y})});Y(this,nl,t=>{$(document).off("mousemove",f(this,Rn))});Y(this,ol,t=>{if(!t.target.closest("buttons")){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,vs,{x:t.changedTouches[0].pageX-l.x,y:t.changedTouches[0].pageY-l.y}),$(document).on("touchmove",f(this,Mn))}});Y(this,Mn,t=>{$(this.querySelector("dialog")).offset({left:t.changedTouches[0].pageX-f(this,vs).x,top:t.changedTouches[0].pageY-f(this,vs).y})});Y(this,al,t=>{$(document).off("touchmove",f(this,Mn))})}connectedCallback(){const t=this.innerHTML,l=this.getAttribute("css-file"),c=l?`@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/${l}";`:"",o=l?H.getCustomPath(this,l):"";this.innerHTML=`
778
+ `;this.comboExpr=(r,n,s)=>{const e=s.querySelector("ng-combo");if(!e)return"";const i=e.getAttribute("code")||"code",u=e.getAttribute("codename")||"codename",a=e.getAttribute("multi-separator")||",";return H.binarySearchValue(e.dataSource,i,r[s.dataset.bind],u,a)};for(const r of f(this,os))$(H.j.querySelectorAll("tbody",r).addClass("bindable").elem()).before('<tbody class="fixed"></tbody>');$(this.shadowRoot).append(t),$(".ng-container-body",this.shadowRoot).append(f(this,os)[0]),this.body=this.shadowRoot.querySelector(".ng-body"),this.querySelectorAll("nx-buttons *").forEach(r=>{r.grid=this}),$(this.shadowRoot.querySelector("ng-head").shadowRoot.querySelector("ng-custom")).append(this.querySelectorAll("nx-buttons")),f(this,rl).call(this),this.createTemplate(),f(this,tl).call(this),this.resetTemplate(),f(this,_c).call(this);const l=this.shadowRoot.querySelector("ng-foot");this.paging=l.shadowRoot.querySelector("ng-paging"),this.layout=l.shadowRoot.querySelector("ng-layout"),this.layout&&this.layout.add(f(this,os)),new Uu(this),this.pin=new Kd(this),this.fields=new vd(this),this.cell=new Vu(this),this.touchEvent=new Xu(this),this.selection=new Wu(this),this.tables=new ef(this),this.dataManager=new cd(this),this.view=new af(this),this.tableUtils=new rf(this),this.columns=new ed(this);for(var c in this.dataManager)this.dataManager[c]instanceof Function&&!["xxx"].includes(c)?this[c]=this.dataManager[c].bind(this):["data","row","tree"].includes(c)&&(this[c]=this.dataManager[c]);for(var c in this.tableUtils)["columns"].includes(c)&&(this[c]=this.tableUtils[c]);for(var c in this.cell)this.cell[c]instanceof Function&&!["refresh"].includes(c)||["xx"].includes(c)&&(this[c]=this.cell[c]);H.j.querySelectorAll(this).hasClass("simple")||(this.filtering=new lf(this)),!H.j.querySelectorAll(this).hasClass("combo")&&!H.j.querySelectorAll(this).hasClass("filter")&&$(this.shadowRoot).append($("<ng-combo-panel></ng-combo-panel").hide()),this.sorting=new tf(this),this.matrix=new Ld(this),tt(this,xi,new td(this)),tt(this,Ja,new Qu(this)),H.j.querySelectorAll(this).hasClass("simple")||tt(this,Tn,new Vd(this)),f(this,el).call(this),this.refresh(),this.body.querySelector(".ng-container-body .nodata")&&new ResizeObserver((r,n)=>{this.body.querySelector("ng-vscrollbar").refresh()}).observe(this.body.querySelector(".ng-container-body .nodata")),!H.j.querySelectorAll(this).hasClass("filter")&&!H.j.querySelectorAll(this).hasClass("combo")&&($(this.body).on("mousedown",r=>{this.shadowRoot.querySelectorAll("ng-combo-panel,ng-filter-panel,ng-context-menu-panel").forEach(n=>{$(n).is(":visible")&&$(n).hide()})}),$(this).on("click",r=>{r.target.shadowRoot.querySelectorAll("ng-info").forEach(n=>{n.close()})})),new ad(this),this.classList.contains("simple")||setTimeout(()=>{this.dispatchEvent(new CustomEvent(H.EVENT.LOAD,{bubbles:!0,detail:{}}))},100);const o=this.shadowRoot.querySelector("ng-head");o&&o.shadowRoot.querySelectorAll("nx-buttons button").forEach(r=>{r.addEventListener("click",n=>{const s=new CustomEvent(H.EVENT.BUTTON_CLICK,{bubbles:!0,detail:{target:r}});this.dispatchEvent(s)})}),tt(this,Za,!0)});Y(this,el,()=>{this.lastRowHidden=isNaN(parseInt(H.j.querySelectorAll(this).attr("display-row-count"))),this.paging||(this.paging={}),H.j.querySelectorAll(this).attr("col-indicator-type",H.j.querySelectorAll(this).attr("col-indicator-type")||H.COLINDICATORTYPE.COLLAPSE),H.j.querySelectorAll(this).attr("auto-fit-col",H.j.querySelectorAll(this).attr("auto-fit-col")||"false"),H.j.querySelectorAll(this).attr("col-resizable",H.j.querySelectorAll(this).attr("col-resizable")||"true"),H.j.querySelectorAll(this).attr("row-resizable",H.j.querySelectorAll(this).attr("row-resizable")||"false"),H.j.querySelectorAll(this).attr("col-movable",H.j.querySelectorAll(this).attr("col-movable")||"false"),H.j.querySelectorAll(this).attr("enable-fixed-col",H.j.querySelectorAll(this).attr("enable-fixed-col")||"false"),H.j.querySelectorAll(this).attr("show-title-bar",H.j.querySelectorAll(this).attr("show-title-bar")||"false"),H.j.querySelectorAll(this).attr("show-menu-icon",H.j.querySelectorAll(this).attr("show-menu-icon")||"false"),H.j.querySelectorAll(this).attr("show-status-bar",H.j.querySelectorAll(this).attr("show-status-bar")||"false"),H.j.querySelectorAll(this).attr("show-thead",H.j.querySelectorAll(this).attr("show-thead")||"true"),H.j.querySelectorAll(this).attr("show-tfoot",H.j.querySelectorAll(this).attr("show-tfoot")||"true"),H.j.querySelectorAll(this).attr("select-type",H.j.querySelectorAll(this).attr("select-type")||H.SELECTTYPE.CELL),H.j.querySelectorAll(this).attr("paging-type",H.j.querySelectorAll(this).attr("paging-type")||H.PAGINGTYPE.NONE),H.j.querySelectorAll(this).attr("paging-count",H.j.querySelectorAll(this).attr("paging-count")||H.PAGINGCOUNT.AUTO)});Y(this,_c,()=>{new ResizeObserver(l=>{this.view&&this.view.redraw(),this.refreshScroll(),this.refreshBindRows(),$("tbody.bindable tr:not([data-matrix-row])",this.body).not(".nodata").length>0&&this.dataManager.viewRecords.reset()}).observe(this);const t=new MutationObserver((l,c)=>{this.body.querySelector("ng-hscrollbar").refresh()});$("colgroup",this.body).each((l,c)=>{t.observe(c,{childList:!0,subtree:!0,attributeOldValue:!0})}),this.body.querySelector("ng-hscrollbar").refresh(),new ResizeObserver((l,c)=>{if(this.getAttribute("auto-fit-col")=="true"){let n=[];var o=0;$(".ng-container-body col",this.body).each((e,i)=>{n.push({col:i,width:Number(H.j.querySelectorAll(i).attr("width"))})}),n.forEach(e=>{o+=e.width});const s=$(".ng-container-body",this.body).width();s!=0&&n.forEach(e=>{var i=e.width*s/o;H.j.querySelectorAll(e.col).attr("width",i)})}this.body.querySelector("ng-hscrollbar").refresh();const r=this.shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");r&&r.resize(),f(this,ys).call(this)}).observe(this.body.querySelector(".ng-container-body"))});it(this,"createTemplate",()=>{this.template=$(".ng-container-body tbody.bindable tr:not(.nodata)",this.body).clone(),this.tmpl=this.body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)"),this.activeTmpl=this.body.querySelector(".ng-container-body tbody.bindable tr:not(.nodata)")});it(this,"resetTemplate",()=>{var t=0;["left","body","right"].forEach(o=>{$(`.ng-container-${o} colgroup col`,this.body).each((r,n)=>{n.dataset.col=t++})});var l=[];$(".col-indicator",this.body).each((o,r)=>{l.push({from:parseInt(r.dataset.col),to:o}),r.innerHTML=`<div>${H.num2ExcelCol(o)}</div>`}),this.template.find("th,td").each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)}),$(".ng-table th,.ng-table td",this.body).each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)});const c=this.shadowRoot.querySelector("ng-foot").shadowRoot.querySelector("ng-layout");c&&($("th,td",c.currentTable).each((o,r)=>{const n=l.findIndex(s=>s.from==r.dataset.col);n>=0&&(r.dataset.col=l[n].to)}),$(".last",c.currentTable).each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")})),this.template.find(".last").each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")}),$(".last",this.body).each((o,r)=>{H.j.querySelectorAll(r).addClass("dummy")})});Y(this,as,(t,l)=>{var c=$(l+" tr",t),o=$(l+" th,"+l+" td",t),r=c.length,n=0;o.each((e,i)=>{n+=i.colSpan});var s=Array.from(Array(r),()=>Array(n).fill(null));c.each((e,i)=>{var u=i.sectionRowIndex,a=0;$(i).find("th,td").each((h,p)=>{for(var m=0;m<s[u].length;m++)if(s[u][m]==null){a=m;break}for(var m=0;m<p.rowSpan;m++)for(var d=0;d<p.colSpan;d++)try{s[u+m][a+d]=m==0&&d==0?"1":"0"}catch(g){console.error(g)}})}),c.each((e,i)=>{var u=i.sectionRowIndex;$(i).find("th,td").not(".dummy").each((a,h)=>{for(var p=0;p<s[u].length;p++)if(s[u][p]=="1"){h.dataset.col=p,s[u][p]="0";break}})})});Y(this,Sc,()=>{const t='<th data-col="@col" class="col-indicator" scope="col"><div>@text</div></th>';var l=this.body.querySelector(".ng-container-body > table > thead");if(!l||l.querySelector(".col-indicator-rowgroup"))return;const c=H.j.querySelectorAll(l.insertRow(0)).attr("role","row").addClass("col-indicator-rowgroup").elem();var o=0;$(".ng-container-body > table > tbody.bindable > tr",this.body).eq(0).find("th,td").each((n,s)=>{if(!H.j.querySelectorAll(s).hasClass("dummy"))for(var e=0;e<s.colSpan;e++)$(c).append(t.replace("@col",o).replace("@text",H.num2ExcelCol(o++)))});var r=[];$("colgroup col",this.body).each((n,s)=>{r.push({width:parseInt(H.j.querySelectorAll(s).attr("width")),background:H.j.querySelectorAll(s).attr("background-color")})}),$("thead .col-indicator",this.body).each((n,s)=>{if(!r[n])return!1;$(s).css({width:r[n].width,"min-width":r[n].width,"background-color":r[n].background,"border-top-color":r[n].background}),H.j.querySelectorAll(s).attr("background-color",r[n].background)})});Y(this,rl,()=>{var t=this.body.querySelector(".ng-container-body > table");if(t){t.querySelectorAll("tbody tr").forEach(c=>{c.style.height||(c.style.height="32px")});var l=t.querySelector("thead");l.length<=0&&$("<thead></thead>").appendTo(t),H.j.querySelectorAll(t).attr("role","table").addClass("ng-table"),H.j.querySelectorAll("tbody th,tbody td",t).attr("tabindex",0),H.j.querySelectorAll("thead,tbody,tfoot",t).attr("role","rowgroup"),H.j.querySelectorAll("tr",t).attr("role","row"),H.j.querySelectorAll("tbody > tr",t).attr("role","gridcell"),H.j.querySelectorAll("th,td",t).attr("scope","col"),f(this,as).call(this,$(t),"thead"),f(this,as).call(this,$(t),"tbody.bindable"),f(this,as).call(this,$(t),"tbody.fixed"),f(this,as).call(this,$(t),"tfoot"),f(this,Sc).call(this),t.querySelectorAll("col").forEach((c,o)=>{H.j.querySelectorAll(`[data-col="${o}"]`,t).attr("fixed",H.j.querySelectorAll(c).attr("fixed"))})}});Y(this,kc,t=>{f(this,as).call(this,t,"thead"),f(this,as).call(this,t,"tbody"),f(this,as).call(this,t,"tfoot"),$("colgroup col[fixed=left]",t).index($(".dummy[fixed=left]",t)),$("tr",t).each((l,c)=>{}),$("colgroup",t).prepend('<col width="0" fixed="left" class="first" />'),$("tr",t).each((l,c)=>{$(c).prepend('<td class="first"></td>')}),$("colgroup",t).append('<col width="0" fixed="right" class="last" />'),$("tr",t).each((l,c)=>{$(c).append('<td class="last"></td>')})});Y(this,sl,()=>{var t=[];return $("th,td",this.template).not(".dummy").not(".first").each((l,c)=>{c.querySelector("ng-row-indicator")||t.push(Number(c.dataset.col))}),t});it(this,"selectArea",(t,l,c,o)=>{const r=f(this,Ws).call(this,t),n=f(this,Ws).call(this,c),s=f(this,Xs).call(this,l),e=f(this,Xs).call(this,o),i=parseInt(r*this.template.length),u=parseInt(n*this.template.length)+this.template.length-1;this.row.at=r,r>=0&&n>=0?this.selection.selectArea(i,s,u,e):this.clearSelection()});it(this,"selectRow",(t,l)=>{const c=f(this,Ws).call(this,t),o=H.isNull(oRow2)?c:f(this,Ws).call(this,l),r=parseInt(c*this.template.length),n=parseInt(o*this.template.length)+this.template.length-1;this.row.at=c,c>=0&&o>=0?this.selection.selectArea(r,this.firstCol,n,this.lastCol):this.clearSelection()});it(this,"selectCol",(t,l)=>{const c=f(this,Xs).call(this,t),o=H.isNull(l)?c:f(this,Xs).call(this,l),r=0,n=parseInt(this.data.count()*this.template.length-1);c>=0&&o>=0?this.selection.selectArea(r,c,n,o):this.clearSelection()});it(this,"selectCell",(t,l,c)=>{const o=f(this,Ws).call(this,t),r=f(this,Xs).call(this,l),n=parseInt(o*this.template.length)+H.nvl(c,0);this.row.at=o,o>=0?this.selection.selectArea(n,r,n,r):this.clearSelection()});Y(this,Ws,t=>{if(typeof t=="number")return t;if(typeof t=="function")return this.data.findIndex(t);throw`invalid ${t}`});Y(this,Xs,t=>{if(typeof t=="number")return t;if(typeof t=="string"&&this.fields.includes(t))return parseInt($(`[data-bind="${t}"]`,this.template)[0].dataset.col);throw`invalid ${t}`});it(this,"scrollTo",t=>{this.row.at=t});it(this,"scrollBy",t=>this.dataManager.scrollTo_V1(this.dataManager.viewRecords.rawIndex+t));it(this,"scrollFirst",()=>{this.scrollTo(0)});it(this,"scrollLast",()=>{this.scrollTo(this.data.count()-1)});this.attachShadow({mode:"open"}),H.extendElementPrototype(),tt(this,os,[]),this.refreshBindRows=()=>{this.bindRows=[],this.bindMatrixRows=[],H.j.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)",this.body).elements.forEach(o=>{this.bindRows.push(parseInt(o.dataset.row)),this.bindMatrixRows.push(parseInt(o.dataset.matrixRow))}),this.bindRows=[...new Set(this.bindRows)],this.bindMatrixRows=[...new Set(this.bindMatrixRows)];var t=$(`.ng-container-body tr[data-row="${this.bindRows[this.bindRows.length-1]}"]`,this.body);if(t.length>0){var l=$(".ng-container-body",this.body);$("tfoot",l),t.eq(0).position().top;var c=0;t.each((o,r)=>{c+=$(r).height()})}},this.refresh=()=>{this.refreshScroll()},this.refreshScroll=()=>{},this.setCurrCell=t=>{this.currCell=t}}connectedCallback(){$(()=>{f(this,xc).call(this)}),document.addEventListener("DOMContentLoaded",t=>{}),$(document.body).on("mousedown",t=>{t.target.closest("ng-combo-panel")||$("ng-combo-panel").hide()})}disconnectedCallback(){}adoptedCallback(){}get currentRow(){return this.row.at}get dataSource(){return this.dataManager.rawRecords}set dataSource(t){this.dataManager?f(this,Qa).call(this,t):setTimeout(()=>{f(this,Qa).call(this,t)},300)}get layouts(){return f(this,os)}attributeChangedCallback(t,l,c){switch(t){case"lang":break;case"caption":const o=this.shadowRoot.querySelector("ng-head");o&&$("span:first-child",o.shadowRoot.querySelector("ng-title")).html(v);break;case"display-row-count":this.lastRowHidden=!!isNaN(parseInt(c));break;case"row-resizable":c=="true"?$(".row-resizer",this.shadowRoot).show():$(".row-resizer",this.shadowRoot).hide();break;case"col-indicator-type":H.j.querySelectorAll(".ng-table thead .col-indicator-rowgroup",this.body).removeClass(H.COLINDICATORTYPE.EXPAND).removeClass(H.COLINDICATORTYPE.COLLAPSE).addClass(c),f(this,ys).call(this);break;case"auto-fit-col":f(this,xi)&&f(this,xi).autoFit(c=="true"),f(this,ys).call(this);break;case"enable-fixed-col":c=="true"?H.j.querySelectorAll(this).addClass(t):H.j.querySelectorAll(this).removeClass(t);break;case"select-type":this.selection&&(this.selection.type=c);break;case"paging-type":this.paging&&(this.paging.type=c);break;case"paging-count":this.paging&&(this.paging.count=c);break;case"show-menu-icon":case"show-title-bar":const r=H.j.querySelectorAll(this).attr("show-title-bar")=="true",n=H.j.querySelectorAll(this).attr("show-menu-icon")=="true",s=this.shadowRoot.querySelector("ng-head");if(!s)break;const e=s.shadowRoot.querySelector("ng-menu");r?(H.j.querySelectorAll(s).addClass("expand"),$(s.shadowRoot).children().not("style").show(),n||H.j.querySelectorAll(e).hide()):n?H.j.querySelectorAll(s).removeClass("expand").show():H.j.querySelectorAll(s).hide(),f(this,ys).call(this);break;case"show-tfoot":$("tfoot",this.body).css({visibility:c=="true"?"unset":"collapse"}),f(this,ys).call(this);break;case"show-status-bar":c=="true"?H.j.querySelectorAll("ng-foot",this.shadowRoot).addClass("expand"):H.j.querySelectorAll("ng-foot",this.shadowRoot).removeClass("expand"),f(this,ys).call(this);break}}get firstCol(){return Math.min.apply(null,f(this,sl).call(this))}get lastCol(){return Math.max.apply(null,f(this,sl).call(this))}}Za=new WeakMap,xi=new WeakMap,Ja=new WeakMap,Tn=new WeakMap,os=new WeakMap,Qa=new WeakMap,tl=new WeakMap,wc=new WeakMap,ys=new WeakMap,xc=new WeakMap,el=new WeakMap,_c=new WeakMap,as=new WeakMap,Sc=new WeakMap,rl=new WeakMap,kc=new WeakMap,sl=new WeakMap,Ws=new WeakMap,Xs=new WeakMap,it(Kn,"observedAttributes",["lang","caption","display-row-count","row-resizable","col-indicator-type","auto-fit-col","enable-fixed-col","select-type","paging-type","paging-count","show-menu-icon","show-title-bar","show-tfoot","show-status-bar"]),customElements.get("nine-grid")||customElements.define("nine-grid",Kn);class uf extends Kn{constructor(){super()}connectedCallback(){super.connectedCallback()}}customElements.get("ng-source")||customElements.define("ng-source",uf);class df extends HTMLElement{constructor(){super();Y(this,vs);it(this,"showModal",()=>{this.querySelector("dialog").showModal()});it(this,"close",()=>{$(".head",this).off("mousedown",f(this,il)),$(".head",this).off("touchstart",f(this,ol)),$(document).off("mouseup",f(this,nl)),$(document).off("touchend",f(this,al)),$(document).off("mousemove",f(this,Rn)),$(document).off("touchmove",f(this,Mn)),this.querySelector("dialog").close()});Y(this,Cc,()=>{$(".close",this).on("click",t=>{H.j.querySelectorAll("dialog",this).addClass("out"),setTimeout(()=>{this.close()},300)}),$(".close2",this).on("click",t=>{this.close()}),$(".head",this).on("mousedown",f(this,il)),$(".head",this).on("touchstart",f(this,ol)),$(document).on("mouseup",f(this,nl)),$(document).on("touchend",f(this,al))});Y(this,il,t=>{if(!t.target.closest("buttons")&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,vs,{x:t.clientX-l.x,y:t.clientY-l.y}),$(document).on("mousemove",f(this,Rn))}});Y(this,Rn,t=>{$(this.querySelector("dialog")).offset({left:t.pageX-f(this,vs).x,top:t.pageY-f(this,vs).y})});Y(this,nl,t=>{$(document).off("mousemove",f(this,Rn))});Y(this,ol,t=>{if(!t.target.closest("buttons")){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,vs,{x:t.changedTouches[0].pageX-l.x,y:t.changedTouches[0].pageY-l.y}),$(document).on("touchmove",f(this,Mn))}});Y(this,Mn,t=>{$(this.querySelector("dialog")).offset({left:t.changedTouches[0].pageX-f(this,vs).x,top:t.changedTouches[0].pageY-f(this,vs).y})});Y(this,al,t=>{$(document).off("touchmove",f(this,Mn))})}connectedCallback(){const t=this.innerHTML,l=this.getAttribute("css-file"),c=l?`@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/${l}";`:"",o=l?H.getCustomPath(this,l):"";this.innerHTML=`
779
779
  <style>
780
780
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxDialog.css";
781
781
  ${H.getCustomPath(this,"nxDialog.css")||""}
@@ -811,10 +811,10 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
811
811
  </div>
812
812
  </div>
813
813
  </dialog>
814
- `,$(".title",this).html("Details"),f(this,Cc).call(this)}}vs=new WeakMap,Cc=new WeakMap,il=new WeakMap,Rn=new WeakMap,nl=new WeakMap,ol=new WeakMap,Mn=new WeakMap,al=new WeakMap,customElements.get("nx-dialog")||customElements.define("nx-dialog",ff);class Eu extends HTMLElement{constructor(){super();Y(this,ll);Y(this,Ys);Y(this,hl);Y(this,In);Y(this,ws);Y(this,_i,[]);Y(this,Nn);it(this,"refresh",()=>{if(f(this,Ys)){if(f(this,Nn))f(this,Ys).innerHTML=i18next.t(f(this,Nn));else if(f(this,_i).length>0&&!H.isNull(f(this,In))){var t=f(this,_i).findIndex(l=>l[f(this,hl)]==H.global.locale);t<0&&(t=0),f(this,Ys).innerHTML=f(this,_i)[t][f(this,In)],$("datalist",this).remove(),$(this).append(f(this,ws))}}});Y(this,Ec,()=>{tt(this,ws,"<datalist>"),this.querySelectorAll("datalist option").forEach((c,o)=>{for(var r={},n=0;n<c.attributes.length;n++)r[c.attributes[n].name]=f(this,ll)?c.attributes[n].value:c.attributes[n].value.replaceAll("<","&lt;").replaceAll(">","&gt;"),o==0&&(["locale","lang","key","code"].includes(c.attributes[n].name)?tt(this,hl,c.attributes[n].name):tt(this,In,c.attributes[n].name));tt(this,ws,f(this,ws)+"<option");for(const s in r)tt(this,ws,f(this,ws)+` ${s}="${r[s]}"`);tt(this,ws,f(this,ws)+"></option>"),f(this,_i).push(r)}),tt(this,ws,f(this,ws)+"</datalist>");const t=this.innerHTML;this.innerHTML=`
814
+ `,$(".title",this).html("Details"),f(this,Cc).call(this)}}vs=new WeakMap,Cc=new WeakMap,il=new WeakMap,Rn=new WeakMap,nl=new WeakMap,ol=new WeakMap,Mn=new WeakMap,al=new WeakMap,customElements.get("nx-dialog")||customElements.define("nx-dialog",df);class Eu extends HTMLElement{constructor(){super();Y(this,ll);Y(this,Ys);Y(this,hl);Y(this,In);Y(this,ws);Y(this,_i,[]);Y(this,Nn);it(this,"refresh",()=>{if(f(this,Ys)){if(f(this,Nn))f(this,Ys).innerHTML=i18next.t(f(this,Nn));else if(f(this,_i).length>0&&!H.isNull(f(this,In))){var t=f(this,_i).findIndex(l=>l[f(this,hl)]==H.global.locale);t<0&&(t=0),f(this,Ys).innerHTML=f(this,_i)[t][f(this,In)],$("datalist",this).remove(),$(this).append(f(this,ws))}}});Y(this,Ec,()=>{tt(this,ws,"<datalist>"),this.querySelectorAll("datalist option").forEach((c,o)=>{for(var r={},n=0;n<c.attributes.length;n++)r[c.attributes[n].name]=f(this,ll)?c.attributes[n].value:c.attributes[n].value.replaceAll("<","&lt;").replaceAll(">","&gt;"),o==0&&(["locale","lang","key","code"].includes(c.attributes[n].name)?tt(this,hl,c.attributes[n].name):tt(this,In,c.attributes[n].name));tt(this,ws,f(this,ws)+"<option");for(const s in r)tt(this,ws,f(this,ws)+` ${s}="${r[s]}"`);tt(this,ws,f(this,ws)+"></option>"),f(this,_i).push(r)}),tt(this,ws,f(this,ws)+"</datalist>");const t=this.innerHTML;this.innerHTML=`
815
815
  <span>${t}</span>
816
816
  `,tt(this,Ys,this.querySelector("span"));for(var l=0;l<this.attributes.length;l++)f(this,Ys).setAttribute(this.attributes[l].name,this.attributes[l].value);this.refresh()})}connectedCallback(){tt(this,ll,this.getAttribute("enable-html")=="true"),tt(this,Nn,this.getAttribute("i18n")||this.getAttribute("label")||this.getAttribute("message")||this.getAttribute("text")),$(()=>{f(this,Ec).call(this)})}}ll=new WeakMap,Ys=new WeakMap,hl=new WeakMap,In=new WeakMap,ws=new WeakMap,_i=new WeakMap,Nn=new WeakMap,Ec=new WeakMap,it(Eu,"i18n",{convertArrayToJSON:t=>{let l={};for(const c of t){if(!c)continue;const o=c.indexOf("=");if(o<=0)continue;const r=c.substring(0,o).split("."),n=c.substring(o+1);let s=l;for(let e=0;e<r.length;e++)e===r.length-1?s[r[e]]=n:(s[r[e]]||(s[r[e]]={}),s=s[r[e]])}return l},updateContent:()=>{H.querySelectorAll("nx-i18n,nx-span").forEach(t=>{t.refresh&&t.refresh()}),H.querySelectorAll("nine-grid").forEach(t=>{t.refresh&&t.refreshData()})},addResourceBundle:t=>{console.log("********************",t);let l=Math.floor(t.length/2);for(var c=0;c<t.length&&!(c+1>=t.length);c+=2){const n=t[c],s=t[c+1];var o=new XMLHttpRequest;if(o.open("GET",s,!1),o.send(),o.status===200){var r=o.responseText;i18next.addResourceBundle(n,"translation",H.i18n.convertArrayToJSON(r.split(`
817
- `))),--l==0&&i18next.changeLanguage(H.global.locale)}}console.log("=========")}}),customElements.get("nx-i18n")||customElements.define("nx-i18n",Eu);class pf extends HTMLElement{constructor(){super();Y(this,On);Y(this,jn);Y(this,Ac,()=>{this.classList.remove("nx-collapse"),document.body.style.width=`calc(100% - ${f(this,jn)}px)`});Y(this,cl,()=>{this.classList.add("nx-collapse"),document.body.style.width=`calc(100% - ${f(this,On)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});this.attachShadow({mode:"open"})}connectedCallback(){Number(this.getAttribute("round")||8),this.getAttribute("fill"),this.getAttribute("stroke"),Number(this.getAttribute("stroke-width")||0),tt(this,On,Number(this.getAttribute("min-width")||75)),tt(this,jn,Number(this.getAttribute("max-width")||265));const t=this.getAttribute("head-button-color")||"#eee",l=document.createElement("template");l.innerHTML=`
817
+ `))),--l==0&&i18next.changeLanguage(H.global.locale)}}console.log("=========")}}),customElements.get("nx-i18n")||customElements.define("nx-i18n",Eu);class ff extends HTMLElement{constructor(){super();Y(this,On);Y(this,jn);Y(this,Ac,()=>{this.classList.remove("nx-collapse"),document.body.style.width=`calc(100% - ${f(this,jn)}px)`});Y(this,cl,()=>{this.classList.add("nx-collapse"),document.body.style.width=`calc(100% - ${f(this,On)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});this.attachShadow({mode:"open"})}connectedCallback(){Number(this.getAttribute("round")||8),this.getAttribute("fill"),this.getAttribute("stroke"),Number(this.getAttribute("stroke-width")||0),tt(this,On,Number(this.getAttribute("min-width")||75)),tt(this,jn,Number(this.getAttribute("max-width")||265));const t=this.getAttribute("head-button-color")||"#eee",l=document.createElement("template");l.innerHTML=`
818
818
  <style>
819
819
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSidebar.css";
820
820
  ${H.getCustomPath(this,"nxSidebar.css")}
@@ -1006,7 +1006,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1006
1006
  </div>
1007
1007
  </div>
1008
1008
  </div>
1009
- `,this.shadowRoot.appendChild(l.content.cloneNode(!0)),l.remove(),this.shadowRoot.querySelector(".nx-toggle-button:nth-of-type(1)").addEventListener("click",()=>{f(this,Ac).call(this)}),this.shadowRoot.querySelectorAll(".nx-toggle-button:nth-of-type(2), .nx-toggle-button:nth-of-type(3)").forEach(c=>{c.addEventListener("click",o=>{f(this,cl).call(this)})}),this.addEventListener("mouseover",c=>{this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-item").forEach(s=>{s.classList.remove("nx-collapse"),s.shadowRoot.querySelector('slot[name="item-content"]').assignedNodes({flatten:!0}).forEach(u=>{u.style.opacity=1})})}),this.addEventListener("mouseout",()=>{if(!this.classList.contains("nx-collapse"))return;this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(n=>n.nodeName==="UL")[0].querySelectorAll("nx-sidebar-item").forEach(n=>{n.classList.add("nx-collapse"),n.shadowRoot.querySelector('slot[name="item-content"]').assignedNodes({flatten:!0}).forEach(i=>{i.style.transition="opacity 0.5s ease-out",i.style.opacity=0})})}),this.addEventListener("mouseover",c=>{this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-menuitem").forEach(s=>{s.classList.remove("collapse")})}),this.addEventListener("mouseout",c=>{if(!this.classList.contains("nx-collapse"))return;this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-menuitem").forEach(s=>{s.classList.add("collapse")})}),document.body.style.float="right",document.body.style.transition="width 0.5s ease-in-out",f(this,cl).call(this)}}On=new WeakMap,jn=new WeakMap,Ac=new WeakMap,cl=new WeakMap;class mf extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.classList.add("collapse")}render(){this.getAttribute("icon-class"),this.shadowRoot.innerHTML=`
1009
+ `,this.shadowRoot.appendChild(l.content.cloneNode(!0)),l.remove(),this.shadowRoot.querySelector(".nx-toggle-button:nth-of-type(1)").addEventListener("click",()=>{f(this,Ac).call(this)}),this.shadowRoot.querySelectorAll(".nx-toggle-button:nth-of-type(2), .nx-toggle-button:nth-of-type(3)").forEach(c=>{c.addEventListener("click",o=>{f(this,cl).call(this)})}),this.addEventListener("mouseover",c=>{this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-item").forEach(s=>{s.classList.remove("nx-collapse"),s.shadowRoot.querySelector('slot[name="item-content"]').assignedNodes({flatten:!0}).forEach(u=>{u.style.opacity=1})})}),this.addEventListener("mouseout",()=>{if(!this.classList.contains("nx-collapse"))return;this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(n=>n.nodeName==="UL")[0].querySelectorAll("nx-sidebar-item").forEach(n=>{n.classList.add("nx-collapse"),n.shadowRoot.querySelector('slot[name="item-content"]').assignedNodes({flatten:!0}).forEach(i=>{i.style.transition="opacity 0.5s ease-out",i.style.opacity=0})})}),this.addEventListener("mouseover",c=>{this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-menuitem").forEach(s=>{s.classList.remove("collapse")})}),this.addEventListener("mouseout",c=>{if(!this.classList.contains("nx-collapse"))return;this.shadowRoot.querySelector('slot[name="nx-body-content"]').assignedNodes({flatten:!0}).filter(s=>s.nodeName==="UL")[0].querySelectorAll("nx-sidebar-menuitem").forEach(s=>{s.classList.add("collapse")})}),document.body.style.float="right",document.body.style.transition="width 0.5s ease-in-out",f(this,cl).call(this)}}On=new WeakMap,jn=new WeakMap,Ac=new WeakMap,cl=new WeakMap;class pf extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.classList.add("collapse")}render(){this.getAttribute("icon-class"),this.shadowRoot.innerHTML=`
1010
1010
  <style>
1011
1011
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSidebarItem.css";
1012
1012
  ${H.getCustomPath(this,"nxSidebarItem.css")}
@@ -1016,7 +1016,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1016
1016
  <slot name="nx-icon"></slot>
1017
1017
  <slot name="item-content"></slot>
1018
1018
  </li>
1019
- `}}class gf extends HTMLElement{constructor(){super();Y(this,ul);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,ul,this.getAttribute("type")||"item"),this.render(),this.classList.add("collapse"),this.classList.add(f(this,ul)),this.shadowRoot.querySelector(".menubar").addEventListener("click",t=>{this.dispatchEvent(new CustomEvent("item-click",{detail:{message:"Item clicked!"},bubbles:!0,composed:!0}))})}render(){const t=this.getAttribute("icon-class"),l=this.innerHTML.trim();this.shadowRoot.innerHTML=`
1019
+ `}}class mf extends HTMLElement{constructor(){super();Y(this,ul);this.attachShadow({mode:"open"})}connectedCallback(){tt(this,ul,this.getAttribute("type")||"item"),this.render(),this.classList.add("collapse"),this.classList.add(f(this,ul)),this.shadowRoot.querySelector(".menubar").addEventListener("click",t=>{this.dispatchEvent(new CustomEvent("item-click",{detail:{message:"Item clicked!"},bubbles:!0,composed:!0}))})}render(){const t=this.getAttribute("icon-class"),l=this.innerHTML.trim();this.shadowRoot.innerHTML=`
1020
1020
  <style>
1021
1021
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSidebarMenuitem.css";
1022
1022
  ${H.getCustomPath(this,"nxSidebarMenuitem.css")}
@@ -1029,7 +1029,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1029
1029
  </div>
1030
1030
  <div class="expand-icon"></div>
1031
1031
  </li>
1032
- `}}ul=new WeakMap,customElements.get("nx-sidebar-menuitem")||customElements.define("nx-sidebar-menuitem",gf),customElements.get("nx-sidebar-item")||customElements.define("nx-sidebar-item",mf),customElements.get("nx-sidebar")||customElements.define("nx-sidebar",pf);class bf extends HTMLElement{constructor(){super();Y(this,$n);Y(this,Ln);it(this,"expand",()=>{f(this,pl).call(this,"collapse"),document.body.style.width=`calc(100% - ${f(this,Ln)}px)`});it(this,"collapse",()=>{f(this,fl).call(this,"collapse"),document.body.style.width=`calc(100% - ${f(this,$n)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});Y(this,dl,t=>{const l=this.shadowRoot.querySelector("nx-side-menu-body");return l?l.shadowRoot.querySelectorAll(t):[]});Y(this,fl,t=>{this.classList.add(t),this.shadowRoot.querySelectorAll("nx-side-menu-head,nx-side-menu-foot,nx-side-menu-body,nx-side-menu-custom").forEach(l=>{l.classList.add(t)}),f(this,dl).call(this,"nx-side-menu-item").forEach(l=>{l.classList.add(t)})});Y(this,pl,t=>{this.classList.remove(t),this.shadowRoot.querySelectorAll("nx-side-menu-head,nx-side-menu-foot,nx-side-menu-body,nx-side-menu-custom").forEach(l=>{l.classList.remove(t)}),f(this,dl).call(this,"nx-side-menu-item").forEach(l=>{l.classList.remove(t)})});Y(this,Tc,()=>{const t=this.innerHTML.trim();this.innerHTML="",tt(this,$n,Number(this.getAttribute("min-width")||48)),tt(this,Ln,Number(this.getAttribute("max-width")||256)),this.shadowRoot.innerHTML=`
1032
+ `}}ul=new WeakMap,customElements.get("nx-sidebar-menuitem")||customElements.define("nx-sidebar-menuitem",mf),customElements.get("nx-sidebar-item")||customElements.define("nx-sidebar-item",pf),customElements.get("nx-sidebar")||customElements.define("nx-sidebar",ff);class gf extends HTMLElement{constructor(){super();Y(this,$n);Y(this,Ln);it(this,"expand",()=>{f(this,pl).call(this,"collapse"),document.body.style.width=`calc(100% - ${f(this,Ln)}px)`});it(this,"collapse",()=>{f(this,fl).call(this,"collapse"),document.body.style.width=`calc(100% - ${f(this,$n)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});Y(this,dl,t=>{const l=this.shadowRoot.querySelector("nx-side-menu-body");return l?l.shadowRoot.querySelectorAll(t):[]});Y(this,fl,t=>{this.classList.add(t),this.shadowRoot.querySelectorAll("nx-side-menu-head,nx-side-menu-foot,nx-side-menu-body,nx-side-menu-custom").forEach(l=>{l.classList.add(t)}),f(this,dl).call(this,"nx-side-menu-item").forEach(l=>{l.classList.add(t)})});Y(this,pl,t=>{this.classList.remove(t),this.shadowRoot.querySelectorAll("nx-side-menu-head,nx-side-menu-foot,nx-side-menu-body,nx-side-menu-custom").forEach(l=>{l.classList.remove(t)}),f(this,dl).call(this,"nx-side-menu-item").forEach(l=>{l.classList.remove(t)})});Y(this,Tc,()=>{const t=this.innerHTML.trim();this.innerHTML="",tt(this,$n,Number(this.getAttribute("min-width")||48)),tt(this,Ln,Number(this.getAttribute("max-width")||256)),this.shadowRoot.innerHTML=`
1033
1033
  <style>
1034
1034
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSideMenu.css";
1035
1035
  ${H.getCustomPath(this,"nxSideMenu.css")}
@@ -1044,7 +1044,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1044
1044
  </style>
1045
1045
 
1046
1046
  ${t}
1047
- `,this.addEventListener("mouseover",l=>{f(this,fl).call(this,"hover")}),this.addEventListener("mouseout",l=>{f(this,pl).call(this,"hover")}),document.body.style.float="right",document.body.style.transition="width 0.5s ease-in-out",this.collapse()});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Tc).call(this)).catch(t=>console.error(t)),setTimeout(()=>{if(!H.querySelector("nx-side-menu-item.active",this.shadowRoot)){const t=window.location.href,c=new URL(t).pathname,o=H.querySelector(`nx-side-menu-item[href="${c}"]`,this.shadowRoot);o&&o.classList.add("active")}},300)}}$n=new WeakMap,Ln=new WeakMap,dl=new WeakMap,fl=new WeakMap,pl=new WeakMap,Tc=new WeakMap;class yf extends HTMLElement{constructor(){super();Y(this,Mc);Y(this,Si);Y(this,Rc,()=>{Ue(this,Mc,Pu).call(this),tt(this,Si,this.shadowRoot.getRootNode().host.getRootNode().host),f(this,Si)&&(this.shadowRoot.querySelector(".icon:nth-of-type(1)").addEventListener("click",t=>{f(this,Si).expand()}),this.shadowRoot.querySelectorAll(".icon:nth-of-type(2),.icon:nth-of-type(3)").forEach(t=>{t.addEventListener("click",l=>{f(this,Si).collapse()})}))});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Rc).call(this)).catch(t=>console.error(t))}}Si=new WeakMap,Rc=new WeakMap,Mc=new WeakSet,Pu=function(){const t=this.getAttribute("icon-color")||"#eee",l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1047
+ `,this.addEventListener("mouseover",l=>{f(this,fl).call(this,"hover")}),this.addEventListener("mouseout",l=>{f(this,pl).call(this,"hover")}),document.body.style.float="right",document.body.style.transition="width 0.5s ease-in-out",this.collapse()});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Tc).call(this)).catch(t=>console.error(t)),setTimeout(()=>{if(!H.querySelector("nx-side-menu-item.active",this.shadowRoot)){const t=window.location.href,c=new URL(t).pathname,o=H.querySelector(`nx-side-menu-item[href="${c}"]`,this.shadowRoot);o&&o.classList.add("active")}},300)}}$n=new WeakMap,Ln=new WeakMap,dl=new WeakMap,fl=new WeakMap,pl=new WeakMap,Tc=new WeakMap;class bf extends HTMLElement{constructor(){super();Y(this,Mc);Y(this,Si);Y(this,Rc,()=>{Ue(this,Mc,Pu).call(this),tt(this,Si,this.shadowRoot.getRootNode().host.getRootNode().host),f(this,Si)&&(this.shadowRoot.querySelector(".icon:nth-of-type(1)").addEventListener("click",t=>{f(this,Si).expand()}),this.shadowRoot.querySelectorAll(".icon:nth-of-type(2),.icon:nth-of-type(3)").forEach(t=>{t.addEventListener("click",l=>{f(this,Si).collapse()})}))});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Rc).call(this)).catch(t=>console.error(t))}}Si=new WeakMap,Rc=new WeakMap,Mc=new WeakSet,Pu=function(){const t=this.getAttribute("icon-color")||"#eee",l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1048
1048
  <style>
1049
1049
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSideMenuHead.css";
1050
1050
  ${H.getCustomPath(this,"nxSideMenuHead.css")}
@@ -1069,7 +1069,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1069
1069
  <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>
1070
1070
  </svg>
1071
1071
  </div>
1072
- `};class vf extends HTMLElement{constructor(){super();Y(this,Nc);Y(this,Pn);Y(this,Ic,()=>{tt(this,Pn,this.closest("nx-side-menu")),Ue(this,Nc,Du).call(this),this.shadowRoot.querySelector(".icon:nth-of-type(1)").addEventListener("click",()=>{f(this,Pn).expand()}),this.shadowRoot.querySelectorAll(".icon:nth-of-type(2), .icon:nth-of-type(3)").forEach(t=>{t.addEventListener("click",l=>{f(this,Pn).collapse()})})});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Ic).call(this)).catch(t=>console.error(t))}}Pn=new WeakMap,Ic=new WeakMap,Nc=new WeakSet,Du=function(){const t=this.getAttribute("icon-color")||"#eee",l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1072
+ `};class yf extends HTMLElement{constructor(){super();Y(this,Nc);Y(this,Pn);Y(this,Ic,()=>{tt(this,Pn,this.closest("nx-side-menu")),Ue(this,Nc,Du).call(this),this.shadowRoot.querySelector(".icon:nth-of-type(1)").addEventListener("click",()=>{f(this,Pn).expand()}),this.shadowRoot.querySelectorAll(".icon:nth-of-type(2), .icon:nth-of-type(3)").forEach(t=>{t.addEventListener("click",l=>{f(this,Pn).collapse()})})});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,Ic).call(this)).catch(t=>console.error(t))}}Pn=new WeakMap,Ic=new WeakMap,Nc=new WeakSet,Du=function(){const t=this.getAttribute("icon-color")||"#eee",l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1073
1073
  <style>
1074
1074
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSideMenuFoot.css";
1075
1075
  ${H.getCustomPath(this,"nxSideMenuFoot.css")}
@@ -1094,7 +1094,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1094
1094
  <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>
1095
1095
  </svg>
1096
1096
  </div>
1097
- `};class wf extends HTMLElement{constructor(){super();Y(this,Oc);Y(this,jc,()=>{this.render(),tt(this,Oc,this.shadowRoot.getRootNode().host.getRootNode().host)});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,jc).call(this)).catch(t=>console.error(t))}render(){const t=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1097
+ `};class vf extends HTMLElement{constructor(){super();Y(this,Oc);Y(this,jc,()=>{this.render(),tt(this,Oc,this.shadowRoot.getRootNode().host.getRootNode().host)});this.attachShadow({mode:"open"})}connectedCallback(){H.waitForInnerHTML(this).then(()=>f(this,jc).call(this)).catch(t=>console.error(t))}render(){const t=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1098
1098
  <style>
1099
1099
  :host {
1100
1100
  height: 100%;
@@ -1115,7 +1115,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1115
1115
  <ul class="side-menu-body">
1116
1116
  ${t}
1117
1117
  </ul>
1118
- `}}Oc=new WeakMap,jc=new WeakMap;class xf extends HTMLElement{constructor(){super();Y(this,ml);Y(this,Dn);Y(this,gl);Y(this,$c,()=>{tt(this,gl,this.getAttribute("type")||"item"),this.render(),tt(this,Dn,H.closest("nx-side-menu",this)),this.classList.toggle("expand"),this.classList.add("collapse"),this.classList.add(f(this,gl)),this.addEventListener("click",l=>{H.querySelectorAll("nx-side-menu-item",f(this,Dn)).forEach(c=>{c.classList.remove("active")}),l.target.classList.add("active"),H.closest("nx-side-menu",this).dispatchEvent(new CustomEvent("side-menu-click",{detail:{target:this},bubbles:!0,composed:!0}))});const t=this.shadowRoot.querySelector(".expand-icon");t&&t.addEventListener("click",l=>{l.stopPropagation();const c=H.querySelectorAll("nx-side-menu-item",f(this,Dn)),o=Array.from(c).findIndex(n=>n.uuid===this.uuid),r=[];if(o!==-1)for(let n=o+1;n<c.length;n++){const s=c[n];if(s.classList.contains("group"))break;r.push(s)}this.classList.toggle("expand"),this.classList.contains("expand")?r.forEach(n=>{n.classList.remove("hide")}):r.forEach(n=>{n.classList.add("hide")})})});this.attachShadow({mode:"open"}),this.test=this.innerText.trim(),this.uuid=H.randomUUID()}connectedCallback(){tt(this,ml,this.getAttribute("title")),H.waitForInnerHTML(this).then(()=>f(this,$c).call(this)).catch(t=>console.error(t))}get caption(){return f(this,ml)}render(){const t=this.getAttribute("icon-class"),l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1118
+ `}}Oc=new WeakMap,jc=new WeakMap;class wf extends HTMLElement{constructor(){super();Y(this,ml);Y(this,Dn);Y(this,gl);Y(this,$c,()=>{tt(this,gl,this.getAttribute("type")||"item"),this.render(),tt(this,Dn,H.closest("nx-side-menu",this)),this.classList.toggle("expand"),this.classList.add("collapse"),this.classList.add(f(this,gl)),this.addEventListener("click",l=>{H.querySelectorAll("nx-side-menu-item",f(this,Dn)).forEach(c=>{c.classList.remove("active")}),l.target.classList.add("active"),H.closest("nx-side-menu",this).dispatchEvent(new CustomEvent("side-menu-click",{detail:{target:this},bubbles:!0,composed:!0}))});const t=this.shadowRoot.querySelector(".expand-icon");t&&t.addEventListener("click",l=>{l.stopPropagation();const c=H.querySelectorAll("nx-side-menu-item",f(this,Dn)),o=Array.from(c).findIndex(n=>n.uuid===this.uuid),r=[];if(o!==-1)for(let n=o+1;n<c.length;n++){const s=c[n];if(s.classList.contains("group"))break;r.push(s)}this.classList.toggle("expand"),this.classList.contains("expand")?r.forEach(n=>{n.classList.remove("hide")}):r.forEach(n=>{n.classList.add("hide")})})});this.attachShadow({mode:"open"}),this.test=this.innerText.trim(),this.uuid=H.randomUUID()}connectedCallback(){tt(this,ml,this.getAttribute("title")),H.waitForInnerHTML(this).then(()=>f(this,$c).call(this)).catch(t=>console.error(t))}get caption(){return f(this,ml)}render(){const t=this.getAttribute("icon-class"),l=this.innerHTML.trim();this.innerHTML="",this.shadowRoot.innerHTML=`
1119
1119
  <style>
1120
1120
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSideMenuItem.css";
1121
1121
  ${H.getCustomPath(this,"nxSideMenuItem.css")}
@@ -1128,15 +1128,15 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1128
1128
  </div>
1129
1129
  <div class="expand-icon"></div>
1130
1130
  </li>
1131
- `}}ml=new WeakMap,Dn=new WeakMap,gl=new WeakMap,$c=new WeakMap,customElements.get("nx-side-menu")||customElements.define("nx-side-menu",bf),customElements.get("nx-side-menu-head")||customElements.define("nx-side-menu-head",yf),customElements.get("nx-side-menu-foot")||customElements.define("nx-side-menu-foot",vf),customElements.get("nx-side-menu-body")||customElements.define("nx-side-menu-body",wf),customElements.get("nx-side-menu-item")||customElements.define("nx-side-menu-item",xf);class _f extends HTMLElement{constructor(){super();Y(this,bl);Y(this,Bn);Y(this,yl);Y(this,Fn);Y(this,xs);Y(this,ki,[]);it(this,"refresh",()=>{if(!(f(this,ki).length<0||H.isNull(f(this,Fn)))){var t=f(this,ki).findIndex(l=>l[f(this,yl)]==H.global.locale);t<0&&(t=0),f(this,Bn).innerHTML=f(this,ki)[t][f(this,Fn)],$("datalist",this).remove(),$(this).append(f(this,xs))}});Y(this,Lc,()=>{tt(this,xs,"<datalist>"),this.querySelectorAll("datalist option").forEach((c,o)=>{for(var r={},n=0;n<c.attributes.length;n++)r[c.attributes[n].name]=f(this,bl)?c.attributes[n].value:c.attributes[n].value.replaceAll("<","&lt;").replaceAll(">","&gt;"),o==0&&(["locale","lang","key","code"].includes(c.attributes[n].name)?tt(this,yl,c.attributes[n].name):tt(this,Fn,c.attributes[n].name));tt(this,xs,f(this,xs)+"<option");for(const s in r)tt(this,xs,f(this,xs)+` ${s}="${r[s]}"`);tt(this,xs,f(this,xs)+"></option>"),f(this,ki).push(r)}),tt(this,xs,f(this,xs)+"</datalist>");const t=this.innerHTML;this.innerHTML=`
1131
+ `}}ml=new WeakMap,Dn=new WeakMap,gl=new WeakMap,$c=new WeakMap,customElements.get("nx-side-menu")||customElements.define("nx-side-menu",gf),customElements.get("nx-side-menu-head")||customElements.define("nx-side-menu-head",bf),customElements.get("nx-side-menu-foot")||customElements.define("nx-side-menu-foot",yf),customElements.get("nx-side-menu-body")||customElements.define("nx-side-menu-body",vf),customElements.get("nx-side-menu-item")||customElements.define("nx-side-menu-item",wf);class xf extends HTMLElement{constructor(){super();Y(this,bl);Y(this,Bn);Y(this,yl);Y(this,Fn);Y(this,xs);Y(this,ki,[]);it(this,"refresh",()=>{if(!(f(this,ki).length<0||H.isNull(f(this,Fn)))){var t=f(this,ki).findIndex(l=>l[f(this,yl)]==H.global.locale);t<0&&(t=0),f(this,Bn).innerHTML=f(this,ki)[t][f(this,Fn)],$("datalist",this).remove(),$(this).append(f(this,xs))}});Y(this,Lc,()=>{tt(this,xs,"<datalist>"),this.querySelectorAll("datalist option").forEach((c,o)=>{for(var r={},n=0;n<c.attributes.length;n++)r[c.attributes[n].name]=f(this,bl)?c.attributes[n].value:c.attributes[n].value.replaceAll("<","&lt;").replaceAll(">","&gt;"),o==0&&(["locale","lang","key","code"].includes(c.attributes[n].name)?tt(this,yl,c.attributes[n].name):tt(this,Fn,c.attributes[n].name));tt(this,xs,f(this,xs)+"<option");for(const s in r)tt(this,xs,f(this,xs)+` ${s}="${r[s]}"`);tt(this,xs,f(this,xs)+"></option>"),f(this,ki).push(r)}),tt(this,xs,f(this,xs)+"</datalist>");const t=this.innerHTML;this.innerHTML=`
1132
1132
  <span>${t}</span>
1133
- `,tt(this,Bn,this.querySelector("span"));for(var l=0;l<this.attributes.length;l++)f(this,Bn).setAttribute(this.attributes[l].name,this.attributes[l].value);this.refresh()});tt(this,bl,this.getAttribute("enable-html")=="true"),$(()=>{f(this,Lc).call(this)})}connectedCallback(){H.getLocale()=="ko"?console.warn("nx-span 컴포넌트는 더 이상 사용되지 않을 예정입니다. nx-i18n 컴포넌트로 대체하세요."):console.warn("The nx-span component will be deprecated. Replace with nx-i18n component.")}}bl=new WeakMap,Bn=new WeakMap,yl=new WeakMap,Fn=new WeakMap,xs=new WeakMap,ki=new WeakMap,Lc=new WeakMap,customElements.get("nx-span")||customElements.define("nx-span",_f);class Sf extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1133
+ `,tt(this,Bn,this.querySelector("span"));for(var l=0;l<this.attributes.length;l++)f(this,Bn).setAttribute(this.attributes[l].name,this.attributes[l].value);this.refresh()});tt(this,bl,this.getAttribute("enable-html")=="true"),$(()=>{f(this,Lc).call(this)})}connectedCallback(){H.getLocale()=="ko"?console.warn("nx-span 컴포넌트는 더 이상 사용되지 않을 예정입니다. nx-i18n 컴포넌트로 대체하세요."):console.warn("The nx-span component will be deprecated. Replace with nx-i18n component.")}}bl=new WeakMap,Bn=new WeakMap,yl=new WeakMap,Fn=new WeakMap,xs=new WeakMap,ki=new WeakMap,Lc=new WeakMap,customElements.get("nx-span")||customElements.define("nx-span",xf);class _f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1134
1134
  <nx-test2></nx-test2>
1135
- `}}class kf extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1135
+ `}}class Sf extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1136
1136
  <div>222222</div>
1137
- `,this.shadowRoot.querySelector("div").addEventListener("click",E=>{console.log(E),this.dispatchEvent(new CustomEvent("onlinkclick2",{detail:{data:"1"},bubbles:!0,composed:!0}))})}}class Cf extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML=`
1137
+ `,this.shadowRoot.querySelector("div").addEventListener("click",E=>{console.log(E),this.dispatchEvent(new CustomEvent("onlinkclick2",{detail:{data:"1"},bubbles:!0,composed:!0}))})}}class kf extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML=`
1138
1138
  <div>333333</div>
1139
- `,this.querySelector("div").addEventListener("click",E=>{console.log(E),this.dispatchEvent(new CustomEvent("onlinkclick3",{detail:{data:"1"},bubbles:!0,composed:!0}))})}}customElements.get("nx-test1")||customElements.define("nx-test1",Sf),customElements.get("nx-test2")||customElements.define("nx-test2",kf),customElements.get("nx-test3")||customElements.define("nx-test3",Cf);class Ef extends HTMLElement{constructor(){super();it(this,"changeLocale",t=>{H.setLocale(t),this.shadowRoot.querySelector("#locale").innerHTML=H.decode(t,"ko","한국어","English")});this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1139
+ `,this.querySelector("div").addEventListener("click",E=>{console.log(E),this.dispatchEvent(new CustomEvent("onlinkclick3",{detail:{data:"1"},bubbles:!0,composed:!0}))})}}customElements.get("nx-test1")||customElements.define("nx-test1",_f),customElements.get("nx-test2")||customElements.define("nx-test2",Sf),customElements.get("nx-test3")||customElements.define("nx-test3",kf);class Cf extends HTMLElement{constructor(){super();it(this,"changeLocale",t=>{H.setLocale(t),this.shadowRoot.querySelector("#locale").innerHTML=H.decode(t,"ko","한국어","English")});this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
1140
1140
  <style>
1141
1141
  :host {
1142
1142
  display: flex;
@@ -1206,7 +1206,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1206
1206
  </li>
1207
1207
  </ul>
1208
1208
  </nav>
1209
- `,this.changeLocale(H.getLocale())}}customElements.get("nx-top-menu")||customElements.define("nx-top-menu",Ef),Array.prototype.nineBinarySearch=function(vt){this.sort((c,o)=>c>o?1:-1);let E=0,t=this.length-1,l;for(;E<=t;){if(l=parseInt((E+t)/2),vt==this[l])return l;vt<this[l]?t=l-1:E=l+1}return-1};class Af extends HTMLElement{constructor(){super();Y(this,ur);Y(this,vl);Y(this,Pc,()=>{this.innerHTML.trim(),this.innerHTML="";const t=document.createElement("template");if(t.innerHTML=`
1209
+ `,this.changeLocale(H.getLocale())}}customElements.get("nx-top-menu")||customElements.define("nx-top-menu",Cf),Array.prototype.nineBinarySearch=function(vt){this.sort((c,o)=>c>o?1:-1);let E=0,t=this.length-1,l;for(;E<=t;){if(l=parseInt((E+t)/2),vt==this[l])return l;vt<this[l]?t=l-1:E=l+1}return-1};class Ef extends HTMLElement{constructor(){super();Y(this,ur);Y(this,vl);Y(this,Pc,()=>{this.innerHTML.trim(),this.innerHTML="";const t=document.createElement("template");if(t.innerHTML=`
1210
1210
  <style>
1211
1211
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxCollapse.css";
1212
1212
  ${H.getCustomPath(this,"nxCollapse.css")}
@@ -1270,7 +1270,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1270
1270
  transform-origin: top right;
1271
1271
  }
1272
1272
  }
1273
- `,(c||f(this,ur)).appendChild(o),l.addEventListener("click",()=>{f(this,ur).classList.add("nx-collapse"),setTimeout(()=>{this.classList.add("nx-collapse")},100),setTimeout(()=>{tt(this,vl,f(this,ur).style.display),f(this,ur).style.display="none"},500)})}this.shadowRoot.querySelector("button").addEventListener("click",()=>{f(this,ur).style.display=f(this,vl),f(this,ur).classList.remove("nx-collapse"),f(this,ur).classList.add("nx-expand"),setTimeout(()=>{this.classList.remove("nx-collapse"),this.classList.add("nx-expand")},100),setTimeout(()=>{f(this,ur).classList.remove("nx-expand"),this.classList.remove("nx-expand")},600)})});this.attachShadow({mode:"open"})}connectedCallback(){const t=this.getAttribute("target");tt(this,ur,H.querySelector(t)),f(this,Pc).call(this)}}ur=new WeakMap,vl=new WeakMap,Pc=new WeakMap,customElements.get("nx-collapse")||customElements.define("nx-collapse",Af);class Tf extends HTMLElement{constructor(){super();Y(this,qn);it(this,"initialize",()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.classList.remove("active")});const t=this.shadowRoot.querySelector('.tab-button:not([style*="display: none"])');t&&t.click()});Y(this,Dc,()=>{this.classList.add(this.getAttribute("theme")||"theme-1"),Ue(this,qn,Bu).call(this),this.shadowRoot.querySelectorAll(".tab-button").forEach(r=>{r.addEventListener("click",this.switchTabHandler)});const t=this.shadowRoot.querySelector(".tab-button"),l=this.shadowRoot.querySelector(".tab-page");t&&l&&(t.classList.add("active"),l.classList.add("active"),setTimeout(()=>{this.shadowRoot.querySelector(".tab-pages").style.height=`${l.scrollHeight}px`},100),console.log(l.style.height,l.scrollHeight)),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(r=>{r.classList.add("exit-right")});const c=new ResizeObserver(()=>{const r=this.shadowRoot.querySelector(".tab-page.active");r&&(this.shadowRoot.querySelector(".tab-pages").style.height=`${r.scrollHeight}px`)}),o=this.shadowRoot.querySelector(".tab-page.active");o&&c.observe(o)});this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
1273
+ `,(c||f(this,ur)).appendChild(o),l.addEventListener("click",()=>{f(this,ur).classList.add("nx-collapse"),setTimeout(()=>{this.classList.add("nx-collapse")},100),setTimeout(()=>{tt(this,vl,f(this,ur).style.display),f(this,ur).style.display="none"},500)})}this.shadowRoot.querySelector("button").addEventListener("click",()=>{f(this,ur).style.display=f(this,vl),f(this,ur).classList.remove("nx-collapse"),f(this,ur).classList.add("nx-expand"),setTimeout(()=>{this.classList.remove("nx-collapse"),this.classList.add("nx-expand")},100),setTimeout(()=>{f(this,ur).classList.remove("nx-expand"),this.classList.remove("nx-expand")},600)})});this.attachShadow({mode:"open"})}connectedCallback(){const t=this.getAttribute("target");tt(this,ur,H.querySelector(t)),f(this,Pc).call(this)}}ur=new WeakMap,vl=new WeakMap,Pc=new WeakMap,customElements.get("nx-collapse")||customElements.define("nx-collapse",Ef);class Af extends HTMLElement{constructor(){super();Y(this,qn);it(this,"initialize",()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.classList.remove("active")});const t=this.shadowRoot.querySelector('.tab-button:not([style*="display: none"])');t&&t.click()});Y(this,Dc,()=>{this.classList.add(this.getAttribute("theme")||"theme-1"),Ue(this,qn,Bu).call(this),this.shadowRoot.querySelectorAll(".tab-button").forEach(r=>{r.addEventListener("click",this.switchTabHandler)});const t=this.shadowRoot.querySelector(".tab-button"),l=this.shadowRoot.querySelector(".tab-page");t&&l&&(t.classList.add("active"),l.classList.add("active"),setTimeout(()=>{this.shadowRoot.querySelector(".tab-pages").style.height=`${l.scrollHeight}px`},100),console.log(l.style.height,l.scrollHeight)),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(r=>{r.classList.add("exit-right")});const c=new ResizeObserver(()=>{const r=this.shadowRoot.querySelector(".tab-page.active");r&&(this.shadowRoot.querySelector(".tab-pages").style.height=`${r.scrollHeight}px`)}),o=this.shadowRoot.querySelector(".tab-page.active");o&&c.observe(o)});this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
1274
1274
  <style>
1275
1275
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxTab.css";
1276
1276
  ${H.getCustomPath(this,"nxTab.css")}
@@ -1278,20 +1278,20 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1278
1278
 
1279
1279
  <div class="tabs"></div>
1280
1280
  <div class="tab-pages"></div>
1281
- `,this.switchTabHandler=Ue(this,qn,Fu).bind(this),this.tabpage={show:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.innerText.trim()===t&&(l.style.display="unset")})},showAll:()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((t,l)=>{t.style.display="unset"})},hide:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.innerText.trim()===t&&(l.style.display="none")})}}}connectedCallback(){f(this,Dc).call(this),this.dispatchEvent(new CustomEvent(H.EVENT.TAB_LOAD,{bubbles:!0,detail:{}}))}}qn=new WeakSet,Bu=function(){const t=this.shadowRoot.querySelector(".tabs"),l=this.shadowRoot.querySelector(".tab-pages"),c=this.querySelectorAll("nx-tab-page");c.forEach((o,r)=>{const n=document.createElement("div");n.classList.add("tab-button"),n.textContent=o.getAttribute("caption"),n.setAttribute("data-target",`content${r}`),t.appendChild(n);const s=document.createElement("div");s.id=`content${r}`,s.classList.add("tab-page"),s.innerHTML=o.innerHTML,l.appendChild(s)}),c.forEach(o=>{o.remove()})},Fu=function(t){const l=t.target;if(console.log(t),!l.classList.contains("tab-button"))return;const c=l.getAttribute("data-target"),o=this.shadowRoot.querySelector(".tab-button.active"),r=this.shadowRoot.querySelector(".tab-page.active"),n=this.shadowRoot.getElementById(c);console.log(c,o,r,n),o!==l&&(console.log("*******"),o&&r?(o.classList.remove("active"),r.classList.remove("active","exit-left","exit-right"),r.style.left="",o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?r.classList.add("exit-left"):r.classList.add("exit-right"),n.classList.add("active"),n.style.left="",n.classList.remove("exit-left","exit-right")):r&&n&&(r.classList.remove("active","exit-left","exit-right"),r.style.left="",r.classList.add("exit-left"),n.classList.add("active"),n.style.left="",n.classList.remove("exit-left","exit-right")),l.classList.add("active"),this.shadowRoot.querySelector(".tab-pages").style.height=`${n.scrollHeight}px`)},Dc=new WeakMap;class Rf extends HTMLElement{constructor(){super()}connectedCallback(){this.caption=this.getAttribute("caption")}}customElements.get("nx-tab")||customElements.define("nx-tab",Tf),customElements.get("nx-tab-page")||customElements.define("nx-tab-page",Rf);class Mf extends HTMLElement{constructor(){super();Y(this,Dr);Y(this,Bc,t=>{const l=t.previousElementSibling,c=t.nextElementSibling;if(!l||!c){tt(this,Dr,this.classList.contains("h")?"h":"v");return}const o=l.getBoundingClientRect(),r=c.getBoundingClientRect();this.classList.contains("h")?tt(this,Dr,"h"):this.classList.contains("v")?tt(this,Dr,"v"):tt(this,Dr,Math.abs(o.top-r.top)<5?"h":"v")});Y(this,Fc,t=>{t.preventDefault(),t.stopPropagation();const l=this.getBoundingClientRect(),c=f(this,Dr)==="h",o=c?t.clientX-l.left:t.clientY-l.top,r=document.createElement("div");r.className=`nx-splitter-drag-bar-${f(this,Dr)}`,Object.assign(r.style,{position:"absolute",zIndex:"999",background:"#666",opacity:"0.6",pointerEvents:"none"});const n=this.getRootNode({composed:!0}),s=n instanceof ShadowRoot?n.host:this.parentElement,e=this.previousElementSibling,i=this.nextElementSibling;if(!s||!e||!i){console.warn("Spliter's parent or siblings not found.");return}(s.shadowRoot||s).appendChild(r);const u=r.offsetParent.getBoundingClientRect(),a=e.getBoundingClientRect(),h=i.getBoundingClientRect(),p=(c?l.left-u.left:l.top-u.top)+o;c?(r.style.top="0",r.style.left=`${p}px`,r.style.width="1px",r.style.height="100%"):(r.style.left="0",r.style.top=`${p}px`,r.style.height="1px",r.style.width="100%"),r.style.zIndex="99999";const m=c?a.left-u.left:a.top-u.top,d=c?h.right-u.left-l.width:h.bottom-u.top-l.height,b=S=>{const C=c?S.clientX:S.clientY,I=c?C-u.left:C-u.top,D=Math.max(m,Math.min(I,d));c?r.style.left=`${D}px`:r.style.top=`${D}px`},g=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",g),r.remove();const S=Array.from(s.children),C=S.filter(O=>O.tagName.toLowerCase()!=="nx-splitter"),I=window.getComputedStyle(s),D=c?I.getPropertyValue("column-gap"):I.getPropertyValue("row-gap"),z=parseFloat(D)||0,B=(S.length>1?S.length-1:0)*z,W=parseFloat(c?r.style.left:r.style.top)-p,q=c?e.getBoundingClientRect().width:e.getBoundingClientRect().height,A=c?i.getBoundingClientRect().width:i.getBoundingClientRect().height;let M=q+W,k=A-W;M<0&&(k+=M,M=0),k<0&&(M+=k,k=0);const y=C.map(O=>c?O.getBoundingClientRect().width:O.getBoundingClientRect().height),w=S.reduce((O,j)=>j.tagName.toLowerCase()==="nx-splitter"?O+(c?j.getBoundingClientRect().width:j.getBoundingClientRect().height):O,0),_=(c?s.getBoundingClientRect().width:s.getBoundingClientRect().height)-w-B;let T=0;C.forEach((O,j)=>{let V;O===e?V=M:O===i?V=k:V=y[j];const X=V/_;console.log(O),O.classList.contains("sidebar")?O.style.flex=`0 0 ${V}px`:O.style.flex=`${X} ${X} 0`,T+=X}),console.log(`dragOffset: ${W}`),console.log(`Calculated FlexSum: ${T}`)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",g)});Y(this,qc,()=>{f(this,Bc).call(this,this),this.classList.add(f(this,Dr));const t=this.innerHTML.trim(),l=`grip-${f(this,Dr)}`,c=t===""?`<div class="${l}"></div>`:`<div class="${l}"></div><div class="inner-container">${t}</div><div class="${l}"></div>`;this.innerHTML="";const o=document.createElement("template");o.innerHTML=`
1281
+ `,this.switchTabHandler=Ue(this,qn,Fu).bind(this),this.tabpage={show:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.innerText.trim()===t&&(l.style.display="unset")})},showAll:()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((t,l)=>{t.style.display="unset"})},hide:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((l,c)=>{l.innerText.trim()===t&&(l.style.display="none")})}}}connectedCallback(){f(this,Dc).call(this),this.dispatchEvent(new CustomEvent(H.EVENT.TAB_LOAD,{bubbles:!0,detail:{}}))}}qn=new WeakSet,Bu=function(){const t=this.shadowRoot.querySelector(".tabs"),l=this.shadowRoot.querySelector(".tab-pages"),c=this.querySelectorAll("nx-tab-page");c.forEach((o,r)=>{const n=document.createElement("div");n.classList.add("tab-button"),n.textContent=o.getAttribute("caption"),n.setAttribute("data-target",`content${r}`),t.appendChild(n);const s=document.createElement("div");s.id=`content${r}`,s.classList.add("tab-page"),s.innerHTML=o.innerHTML,l.appendChild(s)}),c.forEach(o=>{o.remove()})},Fu=function(t){const l=t.target;if(console.log(t),!l.classList.contains("tab-button"))return;const c=l.getAttribute("data-target"),o=this.shadowRoot.querySelector(".tab-button.active"),r=this.shadowRoot.querySelector(".tab-page.active"),n=this.shadowRoot.getElementById(c);console.log(c,o,r,n),o!==l&&(console.log("*******"),o&&r?(o.classList.remove("active"),r.classList.remove("active","exit-left","exit-right"),r.style.left="",o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?r.classList.add("exit-left"):r.classList.add("exit-right"),n.classList.add("active"),n.style.left="",n.classList.remove("exit-left","exit-right")):r&&n&&(r.classList.remove("active","exit-left","exit-right"),r.style.left="",r.classList.add("exit-left"),n.classList.add("active"),n.style.left="",n.classList.remove("exit-left","exit-right")),l.classList.add("active"),this.shadowRoot.querySelector(".tab-pages").style.height=`${n.scrollHeight}px`)},Dc=new WeakMap;class Tf extends HTMLElement{constructor(){super()}connectedCallback(){this.caption=this.getAttribute("caption")}}customElements.get("nx-tab")||customElements.define("nx-tab",Af),customElements.get("nx-tab-page")||customElements.define("nx-tab-page",Tf);class Rf extends HTMLElement{constructor(){super();Y(this,Dr);Y(this,Bc,t=>{const l=t.previousElementSibling,c=t.nextElementSibling;if(!l||!c){tt(this,Dr,this.classList.contains("h")?"h":"v");return}const o=l.getBoundingClientRect(),r=c.getBoundingClientRect();this.classList.contains("h")?tt(this,Dr,"h"):this.classList.contains("v")?tt(this,Dr,"v"):tt(this,Dr,Math.abs(o.top-r.top)<5?"h":"v")});Y(this,Fc,t=>{t.preventDefault(),t.stopPropagation();const l=this.getBoundingClientRect(),c=f(this,Dr)==="h",o=c?t.clientX-l.left:t.clientY-l.top,r=document.createElement("div");r.className=`nx-splitter-drag-bar-${f(this,Dr)}`,Object.assign(r.style,{position:"absolute",zIndex:"999",background:"#666",opacity:"0.6",pointerEvents:"none"});const n=this.getRootNode({composed:!0}),s=n instanceof ShadowRoot?n.host:this.parentElement,e=this.previousElementSibling,i=this.nextElementSibling;if(!s||!e||!i){console.warn("Spliter's parent or siblings not found.");return}(s.shadowRoot||s).appendChild(r);const u=r.offsetParent.getBoundingClientRect(),a=e.getBoundingClientRect(),h=i.getBoundingClientRect(),p=(c?l.left-u.left:l.top-u.top)+o;c?(r.style.top="0",r.style.left=`${p}px`,r.style.width="1px",r.style.height="100%"):(r.style.left="0",r.style.top=`${p}px`,r.style.height="1px",r.style.width="100%"),r.style.zIndex="99999";const m=c?a.left-u.left:a.top-u.top,d=c?h.right-u.left-l.width:h.bottom-u.top-l.height,b=S=>{const C=c?S.clientX:S.clientY,I=c?C-u.left:C-u.top,D=Math.max(m,Math.min(I,d));c?r.style.left=`${D}px`:r.style.top=`${D}px`},g=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",g),r.remove();const S=Array.from(s.children),C=S.filter(O=>O.tagName.toLowerCase()!=="nx-splitter"),I=window.getComputedStyle(s),D=c?I.getPropertyValue("column-gap"):I.getPropertyValue("row-gap"),z=parseFloat(D)||0,B=(S.length>1?S.length-1:0)*z,W=parseFloat(c?r.style.left:r.style.top)-p,q=c?e.getBoundingClientRect().width:e.getBoundingClientRect().height,A=c?i.getBoundingClientRect().width:i.getBoundingClientRect().height;let M=q+W,k=A-W;M<0&&(k+=M,M=0),k<0&&(M+=k,k=0);const y=C.map(O=>c?O.getBoundingClientRect().width:O.getBoundingClientRect().height),w=S.reduce((O,j)=>j.tagName.toLowerCase()==="nx-splitter"?O+(c?j.getBoundingClientRect().width:j.getBoundingClientRect().height):O,0),_=(c?s.getBoundingClientRect().width:s.getBoundingClientRect().height)-w-B;let T=0;C.forEach((O,j)=>{let V;O===e?V=M:O===i?V=k:V=y[j];const X=V/_;console.log(O),O.classList.contains("sidebar")?O.style.flex=`0 0 ${V}px`:O.style.flex=`${X} ${X} 0`,T+=X}),console.log(`dragOffset: ${W}`),console.log(`Calculated FlexSum: ${T}`)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",g)});Y(this,qc,()=>{f(this,Bc).call(this,this),this.classList.add(f(this,Dr));const t=this.innerHTML.trim(),l=`grip-${f(this,Dr)}`,c=t===""?`<div class="${l}"></div>`:`<div class="${l}"></div><div class="inner-container">${t}</div><div class="${l}"></div>`;this.innerHTML="";const o=document.createElement("template");o.innerHTML=`
1282
1282
  <style>
1283
1283
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxSplitter.css";
1284
1284
  ${H.getCustomPath(this,"nxSplitter.css")}
1285
1285
  </style>
1286
1286
  ${c}
1287
- `,this.shadowRoot.appendChild(o.content.cloneNode(!0)),this.shadowRoot.querySelectorAll(".grip-h,.grip-v").forEach(r=>{r.addEventListener("mousedown",n=>f(this,Fc).call(this,n))}),f(this,wl).call(this),window.addEventListener("resize",()=>f(this,wl).call(this))});Y(this,wl,()=>{const t=f(this,Dr)==="h",l=this.parentElement,c=Array.from(l.children).filter(s=>s.tagName.toLowerCase()!=="nx-splitter");if(c.length<2)return;const o=l.getBoundingClientRect(),r=c.reduce((s,e)=>{const i=t?e.getBoundingClientRect().width:e.getBoundingClientRect().height;return s+i},0),n=t?o.width:o.height;c.forEach(s=>{const e=t?s.getBoundingClientRect().width:s.getBoundingClientRect().height,u=n*(e/r)/n;s.style.flex=`${u} ${u} 0`})});this.attachShadow({mode:"open"})}connectedCallback(){f(this,qc).call(this)}}Dr=new WeakMap,Bc=new WeakMap,Fc=new WeakMap,qc=new WeakMap,wl=new WeakMap,customElements.get("nx-splitter")||customElements.define("nx-splitter",Mf);class If extends HTMLElement{constructor(){super();Y(this,gu);it(this,"getData_BAK",()=>{const t={};return this.shadowRoot.querySelectorAll("[id]").forEach(l=>{l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"?t[l.id]=l.value:t[l.id]=l.textContent.trim()}),t});it(this,"getData",()=>{const t={};return this.shadowRoot.querySelectorAll("input, textarea, select, [id], [name]").forEach(l=>{const c=l.id||l.name;if(!c)return;const o=l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"?l.value:l.textContent.trim();t[c]?(Array.isArray(t[c])||(t[c]=[t[c]]),t[c].push(o)):t[c]=o}),t});Y(this,Hc,()=>{const t=this.innerHTML.trim();this.innerHTML="";const l=document.createElement("template");l.innerHTML=`
1287
+ `,this.shadowRoot.appendChild(o.content.cloneNode(!0)),this.shadowRoot.querySelectorAll(".grip-h,.grip-v").forEach(r=>{r.addEventListener("mousedown",n=>f(this,Fc).call(this,n))}),f(this,wl).call(this),window.addEventListener("resize",()=>f(this,wl).call(this))});Y(this,wl,()=>{const t=f(this,Dr)==="h",l=this.parentElement,c=Array.from(l.children).filter(s=>s.tagName.toLowerCase()!=="nx-splitter");if(c.length<2)return;const o=l.getBoundingClientRect(),r=c.reduce((s,e)=>{const i=t?e.getBoundingClientRect().width:e.getBoundingClientRect().height;return s+i},0),n=t?o.width:o.height;c.forEach(s=>{const e=t?s.getBoundingClientRect().width:s.getBoundingClientRect().height,u=n*(e/r)/n;s.style.flex=`${u} ${u} 0`})});this.attachShadow({mode:"open"})}connectedCallback(){f(this,qc).call(this)}}Dr=new WeakMap,Bc=new WeakMap,Fc=new WeakMap,qc=new WeakMap,wl=new WeakMap,customElements.get("nx-splitter")||customElements.define("nx-splitter",Rf);class Mf extends HTMLElement{constructor(){super();Y(this,gu);it(this,"getData_BAK",()=>{const t={};return this.shadowRoot.querySelectorAll("[id]").forEach(l=>{l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"?t[l.id]=l.value:t[l.id]=l.textContent.trim()}),t});it(this,"getData",()=>{const t={};return this.shadowRoot.querySelectorAll("input, textarea, select, [id], [name]").forEach(l=>{const c=l.id||l.name;if(!c)return;const o=l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"?l.value:l.textContent.trim();t[c]?(Array.isArray(t[c])||(t[c]=[t[c]]),t[c].push(o)):t[c]=o}),t});Y(this,Hc,()=>{const t=this.innerHTML.trim();this.innerHTML="";const l=document.createElement("template");l.innerHTML=`
1288
1288
  <style>
1289
1289
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxForm.css";
1290
1290
  ${H.getCustomPath(this,"nxForm.css")}
1291
1291
  </style>
1292
1292
 
1293
1293
  ${t}
1294
- `,this.shadowRoot.appendChild(l.content.cloneNode(!0))});this.attachShadow({mode:"open"})}connectedCallback(){f(this,Hc).call(this)}}gu=new WeakMap,Hc=new WeakMap,customElements.get("nx-form")||customElements.define("nx-form",If);class Nf extends HTMLElement{constructor(){super();Y(this,Ir,[]);Y(this,xl,[]);Y(this,_l,()=>{H.delayQuerySelector("nx-side-menu-item.active").then(t=>{f(this,Sl).call(this,t),f(this,kl).call(this)})});Y(this,Sl,t=>{if(tt(this,Ir,[]),t){const l=t.caption;l&&f(this,Ir).unshift({path:t.getAttribute("href"),caption:l});let c=t,o=!1;for(;c;)if(c=c.previousElementSibling,c&&c.tagName==="NX-SIDE-MENU-ITEM"){const r=c.caption;if(c.getAttribute("type")==="group"){r&&!o&&(f(this,Ir).unshift({path:c.getAttribute("href"),caption:r}),o=!0);break}}}this.closest(".list-wrapper")||f(this,Ir).push({path:"",caption:this.getAttribute("caption")||"Current Page"}),f(this,Ir).unshift({path:"/",caption:"Home"}),tt(this,Ir,f(this,Ir).concat(f(this,xl)))});Y(this,kl,()=>{const t=H.querySelector("nx-side-menu-item.active"),l=t?t.caption:"No Caption";this.innerHTML.trim(),this.innerHTML="",this.shadowRoot.innerHTML="";const c=document.createElement("template");c.innerHTML=`
1294
+ `,this.shadowRoot.appendChild(l.content.cloneNode(!0))});this.attachShadow({mode:"open"})}connectedCallback(){f(this,Hc).call(this)}}gu=new WeakMap,Hc=new WeakMap,customElements.get("nx-form")||customElements.define("nx-form",Mf);class If extends HTMLElement{constructor(){super();Y(this,Ir,[]);Y(this,xl,[]);Y(this,_l,()=>{H.delayQuerySelector("nx-side-menu-item.active").then(t=>{f(this,Sl).call(this,t),f(this,kl).call(this)})});Y(this,Sl,t=>{if(tt(this,Ir,[]),t){const l=t.caption;l&&f(this,Ir).unshift({path:t.getAttribute("href"),caption:l});let c=t,o=!1;for(;c;)if(c=c.previousElementSibling,c&&c.tagName==="NX-SIDE-MENU-ITEM"){const r=c.caption;if(c.getAttribute("type")==="group"){r&&!o&&(f(this,Ir).unshift({path:c.getAttribute("href"),caption:r}),o=!0);break}}}this.closest(".list-wrapper")||f(this,Ir).push({path:"",caption:this.getAttribute("caption")||"Current Page"}),f(this,Ir).unshift({path:"/",caption:"Home"}),tt(this,Ir,f(this,Ir).concat(f(this,xl)))});Y(this,kl,()=>{const t=H.querySelector("nx-side-menu-item.active"),l=t?t.caption:"No Caption";this.innerHTML.trim(),this.innerHTML="",this.shadowRoot.innerHTML="";const c=document.createElement("template");c.innerHTML=`
1295
1295
  <style>
1296
1296
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxTitle.css";
1297
1297
  ${H.getCustomPath(this,"nxTitle.css")}
@@ -1315,7 +1315,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1315
1315
  >${o.caption}</a>`:`<span class="breadcrumb-item ${n?"breadcrumb-current":""}">${o.caption}</span>`,e=r<f(this,Ir).length-1?'<span class="breadcrumb-separator"> &gt; </span>':"";return`${s}${e}`}).join("")}
1316
1316
  </div>
1317
1317
  </div>
1318
- `,this.shadowRoot.appendChild(c.content.cloneNode(!0)),this.shadowRoot.querySelectorAll(".breadcrumb-link").forEach(o=>{o.addEventListener("click",f(this,zc))})});Y(this,zc,t=>{console.log(t);const l=t.target.dataset.path;l&&(window.location.href=l)});this.attachShadow({mode:"open"})}connectedCallback(){f(this,_l).call(this)}disconnectedCallback(){document.removeEventListener("DOMContentLoaded",f(this,_l))}setDynamicPath(t){tt(this,xl,t),f(this,Sl).call(this),f(this,kl).call(this)}}Ir=new WeakMap,xl=new WeakMap,_l=new WeakMap,Sl=new WeakMap,kl=new WeakMap,zc=new WeakMap,customElements.get("nx-title")||customElements.define("nx-title",Nf);class nu extends HTMLElement{constructor(){super();Y(this,Nr);it(this,"originContents");Y(this,Cl,!1);Y(this,Ci);Y(this,El,!1);it(this,"getData",()=>{const t={};return Ue(this,Nr,Ll).call(this).forEach(l=>{const c=l.name;if(!c)return;let o;if(l.tagName==="INPUT"&&l.type==="checkbox"){let r=l.getAttribute("true-value")||"Y",n=l.getAttribute("false-value")||"N";o=l.checked?r:n}else l.tagName==="INPUT"&&l.type,o=l.value;t[c]?(Array.isArray(t[c])||(t[c]=[t[c]]),t[c].push(o)):t[c]=o}),t});it(this,"clearData",(t={})=>{Ue(this,Nr,wu).call(this),Ue(this,Nr,Ll).call(this).forEach(l=>{const c=l.name;if(!c)return;const o=t&&t[c]!==void 0?t[c]:"";Ue(this,Nr,vu).call(this,l,o)}),this.changed=!1});it(this,"setData",t=>{if(!t||typeof t!="object")return;Ue(this,Nr,wu).call(this);let l=!1;Ue(this,Nr,Ll).call(this).forEach(c=>{const o=c.name;!o||!t.hasOwnProperty(o)||Ue(this,Nr,vu).call(this,c,t[o])&&(l=!0)}),l&&(this.changed=!0)});it(this,"initData",t=>{this.clearData(t),this.changed=!1});Y(this,Al,t=>{this.changed=!0});Y(this,Uc,()=>{for(const t of this.attributes)t.name.startsWith("css-")&&this.style.setProperty(t.name.substring(4),t.value);this.originContents=this.innerHTML.trim(),this.innerHTML="",this.shadowRoot&&this.tagName.toLowerCase()==="nx-div"&&(this.shadowRoot.innerHTML=this.originContents)})}connectedCallback(){return f(this,Cl)?!1:(this.getAttribute("use-shadow")!=="false"&&!this.shadowRoot?(this.attachShadow({mode:"open"}),tt(this,Ci,this.shadowRoot)):tt(this,Ci,this),f(this,Uc).call(this),tt(this,Cl,!0),!0)}get changed(){return f(this,El)}set changed(t){const l=!!t;tt(this,El,l);const c=this.closest(".detail-wrapper");if(c){const o=c.querySelector("nx-title2");o&&(o.changed=l)}}get root(){return f(this,Ci)||this}}Cl=new WeakMap,Ci=new WeakMap,El=new WeakMap,Nr=new WeakSet,Ll=function(){return H.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]",f(this,Ci))},vu=function(t,l){const c=t.tagName.toUpperCase(),o=t.type;let r=!1;if(["INPUT","TEXTAREA","SELECT","NX-EDITOR"].includes(c))if(o==="checkbox"){const n=t.getAttribute("true-value")||"Y",s=String(n)===String(l);t.checked!==s&&(r=!0),t.checked=s}else if(o==="radio"){const n=String(t.value)===String(l);t.checked!==n&&(r=!0),t.checked=n}else t.value!==l&&(r=!0),t.value=l;else t.textContent!==l&&(r=!0),t.textContent=l;return r},wu=function(){Ue(this,Nr,Ll).call(this).forEach(t=>{t.removeEventListener("input",f(this,Al)),t.addEventListener("input",f(this,Al))})},Al=new WeakMap,Uc=new WeakMap;class Of extends nu{constructor(){super();Y(this,Tl,!1);Y(this,Vc,()=>{const t=this.getAttribute("caption")||"",l=document.createElement("template");l.innerHTML=`
1318
+ `,this.shadowRoot.appendChild(c.content.cloneNode(!0)),this.shadowRoot.querySelectorAll(".breadcrumb-link").forEach(o=>{o.addEventListener("click",f(this,zc))})});Y(this,zc,t=>{console.log(t);const l=t.target.dataset.path;l&&(window.location.href=l)});this.attachShadow({mode:"open"})}connectedCallback(){f(this,_l).call(this)}disconnectedCallback(){document.removeEventListener("DOMContentLoaded",f(this,_l))}setDynamicPath(t){tt(this,xl,t),f(this,Sl).call(this),f(this,kl).call(this)}}Ir=new WeakMap,xl=new WeakMap,_l=new WeakMap,Sl=new WeakMap,kl=new WeakMap,zc=new WeakMap,customElements.get("nx-title")||customElements.define("nx-title",If);class nu extends HTMLElement{constructor(){super();Y(this,Nr);it(this,"originContents");Y(this,Cl,!1);Y(this,Ci);Y(this,El,!1);it(this,"getData",()=>{const t={};return Ue(this,Nr,Ll).call(this).forEach(l=>{const c=l.name;if(!c)return;let o;if(l.tagName==="INPUT"&&l.type==="checkbox"){let r=l.getAttribute("true-value")||"Y",n=l.getAttribute("false-value")||"N";o=l.checked?r:n}else l.tagName==="INPUT"&&l.type,o=l.value;t[c]?(Array.isArray(t[c])||(t[c]=[t[c]]),t[c].push(o)):t[c]=o}),t});it(this,"clearData",(t={})=>{Ue(this,Nr,wu).call(this),Ue(this,Nr,Ll).call(this).forEach(l=>{const c=l.name;if(!c)return;const o=t&&t[c]!==void 0?t[c]:"";Ue(this,Nr,vu).call(this,l,o)}),this.changed=!1});it(this,"setData",t=>{if(!t||typeof t!="object")return;Ue(this,Nr,wu).call(this);let l=!1;Ue(this,Nr,Ll).call(this).forEach(c=>{const o=c.name;!o||!t.hasOwnProperty(o)||Ue(this,Nr,vu).call(this,c,t[o])&&(l=!0)}),l&&(this.changed=!0)});it(this,"initData",t=>{this.clearData(t),this.changed=!1});Y(this,Al,t=>{this.changed=!0});Y(this,Uc,()=>{for(const t of this.attributes)t.name.startsWith("css-")&&this.style.setProperty(t.name.substring(4),t.value);this.originContents=this.innerHTML.trim(),this.innerHTML="",this.shadowRoot&&this.tagName.toLowerCase()==="nx-div"&&(this.shadowRoot.innerHTML=this.originContents)})}connectedCallback(){return f(this,Cl)?!1:(this.getAttribute("use-shadow")!=="false"&&!this.shadowRoot?(this.attachShadow({mode:"open"}),tt(this,Ci,this.shadowRoot)):tt(this,Ci,this),f(this,Uc).call(this),tt(this,Cl,!0),!0)}get changed(){return f(this,El)}set changed(t){const l=!!t;tt(this,El,l);const c=this.closest(".detail-wrapper");if(c){const o=c.querySelector("nx-title2");o&&(o.changed=l)}}get root(){return f(this,Ci)||this}}Cl=new WeakMap,Ci=new WeakMap,El=new WeakMap,Nr=new WeakSet,Ll=function(){return H.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]",f(this,Ci))},vu=function(t,l){const c=t.tagName.toUpperCase(),o=t.type;let r=!1;if(["INPUT","TEXTAREA","SELECT","NX-EDITOR"].includes(c))if(o==="checkbox"){const n=t.getAttribute("true-value")||"Y",s=String(n)===String(l);t.checked!==s&&(r=!0),t.checked=s}else if(o==="radio"){const n=String(t.value)===String(l);t.checked!==n&&(r=!0),t.checked=n}else t.value!==l&&(r=!0),t.value=l;else t.textContent!==l&&(r=!0),t.textContent=l;return r},wu=function(){Ue(this,Nr,Ll).call(this).forEach(t=>{t.removeEventListener("input",f(this,Al)),t.addEventListener("input",f(this,Al))})},Al=new WeakMap,Uc=new WeakMap;class Nf extends nu{constructor(){super();Y(this,Tl,!1);Y(this,Vc,()=>{const t=this.getAttribute("caption")||"",l=document.createElement("template");l.innerHTML=`
1319
1319
  <style>
1320
1320
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxTitle2.css";
1321
1321
  ${H.getCustomPath(this,"nxTitle2.css")}
@@ -1326,7 +1326,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1326
1326
  </div>
1327
1327
 
1328
1328
  ${this.originContents}
1329
- `,(this.shadowRoot||this).appendChild(l.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Vc).call(this)}get changed(){return f(this,Tl)}set changed(t){tt(this,Tl,t),t?this.classList.add("changed"):this.classList.remove("changed")}}Tl=new WeakMap,Vc=new WeakMap,customElements.get("nx-title2")||customElements.define("nx-title2",Of);class jf extends HTMLElement{constructor(){super();Y(this,Rl);Y(this,Hn)}connectedCallback(){tt(this,Hn,Array.from(this.children).filter(t=>t.tagName.toLowerCase()!=="nx-splitter")),Ue(this,Rl,xu).call(this)}attributeChangedCallback(t,l,c){f(this,Hn)&&l!==c&&Ue(this,Rl,xu).call(this)}static get observedAttributes(){return["columns"]}}Hn=new WeakMap,Rl=new WeakSet,xu=function(){const t=f(this,Hn);if(!t||t.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const l=(this.getAttribute("columns")||"1").split(",").map(Number),c=l.length;let o=0;for(let r=0;r<c;r++){const n=l[r],s=document.createElement("div");s.classList.add("row");for(let e=0;e<n;e++){if(t[o]){const i=t[o];s.appendChild(i),o++}if(e<n-1){const i=document.createElement("nx-splitter");s.appendChild(i)}}if(this.appendChild(s),r<c-1){const e=document.createElement("nx-splitter");e.classList.add("v"),this.appendChild(e)}}},customElements.get("nx-layout")||customElements.define("nx-layout",jf);class $f extends HTMLElement{constructor(){super();Y(this,Gs);Y(this,zn);Y(this,Wc,()=>{const t=c=>{const o=window.getComputedStyle(c),r=c.cloneNode(!0);r.style.fontSize=o.fontSize,r.style.fontFamily=o.fontFamily,r.style.fontWeight=o.fontWeight,r.style.position="absolute",r.style.left="-9999px",r.style.visibility="hidden",document.body.appendChild(r);const n=r.getBoundingClientRect().width;return document.body.removeChild(r),n+4},l=[];this.querySelectorAll(".row").forEach(c=>{c.querySelectorAll(".label").forEach((r,n)=>{l[n]||(l[n]=[]),l[n].push(r)})}),l.forEach(c=>{if(c&&c.length>0){const o=c.map(n=>t(n)),r=Math.max(...o);c.forEach(n=>{n.style.width=`${r}px`})}})})}static get observedAttributes(){return["columns","rows-height"]}connectedCallback(){tt(this,zn,Array.from(this.children).filter(t=>t.tagName.toLowerCase()!=="nx-splitter")),Ue(this,Gs,Su).call(this)}attributeChangedCallback(t,l,c){l!==c&&(t==="rows-height"&&Ue(this,Gs,_u).call(this,c),f(this,zn)&&Ue(this,Gs,Su).call(this))}}zn=new WeakMap,Gs=new WeakSet,_u=function(t){if(t){const l=t.replace(/,/g," ").replace(/\*/g,"1fr");this.style.setProperty("--rows-template",l)}},Su=function(){Ue(this,Gs,_u).call(this,this.getAttribute("rows-height"));const t=f(this,zn);if(!t||t.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const l=(this.getAttribute("columns")||"1").split(",").map(Number),c=l.length;let o=0;for(let r=0;r<c;r++){const n=l[r],s=document.createElement("div");s.classList.add("row");for(let e=0;e<n;e++)if(t[o]){const i=t[o];s.appendChild(i),o++}this.appendChild(s)}setTimeout(()=>{f(this,Wc).call(this)},300)},Wc=new WeakMap,customElements.get("nx-layout2")||customElements.define("nx-layout2",$f);class Lf extends nu{constructor(){super();Y(this,Xc,()=>{var r;const t=this.getAttribute("caption"),l=this.getAttribute("columns")||"",c=((r=this.getAttribute("rows-height"))==null?void 0:r.replace(/,/g," "))||"",o=document.createElement("template");o.innerHTML=`
1329
+ `,(this.shadowRoot||this).appendChild(l.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Vc).call(this)}get changed(){return f(this,Tl)}set changed(t){tt(this,Tl,t),t?this.classList.add("changed"):this.classList.remove("changed")}}Tl=new WeakMap,Vc=new WeakMap,customElements.get("nx-title2")||customElements.define("nx-title2",Nf);class Of extends HTMLElement{constructor(){super();Y(this,Rl);Y(this,Hn)}connectedCallback(){tt(this,Hn,Array.from(this.children).filter(t=>t.tagName.toLowerCase()!=="nx-splitter")),Ue(this,Rl,xu).call(this)}attributeChangedCallback(t,l,c){f(this,Hn)&&l!==c&&Ue(this,Rl,xu).call(this)}static get observedAttributes(){return["columns"]}}Hn=new WeakMap,Rl=new WeakSet,xu=function(){const t=f(this,Hn);if(!t||t.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const l=(this.getAttribute("columns")||"1").split(",").map(Number),c=l.length;let o=0;for(let r=0;r<c;r++){const n=l[r],s=document.createElement("div");s.classList.add("row");for(let e=0;e<n;e++){if(t[o]){const i=t[o];s.appendChild(i),o++}if(e<n-1){const i=document.createElement("nx-splitter");s.appendChild(i)}}if(this.appendChild(s),r<c-1){const e=document.createElement("nx-splitter");e.classList.add("v"),this.appendChild(e)}}},customElements.get("nx-layout")||customElements.define("nx-layout",Of);class jf extends HTMLElement{constructor(){super();Y(this,Gs);Y(this,zn);Y(this,Wc,()=>{const t=c=>{const o=window.getComputedStyle(c),r=c.cloneNode(!0);r.style.fontSize=o.fontSize,r.style.fontFamily=o.fontFamily,r.style.fontWeight=o.fontWeight,r.style.position="absolute",r.style.left="-9999px",r.style.visibility="hidden",document.body.appendChild(r);const n=r.getBoundingClientRect().width;return document.body.removeChild(r),n+4},l=[];this.querySelectorAll(".row").forEach(c=>{c.querySelectorAll(".label").forEach((r,n)=>{l[n]||(l[n]=[]),l[n].push(r)})}),l.forEach(c=>{if(c&&c.length>0){const o=c.map(n=>t(n)),r=Math.max(...o);c.forEach(n=>{n.style.width=`${r}px`})}})})}static get observedAttributes(){return["columns","rows-height"]}connectedCallback(){tt(this,zn,Array.from(this.children).filter(t=>t.tagName.toLowerCase()!=="nx-splitter")),Ue(this,Gs,Su).call(this)}attributeChangedCallback(t,l,c){l!==c&&(t==="rows-height"&&Ue(this,Gs,_u).call(this,c),f(this,zn)&&Ue(this,Gs,Su).call(this))}}zn=new WeakMap,Gs=new WeakSet,_u=function(t){if(t){const l=t.replace(/,/g," ").replace(/\*/g,"1fr");this.style.setProperty("--rows-template",l)}},Su=function(){Ue(this,Gs,_u).call(this,this.getAttribute("rows-height"));const t=f(this,zn);if(!t||t.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const l=(this.getAttribute("columns")||"1").split(",").map(Number),c=l.length;let o=0;for(let r=0;r<c;r++){const n=l[r],s=document.createElement("div");s.classList.add("row");for(let e=0;e<n;e++)if(t[o]){const i=t[o];s.appendChild(i),o++}this.appendChild(s)}setTimeout(()=>{f(this,Wc).call(this)},300)},Wc=new WeakMap,customElements.get("nx-layout2")||customElements.define("nx-layout2",jf);class $f extends nu{constructor(){super();Y(this,Xc,()=>{var r;const t=this.getAttribute("caption"),l=this.getAttribute("columns")||"",c=((r=this.getAttribute("rows-height"))==null?void 0:r.replace(/,/g," "))||"",o=document.createElement("template");o.innerHTML=`
1330
1330
  <style>
1331
1331
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxPanel.css";
1332
1332
  ${H.getCustomPath(this,"nxPanel.css")}
@@ -1340,14 +1340,14 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1340
1340
  ${this.originContents}
1341
1341
  </nx-layout2>
1342
1342
  </div>
1343
- `,(this.shadowRoot||this).appendChild(o.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Xc).call(this)}}Xc=new WeakMap,customElements.get("nx-panel")||customElements.define("nx-panel",Lf);class Pf extends nu{constructor(){super();Y(this,Yc,()=>{const t=document.createElement("template");t.innerHTML=`
1343
+ `,(this.shadowRoot||this).appendChild(o.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Xc).call(this)}}Xc=new WeakMap,customElements.get("nx-panel")||customElements.define("nx-panel",$f);class Lf extends nu{constructor(){super();Y(this,Yc,()=>{const t=document.createElement("template");t.innerHTML=`
1344
1344
  <style>
1345
1345
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/nxButtons.css";
1346
1346
  ${H.getCustomPath(this,"nxButtons.css")}
1347
1347
  </style>
1348
1348
 
1349
1349
  ${this.originContents}
1350
- `,(this.shadowRoot||this).appendChild(t.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Yc).call(this)}}Yc=new WeakMap,customElements.get("nx-buttons")||customElements.define("nx-buttons",Pf);class Df extends HTMLElement{constructor(){super();Y(this,_s);it(this,"showModal",()=>{this.querySelector("dialog").showModal()});it(this,"close",()=>{$(".head",this).off("mousedown",f(this,Ml)),$(".head",this).off("touchstart",f(this,Nl)),$(document).off("mouseup",f(this,Il)),$(document).off("touchend",f(this,Ol)),$(document).off("mousemove",f(this,Un)),$(document).off("touchmove",f(this,Vn)),this.querySelector("dialog").close()});Y(this,Gc,()=>{$(".close",this).on("click",t=>{H.j.querySelectorAll("dialog",this).addClass("out"),setTimeout(()=>{this.close()},300)}),$(".close2",this).on("click",t=>{this.close()}),$(".head",this).on("mousedown",f(this,Ml)),$(".head",this).on("touchstart",f(this,Nl)),$(document).on("mouseup",f(this,Il)),$(document).on("touchend",f(this,Ol))});Y(this,Ml,t=>{if(!t.target.closest("buttons")&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,_s,{x:t.clientX-l.x,y:t.clientY-l.y}),$(document).on("mousemove",f(this,Un))}});Y(this,Un,t=>{$(this.querySelector("dialog")).offset({left:t.pageX-f(this,_s).x,top:t.pageY-f(this,_s).y})});Y(this,Il,t=>{$(document).off("mousemove",f(this,Un))});Y(this,Nl,t=>{if(!t.target.closest("buttons")){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,_s,{x:t.changedTouches[0].pageX-l.x,y:t.changedTouches[0].pageY-l.y}),$(document).on("touchmove",f(this,Vn))}});Y(this,Vn,t=>{$(this.querySelector("dialog")).offset({left:t.changedTouches[0].pageX-f(this,_s).x,top:t.changedTouches[0].pageY-f(this,_s).y})});Y(this,Ol,t=>{$(document).off("touchmove",f(this,Vn))})}connectedCallback(){const t=this.getAttribute("title"),l=this.innerHTML,c=this.getAttribute("css-file");c&&`${H.version}${c}`,c&&H.getCustomPath(this,c),this.innerHTML=`
1350
+ `,(this.shadowRoot||this).appendChild(t.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&f(this,Yc).call(this)}}Yc=new WeakMap,customElements.get("nx-buttons")||customElements.define("nx-buttons",Lf);class Pf extends HTMLElement{constructor(){super();Y(this,_s);it(this,"showModal",()=>{this.querySelector("dialog").showModal()});it(this,"close",()=>{$(".head",this).off("mousedown",f(this,Ml)),$(".head",this).off("touchstart",f(this,Nl)),$(document).off("mouseup",f(this,Il)),$(document).off("touchend",f(this,Ol)),$(document).off("mousemove",f(this,Un)),$(document).off("touchmove",f(this,Vn)),this.querySelector("dialog").close()});Y(this,Gc,()=>{$(".close",this).on("click",t=>{H.j.querySelectorAll("dialog",this).addClass("out"),setTimeout(()=>{this.close()},300)}),$(".close2",this).on("click",t=>{this.close()}),$(".head",this).on("mousedown",f(this,Ml)),$(".head",this).on("touchstart",f(this,Nl)),$(document).on("mouseup",f(this,Il)),$(document).on("touchend",f(this,Ol))});Y(this,Ml,t=>{if(!t.target.closest("buttons")&&!(t.buttons!=1||t.altKey||t.ctrlKey||t.shiftkey)){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,_s,{x:t.clientX-l.x,y:t.clientY-l.y}),$(document).on("mousemove",f(this,Un))}});Y(this,Un,t=>{$(this.querySelector("dialog")).offset({left:t.pageX-f(this,_s).x,top:t.pageY-f(this,_s).y})});Y(this,Il,t=>{$(document).off("mousemove",f(this,Un))});Y(this,Nl,t=>{if(!t.target.closest("buttons")){var l=this.querySelector("dialog").getBoundingClientRect();tt(this,_s,{x:t.changedTouches[0].pageX-l.x,y:t.changedTouches[0].pageY-l.y}),$(document).on("touchmove",f(this,Vn))}});Y(this,Vn,t=>{$(this.querySelector("dialog")).offset({left:t.changedTouches[0].pageX-f(this,_s).x,top:t.changedTouches[0].pageY-f(this,_s).y})});Y(this,Ol,t=>{$(document).off("touchmove",f(this,Vn))})}connectedCallback(){const t=this.getAttribute("title"),l=this.innerHTML,c=this.getAttribute("css-file");c&&`${H.version}${c}`,c&&H.getCustomPath(this,c),this.innerHTML=`
1351
1351
  <style>
1352
1352
  ${H.getCustomPath(this,"nxModal.css")||""}
1353
1353
  </style>
@@ -1380,5 +1380,5 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
1380
1380
  </div>
1381
1381
  </div>
1382
1382
  </dialog>
1383
- `;const o=this.querySelector(".title");o&&t&&(o.textContent=t),f(this,Gc).call(this)}}_s=new WeakMap,Gc=new WeakMap,Ml=new WeakMap,Un=new WeakMap,Il=new WeakMap,Nl=new WeakMap,Vn=new WeakMap,Ol=new WeakMap,customElements.get("nx-modal")||customElements.define("nx-modal",Df),window.jQuery=window.$=Se;function Bf(){customElements.get("nine-grid")||customElements.define("nine-grid",Kn)}de.NineGridContainer=Kn,de.default=H,de.defineCustomElements=Bf,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1383
+ `;const o=this.querySelector(".title");o&&t&&(o.textContent=t),f(this,Gc).call(this)}}_s=new WeakMap,Gc=new WeakMap,Ml=new WeakMap,Un=new WeakMap,Il=new WeakMap,Nl=new WeakMap,Vn=new WeakMap,Ol=new WeakMap,customElements.get("nx-modal")||customElements.define("nx-modal",Pf),window.jQuery=window.$=Se;function Df(){customElements.get("nine-grid")||customElements.define("nine-grid",Kn)}de.NineGridContainer=Kn,de.default=H,de.defineCustomElements=Df,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1384
1384
  //# sourceMappingURL=nine-grid.umd.js.map