UNPKG

@mescius/activereportsjs

Version:

ActiveReportsJS

8 lines 1.46 MB
/*! * @mescius/activereportsjs 6.1.0 * Description: ActiveReportsJS * https://www.npmjs.com/package/@mescius/activereportsjs * Copyright ©️ MESCIUS inc. All rights reserved. * Licensed under the Commercial license */ (function(ir,vr){typeof exports=="object"&&typeof module<"u"?vr(exports,require("./ar-js-core.js")):typeof define=="function"&&define.amd?define(["exports","@mescius/ar-js-pagereport"],vr):(ir=typeof globalThis<"u"?globalThis:ir||self,vr((ir.MESCIUS=ir.MESCIUS||{},ir.MESCIUS.ActiveReportsJS=ir.MESCIUS.ActiveReportsJS||{},ir.MESCIUS.ActiveReportsJS.XlsxExportAdv={}),ir.MESCIUS.ActiveReportsJS.Core))})(this,(function(ir,vr){"use strict";function Ld(O,L){for(var w=0;w<L.length;w++){const k=L[w];if(typeof k!="string"&&!Array.isArray(k)){for(const M in k)if(M!=="default"&&!(M in O)){const o=Object.getOwnPropertyDescriptor(k,M);o&&Object.defineProperty(O,M,o.get?o:{enumerable:!0,get:()=>k[M]})}}}return Object.freeze(Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}))}function jd(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}var Jo={exports:{}},Ft=Jo.exports={},ar,sr;function Li(){throw new Error("setTimeout has not been defined")}function ji(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ar=setTimeout:ar=Li}catch{ar=Li}try{typeof clearTimeout=="function"?sr=clearTimeout:sr=ji}catch{sr=ji}})();function Qo(O){if(ar===setTimeout)return setTimeout(O,0);if((ar===Li||!ar)&&setTimeout)return ar=setTimeout,setTimeout(O,0);try{return ar(O,0)}catch{try{return ar.call(null,O,0)}catch{return ar.call(this,O,0)}}}function Fd(O){if(sr===clearTimeout)return clearTimeout(O);if((sr===ji||!sr)&&clearTimeout)return sr=clearTimeout,clearTimeout(O);try{return sr(O)}catch{try{return sr.call(null,O)}catch{return sr.call(this,O)}}}var dr=[],Rr=!1,xr,ri=-1;function qd(){!Rr||!xr||(Rr=!1,xr.length?dr=xr.concat(dr):ri=-1,dr.length&&ef())}function ef(){if(!Rr){var O=Qo(qd);Rr=!0;for(var L=dr.length;L;){for(xr=dr,dr=[];++ri<L;)xr&&xr[ri].run();ri=-1,L=dr.length}xr=null,Rr=!1,Fd(O)}}Ft.nextTick=function(O){var L=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;w<arguments.length;w++)L[w-1]=arguments[w];dr.push(new tf(O,L)),dr.length===1&&!Rr&&Qo(ef)};function tf(O,L){this.fun=O,this.array=L}tf.prototype.run=function(){this.fun.apply(null,this.array)},Ft.title="browser",Ft.browser=!0,Ft.env={},Ft.argv=[],Ft.version="",Ft.versions={};function pr(){}Ft.on=pr,Ft.addListener=pr,Ft.once=pr,Ft.off=pr,Ft.removeListener=pr,Ft.removeAllListeners=pr,Ft.emit=pr,Ft.prependListener=pr,Ft.prependOnceListener=pr,Ft.listeners=function(O){return[]},Ft.binding=function(O){throw new Error("process.binding is not supported")},Ft.cwd=function(){return"/"},Ft.chdir=function(O){throw new Error("process.chdir is not supported")},Ft.umask=function(){return 0};var Ud=Jo.exports;const bt=jd(Ud);function Fi(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}function rf(O){if(Object.prototype.hasOwnProperty.call(O,"__esModule"))return O;var L=O.default;if(typeof L=="function"){var w=function k(){return this instanceof k?Reflect.construct(L,arguments,this.constructor):L.apply(this,arguments)};w.prototype=L.prototype}else w={};return Object.defineProperty(w,"__esModule",{value:!0}),Object.keys(O).forEach(function(k){var M=Object.getOwnPropertyDescriptor(O,k);Object.defineProperty(w,k,M.get?M:{enumerable:!0,get:function(){return O[k]}})}),w}var qi={exports:{}},nf;function zd(){return nf||(nf=1,(function(O){var L=(function(w){var k=Object.prototype,M=k.hasOwnProperty,o=Object.defineProperty||function(y,x,A){y[x]=A.value},f,s=typeof Symbol=="function"?Symbol:{},r=s.iterator||"@@iterator",t=s.asyncIterator||"@@asyncIterator",e=s.toStringTag||"@@toStringTag";function a(y,x,A){return Object.defineProperty(y,x,{value:A,enumerable:!0,configurable:!0,writable:!0}),y[x]}try{a({},"")}catch{a=function(x,A,S){return x[A]=S}}function i(y,x,A,S){var N=x&&x.prototype instanceof E?x:E,W=Object.create(N.prototype),Q=new l(S||[]);return o(W,"_invoke",{value:C(y,A,Q)}),W}w.wrap=i;function n(y,x,A){try{return{type:"normal",arg:y.call(x,A)}}catch(S){return{type:"throw",arg:S}}}var c="suspendedStart",p="suspendedYield",m="executing",b="completed",g={};function E(){}function R(){}function I(){}var j={};a(j,r,function(){return this});var $=Object.getPrototypeOf,F=$&&$($(h([])));F&&F!==k&&M.call(F,r)&&(j=F);var q=I.prototype=E.prototype=Object.create(j);R.prototype=I,o(q,"constructor",{value:I,configurable:!0}),o(I,"constructor",{value:R,configurable:!0}),R.displayName=a(I,e,"GeneratorFunction");function H(y){["next","throw","return"].forEach(function(x){a(y,x,function(A){return this._invoke(x,A)})})}w.isGeneratorFunction=function(y){var x=typeof y=="function"&&y.constructor;return x?x===R||(x.displayName||x.name)==="GeneratorFunction":!1},w.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,I):(y.__proto__=I,a(y,e,"GeneratorFunction")),y.prototype=Object.create(q),y},w.awrap=function(y){return{__await:y}};function U(y,x){function A(W,Q,D,P){var T=n(y[W],y,Q);if(T.type==="throw")P(T.arg);else{var B=T.arg,z=B.value;return z&&typeof z=="object"&&M.call(z,"__await")?x.resolve(z.__await).then(function(V){A("next",V,D,P)},function(V){A("throw",V,D,P)}):x.resolve(z).then(function(V){B.value=V,D(B)},function(V){return A("throw",V,D,P)})}}var S;function N(W,Q){function D(){return new x(function(P,T){A(W,Q,P,T)})}return S=S?S.then(D,D):D()}o(this,"_invoke",{value:N})}H(U.prototype),a(U.prototype,t,function(){return this}),w.AsyncIterator=U,w.async=function(y,x,A,S,N){N===void 0&&(N=Promise);var W=new U(i(y,x,A,S),N);return w.isGeneratorFunction(x)?W:W.next().then(function(Q){return Q.done?Q.value:W.next()})};function C(y,x,A){var S=c;return function(W,Q){if(S===m)throw new Error("Generator is already running");if(S===b){if(W==="throw")throw Q;return v()}for(A.method=W,A.arg=Q;;){var D=A.delegate;if(D){var P=_(D,A);if(P){if(P===g)continue;return P}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(S===c)throw S=b,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);S=m;var T=n(y,x,A);if(T.type==="normal"){if(S=A.done?b:p,T.arg===g)continue;return{value:T.arg,done:A.done}}else T.type==="throw"&&(S=b,A.method="throw",A.arg=T.arg)}}}function _(y,x){var A=x.method,S=y.iterator[A];if(S===f)return x.delegate=null,A==="throw"&&y.iterator.return&&(x.method="return",x.arg=f,_(y,x),x.method==="throw")||A!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+A+"' method")),g;var N=n(S,y.iterator,x.arg);if(N.type==="throw")return x.method="throw",x.arg=N.arg,x.delegate=null,g;var W=N.arg;if(!W)return x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,g;if(W.done)x[y.resultName]=W.value,x.next=y.nextLoc,x.method!=="return"&&(x.method="next",x.arg=f);else return W;return x.delegate=null,g}H(q),a(q,e,"Generator"),a(q,r,function(){return this}),a(q,"toString",function(){return"[object Generator]"});function u(y){var x={tryLoc:y[0]};1 in y&&(x.catchLoc=y[1]),2 in y&&(x.finallyLoc=y[2],x.afterLoc=y[3]),this.tryEntries.push(x)}function d(y){var x=y.completion||{};x.type="normal",delete x.arg,y.completion=x}function l(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(u,this),this.reset(!0)}w.keys=function(y){var x=Object(y),A=[];for(var S in x)A.push(S);return A.reverse(),function N(){for(;A.length;){var W=A.pop();if(W in x)return N.value=W,N.done=!1,N}return N.done=!0,N}};function h(y){if(y){var x=y[r];if(x)return x.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var A=-1,S=function N(){for(;++A<y.length;)if(M.call(y,A))return N.value=y[A],N.done=!1,N;return N.value=f,N.done=!0,N};return S.next=S}}return{next:v}}w.values=h;function v(){return{value:f,done:!0}}return l.prototype={constructor:l,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(d),!y)for(var x in this)x.charAt(0)==="t"&&M.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=f)},stop:function(){this.done=!0;var y=this.tryEntries[0],x=y.completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var x=this;function A(P,T){return W.type="throw",W.arg=y,x.next=P,T&&(x.method="next",x.arg=f),!!T}for(var S=this.tryEntries.length-1;S>=0;--S){var N=this.tryEntries[S],W=N.completion;if(N.tryLoc==="root")return A("end");if(N.tryLoc<=this.prev){var Q=M.call(N,"catchLoc"),D=M.call(N,"finallyLoc");if(Q&&D){if(this.prev<N.catchLoc)return A(N.catchLoc,!0);if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else if(Q){if(this.prev<N.catchLoc)return A(N.catchLoc,!0)}else if(D){if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(y,x){for(var A=this.tryEntries.length-1;A>=0;--A){var S=this.tryEntries[A];if(S.tryLoc<=this.prev&&M.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var N=S;break}}N&&(y==="break"||y==="continue")&&N.tryLoc<=x&&x<=N.finallyLoc&&(N=null);var W=N?N.completion:{};return W.type=y,W.arg=x,N?(this.method="next",this.next=N.finallyLoc,g):this.complete(W)},complete:function(y,x){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&x&&(this.next=x),g},finish:function(y){for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x];if(A.finallyLoc===y)return this.complete(A.completion,A.afterLoc),d(A),g}},catch:function(y){for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x];if(A.tryLoc===y){var S=A.completion;if(S.type==="throw"){var N=S.arg;d(A)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(y,x,A){return this.delegate={iterator:h(y),resultName:x,nextLoc:A},this.method==="next"&&(this.arg=f),g}},w})(O.exports);try{regeneratorRuntime=L}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}})(qi)),qi.exports}var $d=zd();const Hd=Fi($d);function Fr(O){throw new Error('Could not dynamically require "'+O+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ui={exports:{}};var af;function Wd(){return af||(af=1,(function(O,L){(function(w){O.exports=w()})((function(){return(function w(k,M,o){function f(t,e){if(!M[t]){if(!k[t]){var a=typeof Fr=="function"&&Fr;if(!e&&a)return a(t,!0);if(s)return s(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=M[t]={exports:{}};k[t][0].call(n.exports,(function(c){return f(k[t][1][c]||c)}),n,n.exports,w,k,M,o)}return M[t].exports}for(var s=typeof Fr=="function"&&Fr,r=0;r<o.length;r++)f(o[r]);return f})({1:[function(w,k,M){const o=w("fs"),f=w("fast-csv"),s=w("dayjs/plugin/customParseFormat"),r=w("dayjs/plugin/utc"),t=w("dayjs").extend(s).extend(r),e=w("../utils/stream-buf"),{fs:{exists:a}}=w("../utils/utils"),i={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!"}};k.exports=class{constructor(n){this.workbook=n,this.worksheet=null}async readFile(n,c){if(c=c||{},!await a(n))throw new Error("File not found: "+n);const p=o.createReadStream(n),m=await this.read(p,c);return p.close(),m}read(n,c){return c=c||{},new Promise((p,m)=>{const b=this.workbook.addWorksheet(c.sheetName),g=c.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],E=c.map||function(I){if(I==="")return null;const j=Number(I);if(!Number.isNaN(j)&&j!==1/0)return j;const $=g.reduce((q,H)=>{if(q)return q;const U=t(I,H,!0);return U.isValid()?U:null},null);if($)return new Date($.valueOf());const F=i[I];return F!==void 0?F:I},R=f.parse(c.parserOptions).on("data",I=>{b.addRow(I.map(E))}).on("end",()=>{R.emit("worksheet",b)});R.on("worksheet",p).on("error",m),n.pipe(R)})}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(n,c){return new Promise((p,m)=>{c=c||{};const b=this.workbook.getWorksheet(c.sheetName||c.sheetId),g=f.format(c.formatterOptions);n.on("finish",()=>{p()}),g.on("error",m),g.pipe(n);const{dateFormat:E,dateUTC:R}=c,I=c.map||(F=>{if(F){if(F.text||F.hyperlink)return F.hyperlink||F.text||"";if(F.formula||F.result)return F.result||"";if(F instanceof Date)return E?R?t.utc(F).format(E):t(F).format(E):R?t.utc(F).format():t(F).format();if(F.error)return F.error;if(typeof F=="object")return JSON.stringify(F)}return F}),j=c.includeEmptyRows===void 0||c.includeEmptyRows;let $=1;b&&b.eachRow((F,q)=>{if(j)for(;$++<q-1;)g.write([]);const{values:H}=F;H.shift(),g.write(H.map(I)),$=q}),g.end()})}writeFile(n,c){const p={encoding:(c=c||{}).encoding||"utf8"},m=o.createWriteStream(n,p);return this.write(m,c)}async writeBuffer(n){const c=new e;return await this.write(c,n),c.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:230,"dayjs/plugin/customParseFormat":231,"dayjs/plugin/utc":232,"fast-csv":263,fs:216}],2:[function(w,k,M){const o=w("../utils/col-cache");class f{constructor(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){const a=o.decodeAddress(t);this.nativeCol=a.col+e,this.nativeColOff=0,this.nativeRow=a.row+e,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+e,this.row=t.row+e):(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(r){return r instanceof f||r==null?r:new f(r)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(r){this.nativeCol=Math.floor(r),this.nativeColOff=Math.floor((r-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(r){this.nativeRow=Math.floor(r),this.nativeRowOff=Math.floor((r-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(r){this.nativeCol=r.nativeCol,this.nativeColOff=r.nativeColOff,this.nativeRow=r.nativeRow,this.nativeRowOff=r.nativeRowOff}}k.exports=f},{"../utils/col-cache":19}],3:[function(w,k,M){const o=w("../utils/col-cache"),f=w("../utils/under-dash"),s=w("./enums"),{slideFormula:r}=w("../utils/shared-formula"),t=w("./note");class e{constructor(n,c,p){if(!n||!c)throw new Error("A Cell needs a Row");this._row=n,this._column=c,o.validateAddress(p),this._address=p,this._value=a.create(e.Types.Null,this),this.style=this._mergeStyle(n.style,c.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(n){this.style.numFmt=n}get font(){return this.style.font}set font(n){this.style.font=n}get alignment(){return this.style.alignment}set alignment(n){this.style.alignment=n}get border(){return this.style.border}set border(n){this.style.border=n}get fill(){return this.style.fill}set fill(n){this.style.fill=n}get protection(){return this.style.protection}set protection(n){this.style.protection=n}_mergeStyle(n,c,p){const m=n&&n.numFmt||c&&c.numFmt;m&&(p.numFmt=m);const b=n&&n.font||c&&c.font;b&&(p.font=b);const g=n&&n.alignment||c&&c.alignment;g&&(p.alignment=g);const E=n&&n.border||c&&c.border;E&&(p.border=E);const R=n&&n.fill||c&&c.fill;R&&(p.fill=R);const I=n&&n.protection||c&&c.protection;return I&&(p.protection=I),p}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===e.Types.Merge}merge(n,c){this._value.release(),this._value=a.create(e.Types.Merge,this,n),c||(this.style=n.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=a.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(n){return this._value.type===e.Types.Merge&&this._value.isMergedTo(n)}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(n){this.type!==e.Types.Merge?(this._value.release(),this._value=a.create(a.getType(n),this,n)):this._value.master.value=n}get note(){return this._comment&&this._comment.note}set note(n){this._comment=new t(n)}get text(){return this._value.toString()}get html(){return f.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(n){this.type===e.Types.String&&(this._value=a.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:n}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:n}=this._row;return{sheetName:n.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(n){this.names=[n]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(n){const{definedNames:c}=this.workbook;c.removeAllNames(this.fullAddress),n.forEach(p=>{c.addEx(this.fullAddress,p)})}addName(n){this.workbook.definedNames.addEx(this.fullAddress,n)}removeName(n){this.workbook.definedNames.removeEx(this.fullAddress,n)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(n){this._dataValidations.add(this.address,n)}get model(){const{model:n}=this._value;return n.style=this.style,this._comment&&(n.comment=this._comment.model),n}set model(n){if(this._value.release(),this._value=a.create(n.type,this),this._value.model=n,n.comment)switch(n.comment.type){case"note":this._comment=t.fromModel(n.comment)}n.style?this.style=n.style:this.style={}}}e.Types=s.ValueType;const a={getType:i=>i==null?e.Types.Null:i instanceof String||typeof i=="string"?e.Types.String:typeof i=="number"?e.Types.Number:typeof i=="boolean"?e.Types.Boolean:i instanceof Date?e.Types.Date:i.text&&i.hyperlink?e.Types.Hyperlink:i.formula||i.sharedFormula?e.Types.Formula:i.richText?e.Types.RichText:i.sharedString?e.Types.SharedString:i.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(i){this.model={address:i.address,type:e.Types.Null}}get value(){return null}set value(i){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Number,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Date,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Hyperlink,text:n?n.text:void 0,hyperlink:n?n.hyperlink:void 0},n&&n.tooltip&&(this.model.tooltip=n.tooltip)}get value(){const i={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(i.tooltip=this.model.tooltip),i}set value(i){this.model={text:i.text,hyperlink:i.hyperlink},i.tooltip&&(this.model.tooltip=i.tooltip)}get text(){return this.model.text}set text(i){this.model.text=i}get hyperlink(){return this.model.hyperlink}set hyperlink(i){this.model.hyperlink=i}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(i,n){this.cell=i,this.model={address:i.address,type:e.Types.Formula,shareType:n?n.shareType:void 0,ref:n?n.ref:void 0,formula:n?n.formula:void 0,sharedFormula:n?n.sharedFormula:void 0,result:n?n.result:void 0}}_copyModel(i){const n={},c=p=>{const m=i[p];m&&(n[p]=m)};return c("formula"),c("result"),c("ref"),c("shareType"),c("sharedFormula"),n}get value(){return this._copyModel(this.model)}set value(i){this.model=this._copyModel(i)}validate(i){switch(a.getType(i)){case e.Types.Null:case e.Types.String:case e.Types.Number:case e.Types.Date:break;case e.Types.Hyperlink:case e.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(i){this.model.formula=i}get formulaType(){return this.model.formula?s.FormulaType.Master:this.model.sharedFormula?s.FormulaType.Shared:s.FormulaType.None}get result(){return this.model.result}set result(i){this.model.result=i}get type(){return e.Types.Formula}get effectiveType(){const i=this.model.result;return i==null?s.ValueType.Null:i instanceof String||typeof i=="string"?s.ValueType.String:typeof i=="number"?s.ValueType.Number:i instanceof Date?s.ValueType.Date:i.text&&i.hyperlink?s.ValueType.Hyperlink:i.formula?s.ValueType.Formula:s.ValueType.Null}get address(){return this.model.address}set address(i){this.model.address=i}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:i}=this.cell,n=i.findCell(this.model.sharedFormula);this._translatedFormula=n&&r(n.formula,n.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:e.Types.Merge,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Merge,master:n?n.address:void 0},this._master=n,n&&n.addMergeRef()}get value(){return this._master.value}set value(i){i instanceof e?(this._master&&this._master.releaseMergeRef(),i.addMergeRef(),this._master=i):this._master.value=i}isMergedTo(i){return i===this._master}get master(){return this._master}get type(){return e.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:JSON.stringify(n),rawValue:n}}get value(){return this.model.rawValue}set value(i){this.model.rawValue=i,this.model.value=JSON.stringify(i)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.SharedString,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.String,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}toString(){return this.model.value.richText.map(i=>i.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Boolean,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(i,n){this.model={address:i.address,type:e.Types.Error,value:n}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((i,n)=>(i[n.t]=n.f,i),[]),create(i,n,c){const p=this.types[i];if(!p)throw new Error("Could not create Value of type "+i);return new p(n,c)}};k.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(w,k,M){const o=w("../utils/under-dash"),f=w("./enums"),s=w("../utils/col-cache");class r{constructor(e,a,i){this._worksheet=e,this._number=a,i!==!1&&(this.defn=i)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return s.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(e){e?(this.key=e.key,this.width=e.width!==void 0?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.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(e){e!==void 0?(this._header=e,this.headers.forEach((a,i)=>{this._worksheet.getCell(i+1,this.number).value=a})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}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.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&o.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,a){const i=this.number;a||(a=e,e=null),this._worksheet.eachRow(e,(n,c)=>{a(n.getCell(i),c)})}get values(){const e=[];return this.eachCell((a,i)=>{a&&a.type!==f.ValueType.Null&&(e[i]=a.value)}),e}set values(e){if(!e)return;const a=this.number;let i=0;e.hasOwnProperty("0")&&(i=1),e.forEach((n,c)=>{this._worksheet.getCell(c+i,a).value=n})}_applyStyle(e,a){return this.style[e]=a,this.eachCell(i=>{i[e]=a}),a}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)}static toModel(e){const a=[];let i=null;return e&&e.forEach((n,c)=>{n.isDefault?i&&(i=null):i&&n.equivalentTo(i)?i.max=c+1:(i={min:c+1,max:c+1,width:n.width!==void 0?n.width:9,style:n.style,isCustomWidth:n.isCustomWidth,hidden:n.hidden,outlineLevel:n.outlineLevel,collapsed:n.collapsed},a.push(i))}),a.length?a:void 0}static fromModel(e,a){const i=[];let n=1,c=0;for(a=(a=a||[]).sort((function(p,m){return p.min-m.min}));c<a.length;){const p=a[c++];for(;n<p.min;)i.push(new r(e,n++));for(;n<=p.max;)i.push(new r(e,n++,p))}return i.length?i:null}}k.exports=r},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(w,k,M){k.exports=class{constructor(o){this.model=o||{}}add(o,f){return this.model[o]=f}find(o){return this.model[o]}remove(o){this.model[o]=void 0}}},{}],6:[function(w,k,M){const o=w("../utils/under-dash"),f=w("../utils/col-cache"),s=w("../utils/cell-matrix"),r=w("./range"),t=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;k.exports=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new s)}add(e,a){const i=f.decodeEx(e);this.addEx(i,a)}addEx(e,a){const i=this.getMatrix(a);if(e.top)for(let n=e.left;n<=e.right;n++)for(let c=e.top;c<=e.bottom;c++){const p={sheetName:e.sheetName,address:f.n2l(n)+c,row:c,col:n};i.addCellEx(p)}else i.addCellEx(e)}remove(e,a){const i=f.decodeEx(e);this.removeEx(i,a)}removeEx(e,a){this.getMatrix(a).removeCellEx(e)}removeAllNames(e){o.each(this.matrixMap,a=>{a.removeCellEx(e)})}forEach(e){o.each(this.matrixMap,(a,i)=>{a.forEach(n=>{e(i,n)})})}getNames(e){return this.getNamesEx(f.decodeEx(e))}getNamesEx(e){return o.map(this.matrixMap,(a,i)=>a.findCellEx(e)&&i).filter(Boolean)}_explore(e,a){a.mark=!1;const{sheetName:i}=a,n=new r(a.row,a.col,a.row,a.col,i);let c,p;function m(g,E){const R=e.findCellAt(i,g,a.col);return!(!R||!R.mark)&&(n[E]=g,R.mark=!1,!0)}for(p=a.row-1;m(p,"top");p--);for(p=a.row+1;m(p,"bottom");p++);function b(g,E){const R=[];for(p=n.top;p<=n.bottom;p++){const I=e.findCellAt(i,p,g);if(!I||!I.mark)return!1;R.push(I)}n[E]=g;for(let I=0;I<R.length;I++)R[I].mark=!1;return!0}for(c=a.col-1;b(c,"left");c--);for(c=a.col+1;b(c,"right");c++);return n}getRanges(e,a){return(a=a||this.matrixMap[e])?(a.forEach(i=>{i.mark=!0}),{name:e,ranges:a.map(i=>i.mark&&this._explore(a,i)).filter(Boolean).map(i=>i.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,a){e.forEachInSheet(a,(i,n,c)=>{i&&(i.row===n&&i.col===c||(i.row=n,i.col=c,i.address=f.n2l(c)+n))})}spliceRows(e,a,i,n){o.each(this.matrixMap,c=>{c.spliceRows(e,a,i,n),this.normaliseMatrix(c,e)})}spliceColumns(e,a,i,n){o.each(this.matrixMap,c=>{c.spliceColumns(e,a,i,n),this.normaliseMatrix(c,e)})}get model(){return o.map(this.matrixMap,(e,a)=>this.getRanges(a,e)).filter(e=>e.ranges.length)}set model(e){const a=this.matrixMap={};e.forEach(i=>{const n=a[i.name]=new s;i.ranges.forEach(c=>{t.test(c.split("!").pop()||"")&&n.addCell(c)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(w,k,M){k.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(w,k,M){const o=w("../utils/col-cache"),f=w("./anchor");k.exports=class{constructor(s,r){this.worksheet=s,this.model=r}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(s){let{type:r,imageId:t,range:e,hyperlinks:a}=s;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const i=o.decode(e);this.range={tl:new f(this.worksheet,{col:i.left,row:i.top},-1),br:new f(this.worksheet,{col:i.right,row:i.bottom},0),editAs:"oneCell"}}else this.range={tl:new f(this.worksheet,e.tl,0),br:e.br&&new f(this.worksheet,e.br,0),ext:e.ext,editAs:e.editAs,hyperlinks:a||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(w,k,M){const o=w("../utils/under-dash");class f{constructor(r){this.note=r}get model(){let r=null;switch(typeof this.note){case"string":r={type:"note",note:{texts:[{text:this.note}]}};break;default:r={type:"note",note:this.note}}return o.deepMerge({},f.DEFAULT_CONFIGS,r)}set model(r){const{note:t}=r,{texts:e}=t;e.length===1&&Object.keys(e[0]).length===1?this.note=e[0].text:this.note=t}static fromModel(r){const t=new f;return t.model=r,t}}f.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},k.exports=f},{"../utils/under-dash":26}],10:[function(w,k,M){const o=w("../utils/col-cache");class f{constructor(){this.decode(arguments)}setTLBR(r,t,e,a,i){if(arguments.length<4){const n=o.decodeAddress(r),c=o.decodeAddress(t);this.model={top:Math.min(n.row,c.row),left:Math.min(n.col,c.col),bottom:Math.max(n.row,c.row),right:Math.max(n.col,c.col),sheetName:e},this.setTLBR(n.row,n.col,c.row,c.col,i)}else this.model={top:Math.min(r,e),left:Math.min(t,a),bottom:Math.max(r,e),right:Math.max(t,a),sheetName:i}}decode(r){switch(r.length){case 5:this.setTLBR(r[0],r[1],r[2],r[3],r[4]);break;case 4:this.setTLBR(r[0],r[1],r[2],r[3]);break;case 3:this.setTLBR(r[0],r[1],r[2]);break;case 2:this.setTLBR(r[0],r[1]);break;case 1:{const t=r[0];if(t instanceof f)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{const e=o.decodeEx(t);e.top?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.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() - "+r.length)}}get top(){return this.model.top||1}set top(r){this.model.top=r}get left(){return this.model.left||1}set left(r){this.model.left=r}get bottom(){return this.model.bottom||1}set bottom(r){this.model.bottom=r}get right(){return this.model.right||1}set right(r){this.model.right=r}get sheetName(){return this.model.sheetName}set sheetName(r){this.model.sheetName=r}get _serialisedSheetName(){const{sheetName:r}=this.model;return r?/^[a-zA-Z0-9]*$/.test(r)?r+"!":`'${r}'!`:""}expand(r,t,e,a){(!this.model.top||r<this.top)&&(this.top=r),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||e>this.bottom)&&(this.bottom=e),(!this.model.right||a>this.right)&&(this.right=a)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=o.decodeEx(r);this.expand(t.row,t.col,t.row,t.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(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&!(r.bottom<this.top)&&!(r.top>this.bottom)&&!(r.right<this.left)&&!(r.left>this.right)}contains(r){const t=o.decodeEx(r);return this.containsEx(t)}containsEx(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&r.row>=this.top&&r.row<=this.bottom&&r.col>=this.left&&r.col<=this.right}forEachAddress(r){for(let t=this.left;t<=this.right;t++)for(let e=this.top;e<=this.bottom;e++)r(o.encodeAddress(e,t),e,t)}}k.exports=f},{"../utils/col-cache":19}],11:[function(w,k,M){const o=w("../utils/under-dash"),f=w("./enums"),s=w("../utils/col-cache"),r=w("./cell");k.exports=class{constructor(t,e){this._worksheet=t,this._number=e,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(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const a=this._worksheet.getColumn(t.col);e=new r(this,a,t.address),this._cells[t.col-1]=e}return e}getCell(t){if(typeof t=="string"){const e=this._worksheet.getColumnKey(t);t=e?e.number:s.l2n(t)}return this._cells[t-1]||this.getCellEx({address:s.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const a=t+e;for(var i=arguments.length,n=new Array(i>2?i-2:0),c=2;c<i;c++)n[c-2]=arguments[c];const p=n.length-e,m=this._cells.length;let b,g,E;if(p<0)for(b=t+n.length;b<=m;b++)E=this._cells[b-1],g=this._cells[b-p-1],g?(E=this.getCell(b),E.value=g.value,E.style=g.style,E._comment=g._comment):E&&(E.value=null,E.style={},E._comment=void 0);else if(p>0)for(b=m;b>=a;b--)g=this._cells[b-1],g?(E=this.getCell(b+p),E.value=g.value,E.style=g.style,E._comment=g._comment):this._cells[b+p-1]=void 0;for(b=0;b<n.length;b++)E=this.getCell(t+b),E.value=n[b],E.style={},E._comment=void 0}eachCell(t,e){if(e||(e=t,t=null),t&&t.includeEmpty){const a=this._cells.length;for(let i=1;i<=a;i++)e(this.getCell(i),i)}else this._cells.forEach((a,i)=>{a&&a.type!==f.ValueType.Null&&e(a,i+1)})}addPageBreak(t,e){const a=this._worksheet,i=Math.max(0,t-1)||0,n=Math.max(0,e-1)||16838,c={id:this._number,max:n,man:1};i&&(c.min=i),a.rowBreaks.push(c)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==f.ValueType.Null&&(t[e.col]=e.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let e=0;t.hasOwnProperty("0")&&(e=1),t.forEach((a,i)=>{a!==void 0&&(this.getCellEx({address:s.encodeAddress(this._number,i+e),row:this._number,col:i+e}).value=a)})}else this._worksheet.eachColumnKey((e,a)=>{t[a]!==void 0&&(this.getCellEx({address:s.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[a])})}get hasValues(){return o.some(this._cells,t=>t&&t.type!==f.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,e=0;return this._cells.forEach(a=>{a&&a.type!==f.ValueType.Null&&((!t||t>a.col)&&(t=a.col),e<a.col&&(e=a.col))}),t>0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(a=>{a&&(a[t]=e)}),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,a=0;return this._cells.forEach(i=>{if(i){const n=i.model;n&&((!e||e>i.col)&&(e=i.col),a<i.col&&(a=i.col),t.push(n))}}),this.height||t.length?{cells:t,number:this.number,min:e,max:a,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(t){if(t.number!==this._number)throw new Error("Invalid row number in model");let e;this._cells=[],t.cells.forEach(a=>{switch(a.type){case r.Types.Merge:break;default:{let i;if(a.address)i=s.decodeAddress(a.address);else if(e){const{row:n}=e,c=e.col+1;i={row:n,col:c,address:s.encodeAddress(n,c),$col$row:`$${s.n2l(c)}$${n}`}}e=i,this.getCellEx(i).model=a;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(w,k,M){const o=w("../utils/col-cache");class f{constructor(r,t,e){this.table=r,this.column=t,this.index=e}_set(r,t){this.table.cacheState(),this.column[r]=t}get name(){return this.column.name}set name(r){this._set("name",r)}get filterButton(){return this.column.filterButton}set filterButton(r){this.column.filterButton=r}get style(){return this.column.style}set style(r){this.column.style=r}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(r){this._set("totalsRowLabel",r)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(r){this._set("totalsRowFunction",r)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(r){this._set("totalsRowResult",r)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(r){this._set("totalsRowFormula",r)}}k.exports=class{constructor(s,r){this.worksheet=s,r&&(this.table=r,this.validate(),this.store())}getFormula(s){switch(s.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${s.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${s.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${s.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${s.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${s.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${s.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${s.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${s.name}])`;case"custom":return s.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+s.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:s}=this,r=(p,m,b)=>{p[m]===void 0&&(p[m]=b)};r(s,"headerRow",!0),r(s,"totalsRow",!1),r(s,"style",{}),r(s.style,"theme","TableStyleMedium2"),r(s.style,"showFirstColumn",!1),r(s.style,"showLastColumn",!1),r(s.style,"showRowStripes",!1),r(s.style,"showColumnStripes",!1);const t=(p,m)=>{if(!p)throw new Error(m)};t(s.ref,"Table must have ref"),t(s.columns,"Table must have column definitions"),t(s.rows,"Table must have row definitions"),s.tl=o.decodeAddress(s.ref);const{row:e,col:a}=s.tl;t(e>0,"Table must be on valid row"),t(a>0,"Table must be on valid col");const{width:i,filterHeight:n,tableHeight:c}=this;s.autoFilterRef=o.encode(e,a,e+n-1,a+i-1),s.tableRef=o.encode(e,a,e+c-1,a+i-1),s.columns.forEach((p,m)=>{t(p.name,`Column ${m} must have a name`),m===0?r(p,"totalsRowLabel","Total"):(r(p,"totalsRowFunction","none"),p.totalsRowFormula=this.getFormula(p))})}store(){const s=(n,c)=>{c&&Object.keys(c).forEach(p=>{n[p]=c[p]})},{worksheet:r,table:t}=this,{row:e,col:a}=t.tl;let i=0;if(t.headerRow){const n=r.getRow(e+i++);t.columns.forEach((c,p)=>{const{style:m,name:b}=c,g=n.getCell(a+p);g.value=b,s(g,m)})}if(t.rows.forEach(n=>{const c=r.getRow(e+i++);n.forEach((p,m)=>{const b=c.getCell(a+m);b.value=p,s(b,t.columns[m].style)})}),t.totalsRow){const n=r.getRow(e+i++);t.columns.forEach((c,p)=>{const m=n.getCell(a+p);if(p===0)m.value=c.totalsRowLabel;else{const b=this.getFormula(c);m.value=b?{formula:c.totalsRowFormula,result:c.totalsRowResult}:null}s(m,c.style)})}}load(s){const{table:r}=this,{row:t,col:e}=r.tl;let a=0;if(r.headerRow){const i=s.getRow(t+a++);r.columns.forEach((n,c)=>{i.getCell(e+c).value=n.name})}if(r.rows.forEach(i=>{const n=s.getRow(t+a++);i.forEach((c,p)=>{n.getCell(e+p).value=c})}),r.totalsRow){const i=s.getRow(t+a++);r.columns.forEach((n,c)=>{const p=i.getCell(e+c);c===0?p.value=n.totalsRowLabel:this.getFormula(n)&&(p.value={formula:n.totalsRowFormula,result:n.totalsRowResult})})}}get model(){return this.table}set model(s){this.table=s}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const s=o.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(s.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(s.col+e).value=null}else{for(let r=this.tableHeight;r<this._cache.tableHeight;r++){const t=this.worksheet.getRow(s.row+r);for(let e=0;e<this._cache.width;e++)t.getCell(s.col+e).value=null}for(let r=0;r<this.tableHeight;r++){const t=this.worksheet.getRow(s.row+r);for(let e=this.width;e<this._cache.width;e++)t.getCell(s.col+e).value=null}}this.store()}addRow(s,r){this.cacheState(),r===void 0?this.table.rows.push(s):this.table.rows.splice(r,0,s)}removeRows(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(s,r)}getColumn(s){const r=this.table.columns[s];return new f(this,r,s)}addColumn(s,r,t){this.cacheState(),t===void 0?(this.table.columns.push(s),this.table.rows.forEach((e,a)=>{e.push(r[a])})):(this.table.columns.splice(t,0,s),this.table.rows.forEach((e,a)=>{e.splice(t,0,r[a])}))}removeColumns(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(s,r),this.table.rows.forEach(t=>{t.splice(s,r)})}_assign(s,r,t){this.cacheState(),s[r]=t}get ref(){return this.table.ref}set ref(s){this._assign(this.table,"ref",s)}get name(){return this.table.name}set name(s){this.table.name=s}get displayName(){return this.table.displyName||this.table.name}set displayNamename(s){this.table.displayName=s}get headerRow(){return this.table.headerRow}set headerRow(s){this._assign(this.table,"headerRow",s)}get totalsRow(){return this.table.totalsRow}set totalsRow(s){this._assign(this.table,"totalsRow",s)}get theme(){return this.table.style.name}set theme(s){this.table.style.name=s}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(s){this.table.style.showFirstColumn=s}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(s){this.table.style.showLastColumn=s}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(s){this.table.style.showRowStripes=s}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(s){this.table.style.showColumnStripes=s}}},{"../utils/col-cache":19}],13:[function(w,k,M){const o=w("./worksheet"),f=w("./defined-names"),s=w("../xlsx/xlsx"),r=w("../csv/csv");k.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 f}get xlsx(){return this._xlsx||(this._xlsx=new s(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t<this._w