From fffc8c2e7605e6f11f49c26b38a47b84b340c212 Mon Sep 17 00:00:00 2001 From: Krasilnikov Roman Date: Sat, 3 Feb 2024 16:10:46 +0300 Subject: [PATCH] deploy --- ...ker-Jo2HekI2.js => app-worker-D-53jk2Z.js} | 34 +- assets/index-ZZnNO1yT.js | 384 ++++++++++++++++++ assets/index-wtU_l-Z3.js | 384 ------------------ index.html | 2 +- 4 files changed, 402 insertions(+), 402 deletions(-) rename assets/{app-worker-Jo2HekI2.js => app-worker-D-53jk2Z.js} (93%) create mode 100644 assets/index-ZZnNO1yT.js delete mode 100644 assets/index-wtU_l-Z3.js diff --git a/assets/app-worker-Jo2HekI2.js b/assets/app-worker-D-53jk2Z.js similarity index 93% rename from assets/app-worker-Jo2HekI2.js rename to assets/app-worker-D-53jk2Z.js index a073494..988b993 100644 --- a/assets/app-worker-Jo2HekI2.js +++ b/assets/app-worker-D-53jk2Z.js @@ -1,6 +1,6 @@ -var Mn=Object.defineProperty;var Cn=(Ee,ke,Ae)=>ke in Ee?Mn(Ee,ke,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Ee[ke]=Ae;var xr=(Ee,ke,Ae)=>(Cn(Ee,typeof ke!="symbol"?ke+"":ke,Ae),Ae);(function(){"use strict";function Ee(G,nt){return new Error(`${nt}: ${G}`)}function ke(G){return typeof G=="string"}function Ae(G){return typeof G=="number"}function kr(G){return typeof G=="object"&&G!==null}function Sr(G){return Array.isArray(G)}function nr(G){return kr(G)&&!Sr(G)}function Tr(G,nt,s){return{handleRequest(T){return Promise.resolve(G[T.type](T))},handleInfo:nt,castError:s}}class Mr{constructor(nt,s){this.id=nt,this.logic=s}async handleActorMessage(nt,s,T){switch(nt.type){case"error":case"success":break;case"request":{if(nt.handlerId!==this.id)return;try{const _=await this.logic.handleRequest(nt.request);_!==void 0&&T({requestId:nt.id,type:"success",result:_})}catch(_){T({requestId:nt.id,type:"error",error:this.logic.castError(_)})}break}case"loaded":this.logic.handleInfo(nt,s);break;default:throw Ee(nt,`Unknown message type: ${nt}`)}}start(){this.listen(),this.broadcast({type:"loaded",id:this.id})}}function Cr(){}class Er extends Mr{constructor(){super(...arguments);xr(this,"handleMessageEvent",s=>{this.handleActorMessage(s.data,s.source,this.broadcast)})}broadcast(s){postMessage(s)}listen(){addEventListener("message",this.handleMessageEvent)}stop(){removeEventListener("message",this.handleMessageEvent)}}const ve=(G,nt)=>Array.from(new Array(G),(s,T)=>nt(T));function ir(G,nt,s){return ve(G,()=>ve(nt,s))}function Ar(G){return G[0].map((nt,s)=>G.map(T=>T[s]))}function Rr(G){return G.map(nt=>nt.slice().reverse())}function Or(G){return G.slice().reverse()}const jr=Symbol("undefined cell");function Ke({height:G,width:nt,rows:s},T){const _=ir(G,nt,()=>jr);for(let p=0;p({cells:[],columns:[]}));for(let a=0;a(G.HTML="HTML",G.XLSX="XLSX",G.ASCII="ASCII",G))(Fe||{});const Ir="app-worker";function Nr(G){switch(G.preset){case"Default":return{collapseIndexes:!0,joinPrimitiveArrayValues:!0,combineArraysOfObjects:!1,proportionalSizeAdjustmentThreshold:1,stabilizeOrderOfPropertiesInArraysOfObjects:!0,cornerCellValue:"№"};case"Manual":{const{collapseIndexes:nt,joinPrimitiveArrayValues:s,combineArraysOfObjects:T,stabilizeOrderOfPropertiesInArraysOfObjects:_,proportionalSizeAdjustmentThreshold:p,cornerCellValue:o}=G;return{collapseIndexes:nt,joinPrimitiveArrayValues:s,combineArraysOfObjects:T,stabilizeOrderOfPropertiesInArraysOfObjects:_,proportionalSizeAdjustmentThreshold:p,cornerCellValue:o??""}}default:{const nt=G;throw new Error(`Unexpected preset "${JSON.stringify(nt)}"`)}}}function Pr(G){return nt=>{if(!G.transform)return nt;let s=Ke(nt,({type:T,value:_})=>({type:T,value:_}));return G.horizontalReflect&&(s=Rr(s)),G.verticalReflect&&(s=Or(s)),G.transpose&&(s=Ar(s)),sr(s,({type:T})=>T,({value:T})=>T)}}var or=(G=>(G.CreateTable="create-table",G))(or||{}),we=(G=>(G.Header="header",G.Index="index",G.Value="value",G.Corner="corner",G))(we||{});const Br={height:"width",width:"height"},Dr={head:"height",indexes:"width"},ar={head:"indexes",indexes:"head"};function Ze(G){return{head:null,indexes:null,body:{height:1,width:1,rows:[{cells:[{height:1,width:1,value:G,type:"value"}],columns:[0]}]}}}function Fr(G){return(nt,s)=>(nt-s)/s<=G}function Oe(G,nt){return G.map(s=>s+nt)}function Lr(G,nt){return{cells:[nt].concat(G.cells),columns:[0].concat(Oe(G.columns,nt.width))}}function zr(G,nt){return G.map(s=>({cells:s.cells,columns:Oe(s.columns,nt)}))}function Ur(G,nt,s){return{cells:G.cells.concat(s.cells),columns:G.columns.concat(Oe(s.columns,nt))}}function Hr(G,nt,s){const T=ve(s,()=>({cells:[],columns:[]}));for(let _=0;_({cells:s.cells.map(T=>({...T,width:T.width*nt})),columns:s.columns.map(T=>T*nt)}))}const Ye=(G,nt)=>G+nt,je=(G,nt)=>G>nt?G:nt,lr=(G,nt)=>G?lr(nt%G,G):nt,Le=(G,nt)=>G*nt/lr(G,nt);function Vr({blocks:G,width:nt,heightIsLcm:s=!0,height:T,widthIsLcm:_=!0}){const p=G.map(o=>{const a=_?nt/o.width:1,r=s?T/o.height:1,t=ve(T,()=>new Array(nt));for(let e=0;e0),_=new Array(s);for(let o=0;ou.xTopRightCorner)&&(T[i]=n)}}const _=new Set,p=new Map;for(let o=0;o{const o=Math.floor(nt/p[G]),a={[G]:nt,[s]:p[s],rows:o===1?p.rows:T(p.rows,o,nt)};return nt-p[G]*o===0?a:_(a)}}function Zr(G){return function(s){let T=s[0].width,_=T;for(let r=1;r{let s=nt[0].height,T=s;for(let r=1;r({cells:[],columns:[]}));let a=0;for(let r=0;rnt.width?G:nt}function Jr(G,nt){return G.height===nt.height?G.widthnt.height?G:nt}const Qr={head:Gr,indexes:Jr};function tn(G,nt,s){const{[nt]:T}=G[0];if(!T)return null;const _=Qr[nt],p=[T];let o=T,a=T.height,r=T.width,t=T.height,e=T.width;for(let i=1;i{if(!G&&!nt)return T;const o=G&&_!==null,a=nt&&p!==null,r=a?p.rows.map((i,u)=>Ur(i,p.width,T.rows[u])):T.rows,t=T.width+(a?p.width:0);if(!o)return{height:T.height,width:t,rows:r};const e=T.height+_.height;if(!a)return{height:e,width:t,rows:_.rows.concat(r)};const l=_.rows[0],n=[Lr(l,{height:_.height,width:p.width,value:s,type:we.Corner}),...zr(_.rows.slice(1),p.width),...r];return{height:e,width:t,rows:n}}}function en(G,nt,s,T,_){const p=[];for(let o=0;o({cells:[],columns:[]})),...r.rows]});break;case"head":p.push({height:r.height,width:r.width+t.width,rows:[{cells:[{height:r.height,width:t.width,value:T,type:we.Corner},...r.rows[0].cells],columns:[0,...Oe(r.rows[0].columns,t.width)]},...r.rows.slice(1)]});break;default:throw new Error(`Unknown table component: ${nt}`)}}return _(p)}const rn={head:Zr,indexes:Yr};function hr({deduplicationComponent:G,isProportionalResize:nt,cornerCellValue:s}){const T=rn[G](nt),_=ar[G];return p=>{const o=tn(p,G,nt),a=o===null,r=en(p,_,a,s,T),t=p.map(ur({[G]:a,[_]:r===null,cornerCellValue:s})),e=T(t),l=Dr[_],n=o&&Ge(l,e[l])(o);return{body:e,baked:t,[G]:n,[_]:r}}}function nn(G){let nt=0;for(let s=0;s0?G.padStart(_+G.length):G).padEnd(nt)}default:return T.length===1&&!isNaN(Number(G))?G.padStart(nt):G.padEnd(nt)}}var fr=(G=>(G.MySQL="MySql",G.MarkdownLike="Markdown Like",G))(fr||{});Object.values(fr);function dr(G,nt,s,T){for(let _=0;_{const i=(typeof t.value=="string"?t.value:JSON.stringify(t.value,null,2)).split(` -`).map(u=>` ${u.trim()} `);return{cell:t,rowIndex:e,collIndex:l,lines:i,maxRowLength:nn(i)}}),T=ve(G.width+1,()=>0),_=ve(G.height+1,()=>0);un[nt](G,s,T,_);for(let t=1;t<=G.width;t++)T[t]+=T[t-1];for(let t=1;t<=G.height;t++)_[t]+=_[t-1];const p=G.height+_[G.height],o=G.width+T[G.width],a=ir(p,o,()=>null),r=new Set;for(let t=0;t=d&&vt.join("")).join(` -`)}function pr(G){return G.replace(/[&<"']/g,function(nt){switch(nt){case"&":return"&";case"<":return"<";case'"':return""";default:return"'"}})}const mr=(G,nt,s="")=>` +var Sn=Object.defineProperty;var Tn=(Ee,ke,Ae)=>ke in Ee?Sn(Ee,ke,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Ee[ke]=Ae;var Sr=(Ee,ke,Ae)=>(Tn(Ee,typeof ke!="symbol"?ke+"":ke,Ae),Ae);(function(){"use strict";function Ee(G,nt){return new Error(`${nt}: ${G}`)}function ke(G){return typeof G=="string"}function Ae(G){return typeof G=="number"}function Tr(G){return typeof G=="object"&&G!==null}function Mr(G){return Array.isArray(G)}function sr(G){return Tr(G)&&!Mr(G)}function Cr(G,nt,s){return{handleRequest(T){return Promise.resolve(G[T.type](T))},handleInfo:nt,castError:s}}class Er{constructor(nt,s){this.id=nt,this.logic=s}async handleActorMessage(nt,s,T){switch(nt.type){case"error":case"success":break;case"request":{if(nt.handlerId!==this.id)return;try{const _=await this.logic.handleRequest(nt.request);_!==void 0&&T({requestId:nt.id,type:"success",result:_})}catch(_){T({requestId:nt.id,type:"error",error:this.logic.castError(_)})}break}case"loaded":this.logic.handleInfo(nt,s);break;default:throw Ee(nt,`Unknown message type: ${nt}`)}}start(){this.listen(),this.broadcast({type:"loaded",id:this.id})}}function Ar(){}class Rr extends Er{constructor(){super(...arguments);Sr(this,"handleMessageEvent",s=>{this.handleActorMessage(s.data,s.source,this.broadcast)})}broadcast(s){postMessage(s)}listen(){addEventListener("message",this.handleMessageEvent)}stop(){removeEventListener("message",this.handleMessageEvent)}}const _e=(G,nt)=>Array.from(new Array(G),(s,T)=>nt(T));function or(G,nt,s){return _e(G,()=>_e(nt,s))}function Or(G){return G[0].map((nt,s)=>G.map(T=>T[s]))}function jr(G){return G.map(nt=>nt.slice().reverse())}function Ir(G){return G.slice().reverse()}var ve=(G=>(G.Header="header",G.Index="index",G.Value="value",G.Corner="corner",G))(ve||{});const Nr={head:"height",indexes:"width"},ar={head:"indexes",indexes:"head"};function Be(G){return{head:null,indexes:null,body:{height:1,width:1,data:{rows:[{cells:[{height:1,width:1,value:G,type:"value"}],columns:[0]}],indexes:[0]}}}}function Pr(G){return(nt,s)=>(nt-s)/s<=G}function Fe(G,nt){for(let s=0;sG+nt,Oe=(G,nt)=>G>nt?G:nt,lr=(G,nt)=>G?lr(nt%G,G):nt,Le=(G,nt)=>G*nt/lr(G,nt);function Fr({blocks:G,width:nt,heightIsLcm:s=!0,height:T,widthIsLcm:_=!0}){const p=G.map(o=>{const a=_?nt/o.width:1,r=s?T/o.height:1,{rows:t,indexes:e}=o.data,l=_e(T,()=>new Array(nt));for(let n=0;n0),_=new Array(s),{rows:p}=G;for(let a=0;ad.xTopRightCorner)&&(T[c]=u)}}const o=new Set,a=new Map;for(let r=0;r<_.length;r++){const t=p[r],e=T[t];if(!e||o.has(e.cell))continue;o.add(e.cell);const l=s-e.xTopRightCorner;if(l<=0)continue;const n=a.get(r)||new Map;a.set(r,n.set(e.indexInRow,l))}cr(G,a,"width")}const Ur={width:Dr,height:Br},Hr={width:zr,height:Lr};function Ye(G,nt){const s=Ur[G],T=Hr[G];return _=>{const p=Math.floor(nt/_[G]);p>1&&s(_.data,p);let o=_[G];_[G]=nt,nt-o*p>0&&T(_)}}function Ge(G,nt){const s=new Array(0),T=new Array(0);let _=0;for(let p=0;p({cells:[],columns:[]}));let T=0;for(let p=0;p{let s=nt[0].height,T=s;for(let o=1;ont.width?G:nt}function Wr(G,nt){return G.height===nt.height?G.widthnt.height?G:nt}const Xr={head:qr,indexes:Wr};function Kr(G,nt,s){const{[nt]:T}=G[0];if(!T)return null;const _=Xr[nt],p=[T];let o=T,a=T.height,r=T.width,t=T.height,e=T.width;for(let i=1;i{if(!G&&!nt)return T;const o=G&&_!==null,a=nt&&p!==null,r=a?Je([p,T],T.height):T,t=T.width+(a?p.width:0);if(!o)return r;if(!a)return Ge([_,r],t);for(let l=0;l<_.data.rows.length;l++)Fe(_.data.rows[l].columns,p.width);const e=_.data.rows[0];return e.cells.unshift({height:_.height,width:p.width,value:s,type:ve.Corner}),e.columns.unshift(0),Ge([_,r],t)}}function Zr(G,nt,s,T){const _=[];for(let p=0;p{const o=Kr(p,G,nt),a=o===null,r=Zr(p,_,a,s),t=p.map(hr({[G]:a,[_]:r===null,cornerCellValue:s})),e=T(t),l=Nr[_];return o&&Ye(l,e[l])(o),{body:e,baked:t,[G]:o,[_]:r&&T(r)}}}const Gr=Symbol("undefined cell");function Qe({height:G,width:nt,data:s},T){const _=or(G,nt,()=>Gr);for(let p=0;p({cells:[],columns:[]}));for(let r=0;r(G.HTML="HTML",G.XLSX="XLSX",G.ASCII="ASCII",G))(ze||{});const Jr="app-worker";function Qr(G){switch(G.preset){case"Default":return{collapseIndexes:!0,joinPrimitiveArrayValues:!0,combineArraysOfObjects:!1,proportionalSizeAdjustmentThreshold:1,stabilizeOrderOfPropertiesInArraysOfObjects:!0,cornerCellValue:"№"};case"Manual":{const{collapseIndexes:nt,joinPrimitiveArrayValues:s,combineArraysOfObjects:T,stabilizeOrderOfPropertiesInArraysOfObjects:_,proportionalSizeAdjustmentThreshold:p,cornerCellValue:o}=G;return{collapseIndexes:nt,joinPrimitiveArrayValues:s,combineArraysOfObjects:T,stabilizeOrderOfPropertiesInArraysOfObjects:_,proportionalSizeAdjustmentThreshold:p,cornerCellValue:o??""}}default:{const nt=G;throw new Error(`Unexpected preset "${JSON.stringify(nt)}"`)}}}function tn(G){return nt=>{if(!G.transform)return nt;let s=Qe(nt,({type:T,value:_})=>({type:T,value:_}));return G.horizontalReflect&&(s=jr(s)),G.verticalReflect&&(s=Ir(s)),G.transpose&&(s=Or(s)),dr(s,({type:T})=>T,({value:T})=>T)}}var pr=(G=>(G.CreateTable="create-table",G))(pr||{});function en(G){let nt=0;for(let s=0;s0?G.padStart(_+G.length):G).padEnd(nt)}default:return T.length===1&&!isNaN(Number(G))?G.padStart(nt):G.padEnd(nt)}}var mr=(G=>(G.MySQL="MySql",G.MarkdownLike="Markdown Like",G))(mr||{});Object.values(mr);function br(G,nt,s,T){for(let _=0;_{const i=(typeof t.value=="string"?t.value:JSON.stringify(t.value,null,2)).split(` +`).map(u=>` ${u.trim()} `);return{cell:t,rowIndex:e,collIndex:l,lines:i,maxRowLength:en(i)}}),T=_e(G.width+1,()=>0),_=_e(G.height+1,()=>0);ln[nt](G,s,T,_);for(let t=1;t<=G.width;t++)T[t]+=T[t-1];for(let t=1;t<=G.height;t++)_[t]+=_[t-1];const p=G.height+_[G.height],o=G.width+T[G.width],a=or(p,o,()=>null),r=new Set;for(let t=0;t=d&&vt.join("")).join(` +`)}function gr(G){return G.replace(/[&<"']/g,function(nt){switch(nt){case"&":return"&";case"<":return"<";case'"':return""";default:return"'"}})}const yr=(G,nt,s="")=>` @@ -14,17 +14,17 @@ var Mn=Object.defineProperty;var Cn=(Ee,ke,Ae)=>ke in Ee?Mn(Ee,ke,{enumerable:!0 ${nt} -`,dn="table, th, td {border: 1px solid black; border-collapse: collapse;} th, td {padding: 5px; text-align: left;} th:has(> b), td:has(> b) {text-align: center;}";function br(G){return`${G.rows.map(nt=>`${nt.cells.map(s=>{const T=typeof s.value=="string"?pr(s.value):s.value;return``}).join(` -`)}`).join(` -`)}
${s.type!==we.Value?`${T}`:T}
`}function pn(G){return G.length>1?G.map(([nt,s])=>`

${nt}

${br(s)}`).join("
"):br(G[0][1])}var Yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(G){throw new Error('Could not dynamically require "'+G+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gr={exports:{}};/*! ExcelJS 19-10-2023 */(function(G,nt){(function(s){G.exports=s()})(function(){return function s(T,_,p){function o(t,e){if(!_[t]){if(!T[t]){var l=typeof ze=="function"&&ze;if(!e&&l)return l(t,!0);if(a)return a(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=_[t]={exports:{}};T[t][0].call(i.exports,function(u){return o(T[t][1][u]||u)},i,i.exports,s,T,_,p)}return _[t].exports}for(var a=typeof ze=="function"&&ze,r=0;r{const d=this.workbook.addWorksheet(u.sheetName),f=u.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],v=u.map||function(A){if(A==="")return null;const I=Number(A);if(!Number.isNaN(I)&&I!==1/0)return I;const F=f.reduce((P,D)=>{if(P)return P;const U=t(A,D,!0);return U.isValid()?U:null},null);if(F)return new Date(F.valueOf());const j=n[A];return j!==void 0?j:A},x=o.parse(u.parserOptions).on("data",A=>{d.addRow(A.map(v))}).on("end",()=>{x.emit("worksheet",d)});x.on("worksheet",h).on("error",c),i.pipe(x)})}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(i,u){return new Promise((h,c)=>{u=u||{};const d=this.workbook.getWorksheet(u.sheetName||u.sheetId),f=o.format(u.formatterOptions);i.on("finish",()=>{h()}),f.on("error",c),f.pipe(i);const{dateFormat:v,dateUTC:x}=u,A=u.map||(j=>{if(j){if(j.text||j.hyperlink)return j.hyperlink||j.text||"";if(j.formula||j.result)return j.result||"";if(j instanceof Date)return v?x?t.utc(j).format(v):t(j).format(v):x?t.utc(j).format():t(j).format();if(j.error)return j.error;if(typeof j=="object")return JSON.stringify(j)}return j}),I=u.includeEmptyRows===void 0||u.includeEmptyRows;let F=1;d&&d.eachRow((j,P)=>{if(I)for(;F++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){const l=p.decodeAddress(t);this.nativeCol=l.col+e,this.nativeColOff=0,this.nativeRow=l.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 o||r==null?r:new o(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}}T.exports=o},{"../utils/col-cache":19}],3:[function(s,T,_){const p=s("../utils/col-cache"),o=s("../utils/under-dash"),a=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,u,h){if(!i||!u)throw new Error("A Cell needs a Row");this._row=i,this._column=u,p.validateAddress(h),this._address=h,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,u.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(i){this.style.numFmt=i}get font(){return this.style.font}set font(i){this.style.font=i}get alignment(){return this.style.alignment}set alignment(i){this.style.alignment=i}get border(){return this.style.border}set border(i){this.style.border=i}get fill(){return this.style.fill}set fill(i){this.style.fill=i}get protection(){return this.style.protection}set protection(i){this.style.protection=i}_mergeStyle(i,u,h){const c=i&&i.numFmt||u&&u.numFmt;c&&(h.numFmt=c);const d=i&&i.font||u&&u.font;d&&(h.font=d);const f=i&&i.alignment||u&&u.alignment;f&&(h.alignment=f);const v=i&&i.border||u&&u.border;v&&(h.border=v);const x=i&&i.fill||u&&u.fill;x&&(h.fill=x);const A=i&&i.protection||u&&u.protection;return A&&(h.protection=A),h}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(i,u){this._value.release(),this._value=l.create(e.Types.Merge,this,i),u||(this.style=i.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(i){return this._value.type===e.Types.Merge&&this._value.isMergedTo(i)}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(i){this.type!==e.Types.Merge?(this._value.release(),this._value=l.create(l.getType(i),this,i)):this._value.master.value=i}get note(){return this._comment&&this._comment.note}set note(i){this._comment=new t(i)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(i){this.type===e.Types.String&&(this._value=l.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:i}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:i}=this._row;return{sheetName:i.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(i){this.names=[i]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(i){const{definedNames:u}=this.workbook;u.removeAllNames(this.fullAddress),i.forEach(h=>{u.addEx(this.fullAddress,h)})}addName(i){this.workbook.definedNames.addEx(this.fullAddress,i)}removeName(i){this.workbook.definedNames.removeEx(this.fullAddress,i)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(i){this._dataValidations.add(this.address,i)}get model(){const{model:i}=this._value;return i.style=this.style,this._comment&&(i.comment=this._comment.model),i}set model(i){if(this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment)switch(i.comment.type){case"note":this._comment=t.fromModel(i.comment)}i.style?this.style=i.style:this.style={}}}e.Types=a.ValueType;const l={getType:n=>n==null?e.Types.Null:n instanceof String||typeof n=="string"?e.Types.String:typeof n=="number"?e.Types.Number:typeof n=="boolean"?e.Types.Boolean:n instanceof Date?e.Types.Date:n.text&&n.hyperlink?e.Types.Hyperlink:n.formula||n.sharedFormula?e.Types.Formula:n.richText?e.Types.RichText:n.sharedString?e.Types.SharedString:n.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(n){this.model={address:n.address,type:e.Types.Null}}get value(){return null}set value(n){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Number,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Date,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Hyperlink,text:i?i.text:void 0,hyperlink:i?i.hyperlink:void 0},i&&i.tooltip&&(this.model.tooltip=i.tooltip)}get value(){const n={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(n.tooltip=this.model.tooltip),n}set value(n){this.model={text:n.text,hyperlink:n.hyperlink},n.tooltip&&(this.model.tooltip=n.tooltip)}get text(){return this.model.text}set text(n){this.model.text=n}get hyperlink(){return this.model.hyperlink}set hyperlink(n){this.model.hyperlink=n}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(n,i){this.cell=n,this.model={address:n.address,type:e.Types.Formula,shareType:i?i.shareType:void 0,ref:i?i.ref:void 0,formula:i?i.formula:void 0,sharedFormula:i?i.sharedFormula:void 0,result:i?i.result:void 0}}_copyModel(n){const i={},u=h=>{const c=n[h];c&&(i[h]=c)};return u("formula"),u("result"),u("ref"),u("shareType"),u("sharedFormula"),i}get value(){return this._copyModel(this.model)}set value(n){this.model=this._copyModel(n)}validate(n){switch(l.getType(n)){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(n){this.model.formula=n}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(n){this.model.result=n}get type(){return e.Types.Formula}get effectiveType(){const n=this.model.result;return n==null?a.ValueType.Null:n instanceof String||typeof n=="string"?a.ValueType.String:typeof n=="number"?a.ValueType.Number:n instanceof Date?a.ValueType.Date:n.text&&n.hyperlink?a.ValueType.Hyperlink:n.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(n){this.model.address=n}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:n}=this.cell,i=n.findCell(this.model.sharedFormula);this._translatedFormula=i&&r(i.formula,i.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(n,i){this.model={address:n.address,type:e.Types.Merge,master:i?i.address:void 0},this._master=i,i&&i.addMergeRef()}get value(){return this._master.value}set value(n){n instanceof e?(this._master&&this._master.releaseMergeRef(),n.addMergeRef(),this._master=n):this._master.value=n}isMergedTo(n){return n===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(n){this.model.address=n}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:JSON.stringify(i),rawValue:i}}get value(){return this.model.rawValue}set value(n){this.model.rawValue=n,this.model.value=JSON.stringify(n)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.SharedString,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}toString(){return this.model.value.richText.map(n=>n.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Boolean,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Error,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((n,i)=>(n[i.t]=i.f,n),[]),create(n,i,u){const h=this.types[n];if(!h)throw new Error("Could not create Value of type "+n);return new h(i,u)}};T.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(s,T,_){const p=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache");class r{constructor(e,l,n){this._worksheet=e,this._number=l,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.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((l,n)=>{this._worksheet.getCell(n+1,this.number).value=l})):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&&p.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,l){const n=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(i,u)=>{l(i.getCell(n),u)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==o.ValueType.Null&&(e[n]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let n=0;e.hasOwnProperty("0")&&(n=1),e.forEach((i,u)=>{this._worksheet.getCell(u+n,l).value=i})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(n=>{n[e]=l}),l}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 l=[];let n=null;return e&&e.forEach((i,u)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=u+1:(n={min:u+1,max:u+1,width:i.width!==void 0?i.width:9,style:i.style,isCustomWidth:i.isCustomWidth,hidden:i.hidden,outlineLevel:i.outlineLevel,collapsed:i.collapsed},l.push(n))}),l.length?l:void 0}static fromModel(e,l){const n=[];let i=1,u=0;for(l=(l=l||[]).sort(function(h,c){return h.min-c.min});u{l.removeCellEx(e)})}forEach(e){p.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(o.decodeEx(e))}getNamesEx(e){return p.map(this.matrixMap,(l,n)=>l.findCellEx(e)&&n).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:n}=l,i=new r(l.row,l.col,l.row,l.col,n);let u,h;function c(f,v){const x=e.findCellAt(n,f,l.col);return!(!x||!x.mark)&&(i[v]=f,x.mark=!1,!0)}for(h=l.row-1;c(h,"top");h--);for(h=l.row+1;c(h,"bottom");h++);function d(f,v){const x=[];for(h=i.top;h<=i.bottom;h++){const A=e.findCellAt(n,h,f);if(!A||!A.mark)return!1;x.push(A)}i[v]=f;for(let A=0;A{n.mark=!0}),{name:e,ranges:l.map(n=>n.mark&&this._explore(l,n)).filter(Boolean).map(n=>n.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(n,i,u)=>{n&&(n.row===i&&n.col===u||(n.row=i,n.col=u,n.address=o.n2l(u)+i))})}spliceRows(e,l,n,i){p.each(this.matrixMap,u=>{u.spliceRows(e,l,n,i),this.normaliseMatrix(u,e)})}spliceColumns(e,l,n,i){p.each(this.matrixMap,u=>{u.spliceColumns(e,l,n,i),this.normaliseMatrix(u,e)})}get model(){return p.map(this.matrixMap,(e,l)=>this.getRanges(l,e)).filter(e=>e.ranges.length)}set model(e){const l=this.matrixMap={};e.forEach(n=>{const i=l[n.name]=new a;n.ranges.forEach(u=>{t.test(u.split("!").pop()||"")&&i.addCell(u)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(s,T,_){T.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(s,T,_){const p=s("../utils/col-cache"),o=s("./anchor");T.exports=class{constructor(a,r){this.worksheet=a,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(a){let{type:r,imageId:t,range:e,hyperlinks:l}=a;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=p.decode(e);this.range={tl:new o(this.worksheet,{col:n.left,row:n.top},-1),br:new o(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new o(this.worksheet,e.tl,0),br:e.br&&new o(this.worksheet,e.br,0),ext:e.ext,editAs:e.editAs,hyperlinks:l||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(s,T,_){const p=s("../utils/under-dash");class o{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 p.deepMerge({},o.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 o;return t.model=r,t}}o.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=o},{"../utils/under-dash":26}],10:[function(s,T,_){const p=s("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=p.decodeAddress(r),u=p.decodeAddress(t);this.model={top:Math.min(i.row,u.row),left:Math.min(i.col,u.col),bottom:Math.max(i.row,u.row),right:Math.max(i.col,u.col),sheetName:e},this.setTLBR(i.row,i.col,u.row,u.col,n)}else this.model={top:Math.min(r,e),left:Math.min(t,l),bottom:Math.max(r,e),right:Math.max(t,l),sheetName:n}}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 o)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=p.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,l){(!this.model.top||rthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=p.decodeEx(r);this.expand(t.row,t.col,t.row,t.col)}get tl(){return p.n2l(this.left)+this.top}get $t$l(){return`$${p.n2l(this.left)}$${this.top}`}get br(){return p.n2l(this.right)+this.bottom}get $b$r(){return`$${p.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.bottomthis.bottom)&&!(r.rightthis.right)}contains(r){const t=p.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(p.encodeAddress(e,t),e,t)}}T.exports=o},{"../utils/col-cache":19}],11:[function(s,T,_){const p=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache"),r=s("./cell");T.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 l=this._worksheet.getColumn(t.col);e=new r(this,l,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:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),u=2;u0)for(d=c;d>=l;d--)f=this._cells[d-1],f?(v=this.getCell(d+h),v.value=f.value,v.style=f.style,v._comment=f._comment):this._cells[d+h-1]=void 0;for(d=0;d{l&&l.type!==o.ValueType.Null&&e(l,n+1)})}addPageBreak(t,e){const l=this._worksheet,n=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,u={id:this._number,max:i,man:1};n&&(u.min=n),l.rowBreaks.push(u)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==o.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((l,n)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,n+e),row:this._number,col:n+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[l])})}get hasValues(){return p.some(this._cells,t=>t&&t.type!==o.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(l=>{l&&l.type!==o.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[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,l=0;return this._cells.forEach(n=>{if(n){const i=n.model;i&&((!e||e>n.col)&&(e=n.col),l{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=a.decodeAddress(l.address);else if(e){const{row:i}=e,u=e.col+1;n={row:i,col:u,address:a.encodeAddress(i,u),$col$row:`$${a.n2l(u)}$${i}`}}e=n,this.getCellEx(n).model=l;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(s,T,_){const p=s("../utils/col-cache");class o{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)}}T.exports=class{constructor(a,r){this.worksheet=a,r&&(this.table=r,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.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:a}=this,r=(h,c,d)=>{h[c]===void 0&&(h[c]=d)};r(a,"headerRow",!0),r(a,"totalsRow",!1),r(a,"style",{}),r(a.style,"theme","TableStyleMedium2"),r(a.style,"showFirstColumn",!1),r(a.style,"showLastColumn",!1),r(a.style,"showRowStripes",!1),r(a.style,"showColumnStripes",!1);const t=(h,c)=>{if(!h)throw new Error(c)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=p.decodeAddress(a.ref);const{row:e,col:l}=a.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:n,filterHeight:i,tableHeight:u}=this;a.autoFilterRef=p.encode(e,l,e+i-1,l+n-1),a.tableRef=p.encode(e,l,e+u-1,l+n-1),a.columns.forEach((h,c)=>{t(h.name,`Column ${c} must have a name`),c===0?r(h,"totalsRowLabel","Total"):(r(h,"totalsRowFunction","none"),h.totalsRowFormula=this.getFormula(h))})}store(){const a=(i,u)=>{u&&Object.keys(u).forEach(h=>{i[h]=u[h]})},{worksheet:r,table:t}=this,{row:e,col:l}=t.tl;let n=0;if(t.headerRow){const i=r.getRow(e+n++);t.columns.forEach((u,h)=>{const{style:c,name:d}=u,f=i.getCell(l+h);f.value=d,a(f,c)})}if(t.rows.forEach(i=>{const u=r.getRow(e+n++);i.forEach((h,c)=>{const d=u.getCell(l+c);d.value=h,a(d,t.columns[c].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((u,h)=>{const c=i.getCell(l+h);if(h===0)c.value=u.totalsRowLabel;else{const d=this.getFormula(u);c.value=d?{formula:u.totalsRowFormula,result:u.totalsRowResult}:null}a(c,u.style)})}}load(a){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=a.getRow(t+l++);r.columns.forEach((i,u)=>{n.getCell(e+u).value=i.name})}if(r.rows.forEach(n=>{const i=a.getRow(t+l++);n.forEach((u,h)=>{i.getCell(e+h).value=u})}),r.totalsRow){const n=a.getRow(t+l++);r.columns.forEach((i,u)=>{const h=n.getCell(e+u);u===0?h.value=i.totalsRowLabel:this.getFormula(i)&&(h.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const a=p.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(a,r)}getColumn(a){const r=this.table.columns[a];return new o(this,r,a)}addColumn(a,r,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(a){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,r),this.table.rows.forEach(t=>{t.splice(a,r)})}_assign(a,r,t){this.cacheState(),a[r]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(s,T,_){const p=s("./worksheet"),o=s("./defined-names"),a=s("../xlsx/xlsx"),r=s("../csv/csv");T.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 o}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t(c&&c.orderNo)>h?c.orderNo:h,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),u=new p(i);return this._worksheets[l]=u,u}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(e=>e&&e.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,e)=>t.orderNo-e.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(e=>{t(e,e.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}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(t=>t.model),sheets:this.worksheets.map(t=>t.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(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(e=>{const{id:l,name:n,state:i}=e,u=t.sheets&&t.sheets.findIndex(h=>h.id===l);(this._worksheets[l]=new p({id:l,name:n,orderNo:u,state:i,workbook:this})).model=e}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(s,T,_){const p=s("../utils/under-dash"),o=s("../utils/col-cache"),a=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),u=s("../utils/encryptor"),{copyStyle:h}=s("../utils/copy-style");T.exports=class{constructor(c){c=c||{},this._workbook=c.workbook,this.id=c.id,this.orderNo=c.orderNo,this.name=c.name,this.state=c.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},c.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:!(!c.pageSetup||!c.pageSetup.fitToWidth&&!c.pageSetup.fitToHeight||c.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},c.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},c.headerFooter),this.dataValidations=new i,this.views=c.views||[],this.autoFilter=c.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(c){if(c===void 0&&(c="sheet"+this.id),this._name!==c){if(typeof c!="string")throw new Error("The name has to be a string.");if(c==="")throw new Error("The name can't be empty.");if(c==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(c))throw new Error(`Worksheet name ${c} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(c))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+c);if(c&&c.length>31&&(console.warn(`Worksheet name ${c} exceeds 31 chars. This will be truncated`),c=c.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===c.toLowerCase()))throw new Error("Worksheet name already exists: "+c);this._name=c}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const c=new a;return this._rows.forEach(d=>{if(d){const f=d.dimensions;f&&c.expand(d.number,f.min,d.number,f.max)}}),c}get columns(){return this._columns}set columns(c){this._headerRowCount=c.reduce((v,x)=>{const A=(x.header?1:x.headers&&x.headers.length)||0;return Math.max(v,A)},0);let d=1;const f=this._columns=[];c.forEach(v=>{const x=new t(this,d++,!1);f.push(x),x.defn=v})}getColumnKey(c){return this._keys[c]}setColumnKey(c,d){this._keys[c]=d}deleteColumnKey(c){delete this._keys[c]}eachColumnKey(c){p.each(this._keys,c)}getColumn(c){if(typeof c=="string"){const d=this._keys[c];if(d)return d;c=o.l2n(c)}if(this._columns||(this._columns=[]),c>this._columns.length){let d=this._columns.length+1;for(;d<=c;)this._columns.push(new t(this,d++))}return this._columns[c-1]}spliceColumns(c,d){const f=this._rows.length;for(var v=arguments.length,x=new Array(v>2?v-2:0),A=2;A0)for(let P=0;P{D.push(B[P]||null)});const U=this.getRow(P+1);U.splice.apply(U,D)}else this._rows.forEach(P=>{P&&P.splice(c,d)});const I=x.length-d,F=c+d,j=this._columns.length;if(I<0)for(let P=c+x.length;P<=j;P++)this.getColumn(P).defn=this.getColumn(P-I).defn;else if(I>0)for(let P=j;P>=F;P--)this.getColumn(P+I).defn=this.getColumn(P).defn;for(let P=c;P{c=Math.max(c,d.cellCount)}),c}get actualColumnCount(){const c=[];let d=0;return this.eachRow(f=>{f.eachCell(v=>{let{col:x}=v;c[x]||(c[x]=!0,d++)})}),d}_commitRow(){}get _lastRowNumber(){const c=this._rows;let d=c.length;for(;d>0&&c[d-1]===void 0;)d--;return d}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(c){return this._rows[c-1]}findRows(c,d){return this._rows.slice(c-1,c-1+d)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let c=0;return this.eachRow(()=>{c++}),c}getRow(c){let d=this._rows[c-1];return d||(d=this._rows[c-1]=new r(this,c)),d}getRows(c,d){if(d<1)return;const f=[];for(let v=c;v1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,v=this.getRow(f);return v.values=c,this._setStyleOption(f,d[0]==="i"?d:"n"),v}addRows(c){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return c.forEach(v=>{f.push(this.addRow(v,d))}),f}insertRow(c,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(c,0,d),this._setStyleOption(c,f),this.getRow(c)}insertRows(c,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(c,0,...d),f!=="n")for(let v=0;v1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(c+1)!==void 0?this._copyStyle(c+1,c,d[1]==="+"):d[0]==="i"&&this.findRow(c-1)!==void 0&&this._copyStyle(c-1,c,d[1]==="+")}_copyStyle(c,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this.getRow(c),x=this.getRow(d);x.style=h(v.style),v.eachCell({includeEmpty:f},(A,I)=>{x.getCell(I).style=h(A.style)}),x.height=v.height}duplicateRow(c,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this._rows[c-1],x=new Array(d).fill(v.values);this.spliceRows(c+1,f?0:d,...x);for(let A=0;A{I.getCell(j).style=F.style})}}spliceRows(c,d){const f=c+d;for(var v=arguments.length,x=new Array(v>2?v-2:0),A=2;A{U.getCell(k).style=B.style}),this._rows[P-1]=void 0}else this._rows[P+F-1]=void 0;else if(F>0)for(P=j;P>=f;P--)if(D=this._rows[P-1],D){const U=this.getRow(P+F);U.values=D.values,U.style=D.style,U.height=D.height,D.eachCell({includeEmpty:!0},(B,k)=>{if(U.getCell(k).style=B.style,B._value.constructor.name==="MergeValue"){const C=this.getRow(B._row._number+I).getCell(k),w=B._value._master,m=this.getRow(w._row._number+I).getCell(w._column._number);C.merge(m)}})}else this._rows[P+F-1]=void 0;for(P=0;P{f&&f.hasValues&&d(f,f.number)})}getSheetValues(){const c=[];return this._rows.forEach(d=>{d&&(c[d.number]=d.values)}),c}findCell(c,d){const f=o.getAddress(c,d),v=this._rows[f.row-1];return v?v.findCell(f.col):void 0}getCell(c,d){const f=o.getAddress(c,d);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var c=arguments.length,d=new Array(c),f=0;f{if(v.intersects(c))throw new Error("Cannot merge already merged cells")});const f=this.getCell(c.top,c.left);for(let v=c.top;v<=c.bottom;v++)for(let x=c.left;x<=c.right;x++)(v>c.top||x>c.left)&&this.getCell(v,x).merge(f,d);this._merges[f.address]=c}_unMergeMaster(c){const d=this._merges[c.address];if(d){for(let f=d.top;f<=d.bottom;f++)for(let v=d.left;v<=d.right;v++)this.getCell(f,v).unmerge();delete this._merges[c.address]}}get hasMerges(){return p.some(this._merges,Boolean)}unMergeCells(){for(var c=arguments.length,d=new Array(c),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const x=o.decode(c),{top:A,left:I,bottom:F,right:j}=x,P=j-I+1,D=o.encodeAddress(A,I),U=v==="shared";let B;B=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(C,w)=>f[C-A][w-I]:(C,w)=>f[(C-A)*P+(w-I)]:()=>{};let k=!0;for(let C=A;C<=F;C++)for(let w=I;w<=j;w++)k?(this.getCell(C,w).value={shareType:v,formula:d,ref:c,result:B(C,w)},k=!1):this.getCell(C,w).value=U?{sharedFormula:D,result:B(C,w)}:B(C,w)}addImage(c,d){const f={type:"image",imageId:c,range:d};this._media.push(new l(this,f))}getImages(){return this._media.filter(c=>c.type==="image")}addBackgroundImage(c){const d={type:"background",imageId:c};this._media.push(new l(this,d))}getBackgroundImageId(){const c=this._media.find(d=>d.type==="background");return c&&c.imageId}protect(c,d){return new Promise(f=>{this.sheetProtection={sheet:!0},d&&"spinCount"in d&&(d.spinCount=Number.isFinite(d.spinCount)?Math.round(Math.max(0,d.spinCount)):1e5),c&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=u.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=u.convertPasswordToHash(c,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),d&&(this.sheetProtection=Object.assign(this.sheetProtection,d),!c&&"spinCount"in d&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(c){const d=new n(this,c);return this.tables[c.name]=d,d}getTable(c){return this.tables[c]}removeTable(c){delete this.tables[c]}getTables(){return Object.values(this.tables)}addConditionalFormatting(c){this.conditionalFormattings.push(c)}removeConditionalFormatting(c){typeof c=="number"?this.conditionalFormattings.splice(c,1):this.conditionalFormattings=c instanceof Function?this.conditionalFormattings.filter(c):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(c){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=c}get model(){const c={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(v=>v.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(v=>v.model),conditionalFormattings:this.conditionalFormattings};c.cols=t.toModel(this.columns);const d=c.rows=[],f=c.dimensions=new a;return this._rows.forEach(v=>{const x=v&&v.model;x&&(f.expand(x.number,x.min,x.number,x.max),d.push(x))}),c.merges=[],p.each(this._merges,v=>{c.merges.push(v.range)}),c}_parseRows(c){this._rows=[],c.rows.forEach(d=>{const f=new r(this,d.number);this._rows[f.number-1]=f,f.model=d})}_parseMergeCells(c){p.each(c.mergeCells,d=>{this.mergeCellsWithoutStyle(d)})}set model(c){this.name=c.name,this._columns=t.fromModel(this,c.cols),this._parseRows(c),this._parseMergeCells(c),this.dataValidations=new i(c.dataValidations),this.properties=c.properties,this.pageSetup=c.pageSetup,this.headerFooter=c.headerFooter,this.views=c.views,this.autoFilter=c.autoFilter,this._media=c.media.map(d=>new l(this,d)),this.sheetProtection=c.sheetProtection,this.tables=c.tables.reduce((d,f)=>{const v=new n;return v.model=f,d[f.name]=v,d},{}),this.conditionalFormattings=c.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(s,T,_){s("core-js/modules/es.promise"),s("core-js/modules/es.promise.finally"),s("core-js/modules/es.object.assign"),s("core-js/modules/es.object.keys"),s("core-js/modules/es.object.values"),s("core-js/modules/es.symbol"),s("core-js/modules/es.symbol.async-iterator"),s("core-js/modules/es.array.iterator"),s("core-js/modules/es.array.includes"),s("core-js/modules/es.array.find-index"),s("core-js/modules/es.array.find"),s("core-js/modules/es.string.from-code-point"),s("core-js/modules/es.string.includes"),s("core-js/modules/es.number.is-nan"),s("regenerator-runtime/runtime");const p={Workbook:s("./doc/workbook")},o=s("./doc/enums");Object.keys(o).forEach(a=>{p[a]=o[a]}),T.exports=p},{"./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(s,T,_){const p=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");_.bufferToString=function(o){return typeof o=="string"?o:p?p.decode(o):o.toString()}},{}],17:[function(s,T,_){const p=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=s("buffer");_.stringToBuffer=function(a){return typeof a!="string"?a:p?o.from(p.encode(a).buffer):o.from(a)}},{buffer:220}],18:[function(s,T,_){const p=s("./under-dash"),o=s("./col-cache");T.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(o.decodeEx(a))}getCell(a){return this.findCellEx(o.decodeEx(a),!0)}findCell(a){return this.findCellEx(o.decodeEx(a),!1)}findCellAt(a,r,t){const e=this.sheets[a],l=e&&e[r];return l&&l[t]}addCellEx(a){if(a.top)for(let r=a.top;r<=a.bottom;r++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,r,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,r){const t=this.findSheet(a,r),e=this.findSheetRow(t,a,r);return this.findRowCell(e,a,r)}getCellAt(a,r,t){const e=this.sheets[a]||(this.sheets[a]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:a,address:o.n2l(t)+r,row:r,col:t})}removeCellEx(a){const r=this.findSheet(a);if(!r)return;const t=this.findSheetRow(r,a);t&&delete t[a.col]}forEachInSheet(a,r){const t=this.sheets[a];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(a){p.each(this.sheets,(r,t)=>{this.forEachInSheet(t,a)})}map(a){const r=[];return this.forEach(t=>{r.push(a(t))}),r}findSheet(a,r){const t=a.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(a,r,t){const{row:e}=r;return a&&a[e]?a[e]:t?a[e]=[]:void 0}findRowCell(a,r,t){const{col:e}=r;return a&&a[e]?a[e]:t?a[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(a,r,t,e){const l=this.sheets[a];if(l){const n=[];for(let i=0;i{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,_){const p=/^[A-Z]+\d+$/,o={_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:a=>a<=26?1:a<=676?2:3,_fill(a){let r,t,e,l,n,i=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;i<=26;)r=this._dictionary[i-1],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(i=27;i<=702;)t=i-27,e=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(i=703;i<=16384;)t=i-703,e=t%26,l=Math.floor(t/26)%26,n=Math.floor(t/676),r=this._dictionary[n]+this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!p.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){const r=a.length<5&&this._hash[a];if(r)return r;let t=!1,e="",l=0,n=!1,i="",u=0;for(let c,d=0;d=65&&c<=90)t=!0,e+=a[d],l=26*l+c-64;else if(c>=48&&c<=57)n=!0,i+=a[d],u=10*u+c-48;else if(n&&t&&c!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;n||(u=void 0);const h={address:a=e+i,col:l,row:u,$col$row:`$${e}$${i}`};return l<=100&&u<=100&&(this._hash[a]=h,this._hash[h.$col$row]=h),h},getAddress(a,r){if(r){const t=this.n2l(r)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){const r=a.split(":");if(r.length===2){const t=this.decodeAddress(r[0]),e=this.decodeAddress(r[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){const r=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),u=this.decodeAddress(l[1]);const h=Math.min(i.row,u.row),c=Math.min(i.col,u.col),d=Math.max(i.row,u.row),f=Math.max(i.col,u.col);return i=this.n2l(c)+h,u=this.n2l(f)+d,{top:h,left:c,bottom:d,right:f,sheetName:t,tl:{address:i,col:c,row:h,$col$row:`$${this.n2l(c)}$${h}`,sheetName:t},br:{address:u,col:f,row:d,$col$row:`$${this.n2l(f)}$${d}`,sheetName:t},dimensions:`${i}:${u}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(a,r)=>o.n2l(r)+a,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,r){const[t,e,,l,n]=a,[i,u]=r;return i>=t&&i<=l&&u>=e&&u<=n}};T.exports=o},{}],20:[function(s,T,_){const p=(a,r)=>({...a,...r.reduce((t,e)=>(a[e]&&(t[e]={...a[e]}),t),{})}),o=function(a,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(r[t]=p(a[t],e))};_.copyStyle=a=>{if(!a)return a;if(r=a,Object.keys(r).length===0)return{};var r;const t={...a};return o(a,t,"font",["color"]),o(a,t,"alignment"),o(a,t,"protection"),a.border&&(o(a,t,"border"),o(a.border,t.border,"top",["color"]),o(a.border,t.border,"left",["color"]),o(a.border,t.border,"bottom",["color"]),o(a.border,t.border,"right",["color"]),o(a.border,t.border,"diagonal",["color"])),a.fill&&(o(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(e=>p(e,["color"])))),t}},{}],21:[function(s,T,_){(function(p){(function(){const o=s("crypto"),a={hash(r){const t=o.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;no.randomBytes(r)};T.exports=a}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,_){const{SaxesParser:p}=s("saxes"),{PassThrough:o}=s("readable-stream"),{bufferToString:a}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new o));const t=new p;let e;t.on("error",n=>{e=n});let l=[];t.on("opentag",n=>l.push({eventType:"opentag",value:n})),t.on("text",n=>l.push({eventType:"text",value:n})),t.on("closetag",n=>l.push({eventType:"closetag",value:n}));for await(const n of r){if(t.write(a(n)),e)throw e;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,T,_){const p=s("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(r,t,e){const l=p.decode(t),n=p.decode(e);return r.replace(o,(i,u,h,c,d)=>{if(d)return i;const f=a.exec(c);if(f){const v=f[1],x=f[2].toUpperCase(),A=f[3],I=f[4];if(x.length>3||x.length===3&&x>"XFD")return i;let F=p.l2n(x),j=parseInt(I,10);return v||(F+=n.col-l.col),A||(j+=n.row-l.row),(u||"")+(v||"")+p.n2l(F)+(A||"")+j}return i})}}},{"./col-cache":19}],24:[function(s,T,_){(function(p,o){(function(){const a=s("readable-stream"),r=s("./utils"),t=s("./string-buf");class e{constructor(c,d){this._data=c,this._encoding=d}get length(){return this.toBuffer().length}copy(c,d,f,v){return this.toBuffer().copy(c,d,f,v)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class l{constructor(c){this._data=c}get length(){return this._data.length}copy(c,d,f,v){return this._data._buf.copy(c,d,f,v)}toBuffer(){return this._data.toBuffer()}}class n{constructor(c){this._data=c}get length(){return this._data.length}copy(c,d,f,v){this._data.copy(c,d,f,v)}toBuffer(){return this._data}}class i{constructor(c){this.size=c,this.buffer=o.alloc(c),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const c=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(c,0,this.iRead,this.iWrite),c}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(c){let d;return c===0?null:c===void 0||c>=this.length?(d=this.toBuffer(),this.iRead=this.iWrite,d):(d=o.alloc(c),this.buffer.copy(d,0,this.iRead,c),this.iRead+=c,d)}write(c,d,f){const v=Math.min(f,this.size-this.iWrite);return c.copy(this.buffer,this.iWrite,d,d+v),this.iWrite+=v,v}}const u=function(h){h=h||{},this.bufSize=h.bufSize||1048576,this.buffers=[],this.batch=h.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(u,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(h=>h.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const c=this.buffers[this.buffers.length-1];if(!c.full)return c}const h=new i(this.bufSize);return this.buffers.push(h),h},async _pipe(h){await Promise.all(this.pipes.map(function(c){return new Promise(d=>{c.write(h.toBuffer(),()=>{d()})})}))},_writeToBuffers(h){let c=0;const d=h.length;for(;c1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(f),p.nextTick(d)):(await this._pipe(f),d());else this.paused||this.emit("data",f.toBuffer()),this._writeToBuffers(f),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(h,c,d){const f=v=>{v?d(v):(this._flush(),this.pipes.forEach(x=>{x.end()}),this.emit("finish"))};h?this.write(h,c,f):f()},read(h){let c;if(h){for(c=[];h&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],f=d.read(h);h-=f.length,c.push(f),d.eod&&d.full&&this.buffers.shift()}return o.concat(c)}return c=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],o.concat(c)},setEncoding(h){this.encoding=h},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(h){this.pipes.push(h),!this.paused&&this.buffers.length&&this.end()},unpipe(h){this.pipes=this.pipes.filter(c=>c!==h)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=u}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(s,T,_){(function(p){(function(){T.exports=class{constructor(o){this._buf=p.alloc(o&&o.size||16384),this._encoding=o&&o.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=p.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let a=2*this._buf.length;for(;a=this._buf.length-4;)this._grow(this._inPos+o.length),a=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=a}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,_){const{toString:p}=Object.prototype,o=/["&<>]/,a={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(e=>{t(r[e],e)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(e=>t(r[e],e)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(e=>t(r[e],e)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(e=>t(r[e],e)):[]},keyBy:(r,t)=>r.reduce((e,l)=>(e[l[t]]=l,e),{}),isEqual:function(r,t){const e=typeof r,l=typeof t,n=Array.isArray(r),i=Array.isArray(t);let u;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((h,c)=>{const d=t[c];return a.isEqual(h,d)});if(r===null||t===null)return r===t;if(u=Object.keys(r),Object.keys(t).length!==u.length)return!1;for(const h of u)if(!t.hasOwnProperty(h))return!1;return a.every(r,(h,c)=>{const d=t[c];return a.isEqual(h,d)});default:return r===t}},escapeHtml(r){const t=o.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i":l=">";break;default:continue}n!==i&&(e+=r.substring(n,i)),n=i+1,e+=l}return n!==i?e+r.substring(n,i):e},strcmp:(r,t)=>rt?1:0,isUndefined:r=>p.call(r)==="[object Undefined]",isObject:r=>p.call(r)==="[object Object]",deepMerge(){const r=arguments[0]||{},{length:t}=arguments;let e,l,n;function i(u,h){e=r[h],n=Array.isArray(u),a.isObject(u)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&a.isObject(e)?e:{},r[h]=a.deepMerge(l,u)):a.isUndefined(u)||(r[h]=u)}for(let u=0;u&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{p.setImmediate?o(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,n,i){e.super_=l,i||(i=n,n=null),n&&Object.keys(n).forEach(h=>{Object.defineProperty(e,h,Object.getOwnPropertyDescriptor(n,h))});const u={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(h=>{u[h]=Object.getOwnPropertyDescriptor(i,h)}),e.prototype=Object.create(l.prototype,u)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const n=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(n)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=r.exec(e);if(!l)return e;let n="",i="",u=0,h=l.index;for(;h=11&&c!==13)){i="";break}continue}u!==h&&(n+=e.substring(u,h)),u=h+1,i&&(n+=i)}return u!==h?n+e.substring(u,h):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{a.access(e,a.constants.F_OK,n=>{l(!n)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>e===!0||e==="true"||e===1||e==="1"};T.exports=t}).call(this)}).call(this,typeof Yt<"u"?Yt:typeof self<"u"?self:typeof window<"u"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,T,_){const p=s("./under-dash"),o=s("./utils");function a(e,l,n){e.push(` ${l}="${o.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];p.each(l,(i,u)=>{i!==void 0&&a(n,u,i)}),e.push(n.join(""))}}class t{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(l){const n=this._xml;n.push(" -`)}openNode(l,n){const i=this.tos,u=this._xml;i&&this.open&&u.push(">"),this._stack.push(l),u.push("<"),u.push(l),r(u,n),this.leaf=!0,this.open=!0}addAttribute(l,n){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n!==void 0&&a(this._xml,l,n)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){const n=this._xml;this.open&&(n.push(">"),this.open=!1),this.leaf=!1,n.push(o.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),n=this._xml;this.leaf?n.push("/>"):(n.push("")),this.open=!1,this.leaf=!1}leafNode(l,n,i){this.openNode(l,n),i!==void 0&&this.writeText(i),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 l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},T.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,T,_){(function(p){(function(){const o=s("events"),a=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends o.EventEmitter{constructor(n){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},n),this.zip=new a,this.stream=new r}append(n,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,n,{base64:!0}):(p.browser&&typeof n=="string"&&(n=t(n)),this.zip.file(i.name,n))}async finalize(){const n=await this.zip.generateAsync(this.options);this.stream.end(n),this.emit("finish")}read(n){return this.stream.read(n)}setEncoding(n){return this.stream.setEncoding(n)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(n,i){return this.stream.pipe(n,i)}unpipe(n){return this.stream.unpipe(n)}unshift(n){return this.stream.unshift(n)}wrap(n){return this.stream.wrap(n)}}T.exports={ZipWriter:e}}).call(this)}).call(this,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,T,_){T.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(s,T,_){T.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(s,T,_){const p=s("../../utils/parse-sax"),o=s("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const e of t)for(const{eventType:l,value:n}of e)if(l==="opentag")this.parseOpen(n);else if(l==="text")this.parseText(n);else if(l==="closetag"&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(t){return this.parse(p(t))}get xml(){return this.toXml(this.model)}toXml(t){const e=new o;return this.render(e,t),e.xml}static toAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t.toString()}static toStringAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/col-cache");function a(t){try{return o.decodeEx(t),!0}catch{return!1}}function r(t){const e=[];let l=!1,n="";return t.split(",").forEach(i=>{if(!i)return;const u=(i.match(/'/g)||[]).length;if(!u)return void(l?n+=i+",":a(i)&&e.push(i));const h=u%2==0;!l&&h&&a(i)?e.push(i):l&&!h?(l=!1,a(n+i)&&e.push(n+i),n=""):(l=!0,n+=i+",")}),e}T.exports=class extends p{render(t,e){t.openNode("definedName",{name:e.name,localSheetId:e.localSheetId}),t.writeText(e.ranges.join(",")),t.closeNode()}parseOpen(t){switch(t.name){case"definedName":return this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{render(a,r){a.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:p.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){const r={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(r.visibility=a.visibility),o.leafNode("workbookView",r)}parseOpen(o){if(o.name==="workbookView"){const a=this.model={},r=function(e,l,n){const i=l!==void 0?a[e]=l:n;i!==void 0&&(a[e]=i)},t=function(e,l,n){const i=l!==void 0?a[e]=parseInt(l,10):n;i!==void 0&&(a[e]=i)};return t("x",o.attributes.xWindow,0),t("y",o.attributes.yWindow,0),t("width",o.attributes.windowWidth,25e3),t("height",o.attributes.windowHeight,1e4),r("visibility",o.attributes.visibility,"visible"),t("activeTab",o.attributes.activeTab,void 0),t("firstSheet",o.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),n=s("./sheet-xform"),i=s("./workbook-view-xform"),u=s("./workbook-properties-xform"),h=s("./workbook-calc-properties-xform");class c extends r{constructor(){super(),this.map={fileVersion:c.STATIC_XFORMS.fileVersion,workbookPr:new u,bookViews:new e({tag:"bookViews",count:!1,childXform:new i}),sheets:new e({tag:"sheets",count:!1,childXform:new n}),definedNames:new e({tag:"definedNames",count:!1,childXform:new l}),calcPr:new h}}prepare(f){f.sheets=f.worksheets;const v=[];let x=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(I=>{const F=I.split(":"),j={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${F[0]}:$${F[1]}`],localSheetId:x};v.push(j)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const I=[];if(A.pageSetup.printTitlesColumn){const j=A.pageSetup.printTitlesColumn.split(":");I.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}if(A.pageSetup.printTitlesRow){const j=A.pageSetup.printTitlesRow.split(":");I.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}const F={name:"_xlnm.Print_Titles",ranges:I,localSheetId:x};v.push(F)}x++}),v.length&&(f.definedNames=f.definedNames.concat(v)),(f.media||[]).forEach((A,I)=>{A.name=A.type+(I+1)})}render(f,v){f.openXml(a.StdDocAttributes),f.openNode("workbook",c.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,v.properties),this.map.bookViews.render(f,v.views),this.map.sheets.render(f,v.sheets),this.map.definedNames.render(f,v.definedNames),this.map.calcPr.render(f,v.calcProperties),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"workbook":return!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){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(f){const v=(f.workbookRels||[]).reduce((j,P)=>(j[P.Id]=P,j),{}),x=[];let A,I=0;(f.sheets||[]).forEach(j=>{const P=v[j.rId];P&&(A=f.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=j.name,A.id=j.id,A.state=j.state,x[I++]=A))});const F=[];p.each(f.definedNames,j=>{if(j.name==="_xlnm.Print_Area"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=o.decodeEx(j.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(j.name==="_xlnm.Print_Titles"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=j.ranges.join(","),D=/\$/g,U=/\$\d+:\$\d+/,B=P.match(U);if(B&&B.length){const w=B[0];A.pageSetup.printTitlesRow=w.replace(D,"")}const k=/\$[A-Z]+:\$[A-Z]+/,C=P.match(k);if(C&&C.length){const w=C[0];A.pageSetup.printTitlesColumn=w.replace(D,"")}}}else F.push(j)}),f.definedNames=F,f.media.forEach((j,P)=>{j.index=P})}}c.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"},c.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},T.exports=c},{"../../../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(s,T,_){const p=s("../strings/rich-text-xform"),o=s("../../../utils/utils"),a=s("../base-xform"),r=T.exports=function(t){this.model=t};o.inherits(r,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new p),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){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(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../../../utils/utils"),a=s("../base-xform"),r=s("./comment-xform"),t=T.exports=function(){this.map={comment:new r}};o.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,l){l=l||this.model,e.openXml(p.StdDocAttributes),e.openNode("comments",t.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),l.comments.forEach(n=>{this.map.comment.render(e,n)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){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(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a,r){(a===r[2]||this.tag==="x:SizeWithCells"&&a===r[1])&&o.leafNode(this.tag)}parseOpen(o){switch(o.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(s,T,_){const p=s("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"x:Anchor"}getAnchorRect(o){const a=Math.floor(o.left),r=Math.floor(68*(o.left-a)),t=Math.floor(o.top),e=Math.floor(18*(o.top-t)),l=Math.floor(o.right),n=Math.floor(68*(o.right-l)),i=Math.floor(o.bottom);return[a,r,t,e,l,n,i,Math.floor(18*(o.bottom-i))]}getDefaultRect(o){const a=o.col,r=Math.max(o.row-2,0);return[a,6,r,14,a+2,2,r+4,16]}render(o,a){const r=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.refAddress);o.leafNode("x:Anchor",null,r.join(", "))}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,T,_){const p=s("../base-xform"),o=s("./vml-anchor-xform"),a=s("./style/vml-protection-xform"),r=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends p{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:n,editAs:i}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,i,t),this.map["x:SizeWithCells"].render(e,i,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,n.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,n.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],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(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./vml-shape-xform");class r extends o{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(e,l){e.openXml(p.StdDocAttributes),e.openNode(this.tag,r.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),l.comments.forEach((n,i)=>{this.map["v:shape"].render(e,n,i)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,l){e.anchors.forEach(n=>{n.br?this.map["xdr:twoCellAnchor"].reconcile(n,l):this.map["xdr:oneCellAnchor"].reconcile(n,l)})}}r.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"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(s,T,_){const p=s("../base-xform"),o=s("./vml-textbox-xform"),a=s("./vml-client-data-xform");class r extends p{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new a}}get tag(){return"v:shape"}render(e,l,n){e.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,n)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,l),this.map["x:ClientData"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){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}}}r.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),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":t.note.margins&&t.note.margins.insetmode}),T.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"v:textbox"}conversionUnit(o,a,r){return`${parseFloat(o)*a.toFixed(2)}${r}`}reverseConversionUnit(o){return(o||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(o,a){const r={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}o.openNode("v:textbox",r),o.leafNode("div",{style:"text-align:left"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:return this.model={inset:this.reverseConversionUnit(o.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(s,T,_){const p=s("./base-xform");T.exports=class extends p{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,a){this.model[o]=a.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,a.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.forEach(r=>{o.leafNode("vt:lpstr",void 0,r.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends o{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(n,i){n.openXml(p.StdDocAttributes),n.openNode("Properties",e.PROPERTY_ATTRIBUTES),n.leafNode("Application",void 0,"Microsoft Excel"),n.leafNode("DocSecurity",void 0,"0"),n.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(n,i.worksheets),this.map.TitleOfParts.render(n,i.worksheets),this.map.Company.render(n,i.company||""),this.map.Manager.render(n,i.manager),n.leafNode("LinksUpToDate",void 0,"false"),n.leafNode("SharedDoc",void 0,"false"),n.leafNode("HyperlinksChanged",void 0,"false"),n.leafNode("AppVersion",void 0,"16.0300"),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"Properties":return!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!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"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform");class a extends o{render(t,e){t.openXml(p.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(n=>{if(n.type==="image"){const i=n.extension;l[i]||(l[i]=!0,t.leafNode("Default",{Extension:i,ContentType:"image/"+i}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(n=>{const i=`/xl/worksheets/sheet${n.id}.xml`;t.leafNode("Override",{PartName:i,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach(n=>{t.leafNode("Override",{PartName:"/xl/tables/"+n.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(n=>{t.leafNode("Override",{PartName:`/xl/drawings/${n.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach(n=>{let{commentName:i}=n;t.leafNode("Override",{PartName:`/xl/${i}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends o{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(n,i){n.openXml(p.StdDocAttributes),n.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(n,i.creator),this.map["dc:title"].render(n,i.title),this.map["dc:subject"].render(n,i.subject),this.map["dc:description"].render(n,i.description),this.map["dc:identifier"].render(n,i.identifier),this.map["dc:language"].render(n,i.language),this.map["cp:keywords"].render(n,i.keywords),this.map["cp:category"].render(n,i.category),this.map["cp:lastModifiedBy"].render(n,i.lastModifiedBy),this.map["cp:lastPrinted"].render(n,i.lastPrinted),this.map["cp:revision"].render(n,i.revision),this.map["cp:version"].render(n,i.version),this.map["cp:contentStatus"].render(n,i.contentStatus),this.map["cp:contentType"].render(n,i.contentType),this.map["dcterms:created"].render(n,i.created),this.map["dcterms:modified"].render(n,i.modified),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[n.name],this.parser)return this.parser.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.parser=void 0),!0;switch(n){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: "+n)}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.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"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("Relationship",a)}parseOpen(o){switch(o.name){case"Relationship":return this.model=o.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./relationship-xform");class r extends o{constructor(){super(),this.map={Relationship:new a}}render(e,l){l=l||this._values,e.openXml(p.StdDocAttributes),e.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(n=>{this.map.Relationship.render(e,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,a){if(o&&o.rId){const r=a.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=a.mediaIndex[t];return a.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,_){const p=s("../base-xform"),o=s("./blip-xform");T.exports=class extends p{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(a,r){a.openNode(this.tag),this.map["a:blip"].render(a,r),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(){}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:blip"}render(o,a){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,T,_){const p=s("../base-xform"),o=s("./hlink-click-xform"),a=s("./ext-lst-xform");T.exports=class extends p{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,T,_){const p=s("../base-xform"),o=s("../simple/integer-xform");T.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(a,r){a.openNode(this.tag),this.map["xdr:col"].render(a,r.nativeCol),this.map["xdr:colOff"].render(a,r.nativeColOff),this.map["xdr:row"].render(a,r.nativeRow),this.map["xdr:rowOff"].render(a,r.nativeRowOff),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();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.parser=void 0),!0;switch(a){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(s,T,_){const p=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(n){n.anchors.forEach((i,u)=>{i.anchorType=function(h){return(typeof h.range=="string"?p.decode(h.range):h.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(i),this.map[i.anchorType].prepare(i,{index:u})})}get tag(){return"xdr:wsDr"}render(n,i){n.openXml(o.StdDocAttributes),n.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(u=>{this.map[u.anchorType].render(n,u)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset(),this.model={anchors:[]};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.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(n){case this.tag:return!1;default:return!0}}reconcile(n,i){n.anchors.forEach(u=>{u.br?this.map["xdr:twoCellAnchor"].reconcile(u,i):this.map["xdr:oneCellAnchor"].reconcile(u,i)})}}e.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},T.exports=e},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,a){o.openNode(this.tag);const r=Math.floor(9525*a.width),t=Math.floor(9525*a.height);o.addAttribute("cx",r),o.addAttribute("cy",t),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={width:parseInt(o.attributes.cx||"0",10)/9525,height:parseInt(o.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:hlinkClick"}render(o,a){a.hyperlinks&&a.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(o){switch(o.name){case this.tag:return this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,_){const p=s("../base-xform"),o=s("./c-nv-pr-xform"),a=s("./c-nv-pic-pr-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,T,_){const p=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,l){this.map["xdr:pic"].prepare(e.picture,l)}render(e,l){e.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,l.range.tl),this.map["xdr:ext"].render(e,l.range.ext),this.map["xdr:pic"].render(e,l.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.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(e,l){e.medium=this.reconcilePicture(e.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(s,T,_){const p=s("../base-xform"),o=s("../static-xform"),a=s("./blip-fill-xform"),r=s("./nv-pic-pr-xform"),t=s("./sp-pr");T.exports=class extends p{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new a,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(e,l){e.index=l.index+1}render(e,l){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,l),this.map["xdr:blipFill"].render(e,l),this.map["xdr:spPr"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){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(s,T,_){T.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(s,T,_){const p=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:to"].render(t,e.range.br),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(s,T,_){const p=s("./base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,a){const{childXform:r}=this;o&&o.forEach((t,e)=>{a.index=e,r.prepare(t,a)})}render(o,a){if(this.always||a&&a.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,a&&a.length||0);const{childXform:r}=this;(a||[]).forEach((t,e)=>{r.render(o,t,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(o)&&(this.parser=this.childXform,!0)}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser){if(!this.parser.parseClose(o)&&(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(o,a){if(o){const{childXform:r}=this;o.forEach(t=>{r.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(s,T,_){const p=s("../../../utils/col-cache"),o=s("../base-xform");T.exports=class extends o{get tag(){return"autoFilter"}render(a,r){if(r)if(typeof r=="string")a.leafNode("autoFilter",{ref:r});else{const t=function(n){return typeof n=="string"?n:p.getAddress(n.row,n.column).address},e=t(r.from),l=t(r.to);e&&l&&a.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform"),a=s("../../../doc/range"),r=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}T.exports=class extends o{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,n){const i=n.styles.addStyleModel(l.style||{},function(u){switch(u.type){case r.ValueType.Formula:return e(u.result);default:return u.type}}(l));switch(i&&(l.styleId=i),l.comment&&n.comments.push({...l.comment,ref:l.address}),l.type){case r.ValueType.String:case r.ValueType.RichText:n.sharedStrings&&(l.ssId=n.sharedStrings.add(l.value));break;case r.ValueType.Date:n.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:n.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=n.sharedStrings.add(l.text)),n.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:n.merges.add(l);break;case r.ValueType.Formula:if(n.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=n.siFormulae++),l.formula)n.formulae[l.address]=l;else if(l.sharedFormula){const u=n.formulae[l.sharedFormula];if(!u)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);u.si===void 0?(u.shareType="shared",u.si=n.siFormulae++,u.range=new a(u.address,l.address)):u.range&&u.range.expandToAddress(l.address),l.si=u.si}}}renderFormula(l,n){let i=null;switch(n.shareType){case"shared":i={t:"shared",ref:n.ref||n.range.range,si:n.si};break;case"array":i={t:"array",ref:n.ref};break;default:n.si!==void 0&&(i={t:"shared",si:n.si})}switch(e(n.result)){case r.ValueType.Null:l.leafNode("f",i,n.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Number:l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result.error);break;case r.ValueType.Date:l.leafNode("f",i,n.formula),l.leafNode("v",null,p.dateToExcel(n.result,n.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,n){if(n.type!==r.ValueType.Null||n.styleId){switch(l.openNode("c"),l.addAttribute("r",n.address),n.styleId&&l.addAttribute("s",n.styleId),n.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,n.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,n.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,n.value.error);break;case r.ValueType.String:case r.ValueType.RichText:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):n.value&&n.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),n.value.richText.forEach(i=>{this.richTextXForm.render(l,i)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,n.value));break;case r.ValueType.Date:l.leafNode("v",null,p.dateToExcel(n.value,n.date1904));break;case r.ValueType.Hyperlink:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,n.text));break;case r.ValueType.Formula:this.renderFormula(l,n);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.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(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;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+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:n}=this;if(n.formula||n.shareType)n.type=r.ValueType.Formula,n.value&&(this.t==="str"?n.result=p.xmlDecode(n.value):this.t==="b"?n.result=parseInt(n.value,10)!==0:this.t==="e"?n.result={error:n.value}:n.result=parseFloat(n.value),n.value=void 0);else if(n.value!==void 0)switch(this.t){case"s":n.type=r.ValueType.String,n.value=parseInt(n.value,10);break;case"str":n.type=r.ValueType.String,n.value=p.xmlDecode(n.value);break;case"inlineStr":n.type=r.ValueType.String;break;case"b":n.type=r.ValueType.Boolean,n.value=parseInt(n.value,10)!==0;break;case"e":n.type=r.ValueType.Error,n.value={error:n.value};break;default:n.type=r.ValueType.Number,n.value=parseFloat(n.value)}else n.styleId?n.type=r.ValueType.Null:n.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!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(l),!0)}}reconcile(l,n){const i=l.styleId&&n.styles&&n.styles.getStyleModel(l.styleId);switch(i&&(l.style=i),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&n.sharedStrings&&(l.value=n.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:i&&p.isDateFmt(i.numFmt)&&(l.type=r.ValueType.Date,l.value=p.excelToDate(l.value,n.date1904));break;case r.ValueType.Formula:l.result!==void 0&&i&&p.isDateFmt(i.numFmt)&&(l.result=p.excelToDate(l.result,n.date1904)),l.shareType==="shared"&&(l.ref?n.formulae[l.si]=l.address:(l.sharedFormula=n.formulae[l.si],delete l.shareType),delete l.si)}const u=n.hyperlinkMap[l.address];u&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=u);const h=n.commentsMap&&n.commentsMap[l.address];h&&(l.comment=h)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"x14:cfIcon"}render(o,a){o.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(o){let{attributes:a}=o;this.model={iconSet:a.iconSet,iconId:p.toIntValue(a.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,_){const{v4:p}=s("uuid"),o=s("../../base-xform"),a=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(i){return i.type==="dataBar"?r.isExt(i):!(i.type!=="iconSet"||!i.custom&&!e[i.iconSet])}prepare(i){l.isExt(i)&&(i.x14Id=`{${p()}}`.toUpperCase())}render(i,u){if(l.isExt(u))switch(u.type){case"dataBar":this.renderDataBar(i,u);break;case"iconSet":this.renderIconSet(i,u)}}renderDataBar(i,u){i.openNode(this.tag,{type:"dataBar",id:u.x14Id}),this.databarXform.render(i,u),i.closeNode()}renderIconSet(i,u){i.openNode(this.tag,{type:"iconSet",priority:u.priority,id:u.x14Id||`{${p()}}`}),this.iconSetXform.render(i,u),i.closeNode()}createNewModel(i){let{attributes:u}=i;return{type:u.type,x14Id:u.id,priority:o.toIntValue(u.priority)}}onParserClose(i,u){Object.assign(this.model,u.model)}}T.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(s,T,_){const p=s("../../composite-xform"),o=s("./f-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(a,r){a.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(a,r.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,r){switch(a){case"xm:f":this.model.value=r.model?parseFloat(r.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,T,_){const p=s("../../composite-xform"),o=s("./sqref-ext-xform"),a=s("./cf-rule-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(a.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach(e=>this.cfRule.render(r,e)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(s,T,_){const p=s("../../composite-xform"),o=s("./cf-rule-ext-xform"),a=s("./conditional-formatting-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(o.isExt))),r.hasExtContent}prepare(r,t){r.forEach(e=>{this.cfXform.prepare(e,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(e=>this.cfXform.render(r,e)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../style/color-xform"),r=s("./cfvo-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:p.toIntAttribute(e.minLength,0,!0),maxLength:p.toIntAttribute(e.maxLength,100,!0),border:p.toBoolAttribute(e.border,!1),gradient:p.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toAttribute(e.axisPosition,"auto"),direction:p.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:p.toIntValue(e.minLength,0),maxLength:p.toIntValue(e.maxLength,100),border:p.toBoolValue(e.border,!1),gradient:p.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toStringValue(e.axisPosition,"auto"),direction:p.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"xm:f"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new r}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:p.toStringAttribute(e.iconSet),reverse:p.toBoolAttribute(e.reverse,!1),showValue:p.toBoolAttribute(e.showValue,!0),custom:p.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),e.icons&&e.icons.forEach((l,n)=>{l.iconId=n,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:p.toStringValue(e.iconSet,"3TrafficLights"),reverse:p.toBoolValue(e.reverse,!1),showValue:p.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"xm:sqref"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../../../doc/range"),r=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),n=s("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},u=c=>{const{type:d,operator:f}=c;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:f}}};class h extends o{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new n}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!i[d.iconSet]}render(d,f){switch(f.type){case"expression":this.renderExpression(d,f);break;case"cellIs":this.renderCellIs(d,f);break;case"top10":this.renderTop10(d,f);break;case"aboveAverage":this.renderAboveAverage(d,f);break;case"dataBar":this.renderDataBar(d,f);break;case"colorScale":this.renderColorScale(d,f);break;case"iconSet":this.renderIconSet(d,f);break;case"containsText":this.renderText(d,f);break;case"timePeriod":this.renderTimePeriod(d,f)}}renderExpression(d,f){d.openNode(this.tag,{type:"expression",dxfId:f.dxfId,priority:f.priority}),this.formulaXform.render(d,f.formulae[0]),d.closeNode()}renderCellIs(d,f){d.openNode(this.tag,{type:"cellIs",dxfId:f.dxfId,priority:f.priority,operator:f.operator}),f.formulae.forEach(v=>{this.formulaXform.render(d,v)}),d.closeNode()}renderTop10(d,f){d.leafNode(this.tag,{type:"top10",dxfId:f.dxfId,priority:f.priority,percent:p.toBoolAttribute(f.percent,!1),bottom:p.toBoolAttribute(f.bottom,!1),rank:p.toIntValue(f.rank,10,!0)})}renderAboveAverage(d,f){d.leafNode(this.tag,{type:"aboveAverage",dxfId:f.dxfId,priority:f.priority,aboveAverage:p.toBoolAttribute(f.aboveAverage,!0)})}renderDataBar(d,f){d.openNode(this.tag,{type:"dataBar",priority:f.priority}),this.databarXform.render(d,f),this.extLstRefXform.render(d,f),d.closeNode()}renderColorScale(d,f){d.openNode(this.tag,{type:"colorScale",priority:f.priority}),this.colorScaleXform.render(d,f),d.closeNode()}renderIconSet(d,f){h.isPrimitive(f)&&(d.openNode(this.tag,{type:"iconSet",priority:f.priority}),this.iconSetXform.render(d,f),d.closeNode())}renderText(d,f){d.openNode(this.tag,{type:f.operator,dxfId:f.dxfId,priority:f.priority,operator:p.toStringAttribute(f.operator,"containsText")});const v=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:I}=A;switch(x.operator){case"containsText":return`NOT(ISERROR(SEARCH("${x.text}",${I})))`;case"containsBlanks":return`LEN(TRIM(${I}))=0`;case"notContainsBlanks":return`LEN(TRIM(${I}))>0`;case"containsErrors":return`ISERROR(${I})`;case"notContainsErrors":return`NOT(ISERROR(${I}))`;default:return}})(f);v&&this.formulaXform.render(d,v),d.closeNode()}renderTimePeriod(d,f){d.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const v=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:I}=A;switch(x.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${I},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${I},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${I},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${I},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${I},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${I},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${I},1)=TODAY()-1`;case"today":return`FLOOR(${I},1)=TODAY()`;case"tomorrow":return`FLOOR(${I},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${I},1)<=6,FLOOR(${I},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${I})=MONTH(EDATE(TODAY(),0-1)),YEAR(${I})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${I})=MONTH(TODAY()),YEAR(${I})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${I})=MONTH(EDATE(TODAY(),0+1)),YEAR(${I})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);v&&this.formulaXform.render(d,v),d.closeNode()}createNewModel(d){let{attributes:f}=d;return{...u(f),dxfId:p.toIntValue(f.dxfId),priority:p.toIntValue(f.priority),timePeriod:f.timePeriod,percent:p.toBoolValue(f.percent),bottom:p.toBoolValue(f.bottom),rank:p.toIntValue(f.rank),aboveAverage:p.toBoolValue(f.aboveAverage)}}onParserClose(d,f){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,f.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(f.model)}}}T.exports=h},{"../../../../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(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"cfvo"}render(o,a){o.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(o){this.model={type:o.attributes.type,value:p.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,_){const p=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),t.color.forEach(e=>{this.colorXform.render(r,e)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(s,T,_){const p=s("../../composite-xform"),o=s("./cf-rule-xform");T.exports=class extends p{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(a,r){r.rules.some(o.isPrimitive)&&(a.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:r}=a;return{ref:r.sqref,rules:[]}}onParserClose(a,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,_){const p=s("../../base-xform"),o=s("./conditional-formatting-xform");T.exports=class extends p{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,r){let t=a.reduce((e,l)=>Math.max(e,...l.rules.map(n=>n.priority||0)),1);a.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(a,r){r.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"conditionalFormatting":return this.parser=this.cfXform,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.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,r){a.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=r.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(s,T,_){const p=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform");class a extends p{get tag(){return"x14:id"}render(e,l){e.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class r extends o{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(e,l){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,l.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,l){this.model.x14Id=l.model}}T.exports=class extends o{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"formula"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-xform");T.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(r,t){r.openNode(this.tag,{iconSet:p.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:p.toBoolAttribute(t.reverse,!1),showValue:p.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:p.toStringValue(t.iconSet,"3TrafficLights"),reverse:p.toBoolValue(t.reverse),showValue:p.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{get tag(){return"col"}prepare(a,r){const t=r.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,r){a.openNode("col"),a.addAttribute("min",r.min),a.addAttribute("max",r.max),r.width&&a.addAttribute("width",r.width),r.styleId&&a.addAttribute("style",r.styleId),r.hidden&&a.addAttribute("hidden","1"),r.bestFit&&a.addAttribute("bestFit","1"),r.outlineLevel&&a.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){const r=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(r.styleId=parseInt(a.attributes.style,10)),p.parseBoolean(a.attributes.hidden)&&(r.hidden=!0),p.parseBoolean(a.attributes.bestFit)&&(r.bestFit=!0),a.attributes.outlineLevel&&(r.outlineLevel=parseInt(a.attributes.outlineLevel,10)),p.parseBoolean(a.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,r){a.styleId&&(a.style=r.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/utils"),a=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(n,i,u,h){const c=i[u];c!==void 0?n[u]=c:h!==void 0&&(n[u]=h)}function l(n,i,u,h){const c=i[u];c!==void 0?n[u]=o.parseBoolean(c):h!==void 0&&(n[u]=h)}T.exports=class extends r{get tag(){return"dataValidations"}render(n,i){const u=function(h){const c=p.map(h,(v,x)=>({address:x,dataValidation:v,marked:!1})).sort((v,x)=>p.strcmp(v.address,x.address)),d=p.keyBy(c,"address"),f=(v,x,A)=>{for(let I=0;I{if(!v.marked){const x=a.decodeEx(v.address);if(x.dimensions)return d[x.dimensions].marked=!0,{...v.dataValidation,sqref:v.address};let A=1,I=a.encodeAddress(x.row+A,x.col);for(;h[I]&&p.isEqual(v.dataValidation,h[I]);)A++,I=a.encodeAddress(x.row+A,x.col);let F=1;for(;f(x,A,x.col+F);)F++;for(let j=0;j1||F>1){const j=x.row+(A-1),P=x.col+(F-1);return{...v.dataValidation,sqref:`${v.address}:${a.encodeAddress(j,P)}`}}return{...v.dataValidation,sqref:v.address}}return null}).filter(Boolean)}(i);u.length&&(n.openNode("dataValidations",{count:u.length}),u.forEach(h=>{n.openNode("dataValidation"),h.type!=="any"&&(n.addAttribute("type",h.type),h.operator&&h.type!=="list"&&h.operator!=="between"&&n.addAttribute("operator",h.operator),h.allowBlank&&n.addAttribute("allowBlank","1")),h.showInputMessage&&n.addAttribute("showInputMessage","1"),h.promptTitle&&n.addAttribute("promptTitle",h.promptTitle),h.prompt&&n.addAttribute("prompt",h.prompt),h.showErrorMessage&&n.addAttribute("showErrorMessage","1"),h.errorStyle&&n.addAttribute("errorStyle",h.errorStyle),h.errorTitle&&n.addAttribute("errorTitle",h.errorTitle),h.error&&n.addAttribute("error",h.error),n.addAttribute("sqref",h.sqref),(h.formulae||[]).forEach((c,d)=>{n.openNode("formula"+(d+1)),h.type==="date"?n.writeText(o.dateToExcel(new Date(c))):n.writeText(c),n.closeNode()}),n.closeNode()}),n.closeNode())}parseOpen(n){switch(n.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=n.attributes.sqref;const i={type:n.attributes.type||"any",formulae:[]};switch(n.attributes.type&&l(i,n.attributes,"allowBlank"),l(i,n.attributes,"showInputMessage"),l(i,n.attributes,"showErrorMessage"),i.type){case"any":case"list":case"custom":break;default:e(i,n.attributes,"operator","between")}return e(i,n.attributes,"promptTitle"),e(i,n.attributes,"prompt"),e(i,n.attributes,"errorStyle"),e(i,n.attributes,"errorTitle"),e(i,n.attributes,"error"),this._dataValidation=i,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(n){this._formula&&this._formula.push(n)}parseClose(n){switch(n){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(i=>{i.includes(":")?new t(i).forEachAddress(u=>{this.model[u]=this._dataValidation}):this.model[i]=this._dataValidation}),!0;case"formula1":case"formula2":{let i=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":i=parseInt(i,10);break;case"decimal":i=parseFloat(i);break;case"date":i=o.excelToDate(parseFloat(i))}return this._dataValidation.formulae.push(i),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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"dimension"}render(o,a){a&&o.leafNode("dimension",{ref:a})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"drawing"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,_){const p=s("../composite-xform"),o=s("./cf-ext/conditional-formattings-ext-xform");class a extends p{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new o}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,e){this.conditionalFormattings.prepare(t.conditionalFormattings,e)}render(t,e){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,e.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model[t]=e.model}}T.exports=class extends p{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"headerFooter"}render(o,a){if(a){o.addRollback();let r=!1;o.openNode("headerFooter"),a.differentFirst&&(o.addAttribute("differentFirst","1"),r=!0),a.differentOddEven&&(o.addAttribute("differentOddEven","1"),r=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(o.leafNode("oddHeader",null,a.oddHeader),r=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(o.leafNode("oddFooter",null,a.oddFooter),r=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(o.leafNode("evenHeader",null,a.evenHeader),r=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(o.leafNode("evenFooter",null,a.evenFooter),r=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(o.leafNode("firstHeader",null,a.firstHeader),r=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(o.leafNode("firstFooter",null,a.firstFooter),r=!0),r?(o.closeNode(),o.commit()):o.rollback()}}parseOpen(o){switch(o.name){case"headerFooter":return this.model={},o.attributes.differentFirst&&(this.model.differentFirst=parseInt(o.attributes.differentFirst,0)===1),o.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(o.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(o){switch(this.currentNode){case"oddHeader":this.model.oddHeader=o;break;case"oddFooter":this.model.oddFooter=o;break;case"evenHeader":this.model.evenHeader=o;break;case"evenFooter":this.model.evenFooter=o;break;case"firstHeader":this.model.firstHeader=o;break;case"firstFooter":this.model.firstFooter=o}}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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"hyperlink"}render(o,a){this.isInternalLink(a)?o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"mergeCell"}render(o,a){o.leafNode("mergeCell",{ref:a})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../doc/range"),a=s("../../../utils/col-cache"),r=s("../../../doc/enums");T.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new o(e)}}get mergeCells(){return p.map(this.merges,t=>t.range)}reconcile(t,e){p.each(t,l=>{const n=a.decode(l);for(let i=n.top;i<=n.bottom;i++){const u=e[i-1];for(let h=n.left;h<=n.right;h++){const c=u.cells[h-1];c?c.type===r.ValueType.Merge&&(c.master=n.tl):u.cells[h]={type:r.ValueType.Null,address:a.encodeAddress(i,h)}}}})}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(s,T,_){const p=s("../base-xform"),o=a=>a!==void 0;T.exports=class extends p{get tag(){return"outlinePr"}render(a,r){return!(!r||!o(r.summaryBelow)&&!o(r.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:o(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:o(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:o(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:o(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"brk"}render(o,a){o.leafNode("brk",a)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"pageMargins"}render(a,r){if(r){const t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};p.some(t,e=>e!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){switch(a.name){case this.tag:return this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"pageSetUpPr"}render(o,a){return!(!a||!a.fitToPage)&&(o.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(l){return l?"1":void 0}function r(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}T.exports=class extends o{get tag(){return"pageSetup"}render(l,n){if(n){const i={paperSize:n.paperSize,orientation:n.orientation,horizontalDpi:n.horizontalDpi,verticalDpi:n.verticalDpi,pageOrder:r(n.pageOrder),blackAndWhite:a(n.blackAndWhite),draft:a(n.draft),cellComments:t(n.cellComments),errors:e(n.errors),scale:n.scale,fitToWidth:n.fitToWidth,fitToHeight:n.fitToHeight,firstPageNumber:n.firstPageNumber,useFirstPageNumber:a(n.firstPageNumber),usePrinterDefaults:a(n.usePrinterDefaults),copies:n.copies};p.some(i,u=>u!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(n=l.attributes.paperSize,n!==void 0?parseInt(n,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var n}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"picture"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(r){return r?"1":void 0}T.exports=class extends o{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};p.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){switch(r.name){case this.tag:return this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,T,_){const p=s("./page-breaks-xform"),o=s("../list-xform");T.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new p})}render(a,r){if(r&&r.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,r.length),a.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(a,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/utils"),a=s("./cell-xform");T.exports=class extends p{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(r,t){const e=t.styles.addStyleModel(r.style);e&&(r.styleId=e);const l=this.map.c;r.cells.forEach(n=>{l.prepare(n,t)})}render(r,t,e){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(n=>{l.render(r,n,e)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;const t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],e=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(e.styleId=parseInt(r.attributes.s,10)),o.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),o.parseBoolean(r.attributes.bestFit)&&(e.bestFit=!0),r.attributes.ht&&(e.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(e.outlineLevel=parseInt(r.attributes.outlineLevel,10)),o.parseBoolean(r.attributes.collapsed)&&(e.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){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(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);const e=this.map.c;r.cells.forEach(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"sheetFormatPr"}render(a,r){if(r){const t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),p.some(t,e=>e!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,_){const p=s("../base-xform"),o=s("../style/color-xform"),a=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");T.exports=class extends p{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new a,outlinePr:new r}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(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(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}T.exports=class extends o{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:a(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:a(e.formatCells,"0"),formatColumns:a(e.formatColumns,"0"),formatRows:a(e.formatRows,"0"),insertColumns:a(e.insertColumns,"0"),insertRows:a(e.insertRows,"0"),insertHyperlinks:a(e.insertHyperlinks,"0"),deleteColumns:a(e.deleteColumns,"0"),deleteRows:a(e.deleteRows,"0"),sort:a(e.sort,"0"),autoFilter:a(e.autoFilter,"0"),pivotTables:a(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=a(e.objects===!1,"1"),l.scenarios=a(e.scenarios===!1,"1")),p.some(l,n=>n!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,T,_){const p=s("../../../utils/col-cache"),o=s("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends o{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(h,c,d){d&&r.addAttribute(h,c)};let l,n,i,u;switch(e("rightToLeft","1",t.rightToLeft===!0),e("tabSelected","1",t.tabSelected),e("showRuler","0",t.showRuler===!1),e("showRowColHeaders","0",t.showRowColHeaders===!1),e("showGridLines","0",t.showGridLines===!1),e("zoomScale",t.zoomScale,t.zoomScale),e("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),e("view",t.style,t.style),t.state){case"frozen":n=t.xSplit||0,i=t.ySplit||0,l=t.topLeftCell||p.getAddress(i+1,n+1).address,u=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:u,state:"frozen"}),r.leafNode("selection",{pane:u,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{const t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,e;switch(r){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[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"&&(t.activePane=this.pane.activePane),e=this.selections[this.pane.activePane],e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=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},e=this.selections.topLeft,e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tablePart"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),n=s("./row-xform"),i=s("./col-xform"),u=s("./dimension-xform"),h=s("./hyperlink-xform"),c=s("./merge-cell-xform"),d=s("./data-validations-xform"),f=s("./sheet-properties-xform"),v=s("./sheet-format-properties-xform"),x=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),I=s("./page-margins-xform"),F=s("./page-setup-xform"),j=s("./print-options-xform"),P=s("./auto-filter-xform"),D=s("./picture-xform"),U=s("./drawing-xform"),B=s("./table-part-xform"),k=s("./row-breaks-xform"),C=s("./header-footer-xform"),w=s("./cf/conditional-formattings-xform"),m=s("./ext-lst-xform"),b=(y,S)=>{if(!S||!S.length)return y;if(!y||!y.length)return S;const R={},N={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach(H=>{const{x14Id:q}=H;q&&(N[q]=H)})}),S.forEach(z=>{z.rules.forEach(H=>{const q=N[H.x14Id];q?((O,$)=>{Object.keys($).forEach(E=>{const M=O[E],L=$[E];M===void 0&&L!==void 0&&(O[E]=L)})})(q,H):R[z.ref]?R[z.ref].rules.push(H):y.push({ref:z.ref,rules:[H]})})}),y};class g extends e{constructor(S){super();const{maxRows:R,maxCols:N,ignoreNodes:z}=S||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new u,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new x}),sheetFormatPr:new v,cols:new l({tag:"cols",count:!1,childXform:new i}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new n({maxItems:N}),maxItems:R}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new c}),rowBreaks:new k,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new h}),pageMargins:new I,dataValidations:new d,pageSetup:new F,headerFooter:new C,printOptions:new j,picture:new D,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new w,extLst:new m}}prepare(S,R){R.merges=new t,S.hyperlinks=R.hyperlinks=[],S.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(S.cols,R),this.map.sheetData.prepare(S.rows,R),this.map.conditionalFormatting.prepare(S.conditionalFormattings,R),S.mergeCells=R.merges.mergeCells;const N=S.rels=[];function z(O){return"rId"+(O.length+1)}if(S.hyperlinks.forEach(O=>{const $=z(N);O.rId=$,N.push({Id:$,Type:r.Hyperlink,Target:O.target,TargetMode:"External"})}),S.comments.length>0){const O={Id:z(N),Type:r.Comments,Target:`../comments${S.id}.xml`};N.push(O);const $={Id:z(N),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${S.id}.vml`};N.push($),S.comments.forEach(E=>{E.refAddress=o.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+S.id,vmlDrawing:"vmlDrawing"+S.id})}const H=[];let q;S.media.forEach(O=>{if(O.type==="background"){const $=z(N);q=R.media[O.imageId],N.push({Id:$,Type:r.Image,Target:`../media/${q.name}.${q.extension}`}),S.background={rId:$},S.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:$}=S;q=R.media[O.imageId],$||($=S.drawing={rId:z(N),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push($),N.push({Id:$.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${$.name}.xml`}));let E=this.preImageId===O.imageId?H[O.imageId]:H[$.rels.length];E||(E=z($.rels),H[$.rels.length]=E,$.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${q.name}.${q.extension}`}));const M={picture:{rId:E},range:O.range};if(O.hyperlinks&&O.hyperlinks.hyperlink){const L=z($.rels);H[$.rels.length]=L,M.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:L},$.rels.push({Id:L,Type:r.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,$.anchors.push(M)}}),S.tables.forEach(O=>{const $=z(N);O.rId=$,N.push({Id:$,Type:r.Table,Target:"../tables/"+O.target}),O.columns.forEach(E=>{const{style:M}=E;M&&(E.dxfId=R.styles.addDxfStyle(M))})}),this.map.extLst.prepare(S,R)}render(S,R){S.openXml(a.StdDocAttributes),S.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const N=R.properties?{defaultRowHeight:R.properties.defaultRowHeight,dyDescent:R.properties.dyDescent,outlineLevelCol:R.properties.outlineLevelCol,outlineLevelRow:R.properties.outlineLevelRow}:void 0;R.properties&&R.properties.defaultColWidth&&(N.defaultColWidth=R.properties.defaultColWidth);const z={outlineProperties:R.properties&&R.properties.outlineProperties,tabColor:R.properties&&R.properties.tabColor,pageSetup:R.pageSetup&&R.pageSetup.fitToPage?{fitToPage:R.pageSetup.fitToPage}:void 0},H=R.pageSetup&&R.pageSetup.margins,q={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},O=R.sheetProtection;this.map.sheetPr.render(S,z),this.map.dimension.render(S,R.dimensions),this.map.sheetViews.render(S,R.views),this.map.sheetFormatPr.render(S,N),this.map.cols.render(S,R.cols),this.map.sheetData.render(S,R.rows),this.map.sheetProtection.render(S,O),this.map.autoFilter.render(S,R.autoFilter),this.map.mergeCells.render(S,R.mergeCells),this.map.conditionalFormatting.render(S,R.conditionalFormattings),this.map.dataValidations.render(S,R.dataValidations),this.map.hyperlinks.render(S,R.hyperlinks),this.map.printOptions.render(S,q),this.map.pageMargins.render(S,H),this.map.pageSetup.render(S,R.pageSetup),this.map.headerFooter.render(S,R.headerFooter),this.map.rowBreaks.render(S,R.rowBreaks),this.map.drawing.render(S,R.drawing),this.map.picture.render(S,R.background),this.map.tableParts.render(S,R.tables),this.map.extLst.render(S,R),R.rels&&R.rels.forEach($=>{$.Type===r.VmlDrawing&&S.leafNode("legacyDrawing",{"r:id":$.Id})}),S.closeNode()}parseOpen(S){return this.parser?(this.parser.parseOpen(S),!0):S.name==="worksheet"?(p.each(this.map,R=>{R.reset()}),!0):(this.map[S.name]&&!this.ignoreNodes.includes(S.name)&&(this.parser=this.map[S.name],this.parser.parseOpen(S)),!0)}parseText(S){this.parser&&this.parser.parseText(S)}parseClose(S){if(this.parser)return this.parser.parseClose(S)||(this.parser=void 0),!0;switch(S){case"worksheet":{const R=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(R.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(R.outlineProperties=this.map.sheetPr.model.outlineProperties);const N={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},z=Object.assign(N,this.map.pageSetup.model,this.map.printOptions.model),H=b(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:R,views:this.map.sheetViews.model,pageSetup:z,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:H},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(S,R){const N=(S.relationships||[]).reduce((H,q)=>{if(H[q.Id]=q,q.Type===r.Comments&&(S.comments=R.comments[q.Target].comments),q.Type===r.VmlDrawing&&S.comments&&S.comments.length){const O=R.vmlDrawings[q.Target].comments;S.comments.forEach(($,E)=>{$.note=Object.assign({},$.note,O[E])})}return H},{});if(R.commentsMap=(S.comments||[]).reduce((H,q)=>(q.ref&&(H[q.ref]=q),H),{}),R.hyperlinkMap=(S.hyperlinks||[]).reduce((H,q)=>(q.rId&&(H[q.address]=N[q.rId].Target),H),{}),R.formulae={},S.rows=S.rows&&S.rows.filter(Boolean)||[],S.rows.forEach(H=>{H.cells=H.cells&&H.cells.filter(Boolean)||[]}),this.map.cols.reconcile(S.cols,R),this.map.sheetData.reconcile(S.rows,R),this.map.conditionalFormatting.reconcile(S.conditionalFormattings,R),S.media=[],S.drawing){const H=N[S.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(H){const q=H[1];R.drawings[q].anchors.forEach(O=>{if(O.medium){const $={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};S.media.push($)}})}}const z=S.background&&N[S.background.rId];if(z){const H=z.Target.split("/media/")[1],q=R.mediaIndex&&R.mediaIndex[H];q!==void 0&&S.media.push({type:"background",imageId:q})}S.tables=(S.tables||[]).map(H=>{const q=N[H.rId];return R.tables[q.Target]}),delete S.relationships,delete S.hyperlinks,delete S.comments}}g.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"},T.exports=g},{"../../../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(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,a){a&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch{return""}},this._parse=o.parse||function(a){return new Date(a)}}render(o,a){a&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(a)):o.writeText(this._format(a)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,a){(a||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,a){a!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,_){const p=s("./base-xform"),o=s("../../utils/xml-stream");T.exports=class extends p{constructor(a){super(),this._model=a}render(a){if(!this._xml){const r=new o;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(n=>{t(e,n)}),l.t&&e.writeText(l.t),e.closeNode()})(r,this._model),this._xml=r.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){switch(a){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,T,_){const p=s("./text-xform"),o=s("./rich-text-xform"),a=s("../base-xform");T.exports=class extends a{constructor(){super(),this.map={r:new o,t:new p}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:e}=this.map;t.richText.forEach(l=>{e.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){const{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,T,_){const p=s("./text-xform"),o=s("../style/font-xform"),a=s("../base-xform");class r extends a{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new p)}get fontXform(){return this._fontXform||(this._fontXform=new o(r.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){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(e),!0}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,T,_){const p=s("./text-xform"),o=s("./rich-text-xform"),a=s("./phonetic-text-xform"),r=s("../base-xform");T.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new o,t:new p,rPh:new a}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):e!=null&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./shared-string-xform");T.exports=class extends o{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){const t=this.sharedStringXform.toXml(r);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,e}render(r,t){t=t||this._values,r.openXml(p.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(l=>{e.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(r){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"t"}render(o,a){o.openNode("t"),/^\s|\n|\s$/.test(a)&&o.addAttribute("xml:space","preserve"),o.writeText(a),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(o){switch(o.name){case"t":return this._text=[],!0;default:return!1}}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,_){const p=s("../../../doc/enums"),o=s("../../../utils/utils"),a=s("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),vertical(e){return e==="middle"?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case"vertical":return e;default:return(e=o.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=o.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return p.ReadingOrder.LeftToRight;case"rtl":return p.ReadingOrder.RightToLeft;default:return}}},t={toXml(e){if(e=r.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=o.validInt(e);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};T.exports=class extends a{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let n=!1;function i(u,h){h&&(e.addAttribute(u,h),n=!0)}i("horizontal",r.horizontal(l.horizontal)),i("vertical",r.vertical(l.vertical)),i("wrapText",!!r.wrapText(l.wrapText)&&"1"),i("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),i("indent",r.indent(l.indent)),i("textRotation",t.toXml(l.textRotation)),i("readingOrder",r.readingOrder(l.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const l={};let n=!1;function i(u,h,c){u&&(l[h]=c,n=!0)}i(e.attributes.horizontal,"horizontal",e.attributes.horizontal),i(e.attributes.vertical,"vertical",e.attributes.vertical==="center"?"middle":e.attributes.vertical),i(e.attributes.wrapText,"wrapText",o.parseBoolean(e.attributes.wrapText)),i(e.attributes.shrinkToFit,"shrinkToFit",o.parseBoolean(e.attributes.shrinkToFit)),i(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),i(e.attributes.textRotation,"textRotation",t.toModel(e.attributes.textRotation)),i(e.attributes.readingOrder,"readingOrder",e.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=n?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/utils"),a=s("./color-xform");class r extends p{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,l,n){const i=l&&l.color||n||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),i&&this.map.color.render(e,i)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return r.validStyleValues[e]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,e)=>(t[e]=!0,t),{}),T.exports=class extends p{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,e){const{color:l}=e;function n(i,u){i&&!i.color&&e.color&&(i={...i,color:e.color}),u.render(t,i,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),n(e.left,this.map.left),n(e.right,this.map.right),n(e.top,this.map.top),n(e.bottom,this.map.bottom),n(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=o.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=o.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(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;if(t==="border"){const e=this.model={},l=function(n,i,u){i&&(u&&Object.assign(i,u),e[n]=i)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,a){return!!a&&(o.openNode(this.name),a.argb?o.addAttribute("rgb",a.argb):a.theme!==void 0?(o.addAttribute("theme",a.theme),a.tint!==void 0&&o.addAttribute("tint",a.tint)):a.indexed!==void 0?o.addAttribute("indexed",a.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(s,T,_){const p=s("../base-xform"),o=s("./alignment-xform"),a=s("./border-xform"),r=s("./fill-xform"),t=s("./font-xform"),e=s("./numfmt-xform"),l=s("./protection-xform");T.exports=class extends p{constructor(){super(),this.map={alignment:new o,border:new a,fill:new r,font:new t,numFmt:new e,protection:new l}}get tag(){return"dxf"}render(n,i){if(n.openNode(this.tag),i.font&&this.map.font.render(n,i.font),i.numFmt&&i.numFmtId){const u={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(n,u)}i.fill&&this.map.fill.render(n,i.fill),i.alignment&&this.map.alignment.render(n,i.alignment),i.border&&this.map.border.render(n,i.border),i.protection&&this.map.protection.render(n,i.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n),!0}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n!==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(s,T,_){const p=s("../base-xform"),o=s("./color-xform");class a extends p{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(n,i){n.openNode("stop"),n.addAttribute("position",i.position),this.map.color.render(n,i.color),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"stop":return this.model={position:parseFloat(n.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(n),!0;default:return!1}}parseText(){}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends p{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(n,i){n.openNode("patternFill"),n.addAttribute("patternType",i.pattern),i.fgColor&&this.map.fgColor.render(n,i.fgColor),i.bgColor&&this.map.bgColor.render(n,i.bgColor),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"patternFill":return this.model={type:"pattern",pattern:n.attributes.patternType},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.parser.model&&(this.model[n]=this.parser.model),this.parser=void 0),!0)}}class t extends p{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(n,i){switch(n.openNode("gradientFill"),i.gradient){case"angle":n.addAttribute("degree",i.degree);break;case"path":n.addAttribute("type","path"),i.center.left&&(n.addAttribute("left",i.center.left),i.center.right===void 0&&n.addAttribute("right",i.center.left)),i.center.right&&n.addAttribute("right",i.center.right),i.center.top&&(n.addAttribute("top",i.center.top),i.center.bottom===void 0&&n.addAttribute("bottom",i.center.top)),i.center.bottom&&n.addAttribute("bottom",i.center.bottom)}const u=this.map.stop;i.stops.forEach(h=>{u.render(n,h)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"gradientFill":{const i=this.model={stops:[]};return n.attributes.degree?(i.gradient="angle",i.degree=parseInt(n.attributes.degree,10)):n.attributes.type==="path"&&(i.gradient="path",i.center={left:n.attributes.left?parseFloat(n.attributes.left):0,top:n.attributes.top?parseFloat(n.attributes.top):0},n.attributes.right!==n.attributes.left&&(i.center.right=n.attributes.right?parseFloat(n.attributes.right):0),n.attributes.bottom!==n.attributes.top&&(i.center.bottom=n.attributes.bottom?parseFloat(n.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,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.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends p{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(n,i){switch(n.addRollback(),n.openNode("fill"),i.type){case"pattern":this.map.patternFill.render(n,i);break;case"gradient":this.map.gradientFill.render(n,i);break;default:return void n.rollback()}n.closeNode(),n.commit()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"fill":return this.model={},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(n){return e.validPatternValues[n]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,n)=>(l[n]=!0,l),{}),e.StopXform=a,e.PatternFillXform=r,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,T,_){const p=s("./color-xform"),o=s("../simple/boolean-xform"),a=s("../simple/integer-xform"),r=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class n extends l{constructor(u){super(),this.options=u||n.OPTIONS,this.map={b:{prop:"bold",xform:new o({tag:"b",attr:"val"})},i:{prop:"italic",xform:new o({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new p},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new o({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new o({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(u,h){const{map:c}=this;u.openNode(this.options.tagName),e.each(this.map,(d,f)=>{c[f].xform.render(u,h[d.prop])}),u.closeNode()}parseOpen(u){if(this.parser)return this.parser.parseOpen(u),!0;if(this.map[u.name])return this.parser=this.map[u.name].xform,this.parser.parseOpen(u);switch(u.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(u){this.parser&&this.parser.parseText(u)}parseClose(u){if(this.parser&&!this.parser.parseClose(u)){const h=this.map[u];return this.parser.model&&(this.model[h.prop]=this.parser.model),this.parser=void 0,!0}switch(u){case this.options.tagName:return!1;default:return!0}}}n.OPTIONS={tagName:"font",fontNameTag:"name"},T.exports=n},{"../../../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(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../defaultnumformats"),a=s("../base-xform"),r=function(){const e={};return p.each(o,(l,n)=>{l.f&&(e[l.f]=parseInt(n,10))}),e}();class t extends a{constructor(l,n){super(),this.id=l,this.formatCode=n}get tag(){return"numFmt"}render(l,n){l.leafNode("numFmt",{numFmtId:n.id,formatCode:n.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return o[e]&&o[e].f},T.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,T,_){const p=s("../base-xform"),o={boolean:(a,r)=>a===void 0?r:a};T.exports=class extends p{get tag(){return"protection"}render(a,r){a.addRollback(),a.openNode("protection");let t=!1;function e(l,n){n!==void 0&&(a.addAttribute(l,n),t=!0)}e("locked",o.boolean(r.locked,!0)?void 0:"0"),e("hidden",o.boolean(r.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){const r={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,T,_){const p=s("../base-xform"),o=s("./alignment-xform"),a=s("./protection-xform");T.exports=class extends p{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new o,protection:new a}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(s,T,_){const p=s("../../../doc/enums"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),n=s("./border-xform"),i=s("./numfmt-xform"),u=s("./style-xform"),h=s("./dxf-xform");class c extends a{constructor(f){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new i}),fonts:new t({tag:"fonts",count:!0,childXform:new e,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new n}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new u}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new u({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new h}),numFmt:new i,font:new e,fill:new l,border:new n,style:new u({xfId:!0}),cellStyles:c.STATIC_XFORMS.cellStyles,tableStyles:c.STATIC_XFORMS.tableStyles,extLst:c.STATIC_XFORMS.extLst},f&&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(f,v){v=v||this.model,f.openXml(o.StdDocAttributes),f.openNode("styleSheet",c.STYLESHEET_ATTRIBUTES),this.index?(v.numFmts&&v.numFmts.length&&(f.openNode("numFmts",{count:v.numFmts.length}),v.numFmts.forEach(x=>{f.writeXml(x)}),f.closeNode()),v.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:v.fonts.length,"x14ac:knownFonts":1}),v.fonts.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("fills",{count:v.fills.length}),v.fills.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("borders",{count:v.borders.length}),v.borders.forEach(x=>{f.writeXml(x)}),f.closeNode(),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),f.openNode("cellXfs",{count:v.styles.length}),v.styles.forEach(x=>{f.writeXml(x)}),f.closeNode()):(this.map.numFmts.render(f,v.numFmts),this.map.fonts.render(f,v.fonts),this.map.fills.render(f,v.fills),this.map.borders.render(f,v.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,v.styles)),c.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,v.dxfs),c.STATIC_XFORMS.tableStyles.render(f),c.STATIC_XFORMS.extLst.render(f),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"styleSheet":{this.model={};const v=(x,A)=>{A.model&&A.model.length&&(this.model[x]=A.model)};if(v("numFmts",this.map.numFmts),v("fonts",this.map.fonts),v("fills",this.map.fills),v("borders",this.map.borders),v("styles",this.map.cellXfs),v("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const x=this.index.numFmt;this.model.numFmts.forEach(A=>{x[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(f,v){if(!f)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(f))return this.weakMap.get(f);const x={};if(v=v||p.ValueType.Number,f.numFmt)x.numFmtId=this._addNumFmtStr(f.numFmt);else switch(v){case p.ValueType.Number:x.numFmtId=this._addNumFmtStr("General");break;case p.ValueType.Date:x.numFmtId=this._addNumFmtStr("mm-dd-yy")}f.font&&(x.fontId=this._addFont(f.font)),f.border&&(x.borderId=this._addBorder(f.border)),f.fill&&(x.fillId=this._addFill(f.fill)),f.alignment&&(x.alignment=f.alignment),f.protection&&(x.protection=f.protection);const A=this._addStyle(x);return this.weakMap&&this.weakMap.set(f,A),A}getStyleModel(f){const v=this.model.styles[f];if(!v)return null;let x=this.index.model[f];if(x)return x;if(x=this.index.model[f]={},v.numFmtId){const I=this.index.numFmt[v.numFmtId]||i.getDefaultFmtCode(v.numFmtId);I&&(x.numFmt=I)}function A(I,F,j){if(j||j===0){const P=F[j];P&&(x[I]=P)}}return A("font",this.model.fonts,v.fontId),A("border",this.model.borders,v.borderId),A("fill",this.model.fills,v.fillId),v.alignment&&(x.alignment=v.alignment),v.protection&&(x.protection=v.protection),x}addDxfStyle(f){return f.numFmt&&(f.numFmtId=this._addNumFmtStr(f.numFmt)),this.model.dxfs.push(f),this.model.dxfs.length-1}getDxfStyle(f){return this.model.dxfs[f]}_addStyle(f){const v=this.map.style.toXml(f);let x=this.index.style[v];return x===void 0&&(x=this.index.style[v]=this.model.styles.length,this.model.styles.push(v)),x}_addNumFmtStr(f){let v=i.getDefaultFmtId(f);if(v!==void 0||(v=this.index.numFmt[f],v!==void 0))return v;v=this.index.numFmt[f]=164+this.model.numFmts.length;const x=this.map.numFmt.toXml({id:v,formatCode:f});return this.model.numFmts.push(x),v}_addFont(f){const v=this.map.font.toXml(f);let x=this.index.font[v];return x===void 0&&(x=this.index.font[v]=this.model.fonts.length,this.model.fonts.push(v)),x}_addBorder(f){const v=this.map.border.toXml(f);let x=this.index.border[v];return x===void 0&&(x=this.index.border[v]=this.model.borders.length,this.model.borders.push(v)),x}_addFill(f){const v=this.map.fill.toXml(f);let x=this.index.fill[v];return x===void 0&&(x=this.index.fill[v]=this.model.fills.length,this.model.fills.push(v)),x}}c.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"},c.STATIC_XFORMS={cellStyles:new r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({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"}}]}]})},c.Mock=class extends c{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(d){return d.autodrain(),Promise.resolve()}addStyleModel(d,f){switch(f){case p.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const d={numFmtId:i.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(d)}return this._dateStyleId}getStyleModel(){return{}}},T.exports=c},{"../../../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(s,T,_){const p=s("../base-xform");class o extends p{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{const e=o.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}o.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},T.exports=o},{"../base-xform":32}],137:[function(s,T,_){const p=s("../base-xform"),o=s("./filter-column-xform");T.exports=class extends p{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(a,r){return a.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.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.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"customFilter"}render(o,a){o.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,_){const p=s("../base-xform"),o=s("../list-xform"),a=s("./custom-filter-xform"),r=s("./filter-xform");T.exports=class extends p{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;switch(t.name){case this.tag:return this.model={filterButton:e.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"filter"}render(o,a){o.leafNode(this.tag,{val:a.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tableColumn"}prepare(o,a){o.id=a.index+1}render(o,a){return o.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tableStyleInfo"}render(o,a){return o.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends o{constructor(){super(),this.map={autoFilter:new r,tableColumns:new a({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,u){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,u)}get tag(){return"table"}render(i,u){i.openXml(p.StdDocAttributes),i.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:u.id,name:u.name,displayName:u.displayName||u.name,ref:u.tableRef,totalsRowCount:u.totalsRow?"1":void 0,totalsRowShown:u.totalsRow?void 0:"1",headerRowCount:u.headerRow?"1":"0"}),this.map.autoFilter.render(i,u),this.map.tableColumns.render(i,u.columns),this.map.tableStyleInfo.render(i,u.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:u,attributes:h}=i;switch(u){case this.tag:this.reset(),this.model={name:h.name,displayName:h.displayName||h.name,tableRef:h.ref,totalsRow:h.totalsRowCount==="1",headerRow:h.headerRowCount==="1"};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.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((u,h)=>{this.model.columns[h].filterButton=u.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,u){i.columns.forEach(h=>{h.dxfId!==void 0&&(h.style=u.styles.getDxfStyle(h.dxfId))})}}l.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"},T.exports=l},{"../../../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(s,T,_){(function(p,o){(function(){const a=s("fs"),r=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),n=s("../utils/utils"),i=s("../utils/xml-stream"),{bufferToString:u}=s("../utils/browser-buffer-decode"),h=s("./xform/style/styles-xform"),c=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),f=s("./xform/core/relationships-xform"),v=s("./xform/core/content-types-xform"),x=s("./xform/core/app-xform"),A=s("./xform/book/workbook-xform"),I=s("./xform/sheet/worksheet-xform"),F=s("./xform/drawing/drawing-xform"),j=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),D=s("./xform/comment/vml-notes-xform"),U=s("./xml/theme1");class B{constructor(C){this.workbook=C}async readFile(C,w){if(!await n.fs.exists(C))throw new Error("File not found: "+C);const m=a.createReadStream(C);try{const b=await this.read(m,w);return m.close(),b}catch(b){throw m.close(),b}}parseRels(C){return new f().parseStream(C)}parseWorkbook(C){return new A().parseStream(C)}parseSharedStrings(C){return new d().parseStream(C)}reconcile(C,w){const m=new A,b=new I(w),g=new F,y=new j;m.reconcile(C);const S={media:C.media,mediaIndex:C.mediaIndex};Object.keys(C.drawings).forEach(z=>{const H=C.drawings[z],q=C.drawingRels[z];q&&(S.rels=q.reduce((O,$)=>(O[$.Id]=$,O),{}),(H.anchors||[]).forEach(O=>{const $=O.picture&&O.picture.hyperlinks;$&&S.rels[$.rId]&&($.hyperlink=S.rels[$.rId].Target,delete $.rId)}),g.reconcile(H,S))});const R={styles:C.styles};Object.values(C.tables).forEach(z=>{y.reconcile(z,R)});const N={styles:C.styles,sharedStrings:C.sharedStrings,media:C.media,mediaIndex:C.mediaIndex,date1904:C.properties&&C.properties.date1904,drawings:C.drawings,comments:C.comments,tables:C.tables,vmlDrawings:C.vmlDrawings};C.worksheets.forEach(z=>{z.relationships=C.worksheetRels[z.sheetNo],b.reconcile(z,N)}),delete C.worksheetHash,delete C.worksheetRels,delete C.globalRels,delete C.sharedStrings,delete C.workbookRels,delete C.sheetDefs,delete C.styles,delete C.mediaIndex,delete C.drawings,delete C.drawingRels,delete C.vmlDrawings}async _processWorksheetEntry(C,w,m,b,g){const y=new I(b),S=await y.parseStream(C);S.sheetNo=m,w.worksheetHash[g]=S,w.worksheets.push(S)}async _processCommentEntry(C,w,m){const b=new P,g=await b.parseStream(C);w.comments[`../${m}.xml`]=g}async _processTableEntry(C,w,m){const b=new j,g=await b.parseStream(C);w.tables[`../tables/${m}.xml`]=g}async _processWorksheetRelsEntry(C,w,m){const b=new f,g=await b.parseStream(C);w.worksheetRels[m]=g}async _processMediaEntry(C,w,m){const b=m.lastIndexOf(".");if(b>=1){const g=m.substr(b+1),y=m.substr(0,b);await new Promise((S,R)=>{const N=new l;N.on("finish",()=>{w.mediaIndex[m]=w.media.length,w.mediaIndex[y]=w.media.length;const z={type:"image",name:y,extension:g,buffer:N.toBuffer()};w.media.push(z),S()}),C.on("error",z=>{R(z)}),C.pipe(N)})}}async _processDrawingEntry(C,w,m){const b=new F,g=await b.parseStream(C);w.drawings[m]=g}async _processDrawingRelsEntry(C,w,m){const b=new f,g=await b.parseStream(C);w.drawingRels[m]=g}async _processVmlDrawingEntry(C,w,m){const b=new D,g=await b.parseStream(C);w.vmlDrawings[`../drawings/${m}.vml`]=g}async _processThemeEntry(C,w,m){await new Promise((b,g)=>{const y=new l;C.on("error",g),y.on("error",g),y.on("finish",()=>{w.themes[m]=y.read().toString(),b()}),C.pipe(y)})}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(C,w){!C[Symbol.asyncIterator]&&C.pipe&&(C=C.pipe(new t));const m=[];for await(const b of C)m.push(b);return this.load(o.concat(m),w)}async load(C,w){let m;m=w&&w.base64?o.from(C.toString(),"base64"):C;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await r.loadAsync(m);for(const y of Object.values(g.files))if(!y.dir){let S,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))S=new t,S.write(await y.async("nodebuffer"));else{let N;S=new t({writableObjectMode:!0,readableObjectMode:!0}),N=p.browser?u(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let H=0;H{if(m.type==="image"){const b=`xl/media/${m.name}.${m.extension}`;if(m.filename){const g=await function(y,S){return new Promise((R,N)=>{a.readFile(y,S,(z,H)=>{z?N(z):R(H)})})}(m.filename);return C.append(g,{name:b})}if(m.buffer)return C.append(m.buffer,{name:b});if(m.base64){const g=m.base64,y=g.substring(g.indexOf(",")+1);return C.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(C,w){const m=new F,b=new f;w.worksheets.forEach(g=>{const{drawing:y}=g;if(y){m.prepare(y,{});let S=m.toXml(y);C.append(S,{name:`xl/drawings/${y.name}.xml`}),S=b.toXml(y.rels),C.append(S,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(C,w){const m=new j;w.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{m.prepare(y,{});const S=m.toXml(y);C.append(S,{name:"xl/tables/"+y.target})})})}async addContentTypes(C,w){const m=new v().toXml(w);C.append(m,{name:"[Content_Types].xml"})}async addApp(C,w){const m=new x().toXml(w);C.append(m,{name:"docProps/app.xml"})}async addCore(C,w){const m=new c;C.append(m.toXml(w),{name:"docProps/core.xml"})}async addThemes(C,w){const m=w.themes||{theme1:U};Object.keys(m).forEach(b=>{const g=m[b],y=`xl/theme/${b}.xml`;C.append(g,{name:y})})}async addOfficeRels(C){const w=new f().toXml([{Id:"rId1",Type:B.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:B.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:B.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);C.append(w,{name:"_rels/.rels"})}async addWorkbookRels(C,w){let m=1;const b=[{Id:"rId"+m++,Type:B.RelType.Styles,Target:"styles.xml"},{Id:"rId"+m++,Type:B.RelType.Theme,Target:"theme/theme1.xml"}];w.sharedStrings.count&&b.push({Id:"rId"+m++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),w.worksheets.forEach(y=>{y.rId="rId"+m++,b.push({Id:y.rId,Type:B.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new f().toXml(b);C.append(g,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(C,w){w.sharedStrings&&w.sharedStrings.count&&C.append(w.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(C,w){const{xml:m}=w.styles;m&&C.append(m,{name:"xl/styles.xml"})}async addWorkbook(C,w){const m=new A;C.append(m.toXml(w),{name:"xl/workbook.xml"})}async addWorksheets(C,w){const m=new I,b=new f,g=new P,y=new D;w.worksheets.forEach(S=>{let R=new i;m.render(R,S),C.append(R.xml,{name:`xl/worksheets/sheet${S.id}.xml`}),S.rels&&S.rels.length&&(R=new i,b.render(R,S.rels),C.append(R.xml,{name:`xl/worksheets/_rels/sheet${S.id}.xml.rels`})),S.comments.length>0&&(R=new i,g.render(R,S),C.append(R.xml,{name:`xl/comments${S.id}.xml`}),R=new i,y.render(R,S),C.append(R.xml,{name:`xl/drawings/vmlDrawing${S.id}.vml`}))})}_finalize(C){return new Promise((w,m)=>{C.on("finish",()=>{w(this)}),C.on("error",m),C.finalize()})}prepareModel(C,w){C.creator=C.creator||"ExcelJS",C.lastModifiedBy=C.lastModifiedBy||"ExcelJS",C.created=C.created||new Date,C.modified=C.modified||new Date,C.useSharedStrings=w.useSharedStrings===void 0||w.useSharedStrings,C.useStyles=w.useStyles===void 0||w.useStyles,C.sharedStrings=new d,C.styles=C.useStyles?new h(!0):new h.Mock;const m=new A,b=new I;m.prepare(C);const g={sharedStrings:C.sharedStrings,styles:C.styles,date1904:C.properties.date1904,drawingsCount:0,media:C.media};g.drawings=C.drawings=[],g.commentRefs=C.commentRefs=[];let y=0;C.tables=[],C.worksheets.forEach(S=>{S.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,C.tables.push(R)}),b.prepare(S,g)})}async write(C,w){w=w||{};const{model:m}=this.workbook,b=new e.ZipWriter(w.zip);return b.pipe(C),this.prepareModel(m,w),await this.addContentTypes(b,m),await this.addOfficeRels(b,m),await this.addWorkbookRels(b,m),await this.addWorksheets(b,m),await this.addSharedStrings(b,m),await this.addDrawings(b,m),await this.addTables(b,m),await Promise.all([this.addThemes(b,m),this.addStyles(b,m)]),await this.addMedia(b,m),await Promise.all([this.addApp(b,m),this.addCore(b,m)]),await this.addWorkbook(b,m),this._finalize(b)}writeFile(C,w){const m=a.createWriteStream(C);return new Promise((b,g)=>{m.on("finish",()=>{b()}),m.on("error",y=>{g(y)}),this.write(m,w).then(()=>{m.end()}).catch(y=>{g(y)})})}async writeBuffer(C){const w=new l;return await this.write(w,C),w.read()}}B.RelType=s("./rel-type"),T.exports=B}).call(this)}).call(this,s("_process"),s("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(s,T,_){T.exports=` +`,hn="table, th, td {border: 1px solid black; border-collapse: collapse;} th, td {padding: 5px; text-align: left;} th:has(> b), td:has(> b) {text-align: center;}";function vr(G){const nt=[];let s=0,T=G.data.indexes[s];for(let _=0;_${p.cells.map(o=>{const a=typeof o.value=="string"?gr(o.value):o.value;return`${o.type!==ve.Value?`${a}`:a}`}).join(` +`)}`),T=G.data.indexes[++s]}else nt.push("");return`${nt.join(` +`)}
`}function fn(G){return G.length>1?G.map(([nt,s])=>`

${nt}

${vr(s)}`).join("
"):vr(G[0][1])}var Yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ue(G){throw new Error('Could not dynamically require "'+G+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var wr={exports:{}};/*! ExcelJS 19-10-2023 */(function(G,nt){(function(s){G.exports=s()})(function(){return function s(T,_,p){function o(t,e){if(!_[t]){if(!T[t]){var l=typeof Ue=="function"&&Ue;if(!e&&l)return l(t,!0);if(a)return a(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=_[t]={exports:{}};T[t][0].call(i.exports,function(u){return o(T[t][1][u]||u)},i,i.exports,s,T,_,p)}return _[t].exports}for(var a=typeof Ue=="function"&&Ue,r=0;r{const d=this.workbook.addWorksheet(u.sheetName),f=u.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],v=u.map||function(A){if(A==="")return null;const I=Number(A);if(!Number.isNaN(I)&&I!==1/0)return I;const F=f.reduce((P,B)=>{if(P)return P;const U=t(A,B,!0);return U.isValid()?U:null},null);if(F)return new Date(F.valueOf());const j=n[A];return j!==void 0?j:A},x=o.parse(u.parserOptions).on("data",A=>{d.addRow(A.map(v))}).on("end",()=>{x.emit("worksheet",d)});x.on("worksheet",h).on("error",c),i.pipe(x)})}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(i,u){return new Promise((h,c)=>{u=u||{};const d=this.workbook.getWorksheet(u.sheetName||u.sheetId),f=o.format(u.formatterOptions);i.on("finish",()=>{h()}),f.on("error",c),f.pipe(i);const{dateFormat:v,dateUTC:x}=u,A=u.map||(j=>{if(j){if(j.text||j.hyperlink)return j.hyperlink||j.text||"";if(j.formula||j.result)return j.result||"";if(j instanceof Date)return v?x?t.utc(j).format(v):t(j).format(v):x?t.utc(j).format():t(j).format();if(j.error)return j.error;if(typeof j=="object")return JSON.stringify(j)}return j}),I=u.includeEmptyRows===void 0||u.includeEmptyRows;let F=1;d&&d.eachRow((j,P)=>{if(I)for(;F++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){const l=p.decodeAddress(t);this.nativeCol=l.col+e,this.nativeColOff=0,this.nativeRow=l.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 o||r==null?r:new o(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}}T.exports=o},{"../utils/col-cache":19}],3:[function(s,T,_){const p=s("../utils/col-cache"),o=s("../utils/under-dash"),a=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,u,h){if(!i||!u)throw new Error("A Cell needs a Row");this._row=i,this._column=u,p.validateAddress(h),this._address=h,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,u.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(i){this.style.numFmt=i}get font(){return this.style.font}set font(i){this.style.font=i}get alignment(){return this.style.alignment}set alignment(i){this.style.alignment=i}get border(){return this.style.border}set border(i){this.style.border=i}get fill(){return this.style.fill}set fill(i){this.style.fill=i}get protection(){return this.style.protection}set protection(i){this.style.protection=i}_mergeStyle(i,u,h){const c=i&&i.numFmt||u&&u.numFmt;c&&(h.numFmt=c);const d=i&&i.font||u&&u.font;d&&(h.font=d);const f=i&&i.alignment||u&&u.alignment;f&&(h.alignment=f);const v=i&&i.border||u&&u.border;v&&(h.border=v);const x=i&&i.fill||u&&u.fill;x&&(h.fill=x);const A=i&&i.protection||u&&u.protection;return A&&(h.protection=A),h}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(i,u){this._value.release(),this._value=l.create(e.Types.Merge,this,i),u||(this.style=i.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(i){return this._value.type===e.Types.Merge&&this._value.isMergedTo(i)}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(i){this.type!==e.Types.Merge?(this._value.release(),this._value=l.create(l.getType(i),this,i)):this._value.master.value=i}get note(){return this._comment&&this._comment.note}set note(i){this._comment=new t(i)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(i){this.type===e.Types.String&&(this._value=l.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:i}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:i}=this._row;return{sheetName:i.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(i){this.names=[i]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(i){const{definedNames:u}=this.workbook;u.removeAllNames(this.fullAddress),i.forEach(h=>{u.addEx(this.fullAddress,h)})}addName(i){this.workbook.definedNames.addEx(this.fullAddress,i)}removeName(i){this.workbook.definedNames.removeEx(this.fullAddress,i)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(i){this._dataValidations.add(this.address,i)}get model(){const{model:i}=this._value;return i.style=this.style,this._comment&&(i.comment=this._comment.model),i}set model(i){if(this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment)switch(i.comment.type){case"note":this._comment=t.fromModel(i.comment)}i.style?this.style=i.style:this.style={}}}e.Types=a.ValueType;const l={getType:n=>n==null?e.Types.Null:n instanceof String||typeof n=="string"?e.Types.String:typeof n=="number"?e.Types.Number:typeof n=="boolean"?e.Types.Boolean:n instanceof Date?e.Types.Date:n.text&&n.hyperlink?e.Types.Hyperlink:n.formula||n.sharedFormula?e.Types.Formula:n.richText?e.Types.RichText:n.sharedString?e.Types.SharedString:n.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(n){this.model={address:n.address,type:e.Types.Null}}get value(){return null}set value(n){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Number,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Date,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Hyperlink,text:i?i.text:void 0,hyperlink:i?i.hyperlink:void 0},i&&i.tooltip&&(this.model.tooltip=i.tooltip)}get value(){const n={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(n.tooltip=this.model.tooltip),n}set value(n){this.model={text:n.text,hyperlink:n.hyperlink},n.tooltip&&(this.model.tooltip=n.tooltip)}get text(){return this.model.text}set text(n){this.model.text=n}get hyperlink(){return this.model.hyperlink}set hyperlink(n){this.model.hyperlink=n}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(n,i){this.cell=n,this.model={address:n.address,type:e.Types.Formula,shareType:i?i.shareType:void 0,ref:i?i.ref:void 0,formula:i?i.formula:void 0,sharedFormula:i?i.sharedFormula:void 0,result:i?i.result:void 0}}_copyModel(n){const i={},u=h=>{const c=n[h];c&&(i[h]=c)};return u("formula"),u("result"),u("ref"),u("shareType"),u("sharedFormula"),i}get value(){return this._copyModel(this.model)}set value(n){this.model=this._copyModel(n)}validate(n){switch(l.getType(n)){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(n){this.model.formula=n}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(n){this.model.result=n}get type(){return e.Types.Formula}get effectiveType(){const n=this.model.result;return n==null?a.ValueType.Null:n instanceof String||typeof n=="string"?a.ValueType.String:typeof n=="number"?a.ValueType.Number:n instanceof Date?a.ValueType.Date:n.text&&n.hyperlink?a.ValueType.Hyperlink:n.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(n){this.model.address=n}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:n}=this.cell,i=n.findCell(this.model.sharedFormula);this._translatedFormula=i&&r(i.formula,i.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(n,i){this.model={address:n.address,type:e.Types.Merge,master:i?i.address:void 0},this._master=i,i&&i.addMergeRef()}get value(){return this._master.value}set value(n){n instanceof e?(this._master&&this._master.releaseMergeRef(),n.addMergeRef(),this._master=n):this._master.value=n}isMergedTo(n){return n===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(n){this.model.address=n}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:JSON.stringify(i),rawValue:i}}get value(){return this.model.rawValue}set value(n){this.model.rawValue=n,this.model.value=JSON.stringify(n)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.SharedString,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}toString(){return this.model.value.richText.map(n=>n.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Boolean,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Error,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((n,i)=>(n[i.t]=i.f,n),[]),create(n,i,u){const h=this.types[n];if(!h)throw new Error("Could not create Value of type "+n);return new h(i,u)}};T.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(s,T,_){const p=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache");class r{constructor(e,l,n){this._worksheet=e,this._number=l,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.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((l,n)=>{this._worksheet.getCell(n+1,this.number).value=l})):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&&p.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,l){const n=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(i,u)=>{l(i.getCell(n),u)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==o.ValueType.Null&&(e[n]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let n=0;e.hasOwnProperty("0")&&(n=1),e.forEach((i,u)=>{this._worksheet.getCell(u+n,l).value=i})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(n=>{n[e]=l}),l}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 l=[];let n=null;return e&&e.forEach((i,u)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=u+1:(n={min:u+1,max:u+1,width:i.width!==void 0?i.width:9,style:i.style,isCustomWidth:i.isCustomWidth,hidden:i.hidden,outlineLevel:i.outlineLevel,collapsed:i.collapsed},l.push(n))}),l.length?l:void 0}static fromModel(e,l){const n=[];let i=1,u=0;for(l=(l=l||[]).sort(function(h,c){return h.min-c.min});u{l.removeCellEx(e)})}forEach(e){p.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(o.decodeEx(e))}getNamesEx(e){return p.map(this.matrixMap,(l,n)=>l.findCellEx(e)&&n).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:n}=l,i=new r(l.row,l.col,l.row,l.col,n);let u,h;function c(f,v){const x=e.findCellAt(n,f,l.col);return!(!x||!x.mark)&&(i[v]=f,x.mark=!1,!0)}for(h=l.row-1;c(h,"top");h--);for(h=l.row+1;c(h,"bottom");h++);function d(f,v){const x=[];for(h=i.top;h<=i.bottom;h++){const A=e.findCellAt(n,h,f);if(!A||!A.mark)return!1;x.push(A)}i[v]=f;for(let A=0;A{n.mark=!0}),{name:e,ranges:l.map(n=>n.mark&&this._explore(l,n)).filter(Boolean).map(n=>n.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(n,i,u)=>{n&&(n.row===i&&n.col===u||(n.row=i,n.col=u,n.address=o.n2l(u)+i))})}spliceRows(e,l,n,i){p.each(this.matrixMap,u=>{u.spliceRows(e,l,n,i),this.normaliseMatrix(u,e)})}spliceColumns(e,l,n,i){p.each(this.matrixMap,u=>{u.spliceColumns(e,l,n,i),this.normaliseMatrix(u,e)})}get model(){return p.map(this.matrixMap,(e,l)=>this.getRanges(l,e)).filter(e=>e.ranges.length)}set model(e){const l=this.matrixMap={};e.forEach(n=>{const i=l[n.name]=new a;n.ranges.forEach(u=>{t.test(u.split("!").pop()||"")&&i.addCell(u)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(s,T,_){T.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(s,T,_){const p=s("../utils/col-cache"),o=s("./anchor");T.exports=class{constructor(a,r){this.worksheet=a,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(a){let{type:r,imageId:t,range:e,hyperlinks:l}=a;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=p.decode(e);this.range={tl:new o(this.worksheet,{col:n.left,row:n.top},-1),br:new o(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new o(this.worksheet,e.tl,0),br:e.br&&new o(this.worksheet,e.br,0),ext:e.ext,editAs:e.editAs,hyperlinks:l||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(s,T,_){const p=s("../utils/under-dash");class o{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 p.deepMerge({},o.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 o;return t.model=r,t}}o.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=o},{"../utils/under-dash":26}],10:[function(s,T,_){const p=s("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=p.decodeAddress(r),u=p.decodeAddress(t);this.model={top:Math.min(i.row,u.row),left:Math.min(i.col,u.col),bottom:Math.max(i.row,u.row),right:Math.max(i.col,u.col),sheetName:e},this.setTLBR(i.row,i.col,u.row,u.col,n)}else this.model={top:Math.min(r,e),left:Math.min(t,l),bottom:Math.max(r,e),right:Math.max(t,l),sheetName:n}}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 o)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=p.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,l){(!this.model.top||rthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=p.decodeEx(r);this.expand(t.row,t.col,t.row,t.col)}get tl(){return p.n2l(this.left)+this.top}get $t$l(){return`$${p.n2l(this.left)}$${this.top}`}get br(){return p.n2l(this.right)+this.bottom}get $b$r(){return`$${p.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.bottomthis.bottom)&&!(r.rightthis.right)}contains(r){const t=p.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(p.encodeAddress(e,t),e,t)}}T.exports=o},{"../utils/col-cache":19}],11:[function(s,T,_){const p=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache"),r=s("./cell");T.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 l=this._worksheet.getColumn(t.col);e=new r(this,l,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:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),u=2;u0)for(d=c;d>=l;d--)f=this._cells[d-1],f?(v=this.getCell(d+h),v.value=f.value,v.style=f.style,v._comment=f._comment):this._cells[d+h-1]=void 0;for(d=0;d{l&&l.type!==o.ValueType.Null&&e(l,n+1)})}addPageBreak(t,e){const l=this._worksheet,n=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,u={id:this._number,max:i,man:1};n&&(u.min=n),l.rowBreaks.push(u)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==o.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((l,n)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,n+e),row:this._number,col:n+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[l])})}get hasValues(){return p.some(this._cells,t=>t&&t.type!==o.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(l=>{l&&l.type!==o.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[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,l=0;return this._cells.forEach(n=>{if(n){const i=n.model;i&&((!e||e>n.col)&&(e=n.col),l{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=a.decodeAddress(l.address);else if(e){const{row:i}=e,u=e.col+1;n={row:i,col:u,address:a.encodeAddress(i,u),$col$row:`$${a.n2l(u)}$${i}`}}e=n,this.getCellEx(n).model=l;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(s,T,_){const p=s("../utils/col-cache");class o{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)}}T.exports=class{constructor(a,r){this.worksheet=a,r&&(this.table=r,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.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:a}=this,r=(h,c,d)=>{h[c]===void 0&&(h[c]=d)};r(a,"headerRow",!0),r(a,"totalsRow",!1),r(a,"style",{}),r(a.style,"theme","TableStyleMedium2"),r(a.style,"showFirstColumn",!1),r(a.style,"showLastColumn",!1),r(a.style,"showRowStripes",!1),r(a.style,"showColumnStripes",!1);const t=(h,c)=>{if(!h)throw new Error(c)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=p.decodeAddress(a.ref);const{row:e,col:l}=a.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:n,filterHeight:i,tableHeight:u}=this;a.autoFilterRef=p.encode(e,l,e+i-1,l+n-1),a.tableRef=p.encode(e,l,e+u-1,l+n-1),a.columns.forEach((h,c)=>{t(h.name,`Column ${c} must have a name`),c===0?r(h,"totalsRowLabel","Total"):(r(h,"totalsRowFunction","none"),h.totalsRowFormula=this.getFormula(h))})}store(){const a=(i,u)=>{u&&Object.keys(u).forEach(h=>{i[h]=u[h]})},{worksheet:r,table:t}=this,{row:e,col:l}=t.tl;let n=0;if(t.headerRow){const i=r.getRow(e+n++);t.columns.forEach((u,h)=>{const{style:c,name:d}=u,f=i.getCell(l+h);f.value=d,a(f,c)})}if(t.rows.forEach(i=>{const u=r.getRow(e+n++);i.forEach((h,c)=>{const d=u.getCell(l+c);d.value=h,a(d,t.columns[c].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((u,h)=>{const c=i.getCell(l+h);if(h===0)c.value=u.totalsRowLabel;else{const d=this.getFormula(u);c.value=d?{formula:u.totalsRowFormula,result:u.totalsRowResult}:null}a(c,u.style)})}}load(a){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=a.getRow(t+l++);r.columns.forEach((i,u)=>{n.getCell(e+u).value=i.name})}if(r.rows.forEach(n=>{const i=a.getRow(t+l++);n.forEach((u,h)=>{i.getCell(e+h).value=u})}),r.totalsRow){const n=a.getRow(t+l++);r.columns.forEach((i,u)=>{const h=n.getCell(e+u);u===0?h.value=i.totalsRowLabel:this.getFormula(i)&&(h.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const a=p.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(a,r)}getColumn(a){const r=this.table.columns[a];return new o(this,r,a)}addColumn(a,r,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(a){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,r),this.table.rows.forEach(t=>{t.splice(a,r)})}_assign(a,r,t){this.cacheState(),a[r]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(s,T,_){const p=s("./worksheet"),o=s("./defined-names"),a=s("../xlsx/xlsx"),r=s("../csv/csv");T.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 o}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t(c&&c.orderNo)>h?c.orderNo:h,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),u=new p(i);return this._worksheets[l]=u,u}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(e=>e&&e.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,e)=>t.orderNo-e.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(e=>{t(e,e.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}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(t=>t.model),sheets:this.worksheets.map(t=>t.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(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(e=>{const{id:l,name:n,state:i}=e,u=t.sheets&&t.sheets.findIndex(h=>h.id===l);(this._worksheets[l]=new p({id:l,name:n,orderNo:u,state:i,workbook:this})).model=e}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(s,T,_){const p=s("../utils/under-dash"),o=s("../utils/col-cache"),a=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),u=s("../utils/encryptor"),{copyStyle:h}=s("../utils/copy-style");T.exports=class{constructor(c){c=c||{},this._workbook=c.workbook,this.id=c.id,this.orderNo=c.orderNo,this.name=c.name,this.state=c.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},c.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:!(!c.pageSetup||!c.pageSetup.fitToWidth&&!c.pageSetup.fitToHeight||c.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},c.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},c.headerFooter),this.dataValidations=new i,this.views=c.views||[],this.autoFilter=c.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(c){if(c===void 0&&(c="sheet"+this.id),this._name!==c){if(typeof c!="string")throw new Error("The name has to be a string.");if(c==="")throw new Error("The name can't be empty.");if(c==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(c))throw new Error(`Worksheet name ${c} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(c))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+c);if(c&&c.length>31&&(console.warn(`Worksheet name ${c} exceeds 31 chars. This will be truncated`),c=c.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===c.toLowerCase()))throw new Error("Worksheet name already exists: "+c);this._name=c}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const c=new a;return this._rows.forEach(d=>{if(d){const f=d.dimensions;f&&c.expand(d.number,f.min,d.number,f.max)}}),c}get columns(){return this._columns}set columns(c){this._headerRowCount=c.reduce((v,x)=>{const A=(x.header?1:x.headers&&x.headers.length)||0;return Math.max(v,A)},0);let d=1;const f=this._columns=[];c.forEach(v=>{const x=new t(this,d++,!1);f.push(x),x.defn=v})}getColumnKey(c){return this._keys[c]}setColumnKey(c,d){this._keys[c]=d}deleteColumnKey(c){delete this._keys[c]}eachColumnKey(c){p.each(this._keys,c)}getColumn(c){if(typeof c=="string"){const d=this._keys[c];if(d)return d;c=o.l2n(c)}if(this._columns||(this._columns=[]),c>this._columns.length){let d=this._columns.length+1;for(;d<=c;)this._columns.push(new t(this,d++))}return this._columns[c-1]}spliceColumns(c,d){const f=this._rows.length;for(var v=arguments.length,x=new Array(v>2?v-2:0),A=2;A0)for(let P=0;P{B.push(D[P]||null)});const U=this.getRow(P+1);U.splice.apply(U,B)}else this._rows.forEach(P=>{P&&P.splice(c,d)});const I=x.length-d,F=c+d,j=this._columns.length;if(I<0)for(let P=c+x.length;P<=j;P++)this.getColumn(P).defn=this.getColumn(P-I).defn;else if(I>0)for(let P=j;P>=F;P--)this.getColumn(P+I).defn=this.getColumn(P).defn;for(let P=c;P{c=Math.max(c,d.cellCount)}),c}get actualColumnCount(){const c=[];let d=0;return this.eachRow(f=>{f.eachCell(v=>{let{col:x}=v;c[x]||(c[x]=!0,d++)})}),d}_commitRow(){}get _lastRowNumber(){const c=this._rows;let d=c.length;for(;d>0&&c[d-1]===void 0;)d--;return d}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(c){return this._rows[c-1]}findRows(c,d){return this._rows.slice(c-1,c-1+d)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let c=0;return this.eachRow(()=>{c++}),c}getRow(c){let d=this._rows[c-1];return d||(d=this._rows[c-1]=new r(this,c)),d}getRows(c,d){if(d<1)return;const f=[];for(let v=c;v1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,v=this.getRow(f);return v.values=c,this._setStyleOption(f,d[0]==="i"?d:"n"),v}addRows(c){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return c.forEach(v=>{f.push(this.addRow(v,d))}),f}insertRow(c,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(c,0,d),this._setStyleOption(c,f),this.getRow(c)}insertRows(c,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(c,0,...d),f!=="n")for(let v=0;v1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(c+1)!==void 0?this._copyStyle(c+1,c,d[1]==="+"):d[0]==="i"&&this.findRow(c-1)!==void 0&&this._copyStyle(c-1,c,d[1]==="+")}_copyStyle(c,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this.getRow(c),x=this.getRow(d);x.style=h(v.style),v.eachCell({includeEmpty:f},(A,I)=>{x.getCell(I).style=h(A.style)}),x.height=v.height}duplicateRow(c,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this._rows[c-1],x=new Array(d).fill(v.values);this.spliceRows(c+1,f?0:d,...x);for(let A=0;A{I.getCell(j).style=F.style})}}spliceRows(c,d){const f=c+d;for(var v=arguments.length,x=new Array(v>2?v-2:0),A=2;A{U.getCell(k).style=D.style}),this._rows[P-1]=void 0}else this._rows[P+F-1]=void 0;else if(F>0)for(P=j;P>=f;P--)if(B=this._rows[P-1],B){const U=this.getRow(P+F);U.values=B.values,U.style=B.style,U.height=B.height,B.eachCell({includeEmpty:!0},(D,k)=>{if(U.getCell(k).style=D.style,D._value.constructor.name==="MergeValue"){const C=this.getRow(D._row._number+I).getCell(k),w=D._value._master,m=this.getRow(w._row._number+I).getCell(w._column._number);C.merge(m)}})}else this._rows[P+F-1]=void 0;for(P=0;P{f&&f.hasValues&&d(f,f.number)})}getSheetValues(){const c=[];return this._rows.forEach(d=>{d&&(c[d.number]=d.values)}),c}findCell(c,d){const f=o.getAddress(c,d),v=this._rows[f.row-1];return v?v.findCell(f.col):void 0}getCell(c,d){const f=o.getAddress(c,d);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var c=arguments.length,d=new Array(c),f=0;f{if(v.intersects(c))throw new Error("Cannot merge already merged cells")});const f=this.getCell(c.top,c.left);for(let v=c.top;v<=c.bottom;v++)for(let x=c.left;x<=c.right;x++)(v>c.top||x>c.left)&&this.getCell(v,x).merge(f,d);this._merges[f.address]=c}_unMergeMaster(c){const d=this._merges[c.address];if(d){for(let f=d.top;f<=d.bottom;f++)for(let v=d.left;v<=d.right;v++)this.getCell(f,v).unmerge();delete this._merges[c.address]}}get hasMerges(){return p.some(this._merges,Boolean)}unMergeCells(){for(var c=arguments.length,d=new Array(c),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const x=o.decode(c),{top:A,left:I,bottom:F,right:j}=x,P=j-I+1,B=o.encodeAddress(A,I),U=v==="shared";let D;D=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(C,w)=>f[C-A][w-I]:(C,w)=>f[(C-A)*P+(w-I)]:()=>{};let k=!0;for(let C=A;C<=F;C++)for(let w=I;w<=j;w++)k?(this.getCell(C,w).value={shareType:v,formula:d,ref:c,result:D(C,w)},k=!1):this.getCell(C,w).value=U?{sharedFormula:B,result:D(C,w)}:D(C,w)}addImage(c,d){const f={type:"image",imageId:c,range:d};this._media.push(new l(this,f))}getImages(){return this._media.filter(c=>c.type==="image")}addBackgroundImage(c){const d={type:"background",imageId:c};this._media.push(new l(this,d))}getBackgroundImageId(){const c=this._media.find(d=>d.type==="background");return c&&c.imageId}protect(c,d){return new Promise(f=>{this.sheetProtection={sheet:!0},d&&"spinCount"in d&&(d.spinCount=Number.isFinite(d.spinCount)?Math.round(Math.max(0,d.spinCount)):1e5),c&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=u.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=u.convertPasswordToHash(c,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),d&&(this.sheetProtection=Object.assign(this.sheetProtection,d),!c&&"spinCount"in d&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(c){const d=new n(this,c);return this.tables[c.name]=d,d}getTable(c){return this.tables[c]}removeTable(c){delete this.tables[c]}getTables(){return Object.values(this.tables)}addConditionalFormatting(c){this.conditionalFormattings.push(c)}removeConditionalFormatting(c){typeof c=="number"?this.conditionalFormattings.splice(c,1):this.conditionalFormattings=c instanceof Function?this.conditionalFormattings.filter(c):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(c){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=c}get model(){const c={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(v=>v.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(v=>v.model),conditionalFormattings:this.conditionalFormattings};c.cols=t.toModel(this.columns);const d=c.rows=[],f=c.dimensions=new a;return this._rows.forEach(v=>{const x=v&&v.model;x&&(f.expand(x.number,x.min,x.number,x.max),d.push(x))}),c.merges=[],p.each(this._merges,v=>{c.merges.push(v.range)}),c}_parseRows(c){this._rows=[],c.rows.forEach(d=>{const f=new r(this,d.number);this._rows[f.number-1]=f,f.model=d})}_parseMergeCells(c){p.each(c.mergeCells,d=>{this.mergeCellsWithoutStyle(d)})}set model(c){this.name=c.name,this._columns=t.fromModel(this,c.cols),this._parseRows(c),this._parseMergeCells(c),this.dataValidations=new i(c.dataValidations),this.properties=c.properties,this.pageSetup=c.pageSetup,this.headerFooter=c.headerFooter,this.views=c.views,this.autoFilter=c.autoFilter,this._media=c.media.map(d=>new l(this,d)),this.sheetProtection=c.sheetProtection,this.tables=c.tables.reduce((d,f)=>{const v=new n;return v.model=f,d[f.name]=v,d},{}),this.conditionalFormattings=c.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(s,T,_){s("core-js/modules/es.promise"),s("core-js/modules/es.promise.finally"),s("core-js/modules/es.object.assign"),s("core-js/modules/es.object.keys"),s("core-js/modules/es.object.values"),s("core-js/modules/es.symbol"),s("core-js/modules/es.symbol.async-iterator"),s("core-js/modules/es.array.iterator"),s("core-js/modules/es.array.includes"),s("core-js/modules/es.array.find-index"),s("core-js/modules/es.array.find"),s("core-js/modules/es.string.from-code-point"),s("core-js/modules/es.string.includes"),s("core-js/modules/es.number.is-nan"),s("regenerator-runtime/runtime");const p={Workbook:s("./doc/workbook")},o=s("./doc/enums");Object.keys(o).forEach(a=>{p[a]=o[a]}),T.exports=p},{"./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(s,T,_){const p=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");_.bufferToString=function(o){return typeof o=="string"?o:p?p.decode(o):o.toString()}},{}],17:[function(s,T,_){const p=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=s("buffer");_.stringToBuffer=function(a){return typeof a!="string"?a:p?o.from(p.encode(a).buffer):o.from(a)}},{buffer:220}],18:[function(s,T,_){const p=s("./under-dash"),o=s("./col-cache");T.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(o.decodeEx(a))}getCell(a){return this.findCellEx(o.decodeEx(a),!0)}findCell(a){return this.findCellEx(o.decodeEx(a),!1)}findCellAt(a,r,t){const e=this.sheets[a],l=e&&e[r];return l&&l[t]}addCellEx(a){if(a.top)for(let r=a.top;r<=a.bottom;r++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,r,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,r){const t=this.findSheet(a,r),e=this.findSheetRow(t,a,r);return this.findRowCell(e,a,r)}getCellAt(a,r,t){const e=this.sheets[a]||(this.sheets[a]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:a,address:o.n2l(t)+r,row:r,col:t})}removeCellEx(a){const r=this.findSheet(a);if(!r)return;const t=this.findSheetRow(r,a);t&&delete t[a.col]}forEachInSheet(a,r){const t=this.sheets[a];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(a){p.each(this.sheets,(r,t)=>{this.forEachInSheet(t,a)})}map(a){const r=[];return this.forEach(t=>{r.push(a(t))}),r}findSheet(a,r){const t=a.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(a,r,t){const{row:e}=r;return a&&a[e]?a[e]:t?a[e]=[]:void 0}findRowCell(a,r,t){const{col:e}=r;return a&&a[e]?a[e]:t?a[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(a,r,t,e){const l=this.sheets[a];if(l){const n=[];for(let i=0;i{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,_){const p=/^[A-Z]+\d+$/,o={_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:a=>a<=26?1:a<=676?2:3,_fill(a){let r,t,e,l,n,i=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;i<=26;)r=this._dictionary[i-1],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(i=27;i<=702;)t=i-27,e=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(i=703;i<=16384;)t=i-703,e=t%26,l=Math.floor(t/26)%26,n=Math.floor(t/676),r=this._dictionary[n]+this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!p.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){const r=a.length<5&&this._hash[a];if(r)return r;let t=!1,e="",l=0,n=!1,i="",u=0;for(let c,d=0;d=65&&c<=90)t=!0,e+=a[d],l=26*l+c-64;else if(c>=48&&c<=57)n=!0,i+=a[d],u=10*u+c-48;else if(n&&t&&c!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;n||(u=void 0);const h={address:a=e+i,col:l,row:u,$col$row:`$${e}$${i}`};return l<=100&&u<=100&&(this._hash[a]=h,this._hash[h.$col$row]=h),h},getAddress(a,r){if(r){const t=this.n2l(r)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){const r=a.split(":");if(r.length===2){const t=this.decodeAddress(r[0]),e=this.decodeAddress(r[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){const r=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),u=this.decodeAddress(l[1]);const h=Math.min(i.row,u.row),c=Math.min(i.col,u.col),d=Math.max(i.row,u.row),f=Math.max(i.col,u.col);return i=this.n2l(c)+h,u=this.n2l(f)+d,{top:h,left:c,bottom:d,right:f,sheetName:t,tl:{address:i,col:c,row:h,$col$row:`$${this.n2l(c)}$${h}`,sheetName:t},br:{address:u,col:f,row:d,$col$row:`$${this.n2l(f)}$${d}`,sheetName:t},dimensions:`${i}:${u}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(a,r)=>o.n2l(r)+a,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,r){const[t,e,,l,n]=a,[i,u]=r;return i>=t&&i<=l&&u>=e&&u<=n}};T.exports=o},{}],20:[function(s,T,_){const p=(a,r)=>({...a,...r.reduce((t,e)=>(a[e]&&(t[e]={...a[e]}),t),{})}),o=function(a,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(r[t]=p(a[t],e))};_.copyStyle=a=>{if(!a)return a;if(r=a,Object.keys(r).length===0)return{};var r;const t={...a};return o(a,t,"font",["color"]),o(a,t,"alignment"),o(a,t,"protection"),a.border&&(o(a,t,"border"),o(a.border,t.border,"top",["color"]),o(a.border,t.border,"left",["color"]),o(a.border,t.border,"bottom",["color"]),o(a.border,t.border,"right",["color"]),o(a.border,t.border,"diagonal",["color"])),a.fill&&(o(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(e=>p(e,["color"])))),t}},{}],21:[function(s,T,_){(function(p){(function(){const o=s("crypto"),a={hash(r){const t=o.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;no.randomBytes(r)};T.exports=a}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,_){const{SaxesParser:p}=s("saxes"),{PassThrough:o}=s("readable-stream"),{bufferToString:a}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new o));const t=new p;let e;t.on("error",n=>{e=n});let l=[];t.on("opentag",n=>l.push({eventType:"opentag",value:n})),t.on("text",n=>l.push({eventType:"text",value:n})),t.on("closetag",n=>l.push({eventType:"closetag",value:n}));for await(const n of r){if(t.write(a(n)),e)throw e;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,T,_){const p=s("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(r,t,e){const l=p.decode(t),n=p.decode(e);return r.replace(o,(i,u,h,c,d)=>{if(d)return i;const f=a.exec(c);if(f){const v=f[1],x=f[2].toUpperCase(),A=f[3],I=f[4];if(x.length>3||x.length===3&&x>"XFD")return i;let F=p.l2n(x),j=parseInt(I,10);return v||(F+=n.col-l.col),A||(j+=n.row-l.row),(u||"")+(v||"")+p.n2l(F)+(A||"")+j}return i})}}},{"./col-cache":19}],24:[function(s,T,_){(function(p,o){(function(){const a=s("readable-stream"),r=s("./utils"),t=s("./string-buf");class e{constructor(c,d){this._data=c,this._encoding=d}get length(){return this.toBuffer().length}copy(c,d,f,v){return this.toBuffer().copy(c,d,f,v)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class l{constructor(c){this._data=c}get length(){return this._data.length}copy(c,d,f,v){return this._data._buf.copy(c,d,f,v)}toBuffer(){return this._data.toBuffer()}}class n{constructor(c){this._data=c}get length(){return this._data.length}copy(c,d,f,v){this._data.copy(c,d,f,v)}toBuffer(){return this._data}}class i{constructor(c){this.size=c,this.buffer=o.alloc(c),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const c=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(c,0,this.iRead,this.iWrite),c}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(c){let d;return c===0?null:c===void 0||c>=this.length?(d=this.toBuffer(),this.iRead=this.iWrite,d):(d=o.alloc(c),this.buffer.copy(d,0,this.iRead,c),this.iRead+=c,d)}write(c,d,f){const v=Math.min(f,this.size-this.iWrite);return c.copy(this.buffer,this.iWrite,d,d+v),this.iWrite+=v,v}}const u=function(h){h=h||{},this.bufSize=h.bufSize||1048576,this.buffers=[],this.batch=h.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(u,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(h=>h.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const c=this.buffers[this.buffers.length-1];if(!c.full)return c}const h=new i(this.bufSize);return this.buffers.push(h),h},async _pipe(h){await Promise.all(this.pipes.map(function(c){return new Promise(d=>{c.write(h.toBuffer(),()=>{d()})})}))},_writeToBuffers(h){let c=0;const d=h.length;for(;c1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(f),p.nextTick(d)):(await this._pipe(f),d());else this.paused||this.emit("data",f.toBuffer()),this._writeToBuffers(f),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(h,c,d){const f=v=>{v?d(v):(this._flush(),this.pipes.forEach(x=>{x.end()}),this.emit("finish"))};h?this.write(h,c,f):f()},read(h){let c;if(h){for(c=[];h&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],f=d.read(h);h-=f.length,c.push(f),d.eod&&d.full&&this.buffers.shift()}return o.concat(c)}return c=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],o.concat(c)},setEncoding(h){this.encoding=h},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(h){this.pipes.push(h),!this.paused&&this.buffers.length&&this.end()},unpipe(h){this.pipes=this.pipes.filter(c=>c!==h)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=u}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(s,T,_){(function(p){(function(){T.exports=class{constructor(o){this._buf=p.alloc(o&&o.size||16384),this._encoding=o&&o.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=p.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let a=2*this._buf.length;for(;a=this._buf.length-4;)this._grow(this._inPos+o.length),a=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=a}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,_){const{toString:p}=Object.prototype,o=/["&<>]/,a={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(e=>{t(r[e],e)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(e=>t(r[e],e)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(e=>t(r[e],e)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(e=>t(r[e],e)):[]},keyBy:(r,t)=>r.reduce((e,l)=>(e[l[t]]=l,e),{}),isEqual:function(r,t){const e=typeof r,l=typeof t,n=Array.isArray(r),i=Array.isArray(t);let u;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((h,c)=>{const d=t[c];return a.isEqual(h,d)});if(r===null||t===null)return r===t;if(u=Object.keys(r),Object.keys(t).length!==u.length)return!1;for(const h of u)if(!t.hasOwnProperty(h))return!1;return a.every(r,(h,c)=>{const d=t[c];return a.isEqual(h,d)});default:return r===t}},escapeHtml(r){const t=o.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i":l=">";break;default:continue}n!==i&&(e+=r.substring(n,i)),n=i+1,e+=l}return n!==i?e+r.substring(n,i):e},strcmp:(r,t)=>rt?1:0,isUndefined:r=>p.call(r)==="[object Undefined]",isObject:r=>p.call(r)==="[object Object]",deepMerge(){const r=arguments[0]||{},{length:t}=arguments;let e,l,n;function i(u,h){e=r[h],n=Array.isArray(u),a.isObject(u)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&a.isObject(e)?e:{},r[h]=a.deepMerge(l,u)):a.isUndefined(u)||(r[h]=u)}for(let u=0;u&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{p.setImmediate?o(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,n,i){e.super_=l,i||(i=n,n=null),n&&Object.keys(n).forEach(h=>{Object.defineProperty(e,h,Object.getOwnPropertyDescriptor(n,h))});const u={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(h=>{u[h]=Object.getOwnPropertyDescriptor(i,h)}),e.prototype=Object.create(l.prototype,u)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const n=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(n)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=r.exec(e);if(!l)return e;let n="",i="",u=0,h=l.index;for(;h=11&&c!==13)){i="";break}continue}u!==h&&(n+=e.substring(u,h)),u=h+1,i&&(n+=i)}return u!==h?n+e.substring(u,h):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{a.access(e,a.constants.F_OK,n=>{l(!n)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>e===!0||e==="true"||e===1||e==="1"};T.exports=t}).call(this)}).call(this,typeof Yt<"u"?Yt:typeof self<"u"?self:typeof window<"u"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,T,_){const p=s("./under-dash"),o=s("./utils");function a(e,l,n){e.push(` ${l}="${o.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];p.each(l,(i,u)=>{i!==void 0&&a(n,u,i)}),e.push(n.join(""))}}class t{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(l){const n=this._xml;n.push(" +`)}openNode(l,n){const i=this.tos,u=this._xml;i&&this.open&&u.push(">"),this._stack.push(l),u.push("<"),u.push(l),r(u,n),this.leaf=!0,this.open=!0}addAttribute(l,n){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n!==void 0&&a(this._xml,l,n)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){const n=this._xml;this.open&&(n.push(">"),this.open=!1),this.leaf=!1,n.push(o.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),n=this._xml;this.leaf?n.push("/>"):(n.push("")),this.open=!1,this.leaf=!1}leafNode(l,n,i){this.openNode(l,n),i!==void 0&&this.writeText(i),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 l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},T.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,T,_){(function(p){(function(){const o=s("events"),a=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends o.EventEmitter{constructor(n){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},n),this.zip=new a,this.stream=new r}append(n,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,n,{base64:!0}):(p.browser&&typeof n=="string"&&(n=t(n)),this.zip.file(i.name,n))}async finalize(){const n=await this.zip.generateAsync(this.options);this.stream.end(n),this.emit("finish")}read(n){return this.stream.read(n)}setEncoding(n){return this.stream.setEncoding(n)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(n,i){return this.stream.pipe(n,i)}unpipe(n){return this.stream.unpipe(n)}unshift(n){return this.stream.unshift(n)}wrap(n){return this.stream.wrap(n)}}T.exports={ZipWriter:e}}).call(this)}).call(this,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,T,_){T.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(s,T,_){T.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(s,T,_){const p=s("../../utils/parse-sax"),o=s("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const e of t)for(const{eventType:l,value:n}of e)if(l==="opentag")this.parseOpen(n);else if(l==="text")this.parseText(n);else if(l==="closetag"&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(t){return this.parse(p(t))}get xml(){return this.toXml(this.model)}toXml(t){const e=new o;return this.render(e,t),e.xml}static toAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t.toString()}static toStringAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/col-cache");function a(t){try{return o.decodeEx(t),!0}catch{return!1}}function r(t){const e=[];let l=!1,n="";return t.split(",").forEach(i=>{if(!i)return;const u=(i.match(/'/g)||[]).length;if(!u)return void(l?n+=i+",":a(i)&&e.push(i));const h=u%2==0;!l&&h&&a(i)?e.push(i):l&&!h?(l=!1,a(n+i)&&e.push(n+i),n=""):(l=!0,n+=i+",")}),e}T.exports=class extends p{render(t,e){t.openNode("definedName",{name:e.name,localSheetId:e.localSheetId}),t.writeText(e.ranges.join(",")),t.closeNode()}parseOpen(t){switch(t.name){case"definedName":return this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{render(a,r){a.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:p.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){const r={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(r.visibility=a.visibility),o.leafNode("workbookView",r)}parseOpen(o){if(o.name==="workbookView"){const a=this.model={},r=function(e,l,n){const i=l!==void 0?a[e]=l:n;i!==void 0&&(a[e]=i)},t=function(e,l,n){const i=l!==void 0?a[e]=parseInt(l,10):n;i!==void 0&&(a[e]=i)};return t("x",o.attributes.xWindow,0),t("y",o.attributes.yWindow,0),t("width",o.attributes.windowWidth,25e3),t("height",o.attributes.windowHeight,1e4),r("visibility",o.attributes.visibility,"visible"),t("activeTab",o.attributes.activeTab,void 0),t("firstSheet",o.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),n=s("./sheet-xform"),i=s("./workbook-view-xform"),u=s("./workbook-properties-xform"),h=s("./workbook-calc-properties-xform");class c extends r{constructor(){super(),this.map={fileVersion:c.STATIC_XFORMS.fileVersion,workbookPr:new u,bookViews:new e({tag:"bookViews",count:!1,childXform:new i}),sheets:new e({tag:"sheets",count:!1,childXform:new n}),definedNames:new e({tag:"definedNames",count:!1,childXform:new l}),calcPr:new h}}prepare(f){f.sheets=f.worksheets;const v=[];let x=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(I=>{const F=I.split(":"),j={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${F[0]}:$${F[1]}`],localSheetId:x};v.push(j)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const I=[];if(A.pageSetup.printTitlesColumn){const j=A.pageSetup.printTitlesColumn.split(":");I.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}if(A.pageSetup.printTitlesRow){const j=A.pageSetup.printTitlesRow.split(":");I.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}const F={name:"_xlnm.Print_Titles",ranges:I,localSheetId:x};v.push(F)}x++}),v.length&&(f.definedNames=f.definedNames.concat(v)),(f.media||[]).forEach((A,I)=>{A.name=A.type+(I+1)})}render(f,v){f.openXml(a.StdDocAttributes),f.openNode("workbook",c.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,v.properties),this.map.bookViews.render(f,v.views),this.map.sheets.render(f,v.sheets),this.map.definedNames.render(f,v.definedNames),this.map.calcPr.render(f,v.calcProperties),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"workbook":return!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){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(f){const v=(f.workbookRels||[]).reduce((j,P)=>(j[P.Id]=P,j),{}),x=[];let A,I=0;(f.sheets||[]).forEach(j=>{const P=v[j.rId];P&&(A=f.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=j.name,A.id=j.id,A.state=j.state,x[I++]=A))});const F=[];p.each(f.definedNames,j=>{if(j.name==="_xlnm.Print_Area"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=o.decodeEx(j.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(j.name==="_xlnm.Print_Titles"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=j.ranges.join(","),B=/\$/g,U=/\$\d+:\$\d+/,D=P.match(U);if(D&&D.length){const w=D[0];A.pageSetup.printTitlesRow=w.replace(B,"")}const k=/\$[A-Z]+:\$[A-Z]+/,C=P.match(k);if(C&&C.length){const w=C[0];A.pageSetup.printTitlesColumn=w.replace(B,"")}}}else F.push(j)}),f.definedNames=F,f.media.forEach((j,P)=>{j.index=P})}}c.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"},c.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},T.exports=c},{"../../../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(s,T,_){const p=s("../strings/rich-text-xform"),o=s("../../../utils/utils"),a=s("../base-xform"),r=T.exports=function(t){this.model=t};o.inherits(r,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new p),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){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(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../../../utils/utils"),a=s("../base-xform"),r=s("./comment-xform"),t=T.exports=function(){this.map={comment:new r}};o.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,l){l=l||this.model,e.openXml(p.StdDocAttributes),e.openNode("comments",t.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),l.comments.forEach(n=>{this.map.comment.render(e,n)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){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(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a,r){(a===r[2]||this.tag==="x:SizeWithCells"&&a===r[1])&&o.leafNode(this.tag)}parseOpen(o){switch(o.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(s,T,_){const p=s("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"x:Anchor"}getAnchorRect(o){const a=Math.floor(o.left),r=Math.floor(68*(o.left-a)),t=Math.floor(o.top),e=Math.floor(18*(o.top-t)),l=Math.floor(o.right),n=Math.floor(68*(o.right-l)),i=Math.floor(o.bottom);return[a,r,t,e,l,n,i,Math.floor(18*(o.bottom-i))]}getDefaultRect(o){const a=o.col,r=Math.max(o.row-2,0);return[a,6,r,14,a+2,2,r+4,16]}render(o,a){const r=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.refAddress);o.leafNode("x:Anchor",null,r.join(", "))}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,T,_){const p=s("../base-xform"),o=s("./vml-anchor-xform"),a=s("./style/vml-protection-xform"),r=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends p{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:n,editAs:i}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,i,t),this.map["x:SizeWithCells"].render(e,i,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,n.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,n.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],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(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./vml-shape-xform");class r extends o{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(e,l){e.openXml(p.StdDocAttributes),e.openNode(this.tag,r.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),l.comments.forEach((n,i)=>{this.map["v:shape"].render(e,n,i)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,l){e.anchors.forEach(n=>{n.br?this.map["xdr:twoCellAnchor"].reconcile(n,l):this.map["xdr:oneCellAnchor"].reconcile(n,l)})}}r.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"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(s,T,_){const p=s("../base-xform"),o=s("./vml-textbox-xform"),a=s("./vml-client-data-xform");class r extends p{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new a}}get tag(){return"v:shape"}render(e,l,n){e.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,n)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,l),this.map["x:ClientData"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){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}}}r.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),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":t.note.margins&&t.note.margins.insetmode}),T.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"v:textbox"}conversionUnit(o,a,r){return`${parseFloat(o)*a.toFixed(2)}${r}`}reverseConversionUnit(o){return(o||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(o,a){const r={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}o.openNode("v:textbox",r),o.leafNode("div",{style:"text-align:left"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:return this.model={inset:this.reverseConversionUnit(o.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(s,T,_){const p=s("./base-xform");T.exports=class extends p{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,a){this.model[o]=a.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,a.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.forEach(r=>{o.leafNode("vt:lpstr",void 0,r.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends o{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(n,i){n.openXml(p.StdDocAttributes),n.openNode("Properties",e.PROPERTY_ATTRIBUTES),n.leafNode("Application",void 0,"Microsoft Excel"),n.leafNode("DocSecurity",void 0,"0"),n.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(n,i.worksheets),this.map.TitleOfParts.render(n,i.worksheets),this.map.Company.render(n,i.company||""),this.map.Manager.render(n,i.manager),n.leafNode("LinksUpToDate",void 0,"false"),n.leafNode("SharedDoc",void 0,"false"),n.leafNode("HyperlinksChanged",void 0,"false"),n.leafNode("AppVersion",void 0,"16.0300"),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"Properties":return!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!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"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform");class a extends o{render(t,e){t.openXml(p.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(n=>{if(n.type==="image"){const i=n.extension;l[i]||(l[i]=!0,t.leafNode("Default",{Extension:i,ContentType:"image/"+i}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(n=>{const i=`/xl/worksheets/sheet${n.id}.xml`;t.leafNode("Override",{PartName:i,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach(n=>{t.leafNode("Override",{PartName:"/xl/tables/"+n.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(n=>{t.leafNode("Override",{PartName:`/xl/drawings/${n.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach(n=>{let{commentName:i}=n;t.leafNode("Override",{PartName:`/xl/${i}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends o{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(n,i){n.openXml(p.StdDocAttributes),n.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(n,i.creator),this.map["dc:title"].render(n,i.title),this.map["dc:subject"].render(n,i.subject),this.map["dc:description"].render(n,i.description),this.map["dc:identifier"].render(n,i.identifier),this.map["dc:language"].render(n,i.language),this.map["cp:keywords"].render(n,i.keywords),this.map["cp:category"].render(n,i.category),this.map["cp:lastModifiedBy"].render(n,i.lastModifiedBy),this.map["cp:lastPrinted"].render(n,i.lastPrinted),this.map["cp:revision"].render(n,i.revision),this.map["cp:version"].render(n,i.version),this.map["cp:contentStatus"].render(n,i.contentStatus),this.map["cp:contentType"].render(n,i.contentType),this.map["dcterms:created"].render(n,i.created),this.map["dcterms:modified"].render(n,i.modified),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[n.name],this.parser)return this.parser.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.parser=void 0),!0;switch(n){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: "+n)}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.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"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{render(o,a){o.leafNode("Relationship",a)}parseOpen(o){switch(o.name){case"Relationship":return this.model=o.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./relationship-xform");class r extends o{constructor(){super(),this.map={Relationship:new a}}render(e,l){l=l||this._values,e.openXml(p.StdDocAttributes),e.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(n=>{this.map.Relationship.render(e,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,a){if(o&&o.rId){const r=a.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=a.mediaIndex[t];return a.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,_){const p=s("../base-xform"),o=s("./blip-xform");T.exports=class extends p{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(a,r){a.openNode(this.tag),this.map["a:blip"].render(a,r),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(){}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:blip"}render(o,a){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,T,_){const p=s("../base-xform"),o=s("./hlink-click-xform"),a=s("./ext-lst-xform");T.exports=class extends p{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,T,_){const p=s("../base-xform"),o=s("../simple/integer-xform");T.exports=class extends p{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(a,r){a.openNode(this.tag),this.map["xdr:col"].render(a,r.nativeCol),this.map["xdr:colOff"].render(a,r.nativeColOff),this.map["xdr:row"].render(a,r.nativeRow),this.map["xdr:rowOff"].render(a,r.nativeRowOff),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();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.parser=void 0),!0;switch(a){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(s,T,_){const p=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(n){n.anchors.forEach((i,u)=>{i.anchorType=function(h){return(typeof h.range=="string"?p.decode(h.range):h.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(i),this.map[i.anchorType].prepare(i,{index:u})})}get tag(){return"xdr:wsDr"}render(n,i){n.openXml(o.StdDocAttributes),n.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(u=>{this.map[u.anchorType].render(n,u)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset(),this.model={anchors:[]};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.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(n){case this.tag:return!1;default:return!0}}reconcile(n,i){n.anchors.forEach(u=>{u.br?this.map["xdr:twoCellAnchor"].reconcile(u,i):this.map["xdr:oneCellAnchor"].reconcile(u,i)})}}e.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},T.exports=e},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,a){o.openNode(this.tag);const r=Math.floor(9525*a.width),t=Math.floor(9525*a.height);o.addAttribute("cx",r),o.addAttribute("cy",t),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={width:parseInt(o.attributes.cx||"0",10)/9525,height:parseInt(o.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"a:hlinkClick"}render(o,a){a.hyperlinks&&a.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(o){switch(o.name){case this.tag:return this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,_){const p=s("../base-xform"),o=s("./c-nv-pr-xform"),a=s("./c-nv-pic-pr-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s,T,_){const p=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,l){this.map["xdr:pic"].prepare(e.picture,l)}render(e,l){e.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,l.range.tl),this.map["xdr:ext"].render(e,l.range.ext),this.map["xdr:pic"].render(e,l.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.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(e,l){e.medium=this.reconcilePicture(e.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(s,T,_){const p=s("../base-xform"),o=s("../static-xform"),a=s("./blip-fill-xform"),r=s("./nv-pic-pr-xform"),t=s("./sp-pr");T.exports=class extends p{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new a,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(e,l){e.index=l.index+1}render(e,l){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,l),this.map["xdr:blipFill"].render(e,l),this.map["xdr:spPr"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){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(s,T,_){T.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(s,T,_){const p=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),r=s("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:to"].render(t,e.range.br),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(s,T,_){const p=s("./base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,a){const{childXform:r}=this;o&&o.forEach((t,e)=>{a.index=e,r.prepare(t,a)})}render(o,a){if(this.always||a&&a.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,a&&a.length||0);const{childXform:r}=this;(a||[]).forEach((t,e)=>{r.render(o,t,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(o)&&(this.parser=this.childXform,!0)}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser){if(!this.parser.parseClose(o)&&(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(o,a){if(o){const{childXform:r}=this;o.forEach(t=>{r.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(s,T,_){const p=s("../../../utils/col-cache"),o=s("../base-xform");T.exports=class extends o{get tag(){return"autoFilter"}render(a,r){if(r)if(typeof r=="string")a.leafNode("autoFilter",{ref:r});else{const t=function(n){return typeof n=="string"?n:p.getAddress(n.row,n.column).address},e=t(r.from),l=t(r.to);e&&l&&a.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform"),a=s("../../../doc/range"),r=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}T.exports=class extends o{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,n){const i=n.styles.addStyleModel(l.style||{},function(u){switch(u.type){case r.ValueType.Formula:return e(u.result);default:return u.type}}(l));switch(i&&(l.styleId=i),l.comment&&n.comments.push({...l.comment,ref:l.address}),l.type){case r.ValueType.String:case r.ValueType.RichText:n.sharedStrings&&(l.ssId=n.sharedStrings.add(l.value));break;case r.ValueType.Date:n.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:n.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=n.sharedStrings.add(l.text)),n.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:n.merges.add(l);break;case r.ValueType.Formula:if(n.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=n.siFormulae++),l.formula)n.formulae[l.address]=l;else if(l.sharedFormula){const u=n.formulae[l.sharedFormula];if(!u)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);u.si===void 0?(u.shareType="shared",u.si=n.siFormulae++,u.range=new a(u.address,l.address)):u.range&&u.range.expandToAddress(l.address),l.si=u.si}}}renderFormula(l,n){let i=null;switch(n.shareType){case"shared":i={t:"shared",ref:n.ref||n.range.range,si:n.si};break;case"array":i={t:"array",ref:n.ref};break;default:n.si!==void 0&&(i={t:"shared",si:n.si})}switch(e(n.result)){case r.ValueType.Null:l.leafNode("f",i,n.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Number:l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result.error);break;case r.ValueType.Date:l.leafNode("f",i,n.formula),l.leafNode("v",null,p.dateToExcel(n.result,n.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,n){if(n.type!==r.ValueType.Null||n.styleId){switch(l.openNode("c"),l.addAttribute("r",n.address),n.styleId&&l.addAttribute("s",n.styleId),n.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,n.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,n.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,n.value.error);break;case r.ValueType.String:case r.ValueType.RichText:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):n.value&&n.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),n.value.richText.forEach(i=>{this.richTextXForm.render(l,i)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,n.value));break;case r.ValueType.Date:l.leafNode("v",null,p.dateToExcel(n.value,n.date1904));break;case r.ValueType.Hyperlink:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,n.text));break;case r.ValueType.Formula:this.renderFormula(l,n);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.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(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;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+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:n}=this;if(n.formula||n.shareType)n.type=r.ValueType.Formula,n.value&&(this.t==="str"?n.result=p.xmlDecode(n.value):this.t==="b"?n.result=parseInt(n.value,10)!==0:this.t==="e"?n.result={error:n.value}:n.result=parseFloat(n.value),n.value=void 0);else if(n.value!==void 0)switch(this.t){case"s":n.type=r.ValueType.String,n.value=parseInt(n.value,10);break;case"str":n.type=r.ValueType.String,n.value=p.xmlDecode(n.value);break;case"inlineStr":n.type=r.ValueType.String;break;case"b":n.type=r.ValueType.Boolean,n.value=parseInt(n.value,10)!==0;break;case"e":n.type=r.ValueType.Error,n.value={error:n.value};break;default:n.type=r.ValueType.Number,n.value=parseFloat(n.value)}else n.styleId?n.type=r.ValueType.Null:n.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!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(l),!0)}}reconcile(l,n){const i=l.styleId&&n.styles&&n.styles.getStyleModel(l.styleId);switch(i&&(l.style=i),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&n.sharedStrings&&(l.value=n.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:i&&p.isDateFmt(i.numFmt)&&(l.type=r.ValueType.Date,l.value=p.excelToDate(l.value,n.date1904));break;case r.ValueType.Formula:l.result!==void 0&&i&&p.isDateFmt(i.numFmt)&&(l.result=p.excelToDate(l.result,n.date1904)),l.shareType==="shared"&&(l.ref?n.formulae[l.si]=l.address:(l.sharedFormula=n.formulae[l.si],delete l.shareType),delete l.si)}const u=n.hyperlinkMap[l.address];u&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=u);const h=n.commentsMap&&n.commentsMap[l.address];h&&(l.comment=h)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"x14:cfIcon"}render(o,a){o.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(o){let{attributes:a}=o;this.model={iconSet:a.iconSet,iconId:p.toIntValue(a.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,_){const{v4:p}=s("uuid"),o=s("../../base-xform"),a=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(i){return i.type==="dataBar"?r.isExt(i):!(i.type!=="iconSet"||!i.custom&&!e[i.iconSet])}prepare(i){l.isExt(i)&&(i.x14Id=`{${p()}}`.toUpperCase())}render(i,u){if(l.isExt(u))switch(u.type){case"dataBar":this.renderDataBar(i,u);break;case"iconSet":this.renderIconSet(i,u)}}renderDataBar(i,u){i.openNode(this.tag,{type:"dataBar",id:u.x14Id}),this.databarXform.render(i,u),i.closeNode()}renderIconSet(i,u){i.openNode(this.tag,{type:"iconSet",priority:u.priority,id:u.x14Id||`{${p()}}`}),this.iconSetXform.render(i,u),i.closeNode()}createNewModel(i){let{attributes:u}=i;return{type:u.type,x14Id:u.id,priority:o.toIntValue(u.priority)}}onParserClose(i,u){Object.assign(this.model,u.model)}}T.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(s,T,_){const p=s("../../composite-xform"),o=s("./f-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(a,r){a.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(a,r.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,r){switch(a){case"xm:f":this.model.value=r.model?parseFloat(r.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,T,_){const p=s("../../composite-xform"),o=s("./sqref-ext-xform"),a=s("./cf-rule-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(a.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach(e=>this.cfRule.render(r,e)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(s,T,_){const p=s("../../composite-xform"),o=s("./cf-rule-ext-xform"),a=s("./conditional-formatting-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(o.isExt))),r.hasExtContent}prepare(r,t){r.forEach(e=>{this.cfXform.prepare(e,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(e=>this.cfXform.render(r,e)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../style/color-xform"),r=s("./cfvo-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:p.toIntAttribute(e.minLength,0,!0),maxLength:p.toIntAttribute(e.maxLength,100,!0),border:p.toBoolAttribute(e.border,!1),gradient:p.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toAttribute(e.axisPosition,"auto"),direction:p.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:p.toIntValue(e.minLength,0),maxLength:p.toIntValue(e.maxLength,100),border:p.toBoolValue(e.border,!1),gradient:p.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:p.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:p.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:p.toStringValue(e.axisPosition,"auto"),direction:p.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"xm:f"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new r}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:p.toStringAttribute(e.iconSet),reverse:p.toBoolAttribute(e.reverse,!1),showValue:p.toBoolAttribute(e.showValue,!0),custom:p.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),e.icons&&e.icons.forEach((l,n)=>{l.iconId=n,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:p.toStringValue(e.iconSet,"3TrafficLights"),reverse:p.toBoolValue(e.reverse,!1),showValue:p.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"xm:sqref"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../../../doc/range"),r=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),n=s("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},u=c=>{const{type:d,operator:f}=c;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:f}}};class h extends o{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new n}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!i[d.iconSet]}render(d,f){switch(f.type){case"expression":this.renderExpression(d,f);break;case"cellIs":this.renderCellIs(d,f);break;case"top10":this.renderTop10(d,f);break;case"aboveAverage":this.renderAboveAverage(d,f);break;case"dataBar":this.renderDataBar(d,f);break;case"colorScale":this.renderColorScale(d,f);break;case"iconSet":this.renderIconSet(d,f);break;case"containsText":this.renderText(d,f);break;case"timePeriod":this.renderTimePeriod(d,f)}}renderExpression(d,f){d.openNode(this.tag,{type:"expression",dxfId:f.dxfId,priority:f.priority}),this.formulaXform.render(d,f.formulae[0]),d.closeNode()}renderCellIs(d,f){d.openNode(this.tag,{type:"cellIs",dxfId:f.dxfId,priority:f.priority,operator:f.operator}),f.formulae.forEach(v=>{this.formulaXform.render(d,v)}),d.closeNode()}renderTop10(d,f){d.leafNode(this.tag,{type:"top10",dxfId:f.dxfId,priority:f.priority,percent:p.toBoolAttribute(f.percent,!1),bottom:p.toBoolAttribute(f.bottom,!1),rank:p.toIntValue(f.rank,10,!0)})}renderAboveAverage(d,f){d.leafNode(this.tag,{type:"aboveAverage",dxfId:f.dxfId,priority:f.priority,aboveAverage:p.toBoolAttribute(f.aboveAverage,!0)})}renderDataBar(d,f){d.openNode(this.tag,{type:"dataBar",priority:f.priority}),this.databarXform.render(d,f),this.extLstRefXform.render(d,f),d.closeNode()}renderColorScale(d,f){d.openNode(this.tag,{type:"colorScale",priority:f.priority}),this.colorScaleXform.render(d,f),d.closeNode()}renderIconSet(d,f){h.isPrimitive(f)&&(d.openNode(this.tag,{type:"iconSet",priority:f.priority}),this.iconSetXform.render(d,f),d.closeNode())}renderText(d,f){d.openNode(this.tag,{type:f.operator,dxfId:f.dxfId,priority:f.priority,operator:p.toStringAttribute(f.operator,"containsText")});const v=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:I}=A;switch(x.operator){case"containsText":return`NOT(ISERROR(SEARCH("${x.text}",${I})))`;case"containsBlanks":return`LEN(TRIM(${I}))=0`;case"notContainsBlanks":return`LEN(TRIM(${I}))>0`;case"containsErrors":return`ISERROR(${I})`;case"notContainsErrors":return`NOT(ISERROR(${I}))`;default:return}})(f);v&&this.formulaXform.render(d,v),d.closeNode()}renderTimePeriod(d,f){d.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const v=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:I}=A;switch(x.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${I},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${I},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${I},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${I},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${I},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${I},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${I},1)=TODAY()-1`;case"today":return`FLOOR(${I},1)=TODAY()`;case"tomorrow":return`FLOOR(${I},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${I},1)<=6,FLOOR(${I},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${I})=MONTH(EDATE(TODAY(),0-1)),YEAR(${I})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${I})=MONTH(TODAY()),YEAR(${I})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${I})=MONTH(EDATE(TODAY(),0+1)),YEAR(${I})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);v&&this.formulaXform.render(d,v),d.closeNode()}createNewModel(d){let{attributes:f}=d;return{...u(f),dxfId:p.toIntValue(f.dxfId),priority:p.toIntValue(f.priority),timePeriod:f.timePeriod,percent:p.toBoolValue(f.percent),bottom:p.toBoolValue(f.bottom),rank:p.toIntValue(f.rank),aboveAverage:p.toBoolValue(f.aboveAverage)}}onParserClose(d,f){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,f.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(f.model)}}}T.exports=h},{"../../../../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(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"cfvo"}render(o,a){o.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(o){this.model={type:o.attributes.type,value:p.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,_){const p=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),t.color.forEach(e=>{this.colorXform.render(r,e)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(s,T,_){const p=s("../../composite-xform"),o=s("./cf-rule-xform");T.exports=class extends p{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(a,r){r.rules.some(o.isPrimitive)&&(a.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:r}=a;return{ref:r.sqref,rules:[]}}onParserClose(a,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,_){const p=s("../../base-xform"),o=s("./conditional-formatting-xform");T.exports=class extends p{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,r){let t=a.reduce((e,l)=>Math.max(e,...l.rules.map(n=>n.priority||0)),1);a.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(a,r){r.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"conditionalFormatting":return this.parser=this.cfXform,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.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,r){a.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=r.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(s,T,_){const p=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform");class a extends p{get tag(){return"x14:id"}render(e,l){e.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class r extends o{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(e,l){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,l.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,l){this.model.x14Id=l.model}}T.exports=class extends o{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(s,T,_){const p=s("../../base-xform");T.exports=class extends p{get tag(){return"formula"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,_){const p=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-xform");T.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(r,t){r.openNode(this.tag,{iconSet:p.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:p.toBoolAttribute(t.reverse,!1),showValue:p.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:p.toStringValue(t.iconSet,"3TrafficLights"),reverse:p.toBoolValue(t.reverse),showValue:p.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,T,_){const p=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{get tag(){return"col"}prepare(a,r){const t=r.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,r){a.openNode("col"),a.addAttribute("min",r.min),a.addAttribute("max",r.max),r.width&&a.addAttribute("width",r.width),r.styleId&&a.addAttribute("style",r.styleId),r.hidden&&a.addAttribute("hidden","1"),r.bestFit&&a.addAttribute("bestFit","1"),r.outlineLevel&&a.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){const r=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(r.styleId=parseInt(a.attributes.style,10)),p.parseBoolean(a.attributes.hidden)&&(r.hidden=!0),p.parseBoolean(a.attributes.bestFit)&&(r.bestFit=!0),a.attributes.outlineLevel&&(r.outlineLevel=parseInt(a.attributes.outlineLevel,10)),p.parseBoolean(a.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,r){a.styleId&&(a.style=r.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/utils"),a=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(n,i,u,h){const c=i[u];c!==void 0?n[u]=c:h!==void 0&&(n[u]=h)}function l(n,i,u,h){const c=i[u];c!==void 0?n[u]=o.parseBoolean(c):h!==void 0&&(n[u]=h)}T.exports=class extends r{get tag(){return"dataValidations"}render(n,i){const u=function(h){const c=p.map(h,(v,x)=>({address:x,dataValidation:v,marked:!1})).sort((v,x)=>p.strcmp(v.address,x.address)),d=p.keyBy(c,"address"),f=(v,x,A)=>{for(let I=0;I{if(!v.marked){const x=a.decodeEx(v.address);if(x.dimensions)return d[x.dimensions].marked=!0,{...v.dataValidation,sqref:v.address};let A=1,I=a.encodeAddress(x.row+A,x.col);for(;h[I]&&p.isEqual(v.dataValidation,h[I]);)A++,I=a.encodeAddress(x.row+A,x.col);let F=1;for(;f(x,A,x.col+F);)F++;for(let j=0;j1||F>1){const j=x.row+(A-1),P=x.col+(F-1);return{...v.dataValidation,sqref:`${v.address}:${a.encodeAddress(j,P)}`}}return{...v.dataValidation,sqref:v.address}}return null}).filter(Boolean)}(i);u.length&&(n.openNode("dataValidations",{count:u.length}),u.forEach(h=>{n.openNode("dataValidation"),h.type!=="any"&&(n.addAttribute("type",h.type),h.operator&&h.type!=="list"&&h.operator!=="between"&&n.addAttribute("operator",h.operator),h.allowBlank&&n.addAttribute("allowBlank","1")),h.showInputMessage&&n.addAttribute("showInputMessage","1"),h.promptTitle&&n.addAttribute("promptTitle",h.promptTitle),h.prompt&&n.addAttribute("prompt",h.prompt),h.showErrorMessage&&n.addAttribute("showErrorMessage","1"),h.errorStyle&&n.addAttribute("errorStyle",h.errorStyle),h.errorTitle&&n.addAttribute("errorTitle",h.errorTitle),h.error&&n.addAttribute("error",h.error),n.addAttribute("sqref",h.sqref),(h.formulae||[]).forEach((c,d)=>{n.openNode("formula"+(d+1)),h.type==="date"?n.writeText(o.dateToExcel(new Date(c))):n.writeText(c),n.closeNode()}),n.closeNode()}),n.closeNode())}parseOpen(n){switch(n.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=n.attributes.sqref;const i={type:n.attributes.type||"any",formulae:[]};switch(n.attributes.type&&l(i,n.attributes,"allowBlank"),l(i,n.attributes,"showInputMessage"),l(i,n.attributes,"showErrorMessage"),i.type){case"any":case"list":case"custom":break;default:e(i,n.attributes,"operator","between")}return e(i,n.attributes,"promptTitle"),e(i,n.attributes,"prompt"),e(i,n.attributes,"errorStyle"),e(i,n.attributes,"errorTitle"),e(i,n.attributes,"error"),this._dataValidation=i,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(n){this._formula&&this._formula.push(n)}parseClose(n){switch(n){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(i=>{i.includes(":")?new t(i).forEachAddress(u=>{this.model[u]=this._dataValidation}):this.model[i]=this._dataValidation}),!0;case"formula1":case"formula2":{let i=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":i=parseInt(i,10);break;case"decimal":i=parseFloat(i);break;case"date":i=o.excelToDate(parseFloat(i))}return this._dataValidation.formulae.push(i),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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"dimension"}render(o,a){a&&o.leafNode("dimension",{ref:a})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"drawing"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,_){const p=s("../composite-xform"),o=s("./cf-ext/conditional-formattings-ext-xform");class a extends p{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new o}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,e){this.conditionalFormattings.prepare(t.conditionalFormattings,e)}render(t,e){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,e.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model[t]=e.model}}T.exports=class extends p{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"headerFooter"}render(o,a){if(a){o.addRollback();let r=!1;o.openNode("headerFooter"),a.differentFirst&&(o.addAttribute("differentFirst","1"),r=!0),a.differentOddEven&&(o.addAttribute("differentOddEven","1"),r=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(o.leafNode("oddHeader",null,a.oddHeader),r=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(o.leafNode("oddFooter",null,a.oddFooter),r=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(o.leafNode("evenHeader",null,a.evenHeader),r=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(o.leafNode("evenFooter",null,a.evenFooter),r=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(o.leafNode("firstHeader",null,a.firstHeader),r=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(o.leafNode("firstFooter",null,a.firstFooter),r=!0),r?(o.closeNode(),o.commit()):o.rollback()}}parseOpen(o){switch(o.name){case"headerFooter":return this.model={},o.attributes.differentFirst&&(this.model.differentFirst=parseInt(o.attributes.differentFirst,0)===1),o.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(o.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(o){switch(this.currentNode){case"oddHeader":this.model.oddHeader=o;break;case"oddFooter":this.model.oddFooter=o;break;case"evenHeader":this.model.evenHeader=o;break;case"evenFooter":this.model.evenFooter=o;break;case"firstHeader":this.model.firstHeader=o;break;case"firstFooter":this.model.firstFooter=o}}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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"hyperlink"}render(o,a){this.isInternalLink(a)?o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"mergeCell"}render(o,a){o.leafNode("mergeCell",{ref:a})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../doc/range"),a=s("../../../utils/col-cache"),r=s("../../../doc/enums");T.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new o(e)}}get mergeCells(){return p.map(this.merges,t=>t.range)}reconcile(t,e){p.each(t,l=>{const n=a.decode(l);for(let i=n.top;i<=n.bottom;i++){const u=e[i-1];for(let h=n.left;h<=n.right;h++){const c=u.cells[h-1];c?c.type===r.ValueType.Merge&&(c.master=n.tl):u.cells[h]={type:r.ValueType.Null,address:a.encodeAddress(i,h)}}}})}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(s,T,_){const p=s("../base-xform"),o=a=>a!==void 0;T.exports=class extends p{get tag(){return"outlinePr"}render(a,r){return!(!r||!o(r.summaryBelow)&&!o(r.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:o(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:o(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:o(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:o(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"brk"}render(o,a){o.leafNode("brk",a)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"pageMargins"}render(a,r){if(r){const t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};p.some(t,e=>e!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){switch(a.name){case this.tag:return this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"pageSetUpPr"}render(o,a){return!(!a||!a.fitToPage)&&(o.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(l){return l?"1":void 0}function r(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}T.exports=class extends o{get tag(){return"pageSetup"}render(l,n){if(n){const i={paperSize:n.paperSize,orientation:n.orientation,horizontalDpi:n.horizontalDpi,verticalDpi:n.verticalDpi,pageOrder:r(n.pageOrder),blackAndWhite:a(n.blackAndWhite),draft:a(n.draft),cellComments:t(n.cellComments),errors:e(n.errors),scale:n.scale,fitToWidth:n.fitToWidth,fitToHeight:n.fitToHeight,firstPageNumber:n.firstPageNumber,useFirstPageNumber:a(n.firstPageNumber),usePrinterDefaults:a(n.usePrinterDefaults),copies:n.copies};p.some(i,u=>u!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(n=l.attributes.paperSize,n!==void 0?parseInt(n,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var n}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"picture"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(r){return r?"1":void 0}T.exports=class extends o{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};p.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){switch(r.name){case this.tag:return this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,T,_){const p=s("./page-breaks-xform"),o=s("../list-xform");T.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new p})}render(a,r){if(r&&r.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,r.length),a.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(a,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/utils"),a=s("./cell-xform");T.exports=class extends p{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(r,t){const e=t.styles.addStyleModel(r.style);e&&(r.styleId=e);const l=this.map.c;r.cells.forEach(n=>{l.prepare(n,t)})}render(r,t,e){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(n=>{l.render(r,n,e)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;const t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],e=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(e.styleId=parseInt(r.attributes.s,10)),o.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),o.parseBoolean(r.attributes.bestFit)&&(e.bestFit=!0),r.attributes.ht&&(e.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(e.outlineLevel=parseInt(r.attributes.outlineLevel,10)),o.parseBoolean(r.attributes.collapsed)&&(e.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){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(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);const e=this.map.c;r.cells.forEach(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"sheetFormatPr"}render(a,r){if(r){const t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),p.some(t,e=>e!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,_){const p=s("../base-xform"),o=s("../style/color-xform"),a=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");T.exports=class extends p{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new a,outlinePr:new r}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(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(s,T,_){const p=s("../../../utils/under-dash"),o=s("../base-xform");function a(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}T.exports=class extends o{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:a(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:a(e.formatCells,"0"),formatColumns:a(e.formatColumns,"0"),formatRows:a(e.formatRows,"0"),insertColumns:a(e.insertColumns,"0"),insertRows:a(e.insertRows,"0"),insertHyperlinks:a(e.insertHyperlinks,"0"),deleteColumns:a(e.deleteColumns,"0"),deleteRows:a(e.deleteRows,"0"),sort:a(e.sort,"0"),autoFilter:a(e.autoFilter,"0"),pivotTables:a(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=a(e.objects===!1,"1"),l.scenarios=a(e.scenarios===!1,"1")),p.some(l,n=>n!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,T,_){const p=s("../../../utils/col-cache"),o=s("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends o{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(h,c,d){d&&r.addAttribute(h,c)};let l,n,i,u;switch(e("rightToLeft","1",t.rightToLeft===!0),e("tabSelected","1",t.tabSelected),e("showRuler","0",t.showRuler===!1),e("showRowColHeaders","0",t.showRowColHeaders===!1),e("showGridLines","0",t.showGridLines===!1),e("zoomScale",t.zoomScale,t.zoomScale),e("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),e("view",t.style,t.style),t.state){case"frozen":n=t.xSplit||0,i=t.ySplit||0,l=t.topLeftCell||p.getAddress(i+1,n+1).address,u=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:u,state:"frozen"}),r.leafNode("selection",{pane:u,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{const t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,e;switch(r){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[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"&&(t.activePane=this.pane.activePane),e=this.selections[this.pane.activePane],e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=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},e=this.selections.topLeft,e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tablePart"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),r=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),n=s("./row-xform"),i=s("./col-xform"),u=s("./dimension-xform"),h=s("./hyperlink-xform"),c=s("./merge-cell-xform"),d=s("./data-validations-xform"),f=s("./sheet-properties-xform"),v=s("./sheet-format-properties-xform"),x=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),I=s("./page-margins-xform"),F=s("./page-setup-xform"),j=s("./print-options-xform"),P=s("./auto-filter-xform"),B=s("./picture-xform"),U=s("./drawing-xform"),D=s("./table-part-xform"),k=s("./row-breaks-xform"),C=s("./header-footer-xform"),w=s("./cf/conditional-formattings-xform"),m=s("./ext-lst-xform"),b=(y,S)=>{if(!S||!S.length)return y;if(!y||!y.length)return S;const R={},N={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach(H=>{const{x14Id:q}=H;q&&(N[q]=H)})}),S.forEach(z=>{z.rules.forEach(H=>{const q=N[H.x14Id];q?((O,$)=>{Object.keys($).forEach(E=>{const M=O[E],L=$[E];M===void 0&&L!==void 0&&(O[E]=L)})})(q,H):R[z.ref]?R[z.ref].rules.push(H):y.push({ref:z.ref,rules:[H]})})}),y};class g extends e{constructor(S){super();const{maxRows:R,maxCols:N,ignoreNodes:z}=S||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new u,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new x}),sheetFormatPr:new v,cols:new l({tag:"cols",count:!1,childXform:new i}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new n({maxItems:N}),maxItems:R}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new c}),rowBreaks:new k,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new h}),pageMargins:new I,dataValidations:new d,pageSetup:new F,headerFooter:new C,printOptions:new j,picture:new B,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new D}),conditionalFormatting:new w,extLst:new m}}prepare(S,R){R.merges=new t,S.hyperlinks=R.hyperlinks=[],S.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(S.cols,R),this.map.sheetData.prepare(S.rows,R),this.map.conditionalFormatting.prepare(S.conditionalFormattings,R),S.mergeCells=R.merges.mergeCells;const N=S.rels=[];function z(O){return"rId"+(O.length+1)}if(S.hyperlinks.forEach(O=>{const $=z(N);O.rId=$,N.push({Id:$,Type:r.Hyperlink,Target:O.target,TargetMode:"External"})}),S.comments.length>0){const O={Id:z(N),Type:r.Comments,Target:`../comments${S.id}.xml`};N.push(O);const $={Id:z(N),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${S.id}.vml`};N.push($),S.comments.forEach(E=>{E.refAddress=o.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+S.id,vmlDrawing:"vmlDrawing"+S.id})}const H=[];let q;S.media.forEach(O=>{if(O.type==="background"){const $=z(N);q=R.media[O.imageId],N.push({Id:$,Type:r.Image,Target:`../media/${q.name}.${q.extension}`}),S.background={rId:$},S.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:$}=S;q=R.media[O.imageId],$||($=S.drawing={rId:z(N),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push($),N.push({Id:$.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${$.name}.xml`}));let E=this.preImageId===O.imageId?H[O.imageId]:H[$.rels.length];E||(E=z($.rels),H[$.rels.length]=E,$.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${q.name}.${q.extension}`}));const M={picture:{rId:E},range:O.range};if(O.hyperlinks&&O.hyperlinks.hyperlink){const L=z($.rels);H[$.rels.length]=L,M.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:L},$.rels.push({Id:L,Type:r.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,$.anchors.push(M)}}),S.tables.forEach(O=>{const $=z(N);O.rId=$,N.push({Id:$,Type:r.Table,Target:"../tables/"+O.target}),O.columns.forEach(E=>{const{style:M}=E;M&&(E.dxfId=R.styles.addDxfStyle(M))})}),this.map.extLst.prepare(S,R)}render(S,R){S.openXml(a.StdDocAttributes),S.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const N=R.properties?{defaultRowHeight:R.properties.defaultRowHeight,dyDescent:R.properties.dyDescent,outlineLevelCol:R.properties.outlineLevelCol,outlineLevelRow:R.properties.outlineLevelRow}:void 0;R.properties&&R.properties.defaultColWidth&&(N.defaultColWidth=R.properties.defaultColWidth);const z={outlineProperties:R.properties&&R.properties.outlineProperties,tabColor:R.properties&&R.properties.tabColor,pageSetup:R.pageSetup&&R.pageSetup.fitToPage?{fitToPage:R.pageSetup.fitToPage}:void 0},H=R.pageSetup&&R.pageSetup.margins,q={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},O=R.sheetProtection;this.map.sheetPr.render(S,z),this.map.dimension.render(S,R.dimensions),this.map.sheetViews.render(S,R.views),this.map.sheetFormatPr.render(S,N),this.map.cols.render(S,R.cols),this.map.sheetData.render(S,R.rows),this.map.sheetProtection.render(S,O),this.map.autoFilter.render(S,R.autoFilter),this.map.mergeCells.render(S,R.mergeCells),this.map.conditionalFormatting.render(S,R.conditionalFormattings),this.map.dataValidations.render(S,R.dataValidations),this.map.hyperlinks.render(S,R.hyperlinks),this.map.printOptions.render(S,q),this.map.pageMargins.render(S,H),this.map.pageSetup.render(S,R.pageSetup),this.map.headerFooter.render(S,R.headerFooter),this.map.rowBreaks.render(S,R.rowBreaks),this.map.drawing.render(S,R.drawing),this.map.picture.render(S,R.background),this.map.tableParts.render(S,R.tables),this.map.extLst.render(S,R),R.rels&&R.rels.forEach($=>{$.Type===r.VmlDrawing&&S.leafNode("legacyDrawing",{"r:id":$.Id})}),S.closeNode()}parseOpen(S){return this.parser?(this.parser.parseOpen(S),!0):S.name==="worksheet"?(p.each(this.map,R=>{R.reset()}),!0):(this.map[S.name]&&!this.ignoreNodes.includes(S.name)&&(this.parser=this.map[S.name],this.parser.parseOpen(S)),!0)}parseText(S){this.parser&&this.parser.parseText(S)}parseClose(S){if(this.parser)return this.parser.parseClose(S)||(this.parser=void 0),!0;switch(S){case"worksheet":{const R=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(R.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(R.outlineProperties=this.map.sheetPr.model.outlineProperties);const N={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},z=Object.assign(N,this.map.pageSetup.model,this.map.printOptions.model),H=b(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:R,views:this.map.sheetViews.model,pageSetup:z,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:H},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(S,R){const N=(S.relationships||[]).reduce((H,q)=>{if(H[q.Id]=q,q.Type===r.Comments&&(S.comments=R.comments[q.Target].comments),q.Type===r.VmlDrawing&&S.comments&&S.comments.length){const O=R.vmlDrawings[q.Target].comments;S.comments.forEach(($,E)=>{$.note=Object.assign({},$.note,O[E])})}return H},{});if(R.commentsMap=(S.comments||[]).reduce((H,q)=>(q.ref&&(H[q.ref]=q),H),{}),R.hyperlinkMap=(S.hyperlinks||[]).reduce((H,q)=>(q.rId&&(H[q.address]=N[q.rId].Target),H),{}),R.formulae={},S.rows=S.rows&&S.rows.filter(Boolean)||[],S.rows.forEach(H=>{H.cells=H.cells&&H.cells.filter(Boolean)||[]}),this.map.cols.reconcile(S.cols,R),this.map.sheetData.reconcile(S.rows,R),this.map.conditionalFormatting.reconcile(S.conditionalFormattings,R),S.media=[],S.drawing){const H=N[S.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(H){const q=H[1];R.drawings[q].anchors.forEach(O=>{if(O.medium){const $={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};S.media.push($)}})}}const z=S.background&&N[S.background.rId];if(z){const H=z.Target.split("/media/")[1],q=R.mediaIndex&&R.mediaIndex[H];q!==void 0&&S.media.push({type:"background",imageId:q})}S.tables=(S.tables||[]).map(H=>{const q=N[H.rId];return R.tables[q.Target]}),delete S.relationships,delete S.hyperlinks,delete S.comments}}g.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"},T.exports=g},{"../../../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(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,a){a&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch{return""}},this._parse=o.parse||function(a){return new Date(a)}}render(o,a){a&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(a)):o.writeText(this._format(a)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,a){(a||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,a){a!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,_){const p=s("./base-xform"),o=s("../../utils/xml-stream");T.exports=class extends p{constructor(a){super(),this._model=a}render(a){if(!this._xml){const r=new o;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(n=>{t(e,n)}),l.t&&e.writeText(l.t),e.closeNode()})(r,this._model),this._xml=r.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){switch(a){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,T,_){const p=s("./text-xform"),o=s("./rich-text-xform"),a=s("../base-xform");T.exports=class extends a{constructor(){super(),this.map={r:new o,t:new p}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:e}=this.map;t.richText.forEach(l=>{e.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){const{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,T,_){const p=s("./text-xform"),o=s("../style/font-xform"),a=s("../base-xform");class r extends a{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new p)}get fontXform(){return this._fontXform||(this._fontXform=new o(r.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){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(e),!0}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,T,_){const p=s("./text-xform"),o=s("./rich-text-xform"),a=s("./phonetic-text-xform"),r=s("../base-xform");T.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new o,t:new p,rPh:new a}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):e!=null&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./shared-string-xform");T.exports=class extends o{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){const t=this.sharedStringXform.toXml(r);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,e}render(r,t){t=t||this._values,r.openXml(p.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(l=>{e.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(r){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"t"}render(o,a){o.openNode("t"),/^\s|\n|\s$/.test(a)&&o.addAttribute("xml:space","preserve"),o.writeText(a),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(o){switch(o.name){case"t":return this._text=[],!0;default:return!1}}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,_){const p=s("../../../doc/enums"),o=s("../../../utils/utils"),a=s("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),vertical(e){return e==="middle"?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case"vertical":return e;default:return(e=o.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=o.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return p.ReadingOrder.LeftToRight;case"rtl":return p.ReadingOrder.RightToLeft;default:return}}},t={toXml(e){if(e=r.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=o.validInt(e);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};T.exports=class extends a{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let n=!1;function i(u,h){h&&(e.addAttribute(u,h),n=!0)}i("horizontal",r.horizontal(l.horizontal)),i("vertical",r.vertical(l.vertical)),i("wrapText",!!r.wrapText(l.wrapText)&&"1"),i("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),i("indent",r.indent(l.indent)),i("textRotation",t.toXml(l.textRotation)),i("readingOrder",r.readingOrder(l.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const l={};let n=!1;function i(u,h,c){u&&(l[h]=c,n=!0)}i(e.attributes.horizontal,"horizontal",e.attributes.horizontal),i(e.attributes.vertical,"vertical",e.attributes.vertical==="center"?"middle":e.attributes.vertical),i(e.attributes.wrapText,"wrapText",o.parseBoolean(e.attributes.wrapText)),i(e.attributes.shrinkToFit,"shrinkToFit",o.parseBoolean(e.attributes.shrinkToFit)),i(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),i(e.attributes.textRotation,"textRotation",t.toModel(e.attributes.textRotation)),i(e.attributes.readingOrder,"readingOrder",e.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=n?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,T,_){const p=s("../base-xform"),o=s("../../../utils/utils"),a=s("./color-xform");class r extends p{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,l,n){const i=l&&l.color||n||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),i&&this.map.color.render(e,i)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return r.validStyleValues[e]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,e)=>(t[e]=!0,t),{}),T.exports=class extends p{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,e){const{color:l}=e;function n(i,u){i&&!i.color&&e.color&&(i={...i,color:e.color}),u.render(t,i,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),n(e.left,this.map.left),n(e.right,this.map.right),n(e.top,this.map.top),n(e.bottom,this.map.bottom),n(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=o.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=o.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(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;if(t==="border"){const e=this.model={},l=function(n,i,u){i&&(u&&Object.assign(i,u),e[n]=i)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,a){return!!a&&(o.openNode(this.name),a.argb?o.addAttribute("rgb",a.argb):a.theme!==void 0?(o.addAttribute("theme",a.theme),a.tint!==void 0&&o.addAttribute("tint",a.tint)):a.indexed!==void 0?o.addAttribute("indexed",a.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(s,T,_){const p=s("../base-xform"),o=s("./alignment-xform"),a=s("./border-xform"),r=s("./fill-xform"),t=s("./font-xform"),e=s("./numfmt-xform"),l=s("./protection-xform");T.exports=class extends p{constructor(){super(),this.map={alignment:new o,border:new a,fill:new r,font:new t,numFmt:new e,protection:new l}}get tag(){return"dxf"}render(n,i){if(n.openNode(this.tag),i.font&&this.map.font.render(n,i.font),i.numFmt&&i.numFmtId){const u={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(n,u)}i.fill&&this.map.fill.render(n,i.fill),i.alignment&&this.map.alignment.render(n,i.alignment),i.border&&this.map.border.render(n,i.border),i.protection&&this.map.protection.render(n,i.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n),!0}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n!==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(s,T,_){const p=s("../base-xform"),o=s("./color-xform");class a extends p{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(n,i){n.openNode("stop"),n.addAttribute("position",i.position),this.map.color.render(n,i.color),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"stop":return this.model={position:parseFloat(n.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(n),!0;default:return!1}}parseText(){}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends p{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(n,i){n.openNode("patternFill"),n.addAttribute("patternType",i.pattern),i.fgColor&&this.map.fgColor.render(n,i.fgColor),i.bgColor&&this.map.bgColor.render(n,i.bgColor),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"patternFill":return this.model={type:"pattern",pattern:n.attributes.patternType},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.parser.model&&(this.model[n]=this.parser.model),this.parser=void 0),!0)}}class t extends p{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(n,i){switch(n.openNode("gradientFill"),i.gradient){case"angle":n.addAttribute("degree",i.degree);break;case"path":n.addAttribute("type","path"),i.center.left&&(n.addAttribute("left",i.center.left),i.center.right===void 0&&n.addAttribute("right",i.center.left)),i.center.right&&n.addAttribute("right",i.center.right),i.center.top&&(n.addAttribute("top",i.center.top),i.center.bottom===void 0&&n.addAttribute("bottom",i.center.top)),i.center.bottom&&n.addAttribute("bottom",i.center.bottom)}const u=this.map.stop;i.stops.forEach(h=>{u.render(n,h)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"gradientFill":{const i=this.model={stops:[]};return n.attributes.degree?(i.gradient="angle",i.degree=parseInt(n.attributes.degree,10)):n.attributes.type==="path"&&(i.gradient="path",i.center={left:n.attributes.left?parseFloat(n.attributes.left):0,top:n.attributes.top?parseFloat(n.attributes.top):0},n.attributes.right!==n.attributes.left&&(i.center.right=n.attributes.right?parseFloat(n.attributes.right):0),n.attributes.bottom!==n.attributes.top&&(i.center.bottom=n.attributes.bottom?parseFloat(n.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,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.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends p{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(n,i){switch(n.addRollback(),n.openNode("fill"),i.type){case"pattern":this.map.patternFill.render(n,i);break;case"gradient":this.map.gradientFill.render(n,i);break;default:return void n.rollback()}n.closeNode(),n.commit()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"fill":return this.model={},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(n){return e.validPatternValues[n]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,n)=>(l[n]=!0,l),{}),e.StopXform=a,e.PatternFillXform=r,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,T,_){const p=s("./color-xform"),o=s("../simple/boolean-xform"),a=s("../simple/integer-xform"),r=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class n extends l{constructor(u){super(),this.options=u||n.OPTIONS,this.map={b:{prop:"bold",xform:new o({tag:"b",attr:"val"})},i:{prop:"italic",xform:new o({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new p},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new o({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new o({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(u,h){const{map:c}=this;u.openNode(this.options.tagName),e.each(this.map,(d,f)=>{c[f].xform.render(u,h[d.prop])}),u.closeNode()}parseOpen(u){if(this.parser)return this.parser.parseOpen(u),!0;if(this.map[u.name])return this.parser=this.map[u.name].xform,this.parser.parseOpen(u);switch(u.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(u){this.parser&&this.parser.parseText(u)}parseClose(u){if(this.parser&&!this.parser.parseClose(u)){const h=this.map[u];return this.parser.model&&(this.model[h.prop]=this.parser.model),this.parser=void 0,!0}switch(u){case this.options.tagName:return!1;default:return!0}}}n.OPTIONS={tagName:"font",fontNameTag:"name"},T.exports=n},{"../../../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(s,T,_){const p=s("../../../utils/under-dash"),o=s("../../defaultnumformats"),a=s("../base-xform"),r=function(){const e={};return p.each(o,(l,n)=>{l.f&&(e[l.f]=parseInt(n,10))}),e}();class t extends a{constructor(l,n){super(),this.id=l,this.formatCode=n}get tag(){return"numFmt"}render(l,n){l.leafNode("numFmt",{numFmtId:n.id,formatCode:n.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return o[e]&&o[e].f},T.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,T,_){const p=s("../base-xform"),o={boolean:(a,r)=>a===void 0?r:a};T.exports=class extends p{get tag(){return"protection"}render(a,r){a.addRollback(),a.openNode("protection");let t=!1;function e(l,n){n!==void 0&&(a.addAttribute(l,n),t=!0)}e("locked",o.boolean(r.locked,!0)?void 0:"0"),e("hidden",o.boolean(r.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){const r={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,T,_){const p=s("../base-xform"),o=s("./alignment-xform"),a=s("./protection-xform");T.exports=class extends p{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new o,protection:new a}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(s,T,_){const p=s("../../../doc/enums"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),r=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),n=s("./border-xform"),i=s("./numfmt-xform"),u=s("./style-xform"),h=s("./dxf-xform");class c extends a{constructor(f){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new i}),fonts:new t({tag:"fonts",count:!0,childXform:new e,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new n}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new u}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new u({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new h}),numFmt:new i,font:new e,fill:new l,border:new n,style:new u({xfId:!0}),cellStyles:c.STATIC_XFORMS.cellStyles,tableStyles:c.STATIC_XFORMS.tableStyles,extLst:c.STATIC_XFORMS.extLst},f&&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(f,v){v=v||this.model,f.openXml(o.StdDocAttributes),f.openNode("styleSheet",c.STYLESHEET_ATTRIBUTES),this.index?(v.numFmts&&v.numFmts.length&&(f.openNode("numFmts",{count:v.numFmts.length}),v.numFmts.forEach(x=>{f.writeXml(x)}),f.closeNode()),v.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:v.fonts.length,"x14ac:knownFonts":1}),v.fonts.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("fills",{count:v.fills.length}),v.fills.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("borders",{count:v.borders.length}),v.borders.forEach(x=>{f.writeXml(x)}),f.closeNode(),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),f.openNode("cellXfs",{count:v.styles.length}),v.styles.forEach(x=>{f.writeXml(x)}),f.closeNode()):(this.map.numFmts.render(f,v.numFmts),this.map.fonts.render(f,v.fonts),this.map.fills.render(f,v.fills),this.map.borders.render(f,v.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,v.styles)),c.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,v.dxfs),c.STATIC_XFORMS.tableStyles.render(f),c.STATIC_XFORMS.extLst.render(f),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"styleSheet":{this.model={};const v=(x,A)=>{A.model&&A.model.length&&(this.model[x]=A.model)};if(v("numFmts",this.map.numFmts),v("fonts",this.map.fonts),v("fills",this.map.fills),v("borders",this.map.borders),v("styles",this.map.cellXfs),v("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const x=this.index.numFmt;this.model.numFmts.forEach(A=>{x[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(f,v){if(!f)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(f))return this.weakMap.get(f);const x={};if(v=v||p.ValueType.Number,f.numFmt)x.numFmtId=this._addNumFmtStr(f.numFmt);else switch(v){case p.ValueType.Number:x.numFmtId=this._addNumFmtStr("General");break;case p.ValueType.Date:x.numFmtId=this._addNumFmtStr("mm-dd-yy")}f.font&&(x.fontId=this._addFont(f.font)),f.border&&(x.borderId=this._addBorder(f.border)),f.fill&&(x.fillId=this._addFill(f.fill)),f.alignment&&(x.alignment=f.alignment),f.protection&&(x.protection=f.protection);const A=this._addStyle(x);return this.weakMap&&this.weakMap.set(f,A),A}getStyleModel(f){const v=this.model.styles[f];if(!v)return null;let x=this.index.model[f];if(x)return x;if(x=this.index.model[f]={},v.numFmtId){const I=this.index.numFmt[v.numFmtId]||i.getDefaultFmtCode(v.numFmtId);I&&(x.numFmt=I)}function A(I,F,j){if(j||j===0){const P=F[j];P&&(x[I]=P)}}return A("font",this.model.fonts,v.fontId),A("border",this.model.borders,v.borderId),A("fill",this.model.fills,v.fillId),v.alignment&&(x.alignment=v.alignment),v.protection&&(x.protection=v.protection),x}addDxfStyle(f){return f.numFmt&&(f.numFmtId=this._addNumFmtStr(f.numFmt)),this.model.dxfs.push(f),this.model.dxfs.length-1}getDxfStyle(f){return this.model.dxfs[f]}_addStyle(f){const v=this.map.style.toXml(f);let x=this.index.style[v];return x===void 0&&(x=this.index.style[v]=this.model.styles.length,this.model.styles.push(v)),x}_addNumFmtStr(f){let v=i.getDefaultFmtId(f);if(v!==void 0||(v=this.index.numFmt[f],v!==void 0))return v;v=this.index.numFmt[f]=164+this.model.numFmts.length;const x=this.map.numFmt.toXml({id:v,formatCode:f});return this.model.numFmts.push(x),v}_addFont(f){const v=this.map.font.toXml(f);let x=this.index.font[v];return x===void 0&&(x=this.index.font[v]=this.model.fonts.length,this.model.fonts.push(v)),x}_addBorder(f){const v=this.map.border.toXml(f);let x=this.index.border[v];return x===void 0&&(x=this.index.border[v]=this.model.borders.length,this.model.borders.push(v)),x}_addFill(f){const v=this.map.fill.toXml(f);let x=this.index.fill[v];return x===void 0&&(x=this.index.fill[v]=this.model.fills.length,this.model.fills.push(v)),x}}c.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"},c.STATIC_XFORMS={cellStyles:new r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({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"}}]}]})},c.Mock=class extends c{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(d){return d.autodrain(),Promise.resolve()}addStyleModel(d,f){switch(f){case p.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const d={numFmtId:i.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(d)}return this._dateStyleId}getStyleModel(){return{}}},T.exports=c},{"../../../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(s,T,_){const p=s("../base-xform");class o extends p{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{const e=o.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}o.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},T.exports=o},{"../base-xform":32}],137:[function(s,T,_){const p=s("../base-xform"),o=s("./filter-column-xform");T.exports=class extends p{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(a,r){return a.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.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.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"customFilter"}render(o,a){o.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,_){const p=s("../base-xform"),o=s("../list-xform"),a=s("./custom-filter-xform"),r=s("./filter-xform");T.exports=class extends p{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;switch(t.name){case this.tag:return this.model={filterButton:e.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){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(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"filter"}render(o,a){o.leafNode(this.tag,{val:a.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tableColumn"}prepare(o,a){o.id=a.index+1}render(o,a){return o.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(s,T,_){const p=s("../base-xform");T.exports=class extends p{get tag(){return"tableStyleInfo"}render(o,a){return o.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,_){const p=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends o{constructor(){super(),this.map={autoFilter:new r,tableColumns:new a({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,u){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,u)}get tag(){return"table"}render(i,u){i.openXml(p.StdDocAttributes),i.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:u.id,name:u.name,displayName:u.displayName||u.name,ref:u.tableRef,totalsRowCount:u.totalsRow?"1":void 0,totalsRowShown:u.totalsRow?void 0:"1",headerRowCount:u.headerRow?"1":"0"}),this.map.autoFilter.render(i,u),this.map.tableColumns.render(i,u.columns),this.map.tableStyleInfo.render(i,u.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:u,attributes:h}=i;switch(u){case this.tag:this.reset(),this.model={name:h.name,displayName:h.displayName||h.name,tableRef:h.ref,totalsRow:h.totalsRowCount==="1",headerRow:h.headerRowCount==="1"};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.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((u,h)=>{this.model.columns[h].filterButton=u.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,u){i.columns.forEach(h=>{h.dxfId!==void 0&&(h.style=u.styles.getDxfStyle(h.dxfId))})}}l.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"},T.exports=l},{"../../../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(s,T,_){(function(p,o){(function(){const a=s("fs"),r=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),n=s("../utils/utils"),i=s("../utils/xml-stream"),{bufferToString:u}=s("../utils/browser-buffer-decode"),h=s("./xform/style/styles-xform"),c=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),f=s("./xform/core/relationships-xform"),v=s("./xform/core/content-types-xform"),x=s("./xform/core/app-xform"),A=s("./xform/book/workbook-xform"),I=s("./xform/sheet/worksheet-xform"),F=s("./xform/drawing/drawing-xform"),j=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),B=s("./xform/comment/vml-notes-xform"),U=s("./xml/theme1");class D{constructor(C){this.workbook=C}async readFile(C,w){if(!await n.fs.exists(C))throw new Error("File not found: "+C);const m=a.createReadStream(C);try{const b=await this.read(m,w);return m.close(),b}catch(b){throw m.close(),b}}parseRels(C){return new f().parseStream(C)}parseWorkbook(C){return new A().parseStream(C)}parseSharedStrings(C){return new d().parseStream(C)}reconcile(C,w){const m=new A,b=new I(w),g=new F,y=new j;m.reconcile(C);const S={media:C.media,mediaIndex:C.mediaIndex};Object.keys(C.drawings).forEach(z=>{const H=C.drawings[z],q=C.drawingRels[z];q&&(S.rels=q.reduce((O,$)=>(O[$.Id]=$,O),{}),(H.anchors||[]).forEach(O=>{const $=O.picture&&O.picture.hyperlinks;$&&S.rels[$.rId]&&($.hyperlink=S.rels[$.rId].Target,delete $.rId)}),g.reconcile(H,S))});const R={styles:C.styles};Object.values(C.tables).forEach(z=>{y.reconcile(z,R)});const N={styles:C.styles,sharedStrings:C.sharedStrings,media:C.media,mediaIndex:C.mediaIndex,date1904:C.properties&&C.properties.date1904,drawings:C.drawings,comments:C.comments,tables:C.tables,vmlDrawings:C.vmlDrawings};C.worksheets.forEach(z=>{z.relationships=C.worksheetRels[z.sheetNo],b.reconcile(z,N)}),delete C.worksheetHash,delete C.worksheetRels,delete C.globalRels,delete C.sharedStrings,delete C.workbookRels,delete C.sheetDefs,delete C.styles,delete C.mediaIndex,delete C.drawings,delete C.drawingRels,delete C.vmlDrawings}async _processWorksheetEntry(C,w,m,b,g){const y=new I(b),S=await y.parseStream(C);S.sheetNo=m,w.worksheetHash[g]=S,w.worksheets.push(S)}async _processCommentEntry(C,w,m){const b=new P,g=await b.parseStream(C);w.comments[`../${m}.xml`]=g}async _processTableEntry(C,w,m){const b=new j,g=await b.parseStream(C);w.tables[`../tables/${m}.xml`]=g}async _processWorksheetRelsEntry(C,w,m){const b=new f,g=await b.parseStream(C);w.worksheetRels[m]=g}async _processMediaEntry(C,w,m){const b=m.lastIndexOf(".");if(b>=1){const g=m.substr(b+1),y=m.substr(0,b);await new Promise((S,R)=>{const N=new l;N.on("finish",()=>{w.mediaIndex[m]=w.media.length,w.mediaIndex[y]=w.media.length;const z={type:"image",name:y,extension:g,buffer:N.toBuffer()};w.media.push(z),S()}),C.on("error",z=>{R(z)}),C.pipe(N)})}}async _processDrawingEntry(C,w,m){const b=new F,g=await b.parseStream(C);w.drawings[m]=g}async _processDrawingRelsEntry(C,w,m){const b=new f,g=await b.parseStream(C);w.drawingRels[m]=g}async _processVmlDrawingEntry(C,w,m){const b=new B,g=await b.parseStream(C);w.vmlDrawings[`../drawings/${m}.vml`]=g}async _processThemeEntry(C,w,m){await new Promise((b,g)=>{const y=new l;C.on("error",g),y.on("error",g),y.on("finish",()=>{w.themes[m]=y.read().toString(),b()}),C.pipe(y)})}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(C,w){!C[Symbol.asyncIterator]&&C.pipe&&(C=C.pipe(new t));const m=[];for await(const b of C)m.push(b);return this.load(o.concat(m),w)}async load(C,w){let m;m=w&&w.base64?o.from(C.toString(),"base64"):C;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await r.loadAsync(m);for(const y of Object.values(g.files))if(!y.dir){let S,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))S=new t,S.write(await y.async("nodebuffer"));else{let N;S=new t({writableObjectMode:!0,readableObjectMode:!0}),N=p.browser?u(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let H=0;H{if(m.type==="image"){const b=`xl/media/${m.name}.${m.extension}`;if(m.filename){const g=await function(y,S){return new Promise((R,N)=>{a.readFile(y,S,(z,H)=>{z?N(z):R(H)})})}(m.filename);return C.append(g,{name:b})}if(m.buffer)return C.append(m.buffer,{name:b});if(m.base64){const g=m.base64,y=g.substring(g.indexOf(",")+1);return C.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(C,w){const m=new F,b=new f;w.worksheets.forEach(g=>{const{drawing:y}=g;if(y){m.prepare(y,{});let S=m.toXml(y);C.append(S,{name:`xl/drawings/${y.name}.xml`}),S=b.toXml(y.rels),C.append(S,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(C,w){const m=new j;w.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{m.prepare(y,{});const S=m.toXml(y);C.append(S,{name:"xl/tables/"+y.target})})})}async addContentTypes(C,w){const m=new v().toXml(w);C.append(m,{name:"[Content_Types].xml"})}async addApp(C,w){const m=new x().toXml(w);C.append(m,{name:"docProps/app.xml"})}async addCore(C,w){const m=new c;C.append(m.toXml(w),{name:"docProps/core.xml"})}async addThemes(C,w){const m=w.themes||{theme1:U};Object.keys(m).forEach(b=>{const g=m[b],y=`xl/theme/${b}.xml`;C.append(g,{name:y})})}async addOfficeRels(C){const w=new f().toXml([{Id:"rId1",Type:D.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:D.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:D.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);C.append(w,{name:"_rels/.rels"})}async addWorkbookRels(C,w){let m=1;const b=[{Id:"rId"+m++,Type:D.RelType.Styles,Target:"styles.xml"},{Id:"rId"+m++,Type:D.RelType.Theme,Target:"theme/theme1.xml"}];w.sharedStrings.count&&b.push({Id:"rId"+m++,Type:D.RelType.SharedStrings,Target:"sharedStrings.xml"}),w.worksheets.forEach(y=>{y.rId="rId"+m++,b.push({Id:y.rId,Type:D.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new f().toXml(b);C.append(g,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(C,w){w.sharedStrings&&w.sharedStrings.count&&C.append(w.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(C,w){const{xml:m}=w.styles;m&&C.append(m,{name:"xl/styles.xml"})}async addWorkbook(C,w){const m=new A;C.append(m.toXml(w),{name:"xl/workbook.xml"})}async addWorksheets(C,w){const m=new I,b=new f,g=new P,y=new B;w.worksheets.forEach(S=>{let R=new i;m.render(R,S),C.append(R.xml,{name:`xl/worksheets/sheet${S.id}.xml`}),S.rels&&S.rels.length&&(R=new i,b.render(R,S.rels),C.append(R.xml,{name:`xl/worksheets/_rels/sheet${S.id}.xml.rels`})),S.comments.length>0&&(R=new i,g.render(R,S),C.append(R.xml,{name:`xl/comments${S.id}.xml`}),R=new i,y.render(R,S),C.append(R.xml,{name:`xl/drawings/vmlDrawing${S.id}.vml`}))})}_finalize(C){return new Promise((w,m)=>{C.on("finish",()=>{w(this)}),C.on("error",m),C.finalize()})}prepareModel(C,w){C.creator=C.creator||"ExcelJS",C.lastModifiedBy=C.lastModifiedBy||"ExcelJS",C.created=C.created||new Date,C.modified=C.modified||new Date,C.useSharedStrings=w.useSharedStrings===void 0||w.useSharedStrings,C.useStyles=w.useStyles===void 0||w.useStyles,C.sharedStrings=new d,C.styles=C.useStyles?new h(!0):new h.Mock;const m=new A,b=new I;m.prepare(C);const g={sharedStrings:C.sharedStrings,styles:C.styles,date1904:C.properties.date1904,drawingsCount:0,media:C.media};g.drawings=C.drawings=[],g.commentRefs=C.commentRefs=[];let y=0;C.tables=[],C.worksheets.forEach(S=>{S.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,C.tables.push(R)}),b.prepare(S,g)})}async write(C,w){w=w||{};const{model:m}=this.workbook,b=new e.ZipWriter(w.zip);return b.pipe(C),this.prepareModel(m,w),await this.addContentTypes(b,m),await this.addOfficeRels(b,m),await this.addWorkbookRels(b,m),await this.addWorksheets(b,m),await this.addSharedStrings(b,m),await this.addDrawings(b,m),await this.addTables(b,m),await Promise.all([this.addThemes(b,m),this.addStyles(b,m)]),await this.addMedia(b,m),await Promise.all([this.addApp(b,m),this.addCore(b,m)]),await this.addWorkbook(b,m),this._finalize(b)}writeFile(C,w){const m=a.createWriteStream(C);return new Promise((b,g)=>{m.on("finish",()=>{b()}),m.on("error",y=>{g(y)}),this.write(m,w).then(()=>{m.end()}).catch(y=>{g(y)})})}async writeBuffer(C){const w=new l;return await this.write(w,C),w.read()}}D.RelType=s("./rel-type"),T.exports=D}).call(this)}).call(this,s("_process"),s("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(s,T,_){T.exports=` `},{}],146:[function(s,T,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvFormatterStream=void 0;const o=s("stream"),a=s("./formatter");class r extends o.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new a.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,l,n){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(u,h)=>u?(i=!0,n(u)):(h&&h.forEach(c=>{this.push(p.from(c,"utf8"))}),i=!0,n()))}catch(u){if(i)throw u;n(u)}}_flush(e){this.rowFormatter.finish((l,n)=>l?e(l):(n&&n.forEach(i=>{this.push(p.from(i,"utf8"))}),e()))}}_.CsvFormatterStream=r}).call(this)}).call(this,s("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FormatterOptions=void 0,_.FormatterOptions=class{constructor(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var o;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=` `,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,p||{}),(p==null?void 0:p.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(p==null?void 0:p.quote)===!0?this.quote='"':(p==null?void 0:p.quote)===!1&&(this.quote=""),typeof(p==null?void 0:p.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((o=p.writeHeaders)===null||o===void 0||o),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(s,T,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=void 0;const o=p(s("lodash.isboolean")),a=p(s("lodash.isnil")),r=p(s("lodash.escaperegexp"));_.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,t.headers!==null&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");const e=`[${t.delimiter}${r.default(t.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const l=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,e,l){const n=(""+(a.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:i}=this;return i.quote!==""&&n.indexOf(i.quote)!==-1?this.quoteField(n.replace(this.REPLACE_REGEXP,i.escapedQuote)):n.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(e,l)?this.quoteField(n):n}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(s,T,_){var p=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowFormatter=void 0;const o=p(s("lodash.isfunction")),a=p(s("lodash.isequal")),r=s("./FieldFormatter"),t=s("../types");class e{constructor(n){this.rowCount=0,this.formatterOptions=n,this.fieldFormatter=new r.FieldFormatter(n),this.headers=n.headers,this.shouldWriteHeaders=n.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),n.transform&&(this.rowTransform=n.transform)}static isRowHashArray(n){return!!Array.isArray(n)&&Array.isArray(n[0])&&n[0].length===2}static isRowArray(n){return Array.isArray(n)&&!this.isRowHashArray(n)}static gatherHeaders(n){return e.isRowHashArray(n)?n.map(i=>i[0]):Array.isArray(n)?n:Object.keys(n)}static createTransform(n){return t.isSyncTransform(n)?(i,u)=>{let h=null;try{h=n(i)}catch(c){return u(c)}return u(null,h)}:(i,u)=>{n(i,u)}}set rowTransform(n){if(!o.default(n))throw new TypeError("The transform should be a function");this._rowTransform=e.createTransform(n)}format(n,i){this.callTransformer(n,(u,h)=>{if(u)return i(u);if(!n)return i(null);const c=[];if(h){const{shouldFormatColumns:d,headers:f}=this.checkHeaders(h);if(this.shouldWriteHeaders&&f&&!this.hasWrittenHeaders&&(c.push(this.formatColumns(f,!0)),this.hasWrittenHeaders=!0),d){const v=this.gatherColumns(h);c.push(this.formatColumns(v,!1))}}return i(null,c)})}finish(n){const i=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return n(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));i.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&i.push(this.formatterOptions.rowDelimiter),n(null,i)}checkHeaders(n){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const i=e.gatherHeaders(n);return this.headers=i,this.fieldFormatter.headers=i,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(i,n),headers:i}:{shouldFormatColumns:!0,headers:null}}gatherColumns(n){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(n)?e.isRowHashArray(n)?this.headers.map((i,u)=>{const h=n[u];return h?h[1]:""}):e.isRowArray(n)&&!this.shouldWriteHeaders?n:this.headers.map((i,u)=>n[u]):this.headers.map(i=>n[i])}callTransformer(n,i){return this._rowTransform?this._rowTransform(n,i):i(null,n)}formatColumns(n,i){const u=n.map((c,d)=>this.fieldFormatter.format(c,d,i)).join(this.formatterOptions.delimiter),{rowCount:h}=this;return this.rowCount+=1,h?[this.formatterOptions.rowDelimiter,u].join(""):u}}_.RowFormatter=e},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=_.RowFormatter=void 0;var p=s("./RowFormatter");Object.defineProperty(_,"RowFormatter",{enumerable:!0,get:function(){return p.RowFormatter}});var o=s("./FieldFormatter");Object.defineProperty(_,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(s,T,_){(function(p){(function(){var o=Object.create?function(d,f,v,x){x===void 0&&(x=v),Object.defineProperty(d,x,{enumerable:!0,get:function(){return f[v]}})}:function(d,f,v,x){x===void 0&&(x=v),d[x]=f[v]},a=Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f},r=function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var v in d)v!=="default"&&Object.prototype.hasOwnProperty.call(d,v)&&o(f,d,v);return a(f,d),f},t=function(d,f){for(var v in d)v==="default"||Object.prototype.hasOwnProperty.call(f,v)||o(f,d,v)};Object.defineProperty(_,"__esModule",{value:!0}),_.writeToPath=_.writeToString=_.writeToBuffer=_.writeToStream=_.write=_.format=_.FormatterOptions=_.CsvFormatterStream=void 0;const e=s("util"),l=s("stream"),n=r(s("fs")),i=s("./FormatterOptions"),u=s("./CsvFormatterStream");t(s("./types"),_);var h=s("./CsvFormatterStream");Object.defineProperty(_,"CsvFormatterStream",{enumerable:!0,get:function(){return h.CsvFormatterStream}});var c=s("./FormatterOptions");Object.defineProperty(_,"FormatterOptions",{enumerable:!0,get:function(){return c.FormatterOptions}}),_.format=d=>new u.CsvFormatterStream(new i.FormatterOptions(d)),_.write=(d,f)=>{const v=_.format(f),x=e.promisify((A,I)=>{v.write(A,void 0,I)});return d.reduce((A,I)=>A.then(()=>x(I)),Promise.resolve()).then(()=>v.end()).catch(A=>{v.emit("error",A)}),v},_.writeToStream=(d,f,v)=>_.write(f,v).pipe(d),_.writeToBuffer=function(d){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const v=[],x=new l.Writable({write(A,I,F){v.push(A),F()}});return new Promise((A,I)=>{x.on("error",I).on("finish",()=>A(p.concat(v))),_.write(d,f).pipe(x)})},_.writeToString=(d,f)=>_.writeToBuffer(d,f).then(v=>v.toString()),_.writeToPath=(d,f,v)=>{const x=n.createWriteStream(d,{encoding:"utf8"});return _.write(f,v).pipe(x)}}).call(this)}).call(this,s("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1},{}],153:[function(s,T,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvParserStream=void 0;const o=s("string_decoder"),a=s("stream"),r=s("./transforms"),t=s("./parser");class e extends a.Transform{constructor(n){super({objectMode:n.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=n,this.parser=new t.Parser(n),this.headerTransformer=new r.HeaderTransformer(n),this.decoder=new o.StringDecoder(n.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(n){return this.rowTransformerValidator.rowTransform=n,this}validate(n){return this.rowTransformerValidator.rowValidator=n,this}emit(n){if(n==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var i=arguments.length,u=new Array(i>1?i-1:0),h=1;h{const d=x=>x?i(x):c%100!=0?h(c+1):void p(()=>h(c+1));if(this.checkAndEmitHeaders(),c>=u||this.hasHitRowLimit)return i();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const f=n[c];this.rowCount+=1,this.parsedRowCount+=1;const v=this.rowCount;return this.transformRow(f,(x,A)=>{if(x)return this.rowCount-=1,d(x);if(!A)return d(new Error("expected transform result"));if(A.isValid){if(A.row)return this.pushRow(A.row,d)}else this.emit("data-invalid",A.row,v,A.reason);return d()})};h(0)}transformRow(n,i){try{this.headerTransformer.transform(n,(u,h)=>u?i(u):h?h.isValid?h.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(h.row,i):this.skipRow(i):(this.rowCount-=1,this.parsedRowCount-=1,i(null,{row:null,isValid:!0})):this.shouldEmitRows?i(null,{isValid:!1,row:n}):this.skipRow(i):i(new Error("Expected result from header transform")))}catch(u){i(u)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(n){return this.rowCount-=1,n(null,{row:null,isValid:!0})}pushRow(n,i){try{this.parserOptions.objectMode?this.push(n):this.push(JSON.stringify(n)),i()}catch(u){i(u)}}static wrapDoneCallback(n){let i=!1;return function(u){if(u){if(i)throw u;return i=!0,void n(u)}for(var h=arguments.length,c=new Array(h>1?h-1:0),d=1;d1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=o.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(s,T,_){var p=Object.create?function(h,c,d,f){f===void 0&&(f=d),Object.defineProperty(h,f,{enumerable:!0,get:function(){return c[d]}})}:function(h,c,d,f){f===void 0&&(f=d),h[f]=c[d]},o=Object.create?function(h,c){Object.defineProperty(h,"default",{enumerable:!0,value:c})}:function(h,c){h.default=c},a=function(h){if(h&&h.__esModule)return h;var c={};if(h!=null)for(var d in h)d!=="default"&&Object.prototype.hasOwnProperty.call(h,d)&&p(c,h,d);return o(c,h),c},r=function(h,c){for(var d in h)d==="default"||Object.prototype.hasOwnProperty.call(c,d)||p(c,h,d)};Object.defineProperty(_,"__esModule",{value:!0}),_.parseString=_.parseFile=_.parseStream=_.parse=_.ParserOptions=_.CsvParserStream=void 0;const t=a(s("fs")),e=s("stream"),l=s("./ParserOptions"),n=s("./CsvParserStream");r(s("./types"),_);var i=s("./CsvParserStream");Object.defineProperty(_,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var u=s("./ParserOptions");Object.defineProperty(_,"ParserOptions",{enumerable:!0,get:function(){return u.ParserOptions}}),_.parse=h=>new n.CsvParserStream(new l.ParserOptions(h)),_.parseStream=(h,c)=>h.pipe(new n.CsvParserStream(new l.ParserOptions(c))),_.parseFile=function(h){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(h).pipe(new n.CsvParserStream(new l.ParserOptions(c)))},_.parseString=(h,c)=>{const d=new e.Readable;return d.push(h),d.push(null),d.pipe(new n.CsvParserStream(new l.ParserOptions(c)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Parser=void 0;const p=s("./Scanner"),o=s("./RowParser"),a=s("./Token");class r{constructor(e){this.parserOptions=e,this.rowParser=new o.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,l){const n=new p.Scanner({line:r.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){const l=[];let n=!0;for(;n;)n=this.parseRow(e,l);return{line:e.line,rows:l}}parseWithComments(e){const{parserOptions:l}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(a.Token.isTokenComment(i,l)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows:n};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,l){if(!e.nextNonSpaceToken)return!1;const n=this.rowParser.parse(e);return n!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(n)||l.push(n),!0)}}_.Parser=r},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.RowParser=void 0;const p=s("./column"),o=s("./Token");_.RowParser=class{constructor(a){this.parserOptions=a,this.columnParser=new p.ColumnParser(a)}static isEmptyRow(a){return a.join("").replace(/\s+/g,"")===""}parse(a){const{parserOptions:r}=this,{hasMoreData:t}=a,e=a,l=[];let n=this.getStartToken(e,l);for(;n;){if(o.Token.isTokenRowDelimiter(n))return e.advancePastToken(n),!e.hasMoreCharacters&&o.Token.isTokenCarriageReturn(n,r)&&t?null:(e.truncateToCursor(),l);if(!this.shouldSkipColumnParse(e,n,l)){const i=this.columnParser.parse(e);if(i===null)return null;l.push(i)}n=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),l)}getStartToken(a,r){const t=a.nextNonSpaceToken;return t!==null&&o.Token.isTokenDelimiter(t,this.parserOptions)?(r.push(""),a.nextNonSpaceToken):t}shouldSkipColumnParse(a,r,t){const{parserOptions:e}=this;if(o.Token.isTokenDelimiter(r,e)){a.advancePastToken(r);const l=a.nextCharacterToken;if(!a.hasMoreCharacters||l!==null&&o.Token.isTokenRowDelimiter(l)||l!==null&&o.Token.isTokenDelimiter(l,e))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Scanner=void 0;const p=s("./Token"),o=/((?:\r\n)|\n|\r)/;_.Scanner=class{constructor(a){this.cursor=0,this.line=a.line,this.lineLength=this.line.length,this.parserOptions=a.parserOptions,this.hasMoreData=a.hasMoreData,this.cursor=a.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:a}=this,r=this.parserOptions.NEXT_TOKEN_REGEXP;if(a.search(r)===-1)return null;const t=r.exec(a);if(t==null)return null;const e=t[1],l=this.cursor+(t.index||0);return new p.Token({token:e,startCursor:l,endCursor:l+e.length-1})}get nextCharacterToken(){const{cursor:a,lineLength:r}=this;return r<=a?null:new p.Token({token:this.line[a],startCursor:a,endCursor:a})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const a=o.exec(this.lineFromCursor);return a?(this.cursor+=(a.index||0)+a[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(a){return this.cursor=a,this}advanceToToken(a){return this.cursor=a.startCursor,this}advancePastToken(a){return this.cursor=a.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Token=void 0,_.Token=class{constructor(p){this.token=p.token,this.startCursor=p.startCursor,this.endCursor=p.endCursor}static isTokenRowDelimiter(p){const o=p.token;return o==="\r"||o===` `||o===`\r `}static isTokenCarriageReturn(p,o){return p.token===o.carriageReturn}static isTokenComment(p,o){return o.supportsComments&&!!p&&p.token===o.comment}static isTokenEscapeCharacter(p,o){return p.token===o.escapeChar}static isTokenQuote(p,o){return p.token===o.quote}static isTokenDelimiter(p,o){return p.token===o.delimiter}}},{}],160:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=void 0,_.ColumnFormatter=class{constructor(p){p.trim?this.format=o=>o.trim():p.ltrim?this.format=o=>o.trimLeft():p.rtrim?this.format=o=>o.trimRight():this.format=o=>o}}},{}],161:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnParser=void 0;const p=s("./NonQuotedColumnParser"),o=s("./QuotedColumnParser"),a=s("../Token");_.ColumnParser=class{constructor(r){this.parserOptions=r,this.quotedColumnParser=new o.QuotedColumnParser(r),this.nonQuotedColumnParser=new p.NonQuotedColumnParser(r)}parse(r){const{nextNonSpaceToken:t}=r;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(r.advanceToToken(t),this.quotedColumnParser.parse(r)):this.nonQuotedColumnParser.parse(r)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.NonQuotedColumnParser=void 0;const p=s("./ColumnFormatter"),o=s("../Token");_.NonQuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new p.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const{parserOptions:r}=this,t=[];let e=a.nextCharacterToken;for(;e&&!o.Token.isTokenDelimiter(e,r)&&!o.Token.isTokenRowDelimiter(e);e=a.nextCharacterToken)t.push(e.token),a.advancePastToken(e);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=void 0;const p=s("./ColumnFormatter"),o=s("../Token");_.QuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new p.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const r=a.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(a);if(!t){if(a.advanceTo(r),!a.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${a.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(a),e}gatherDataBetweenQuotes(a){const{parserOptions:r}=this;let t=!1,e=!1;const l=[];let n=a.nextCharacterToken;for(;!e&&n!==null;n=a.nextCharacterToken){const i=o.Token.isTokenQuote(n,r);if(!t&&i)t=!0;else if(t)if(o.Token.isTokenEscapeCharacter(n,r)){a.advancePastToken(n);const u=a.nextCharacterToken;u!==null&&(o.Token.isTokenQuote(u,r)||o.Token.isTokenEscapeCharacter(u,r))?(l.push(u.token),n=u):i?e=!0:l.push(n.token)}else i?e=!0:l.push(n.token);a.advancePastToken(n)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:e}}checkForMalformedColumn(a){const{parserOptions:r}=this,{nextNonSpaceToken:t}=a;if(t){const e=o.Token.isTokenDelimiter(t,r),l=o.Token.isTokenRowDelimiter(t);if(!e&&!l){const n=a.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${r.escapedDelimiter}' OR new line got: '${t.token}'. at '${n}`)}a.advanceToToken(t)}else a.hasMoreData||a.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=void 0;var p=s("./ColumnParser");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return p.ColumnParser}});var o=s("./NonQuotedColumnParser");Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var a=s("./QuotedColumnParser");Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var r=s("./ColumnFormatter");Object.defineProperty(_,"ColumnFormatter",{enumerable:!0,get:function(){return r.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=_.Token=_.Scanner=_.RowParser=_.Parser=void 0;var p=s("./Parser");Object.defineProperty(_,"Parser",{enumerable:!0,get:function(){return p.Parser}});var o=s("./RowParser");Object.defineProperty(_,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var a=s("./Scanner");Object.defineProperty(_,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var r=s("./Token");Object.defineProperty(_,"Token",{enumerable:!0,get:function(){return r.Token}});var t=s("./column");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(s,T,_){var p=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=void 0;const o=p(s("lodash.isundefined")),a=p(s("lodash.isfunction")),r=p(s("lodash.uniq")),t=p(s("lodash.groupby"));_.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,l){return this.shouldMapRow(e)?l(null,this.processRow(e)):l(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&e.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return l.strictColumnHandling&&e.length!!i);if(r.default(n).length!==n.length){const i=t.default(n),u=Object.keys(i).filter(h=>i[h].length>1);throw new Error("Duplicate headers found "+JSON.stringify(u))}this.headers=e,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(s,T,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowTransformerValidator=void 0;const o=p(s("lodash.isfunction")),a=s("../types");class r{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(l,n)=>{let i=null;try{i=e(l)}catch(u){return n(u)}return n(null,i)}:e}static createValidator(e){return a.isSyncValidate(e)?(l,n)=>{n(null,{row:l,isValid:e(l)})}:(l,n)=>{e(l,(i,u,h)=>i?n(i):n(null,u?{row:l,isValid:u,reason:h}:{row:l,isValid:!1,reason:h}))}}set rowTransform(e){if(!o.default(e))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(e)}set rowValidator(e){if(!o.default(e))throw new TypeError("The validate should be a function");this._rowValidator=r.createValidator(e)}transformAndValidate(e,l){return this.callTransformer(e,(n,i)=>n?l(n):i?this.callValidator(i,(u,h)=>u?l(u):h&&!h.isValid?l(null,{row:i,isValid:!1,reason:h.reason}):l(null,{row:i,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(e,l){return this._rowTransform?this._rowTransform(e,l):l(null,e)}callValidator(e,l){return this._rowValidator?this._rowValidator(e,l):l(null,{row:e,isValid:!0})}}_.RowTransformerValidator=r},{"../types":169,"lodash.isfunction":446}],168:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=_.RowTransformerValidator=void 0;var p=s("./RowTransformerValidator");Object.defineProperty(_,"RowTransformerValidator",{enumerable:!0,get:function(){return p.RowTransformerValidator}});var o=s("./HeaderTransformer");Object.defineProperty(_,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(s,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncValidate=_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1,_.isSyncValidate=p=>p.length===1},{}],170:[function(s,T,_){const p=_;p.bignum=s("bn.js"),p.define=s("./asn1/api").define,p.base=s("./asn1/base"),p.constants=s("./asn1/constants"),p.decoders=s("./asn1/decoders"),p.encoders=s("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(s,T,_){const p=s("./encoders"),o=s("./decoders"),a=s("inherits");function r(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}_.define=function(t,e){return new r(t,e)},r.prototype._createNamed=function(t){const e=this.name;function l(n){this._initNamed(n,e)}return a(l,t),l.prototype._initNamed=function(n,i){t.call(this,n,i)},new l(this)},r.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(o[t])),this.decoders[t]},r.prototype.decode=function(t,e,l){return this._getDecoder(e).decode(t,l)},r.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(p[t])),this.encoders[t]},r.prototype.encode=function(t,e,l){return this._getEncoder(e).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(s,T,_){const p=s("inherits"),o=s("../base/reporter").Reporter,a=s("safer-buffer").Buffer;function r(e,l){o.call(this,l),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,l){if(Array.isArray(e))this.length=0,this.value=e.map(function(n){return t.isEncoderBuffer(n)||(n=new t(n,l)),this.length+=n.length,n},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return l.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return l.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}p(r,o),_.DecoderBuffer=r,r.isDecoderBuffer=function(e){return e instanceof r?!0:typeof e=="object"&&a.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"},r.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},r.prototype.restore=function(e){const l=new r(this.base);return l.offset=e.offset,l.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),l},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,l){if(!(this.offset+e<=this.length))return this.error(l||"DecoderBuffer overrun");const n=new r(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},_.EncoderBuffer=t,t.isEncoderBuffer=function(e){return e instanceof t?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"},t.prototype.join=function(e,l){return e||(e=a.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,l),l+=n.length}):(typeof this.value=="number"?e[l]=this.value:typeof this.value=="string"?e.write(this.value,l):a.isBuffer(this.value)&&this.value.copy(e,l),l+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(s,T,_){const p=_;p.Reporter=s("./reporter").Reporter,p.DecoderBuffer=s("./buffer").DecoderBuffer,p.EncoderBuffer=s("./buffer").EncoderBuffer,p.Node=s("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(s,T,_){const p=s("../base/reporter").Reporter,o=s("../base/buffer").EncoderBuffer,a=s("../base/buffer").DecoderBuffer,r=s("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],e=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(i,u,h){const c={};this._baseState=c,c.name=h,c.enc=i,c.parent=u||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}T.exports=l;const n=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const i=this._baseState,u={};n.forEach(function(c){u[c]=i[c]});const h=new this.constructor(u.parent);return h._baseState=u,h},l.prototype._wrap=function(){const i=this._baseState;e.forEach(function(u){this[u]=function(){const h=new this.constructor(this);return i.children.push(h),h[u].apply(h,arguments)}},this)},l.prototype._init=function(i){const u=this._baseState;r(u.parent===null),i.call(this),u.children=u.children.filter(function(h){return h._baseState.parent===this},this),r.equal(u.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(i){const u=this._baseState,h=i.filter(function(c){return c instanceof this.constructor},this);i=i.filter(function(c){return!(c instanceof this.constructor)},this),h.length!==0&&(r(u.children===null),u.children=h,h.forEach(function(c){c._baseState.parent=this},this)),i.length!==0&&(r(u.args===null),u.args=i,u.reverseArgs=i.map(function(c){if(typeof c!="object"||c.constructor!==Object)return c;const d={};return Object.keys(c).forEach(function(f){f==(0|f)&&(f|=0);const v=c[f];d[v]=f}),d}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(i){l.prototype[i]=function(){const u=this._baseState;throw new Error(i+" not implemented for encoding: "+u.enc)}}),t.forEach(function(i){l.prototype[i]=function(){const u=this._baseState,h=Array.prototype.slice.call(arguments);return r(u.tag===null),u.tag=i,this._useArgs(h),this}}),l.prototype.use=function(i){r(i);const u=this._baseState;return r(u.use===null),u.use=i,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(i){const u=this._baseState;return r(u.default===null),u.default=i,u.optional=!0,this},l.prototype.explicit=function(i){const u=this._baseState;return r(u.explicit===null&&u.implicit===null),u.explicit=i,this},l.prototype.implicit=function(i){const u=this._baseState;return r(u.explicit===null&&u.implicit===null),u.implicit=i,this},l.prototype.obj=function(){const i=this._baseState,u=Array.prototype.slice.call(arguments);return i.obj=!0,u.length!==0&&this._useArgs(u),this},l.prototype.key=function(i){const u=this._baseState;return r(u.key===null),u.key=i,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(i){const u=this._baseState;return r(u.choice===null),u.choice=i,this._useArgs(Object.keys(i).map(function(h){return i[h]})),this},l.prototype.contains=function(i){const u=this._baseState;return r(u.use===null),u.contains=i,this},l.prototype._decode=function(i,u){const h=this._baseState;if(h.parent===null)return i.wrapResult(h.children[0]._decode(i,u));let c,d=h.default,f=!0,v=null;if(h.key!==null&&(v=i.enterKey(h.key)),h.optional){let x=null;if(h.explicit!==null?x=h.explicit:h.implicit!==null?x=h.implicit:h.tag!==null&&(x=h.tag),x!==null||h.any){if(f=this._peekTag(i,x,h.any),i.isError(f))return f}else{const A=i.save();try{h.choice===null?this._decodeGeneric(h.tag,i,u):this._decodeChoice(i,u),f=!0}catch{f=!1}i.restore(A)}}if(h.obj&&f&&(c=i.enterObject()),f){if(h.explicit!==null){const A=this._decodeTag(i,h.explicit);if(i.isError(A))return A;i=A}const x=i.offset;if(h.use===null&&h.choice===null){let A;h.any&&(A=i.save());const I=this._decodeTag(i,h.implicit!==null?h.implicit:h.tag,h.any);if(i.isError(I))return I;h.any?d=i.raw(A):i=I}if(u&&u.track&&h.tag!==null&&u.track(i.path(),x,i.length,"tagged"),u&&u.track&&h.tag!==null&&u.track(i.path(),i.offset,i.length,"content"),h.any||(d=h.choice===null?this._decodeGeneric(h.tag,i,u):this._decodeChoice(i,u)),i.isError(d))return d;if(h.any||h.choice!==null||h.children===null||h.children.forEach(function(A){A._decode(i,u)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){const A=new a(d);d=this._getUse(h.contains,i._reporterState.obj)._decode(A,u)}}return h.obj&&f&&(d=i.leaveObject(c)),h.key===null||d===null&&f!==!0?v!==null&&i.exitKey(v):i.leaveKey(v,h.key,d),d},l.prototype._decodeGeneric=function(i,u,h){const c=this._baseState;return i==="seq"||i==="set"?null:i==="seqof"||i==="setof"?this._decodeList(u,i,c.args[0],h):/str$/.test(i)?this._decodeStr(u,i,h):i==="objid"&&c.args?this._decodeObjid(u,c.args[0],c.args[1],h):i==="objid"?this._decodeObjid(u,null,null,h):i==="gentime"||i==="utctime"?this._decodeTime(u,i,h):i==="null_"?this._decodeNull(u,h):i==="bool"?this._decodeBool(u,h):i==="objDesc"?this._decodeStr(u,i,h):i==="int"||i==="enum"?this._decodeInt(u,c.args&&c.args[0],h):c.use!==null?this._getUse(c.use,u._reporterState.obj)._decode(u,h):u.error("unknown tag: "+i)},l.prototype._getUse=function(i,u){const h=this._baseState;return h.useDecoder=this._use(i,u),r(h.useDecoder._baseState.parent===null),h.useDecoder=h.useDecoder._baseState.children[0],h.implicit!==h.useDecoder._baseState.implicit&&(h.useDecoder=h.useDecoder.clone(),h.useDecoder._baseState.implicit=h.implicit),h.useDecoder},l.prototype._decodeChoice=function(i,u){const h=this._baseState;let c=null,d=!1;return Object.keys(h.choice).some(function(f){const v=i.save(),x=h.choice[f];try{const A=x._decode(i,u);if(i.isError(A))return!1;c={type:f,value:A},d=!0}catch{return i.restore(v),!1}return!0},this),d?c:i.error("Choice not matched")},l.prototype._createEncoderBuffer=function(i){return new o(i,this.reporter)},l.prototype._encode=function(i,u,h){const c=this._baseState;if(c.default!==null&&c.default===i)return;const d=this._encodeValue(i,u,h);return d===void 0||this._skipDefault(d,u,h)?void 0:d},l.prototype._encodeValue=function(i,u,h){const c=this._baseState;if(c.parent===null)return c.children[0]._encode(i,u||new p);let d=null;if(this.reporter=u,c.optional&&i===void 0){if(c.default===null)return;i=c.default}let f=null,v=!1;if(c.any)d=this._createEncoderBuffer(i);else if(c.choice)d=this._encodeChoice(i,u);else if(c.contains)f=this._getUse(c.contains,h)._encode(i,u),v=!0;else if(c.children)f=c.children.map(function(x){if(x._baseState.tag==="null_")return x._encode(null,u,i);if(x._baseState.key===null)return u.error("Child should have a key");const A=u.enterKey(x._baseState.key);if(typeof i!="object")return u.error("Child expected, but input is not object");const I=x._encode(i[x._baseState.key],u,i);return u.leaveKey(A),I},this).filter(function(x){return x}),f=this._createEncoderBuffer(f);else if(c.tag==="seqof"||c.tag==="setof"){if(!c.args||c.args.length!==1)return u.error("Too many args for : "+c.tag);if(!Array.isArray(i))return u.error("seqof/setof, but data is not Array");const x=this.clone();x._baseState.implicit=null,f=this._createEncoderBuffer(i.map(function(A){const I=this._baseState;return this._getUse(I.args[0],i)._encode(A,u)},x))}else c.use!==null?d=this._getUse(c.use,h)._encode(i,u):(f=this._encodePrimitive(c.tag,i),v=!0);if(!c.any&&c.choice===null){const x=c.implicit!==null?c.implicit:c.tag,A=c.implicit===null?"universal":"context";x===null?c.use===null&&u.error("Tag could be omitted only for .use()"):c.use===null&&(d=this._encodeComposite(x,v,A,f))}return c.explicit!==null&&(d=this._encodeComposite(c.explicit,!1,"context",d)),d},l.prototype._encodeChoice=function(i,u){const h=this._baseState,c=h.choice[i.type];return c||r(!1,i.type+" not found in "+JSON.stringify(Object.keys(h.choice))),c._encode(i.value,u)},l.prototype._encodePrimitive=function(i,u){const h=this._baseState;if(/str$/.test(i))return this._encodeStr(u,i);if(i==="objid"&&h.args)return this._encodeObjid(u,h.reverseArgs[0],h.args[1]);if(i==="objid")return this._encodeObjid(u,null,null);if(i==="gentime"||i==="utctime")return this._encodeTime(u,i);if(i==="null_")return this._encodeNull();if(i==="int"||i==="enum")return this._encodeInt(u,h.args&&h.reverseArgs[0]);if(i==="bool")return this._encodeBool(u);if(i==="objDesc")return this._encodeStr(u,i);throw new Error("Unsupported tag: "+i)},l.prototype._isNumstr=function(i){return/^[0-9 ]*$/.test(i)},l.prototype._isPrintstr=function(i){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(i)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(s,T,_){const p=s("inherits");function o(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function a(r,t){this.path=r,this.rethrow(t)}_.Reporter=o,o.prototype.isError=function(r){return r instanceof a},o.prototype.save=function(){const r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},o.prototype.restore=function(r){const t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},o.prototype.enterKey=function(r){return this._reporterState.path.push(r)},o.prototype.exitKey=function(r){const t=this._reporterState;t.path=t.path.slice(0,r-1)},o.prototype.leaveKey=function(r,t,e){const l=this._reporterState;this.exitKey(r),l.obj!==null&&(l.obj[t]=e)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const r=this._reporterState,t=r.obj;return r.obj={},t},o.prototype.leaveObject=function(r){const t=this._reporterState,e=t.obj;return t.obj=r,e},o.prototype.error=function(r){let t;const e=this._reporterState,l=r instanceof a;if(t=l?r:new a(e.path.map(function(n){return"["+JSON.stringify(n)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return l||e.errors.push(t),t},o.prototype.wrapResult=function(r){const t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},p(a,Error),a.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(s,T,_){function p(o){const a={};return Object.keys(o).forEach(function(r){(0|r)==r&&(r|=0);const t=o[r];a[t]=r}),a}_.tagClass={0:"universal",1:"application",2:"context",3:"private"},_.tagClassByName=p(_.tagClass),_.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},_.tagByName=p(_.tag)},{}],177:[function(s,T,_){const p=_;p._reverse=function(o){const a={};return Object.keys(o).forEach(function(r){(0|r)==r&&(r|=0);const t=o[r];a[t]=r}),a},p.der=s("./der")},{"./der":176}],178:[function(s,T,_){const p=s("inherits"),o=s("bn.js"),a=s("../base/buffer").DecoderBuffer,r=s("../base/node"),t=s("../constants/der");function e(u){this.enc="der",this.name=u.name,this.entity=u,this.tree=new l,this.tree._init(u.body)}function l(u){r.call(this,"der",u)}function n(u,h){let c=u.readUInt8(h);if(u.isError(c))return c;const d=t.tagClass[c>>6],f=(32&c)==0;if((31&c)==31){let v=c;for(c=0;(128&v)==128;){if(v=u.readUInt8(h),u.isError(v))return v;c<<=7,c|=127&v}}else c&=31;return{cls:d,primitive:f,tag:c,tagStr:t.tag[c]}}function i(u,h,c){let d=u.readUInt8(c);if(u.isError(d))return d;if(!h&&d===128)return null;if(!(128&d))return d;const f=127&d;if(f>4)return u.error("length octect is too long");d=0;for(let v=0;v=31?I.error("Multi-octet tag encoding unsupported"):(x||(F|=32),F|=r.tagClassByName[A||"universal"]<<6,F)}(n,i,u,this.reporter);if(h.length<128){const v=o.alloc(2);return v[0]=c,v[1]=h.length,this._createEncoderBuffer([v,h])}let d=1;for(let v=h.length;v>=256;v>>=8)d++;const f=o.alloc(2+d);f[0]=c,f[1]=128|d;for(let v=1+d,x=h.length;x>0;v--,x>>=8)f[v]=255&x;return this._createEncoderBuffer([f,h])},e.prototype._encodeStr=function(n,i){if(i==="bitstr")return this._createEncoderBuffer([0|n.unused,n.data]);if(i==="bmpstr"){const u=o.alloc(2*n.length);for(let h=0;h=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,40*n[0]+n[1])}let h=0;for(let f=0;f=128;v>>=7)h++}const c=o.alloc(h);let d=c.length-1;for(let f=n.length-1;f>=0;f--){let v=n[f];for(c[d--]=127&v;(v>>=7)>0;)c[d--]=128|127&v}return this._createEncoderBuffer(c)},e.prototype._encodeTime=function(n,i){let u;const h=new Date(n);return i==="gentime"?u=[l(h.getUTCFullYear()),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):i==="utctime"?u=[l(h.getUTCFullYear()%100),l(h.getUTCMonth()+1),l(h.getUTCDate()),l(h.getUTCHours()),l(h.getUTCMinutes()),l(h.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+i+" time is not supported yet"),this._encodeStr(u,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(n,i){if(typeof n=="string"){if(!i)return this.reporter.error("String int or enum given, but no values map");if(!i.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=i[n]}if(typeof n!="number"&&!o.isBuffer(n)){const c=n.toArray();!n.sign&&128&c[0]&&c.unshift(0),n=o.from(c)}if(o.isBuffer(n)){let c=n.length;n.length===0&&c++;const d=o.alloc(c);return n.copy(d),n.length===0&&(d[0]=0),this._createEncoderBuffer(d)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);let u=1;for(let c=n;c>=256;c>>=8)u++;const h=new Array(u);for(let c=h.length-1;c>=0;c--)h[c]=255&n,n>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(o.from(h))},e.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},e.prototype._use=function(n,i){return typeof n=="function"&&(n=n(i)),n._getEncoder("der").tree},e.prototype._skipDefault=function(n,i,u){const h=this._baseState;let c;if(h.default===null)return!1;const d=n.join();if(h.defaultBuffer===void 0&&(h.defaultBuffer=this._encodeValue(h.default,i,u).join()),d.length!==h.defaultBuffer.length)return!1;for(c=0;c=65&&w<=70?w-55:w>=97&&w<=102?w-87:w-48&15}function n(k,C,w){var m=l(k,w);return w-1>=C&&(m|=l(k,w-1)<<4),m}function i(k,C,w,m){for(var b=0,g=Math.min(k.length,w),y=C;y=49?S-49+10:S>=17?S-17+10:S}return b}t.isBN=function(k){return k instanceof t||k!==null&&typeof k=="object"&&k.constructor.wordSize===t.wordSize&&Array.isArray(k.words)},t.max=function(k,C){return k.cmp(C)>0?k:C},t.min=function(k,C){return k.cmp(C)<0?k:C},t.prototype._init=function(k,C,w){if(typeof k=="number")return this._initNumber(k,C,w);if(typeof k=="object")return this._initArray(k,C,w);C==="hex"&&(C=16),a(C===(0|C)&&C>=2&&C<=36);var m=0;(k=k.toString().replace(/\s+/g,""))[0]==="-"&&(m++,this.negative=1),m=0;m-=3)g=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(w==="le")for(m=0,b=0;m>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(k,C,w){this.length=Math.ceil((k.length-C)/6),this.words=new Array(this.length);for(var m=0;m=C;m-=2)b=n(k,C,m)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(m=(k.length-C)%2==0?C+1:C;m=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(k,C,w){this.words=[0],this.length=1;for(var m=0,b=1;b<=67108863;b*=C)m++;m--,b=b/C|0;for(var g=k.length-w,y=g%m,S=Math.min(g,g-y)+w,R=0,N=w;N1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(k,C,w){w.negative=C.negative^k.negative;var m=k.length+C.length|0;w.length=m,m=m-1|0;var b=0|k.words[0],g=0|C.words[0],y=b*g,S=67108863&y,R=y/67108864|0;w.words[0]=S;for(var N=1;N>>26,H=67108863&R,q=Math.min(N,C.length-1),O=Math.max(0,N-k.length+1);O<=q;O++){var $=N-O|0;z+=(y=(b=0|k.words[$])*(g=0|C.words[O])+H)/67108864|0,H=67108863&y}w.words[N]=0|H,R=0|z}return R!==0?w.words[N]=0|R:w.length--,w.strip()}t.prototype.toString=function(k,C){var w;if(C=0|C||1,(k=k||10)===16||k==="hex"){w="";for(var m=0,b=0,g=0;g>>24-m&16777215)!==0||g!==this.length-1?u[6-S.length]+S+w:S+w,(m+=2)>=26&&(m-=26,g--)}for(b!==0&&(w=b.toString(16)+w);w.length%C!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(k===(0|k)&&k>=2&&k<=36){var R=h[k],N=c[k];w="";var z=this.clone();for(z.negative=0;!z.isZero();){var H=z.modn(N).toString(k);w=(z=z.idivn(N)).isZero()?H+w:u[R-H.length]+H+w}for(this.isZero()&&(w="0"+w);w.length%C!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=67108864*this.words[1]:this.length===3&&this.words[2]===1?k+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(k,C){return a(e!==void 0),this.toArrayLike(e,k,C)},t.prototype.toArray=function(k,C){return this.toArrayLike(Array,k,C)},t.prototype.toArrayLike=function(k,C,w){var m=this.byteLength(),b=w||Math.max(1,m);a(m<=b,"byte array longer than desired length"),a(b>0,"Requested array length <= 0"),this.strip();var g,y,S=C==="le",R=new k(b),N=this.clone();if(S){for(y=0;!N.isZero();y++)g=N.andln(255),N.iushrn(8),R[y]=g;for(;y=4096&&(w+=13,C>>>=13),C>=64&&(w+=7,C>>>=7),C>=8&&(w+=4,C>>>=4),C>=2&&(w+=2,C>>>=2),w+C},t.prototype._zeroBits=function(k){if(k===0)return 26;var C=k,w=0;return!(8191&C)&&(w+=13,C>>>=13),!(127&C)&&(w+=7,C>>>=7),!(15&C)&&(w+=4,C>>>=4),!(3&C)&&(w+=2,C>>>=2),!(1&C)&&w++,w},t.prototype.bitLength=function(){var k=this.words[this.length-1],C=this._countBits(k);return 26*(this.length-1)+C},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,C=0;Ck.length?this.clone().ior(k):k.clone().ior(this)},t.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},t.prototype.iuand=function(k){var C;C=this.length>k.length?k:this;for(var w=0;wk.length?this.clone().iand(k):k.clone().iand(this)},t.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},t.prototype.iuxor=function(k){var C,w;this.length>k.length?(C=this,w=k):(C=k,w=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},t.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},t.prototype.inotn=function(k){a(typeof k=="number"&&k>=0);var C=0|Math.ceil(k/26),w=k%26;this._expand(C),w>0&&C--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-w),this.strip()},t.prototype.notn=function(k){return this.clone().inotn(k)},t.prototype.setn=function(k,C){a(typeof k=="number"&&k>=0);var w=k/26|0,m=k%26;return this._expand(w+1),this.words[w]=C?this.words[w]|1<k.length?(w=this,m=k):(w=k,m=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=w.length,b!==0)this.words[this.length]=b,this.length++;else if(w!==this)for(;gk.length?this.clone().iadd(k):k.clone().iadd(this)},t.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var C=this.iadd(k);return k.negative=1,C._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var w,m,b=this.cmp(k);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(w=this,m=k):(w=k,m=this);for(var g=0,y=0;y>26,this.words[y]=67108863&C;for(;g!==0&&y>26,this.words[y]=67108863&C;if(g===0&&y>>13,O=0|y[1],$=8191&O,E=O>>>13,M=0|y[2],L=8191&M,V=M>>>13,K=0|y[3],W=8191&K,Z=K>>>13,tt=0|y[4],rt=8191&tt,X=tt>>>13,Q=0|y[5],J=8191&Q,st=Q>>>13,it=0|y[6],at=8191&it,ct=it>>>13,ut=0|y[7],dt=8191&ut,xt=ut>>>13,_t=0|y[8],yt=8191&_t,Rt=_t>>>13,Et=0|y[9],At=8191&Et,jt=Et>>>13,kt=0|S[0],mt=8191&kt,St=kt>>>13,Ct=0|S[1],Tt=8191&Ct,Zt=Ct>>>13,ne=0|S[2],It=8191&ne,te=ne>>>13,Xt=0|S[3],Ut=8191&Xt,le=Xt>>>13,ee=0|S[4],Dt=8191&ee,Gt=ee>>>13,oe=0|S[5],Ft=8191&oe,re=oe>>>13,ae=0|S[6],$t=8191&ae,et=ae>>>13,ot=0|S[7],ht=8191&ot,vt=ot>>>13,Nt=0|S[8],wt=8191&Nt,Lt=Nt>>>13,Pt=0|S[9],Ot=8191&Pt,Ht=Pt>>>13;w.negative=k.negative^C.negative,w.length=19;var zt=(N+(m=Math.imul(H,mt))|0)+((8191&(b=(b=Math.imul(H,St))+Math.imul(q,mt)|0))<<13)|0;N=((g=Math.imul(q,St))+(b>>>13)|0)+(zt>>>26)|0,zt&=67108863,m=Math.imul($,mt),b=(b=Math.imul($,St))+Math.imul(E,mt)|0,g=Math.imul(E,St);var Wt=(N+(m=m+Math.imul(H,Tt)|0)|0)+((8191&(b=(b=b+Math.imul(H,Zt)|0)+Math.imul(q,Tt)|0))<<13)|0;N=((g=g+Math.imul(q,Zt)|0)+(b>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,m=Math.imul(L,mt),b=(b=Math.imul(L,St))+Math.imul(V,mt)|0,g=Math.imul(V,St),m=m+Math.imul($,Tt)|0,b=(b=b+Math.imul($,Zt)|0)+Math.imul(E,Tt)|0,g=g+Math.imul(E,Zt)|0;var fe=(N+(m=m+Math.imul(H,It)|0)|0)+((8191&(b=(b=b+Math.imul(H,te)|0)+Math.imul(q,It)|0))<<13)|0;N=((g=g+Math.imul(q,te)|0)+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,m=Math.imul(W,mt),b=(b=Math.imul(W,St))+Math.imul(Z,mt)|0,g=Math.imul(Z,St),m=m+Math.imul(L,Tt)|0,b=(b=b+Math.imul(L,Zt)|0)+Math.imul(V,Tt)|0,g=g+Math.imul(V,Zt)|0,m=m+Math.imul($,It)|0,b=(b=b+Math.imul($,te)|0)+Math.imul(E,It)|0,g=g+Math.imul(E,te)|0;var ce=(N+(m=m+Math.imul(H,Ut)|0)|0)+((8191&(b=(b=b+Math.imul(H,le)|0)+Math.imul(q,Ut)|0))<<13)|0;N=((g=g+Math.imul(q,le)|0)+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,m=Math.imul(rt,mt),b=(b=Math.imul(rt,St))+Math.imul(X,mt)|0,g=Math.imul(X,St),m=m+Math.imul(W,Tt)|0,b=(b=b+Math.imul(W,Zt)|0)+Math.imul(Z,Tt)|0,g=g+Math.imul(Z,Zt)|0,m=m+Math.imul(L,It)|0,b=(b=b+Math.imul(L,te)|0)+Math.imul(V,It)|0,g=g+Math.imul(V,te)|0,m=m+Math.imul($,Ut)|0,b=(b=b+Math.imul($,le)|0)+Math.imul(E,Ut)|0,g=g+Math.imul(E,le)|0;var pe=(N+(m=m+Math.imul(H,Dt)|0)|0)+((8191&(b=(b=b+Math.imul(H,Gt)|0)+Math.imul(q,Dt)|0))<<13)|0;N=((g=g+Math.imul(q,Gt)|0)+(b>>>13)|0)+(pe>>>26)|0,pe&=67108863,m=Math.imul(J,mt),b=(b=Math.imul(J,St))+Math.imul(st,mt)|0,g=Math.imul(st,St),m=m+Math.imul(rt,Tt)|0,b=(b=b+Math.imul(rt,Zt)|0)+Math.imul(X,Tt)|0,g=g+Math.imul(X,Zt)|0,m=m+Math.imul(W,It)|0,b=(b=b+Math.imul(W,te)|0)+Math.imul(Z,It)|0,g=g+Math.imul(Z,te)|0,m=m+Math.imul(L,Ut)|0,b=(b=b+Math.imul(L,le)|0)+Math.imul(V,Ut)|0,g=g+Math.imul(V,le)|0,m=m+Math.imul($,Dt)|0,b=(b=b+Math.imul($,Gt)|0)+Math.imul(E,Dt)|0,g=g+Math.imul(E,Gt)|0;var me=(N+(m=m+Math.imul(H,Ft)|0)|0)+((8191&(b=(b=b+Math.imul(H,re)|0)+Math.imul(q,Ft)|0))<<13)|0;N=((g=g+Math.imul(q,re)|0)+(b>>>13)|0)+(me>>>26)|0,me&=67108863,m=Math.imul(at,mt),b=(b=Math.imul(at,St))+Math.imul(ct,mt)|0,g=Math.imul(ct,St),m=m+Math.imul(J,Tt)|0,b=(b=b+Math.imul(J,Zt)|0)+Math.imul(st,Tt)|0,g=g+Math.imul(st,Zt)|0,m=m+Math.imul(rt,It)|0,b=(b=b+Math.imul(rt,te)|0)+Math.imul(X,It)|0,g=g+Math.imul(X,te)|0,m=m+Math.imul(W,Ut)|0,b=(b=b+Math.imul(W,le)|0)+Math.imul(Z,Ut)|0,g=g+Math.imul(Z,le)|0,m=m+Math.imul(L,Dt)|0,b=(b=b+Math.imul(L,Gt)|0)+Math.imul(V,Dt)|0,g=g+Math.imul(V,Gt)|0,m=m+Math.imul($,Ft)|0,b=(b=b+Math.imul($,re)|0)+Math.imul(E,Ft)|0,g=g+Math.imul(E,re)|0;var ge=(N+(m=m+Math.imul(H,$t)|0)|0)+((8191&(b=(b=b+Math.imul(H,et)|0)+Math.imul(q,$t)|0))<<13)|0;N=((g=g+Math.imul(q,et)|0)+(b>>>13)|0)+(ge>>>26)|0,ge&=67108863,m=Math.imul(dt,mt),b=(b=Math.imul(dt,St))+Math.imul(xt,mt)|0,g=Math.imul(xt,St),m=m+Math.imul(at,Tt)|0,b=(b=b+Math.imul(at,Zt)|0)+Math.imul(ct,Tt)|0,g=g+Math.imul(ct,Zt)|0,m=m+Math.imul(J,It)|0,b=(b=b+Math.imul(J,te)|0)+Math.imul(st,It)|0,g=g+Math.imul(st,te)|0,m=m+Math.imul(rt,Ut)|0,b=(b=b+Math.imul(rt,le)|0)+Math.imul(X,Ut)|0,g=g+Math.imul(X,le)|0,m=m+Math.imul(W,Dt)|0,b=(b=b+Math.imul(W,Gt)|0)+Math.imul(Z,Dt)|0,g=g+Math.imul(Z,Gt)|0,m=m+Math.imul(L,Ft)|0,b=(b=b+Math.imul(L,re)|0)+Math.imul(V,Ft)|0,g=g+Math.imul(V,re)|0,m=m+Math.imul($,$t)|0,b=(b=b+Math.imul($,et)|0)+Math.imul(E,$t)|0,g=g+Math.imul(E,et)|0;var Y=(N+(m=m+Math.imul(H,ht)|0)|0)+((8191&(b=(b=b+Math.imul(H,vt)|0)+Math.imul(q,ht)|0))<<13)|0;N=((g=g+Math.imul(q,vt)|0)+(b>>>13)|0)+(Y>>>26)|0,Y&=67108863,m=Math.imul(yt,mt),b=(b=Math.imul(yt,St))+Math.imul(Rt,mt)|0,g=Math.imul(Rt,St),m=m+Math.imul(dt,Tt)|0,b=(b=b+Math.imul(dt,Zt)|0)+Math.imul(xt,Tt)|0,g=g+Math.imul(xt,Zt)|0,m=m+Math.imul(at,It)|0,b=(b=b+Math.imul(at,te)|0)+Math.imul(ct,It)|0,g=g+Math.imul(ct,te)|0,m=m+Math.imul(J,Ut)|0,b=(b=b+Math.imul(J,le)|0)+Math.imul(st,Ut)|0,g=g+Math.imul(st,le)|0,m=m+Math.imul(rt,Dt)|0,b=(b=b+Math.imul(rt,Gt)|0)+Math.imul(X,Dt)|0,g=g+Math.imul(X,Gt)|0,m=m+Math.imul(W,Ft)|0,b=(b=b+Math.imul(W,re)|0)+Math.imul(Z,Ft)|0,g=g+Math.imul(Z,re)|0,m=m+Math.imul(L,$t)|0,b=(b=b+Math.imul(L,et)|0)+Math.imul(V,$t)|0,g=g+Math.imul(V,et)|0,m=m+Math.imul($,ht)|0,b=(b=b+Math.imul($,vt)|0)+Math.imul(E,ht)|0,g=g+Math.imul(E,vt)|0;var lt=(N+(m=m+Math.imul(H,wt)|0)|0)+((8191&(b=(b=b+Math.imul(H,Lt)|0)+Math.imul(q,wt)|0))<<13)|0;N=((g=g+Math.imul(q,Lt)|0)+(b>>>13)|0)+(lt>>>26)|0,lt&=67108863,m=Math.imul(At,mt),b=(b=Math.imul(At,St))+Math.imul(jt,mt)|0,g=Math.imul(jt,St),m=m+Math.imul(yt,Tt)|0,b=(b=b+Math.imul(yt,Zt)|0)+Math.imul(Rt,Tt)|0,g=g+Math.imul(Rt,Zt)|0,m=m+Math.imul(dt,It)|0,b=(b=b+Math.imul(dt,te)|0)+Math.imul(xt,It)|0,g=g+Math.imul(xt,te)|0,m=m+Math.imul(at,Ut)|0,b=(b=b+Math.imul(at,le)|0)+Math.imul(ct,Ut)|0,g=g+Math.imul(ct,le)|0,m=m+Math.imul(J,Dt)|0,b=(b=b+Math.imul(J,Gt)|0)+Math.imul(st,Dt)|0,g=g+Math.imul(st,Gt)|0,m=m+Math.imul(rt,Ft)|0,b=(b=b+Math.imul(rt,re)|0)+Math.imul(X,Ft)|0,g=g+Math.imul(X,re)|0,m=m+Math.imul(W,$t)|0,b=(b=b+Math.imul(W,et)|0)+Math.imul(Z,$t)|0,g=g+Math.imul(Z,et)|0,m=m+Math.imul(L,ht)|0,b=(b=b+Math.imul(L,vt)|0)+Math.imul(V,ht)|0,g=g+Math.imul(V,vt)|0,m=m+Math.imul($,wt)|0,b=(b=b+Math.imul($,Lt)|0)+Math.imul(E,wt)|0,g=g+Math.imul(E,Lt)|0;var ft=(N+(m=m+Math.imul(H,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(H,Ht)|0)+Math.imul(q,Ot)|0))<<13)|0;N=((g=g+Math.imul(q,Ht)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,m=Math.imul(At,Tt),b=(b=Math.imul(At,Zt))+Math.imul(jt,Tt)|0,g=Math.imul(jt,Zt),m=m+Math.imul(yt,It)|0,b=(b=b+Math.imul(yt,te)|0)+Math.imul(Rt,It)|0,g=g+Math.imul(Rt,te)|0,m=m+Math.imul(dt,Ut)|0,b=(b=b+Math.imul(dt,le)|0)+Math.imul(xt,Ut)|0,g=g+Math.imul(xt,le)|0,m=m+Math.imul(at,Dt)|0,b=(b=b+Math.imul(at,Gt)|0)+Math.imul(ct,Dt)|0,g=g+Math.imul(ct,Gt)|0,m=m+Math.imul(J,Ft)|0,b=(b=b+Math.imul(J,re)|0)+Math.imul(st,Ft)|0,g=g+Math.imul(st,re)|0,m=m+Math.imul(rt,$t)|0,b=(b=b+Math.imul(rt,et)|0)+Math.imul(X,$t)|0,g=g+Math.imul(X,et)|0,m=m+Math.imul(W,ht)|0,b=(b=b+Math.imul(W,vt)|0)+Math.imul(Z,ht)|0,g=g+Math.imul(Z,vt)|0,m=m+Math.imul(L,wt)|0,b=(b=b+Math.imul(L,Lt)|0)+Math.imul(V,wt)|0,g=g+Math.imul(V,Lt)|0;var pt=(N+(m=m+Math.imul($,Ot)|0)|0)+((8191&(b=(b=b+Math.imul($,Ht)|0)+Math.imul(E,Ot)|0))<<13)|0;N=((g=g+Math.imul(E,Ht)|0)+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,m=Math.imul(At,It),b=(b=Math.imul(At,te))+Math.imul(jt,It)|0,g=Math.imul(jt,te),m=m+Math.imul(yt,Ut)|0,b=(b=b+Math.imul(yt,le)|0)+Math.imul(Rt,Ut)|0,g=g+Math.imul(Rt,le)|0,m=m+Math.imul(dt,Dt)|0,b=(b=b+Math.imul(dt,Gt)|0)+Math.imul(xt,Dt)|0,g=g+Math.imul(xt,Gt)|0,m=m+Math.imul(at,Ft)|0,b=(b=b+Math.imul(at,re)|0)+Math.imul(ct,Ft)|0,g=g+Math.imul(ct,re)|0,m=m+Math.imul(J,$t)|0,b=(b=b+Math.imul(J,et)|0)+Math.imul(st,$t)|0,g=g+Math.imul(st,et)|0,m=m+Math.imul(rt,ht)|0,b=(b=b+Math.imul(rt,vt)|0)+Math.imul(X,ht)|0,g=g+Math.imul(X,vt)|0,m=m+Math.imul(W,wt)|0,b=(b=b+Math.imul(W,Lt)|0)+Math.imul(Z,wt)|0,g=g+Math.imul(Z,Lt)|0;var Mt=(N+(m=m+Math.imul(L,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(L,Ht)|0)+Math.imul(V,Ot)|0))<<13)|0;N=((g=g+Math.imul(V,Ht)|0)+(b>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,m=Math.imul(At,Ut),b=(b=Math.imul(At,le))+Math.imul(jt,Ut)|0,g=Math.imul(jt,le),m=m+Math.imul(yt,Dt)|0,b=(b=b+Math.imul(yt,Gt)|0)+Math.imul(Rt,Dt)|0,g=g+Math.imul(Rt,Gt)|0,m=m+Math.imul(dt,Ft)|0,b=(b=b+Math.imul(dt,re)|0)+Math.imul(xt,Ft)|0,g=g+Math.imul(xt,re)|0,m=m+Math.imul(at,$t)|0,b=(b=b+Math.imul(at,et)|0)+Math.imul(ct,$t)|0,g=g+Math.imul(ct,et)|0,m=m+Math.imul(J,ht)|0,b=(b=b+Math.imul(J,vt)|0)+Math.imul(st,ht)|0,g=g+Math.imul(st,vt)|0,m=m+Math.imul(rt,wt)|0,b=(b=b+Math.imul(rt,Lt)|0)+Math.imul(X,wt)|0,g=g+Math.imul(X,Lt)|0;var bt=(N+(m=m+Math.imul(W,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(W,Ht)|0)+Math.imul(Z,Ot)|0))<<13)|0;N=((g=g+Math.imul(Z,Ht)|0)+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,m=Math.imul(At,Dt),b=(b=Math.imul(At,Gt))+Math.imul(jt,Dt)|0,g=Math.imul(jt,Gt),m=m+Math.imul(yt,Ft)|0,b=(b=b+Math.imul(yt,re)|0)+Math.imul(Rt,Ft)|0,g=g+Math.imul(Rt,re)|0,m=m+Math.imul(dt,$t)|0,b=(b=b+Math.imul(dt,et)|0)+Math.imul(xt,$t)|0,g=g+Math.imul(xt,et)|0,m=m+Math.imul(at,ht)|0,b=(b=b+Math.imul(at,vt)|0)+Math.imul(ct,ht)|0,g=g+Math.imul(ct,vt)|0,m=m+Math.imul(J,wt)|0,b=(b=b+Math.imul(J,Lt)|0)+Math.imul(st,wt)|0,g=g+Math.imul(st,Lt)|0;var gt=(N+(m=m+Math.imul(rt,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(rt,Ht)|0)+Math.imul(X,Ot)|0))<<13)|0;N=((g=g+Math.imul(X,Ht)|0)+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,m=Math.imul(At,Ft),b=(b=Math.imul(At,re))+Math.imul(jt,Ft)|0,g=Math.imul(jt,re),m=m+Math.imul(yt,$t)|0,b=(b=b+Math.imul(yt,et)|0)+Math.imul(Rt,$t)|0,g=g+Math.imul(Rt,et)|0,m=m+Math.imul(dt,ht)|0,b=(b=b+Math.imul(dt,vt)|0)+Math.imul(xt,ht)|0,g=g+Math.imul(xt,vt)|0,m=m+Math.imul(at,wt)|0,b=(b=b+Math.imul(at,Lt)|0)+Math.imul(ct,wt)|0,g=g+Math.imul(ct,Lt)|0;var Kt=(N+(m=m+Math.imul(J,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(J,Ht)|0)+Math.imul(st,Ot)|0))<<13)|0;N=((g=g+Math.imul(st,Ht)|0)+(b>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,m=Math.imul(At,$t),b=(b=Math.imul(At,et))+Math.imul(jt,$t)|0,g=Math.imul(jt,et),m=m+Math.imul(yt,ht)|0,b=(b=b+Math.imul(yt,vt)|0)+Math.imul(Rt,ht)|0,g=g+Math.imul(Rt,vt)|0,m=m+Math.imul(dt,wt)|0,b=(b=b+Math.imul(dt,Lt)|0)+Math.imul(xt,wt)|0,g=g+Math.imul(xt,Lt)|0;var qt=(N+(m=m+Math.imul(at,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(at,Ht)|0)+Math.imul(ct,Ot)|0))<<13)|0;N=((g=g+Math.imul(ct,Ht)|0)+(b>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(At,ht),b=(b=Math.imul(At,vt))+Math.imul(jt,ht)|0,g=Math.imul(jt,vt),m=m+Math.imul(yt,wt)|0,b=(b=b+Math.imul(yt,Lt)|0)+Math.imul(Rt,wt)|0,g=g+Math.imul(Rt,Lt)|0;var Vt=(N+(m=m+Math.imul(dt,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(dt,Ht)|0)+Math.imul(xt,Ot)|0))<<13)|0;N=((g=g+Math.imul(xt,Ht)|0)+(b>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,m=Math.imul(At,wt),b=(b=Math.imul(At,Lt))+Math.imul(jt,wt)|0,g=Math.imul(jt,Lt);var Bt=(N+(m=m+Math.imul(yt,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(yt,Ht)|0)+Math.imul(Rt,Ot)|0))<<13)|0;N=((g=g+Math.imul(Rt,Ht)|0)+(b>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var ie=(N+(m=Math.imul(At,Ot))|0)+((8191&(b=(b=Math.imul(At,Ht))+Math.imul(jt,Ot)|0))<<13)|0;return N=((g=Math.imul(jt,Ht))+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,R[0]=zt,R[1]=Wt,R[2]=fe,R[3]=ce,R[4]=pe,R[5]=me,R[6]=ge,R[7]=Y,R[8]=lt,R[9]=ft,R[10]=pt,R[11]=Mt,R[12]=bt,R[13]=gt,R[14]=Kt,R[15]=qt,R[16]=Vt,R[17]=Bt,R[18]=ie,N!==0&&(R[19]=N,w.length++),w};function v(k,C,w){return new x().mulp(k,C,w)}function x(k,C){this.x=k,this.y=C}Math.imul||(f=d),t.prototype.mulTo=function(k,C){var w=this.length+k.length;return this.length===10&&k.length===10?f(this,k,C):w<63?d(this,k,C):w<1024?function(m,b,g){g.negative=b.negative^m.negative,g.length=m.length+b.length;for(var y=0,S=0,R=0;R>>26)|0)>>>26,N&=67108863}g.words[R]=z,y=N,N=S}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,k,C):v(this,k,C)},x.prototype.makeRBT=function(k){for(var C=new Array(k),w=t.prototype._countBits(k)-1,m=0;m>=1;return m},x.prototype.permute=function(k,C,w,m,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,w[2*g+1]=8191&b,b>>>=13;for(g=2*C;g>=26,C+=m/67108864|0,C+=b>>>26,this.words[w]=67108863&b}return C!==0&&(this.words[w]=C,this.length++),this},t.prototype.muln=function(k){return this.clone().imuln(k)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(k){var C=function(g){for(var y=new Array(g.bitLength()),S=0;S>>N}return y}(k);if(C.length===0)return new t(1);for(var w=this,m=0;m=0);var C,w=k%26,m=(k-w)/26,b=67108863>>>26-w<<26-w;if(w!==0){var g=0;for(C=0;C>>26-w}g&&(this.words[C]=g,this.length++)}if(m!==0){for(C=this.length-1;C>=0;C--)this.words[C+m]=this.words[C];for(C=0;C=0),m=C?(C-C%26)/26:0;var b=k%26,g=Math.min((k-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(N!==0||R>=m);R--){var z=0|this.words[R];this.words[R]=N<<26-b|z>>>b,N=z&y}return S&&N!==0&&(S.words[S.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(k,C,w){return a(this.negative===0),this.iushrn(k,C,w)},t.prototype.shln=function(k){return this.clone().ishln(k)},t.prototype.ushln=function(k){return this.clone().iushln(k)},t.prototype.shrn=function(k){return this.clone().ishrn(k)},t.prototype.ushrn=function(k){return this.clone().iushrn(k)},t.prototype.testn=function(k){a(typeof k=="number"&&k>=0);var C=k%26,w=(k-C)/26,m=1<=0);var C=k%26,w=(k-C)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(C!==0&&w++,this.length=Math.min(w,this.length),C!==0){var m=67108863^67108863>>>C<=67108864;C++)this.words[C]-=67108864,C===this.length-1?this.words[C+1]=1:this.words[C+1]++;return this.length=Math.max(this.length,C+1),this},t.prototype.isubn=function(k){if(a(typeof k=="number"),a(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var C=0;C>26)-(S/67108864|0),this.words[m+w]=67108863&b}for(;m>26,this.words[m+w]=67108863&b;if(y===0)return this.strip();for(a(y===-1),y=0,m=0;m>26,this.words[m]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(k,C){var w=(this.length,k.length),m=this.clone(),b=k,g=0|b.words[b.length-1];(w=26-this._countBits(g))!==0&&(b=b.ushln(w),m.iushln(w),g=0|b.words[b.length-1]);var y,S=m.length-b.length;if(C!=="mod"){(y=new t(null)).length=S+1,y.words=new Array(y.length);for(var R=0;R=0;z--){var H=67108864*(0|m.words[b.length+z])+(0|m.words[b.length+z-1]);for(H=Math.min(H/g|0,67108863),m._ishlnsubmul(b,H,z);m.negative!==0;)H--,m.negative=0,m._ishlnsubmul(b,1,z),m.isZero()||(m.negative^=1);y&&(y.words[z]=H)}return y&&y.strip(),m.strip(),C!=="div"&&w!==0&&m.iushrn(w),{div:y||null,mod:m}},t.prototype.divmod=function(k,C,w){return a(!k.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&k.negative===0?(g=this.neg().divmod(k,C),C!=="mod"&&(m=g.div.neg()),C!=="div"&&(b=g.mod.neg(),w&&b.negative!==0&&b.iadd(k)),{div:m,mod:b}):this.negative===0&&k.negative!==0?(g=this.divmod(k.neg(),C),C!=="mod"&&(m=g.div.neg()),{div:m,mod:g.mod}):this.negative&k.negative?(g=this.neg().divmod(k.neg(),C),C!=="div"&&(b=g.mod.neg(),w&&b.negative!==0&&b.isub(k)),{div:g.div,mod:b}):k.length>this.length||this.cmp(k)<0?{div:new t(0),mod:this}:k.length===1?C==="div"?{div:this.divn(k.words[0]),mod:null}:C==="mod"?{div:null,mod:new t(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new t(this.modn(k.words[0]))}:this._wordDiv(k,C);var m,b,g},t.prototype.div=function(k){return this.divmod(k,"div",!1).div},t.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},t.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},t.prototype.divRound=function(k){var C=this.divmod(k);if(C.mod.isZero())return C.div;var w=C.div.negative!==0?C.mod.isub(k):C.mod,m=k.ushrn(1),b=k.andln(1),g=w.cmp(m);return g<0||b===1&&g===0?C.div:C.div.negative!==0?C.div.isubn(1):C.div.iaddn(1)},t.prototype.modn=function(k){a(k<=67108863);for(var C=(1<<26)%k,w=0,m=this.length-1;m>=0;m--)w=(C*w+(0|this.words[m]))%k;return w},t.prototype.idivn=function(k){a(k<=67108863);for(var C=0,w=this.length-1;w>=0;w--){var m=(0|this.words[w])+67108864*C;this.words[w]=m/k|0,C=m%k}return this.strip()},t.prototype.divn=function(k){return this.clone().idivn(k)},t.prototype.egcd=function(k){a(k.negative===0),a(!k.isZero());var C=this,w=k.clone();C=C.negative!==0?C.umod(k):C.clone();for(var m=new t(1),b=new t(0),g=new t(0),y=new t(1),S=0;C.isEven()&&w.isEven();)C.iushrn(1),w.iushrn(1),++S;for(var R=w.clone(),N=C.clone();!C.isZero();){for(var z=0,H=1;!(C.words[0]&H)&&z<26;++z,H<<=1);if(z>0)for(C.iushrn(z);z-- >0;)(m.isOdd()||b.isOdd())&&(m.iadd(R),b.isub(N)),m.iushrn(1),b.iushrn(1);for(var q=0,O=1;!(w.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(w.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(N)),g.iushrn(1),y.iushrn(1);C.cmp(w)>=0?(C.isub(w),m.isub(g),b.isub(y)):(w.isub(C),g.isub(m),y.isub(b))}return{a:g,b:y,gcd:w.iushln(S)}},t.prototype._invmp=function(k){a(k.negative===0),a(!k.isZero());var C=this,w=k.clone();C=C.negative!==0?C.umod(k):C.clone();for(var m,b=new t(1),g=new t(0),y=w.clone();C.cmpn(1)>0&&w.cmpn(1)>0;){for(var S=0,R=1;!(C.words[0]&R)&&S<26;++S,R<<=1);if(S>0)for(C.iushrn(S);S-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var N=0,z=1;!(w.words[0]&z)&&N<26;++N,z<<=1);if(N>0)for(w.iushrn(N);N-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);C.cmp(w)>=0?(C.isub(w),b.isub(g)):(w.isub(C),g.isub(b))}return(m=C.cmpn(1)===0?b:g).cmpn(0)<0&&m.iadd(k),m},t.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var C=this.clone(),w=k.clone();C.negative=0,w.negative=0;for(var m=0;C.isEven()&&w.isEven();m++)C.iushrn(1),w.iushrn(1);for(;;){for(;C.isEven();)C.iushrn(1);for(;w.isEven();)w.iushrn(1);var b=C.cmp(w);if(b<0){var g=C;C=w,w=g}else if(b===0||w.cmpn(1)===0)break;C.isub(w)}return w.iushln(m)},t.prototype.invm=function(k){return this.egcd(k).a.umod(k)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(k){return this.words[0]&k},t.prototype.bincn=function(k){a(typeof k=="number");var C=k%26,w=(k-C)/26,m=1<>>26,y&=67108863,this.words[g]=y}return b!==0&&(this.words[g]=b,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(k){var C,w=k<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;if(this.strip(),this.length>1)C=1;else{w&&(k=-k),a(k<=67108863,"Number is too big");var m=0|this.words[0];C=m===k?0:mk.length)return 1;if(this.length=0;w--){var m=0|this.words[w],b=0|k.words[w];if(m!==b){mb&&(C=1);break}}return C},t.prototype.gtn=function(k){return this.cmpn(k)===1},t.prototype.gt=function(k){return this.cmp(k)===1},t.prototype.gten=function(k){return this.cmpn(k)>=0},t.prototype.gte=function(k){return this.cmp(k)>=0},t.prototype.ltn=function(k){return this.cmpn(k)===-1},t.prototype.lt=function(k){return this.cmp(k)===-1},t.prototype.lten=function(k){return this.cmpn(k)<=0},t.prototype.lte=function(k){return this.cmp(k)<=0},t.prototype.eqn=function(k){return this.cmpn(k)===0},t.prototype.eq=function(k){return this.cmp(k)===0},t.red=function(k){return new U(k)},t.prototype.toRed=function(k){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(k){return this.red=k,this},t.prototype.forceRed=function(k){return a(!this.red,"Already a number in reduction context"),this._forceRed(k)},t.prototype.redAdd=function(k){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},t.prototype.redIAdd=function(k){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},t.prototype.redSub=function(k){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},t.prototype.redISub=function(k){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},t.prototype.redShl=function(k){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},t.prototype.redMul=function(k){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},t.prototype.redIMul=function(k){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(k){return a(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var A={k256:null,p224:null,p192:null,p25519:null};function I(k,C){this.name=k,this.p=new t(C,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function F(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function U(k){if(typeof k=="string"){var C=t._prime(k);this.m=C.p,this.prime=C}else a(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}function B(k){U.call(this,k),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var k=new t(null);return k.words=new Array(Math.ceil(this.n/13)),k},I.prototype.ireduce=function(k){var C,w=k;do this.split(w,this.tmp),C=(w=(w=this.imulK(w)).iadd(this.tmp)).bitLength();while(C>this.n);var m=C0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},I.prototype.split=function(k,C){k.iushrn(this.n,0,C)},I.prototype.imulK=function(k){return k.imul(this.k)},r(F,I),F.prototype.split=function(k,C){for(var w=Math.min(k.length,9),m=0;m>>22,b=g}b>>>=22,k.words[m-10]=b,b===0&&k.length>10?k.length-=10:k.length-=9},F.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var C=0,w=0;w>>=26,k.words[w]=b,C=m}return C!==0&&(k.words[k.length++]=C),k},t._prime=function(k){if(A[k])return A[k];var C;if(k==="k256")C=new F;else if(k==="p224")C=new j;else if(k==="p192")C=new P;else{if(k!=="p25519")throw new Error("Unknown prime "+k);C=new D}return A[k]=C,C},U.prototype._verify1=function(k){a(k.negative===0,"red works only with positives"),a(k.red,"red works only with red numbers")},U.prototype._verify2=function(k,C){a((k.negative|C.negative)==0,"red works only with positives"),a(k.red&&k.red===C.red,"red works only with red numbers")},U.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},U.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},U.prototype.add=function(k,C){this._verify2(k,C);var w=k.add(C);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},U.prototype.iadd=function(k,C){this._verify2(k,C);var w=k.iadd(C);return w.cmp(this.m)>=0&&w.isub(this.m),w},U.prototype.sub=function(k,C){this._verify2(k,C);var w=k.sub(C);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},U.prototype.isub=function(k,C){this._verify2(k,C);var w=k.isub(C);return w.cmpn(0)<0&&w.iadd(this.m),w},U.prototype.shl=function(k,C){return this._verify1(k),this.imod(k.ushln(C))},U.prototype.imul=function(k,C){return this._verify2(k,C),this.imod(k.imul(C))},U.prototype.mul=function(k,C){return this._verify2(k,C),this.imod(k.mul(C))},U.prototype.isqr=function(k){return this.imul(k,k.clone())},U.prototype.sqr=function(k){return this.mul(k,k)},U.prototype.sqrt=function(k){if(k.isZero())return k.clone();var C=this.m.andln(3);if(a(C%2==1),C===3){var w=this.m.add(new t(1)).iushrn(2);return this.pow(k,w)}for(var m=this.m.subn(1),b=0;!m.isZero()&&m.andln(1)===0;)b++,m.iushrn(1);a(!m.isZero());var g=new t(1).toRed(this),y=g.redNeg(),S=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new t(2*R*R).toRed(this);this.pow(R,S).cmp(y)!==0;)R.redIAdd(y);for(var N=this.pow(R,m),z=this.pow(k,m.addn(1).iushrn(1)),H=this.pow(k,m),q=b;H.cmp(g)!==0;){for(var O=H,$=0;O.cmp(g)!==0;$++)O=O.redSqr();a($=0;m--){for(var R=C.words[m],N=S-1;N>=0;N--){var z=R>>N&1;b!==w[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||m===0&&N===0)&&(b=this.mul(b,w[g]),y=0,g=0)):y=0}S=26}return b},U.prototype.convertTo=function(k){var C=k.umod(this.m);return C===k?C.clone():C},U.prototype.convertFrom=function(k){var C=k.clone();return C.red=null,C},t.mont=function(k){return new B(k)},r(B,U),B.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},B.prototype.convertFrom=function(k){var C=this.imod(k.mul(this.rinv));return C.red=null,C},B.prototype.imul=function(k,C){if(k.isZero()||C.isZero())return k.words[0]=0,k.length=1,k;var w=k.imul(C),m=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=w.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.mul=function(k,C){if(k.isZero()||C.isZero())return new t(0)._forceRed(this);var w=k.mul(C),m=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=w.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.invm=function(k){return this.imod(k._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],185:[function(s,T,_){_.byteLength=function(i){var u=l(i),h=u[0],c=u[1];return 3*(h+c)/4-c},_.toByteArray=function(i){var u,h,c=l(i),d=c[0],f=c[1],v=new a(function(I,F,j){return 3*(F+j)/4-j}(0,d,f)),x=0,A=f>0?d-4:d;for(h=0;h>16&255,v[x++]=u>>8&255,v[x++]=255&u;return f===2&&(u=o[i.charCodeAt(h)]<<2|o[i.charCodeAt(h+1)]>>4,v[x++]=255&u),f===1&&(u=o[i.charCodeAt(h)]<<10|o[i.charCodeAt(h+1)]<<4|o[i.charCodeAt(h+2)]>>2,v[x++]=u>>8&255,v[x++]=255&u),v},_.fromByteArray=function(i){for(var u,h=i.length,c=h%3,d=[],f=0,v=h-c;fv?v:f+16383));return c===1?(u=i[h-1],d.push(p[u>>2]+p[u<<4&63]+"==")):c===2&&(u=(i[h-2]<<8)+i[h-1],d.push(p[u>>10]+p[u>>4&63]+p[u<<2&63]+"=")),d.join("")};for(var p=[],o=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var h=i.indexOf("=");return h===-1&&(h=u),[h,h===u?0:4-h%4]}function n(i,u,h){for(var c,d,f=[],v=u;v>18&63]+p[d>>12&63]+p[d>>6&63]+p[63&d]);return f.join("")}o[45]=62,o[95]=63},{}],186:[function(s,T,_){(function(p,o){function a(w,m){if(!w)throw new Error(m||"Assertion failed")}function r(w,m){w.super_=m;var b=function(){};b.prototype=m.prototype,w.prototype=new b,w.prototype.constructor=w}function t(w,m,b){if(t.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&(m!=="le"&&m!=="be"||(b=m,m=10),this._init(w||0,m||10,b||"be"))}var e;typeof p=="object"?p.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{e=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch{}function l(w,m){var b=w.charCodeAt(m);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void a(!1,"Invalid character in "+w)}function n(w,m,b){var g=l(w,b);return b-1>=m&&(g|=l(w,b-1)<<4),g}function i(w,m,b,g){for(var y=0,S=0,R=Math.min(w.length,b),N=m;N=49?z-49+10:z>=17?z-17+10:z,a(z>=0&&S0?w:m},t.min=function(w,m){return w.cmp(m)<0?w:m},t.prototype._init=function(w,m,b){if(typeof w=="number")return this._initNumber(w,m,b);if(typeof w=="object")return this._initArray(w,m,b);m==="hex"&&(m=16),a(m===(0|m)&&m>=2&&m<=36);var g=0;(w=w.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)S=w[g]|w[g-1]<<8|w[g-2]<<16,this.words[y]|=S<>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);else if(b==="le")for(g=0,y=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);return this._strip()},t.prototype._parseHex=function(w,m,b){this.length=Math.ceil((w.length-m)/6),this.words=new Array(this.length);for(var g=0;g=m;g-=2)y=n(w,m,g)<=18?(S-=18,R+=1,this.words[R]|=y>>>26):S+=8;else for(g=(w.length-m)%2==0?m+1:m;g=18?(S-=18,R+=1,this.words[R]|=y>>>26):S+=8;this._strip()},t.prototype._parseBase=function(w,m,b){this.words=[0],this.length=1;for(var g=0,y=1;y<=67108863;y*=m)g++;g--,y=y/m|0;for(var S=w.length-b,R=S%g,N=Math.min(S,S-R)+b,z=0,H=b;H1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{t.prototype.inspect=h}else t.prototype.inspect=h;function h(){return(this.red?""}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(w,m){var b;if(m=0|m||1,(w=w||10)===16||w==="hex"){b="";for(var g=0,y=0,S=0;S>>24-g&16777215,(g+=2)>=26&&(g-=26,S--),b=y!==0||S!==this.length-1?c[6-N.length]+N+b:N+b}for(y!==0&&(b=y.toString(16)+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(w===(0|w)&&w>=2&&w<=36){var z=d[w],H=f[w];b="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modrn(H).toString(w);b=(q=q.idivn(H)).isZero()?O+b:c[z-O.length]+O+b}for(this.isZero()&&(b="0"+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=67108864*this.words[1]:this.length===3&&this.words[2]===1?w+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(w,m){return this.toArrayLike(e,w,m)}),t.prototype.toArray=function(w,m){return this.toArrayLike(Array,w,m)};function v(w,m,b){b.negative=m.negative^w.negative;var g=w.length+m.length|0;b.length=g,g=g-1|0;var y=0|w.words[0],S=0|m.words[0],R=y*S,N=67108863&R,z=R/67108864|0;b.words[0]=N;for(var H=1;H>>26,O=67108863&z,$=Math.min(H,m.length-1),E=Math.max(0,H-w.length+1);E<=$;E++){var M=H-E|0;q+=(R=(y=0|w.words[M])*(S=0|m.words[E])+O)/67108864|0,O=67108863&R}b.words[H]=0|O,z=0|q}return z!==0?b.words[H]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(w,m,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);a(g<=y,"byte array longer than desired length"),a(y>0,"Requested array length <= 0");var S=function(R,N){return R.allocUnsafe?R.allocUnsafe(N):new R(N)}(w,y);return this["_toArrayLike"+(m==="le"?"LE":"BE")](S,g),S},t.prototype._toArrayLikeLE=function(w,m){for(var b=0,g=0,y=0,S=0;y>8&255),b>16&255),S===6?(b>24&255),g=0,S=0):(g=R>>>24,S+=2)}if(b=0&&(w[b--]=R>>8&255),b>=0&&(w[b--]=R>>16&255),S===6?(b>=0&&(w[b--]=R>>24&255),g=0,S=0):(g=R>>>24,S+=2)}if(b>=0)for(w[b--]=g;b>=0;)w[b--]=0},Math.clz32?t.prototype._countBits=function(w){return 32-Math.clz32(w)}:t.prototype._countBits=function(w){var m=w,b=0;return m>=4096&&(b+=13,m>>>=13),m>=64&&(b+=7,m>>>=7),m>=8&&(b+=4,m>>>=4),m>=2&&(b+=2,m>>>=2),b+m},t.prototype._zeroBits=function(w){if(w===0)return 26;var m=w,b=0;return!(8191&m)&&(b+=13,m>>>=13),!(127&m)&&(b+=7,m>>>=7),!(15&m)&&(b+=4,m>>>=4),!(3&m)&&(b+=2,m>>>=2),!(1&m)&&b++,b},t.prototype.bitLength=function(){var w=this.words[this.length-1],m=this._countBits(w);return 26*(this.length-1)+m},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,m=0;mw.length?this.clone().ior(w):w.clone().ior(this)},t.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},t.prototype.iuand=function(w){var m;m=this.length>w.length?w:this;for(var b=0;bw.length?this.clone().iand(w):w.clone().iand(this)},t.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},t.prototype.iuxor=function(w){var m,b;this.length>w.length?(m=this,b=w):(m=w,b=this);for(var g=0;gw.length?this.clone().ixor(w):w.clone().ixor(this)},t.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},t.prototype.inotn=function(w){a(typeof w=="number"&&w>=0);var m=0|Math.ceil(w/26),b=w%26;this._expand(m),b>0&&m--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-b),this._strip()},t.prototype.notn=function(w){return this.clone().inotn(w)},t.prototype.setn=function(w,m){a(typeof w=="number"&&w>=0);var b=w/26|0,g=w%26;return this._expand(b+1),this.words[b]=m?this.words[b]|1<w.length?(b=this,g=w):(b=w,g=this);for(var y=0,S=0;S>>26;for(;y!==0&&S>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;Sw.length?this.clone().iadd(w):w.clone().iadd(this)},t.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var m=this.iadd(w);return w.negative=1,m._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var b,g,y=this.cmp(w);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=w):(b=w,g=this);for(var S=0,R=0;R>26,this.words[R]=67108863&m;for(;S!==0&&R>26,this.words[R]=67108863&m;if(S===0&&R>>13,E=0|R[1],M=8191&E,L=E>>>13,V=0|R[2],K=8191&V,W=V>>>13,Z=0|R[3],tt=8191&Z,rt=Z>>>13,X=0|R[4],Q=8191&X,J=X>>>13,st=0|R[5],it=8191&st,at=st>>>13,ct=0|R[6],ut=8191&ct,dt=ct>>>13,xt=0|R[7],_t=8191&xt,yt=xt>>>13,Rt=0|R[8],Et=8191&Rt,At=Rt>>>13,jt=0|R[9],kt=8191&jt,mt=jt>>>13,St=0|N[0],Ct=8191&St,Tt=St>>>13,Zt=0|N[1],ne=8191&Zt,It=Zt>>>13,te=0|N[2],Xt=8191&te,Ut=te>>>13,le=0|N[3],ee=8191&le,Dt=le>>>13,Gt=0|N[4],oe=8191&Gt,Ft=Gt>>>13,re=0|N[5],ae=8191&re,$t=re>>>13,et=0|N[6],ot=8191&et,ht=et>>>13,vt=0|N[7],Nt=8191&vt,wt=vt>>>13,Lt=0|N[8],Pt=8191&Lt,Ot=Lt>>>13,Ht=0|N[9],zt=8191&Ht,Wt=Ht>>>13;b.negative=w.negative^m.negative,b.length=19;var fe=(H+(g=Math.imul(O,Ct))|0)+((8191&(y=(y=Math.imul(O,Tt))+Math.imul($,Ct)|0))<<13)|0;H=((S=Math.imul($,Tt))+(y>>>13)|0)+(fe>>>26)|0,fe&=67108863,g=Math.imul(M,Ct),y=(y=Math.imul(M,Tt))+Math.imul(L,Ct)|0,S=Math.imul(L,Tt);var ce=(H+(g=g+Math.imul(O,ne)|0)|0)+((8191&(y=(y=y+Math.imul(O,It)|0)+Math.imul($,ne)|0))<<13)|0;H=((S=S+Math.imul($,It)|0)+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863,g=Math.imul(K,Ct),y=(y=Math.imul(K,Tt))+Math.imul(W,Ct)|0,S=Math.imul(W,Tt),g=g+Math.imul(M,ne)|0,y=(y=y+Math.imul(M,It)|0)+Math.imul(L,ne)|0,S=S+Math.imul(L,It)|0;var pe=(H+(g=g+Math.imul(O,Xt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ut)|0)+Math.imul($,Xt)|0))<<13)|0;H=((S=S+Math.imul($,Ut)|0)+(y>>>13)|0)+(pe>>>26)|0,pe&=67108863,g=Math.imul(tt,Ct),y=(y=Math.imul(tt,Tt))+Math.imul(rt,Ct)|0,S=Math.imul(rt,Tt),g=g+Math.imul(K,ne)|0,y=(y=y+Math.imul(K,It)|0)+Math.imul(W,ne)|0,S=S+Math.imul(W,It)|0,g=g+Math.imul(M,Xt)|0,y=(y=y+Math.imul(M,Ut)|0)+Math.imul(L,Xt)|0,S=S+Math.imul(L,Ut)|0;var me=(H+(g=g+Math.imul(O,ee)|0)|0)+((8191&(y=(y=y+Math.imul(O,Dt)|0)+Math.imul($,ee)|0))<<13)|0;H=((S=S+Math.imul($,Dt)|0)+(y>>>13)|0)+(me>>>26)|0,me&=67108863,g=Math.imul(Q,Ct),y=(y=Math.imul(Q,Tt))+Math.imul(J,Ct)|0,S=Math.imul(J,Tt),g=g+Math.imul(tt,ne)|0,y=(y=y+Math.imul(tt,It)|0)+Math.imul(rt,ne)|0,S=S+Math.imul(rt,It)|0,g=g+Math.imul(K,Xt)|0,y=(y=y+Math.imul(K,Ut)|0)+Math.imul(W,Xt)|0,S=S+Math.imul(W,Ut)|0,g=g+Math.imul(M,ee)|0,y=(y=y+Math.imul(M,Dt)|0)+Math.imul(L,ee)|0,S=S+Math.imul(L,Dt)|0;var ge=(H+(g=g+Math.imul(O,oe)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ft)|0)+Math.imul($,oe)|0))<<13)|0;H=((S=S+Math.imul($,Ft)|0)+(y>>>13)|0)+(ge>>>26)|0,ge&=67108863,g=Math.imul(it,Ct),y=(y=Math.imul(it,Tt))+Math.imul(at,Ct)|0,S=Math.imul(at,Tt),g=g+Math.imul(Q,ne)|0,y=(y=y+Math.imul(Q,It)|0)+Math.imul(J,ne)|0,S=S+Math.imul(J,It)|0,g=g+Math.imul(tt,Xt)|0,y=(y=y+Math.imul(tt,Ut)|0)+Math.imul(rt,Xt)|0,S=S+Math.imul(rt,Ut)|0,g=g+Math.imul(K,ee)|0,y=(y=y+Math.imul(K,Dt)|0)+Math.imul(W,ee)|0,S=S+Math.imul(W,Dt)|0,g=g+Math.imul(M,oe)|0,y=(y=y+Math.imul(M,Ft)|0)+Math.imul(L,oe)|0,S=S+Math.imul(L,Ft)|0;var Y=(H+(g=g+Math.imul(O,ae)|0)|0)+((8191&(y=(y=y+Math.imul(O,$t)|0)+Math.imul($,ae)|0))<<13)|0;H=((S=S+Math.imul($,$t)|0)+(y>>>13)|0)+(Y>>>26)|0,Y&=67108863,g=Math.imul(ut,Ct),y=(y=Math.imul(ut,Tt))+Math.imul(dt,Ct)|0,S=Math.imul(dt,Tt),g=g+Math.imul(it,ne)|0,y=(y=y+Math.imul(it,It)|0)+Math.imul(at,ne)|0,S=S+Math.imul(at,It)|0,g=g+Math.imul(Q,Xt)|0,y=(y=y+Math.imul(Q,Ut)|0)+Math.imul(J,Xt)|0,S=S+Math.imul(J,Ut)|0,g=g+Math.imul(tt,ee)|0,y=(y=y+Math.imul(tt,Dt)|0)+Math.imul(rt,ee)|0,S=S+Math.imul(rt,Dt)|0,g=g+Math.imul(K,oe)|0,y=(y=y+Math.imul(K,Ft)|0)+Math.imul(W,oe)|0,S=S+Math.imul(W,Ft)|0,g=g+Math.imul(M,ae)|0,y=(y=y+Math.imul(M,$t)|0)+Math.imul(L,ae)|0,S=S+Math.imul(L,$t)|0;var lt=(H+(g=g+Math.imul(O,ot)|0)|0)+((8191&(y=(y=y+Math.imul(O,ht)|0)+Math.imul($,ot)|0))<<13)|0;H=((S=S+Math.imul($,ht)|0)+(y>>>13)|0)+(lt>>>26)|0,lt&=67108863,g=Math.imul(_t,Ct),y=(y=Math.imul(_t,Tt))+Math.imul(yt,Ct)|0,S=Math.imul(yt,Tt),g=g+Math.imul(ut,ne)|0,y=(y=y+Math.imul(ut,It)|0)+Math.imul(dt,ne)|0,S=S+Math.imul(dt,It)|0,g=g+Math.imul(it,Xt)|0,y=(y=y+Math.imul(it,Ut)|0)+Math.imul(at,Xt)|0,S=S+Math.imul(at,Ut)|0,g=g+Math.imul(Q,ee)|0,y=(y=y+Math.imul(Q,Dt)|0)+Math.imul(J,ee)|0,S=S+Math.imul(J,Dt)|0,g=g+Math.imul(tt,oe)|0,y=(y=y+Math.imul(tt,Ft)|0)+Math.imul(rt,oe)|0,S=S+Math.imul(rt,Ft)|0,g=g+Math.imul(K,ae)|0,y=(y=y+Math.imul(K,$t)|0)+Math.imul(W,ae)|0,S=S+Math.imul(W,$t)|0,g=g+Math.imul(M,ot)|0,y=(y=y+Math.imul(M,ht)|0)+Math.imul(L,ot)|0,S=S+Math.imul(L,ht)|0;var ft=(H+(g=g+Math.imul(O,Nt)|0)|0)+((8191&(y=(y=y+Math.imul(O,wt)|0)+Math.imul($,Nt)|0))<<13)|0;H=((S=S+Math.imul($,wt)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,g=Math.imul(Et,Ct),y=(y=Math.imul(Et,Tt))+Math.imul(At,Ct)|0,S=Math.imul(At,Tt),g=g+Math.imul(_t,ne)|0,y=(y=y+Math.imul(_t,It)|0)+Math.imul(yt,ne)|0,S=S+Math.imul(yt,It)|0,g=g+Math.imul(ut,Xt)|0,y=(y=y+Math.imul(ut,Ut)|0)+Math.imul(dt,Xt)|0,S=S+Math.imul(dt,Ut)|0,g=g+Math.imul(it,ee)|0,y=(y=y+Math.imul(it,Dt)|0)+Math.imul(at,ee)|0,S=S+Math.imul(at,Dt)|0,g=g+Math.imul(Q,oe)|0,y=(y=y+Math.imul(Q,Ft)|0)+Math.imul(J,oe)|0,S=S+Math.imul(J,Ft)|0,g=g+Math.imul(tt,ae)|0,y=(y=y+Math.imul(tt,$t)|0)+Math.imul(rt,ae)|0,S=S+Math.imul(rt,$t)|0,g=g+Math.imul(K,ot)|0,y=(y=y+Math.imul(K,ht)|0)+Math.imul(W,ot)|0,S=S+Math.imul(W,ht)|0,g=g+Math.imul(M,Nt)|0,y=(y=y+Math.imul(M,wt)|0)+Math.imul(L,Nt)|0,S=S+Math.imul(L,wt)|0;var pt=(H+(g=g+Math.imul(O,Pt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ot)|0)+Math.imul($,Pt)|0))<<13)|0;H=((S=S+Math.imul($,Ot)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(kt,Ct),y=(y=Math.imul(kt,Tt))+Math.imul(mt,Ct)|0,S=Math.imul(mt,Tt),g=g+Math.imul(Et,ne)|0,y=(y=y+Math.imul(Et,It)|0)+Math.imul(At,ne)|0,S=S+Math.imul(At,It)|0,g=g+Math.imul(_t,Xt)|0,y=(y=y+Math.imul(_t,Ut)|0)+Math.imul(yt,Xt)|0,S=S+Math.imul(yt,Ut)|0,g=g+Math.imul(ut,ee)|0,y=(y=y+Math.imul(ut,Dt)|0)+Math.imul(dt,ee)|0,S=S+Math.imul(dt,Dt)|0,g=g+Math.imul(it,oe)|0,y=(y=y+Math.imul(it,Ft)|0)+Math.imul(at,oe)|0,S=S+Math.imul(at,Ft)|0,g=g+Math.imul(Q,ae)|0,y=(y=y+Math.imul(Q,$t)|0)+Math.imul(J,ae)|0,S=S+Math.imul(J,$t)|0,g=g+Math.imul(tt,ot)|0,y=(y=y+Math.imul(tt,ht)|0)+Math.imul(rt,ot)|0,S=S+Math.imul(rt,ht)|0,g=g+Math.imul(K,Nt)|0,y=(y=y+Math.imul(K,wt)|0)+Math.imul(W,Nt)|0,S=S+Math.imul(W,wt)|0,g=g+Math.imul(M,Pt)|0,y=(y=y+Math.imul(M,Ot)|0)+Math.imul(L,Pt)|0,S=S+Math.imul(L,Ot)|0;var Mt=(H+(g=g+Math.imul(O,zt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Wt)|0)+Math.imul($,zt)|0))<<13)|0;H=((S=S+Math.imul($,Wt)|0)+(y>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,g=Math.imul(kt,ne),y=(y=Math.imul(kt,It))+Math.imul(mt,ne)|0,S=Math.imul(mt,It),g=g+Math.imul(Et,Xt)|0,y=(y=y+Math.imul(Et,Ut)|0)+Math.imul(At,Xt)|0,S=S+Math.imul(At,Ut)|0,g=g+Math.imul(_t,ee)|0,y=(y=y+Math.imul(_t,Dt)|0)+Math.imul(yt,ee)|0,S=S+Math.imul(yt,Dt)|0,g=g+Math.imul(ut,oe)|0,y=(y=y+Math.imul(ut,Ft)|0)+Math.imul(dt,oe)|0,S=S+Math.imul(dt,Ft)|0,g=g+Math.imul(it,ae)|0,y=(y=y+Math.imul(it,$t)|0)+Math.imul(at,ae)|0,S=S+Math.imul(at,$t)|0,g=g+Math.imul(Q,ot)|0,y=(y=y+Math.imul(Q,ht)|0)+Math.imul(J,ot)|0,S=S+Math.imul(J,ht)|0,g=g+Math.imul(tt,Nt)|0,y=(y=y+Math.imul(tt,wt)|0)+Math.imul(rt,Nt)|0,S=S+Math.imul(rt,wt)|0,g=g+Math.imul(K,Pt)|0,y=(y=y+Math.imul(K,Ot)|0)+Math.imul(W,Pt)|0,S=S+Math.imul(W,Ot)|0;var bt=(H+(g=g+Math.imul(M,zt)|0)|0)+((8191&(y=(y=y+Math.imul(M,Wt)|0)+Math.imul(L,zt)|0))<<13)|0;H=((S=S+Math.imul(L,Wt)|0)+(y>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(kt,Xt),y=(y=Math.imul(kt,Ut))+Math.imul(mt,Xt)|0,S=Math.imul(mt,Ut),g=g+Math.imul(Et,ee)|0,y=(y=y+Math.imul(Et,Dt)|0)+Math.imul(At,ee)|0,S=S+Math.imul(At,Dt)|0,g=g+Math.imul(_t,oe)|0,y=(y=y+Math.imul(_t,Ft)|0)+Math.imul(yt,oe)|0,S=S+Math.imul(yt,Ft)|0,g=g+Math.imul(ut,ae)|0,y=(y=y+Math.imul(ut,$t)|0)+Math.imul(dt,ae)|0,S=S+Math.imul(dt,$t)|0,g=g+Math.imul(it,ot)|0,y=(y=y+Math.imul(it,ht)|0)+Math.imul(at,ot)|0,S=S+Math.imul(at,ht)|0,g=g+Math.imul(Q,Nt)|0,y=(y=y+Math.imul(Q,wt)|0)+Math.imul(J,Nt)|0,S=S+Math.imul(J,wt)|0,g=g+Math.imul(tt,Pt)|0,y=(y=y+Math.imul(tt,Ot)|0)+Math.imul(rt,Pt)|0,S=S+Math.imul(rt,Ot)|0;var gt=(H+(g=g+Math.imul(K,zt)|0)|0)+((8191&(y=(y=y+Math.imul(K,Wt)|0)+Math.imul(W,zt)|0))<<13)|0;H=((S=S+Math.imul(W,Wt)|0)+(y>>>13)|0)+(gt>>>26)|0,gt&=67108863,g=Math.imul(kt,ee),y=(y=Math.imul(kt,Dt))+Math.imul(mt,ee)|0,S=Math.imul(mt,Dt),g=g+Math.imul(Et,oe)|0,y=(y=y+Math.imul(Et,Ft)|0)+Math.imul(At,oe)|0,S=S+Math.imul(At,Ft)|0,g=g+Math.imul(_t,ae)|0,y=(y=y+Math.imul(_t,$t)|0)+Math.imul(yt,ae)|0,S=S+Math.imul(yt,$t)|0,g=g+Math.imul(ut,ot)|0,y=(y=y+Math.imul(ut,ht)|0)+Math.imul(dt,ot)|0,S=S+Math.imul(dt,ht)|0,g=g+Math.imul(it,Nt)|0,y=(y=y+Math.imul(it,wt)|0)+Math.imul(at,Nt)|0,S=S+Math.imul(at,wt)|0,g=g+Math.imul(Q,Pt)|0,y=(y=y+Math.imul(Q,Ot)|0)+Math.imul(J,Pt)|0,S=S+Math.imul(J,Ot)|0;var Kt=(H+(g=g+Math.imul(tt,zt)|0)|0)+((8191&(y=(y=y+Math.imul(tt,Wt)|0)+Math.imul(rt,zt)|0))<<13)|0;H=((S=S+Math.imul(rt,Wt)|0)+(y>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,g=Math.imul(kt,oe),y=(y=Math.imul(kt,Ft))+Math.imul(mt,oe)|0,S=Math.imul(mt,Ft),g=g+Math.imul(Et,ae)|0,y=(y=y+Math.imul(Et,$t)|0)+Math.imul(At,ae)|0,S=S+Math.imul(At,$t)|0,g=g+Math.imul(_t,ot)|0,y=(y=y+Math.imul(_t,ht)|0)+Math.imul(yt,ot)|0,S=S+Math.imul(yt,ht)|0,g=g+Math.imul(ut,Nt)|0,y=(y=y+Math.imul(ut,wt)|0)+Math.imul(dt,Nt)|0,S=S+Math.imul(dt,wt)|0,g=g+Math.imul(it,Pt)|0,y=(y=y+Math.imul(it,Ot)|0)+Math.imul(at,Pt)|0,S=S+Math.imul(at,Ot)|0;var qt=(H+(g=g+Math.imul(Q,zt)|0)|0)+((8191&(y=(y=y+Math.imul(Q,Wt)|0)+Math.imul(J,zt)|0))<<13)|0;H=((S=S+Math.imul(J,Wt)|0)+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,g=Math.imul(kt,ae),y=(y=Math.imul(kt,$t))+Math.imul(mt,ae)|0,S=Math.imul(mt,$t),g=g+Math.imul(Et,ot)|0,y=(y=y+Math.imul(Et,ht)|0)+Math.imul(At,ot)|0,S=S+Math.imul(At,ht)|0,g=g+Math.imul(_t,Nt)|0,y=(y=y+Math.imul(_t,wt)|0)+Math.imul(yt,Nt)|0,S=S+Math.imul(yt,wt)|0,g=g+Math.imul(ut,Pt)|0,y=(y=y+Math.imul(ut,Ot)|0)+Math.imul(dt,Pt)|0,S=S+Math.imul(dt,Ot)|0;var Vt=(H+(g=g+Math.imul(it,zt)|0)|0)+((8191&(y=(y=y+Math.imul(it,Wt)|0)+Math.imul(at,zt)|0))<<13)|0;H=((S=S+Math.imul(at,Wt)|0)+(y>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,g=Math.imul(kt,ot),y=(y=Math.imul(kt,ht))+Math.imul(mt,ot)|0,S=Math.imul(mt,ht),g=g+Math.imul(Et,Nt)|0,y=(y=y+Math.imul(Et,wt)|0)+Math.imul(At,Nt)|0,S=S+Math.imul(At,wt)|0,g=g+Math.imul(_t,Pt)|0,y=(y=y+Math.imul(_t,Ot)|0)+Math.imul(yt,Pt)|0,S=S+Math.imul(yt,Ot)|0;var Bt=(H+(g=g+Math.imul(ut,zt)|0)|0)+((8191&(y=(y=y+Math.imul(ut,Wt)|0)+Math.imul(dt,zt)|0))<<13)|0;H=((S=S+Math.imul(dt,Wt)|0)+(y>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(kt,Nt),y=(y=Math.imul(kt,wt))+Math.imul(mt,Nt)|0,S=Math.imul(mt,wt),g=g+Math.imul(Et,Pt)|0,y=(y=y+Math.imul(Et,Ot)|0)+Math.imul(At,Pt)|0,S=S+Math.imul(At,Ot)|0;var ie=(H+(g=g+Math.imul(_t,zt)|0)|0)+((8191&(y=(y=y+Math.imul(_t,Wt)|0)+Math.imul(yt,zt)|0))<<13)|0;H=((S=S+Math.imul(yt,Wt)|0)+(y>>>13)|0)+(ie>>>26)|0,ie&=67108863,g=Math.imul(kt,Pt),y=(y=Math.imul(kt,Ot))+Math.imul(mt,Pt)|0,S=Math.imul(mt,Ot);var ue=(H+(g=g+Math.imul(Et,zt)|0)|0)+((8191&(y=(y=y+Math.imul(Et,Wt)|0)+Math.imul(At,zt)|0))<<13)|0;H=((S=S+Math.imul(At,Wt)|0)+(y>>>13)|0)+(ue>>>26)|0,ue&=67108863;var Jt=(H+(g=Math.imul(kt,zt))|0)+((8191&(y=(y=Math.imul(kt,Wt))+Math.imul(mt,zt)|0))<<13)|0;return H=((S=Math.imul(mt,Wt))+(y>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,z[0]=fe,z[1]=ce,z[2]=pe,z[3]=me,z[4]=ge,z[5]=Y,z[6]=lt,z[7]=ft,z[8]=pt,z[9]=Mt,z[10]=bt,z[11]=gt,z[12]=Kt,z[13]=qt,z[14]=Vt,z[15]=Bt,z[16]=ie,z[17]=ue,z[18]=Jt,H!==0&&(z[19]=H,b.length++),b};function A(w,m,b){b.negative=m.negative^w.negative,b.length=w.length+m.length;for(var g=0,y=0,S=0;S>>26)|0)>>>26,R&=67108863}b.words[S]=N,g=R,R=y}return g!==0?b.words[S]=g:b.length--,b._strip()}function I(w,m,b){return A(w,m,b)}Math.imul||(x=v),t.prototype.mulTo=function(w,m){var b=this.length+w.length;return this.length===10&&w.length===10?x(this,w,m):b<63?v(this,w,m):b<1024?A(this,w,m):I(this,w,m)},t.prototype.mul=function(w){var m=new t(null);return m.words=new Array(this.length+w.length),this.mulTo(w,m)},t.prototype.mulf=function(w){var m=new t(null);return m.words=new Array(this.length+w.length),I(this,w,m)},t.prototype.imul=function(w){return this.clone().mulTo(w,this)},t.prototype.imuln=function(w){var m=w<0;m&&(w=-w),a(typeof w=="number"),a(w<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=S>>>26,this.words[g]=67108863&S}return b!==0&&(this.words[g]=b,this.length++),m?this.ineg():this},t.prototype.muln=function(w){return this.clone().imuln(w)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(w){var m=function(S){for(var R=new Array(S.bitLength()),N=0;N>>H&1}return R}(w);if(m.length===0)return new t(1);for(var b=this,g=0;g=0);var m,b=w%26,g=(w-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var S=0;for(m=0;m>>26-b}S&&(this.words[m]=S,this.length++)}if(g!==0){for(m=this.length-1;m>=0;m--)this.words[m+g]=this.words[m];for(m=0;m=0),g=m?(m-m%26)/26:0;var y=w%26,S=Math.min((w-y)/26,this.length),R=67108863^67108863>>>y<S)for(this.length-=S,z=0;z=0&&(H!==0||z>=g);z--){var q=0|this.words[z];this.words[z]=H<<26-y|q>>>y,H=q&R}return N&&H!==0&&(N.words[N.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(w,m,b){return a(this.negative===0),this.iushrn(w,m,b)},t.prototype.shln=function(w){return this.clone().ishln(w)},t.prototype.ushln=function(w){return this.clone().iushln(w)},t.prototype.shrn=function(w){return this.clone().ishrn(w)},t.prototype.ushrn=function(w){return this.clone().iushrn(w)},t.prototype.testn=function(w){a(typeof w=="number"&&w>=0);var m=w%26,b=(w-m)/26,g=1<=0);var m=w%26,b=(w-m)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(m!==0&&b++,this.length=Math.min(b,this.length),m!==0){var g=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},t.prototype.isubn=function(w){if(a(typeof w=="number"),a(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(N/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(a(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(w,m){var b=(this.length,w.length),g=this.clone(),y=w,S=0|y.words[y.length-1];(b=26-this._countBits(S))!==0&&(y=y.ushln(b),g.iushln(b),S=0|y.words[y.length-1]);var R,N=g.length-y.length;if(m!=="mod"){(R=new t(null)).length=N+1,R.words=new Array(R.length);for(var z=0;z=0;q--){var O=67108864*(0|g.words[y.length+q])+(0|g.words[y.length+q-1]);for(O=Math.min(O/S|0,67108863),g._ishlnsubmul(y,O,q);g.negative!==0;)O--,g.negative=0,g._ishlnsubmul(y,1,q),g.isZero()||(g.negative^=1);R&&(R.words[q]=O)}return R&&R._strip(),g._strip(),m!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(w,m,b){return a(!w.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&w.negative===0?(S=this.neg().divmod(w,m),m!=="mod"&&(g=S.div.neg()),m!=="div"&&(y=S.mod.neg(),b&&y.negative!==0&&y.iadd(w)),{div:g,mod:y}):this.negative===0&&w.negative!==0?(S=this.divmod(w.neg(),m),m!=="mod"&&(g=S.div.neg()),{div:g,mod:S.mod}):this.negative&w.negative?(S=this.neg().divmod(w.neg(),m),m!=="div"&&(y=S.mod.neg(),b&&y.negative!==0&&y.isub(w)),{div:S.div,mod:y}):w.length>this.length||this.cmp(w)<0?{div:new t(0),mod:this}:w.length===1?m==="div"?{div:this.divn(w.words[0]),mod:null}:m==="mod"?{div:null,mod:new t(this.modrn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new t(this.modrn(w.words[0]))}:this._wordDiv(w,m);var g,y,S},t.prototype.div=function(w){return this.divmod(w,"div",!1).div},t.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},t.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},t.prototype.divRound=function(w){var m=this.divmod(w);if(m.mod.isZero())return m.div;var b=m.div.negative!==0?m.mod.isub(w):m.mod,g=w.ushrn(1),y=w.andln(1),S=b.cmp(g);return S<0||y===1&&S===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},t.prototype.modrn=function(w){var m=w<0;m&&(w=-w),a(w<=67108863);for(var b=(1<<26)%w,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%w;return m?-g:g},t.prototype.modn=function(w){return this.modrn(w)},t.prototype.idivn=function(w){var m=w<0;m&&(w=-w),a(w<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/w|0,b=y%w}return this._strip(),m?this.ineg():this},t.prototype.divn=function(w){return this.clone().idivn(w)},t.prototype.egcd=function(w){a(w.negative===0),a(!w.isZero());var m=this,b=w.clone();m=m.negative!==0?m.umod(w):m.clone();for(var g=new t(1),y=new t(0),S=new t(0),R=new t(1),N=0;m.isEven()&&b.isEven();)m.iushrn(1),b.iushrn(1),++N;for(var z=b.clone(),H=m.clone();!m.isZero();){for(var q=0,O=1;!(m.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub(H)),g.iushrn(1),y.iushrn(1);for(var $=0,E=1;!(b.words[0]&E)&&$<26;++$,E<<=1);if($>0)for(b.iushrn($);$-- >0;)(S.isOdd()||R.isOdd())&&(S.iadd(z),R.isub(H)),S.iushrn(1),R.iushrn(1);m.cmp(b)>=0?(m.isub(b),g.isub(S),y.isub(R)):(b.isub(m),S.isub(g),R.isub(y))}return{a:S,b:R,gcd:b.iushln(N)}},t.prototype._invmp=function(w){a(w.negative===0),a(!w.isZero());var m=this,b=w.clone();m=m.negative!==0?m.umod(w):m.clone();for(var g,y=new t(1),S=new t(0),R=b.clone();m.cmpn(1)>0&&b.cmpn(1)>0;){for(var N=0,z=1;!(m.words[0]&z)&&N<26;++N,z<<=1);if(N>0)for(m.iushrn(N);N-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var H=0,q=1;!(b.words[0]&q)&&H<26;++H,q<<=1);if(H>0)for(b.iushrn(H);H-- >0;)S.isOdd()&&S.iadd(R),S.iushrn(1);m.cmp(b)>=0?(m.isub(b),y.isub(S)):(b.isub(m),S.isub(y))}return(g=m.cmpn(1)===0?y:S).cmpn(0)<0&&g.iadd(w),g},t.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var m=this.clone(),b=w.clone();m.negative=0,b.negative=0;for(var g=0;m.isEven()&&b.isEven();g++)m.iushrn(1),b.iushrn(1);for(;;){for(;m.isEven();)m.iushrn(1);for(;b.isEven();)b.iushrn(1);var y=m.cmp(b);if(y<0){var S=m;m=b,b=S}else if(y===0||b.cmpn(1)===0)break;m.isub(b)}return b.iushln(g)},t.prototype.invm=function(w){return this.egcd(w).a.umod(w)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(w){return this.words[0]&w},t.prototype.bincn=function(w){a(typeof w=="number");var m=w%26,b=(w-m)/26,g=1<>>26,R&=67108863,this.words[S]=R}return y!==0&&(this.words[S]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(w){var m,b=w<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;if(this._strip(),this.length>1)m=1;else{b&&(w=-w),a(w<=67108863,"Number is too big");var g=0|this.words[0];m=g===w?0:gw.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|w.words[b];if(g!==y){gy&&(m=1);break}}return m},t.prototype.gtn=function(w){return this.cmpn(w)===1},t.prototype.gt=function(w){return this.cmp(w)===1},t.prototype.gten=function(w){return this.cmpn(w)>=0},t.prototype.gte=function(w){return this.cmp(w)>=0},t.prototype.ltn=function(w){return this.cmpn(w)===-1},t.prototype.lt=function(w){return this.cmp(w)===-1},t.prototype.lten=function(w){return this.cmpn(w)<=0},t.prototype.lte=function(w){return this.cmp(w)<=0},t.prototype.eqn=function(w){return this.cmpn(w)===0},t.prototype.eq=function(w){return this.cmp(w)===0},t.red=function(w){return new k(w)},t.prototype.toRed=function(w){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(w){return this.red=w,this},t.prototype.forceRed=function(w){return a(!this.red,"Already a number in reduction context"),this._forceRed(w)},t.prototype.redAdd=function(w){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},t.prototype.redIAdd=function(w){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},t.prototype.redSub=function(w){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},t.prototype.redISub=function(w){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},t.prototype.redShl=function(w){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},t.prototype.redMul=function(w){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},t.prototype.redIMul=function(w){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(w){return a(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var F={k256:null,p224:null,p192:null,p25519:null};function j(w,m){this.name=w,this.p=new t(m,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function P(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function D(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function U(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(w){if(typeof w=="string"){var m=t._prime(w);this.m=m.p,this.prime=m}else a(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}function C(w){k.call(this,w),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}j.prototype._tmp=function(){var w=new t(null);return w.words=new Array(Math.ceil(this.n/13)),w},j.prototype.ireduce=function(w){var m,b=w;do this.split(b,this.tmp),m=(b=(b=this.imulK(b)).iadd(this.tmp)).bitLength();while(m>this.n);var g=m0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},j.prototype.split=function(w,m){w.iushrn(this.n,0,m)},j.prototype.imulK=function(w){return w.imul(this.k)},r(P,j),P.prototype.split=function(w,m){for(var b=Math.min(w.length,9),g=0;g>>22,y=S}y>>>=22,w.words[g-10]=y,y===0&&w.length>10?w.length-=10:w.length-=9},P.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var m=0,b=0;b>>=26,w.words[b]=y,m=g}return m!==0&&(w.words[w.length++]=m),w},t._prime=function(w){if(F[w])return F[w];var m;if(w==="k256")m=new P;else if(w==="p224")m=new D;else if(w==="p192")m=new U;else{if(w!=="p25519")throw new Error("Unknown prime "+w);m=new B}return F[w]=m,m},k.prototype._verify1=function(w){a(w.negative===0,"red works only with positives"),a(w.red,"red works only with red numbers")},k.prototype._verify2=function(w,m){a((w.negative|m.negative)==0,"red works only with positives"),a(w.red&&w.red===m.red,"red works only with red numbers")},k.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):(u(w,w.umod(this.m)._forceRed(this)),w)},k.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},k.prototype.add=function(w,m){this._verify2(w,m);var b=w.add(m);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},k.prototype.iadd=function(w,m){this._verify2(w,m);var b=w.iadd(m);return b.cmp(this.m)>=0&&b.isub(this.m),b},k.prototype.sub=function(w,m){this._verify2(w,m);var b=w.sub(m);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},k.prototype.isub=function(w,m){this._verify2(w,m);var b=w.isub(m);return b.cmpn(0)<0&&b.iadd(this.m),b},k.prototype.shl=function(w,m){return this._verify1(w),this.imod(w.ushln(m))},k.prototype.imul=function(w,m){return this._verify2(w,m),this.imod(w.imul(m))},k.prototype.mul=function(w,m){return this._verify2(w,m),this.imod(w.mul(m))},k.prototype.isqr=function(w){return this.imul(w,w.clone())},k.prototype.sqr=function(w){return this.mul(w,w)},k.prototype.sqrt=function(w){if(w.isZero())return w.clone();var m=this.m.andln(3);if(a(m%2==1),m===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(w,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);a(!g.isZero());var S=new t(1).toRed(this),R=S.redNeg(),N=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,N).cmp(R)!==0;)z.redIAdd(R);for(var H=this.pow(z,g),q=this.pow(w,g.addn(1).iushrn(1)),O=this.pow(w,g),$=y;O.cmp(S)!==0;){for(var E=O,M=0;E.cmp(S)!==0;M++)E=E.redSqr();a(M<$);var L=this.pow(H,new t(1).iushln($-M-1));q=q.redMul(L),H=L.redSqr(),O=O.redMul(H),$=M}return q},k.prototype.invm=function(w){var m=w._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},k.prototype.pow=function(w,m){if(m.isZero())return new t(1).toRed(this);if(m.cmpn(1)===0)return w.clone();var b=new Array(16);b[0]=new t(1).toRed(this),b[1]=w;for(var g=2;g=0;g--){for(var z=m.words[g],H=N-1;H>=0;H--){var q=z>>H&1;y!==b[0]&&(y=this.sqr(y)),q!==0||S!==0?(S<<=1,S|=q,(++R===4||g===0&&H===0)&&(y=this.mul(y,b[S]),R=0,S=0)):R=0}N=26}return y},k.prototype.convertTo=function(w){var m=w.umod(this.m);return m===w?m.clone():m},k.prototype.convertFrom=function(w){var m=w.clone();return m.red=null,m},t.mont=function(w){return new C(w)},r(C,k),C.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},C.prototype.convertFrom=function(w){var m=this.imod(w.mul(this.rinv));return m.red=null,m},C.prototype.imul=function(w,m){if(w.isZero()||m.isZero())return w.words[0]=0,w.length=1,w;var b=w.imul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),S=y;return y.cmp(this.m)>=0?S=y.isub(this.m):y.cmpn(0)<0&&(S=y.iadd(this.m)),S._forceRed(this)},C.prototype.mul=function(w,m){if(w.isZero()||m.isZero())return new t(0)._forceRed(this);var b=w.mul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),S=y;return y.cmp(this.m)>=0?S=y.isub(this.m):y.cmpn(0)<0&&(S=y.iadd(this.m)),S._forceRed(this)},C.prototype.invm=function(w){return this.imod(w._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],187:[function(s,T,_){var p;function o(r){this.rand=r}if(T.exports=function(r){return p||(p=new o(null)),p.generate(r)},T.exports.Rand=o,o.prototype.generate=function(r){return this._rand(r)},o.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e>>24]^I[D>>>16&255]^F[U>>>8&255]^j[255&B]^i[k++],f=A[D>>>24]^I[U>>>16&255]^F[B>>>8&255]^j[255&P]^i[k++],v=A[U>>>24]^I[B>>>16&255]^F[P>>>8&255]^j[255&D]^i[k++],x=A[B>>>24]^I[P>>>16&255]^F[D>>>8&255]^j[255&U]^i[k++],P=d,D=f,U=v,B=x;return d=(h[P>>>24]<<24|h[D>>>16&255]<<16|h[U>>>8&255]<<8|h[255&B])^i[k++],f=(h[D>>>24]<<24|h[U>>>16&255]<<16|h[B>>>8&255]<<8|h[255&P])^i[k++],v=(h[U>>>24]<<24|h[B>>>16&255]<<16|h[P>>>8&255]<<8|h[255&D])^i[k++],x=(h[B>>>24]<<24|h[P>>>16&255]<<16|h[D>>>8&255]<<8|h[255&U])^i[k++],[d>>>=0,f>>>=0,v>>>=0,x>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var n=new Array(256),i=0;i<256;i++)n[i]=i<128?i<<1:i<<1^283;for(var u=[],h=[],c=[[],[],[],[]],d=[[],[],[],[]],f=0,v=0,x=0;x<256;++x){var A=v^v<<1^v<<2^v<<3^v<<4;A=A>>>8^255&A^99,u[f]=A,h[A]=f;var I=n[f],F=n[I],j=n[F],P=257*n[A]^16843008*A;c[0][f]=P<<24|P>>>8,c[1][f]=P<<16|P>>>16,c[2][f]=P<<8|P>>>24,c[3][f]=P,P=16843009*j^65537*F^257*I^16843008*f,d[0][A]=P<<24|P>>>8,d[1][A]=P<<16|P>>>16,d[2][A]=P<<8|P>>>24,d[3][A]=P,f===0?f=v=1:(f=I^n[n[n[j^I]]],v^=n[n[v]])}return{SBOX:u,INV_SBOX:h,SUB_MIX:c,INV_SUB_MIX:d}}();function l(n){this._key=o(n),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var n=this._key,i=n.length,u=i+6,h=4*(u+1),c=[],d=0;d>>24,f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f],f^=t[d/i|0]<<24):i>6&&d%i==4&&(f=e.SBOX[f>>>24]<<24|e.SBOX[f>>>16&255]<<16|e.SBOX[f>>>8&255]<<8|e.SBOX[255&f]),c[d]=c[d-i]^f}for(var v=[],x=0;x>>24]]^e.INV_SUB_MIX[1][e.SBOX[I>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[I>>>8&255]]^e.INV_SUB_MIX[3][e.SBOX[255&I]]}this._nRounds=u,this._keySchedule=c,this._invKeySchedule=v},l.prototype.encryptBlockRaw=function(n){return r(n=o(n),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(n){var i=this.encryptBlockRaw(n),u=p.allocUnsafe(16);return u.writeUInt32BE(i[0],0),u.writeUInt32BE(i[1],4),u.writeUInt32BE(i[2],8),u.writeUInt32BE(i[3],12),u},l.prototype.decryptBlock=function(n){var i=(n=o(n))[1];n[1]=n[3],n[3]=i;var u=r(n,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),h=p.allocUnsafe(16);return h.writeUInt32BE(u[0],0),h.writeUInt32BE(u[3],4),h.writeUInt32BE(u[2],8),h.writeUInt32BE(u[1],12),h},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},T.exports.AES=l},{"safe-buffer":494}],190:[function(s,T,_){var p=s("./aes"),o=s("safe-buffer").Buffer,a=s("cipher-base"),r=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function n(i,u,h,c){a.call(this);var d=o.alloc(4,0);this._cipher=new p.AES(u);var f=this._cipher.encryptBlock(d);this._ghash=new t(f),h=function(v,x,A){if(x.length===12)return v._finID=o.concat([x,o.from([0,0,0,1])]),o.concat([x,o.from([0,0,0,2])]);var I=new t(A),F=x.length,j=F%16;I.update(x),j&&(j=16-j,I.update(o.alloc(j,0))),I.update(o.alloc(8,0));var P=8*F,D=o.alloc(8);D.writeUIntBE(P,0,8),I.update(D),v._finID=I.state;var U=o.from(v._finID);return l(U),U}(this,h,f),this._prev=o.from(h),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=c,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}r(n,a),n.prototype._update=function(i){if(!this._called&&this._alen){var u=16-this._alen%16;u<16&&(u=o.alloc(u,0),this._ghash.update(u))}this._called=!0;var h=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(h),this._len+=i.length,h},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var i=e(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(u,h){var c=0;u.length!==h.length&&c++;for(var d=Math.min(u.length,h.length),f=0;f16)throw new Error("unable to decrypt data");for(var f=-1;++f16)return c=this.cache.slice(0,16),this.cache=this.cache.slice(16),c}else if(this.cache.length>=16)return c=this.cache.slice(0,16),this.cache=this.cache.slice(16),c;return null},i.prototype.flush=function(){if(this.cache.length)return this.cache},_.createDecipher=function(h,c){var d=a[h.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var f=l(c,!1,d.key,d.iv);return u(h,f.key,f.iv)},_.createDecipheriv=u},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(s,T,_){var p=s("./modes"),o=s("./authCipher"),a=s("safe-buffer").Buffer,r=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function n(c,d,f){t.call(this),this._cache=new u,this._cipher=new e.AES(d),this._prev=a.from(f),this._mode=c,this._autopadding=!0}s("inherits")(n,t),n.prototype._update=function(c){var d,f;this._cache.add(c);for(var v=[];d=this._cache.get();)f=this._mode.encrypt(this,d),v.push(f);return a.concat(v)};var i=a.alloc(16,16);function u(){this.cache=a.allocUnsafe(0)}function h(c,d,f){var v=p[c.toLowerCase()];if(!v)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=a.from(d)),d.length!==v.key/8)throw new TypeError("invalid key length "+d.length);if(typeof f=="string"&&(f=a.from(f)),v.mode!=="GCM"&&f.length!==v.iv)throw new TypeError("invalid iv length "+f.length);return v.type==="stream"?new r(v.module,d,f):v.type==="auth"?new o(v.module,d,f):new n(v.module,d,f)}n.prototype._final=function(){var c=this._cache.flush();if(this._autopadding)return c=this._mode.encrypt(this,c),this._cipher.scrub(),c;if(!c.equals(i))throw this._cipher.scrub(),new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(c){return this._autopadding=!!c,this},u.prototype.add=function(c){this.cache=a.concat([this.cache,c])},u.prototype.get=function(){if(this.cache.length>15){var c=this.cache.slice(0,16);return this.cache=this.cache.slice(16),c}return null},u.prototype.flush=function(){for(var c=16-this.cache.length,d=a.allocUnsafe(c),f=-1;++f>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function r(t){this.h=t,this.state=p.alloc(16,0),this.cache=p.allocUnsafe(0)}r.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,l&&(n[0]=n[0]^225<<24)}this.state=a(i)},r.prototype.update=function(t){var e;for(this.cache=p.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},r.prototype.final=function(t,e){return this.cache.length&&this.ghash(p.concat([this.cache,o],16)),this.ghash(a([0,t,0,e])),this.state},T.exports=r},{"safe-buffer":494}],195:[function(s,T,_){T.exports=function(p){for(var o,a=p.length;a--;){if((o=p.readUInt8(a))!==255){o++,p.writeUInt8(o,a);break}p.writeUInt8(0,a)}}},{}],196:[function(s,T,_){var p=s("buffer-xor");_.encrypt=function(o,a){var r=p(a,o._prev);return o._prev=o._cipher.encryptBlock(r),o._prev},_.decrypt=function(o,a){var r=o._prev;o._prev=a;var t=o._cipher.decryptBlock(a);return p(t,r)}},{"buffer-xor":219}],197:[function(s,T,_){var p=s("safe-buffer").Buffer,o=s("buffer-xor");function a(r,t,e){var l=t.length,n=o(t,r._cache);return r._cache=r._cache.slice(l),r._prev=p.concat([r._prev,e?t:n]),n}_.encrypt=function(r,t,e){for(var l,n=p.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=p.allocUnsafe(0)),!(r._cache.length<=t.length)){n=p.concat([n,a(r,t,e)]);break}l=r._cache.length,n=p.concat([n,a(r,t.slice(0,l),e)]),t=t.slice(l)}return n}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,T,_){var p=s("safe-buffer").Buffer;function o(r,t,e){for(var l,n,i=-1,u=0;++i<8;)l=t&1<<7-i?128:0,u+=(128&(n=r._cipher.encryptBlock(r._prev)[0]^l))>>i%8,r._prev=a(r._prev,e?l:n);return u}function a(r,t){var e=r.length,l=-1,n=p.allocUnsafe(r.length);for(r=p.concat([r,p.from([t])]);++l>7;return n}_.encrypt=function(r,t,e){for(var l=t.length,n=p.allocUnsafe(l),i=-1;++i=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){var n=function(F){var j=r(F);return{blinder:j.toRed(o.mont(F.modulus)).redPow(new o(F.publicExponent)).fromRed(),unblinder:j.invm(F.modulus)}}(l),i=l.modulus.byteLength(),u=new o(e).mul(n.blinder).umod(l.modulus),h=u.toRed(o.mont(l.prime1)),c=u.toRed(o.mont(l.prime2)),d=l.coefficient,f=l.prime1,v=l.prime2,x=h.redPow(l.exponent1).fromRed(),A=c.redPow(l.exponent2).fromRed(),I=x.isub(A).imul(d).umod(f).imul(v);return A.iadd(I).imul(n.unblinder).umod(l.modulus).toArrayLike(p,"be",i)}t.getr=r,T.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,T,_){T.exports=s("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(s,T,_){T.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(s,T,_){T.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(s,T,_){var p=s("safe-buffer").Buffer,o=s("create-hash"),a=s("readable-stream"),r=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function n(c){a.Writable.call(this);var d=l[c];if(!d)throw new Error("Unknown message digest");this._hashType=d.hash,this._hash=o(d.hash),this._tag=d.id,this._signType=d.sign}function i(c){a.Writable.call(this);var d=l[c];if(!d)throw new Error("Unknown message digest");this._hash=o(d.hash),this._tag=d.id,this._signType=d.sign}function u(c){return new n(c)}function h(c){return new i(c)}Object.keys(l).forEach(function(c){l[c].id=p.from(l[c].id,"hex"),l[c.toLowerCase()]=l[c]}),r(n,a.Writable),n.prototype._write=function(c,d,f){this._hash.update(c),f()},n.prototype.update=function(c,d){return typeof c=="string"&&(c=p.from(c,d)),this._hash.update(c),this},n.prototype.sign=function(c,d){this.end();var f=this._hash.digest(),v=t(f,c,this._hashType,this._signType,this._tag);return d?v.toString(d):v},r(i,a.Writable),i.prototype._write=function(c,d,f){this._hash.update(c),f()},i.prototype.update=function(c,d){return typeof c=="string"&&(c=p.from(c,d)),this._hash.update(c),this},i.prototype.verify=function(c,d,f){typeof d=="string"&&(d=p.from(d,f)),this.end();var v=this._hash.digest();return e(d,v,c,this._signType,this._tag)},T.exports={Sign:u,Verify:h,createSign:u,createVerify:h}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(s,T,_){var p=s("safe-buffer").Buffer,o=s("create-hmac"),a=s("browserify-rsa"),r=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function n(c,d,f,v){if((c=p.from(c.toArray())).length0&&f.ishrn(v),f}function u(c,d,f){var v,x;do{for(v=p.alloc(0);8*v.length=n)throw new Error("invalid sig")}T.exports=function(l,n,i,u,h){var c=r(i);if(c.type==="ec"){if(u!=="ecdsa"&&u!=="ecdsa/rsa")throw new Error("wrong public key type");return function(F,j,P){var D=t[P.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var U=new a(D),B=P.data.subjectPrivateKey.data;return U.verify(j,F,B)}(l,n,c)}if(c.type==="dsa"){if(u!=="dsa")throw new Error("wrong public key type");return function(F,j,P){var D=P.data.p,U=P.data.q,B=P.data.g,k=P.data.pub_key,C=r.signature.decode(F,"der"),w=C.s,m=C.r;e(w,U),e(m,U);var b=o.mont(D),g=w.invm(U);return B.toRed(b).redPow(new o(j).mul(g).mod(U)).fromRed().mul(k.toRed(b).redPow(m.mul(g).mod(U)).fromRed()).mod(D).mod(U).cmp(m)===0}(l,n,c)}if(u!=="rsa"&&u!=="ecdsa/rsa")throw new Error("wrong public key type");n=p.concat([h,n]);for(var d=c.modulus.byteLength(),f=[1],v=0;n.length+f.length+2>5==6?2:c>>4==14?3:c>>3==30?4:c>>6==2?-1:-2}function t(c){var d=this.lastTotal-this.lastNeed,f=function(v,x,A){if((192&x[0])!=128)return v.lastNeed=0,"�";if(v.lastNeed>1&&x.length>1){if((192&x[1])!=128)return v.lastNeed=1,"�";if(v.lastNeed>2&&x.length>2&&(192&x[2])!=128)return v.lastNeed=2,"�"}}(this,c);return f!==void 0?f:this.lastNeed<=c.length?(c.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(c.copy(this.lastChar,d,0,c.length),void(this.lastNeed-=c.length))}function e(c,d){if((c.length-d)%2==0){var f=c.toString("utf16le",d);if(f){var v=f.charCodeAt(f.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=c[c.length-1],c.toString("utf16le",d,c.length-1)}function l(c){var d=c&&c.length?this.write(c):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,f)}return d}function n(c,d){var f=(c.length-d)%3;return f===0?c.toString("base64",d):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=c[c.length-1]:(this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1]),c.toString("base64",d,c.length-f))}function i(c){var d=c&&c.length?this.write(c):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function u(c){return c.toString(this.encoding)}function h(c){return c&&c.length?this.write(c):""}_.StringDecoder=a,a.prototype.write=function(c){if(c.length===0)return"";var d,f;if(this.lastNeed){if((d=this.fillLast(c))===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f=0?(j>0&&(x.lastNeed=j-1),j):--F=0?(j>0&&(x.lastNeed=j-2),j):--F=0?(j>0&&(j===2?j=0:x.lastNeed=j-3),j):0}(this,c,d);if(!this.lastNeed)return c.toString("utf8",d);this.lastTotal=f;var v=c.length-(f-this.lastNeed);return c.copy(this.lastChar,0,v),c.toString("utf8",d,v)},a.prototype.fillLast=function(c){if(this.lastNeed<=c.length)return c.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);c.copy(this.lastChar,this.lastTotal-this.lastNeed,0,c.length),this.lastNeed-=c.length}},{"safe-buffer":217}],219:[function(s,T,_){(function(p){(function(){T.exports=function(o,a){for(var r=Math.min(o.length,a.length),t=new p(r),e=0;e2147483647)throw new RangeError('The value "'+E+'" is invalid for option "size"');var M=new Uint8Array(E);return M.__proto__=t.prototype,M}function t(E,M,L){if(typeof E=="number"){if(typeof M=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return n(E)}return e(E,M,L)}function e(E,M,L){if(typeof E=="string")return function(W,Z){if(typeof Z=="string"&&Z!==""||(Z="utf8"),!t.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);var tt=0|h(W,Z),rt=r(tt),X=rt.write(W,Z);return X!==tt&&(rt=rt.slice(0,X)),rt}(E,M);if(ArrayBuffer.isView(E))return i(E);if(E==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(O(E,ArrayBuffer)||E&&O(E.buffer,ArrayBuffer))return function(W,Z,tt){if(Z<0||W.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|E}function h(E,M){if(t.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||O(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);var L=E.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&L===0)return 0;for(var K=!1;;)switch(M){case"ascii":case"latin1":case"binary":return L;case"utf8":case"utf-8":return z(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*L;case"hex":return L>>>1;case"base64":return H(E).length;default:if(K)return V?-1:z(E).length;M=(""+M).toLowerCase(),K=!0}}function c(E,M,L){var V=!1;if((M===void 0||M<0)&&(M=0),M>this.length||((L===void 0||L>this.length)&&(L=this.length),L<=0)||(L>>>=0)<=(M>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return C(this,M,L);case"utf8":case"utf-8":return U(this,M,L);case"ascii":return B(this,M,L);case"latin1":case"binary":return k(this,M,L);case"base64":return D(this,M,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,M,L);default:if(V)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),V=!0}}function d(E,M,L){var V=E[M];E[M]=E[L],E[L]=V}function f(E,M,L,V,K){if(E.length===0)return-1;if(typeof L=="string"?(V=L,L=0):L>2147483647?L=2147483647:L<-2147483648&&(L=-2147483648),$(L=+L)&&(L=K?0:E.length-1),L<0&&(L=E.length+L),L>=E.length){if(K)return-1;L=E.length-1}else if(L<0){if(!K)return-1;L=0}if(typeof M=="string"&&(M=t.from(M,V)),t.isBuffer(M))return M.length===0?-1:v(E,M,L,V,K);if(typeof M=="number")return M&=255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(E,M,L):Uint8Array.prototype.lastIndexOf.call(E,M,L):v(E,[M],L,V,K);throw new TypeError("val must be string, number or Buffer")}function v(E,M,L,V,K){var W,Z=1,tt=E.length,rt=M.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(E.length<2||M.length<2)return-1;Z=2,tt/=2,rt/=2,L/=2}function X(it,at){return Z===1?it[at]:it.readUInt16BE(at*Z)}if(K){var Q=-1;for(W=L;Wtt&&(L=tt-rt),W=L;W>=0;W--){for(var J=!0,st=0;stK&&(V=K):V=K;var W=M.length;V>W/2&&(V=W/2);for(var Z=0;Z>8,rt=Z%256,X.push(rt),X.push(tt);return X}(M,E.length-L),E,L,V)}function D(E,M,L){return M===0&&L===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(M,L))}function U(E,M,L){L=Math.min(E.length,L);for(var V=[],K=M;K239?4:X>223?3:X>191?2:1;if(K+J<=L)switch(J){case 1:X<128&&(Q=X);break;case 2:(192&(W=E[K+1]))==128&&(rt=(31&X)<<6|63&W)>127&&(Q=rt);break;case 3:W=E[K+1],Z=E[K+2],(192&W)==128&&(192&Z)==128&&(rt=(15&X)<<12|(63&W)<<6|63&Z)>2047&&(rt<55296||rt>57343)&&(Q=rt);break;case 4:W=E[K+1],Z=E[K+2],tt=E[K+3],(192&W)==128&&(192&Z)==128&&(192&tt)==128&&(rt=(15&X)<<18|(63&W)<<12|(63&Z)<<6|63&tt)>65535&&rt<1114112&&(Q=rt)}Q===null?(Q=65533,J=1):Q>65535&&(Q-=65536,V.push(Q>>>10&1023|55296),Q=56320|1023&Q),V.push(Q),K+=J}return function(st){var it=st.length;if(it<=4096)return String.fromCharCode.apply(String,st);for(var at="",ct=0;ct"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(E,M,L){return e(E,M,L)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(E,M,L){return function(V,K,W){return l(V),V<=0?r(V):K!==void 0?typeof W=="string"?r(V).fill(K,W):r(V).fill(K):r(V)}(E,M,L)},t.allocUnsafe=function(E){return n(E)},t.allocUnsafeSlow=function(E){return n(E)},t.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==t.prototype},t.compare=function(E,M){if(O(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),O(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(E)||!t.isBuffer(M))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===M)return 0;for(var L=E.length,V=M.length,K=0,W=Math.min(L,V);KM&&(E+=" ... "),""},t.prototype.compare=function(E,M,L,V,K){if(O(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),!t.isBuffer(E))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof E);if(M===void 0&&(M=0),L===void 0&&(L=E?E.length:0),V===void 0&&(V=0),K===void 0&&(K=this.length),M<0||L>E.length||V<0||K>this.length)throw new RangeError("out of range index");if(V>=K&&M>=L)return 0;if(V>=K)return-1;if(M>=L)return 1;if(this===E)return 0;for(var W=(K>>>=0)-(V>>>=0),Z=(L>>>=0)-(M>>>=0),tt=Math.min(W,Z),rt=this.slice(V,K),X=E.slice(M,L),Q=0;Q>>=0,isFinite(L)?(L>>>=0,V===void 0&&(V="utf8")):(V=L,L=void 0)}var K=this.length-M;if((L===void 0||L>K)&&(L=K),E.length>0&&(L<0||M<0)||M>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var W=!1;;)switch(V){case"hex":return x(this,E,M,L);case"utf8":case"utf-8":return A(this,E,M,L);case"ascii":return I(this,E,M,L);case"latin1":case"binary":return F(this,E,M,L);case"base64":return j(this,E,M,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,M,L);default:if(W)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),W=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(E,M,L){var V="";L=Math.min(E.length,L);for(var K=M;KV)&&(L=V);for(var K="",W=M;WL)throw new RangeError("Trying to access beyond buffer length")}function b(E,M,L,V,K,W){if(!t.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(M>K||ME.length)throw new RangeError("Index out of range")}function g(E,M,L,V,K,W){if(L+V>E.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("Index out of range")}function y(E,M,L,V,K){return M=+M,L>>>=0,K||g(E,0,L,4),a.write(E,M,L,V,23,4),L+4}function S(E,M,L,V,K){return M=+M,L>>>=0,K||g(E,0,L,8),a.write(E,M,L,V,52,8),L+8}t.prototype.slice=function(E,M){var L=this.length;(E=~~E)<0?(E+=L)<0&&(E=0):E>L&&(E=L),(M=M===void 0?L:~~M)<0?(M+=L)<0&&(M=0):M>L&&(M=L),M>>=0,M>>>=0,L||m(E,M,this.length);for(var V=this[E],K=1,W=0;++W>>=0,M>>>=0,L||m(E,M,this.length);for(var V=this[E+--M],K=1;M>0&&(K*=256);)V+=this[E+--M]*K;return V},t.prototype.readUInt8=function(E,M){return E>>>=0,M||m(E,1,this.length),this[E]},t.prototype.readUInt16LE=function(E,M){return E>>>=0,M||m(E,2,this.length),this[E]|this[E+1]<<8},t.prototype.readUInt16BE=function(E,M){return E>>>=0,M||m(E,2,this.length),this[E]<<8|this[E+1]},t.prototype.readUInt32LE=function(E,M){return E>>>=0,M||m(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+16777216*this[E+3]},t.prototype.readUInt32BE=function(E,M){return E>>>=0,M||m(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},t.prototype.readIntLE=function(E,M,L){E>>>=0,M>>>=0,L||m(E,M,this.length);for(var V=this[E],K=1,W=0;++W=(K*=128)&&(V-=Math.pow(2,8*M)),V},t.prototype.readIntBE=function(E,M,L){E>>>=0,M>>>=0,L||m(E,M,this.length);for(var V=M,K=1,W=this[E+--V];V>0&&(K*=256);)W+=this[E+--V]*K;return W>=(K*=128)&&(W-=Math.pow(2,8*M)),W},t.prototype.readInt8=function(E,M){return E>>>=0,M||m(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},t.prototype.readInt16LE=function(E,M){E>>>=0,M||m(E,2,this.length);var L=this[E]|this[E+1]<<8;return 32768&L?4294901760|L:L},t.prototype.readInt16BE=function(E,M){E>>>=0,M||m(E,2,this.length);var L=this[E+1]|this[E]<<8;return 32768&L?4294901760|L:L},t.prototype.readInt32LE=function(E,M){return E>>>=0,M||m(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},t.prototype.readInt32BE=function(E,M){return E>>>=0,M||m(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},t.prototype.readFloatLE=function(E,M){return E>>>=0,M||m(E,4,this.length),a.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,M){return E>>>=0,M||m(E,4,this.length),a.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,M){return E>>>=0,M||m(E,8,this.length),a.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,M){return E>>>=0,M||m(E,8,this.length),a.read(this,E,!1,52,8)},t.prototype.writeUIntLE=function(E,M,L,V){E=+E,M>>>=0,L>>>=0,V||b(this,E,M,L,Math.pow(2,8*L)-1,0);var K=1,W=0;for(this[M]=255&E;++W>>=0,L>>>=0,V||b(this,E,M,L,Math.pow(2,8*L)-1,0);var K=L-1,W=1;for(this[M+K]=255&E;--K>=0&&(W*=256);)this[M+K]=E/W&255;return M+L},t.prototype.writeUInt8=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,1,255,0),this[M]=255&E,M+1},t.prototype.writeUInt16LE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,2,65535,0),this[M]=255&E,this[M+1]=E>>>8,M+2},t.prototype.writeUInt16BE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,2,65535,0),this[M]=E>>>8,this[M+1]=255&E,M+2},t.prototype.writeUInt32LE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,4,4294967295,0),this[M+3]=E>>>24,this[M+2]=E>>>16,this[M+1]=E>>>8,this[M]=255&E,M+4},t.prototype.writeUInt32BE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,4,4294967295,0),this[M]=E>>>24,this[M+1]=E>>>16,this[M+2]=E>>>8,this[M+3]=255&E,M+4},t.prototype.writeIntLE=function(E,M,L,V){if(E=+E,M>>>=0,!V){var K=Math.pow(2,8*L-1);b(this,E,M,L,K-1,-K)}var W=0,Z=1,tt=0;for(this[M]=255&E;++W>0)-tt&255;return M+L},t.prototype.writeIntBE=function(E,M,L,V){if(E=+E,M>>>=0,!V){var K=Math.pow(2,8*L-1);b(this,E,M,L,K-1,-K)}var W=L-1,Z=1,tt=0;for(this[M+W]=255&E;--W>=0&&(Z*=256);)E<0&&tt===0&&this[M+W+1]!==0&&(tt=1),this[M+W]=(E/Z>>0)-tt&255;return M+L},t.prototype.writeInt8=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,1,127,-128),E<0&&(E=255+E+1),this[M]=255&E,M+1},t.prototype.writeInt16LE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,2,32767,-32768),this[M]=255&E,this[M+1]=E>>>8,M+2},t.prototype.writeInt16BE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,2,32767,-32768),this[M]=E>>>8,this[M+1]=255&E,M+2},t.prototype.writeInt32LE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,4,2147483647,-2147483648),this[M]=255&E,this[M+1]=E>>>8,this[M+2]=E>>>16,this[M+3]=E>>>24,M+4},t.prototype.writeInt32BE=function(E,M,L){return E=+E,M>>>=0,L||b(this,E,M,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[M]=E>>>24,this[M+1]=E>>>16,this[M+2]=E>>>8,this[M+3]=255&E,M+4},t.prototype.writeFloatLE=function(E,M,L){return y(this,E,M,!0,L)},t.prototype.writeFloatBE=function(E,M,L){return y(this,E,M,!1,L)},t.prototype.writeDoubleLE=function(E,M,L){return S(this,E,M,!0,L)},t.prototype.writeDoubleBE=function(E,M,L){return S(this,E,M,!1,L)},t.prototype.copy=function(E,M,L,V){if(!t.isBuffer(E))throw new TypeError("argument should be a Buffer");if(L||(L=0),V||V===0||(V=this.length),M>=E.length&&(M=E.length),M||(M=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),E.length-M=0;--W)E[W+M]=this[W+L];else Uint8Array.prototype.set.call(E,this.subarray(L,V),M);return K},t.prototype.fill=function(E,M,L,V){if(typeof E=="string"){if(typeof M=="string"?(V=M,M=0,L=this.length):typeof L=="string"&&(V=L,L=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!t.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(E.length===1){var K=E.charCodeAt(0);(V==="utf8"&&K<128||V==="latin1")&&(E=K)}}else typeof E=="number"&&(E&=255);if(M<0||this.length>>=0,L=L===void 0?this.length:L>>>0,E||(E=0),typeof E=="number")for(W=M;W55295&&L<57344){if(!K){if(L>56319){(M-=3)>-1&&W.push(239,191,189);continue}if(Z+1===V){(M-=3)>-1&&W.push(239,191,189);continue}K=L;continue}if(L<56320){(M-=3)>-1&&W.push(239,191,189),K=L;continue}L=65536+(K-55296<<10|L-56320)}else K&&(M-=3)>-1&&W.push(239,191,189);if(K=null,L<128){if((M-=1)<0)break;W.push(L)}else if(L<2048){if((M-=2)<0)break;W.push(L>>6|192,63&L|128)}else if(L<65536){if((M-=3)<0)break;W.push(L>>12|224,L>>6&63|128,63&L|128)}else{if(!(L<1114112))throw new Error("Invalid code point");if((M-=4)<0)break;W.push(L>>18|240,L>>12&63|128,L>>6&63|128,63&L|128)}}return W}function H(E){return o.toByteArray(function(M){if((M=(M=M.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;M.length%4!=0;)M+="=";return M}(E))}function q(E,M,L,V){for(var K=0;K=M.length||K>=E.length);++K)M[K+L]=E[K];return K}function O(E,M){return E instanceof M||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===M.name}function $(E){return E!=E}}).call(this)}).call(this,s("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(s,T,_){var p=s("safe-buffer").Buffer,o=s("stream").Transform,a=s("string_decoder").StringDecoder;function r(t){o.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}s("inherits")(r,o),r.prototype.update=function(t,e,l){typeof t=="string"&&(t=p.from(t,e));var n=this._update(t);return this.hashMode?this:(l&&(n=this._toString(n,l)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,e,l){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{l(n)}},r.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(l){e=l}t(e)},r.prototype._finalOrDigest=function(t){var e=this.__final()||p.alloc(0);return t&&(e=this._toString(e,t,!0)),e},r.prototype._toString=function(t,e,l){if(this._decoder||(this._decoder=new a(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return l&&(n+=this._decoder.end()),n},T.exports=r},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(s,T,_){var p=s("../internals/is-callable"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(r){if(p(r))return r;throw new a(o(r)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(s,T,_){var p=s("../internals/is-constructor"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(r){if(p(r))return r;throw new a(o(r)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(s,T,_){var p=s("../internals/is-callable"),o=String,a=TypeError;T.exports=function(r){if(typeof r=="object"||p(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(s,T,_){var p=s("../internals/well-known-symbol"),o=s("../internals/object-create"),a=s("../internals/object-define-property").f,r=p("unscopables"),t=Array.prototype;t[r]===void 0&&a(t,r,{configurable:!0,value:o(null)}),T.exports=function(e){t[r][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(s,T,_){var p=s("../internals/object-is-prototype-of"),o=TypeError;T.exports=function(a,r){if(p(r,a))return a;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(s,T,_){var p=s("../internals/is-object"),o=String,a=TypeError;T.exports=function(r){if(p(r))return r;throw new a(o(r)+" is not an object")}},{"../internals/is-object":289}],228:[function(s,T,_){var p=s("../internals/to-indexed-object"),o=s("../internals/to-absolute-index"),a=s("../internals/length-of-array-like"),r=function(t){return function(e,l,n){var i,u=p(e),h=a(u),c=o(n,h);if(t&&l!=l){for(;h>c;)if((i=u[c++])!=i)return!0}else for(;h>c;c++)if((t||c in u)&&u[c]===l)return t||c||0;return!t&&-1}};T.exports={includes:r(!0),indexOf:r(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(s,T,_){var p=s("../internals/function-bind-context"),o=s("../internals/function-uncurry-this"),a=s("../internals/indexed-object"),r=s("../internals/to-object"),t=s("../internals/length-of-array-like"),e=s("../internals/array-species-create"),l=o([].push),n=function(i){var u=i===1,h=i===2,c=i===3,d=i===4,f=i===6,v=i===7,x=i===5||f;return function(A,I,F,j){for(var P,D,U=r(A),B=a(U),k=p(I,F),C=t(B),w=0,m=j||e,b=u?m(A,C):h||v?m(A,0):void 0;C>w;w++)if((x||w in B)&&(D=k(P=B[w],w,U),i))if(u)b[w]=D;else if(D)switch(i){case 3:return!0;case 5:return P;case 6:return w;case 2:l(b,P)}else switch(i){case 4:return!1;case 7:l(b,P)}return f?-1:c||d?d:b}};T.exports={forEach:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6),filterReject:n(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(s,T,_){var p=s("../internals/to-absolute-index"),o=s("../internals/length-of-array-like"),a=s("../internals/create-property"),r=Array,t=Math.max;T.exports=function(e,l,n){for(var i=o(e),u=p(l,i),h=p(n===void 0?i:n,i),c=r(t(h-u,0)),d=0;u0&&p[0]<4?1:+(p[0]+p[1])),!o&&r&&(!(p=r.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=r.match(/Chrome\/(\d+)/))&&(o=+p[1]),T.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(s,T,_){T.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(s,T,_){var p=s("../internals/global"),o=s("../internals/object-get-own-property-descriptor").f,a=s("../internals/create-non-enumerable-property"),r=s("../internals/define-built-in"),t=s("../internals/define-global-property"),e=s("../internals/copy-constructor-properties"),l=s("../internals/is-forced");T.exports=function(n,i){var u,h,c,d,f,v=n.target,x=n.global,A=n.stat;if(u=x?p:A?p[v]||t(v,{}):(p[v]||{}).prototype)for(h in i){if(d=i[h],c=n.dontCallGetSet?(f=o(u,h))&&f.value:u[h],!l(x?h:v+(A?".":"#")+h,n.forced)&&c!==void 0){if(typeof d==typeof c)continue;e(d,c)}(n.sham||c&&c.sham)&&a(d,"sham",!0),r(u,h,d,n)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(s,T,_){T.exports=function(p){try{return!!p()}catch{return!0}}},{}],261:[function(s,T,_){var p=s("../internals/function-bind-native"),o=Function.prototype,a=o.apply,r=o.call;T.exports=typeof Reflect=="object"&&Reflect.apply||(p?r.bind(a):function(){return r.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(s,T,_){var p=s("../internals/function-uncurry-this-clause"),o=s("../internals/a-callable"),a=s("../internals/function-bind-native"),r=p(p.bind);T.exports=function(t,e){return o(t),e===void 0?t:a?r(t,e):function(){return t.apply(e,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(s,T,_){var p=s("../internals/fails");T.exports=!p(function(){var o=(function(){}).bind();return typeof o!="function"||o.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(s,T,_){var p=s("../internals/function-bind-native"),o=Function.prototype.call;T.exports=p?o.bind(o):function(){return o.apply(o,arguments)}},{"../internals/function-bind-native":263}],265:[function(s,T,_){var p=s("../internals/descriptors"),o=s("../internals/has-own-property"),a=Function.prototype,r=p&&Object.getOwnPropertyDescriptor,t=o(a,"name"),e=t&&(function(){}).name==="something",l=t&&(!p||p&&r(a,"name").configurable);T.exports={EXISTS:t,PROPER:e,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(s,T,_){var p=s("../internals/function-uncurry-this"),o=s("../internals/a-callable");T.exports=function(a,r,t){try{return p(o(Object.getOwnPropertyDescriptor(a,r)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(s,T,_){var p=s("../internals/classof-raw"),o=s("../internals/function-uncurry-this");T.exports=function(a){if(p(a)==="Function")return o(a)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(s,T,_){var p=s("../internals/function-bind-native"),o=Function.prototype,a=o.call,r=p&&o.bind.bind(a,a);T.exports=p?r:function(t){return function(){return a.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(s,T,_){var p=s("../internals/global"),o=s("../internals/is-callable"),a=function(r){return o(r)?r:void 0};T.exports=function(r,t){return arguments.length<2?a(p[r]):p[r]&&p[r][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(s,T,_){var p=s("../internals/classof"),o=s("../internals/get-method"),a=s("../internals/is-null-or-undefined"),r=s("../internals/iterators"),t=s("../internals/well-known-symbol")("iterator");T.exports=function(e){if(!a(e))return o(e,t)||o(e,"@@iterator")||r[p(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(s,T,_){var p=s("../internals/function-call"),o=s("../internals/a-callable"),a=s("../internals/an-object"),r=s("../internals/try-to-string"),t=s("../internals/get-iterator-method"),e=TypeError;T.exports=function(l,n){var i=arguments.length<2?t(l):n;if(o(i))return a(p(i,l));throw new e(r(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(s,T,_){var p=s("../internals/function-uncurry-this"),o=s("../internals/is-array"),a=s("../internals/is-callable"),r=s("../internals/classof-raw"),t=s("../internals/to-string"),e=p([].push);T.exports=function(l){if(a(l))return l;if(o(l)){for(var n=l.length,i=[],u=0;uF;F++)if((P=y(f[F]))&&l(d,P))return P;return new c(!1)}A=n(f,I)}for(D=C?f.next:A.next;!(U=o(D,A)).done;){try{P=y(U.value)}catch(S){u(A,"throw",S)}if(typeof P=="object"&&P&&l(d,P))return P}return new c(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(s,T,_){var p=s("../internals/function-call"),o=s("../internals/an-object"),a=s("../internals/get-method");T.exports=function(r,t,e){var l,n;o(r);try{if(!(l=a(r,"return"))){if(t==="throw")throw e;return e}l=p(l,r)}catch(i){n=!0,l=i}if(t==="throw")throw e;if(n)throw l;return o(l),e}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(s,T,_){var p=s("../internals/iterators-core").IteratorPrototype,o=s("../internals/object-create"),a=s("../internals/create-property-descriptor"),r=s("../internals/set-to-string-tag"),t=s("../internals/iterators"),e=function(){return this};T.exports=function(l,n,i,u){var h=n+" Iterator";return l.prototype=o(p,{next:a(+!u,i)}),r(l,h,!1,!0),t[h]=e,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(s,T,_){var p=s("../internals/export"),o=s("../internals/function-call"),a=s("../internals/is-pure"),r=s("../internals/function-name"),t=s("../internals/is-callable"),e=s("../internals/iterator-create-constructor"),l=s("../internals/object-get-prototype-of"),n=s("../internals/object-set-prototype-of"),i=s("../internals/set-to-string-tag"),u=s("../internals/create-non-enumerable-property"),h=s("../internals/define-built-in"),c=s("../internals/well-known-symbol"),d=s("../internals/iterators"),f=s("../internals/iterators-core"),v=r.PROPER,x=r.CONFIGURABLE,A=f.IteratorPrototype,I=f.BUGGY_SAFARI_ITERATORS,F=c("iterator"),j=function(){return this};T.exports=function(P,D,U,B,k,C,w){e(U,D,B);var m,b,g,y=function(O){if(O===k&&H)return H;if(!I&&O&&O in N)return N[O];switch(O){case"keys":case"values":case"entries":return function(){return new U(this,O)}}return function(){return new U(this)}},S=D+" Iterator",R=!1,N=P.prototype,z=N[F]||N["@@iterator"]||k&&N[k],H=!I&&z||y(k),q=D==="Array"&&N.entries||z;if(q&&(m=l(q.call(new P)))!==Object.prototype&&m.next&&(a||l(m)===A||(n?n(m,A):t(m[F])||h(m,F,j)),i(m,S,!0,!0),a&&(d[S]=j)),v&&k==="values"&&z&&z.name!=="values"&&(!a&&x?u(N,"name","values"):(R=!0,H=function(){return o(z,this)})),k)if(b={values:y("values"),keys:C?H:y("keys"),entries:y("entries")},w)for(g in b)(I||R||!(g in N))&&h(N,g,b[g]);else p({target:D,proto:!0,forced:I||R},b);return a&&!w||N[F]===H||h(N,F,H,{name:k}),d[D]=H,b}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(s,T,_){var p,o,a,r=s("../internals/fails"),t=s("../internals/is-callable"),e=s("../internals/is-object"),l=s("../internals/object-create"),n=s("../internals/object-get-prototype-of"),i=s("../internals/define-built-in"),u=s("../internals/well-known-symbol"),h=s("../internals/is-pure"),c=u("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(o=n(n(a)))!==Object.prototype&&(p=o):d=!0),!e(p)||r(function(){var f={};return p[c].call(f)!==f})?p={}:h&&(p=l(p)),t(p[c])||i(p,c,function(){return this}),T.exports={IteratorPrototype:p,BUGGY_SAFARI_ITERATORS:d}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(s,T,_){arguments[4][276][0].apply(_,arguments)},{dup:276}],299:[function(s,T,_){var p=s("../internals/to-length");T.exports=function(o){return p(o.length)}},{"../internals/to-length":343}],300:[function(s,T,_){var p=s("../internals/function-uncurry-this"),o=s("../internals/fails"),a=s("../internals/is-callable"),r=s("../internals/has-own-property"),t=s("../internals/descriptors"),e=s("../internals/function-name").CONFIGURABLE,l=s("../internals/inspect-source"),n=s("../internals/internal-state"),i=n.enforce,u=n.get,h=String,c=Object.defineProperty,d=p("".slice),f=p("".replace),v=p([].join),x=t&&!o(function(){return c(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),I=T.exports=function(F,j,P){d(h(j),0,7)==="Symbol("&&(j="["+f(h(j),/^Symbol\(([^)]*)\)/,"$1")+"]"),P&&P.getter&&(j="get "+j),P&&P.setter&&(j="set "+j),(!r(F,"name")||e&&F.name!==j)&&(t?c(F,"name",{value:j,configurable:!0}):F.name=j),x&&P&&r(P,"arity")&&F.length!==P.arity&&c(F,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?t&&c(F,"prototype",{writable:!1}):F.prototype&&(F.prototype=void 0)}catch{}var D=i(F);return r(D,"source")||(D.source=v(A,typeof j=="string"?j:"")),F};Function.prototype.toString=I(function(){return a(this)&&u(this).source||l(this)},"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(s,T,_){var p=Math.ceil,o=Math.floor;T.exports=Math.trunc||function(a){var r=+a;return(r>0?o:p)(r)}},{}],302:[function(s,T,_){var p,o,a,r,t,e=s("../internals/global"),l=s("../internals/function-bind-context"),n=s("../internals/object-get-own-property-descriptor").f,i=s("../internals/task").set,u=s("../internals/queue"),h=s("../internals/engine-is-ios"),c=s("../internals/engine-is-ios-pebble"),d=s("../internals/engine-is-webos-webkit"),f=s("../internals/engine-is-node"),v=e.MutationObserver||e.WebKitMutationObserver,x=e.document,A=e.process,I=e.Promise,F=n(e,"queueMicrotask"),j=F&&F.value;if(!j){var P=new u,D=function(){var U,B;for(f&&(U=A.domain)&&U.exit();B=P.get();)try{B()}catch(k){throw P.head&&p(),k}U&&U.enter()};h||f||d||!v||!x?!c&&I&&I.resolve?((r=I.resolve(void 0)).constructor=I,t=l(r.then,r),p=function(){t(D)}):f?p=function(){A.nextTick(D)}:(i=l(i,e),p=function(){i(D)}):(o=!0,a=x.createTextNode(""),new v(D).observe(a,{characterData:!0}),p=function(){a.data=o=!o}),j=function(U){P.head||p(),P.add(U)}}T.exports=j},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(s,T,_){var p=s("../internals/a-callable"),o=TypeError,a=function(r){var t,e;this.promise=new r(function(l,n){if(t!==void 0||e!==void 0)throw new o("Bad Promise constructor");t=l,e=n}),this.resolve=p(t),this.reject=p(e)};T.exports.f=function(r){return new a(r)}},{"../internals/a-callable":222}],304:[function(s,T,_){var p=s("../internals/is-regexp"),o=TypeError;T.exports=function(a){if(p(a))throw new o("The method doesn't accept regular expressions");return a}},{"../internals/is-regexp":291}],305:[function(s,T,_){var p=s("../internals/descriptors"),o=s("../internals/function-uncurry-this"),a=s("../internals/function-call"),r=s("../internals/fails"),t=s("../internals/object-keys"),e=s("../internals/object-get-own-property-symbols"),l=s("../internals/object-property-is-enumerable"),n=s("../internals/to-object"),i=s("../internals/indexed-object"),u=Object.assign,h=Object.defineProperty,c=o([].concat);T.exports=!u||r(function(){if(p&&u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},f={},v=Symbol("assign detection");return d[v]=7,"abcdefghijklmnopqrst".split("").forEach(function(x){f[x]=x}),u({},d)[v]!==7||t(u({},f)).join("")!=="abcdefghijklmnopqrst"})?function(d,f){for(var v=n(d),x=arguments.length,A=1,I=e.f,F=l.f;x>A;)for(var j,P=i(arguments[A++]),D=I?c(t(P),I(P)):t(P),U=D.length,B=0;U>B;)j=D[B++],p&&!a(F,P,j)||(v[j]=P[j]);return v}:u},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(s,T,_){var p,o=s("../internals/an-object"),a=s("../internals/object-define-properties"),r=s("../internals/enum-bug-keys"),t=s("../internals/hidden-keys"),e=s("../internals/html"),l=s("../internals/document-create-element"),n=s("../internals/shared-key"),i=n("IE_PROTO"),u=function(){},h=function(f){return" +