import{L as ze}from"./index-ce075296.js";import{L as Ue}from"./Loading-64a0a139.js";import{F as He,l as hr}from"./lodash-d2e55fae.js";import{h as fr}from"./moment-a9aaa855.js";import{T as Ve}from"./index-60bd34b8.js";import{M as $e}from"./Multiselect-588e2743.js";import{S as dr}from"./SubmitButton-2e58df90.js";import{T as pr}from"./index-dcd47e83.js";import{P as mr}from"./index-a2c40815.js";import{b as br,X as Xt,Y as gr,_ as qe,r as fe,o as be,d as Ce,c as Re,a as _e,f as Ut,e as Zt,g as xe,h as Te,w as er,I as yr,H as Qe}from"./index-24f5bdc3.js";import{E as nr}from"./jspdf.es.min-7f157fbc.js";import{C as vr}from"./CompanyService-513cbf4b.js";import"./index-87a1df2e.js";import"./vue-cleave.min-4c03471d.js";import"./xhebrhsj-61f1ab94.js";import"./es.string.replace-f95ce264.js";import"./index-b856e681.js";const wr="https://ahg-prf-api.autohub.ph/api/v1/report",lr={generateReport(at={}){return br.get(`${wr}`,{params:at})}};function tr(at){throw new Error('Could not dynamically require "'+at+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ur={exports:{}};/*! ExcelJS 19-10-2023 */(function(at,ht){(function(a){at.exports=a()})(function(){return function a(T,_,p){function o(t,e){if(!_[t]){if(!T[t]){var s=typeof tr=="function"&&tr;if(!e&&s)return s(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=_[t]={exports:{}};T[t][0].call(i.exports,function(c){return o(T[t][1][c]||c)},i,i.exports,a,T,_,p)}return _[t].exports}for(var l=typeof tr=="function"&&tr,n=0;n{const d=this.workbook.addWorksheet(c.sheetName),f=c.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=c.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=f.reduce((P,F)=>{if(P)return P;const H=t(A,F,!0);return H.isValid()?H:null},null);if(L)return new Date(L.valueOf());const j=r[A];return j!==void 0?j:A},x=o.parse(c.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{x.emit("worksheet",d)});x.on("worksheet",h).on("error",u),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,c){return new Promise((h,u)=>{c=c||{};const d=this.workbook.getWorksheet(c.sheetName||c.sheetId),f=o.format(c.formatterOptions);i.on("finish",()=>{h()}),f.on("error",u),f.pipe(i);const{dateFormat:w,dateUTC:x}=c,A=c.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 w?x?t.utc(j).format(w):t(j).format(w):x?t.utc(j).format():t(j).format();if(j.error)return j.error;if(typeof j=="object")return JSON.stringify(j)}return j}),N=c.includeEmptyRows===void 0||c.includeEmptyRows;let L=1;d&&d.eachRow((j,P)=>{if(N)for(;L++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=n,t)if(typeof t=="string"){const s=p.decodeAddress(t);this.nativeCol=s.col+e,this.nativeColOff=0,this.nativeRow=s.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(n){return n instanceof o||n==null?n:new o(n)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(n){this.nativeCol=Math.floor(n),this.nativeColOff=Math.floor((n-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(n){this.nativeRow=Math.floor(n),this.nativeRowOff=Math.floor((n-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(n){this.nativeCol=n.nativeCol,this.nativeColOff=n.nativeColOff,this.nativeRow=n.nativeRow,this.nativeRowOff=n.nativeRowOff}}T.exports=o},{"../utils/col-cache":19}],3:[function(a,T,_){const p=a("../utils/col-cache"),o=a("../utils/under-dash"),l=a("./enums"),{slideFormula:n}=a("../utils/shared-formula"),t=a("./note");class e{constructor(i,c,h){if(!i||!c)throw new Error("A Cell needs a Row");this._row=i,this._column=c,p.validateAddress(h),this._address=h,this._value=s.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,c.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(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,c,h){const u=i&&i.numFmt||c&&c.numFmt;u&&(h.numFmt=u);const d=i&&i.font||c&&c.font;d&&(h.font=d);const f=i&&i.alignment||c&&c.alignment;f&&(h.alignment=f);const w=i&&i.border||c&&c.border;w&&(h.border=w);const x=i&&i.fill||c&&c.fill;x&&(h.fill=x);const A=i&&i.protection||c&&c.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,c){this._value.release(),this._value=s.create(e.Types.Merge,this,i),c||(this.style=i.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=s.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=s.create(s.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=s.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:c}=this.workbook;c.removeAllNames(this.fullAddress),i.forEach(h=>{c.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=s.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=l.ValueType;const s={getType:r=>r==null?e.Types.Null:r instanceof String||typeof r=="string"?e.Types.String:typeof r=="number"?e.Types.Number:typeof r=="boolean"?e.Types.Boolean:r instanceof Date?e.Types.Date:r.text&&r.hyperlink?e.Types.Hyperlink:r.formula||r.sharedFormula?e.Types.Formula:r.richText?e.Types.RichText:r.sharedString?e.Types.SharedString:r.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(r){this.model={address:r.address,type:e.Types.Null}}get value(){return null}set value(r){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.Number,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.Date,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(r,i){this.model={address:r.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 r={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(r.tooltip=this.model.tooltip),r}set value(r){this.model={text:r.text,hyperlink:r.hyperlink},r.tooltip&&(this.model.tooltip=r.tooltip)}get text(){return this.model.text}set text(r){this.model.text=r}get hyperlink(){return this.model.hyperlink}set hyperlink(r){this.model.hyperlink=r}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(r,i){this.cell=r,this.model={address:r.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(r){const i={},c=h=>{const u=r[h];u&&(i[h]=u)};return c("formula"),c("result"),c("ref"),c("shareType"),c("sharedFormula"),i}get value(){return this._copyModel(this.model)}set value(r){this.model=this._copyModel(r)}validate(r){switch(s.getType(r)){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(r){this.model.formula=r}get formulaType(){return this.model.formula?l.FormulaType.Master:this.model.sharedFormula?l.FormulaType.Shared:l.FormulaType.None}get result(){return this.model.result}set result(r){this.model.result=r}get type(){return e.Types.Formula}get effectiveType(){const r=this.model.result;return r==null?l.ValueType.Null:r instanceof String||typeof r=="string"?l.ValueType.String:typeof r=="number"?l.ValueType.Number:r instanceof Date?l.ValueType.Date:r.text&&r.hyperlink?l.ValueType.Hyperlink:r.formula?l.ValueType.Formula:l.ValueType.Null}get address(){return this.model.address}set address(r){this.model.address=r}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:r}=this.cell,i=r.findCell(this.model.sharedFormula);this._translatedFormula=i&&n(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(r,i){this.model={address:r.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(r){r instanceof e?(this._master&&this._master.releaseMergeRef(),r.addMergeRef(),this._master=r):this._master.value=r}isMergedTo(r){return r===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(r){this.model.address=r}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.String,value:JSON.stringify(i),rawValue:i}}get value(){return this.model.rawValue}set value(r){this.model.rawValue=r,this.model.value=JSON.stringify(r)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.SharedString,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}toString(){return this.model.value.richText.map(r=>r.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.Boolean,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(r,i){this.model={address:r.address,type:e.Types.Error,value:i}}get value(){return this.model.value}set value(r){this.model.value=r}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(r){this.model.address=r}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((r,i)=>(r[i.t]=i.f,r),[]),create(r,i,c){const h=this.types[r];if(!h)throw new Error("Could not create Value of type "+r);return new h(i,c)}};T.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(a,T,_){const p=a("../utils/under-dash"),o=a("./enums"),l=a("../utils/col-cache");class n{constructor(e,s,r){this._worksheet=e,this._number=s,r!==!1&&(this.defn=r)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return l.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((s,r)=>{this._worksheet.getCell(r+1,this.number).value=s})):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,s){const r=this.number;s||(s=e,e=null),this._worksheet.eachRow(e,(i,c)=>{s(i.getCell(r),c)})}get values(){const e=[];return this.eachCell((s,r)=>{s&&s.type!==o.ValueType.Null&&(e[r]=s.value)}),e}set values(e){if(!e)return;const s=this.number;let r=0;e.hasOwnProperty("0")&&(r=1),e.forEach((i,c)=>{this._worksheet.getCell(c+r,s).value=i})}_applyStyle(e,s){return this.style[e]=s,this.eachCell(r=>{r[e]=s}),s}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 s=[];let r=null;return e&&e.forEach((i,c)=>{i.isDefault?r&&(r=null):r&&i.equivalentTo(r)?r.max=c+1:(r={min:c+1,max:c+1,width:i.width!==void 0?i.width:9,style:i.style,isCustomWidth:i.isCustomWidth,hidden:i.hidden,outlineLevel:i.outlineLevel,collapsed:i.collapsed},s.push(r))}),s.length?s:void 0}static fromModel(e,s){const r=[];let i=1,c=0;for(s=(s=s||[]).sort(function(h,u){return h.min-u.min});c{s.removeCellEx(e)})}forEach(e){p.each(this.matrixMap,(s,r)=>{s.forEach(i=>{e(r,i)})})}getNames(e){return this.getNamesEx(o.decodeEx(e))}getNamesEx(e){return p.map(this.matrixMap,(s,r)=>s.findCellEx(e)&&r).filter(Boolean)}_explore(e,s){s.mark=!1;const{sheetName:r}=s,i=new n(s.row,s.col,s.row,s.col,r);let c,h;function u(f,w){const x=e.findCellAt(r,f,s.col);return!(!x||!x.mark)&&(i[w]=f,x.mark=!1,!0)}for(h=s.row-1;u(h,"top");h--);for(h=s.row+1;u(h,"bottom");h++);function d(f,w){const x=[];for(h=i.top;h<=i.bottom;h++){const A=e.findCellAt(r,h,f);if(!A||!A.mark)return!1;x.push(A)}i[w]=f;for(let A=0;A{r.mark=!0}),{name:e,ranges:s.map(r=>r.mark&&this._explore(s,r)).filter(Boolean).map(r=>r.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,s){e.forEachInSheet(s,(r,i,c)=>{r&&(r.row===i&&r.col===c||(r.row=i,r.col=c,r.address=o.n2l(c)+i))})}spliceRows(e,s,r,i){p.each(this.matrixMap,c=>{c.spliceRows(e,s,r,i),this.normaliseMatrix(c,e)})}spliceColumns(e,s,r,i){p.each(this.matrixMap,c=>{c.spliceColumns(e,s,r,i),this.normaliseMatrix(c,e)})}get model(){return p.map(this.matrixMap,(e,s)=>this.getRanges(s,e)).filter(e=>e.ranges.length)}set model(e){const s=this.matrixMap={};e.forEach(r=>{const i=s[r.name]=new l;r.ranges.forEach(c=>{t.test(c.split("!").pop()||"")&&i.addCell(c)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(a,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(a,T,_){const p=a("../utils/col-cache"),o=a("./anchor");T.exports=class{constructor(l,n){this.worksheet=l,this.model=n}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(l){let{type:n,imageId:t,range:e,hyperlinks:s}=l;if(this.type=n,this.imageId=t,n==="image")if(typeof e=="string"){const r=p.decode(e);this.range={tl:new o(this.worksheet,{col:r.left,row:r.top},-1),br:new o(this.worksheet,{col:r.right,row:r.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:s||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(a,T,_){const p=a("../utils/under-dash");class o{constructor(n){this.note=n}get model(){let n=null;switch(typeof this.note){case"string":n={type:"note",note:{texts:[{text:this.note}]}};break;default:n={type:"note",note:this.note}}return p.deepMerge({},o.DEFAULT_CONFIGS,n)}set model(n){const{note:t}=n,{texts:e}=t;e.length===1&&Object.keys(e[0]).length===1?this.note=e[0].text:this.note=t}static fromModel(n){const t=new o;return t.model=n,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(a,T,_){const p=a("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(n,t,e,s,r){if(arguments.length<4){const i=p.decodeAddress(n),c=p.decodeAddress(t);this.model={top:Math.min(i.row,c.row),left:Math.min(i.col,c.col),bottom:Math.max(i.row,c.row),right:Math.max(i.col,c.col),sheetName:e},this.setTLBR(i.row,i.col,c.row,c.col,r)}else this.model={top:Math.min(n,e),left:Math.min(t,s),bottom:Math.max(n,e),right:Math.max(t,s),sheetName:r}}decode(n){switch(n.length){case 5:this.setTLBR(n[0],n[1],n[2],n[3],n[4]);break;case 4:this.setTLBR(n[0],n[1],n[2],n[3]);break;case 3:this.setTLBR(n[0],n[1],n[2]);break;case 2:this.setTLBR(n[0],n[1]);break;case 1:{const t=n[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() - "+n.length)}}get top(){return this.model.top||1}set top(n){this.model.top=n}get left(){return this.model.left||1}set left(n){this.model.left=n}get bottom(){return this.model.bottom||1}set bottom(n){this.model.bottom=n}get right(){return this.model.right||1}set right(n){this.model.right=n}get sheetName(){return this.model.sheetName}set sheetName(n){this.model.sheetName=n}get _serialisedSheetName(){const{sheetName:n}=this.model;return n?/^[a-zA-Z0-9]*$/.test(n)?n+"!":`'${n}'!`:""}expand(n,t,e,s){(!this.model.top||nthis.bottom)&&(this.bottom=e),(!this.model.right||s>this.right)&&(this.right=s)}expandRow(n){if(n){const{dimensions:t,number:e}=n;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(n){const t=p.decodeEx(n);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(n){return(!n.sheetName||!this.sheetName||n.sheetName===this.sheetName)&&!(n.bottomthis.bottom)&&!(n.rightthis.right)}contains(n){const t=p.decodeEx(n);return this.containsEx(t)}containsEx(n){return(!n.sheetName||!this.sheetName||n.sheetName===this.sheetName)&&n.row>=this.top&&n.row<=this.bottom&&n.col>=this.left&&n.col<=this.right}forEachAddress(n){for(let t=this.left;t<=this.right;t++)for(let e=this.top;e<=this.bottom;e++)n(p.encodeAddress(e,t),e,t)}}T.exports=o},{"../utils/col-cache":19}],11:[function(a,T,_){const p=a("../utils/under-dash"),o=a("./enums"),l=a("../utils/col-cache"),n=a("./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 s=this._worksheet.getColumn(t.col);e=new n(this,s,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:l.l2n(t)}return this._cells[t-1]||this.getCellEx({address:l.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const s=t+e;for(var r=arguments.length,i=new Array(r>2?r-2:0),c=2;c0)for(d=u;d>=s;d--)f=this._cells[d-1],f?(w=this.getCell(d+h),w.value=f.value,w.style=f.style,w._comment=f._comment):this._cells[d+h-1]=void 0;for(d=0;d{s&&s.type!==o.ValueType.Null&&e(s,r+1)})}addPageBreak(t,e){const s=this._worksheet,r=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,c={id:this._number,max:i,man:1};r&&(c.min=r),s.rowBreaks.push(c)}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((s,r)=>{s!==void 0&&(this.getCellEx({address:l.encodeAddress(this._number,r+e),row:this._number,col:r+e}).value=s)})}else this._worksheet.eachColumnKey((e,s)=>{t[s]!==void 0&&(this.getCellEx({address:l.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[s])})}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(s=>{s&&s.type!==o.ValueType.Null&&((!t||t>s.col)&&(t=s.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(s=>{s&&(s[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,s=0;return this._cells.forEach(r=>{if(r){const i=r.model;i&&((!e||e>r.col)&&(e=r.col),s{switch(s.type){case n.Types.Merge:break;default:{let r;if(s.address)r=l.decodeAddress(s.address);else if(e){const{row:i}=e,c=e.col+1;r={row:i,col:c,address:l.encodeAddress(i,c),$col$row:`$${l.n2l(c)}$${i}`}}e=r,this.getCellEx(r).model=s;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(a,T,_){const p=a("../utils/col-cache");class o{constructor(n,t,e){this.table=n,this.column=t,this.index=e}_set(n,t){this.table.cacheState(),this.column[n]=t}get name(){return this.column.name}set name(n){this._set("name",n)}get filterButton(){return this.column.filterButton}set filterButton(n){this.column.filterButton=n}get style(){return this.column.style}set style(n){this.column.style=n}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(n){this._set("totalsRowLabel",n)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(n){this._set("totalsRowFunction",n)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(n){this._set("totalsRowResult",n)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(n){this._set("totalsRowFormula",n)}}T.exports=class{constructor(l,n){this.worksheet=l,n&&(this.table=n,this.validate(),this.store())}getFormula(l){switch(l.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${l.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${l.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${l.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${l.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${l.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${l.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${l.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${l.name}])`;case"custom":return l.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+l.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:l}=this,n=(h,u,d)=>{h[u]===void 0&&(h[u]=d)};n(l,"headerRow",!0),n(l,"totalsRow",!1),n(l,"style",{}),n(l.style,"theme","TableStyleMedium2"),n(l.style,"showFirstColumn",!1),n(l.style,"showLastColumn",!1),n(l.style,"showRowStripes",!1),n(l.style,"showColumnStripes",!1);const t=(h,u)=>{if(!h)throw new Error(u)};t(l.ref,"Table must have ref"),t(l.columns,"Table must have column definitions"),t(l.rows,"Table must have row definitions"),l.tl=p.decodeAddress(l.ref);const{row:e,col:s}=l.tl;t(e>0,"Table must be on valid row"),t(s>0,"Table must be on valid col");const{width:r,filterHeight:i,tableHeight:c}=this;l.autoFilterRef=p.encode(e,s,e+i-1,s+r-1),l.tableRef=p.encode(e,s,e+c-1,s+r-1),l.columns.forEach((h,u)=>{t(h.name,`Column ${u} must have a name`),u===0?n(h,"totalsRowLabel","Total"):(n(h,"totalsRowFunction","none"),h.totalsRowFormula=this.getFormula(h))})}store(){const l=(i,c)=>{c&&Object.keys(c).forEach(h=>{i[h]=c[h]})},{worksheet:n,table:t}=this,{row:e,col:s}=t.tl;let r=0;if(t.headerRow){const i=n.getRow(e+r++);t.columns.forEach((c,h)=>{const{style:u,name:d}=c,f=i.getCell(s+h);f.value=d,l(f,u)})}if(t.rows.forEach(i=>{const c=n.getRow(e+r++);i.forEach((h,u)=>{const d=c.getCell(s+u);d.value=h,l(d,t.columns[u].style)})}),t.totalsRow){const i=n.getRow(e+r++);t.columns.forEach((c,h)=>{const u=i.getCell(s+h);if(h===0)u.value=c.totalsRowLabel;else{const d=this.getFormula(c);u.value=d?{formula:c.totalsRowFormula,result:c.totalsRowResult}:null}l(u,c.style)})}}load(l){const{table:n}=this,{row:t,col:e}=n.tl;let s=0;if(n.headerRow){const r=l.getRow(t+s++);n.columns.forEach((i,c)=>{r.getCell(e+c).value=i.name})}if(n.rows.forEach(r=>{const i=l.getRow(t+s++);r.forEach((c,h)=>{i.getCell(e+h).value=c})}),n.totalsRow){const r=l.getRow(t+s++);n.columns.forEach((i,c)=>{const h=r.getCell(e+c);c===0?h.value=i.totalsRowLabel:this.getFormula(i)&&(h.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(l){this.table=l}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const l=p.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(l,n)}getColumn(l){const n=this.table.columns[l];return new o(this,n,l)}addColumn(l,n,t){this.cacheState(),t===void 0?(this.table.columns.push(l),this.table.rows.forEach((e,s)=>{e.push(n[s])})):(this.table.columns.splice(t,0,l),this.table.rows.forEach((e,s)=>{e.splice(t,0,n[s])}))}removeColumns(l){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(l,n),this.table.rows.forEach(t=>{t.splice(l,n)})}_assign(l,n,t){this.cacheState(),l[n]=t}get ref(){return this.table.ref}set ref(l){this._assign(this.table,"ref",l)}get name(){return this.table.name}set name(l){this.table.name=l}get displayName(){return this.table.displyName||this.table.name}set displayNamename(l){this.table.displayName=l}get headerRow(){return this.table.headerRow}set headerRow(l){this._assign(this.table,"headerRow",l)}get totalsRow(){return this.table.totalsRow}set totalsRow(l){this._assign(this.table,"totalsRow",l)}get theme(){return this.table.style.name}set theme(l){this.table.style.name=l}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(l){this.table.style.showFirstColumn=l}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(l){this.table.style.showLastColumn=l}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(l){this.table.style.showRowStripes=l}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(l){this.table.style.showColumnStripes=l}}},{"../utils/col-cache":19}],13:[function(a,T,_){const p=a("./worksheet"),o=a("./defined-names"),l=a("../xlsx/xlsx"),n=a("../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 l(this)),this._xlsx}get csv(){return this._csv||(this._csv=new n(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>h?u.orderNo:h,0),i=Object.assign({},e,{id:s,name:t,orderNo:r+1,workbook:this}),c=new p(i);return this._worksheets[s]=c,c}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:s,name:r,state:i}=e,c=t.sheets&&t.sheets.findIndex(h=>h.id===s);(this._worksheets[s]=new p({id:s,name:r,orderNo:c,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(a,T,_){const p=a("../utils/under-dash"),o=a("../utils/col-cache"),l=a("./range"),n=a("./row"),t=a("./column"),e=a("./enums"),s=a("./image"),r=a("./table"),i=a("./data-validations"),c=a("../utils/encryptor"),{copyStyle:h}=a("../utils/copy-style");T.exports=class{constructor(u){u=u||{},this._workbook=u.workbook,this.id=u.id,this.orderNo=u.orderNo,this.name=u.name,this.state=u.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},u.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:!(!u.pageSetup||!u.pageSetup.fitToWidth&&!u.pageSetup.fitToHeight||u.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},u.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},u.headerFooter),this.dataValidations=new i,this.views=u.views||[],this.autoFilter=u.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(u){if(u===void 0&&(u="sheet"+this.id),this._name!==u){if(typeof u!="string")throw new Error("The name has to be a string.");if(u==="")throw new Error("The name can't be empty.");if(u==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(u))throw new Error(`Worksheet name ${u} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(u))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+u);if(u&&u.length>31&&(console.warn(`Worksheet name ${u} exceeds 31 chars. This will be truncated`),u=u.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const u=new l;return this._rows.forEach(d=>{if(d){const f=d.dimensions;f&&u.expand(d.number,f.min,d.number,f.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((w,x)=>{const A=(x.header?1:x.headers&&x.headers.length)||0;return Math.max(w,A)},0);let d=1;const f=this._columns=[];u.forEach(w=>{const x=new t(this,d++,!1);f.push(x),x.defn=w})}getColumnKey(u){return this._keys[u]}setColumnKey(u,d){this._keys[u]=d}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){p.each(this._keys,u)}getColumn(u){if(typeof u=="string"){const d=this._keys[u];if(d)return d;u=o.l2n(u)}if(this._columns||(this._columns=[]),u>this._columns.length){let d=this._columns.length+1;for(;d<=u;)this._columns.push(new t(this,d++))}return this._columns[u-1]}spliceColumns(u,d){const f=this._rows.length;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A0)for(let P=0;P{F.push(D[P]||null)});const H=this.getRow(P+1);H.splice.apply(H,F)}else this._rows.forEach(P=>{P&&P.splice(u,d)});const N=x.length-d,L=u+d,j=this._columns.length;if(N<0)for(let P=u+x.length;P<=j;P++)this.getColumn(P).defn=this.getColumn(P-N).defn;else if(N>0)for(let P=j;P>=L;P--)this.getColumn(P+N).defn=this.getColumn(P).defn;for(let P=u;P{u=Math.max(u,d.cellCount)}),u}get actualColumnCount(){const u=[];let d=0;return this.eachRow(f=>{f.eachCell(w=>{let{col:x}=w;u[x]||(u[x]=!0,d++)})}),d}_commitRow(){}get _lastRowNumber(){const u=this._rows;let d=u.length;for(;d>0&&u[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(u){return this._rows[u-1]}findRows(u,d){return this._rows.slice(u-1,u-1+d)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let u=0;return this.eachRow(()=>{u++}),u}getRow(u){let d=this._rows[u-1];return d||(d=this._rows[u-1]=new n(this,u)),d}getRows(u,d){if(d<1)return;const f=[];for(let w=u;w1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,w=this.getRow(f);return w.values=u,this._setStyleOption(f,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return u.forEach(w=>{f.push(this.addRow(w,d))}),f}insertRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,f),this.getRow(u)}insertRows(u,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),f!=="n")for(let w=0;w1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,d[1]==="+"):d[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,d[1]==="+")}_copyStyle(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),x=this.getRow(d);x.style=h(w.style),w.eachCell({includeEmpty:f},(A,N)=>{x.getCell(N).style=h(A.style)}),x.height=w.height}duplicateRow(u,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this._rows[u-1],x=new Array(d).fill(w.values);this.spliceRows(u+1,f?0:d,...x);for(let A=0;A{N.getCell(j).style=L.style})}}spliceRows(u,d){const f=u+d;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A{H.getCell(S).style=D.style}),this._rows[P-1]=void 0}else this._rows[P+L-1]=void 0;else if(L>0)for(P=j;P>=f;P--)if(F=this._rows[P-1],F){const H=this.getRow(P+L);H.values=F.values,H.style=F.style,H.height=F.height,F.eachCell({includeEmpty:!0},(D,S)=>{if(H.getCell(S).style=D.style,D._value.constructor.name==="MergeValue"){const M=this.getRow(D._row._number+N).getCell(S),v=D._value._master,m=this.getRow(v._row._number+N).getCell(v._column._number);M.merge(m)}})}else this._rows[P+L-1]=void 0;for(P=0;P{f&&f.hasValues&&d(f,f.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const f=o.getAddress(u,d),w=this._rows[f.row-1];return w?w.findCell(f.col):void 0}getCell(u,d){const f=o.getAddress(u,d);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const f=this.getCell(u.top,u.left);for(let w=u.top;w<=u.bottom;w++)for(let x=u.left;x<=u.right;x++)(w>u.top||x>u.left)&&this.getCell(w,x).merge(f,d);this._merges[f.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let f=d.top;f<=d.bottom;f++)for(let w=d.left;w<=d.right;w++)this.getCell(f,w).unmerge();delete this._merges[u.address]}}get hasMerges(){return p.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,d=new Array(u),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const x=o.decode(u),{top:A,left:N,bottom:L,right:j}=x,P=j-N+1,F=o.encodeAddress(A,N),H=w==="shared";let D;D=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(M,v)=>f[M-A][v-N]:(M,v)=>f[(M-A)*P+(v-N)]:()=>{};let S=!0;for(let M=A;M<=L;M++)for(let v=N;v<=j;v++)S?(this.getCell(M,v).value={shareType:w,formula:d,ref:u,result:D(M,v)},S=!1):this.getCell(M,v).value=H?{sharedFormula:F,result:D(M,v)}:D(M,v)}addImage(u,d){const f={type:"image",imageId:u,range:d};this._media.push(new s(this,f))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){const d={type:"background",imageId:u};this._media.push(new s(this,d))}getBackgroundImageId(){const u=this._media.find(d=>d.type==="background");return u&&u.imageId}protect(u,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),u&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=c.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=c.convertPasswordToHash(u,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),d&&(this.sheetProtection=Object.assign(this.sheetProtection,d),!u&&"spinCount"in d&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(u){const d=new r(this,u);return this.tables[u.name]=d,d}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(u){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=u}get model(){const u={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(w=>w.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(w=>w.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const d=u.rows=[],f=u.dimensions=new l;return this._rows.forEach(w=>{const x=w&&w.model;x&&(f.expand(x.number,x.min,x.number,x.max),d.push(x))}),u.merges=[],p.each(this._merges,w=>{u.merges.push(w.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(d=>{const f=new n(this,d.number);this._rows[f.number-1]=f,f.model=d})}_parseMergeCells(u){p.each(u.mergeCells,d=>{this.mergeCellsWithoutStyle(d)})}set model(u){this.name=u.name,this._columns=t.fromModel(this,u.cols),this._parseRows(u),this._parseMergeCells(u),this.dataValidations=new i(u.dataValidations),this.properties=u.properties,this.pageSetup=u.pageSetup,this.headerFooter=u.headerFooter,this.views=u.views,this.autoFilter=u.autoFilter,this._media=u.media.map(d=>new s(this,d)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((d,f)=>{const w=new r;return w.model=f,d[f.name]=w,d},{}),this.conditionalFormattings=u.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(a,T,_){a("core-js/modules/es.promise"),a("core-js/modules/es.promise.finally"),a("core-js/modules/es.object.assign"),a("core-js/modules/es.object.keys"),a("core-js/modules/es.object.values"),a("core-js/modules/es.symbol"),a("core-js/modules/es.symbol.async-iterator"),a("core-js/modules/es.array.iterator"),a("core-js/modules/es.array.includes"),a("core-js/modules/es.array.find-index"),a("core-js/modules/es.array.find"),a("core-js/modules/es.string.from-code-point"),a("core-js/modules/es.string.includes"),a("core-js/modules/es.number.is-nan"),a("regenerator-runtime/runtime");const p={Workbook:a("./doc/workbook")},o=a("./doc/enums");Object.keys(o).forEach(l=>{p[l]=o[l]}),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(a,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(a,T,_){const p=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=a("buffer");_.stringToBuffer=function(l){return typeof l!="string"?l:p?o.from(p.encode(l).buffer):o.from(l)}},{buffer:220}],18:[function(a,T,_){const p=a("./under-dash"),o=a("./col-cache");T.exports=class{constructor(l){this.template=l,this.sheets={}}addCell(l){this.addCellEx(o.decodeEx(l))}getCell(l){return this.findCellEx(o.decodeEx(l),!0)}findCell(l){return this.findCellEx(o.decodeEx(l),!1)}findCellAt(l,n,t){const e=this.sheets[l],s=e&&e[n];return s&&s[t]}addCellEx(l){if(l.top)for(let n=l.top;n<=l.bottom;n++)for(let t=l.left;t<=l.right;t++)this.getCellAt(l.sheetName,n,t);else this.findCellEx(l,!0)}getCellEx(l){return this.findCellEx(l,!0)}findCellEx(l,n){const t=this.findSheet(l,n),e=this.findSheetRow(t,l,n);return this.findRowCell(e,l,n)}getCellAt(l,n,t){const e=this.sheets[l]||(this.sheets[l]=[]),s=e[n]||(e[n]=[]);return s[t]||(s[t]={sheetName:l,address:o.n2l(t)+n,row:n,col:t})}removeCellEx(l){const n=this.findSheet(l);if(!n)return;const t=this.findSheetRow(n,l);t&&delete t[l.col]}forEachInSheet(l,n){const t=this.sheets[l];t&&t.forEach((e,s)=>{e&&e.forEach((r,i)=>{r&&n(r,s,i)})})}forEach(l){p.each(this.sheets,(n,t)=>{this.forEachInSheet(t,l)})}map(l){const n=[];return this.forEach(t=>{n.push(l(t))}),n}findSheet(l,n){const t=l.sheetName;return this.sheets[t]?this.sheets[t]:n?this.sheets[t]=[]:void 0}findSheetRow(l,n,t){const{row:e}=n;return l&&l[e]?l[e]:t?l[e]=[]:void 0}findRowCell(l,n,t){const{col:e}=n;return l&&l[e]?l[e]:t?l[e]=this.template?Object.assign(n,JSON.parse(JSON.stringify(this.template))):n:void 0}spliceRows(l,n,t,e){const s=this.sheets[l];if(s){const r=[];for(let i=0;i{i.splice(n,t,...r)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(a,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:l=>l<=26?1:l<=676?2:3,_fill(l){let n,t,e,s,r,i=1;if(l>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&l>=1){for(;i<=26;)n=this._dictionary[i-1],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&l>=2){for(i=27;i<=702;)t=i-27,e=t%26,s=Math.floor(t/26),n=this._dictionary[s]+this._dictionary[e],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&l>=3){for(i=703;i<=16384;)t=i-703,e=t%26,s=Math.floor(t/26)%26,r=Math.floor(t/676),n=this._dictionary[r]+this._dictionary[s]+this._dictionary[e],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=3}},l2n(l){if(this._l2n[l]||this._fill(l.length),!this._l2n[l])throw new Error("Out of bounds. Invalid column letter: "+l);return this._l2n[l]},n2l(l){if(l<1||l>16384)throw new Error(l+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[l]||this._fill(this._level(l)),this._n2l[l]},_hash:{},validateAddress(l){if(!p.test(l))throw new Error("Invalid Address: "+l);return!0},decodeAddress(l){const n=l.length<5&&this._hash[l];if(n)return n;let t=!1,e="",s=0,r=!1,i="",c=0;for(let u,d=0;d=65&&u<=90)t=!0,e+=l[d],s=26*s+u-64;else if(u>=48&&u<=57)r=!0,i+=l[d],c=10*c+u-48;else if(r&&t&&u!==36)break;if(t){if(s>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else s=void 0;r||(c=void 0);const h={address:l=e+i,col:s,row:c,$col$row:`$${e}$${i}`};return s<=100&&c<=100&&(this._hash[l]=h,this._hash[h.$col$row]=h),h},getAddress(l,n){if(n){const t=this.n2l(n)+l;return this.decodeAddress(t)}return this.decodeAddress(l)},decode(l){const n=l.split(":");if(n.length===2){const t=this.decodeAddress(n[0]),e=this.decodeAddress(n[1]),s={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 s.tl=this.n2l(s.left)+s.top,s.br=this.n2l(s.right)+s.bottom,s.dimensions=`${s.tl}:${s.br}`,s}return this.decodeAddress(l)},decodeEx(l){const n=l.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=n[1]||n[2],e=n[3],s=e.split(":");if(s.length>1){let i=this.decodeAddress(s[0]),c=this.decodeAddress(s[1]);const h=Math.min(i.row,c.row),u=Math.min(i.col,c.col),d=Math.max(i.row,c.row),f=Math.max(i.col,c.col);return i=this.n2l(u)+h,c=this.n2l(f)+d,{top:h,left:u,bottom:d,right:f,sheetName:t,tl:{address:i,col:u,row:h,$col$row:`$${this.n2l(u)}$${h}`,sheetName:t},br:{address:c,col:f,row:d,$col$row:`$${this.n2l(f)}$${d}`,sheetName:t},dimensions:`${i}:${c}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const r=this.decodeAddress(e);return t?{sheetName:t,...r}:r},encodeAddress:(l,n)=>o.n2l(n)+l,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(l,n){const[t,e,,s,r]=l,[i,c]=n;return i>=t&&i<=s&&c>=e&&c<=r}};T.exports=o},{}],20:[function(a,T,_){const p=(l,n)=>({...l,...n.reduce((t,e)=>(l[e]&&(t[e]={...l[e]}),t),{})}),o=function(l,n,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];l[t]&&(n[t]=p(l[t],e))};_.copyStyle=l=>{if(!l)return l;if(n=l,Object.keys(n).length===0)return{};var n;const t={...l};return o(l,t,"font",["color"]),o(l,t,"alignment"),o(l,t,"protection"),l.border&&(o(l,t,"border"),o(l.border,t.border,"top",["color"]),o(l.border,t.border,"left",["color"]),o(l.border,t.border,"bottom",["color"]),o(l.border,t.border,"right",["color"]),o(l.border,t.border,"diagonal",["color"])),l.fill&&(o(l,t,"fill",["fgColor","bgColor","center"]),l.fill.stops&&(t.fill.stops=l.fill.stops.map(e=>p(e,["color"])))),t}},{}],21:[function(a,T,_){(function(p){(function(){const o=a("crypto"),l={hash(n){const t=o.createHash(n);for(var e=arguments.length,s=new Array(e>1?e-1:0),r=1;ro.randomBytes(n)};T.exports=l}).call(this)}).call(this,a("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(a,T,_){const{SaxesParser:p}=a("saxes"),{PassThrough:o}=a("readable-stream"),{bufferToString:l}=a("./browser-buffer-decode");T.exports=async function*(n){n.pipe&&!n[Symbol.asyncIterator]&&(n=n.pipe(new o));const t=new p;let e;t.on("error",r=>{e=r});let s=[];t.on("opentag",r=>s.push({eventType:"opentag",value:r})),t.on("text",r=>s.push({eventType:"text",value:r})),t.on("closetag",r=>s.push({eventType:"closetag",value:r}));for await(const r of n){if(t.write(l(r)),e)throw e;yield s,s=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(a,T,_){const p=a("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,l=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(n,t,e){const s=p.decode(t),r=p.decode(e);return n.replace(o,(i,c,h,u,d)=>{if(d)return i;const f=l.exec(u);if(f){const w=f[1],x=f[2].toUpperCase(),A=f[3],N=f[4];if(x.length>3||x.length===3&&x>"XFD")return i;let L=p.l2n(x),j=parseInt(N,10);return w||(L+=r.col-s.col),A||(j+=r.row-s.row),(c||"")+(w||"")+p.n2l(L)+(A||"")+j}return i})}}},{"./col-cache":19}],24:[function(a,T,_){(function(p,o){(function(){const l=a("readable-stream"),n=a("./utils"),t=a("./string-buf");class e{constructor(u,d){this._data=u,this._encoding=d}get length(){return this.toBuffer().length}copy(u,d,f,w){return this.toBuffer().copy(u,d,f,w)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class s{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,f,w){return this._data._buf.copy(u,d,f,w)}toBuffer(){return this._data.toBuffer()}}class r{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,f,w){this._data.copy(u,d,f,w)}toBuffer(){return this._data}}class i{constructor(u){this.size=u,this.buffer=o.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(u,0,this.iRead,this.iWrite),u}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(u){let d;return u===0?null:u===void 0||u>=this.length?(d=this.toBuffer(),this.iRead=this.iWrite,d):(d=o.alloc(u),this.buffer.copy(d,0,this.iRead,u),this.iRead+=u,d)}write(u,d,f){const w=Math.min(f,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,d,d+w),this.iWrite+=w,w}}const c=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};n.inherits(c,l.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 u=this.buffers[this.buffers.length-1];if(!u.full)return u}const h=new i(this.bufSize);return this.buffers.push(h),h},async _pipe(h){await Promise.all(this.pipes.map(function(u){return new Promise(d=>{u.write(h.toBuffer(),()=>{d()})})}))},_writeToBuffers(h){let u=0;const d=h.length;for(;u1;)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,u,d){const f=w=>{w?d(w):(this._flush(),this.pipes.forEach(x=>{x.end()}),this.emit("finish"))};h?this.write(h,u,f):f()},read(h){let u;if(h){for(u=[];h&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],f=d.read(h);h-=f.length,u.push(f),d.eod&&d.full&&this.buffers.shift()}return o.concat(u)}return u=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],o.concat(u)},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(u=>u!==h)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=c}).call(this)}).call(this,a("_process"),a("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(a,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 l=2*this._buf.length;for(;l=this._buf.length-4;)this._grow(this._inPos+o.length),l=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=l}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,a("buffer").Buffer)},{buffer:220}],26:[function(a,T,_){const{toString:p}=Object.prototype,o=/["&<>]/,l={each:function(n,t){n&&(Array.isArray(n)?n.forEach(t):Object.keys(n).forEach(e=>{t(n[e],e)}))},some:function(n,t){return!!n&&(Array.isArray(n)?n.some(t):Object.keys(n).some(e=>t(n[e],e)))},every:function(n,t){return!n||(Array.isArray(n)?n.every(t):Object.keys(n).every(e=>t(n[e],e)))},map:function(n,t){return n?Array.isArray(n)?n.map(t):Object.keys(n).map(e=>t(n[e],e)):[]},keyBy:(n,t)=>n.reduce((e,s)=>(e[s[t]]=s,e),{}),isEqual:function(n,t){const e=typeof n,s=typeof t,r=Array.isArray(n),i=Array.isArray(t);let c;if(e!==s)return!1;switch(typeof n){case"object":if(r||i)return!(!r||!i)&&n.length===t.length&&n.every((h,u)=>{const d=t[u];return l.isEqual(h,d)});if(n===null||t===null)return n===t;if(c=Object.keys(n),Object.keys(t).length!==c.length)return!1;for(const h of c)if(!t.hasOwnProperty(h))return!1;return l.every(n,(h,u)=>{const d=t[u];return l.isEqual(h,d)});default:return n===t}},escapeHtml(n){const t=o.exec(n);if(!t)return n;let e="",s="",r=0,i=t.index;for(;i":s=">";break;default:continue}r!==i&&(e+=n.substring(r,i)),r=i+1,e+=s}return r!==i?e+n.substring(r,i):e},strcmp:(n,t)=>nt?1:0,isUndefined:n=>p.call(n)==="[object Undefined]",isObject:n=>p.call(n)==="[object Object]",deepMerge(){const n=arguments[0]||{},{length:t}=arguments;let e,s,r;function i(c,h){e=n[h],r=Array.isArray(c),l.isObject(c)||r?(r?(r=!1,s=e&&Array.isArray(e)?e:[]):s=e&&l.isObject(e)?e:{},n[h]=l.deepMerge(s,c)):l.isUndefined(c)||(n[h]=c)}for(let c=0;c&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(s=>{p.setImmediate?o(()=>{s(e)}):setTimeout(()=>{s(e)},1)}),inherits:function(e,s,r,i){e.super_=s,i||(i=r,r=null),r&&Object.keys(r).forEach(h=>{Object.defineProperty(e,h,Object.getOwnPropertyDescriptor(r,h))});const c={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(h=>{c[h]=Object.getOwnPropertyDescriptor(i,h)}),e.prototype=Object.create(s.prototype,c)},dateToExcel:(e,s)=>25569+e.getTime()/864e5-(s?1462:0),excelToDate(e,s){const r=Math.round(24*(e-25569+(s?1462:0))*3600*1e3);return new Date(r)},parsePath(e){const s=e.lastIndexOf("/");return{path:e.substring(0,s),name:e.substring(s+1)}},getRelsPath(e){const s=t.parsePath(e);return`${s.path}/_rels/${s.name}.rels`},xmlEncode(e){const s=n.exec(e);if(!s)return e;let r="",i="",c=0,h=s.index;for(;h=11&&u!==13)){i="";break}continue}c!==h&&(r+=e.substring(c,h)),c=h+1,i&&(r+=i)}return c!==h?r+e.substring(c,h):r},xmlDecode:e=>e.replace(/&([a-z]*);/g,s=>{switch(s){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return s}}),validInt(e){const s=parseInt(e,10);return Number.isNaN(s)?0:s},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(s=>{l.access(e,l.constants.F_OK,r=>{s(!r)})})},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 Xt<"u"?Xt:typeof self<"u"?self:typeof window<"u"?window:{},a("timers").setImmediate)},{fs:216,timers:523}],28:[function(a,T,_){const p=a("./under-dash"),o=a("./utils");function l(e,s,r){e.push(` ${s}="${o.xmlEncode(r.toString())}"`)}function n(e,s){if(s){const r=[];p.each(s,(i,c)=>{i!==void 0&&l(r,c,i)}),e.push(r.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(s){const r=this._xml;r.push(" `)}openNode(s,r){const i=this.tos,c=this._xml;i&&this.open&&c.push(">"),this._stack.push(s),c.push("<"),c.push(s),n(c,r),this.leaf=!0,this.open=!0}addAttribute(s,r){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r!==void 0&&l(this._xml,s,r)}addAttributes(s){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n(this._xml,s)}writeText(s){const r=this._xml;this.open&&(r.push(">"),this.open=!1),this.leaf=!1,r.push(o.xmlEncode(s.toString()))}writeXml(s){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(s)}closeNode(){const s=this._stack.pop(),r=this._xml;this.leaf?r.push("/>"):(r.push("")),this.open=!1,this.leaf=!1}leafNode(s,r,i){this.openNode(s,r),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 s=this._rollbacks.pop();this._xml.length>s.xml&&this._xml.splice(s.xml,this._xml.length-s.xml),this._stack.length>s.stack&&this._stack.splice(s.stack,this._stack.length-s.stack),this.leaf=s.leaf,this.open=s.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(a,T,_){(function(p){(function(){const o=a("events"),l=a("jszip"),n=a("./stream-buf"),{stringToBuffer:t}=a("./browser-buffer-encode");class e extends o.EventEmitter{constructor(r){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},r),this.zip=new l,this.stream=new n}append(r,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,r,{base64:!0}):(p.browser&&typeof r=="string"&&(r=t(r)),this.zip.file(i.name,r))}async finalize(){const r=await this.zip.generateAsync(this.options);this.stream.end(r),this.emit("finish")}read(r){return this.stream.read(r)}setEncoding(r){return this.stream.setEncoding(r)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(r,i){return this.stream.pipe(r,i)}unpipe(r){return this.stream.unpipe(r)}unshift(r){return this.stream.unshift(r)}wrap(r){return this.stream.wrap(r)}}T.exports={ZipWriter:e}}).call(this)}).call(this,a("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(a,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(a,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(a,T,_){const p=a("../../utils/parse-sax"),o=a("../../utils/xml-stream");class l{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 l?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:s,value:r}of e)if(s==="opentag")this.parseOpen(r);else if(s==="text")this.parseText(r);else if(s==="closetag"&&!this.parseClose(r.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 s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(s)return e}else if(s||t!==e)return t.toString()}static toStringAttribute(t,e){let s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return l.toAttribute(t,e,s)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(s)return e}else if(s||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return l.toAttribute(t,e,s)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return l.toAttribute(t,e,s)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=l},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(a,T,_){const p=a("../base-xform"),o=a("../../../utils/col-cache");function l(t){try{return o.decodeEx(t),!0}catch{return!1}}function n(t){const e=[];let s=!1,r="";return t.split(",").forEach(i=>{if(!i)return;const c=(i.match(/'/g)||[]).length;if(!c)return void(s?r+=i+",":l(i)&&e.push(i));const h=c%2==0;!s&&h&&l(i)?e.push(i):s&&!h?(s=!1,l(r+i)&&e.push(r+i),r=""):(s=!0,r+=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:n(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(a,T,_){const p=a("../../../utils/utils"),o=a("../base-xform");T.exports=class extends o{render(l,n){l.leafNode("sheet",{sheetId:n.id,name:n.name,state:n.state,"r:id":n.rId})}parseOpen(l){return l.name==="sheet"&&(this.model={name:p.xmlDecode(l.attributes.name),id:parseInt(l.attributes.sheetId,10),state:l.attributes.state,rId:l.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:l.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){o.leafNode("workbookPr",{date1904:l.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(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){const n={xWindow:l.x||0,yWindow:l.y||0,windowWidth:l.width||12e3,windowHeight:l.height||24e3,firstSheet:l.firstSheet,activeTab:l.activeTab};l.visibility&&l.visibility!=="visible"&&(n.visibility=l.visibility),o.leafNode("workbookView",n)}parseOpen(o){if(o.name==="workbookView"){const l=this.model={},n=function(e,s,r){const i=s!==void 0?l[e]=s:r;i!==void 0&&(l[e]=i)},t=function(e,s,r){const i=s!==void 0?l[e]=parseInt(s,10):r;i!==void 0&&(l[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),n("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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../../../utils/col-cache"),l=a("../../../utils/xml-stream"),n=a("../base-xform"),t=a("../static-xform"),e=a("../list-xform"),s=a("./defined-name-xform"),r=a("./sheet-xform"),i=a("./workbook-view-xform"),c=a("./workbook-properties-xform"),h=a("./workbook-calc-properties-xform");class u extends n{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new c,bookViews:new e({tag:"bookViews",count:!1,childXform:new i}),sheets:new e({tag:"sheets",count:!1,childXform:new r}),definedNames:new e({tag:"definedNames",count:!1,childXform:new s}),calcPr:new h}}prepare(f){f.sheets=f.worksheets;const w=[];let x=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(N=>{const L=N.split(":"),j={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${L[0]}:$${L[1]}`],localSheetId:x};w.push(j)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const N=[];if(A.pageSetup.printTitlesColumn){const j=A.pageSetup.printTitlesColumn.split(":");N.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}if(A.pageSetup.printTitlesRow){const j=A.pageSetup.printTitlesRow.split(":");N.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}const L={name:"_xlnm.Print_Titles",ranges:N,localSheetId:x};w.push(L)}x++}),w.length&&(f.definedNames=f.definedNames.concat(w)),(f.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(f,w){f.openXml(l.StdDocAttributes),f.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,w.properties),this.map.bookViews.render(f,w.views),this.map.sheets.render(f,w.sheets),this.map.definedNames.render(f,w.definedNames),this.map.calcPr.render(f,w.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 w=(f.workbookRels||[]).reduce((j,P)=>(j[P.Id]=P,j),{}),x=[];let A,N=0;(f.sheets||[]).forEach(j=>{const P=w[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[N++]=A))});const L=[];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(","),F=/\$/g,H=/\$\d+:\$\d+/,D=P.match(H);if(D&&D.length){const v=D[0];A.pageSetup.printTitlesRow=v.replace(F,"")}const S=/\$[A-Z]+:\$[A-Z]+/,M=P.match(S);if(M&&M.length){const v=M[0];A.pageSetup.printTitlesColumn=v.replace(F,"")}}}else L.push(j)}),f.definedNames=L,f.media.forEach((j,P)=>{j.index=P})}}u.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"},u.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},T.exports=u},{"../../../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(a,T,_){const p=a("../strings/rich-text-xform"),o=a("../../../utils/utils"),l=a("../base-xform"),n=T.exports=function(t){this.model=t};o.inherits(n,l,{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(s=>{this.richTextXform.render(t,s)}),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(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../../../utils/utils"),l=a("../base-xform"),n=a("./comment-xform"),t=T.exports=function(){this.map={comment:new n}};o.inherits(t,l,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,s){s=s||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"),s.comments.forEach(r=>{this.map.comment.render(e,r)}),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(a,T,_){const p=a("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,l,n){(l===n[2]||this.tag==="x:SizeWithCells"&&l===n[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(a,T,_){const p=a("../../base-xform");T.exports=class extends p{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,l){o.leafNode(this.tag,null,l)}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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"x:Anchor"}getAnchorRect(o){const l=Math.floor(o.left),n=Math.floor(68*(o.left-l)),t=Math.floor(o.top),e=Math.floor(18*(o.top-t)),s=Math.floor(o.right),r=Math.floor(68*(o.right-s)),i=Math.floor(o.bottom);return[l,n,t,e,s,r,i,Math.floor(18*(o.bottom-i))]}getDefaultRect(o){const l=o.col,n=Math.max(o.row-2,0);return[l,6,n,14,l+2,2,n+4,16]}render(o,l){const n=l.anchor?this.getAnchorRect(l.anchor):this.getDefaultRect(l.refAddress);o.leafNode("x:Anchor",null,n.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(a,T,_){const p=a("../base-xform"),o=a("./vml-anchor-xform"),l=a("./style/vml-protection-xform"),n=a("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends p{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new l({tag:"x:Locked"}),"x:LockText":new l({tag:"x:LockText"}),"x:SizeWithCells":new n({tag:"x:SizeWithCells"}),"x:MoveWithCells":new n({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,s){const{protection:r,editAs:i}=s.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,s),this.map["x:Locked"].render(e,r.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,r.lockText),e.leafNode("x:Row",null,s.refAddress.row-1),e.leafNode("x:Column",null,s.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),s=Object.keys(e).length;this.model.editAs=t[s],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(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("./vml-shape-xform");class n extends o{constructor(){super(),this.map={"v:shape":new l}}get tag(){return"xml"}render(e,s){e.openXml(p.StdDocAttributes),e.openNode(this.tag,n.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(),s.comments.forEach((r,i)=>{this.map["v:shape"].render(e,r,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,s){e.anchors.forEach(r=>{r.br?this.map["xdr:twoCellAnchor"].reconcile(r,s):this.map["xdr:oneCellAnchor"].reconcile(r,s)})}}n.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=n},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(a,T,_){const p=a("../base-xform"),o=a("./vml-textbox-xform"),l=a("./vml-client-data-xform");class n extends p{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new l}}get tag(){return"v:shape"}render(e,s,r){e.openNode("v:shape",n.V_SHAPE_ATTRIBUTES(s,r)),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,s),this.map["x:ClientData"].render(e,s),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}}}n.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=n},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"v:textbox"}conversionUnit(o,l,n){return`${parseFloat(o)*l.toFixed(2)}${n}`}reverseConversionUnit(o){return(o||"").split(",").map(l=>Number(parseFloat(this.conversionUnit(parseFloat(l),.1,"")).toFixed(2)))}render(o,l){const n={style:"mso-direction-alt:auto"};if(l&&l.note){let{inset:t}=l.note&&l.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(n.inset=t)}o.openNode("v:textbox",n),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(a,T,_){const p=a("./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,l){this.model[o]=l.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(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){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,l.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:l.length,baseType:"lpstr"}),l.forEach(n=>{o.leafNode("vt:lpstr",void 0,n.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("../simple/string-xform"),n=a("./app-heading-pairs-xform"),t=a("./app-titles-of-parts-xform");class e extends o{constructor(){super(),this.map={Company:new l({tag:"Company"}),Manager:new l({tag:"Manager"}),HeadingPairs:new n,TitleOfParts:new t}}render(r,i){r.openXml(p.StdDocAttributes),r.openNode("Properties",e.PROPERTY_ATTRIBUTES),r.leafNode("Application",void 0,"Microsoft Excel"),r.leafNode("DocSecurity",void 0,"0"),r.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(r,i.worksheets),this.map.TitleOfParts.render(r,i.worksheets),this.map.Company.render(r,i.company||""),this.map.Manager.render(r,i.manager),r.leafNode("LinksUpToDate",void 0,"false"),r.leafNode("SharedDoc",void 0,"false"),r.leafNode("HyperlinksChanged",void 0,"false"),r.leafNode("AppVersion",void 0,"16.0300"),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"Properties":return!0;default: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)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){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(s){return s.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(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform");class l extends o{render(t,e){t.openXml(p.StdDocAttributes),t.openNode("Types",l.PROPERTY_ATTRIBUTES);const s={};(e.media||[]).forEach(r=>{if(r.type==="image"){const i=r.extension;s[i]||(s[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(r=>{const i=`/xl/worksheets/sheet${r.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(r=>{t.leafNode("Override",{PartName:"/xl/tables/"+r.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(r=>{t.leafNode("Override",{PartName:`/xl/drawings/${r.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(r=>{let{commentName:i}=r;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}}l.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("../simple/date-xform"),n=a("../simple/string-xform"),t=a("../simple/integer-xform");class e extends o{constructor(){super(),this.map={"dc:creator":new n({tag:"dc:creator"}),"dc:title":new n({tag:"dc:title"}),"dc:subject":new n({tag:"dc:subject"}),"dc:description":new n({tag:"dc:description"}),"dc:identifier":new n({tag:"dc:identifier"}),"dc:language":new n({tag:"dc:language"}),"cp:keywords":new n({tag:"cp:keywords"}),"cp:category":new n({tag:"cp:category"}),"cp:lastModifiedBy":new n({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new l({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new n({tag:"cp:version"}),"cp:contentStatus":new n({tag:"cp:contentStatus"}),"cp:contentType":new n({tag:"cp:contentType"}),"dcterms:created":new l({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new l({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(r,i){r.openXml(p.StdDocAttributes),r.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(r,i.creator),this.map["dc:title"].render(r,i.title),this.map["dc:subject"].render(r,i.subject),this.map["dc:description"].render(r,i.description),this.map["dc:identifier"].render(r,i.identifier),this.map["dc:language"].render(r,i.language),this.map["cp:keywords"].render(r,i.keywords),this.map["cp:category"].render(r,i.category),this.map["cp:lastModifiedBy"].render(r,i.lastModifiedBy),this.map["cp:lastPrinted"].render(r,i.lastPrinted),this.map["cp:revision"].render(r,i.revision),this.map["cp:version"].render(r,i.version),this.map["cp:contentStatus"].render(r,i.contentStatus),this.map["cp:contentType"].render(r,i.contentType),this.map["dcterms:created"].render(r,i.created),this.map["dcterms:modified"].render(r,i.modified),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[r.name],this.parser)return this.parser.parseOpen(r),!0;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.parser=void 0),!0;switch(r){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: "+r)}}}e.DateFormat=function(s){return s.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(a,T,_){const p=a("../base-xform");T.exports=class extends p{render(o,l){o.leafNode("Relationship",l)}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(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("./relationship-xform");class n extends o{constructor(){super(),this.map={Relationship:new l}}render(e,s){s=s||this._values,e.openXml(p.StdDocAttributes),e.openNode("Relationships",n.RELATIONSHIPS_ATTRIBUTES),s.forEach(r=>{this.map.Relationship.render(e,r)}),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)}}}n.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},T.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(a,T,_){const p=a("../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,l){if(o&&o.rId){const n=l.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){const t=n[1],e=l.mediaIndex[t];return l.media[e]}}}}},{"../base-xform":32}],57:[function(a,T,_){const p=a("../base-xform"),o=a("./blip-xform");T.exports=class extends p{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(l,n){l.openNode(this.tag),this.map["a:blip"].render(l,n),l.openNode("a:stretch"),l.leafNode("a:fillRect"),l.closeNode(),l.closeNode()}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case this.tag:this.reset();break;default:this.parser=this.map[l.name],this.parser&&this.parser.parseOpen(l)}return!0}parseText(){}parseClose(l){if(this.parser)return this.parser.parseClose(l)||(this.parser=void 0),!0;switch(l){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"a:blip"}render(o,l){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":l.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(a,T,_){const p=a("../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(a,T,_){const p=a("../base-xform"),o=a("./hlink-click-xform"),l=a("./ext-lst-xform");T.exports=class extends p{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new l}}get tag(){return"xdr:cNvPr"}render(n,t){n.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(n,t),this.map["a:extLst"].render(n,t),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(){}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(a,T,_){const p=a("../base-xform"),o=a("../simple/integer-xform");T.exports=class extends p{constructor(l){super(),this.tag=l.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(l,n){l.openNode(this.tag),this.map["xdr:col"].render(l,n.nativeCol),this.map["xdr:colOff"].render(l,n.nativeColOff),this.map["xdr:row"].render(l,n.nativeRow),this.map["xdr:rowOff"].render(l,n.nativeRowOff),l.closeNode()}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case this.tag:this.reset();break;default:this.parser=this.map[l.name],this.parser&&this.parser.parseOpen(l)}return!0}parseText(l){this.parser&&this.parser.parseText(l)}parseClose(l){if(this.parser)return this.parser.parseClose(l)||(this.parser=void 0),!0;switch(l){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(a,T,_){const p=a("../../../utils/col-cache"),o=a("../../../utils/xml-stream"),l=a("../base-xform"),n=a("./two-cell-anchor-xform"),t=a("./one-cell-anchor-xform");class e extends l{constructor(){super(),this.map={"xdr:twoCellAnchor":new n,"xdr:oneCellAnchor":new t}}prepare(r){r.anchors.forEach((i,c)=>{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:c})})}get tag(){return"xdr:wsDr"}render(r,i){r.openXml(o.StdDocAttributes),r.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(c=>{this.map[c.anchorType].render(r,c)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(r){case this.tag:return!1;default:return!0}}reconcile(r,i){r.anchors.forEach(c=>{c.br?this.map["xdr:twoCellAnchor"].reconcile(c,i):this.map["xdr:oneCellAnchor"].reconcile(c,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(a,T,_){const p=a("../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(a,T,_){const p=a("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,l){o.openNode(this.tag);const n=Math.floor(9525*l.width),t=Math.floor(9525*l.height);o.addAttribute("cx",n),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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"a:hlinkClick"}render(o,l){l.hyperlinks&&l.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":l.hyperlinks.rId,tooltip:l.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(a,T,_){const p=a("../base-xform"),o=a("./c-nv-pr-xform"),l=a("./c-nv-pic-pr-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new l}}get tag(){return"xdr:nvPicPr"}render(n,t){n.openNode(this.tag),this.map["xdr:cNvPr"].render(n,t),this.map["xdr:cNvPicPr"].render(n,t),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(){}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(a,T,_){const p=a("./base-cell-anchor-xform"),o=a("../static-xform"),l=a("./cell-position-xform"),n=a("./ext-xform"),t=a("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new l({tag:"xdr:from"}),"xdr:ext":new n({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,s){this.map["xdr:pic"].prepare(e.picture,s)}render(e,s){e.openNode(this.tag,{editAs:s.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,s.range.tl),this.map["xdr:ext"].render(e,s.range.ext),this.map["xdr:pic"].render(e,s.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,s){e.medium=this.reconcilePicture(e.picture,s)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(a,T,_){const p=a("../base-xform"),o=a("../static-xform"),l=a("./blip-fill-xform"),n=a("./nv-pic-pr-xform"),t=a("./sp-pr");T.exports=class extends p{constructor(){super(),this.map={"xdr:nvPicPr":new n,"xdr:blipFill":new l,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(e,s){e.index=s.index+1}render(e,s){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,s),this.map["xdr:blipFill"].render(e,s),this.map["xdr:spPr"].render(e,s),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(a,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(a,T,_){const p=a("./base-cell-anchor-xform"),o=a("../static-xform"),l=a("./cell-position-xform"),n=a("./pic-xform");T.exports=class extends p{constructor(){super(),this.map={"xdr:from":new l({tag:"xdr:from"}),"xdr:to":new l({tag:"xdr:to"}),"xdr:pic":new n,"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(a,T,_){const p=a("./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,l){const{childXform:n}=this;o&&o.forEach((t,e)=>{l.index=e,n.prepare(t,l)})}render(o,l){if(this.always||l&&l.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,l&&l.length||0);const{childXform:n}=this;(l||[]).forEach((t,e)=>{n.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,l){if(o){const{childXform:n}=this;o.forEach(t=>{n.reconcile(t,l)})}}}},{"./base-xform":32}],72:[function(a,T,_){const p=a("../../../utils/col-cache"),o=a("../base-xform");T.exports=class extends o{get tag(){return"autoFilter"}render(l,n){if(n)if(typeof n=="string")l.leafNode("autoFilter",{ref:n});else{const t=function(r){return typeof r=="string"?r:p.getAddress(r.row,r.column).address},e=t(n.from),s=t(n.to);e&&s&&l.leafNode("autoFilter",{ref:`${e}:${s}`})}}parseOpen(l){l.name==="autoFilter"&&(this.model=l.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(a,T,_){const p=a("../../../utils/utils"),o=a("../base-xform"),l=a("../../../doc/range"),n=a("../../../doc/enums"),t=a("../strings/rich-text-xform");function e(s){if(s==null)return n.ValueType.Null;if(s instanceof String||typeof s=="string")return n.ValueType.String;if(typeof s=="number")return n.ValueType.Number;if(typeof s=="boolean")return n.ValueType.Boolean;if(s instanceof Date)return n.ValueType.Date;if(s.text&&s.hyperlink)return n.ValueType.Hyperlink;if(s.formula)return n.ValueType.Formula;if(s.error)return n.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(s,r){const i=r.styles.addStyleModel(s.style||{},function(c){switch(c.type){case n.ValueType.Formula:return e(c.result);default:return c.type}}(s));switch(i&&(s.styleId=i),s.comment&&r.comments.push({...s.comment,ref:s.address}),s.type){case n.ValueType.String:case n.ValueType.RichText:r.sharedStrings&&(s.ssId=r.sharedStrings.add(s.value));break;case n.ValueType.Date:r.date1904&&(s.date1904=!0);break;case n.ValueType.Hyperlink:r.sharedStrings&&s.text!==void 0&&s.text!==null&&(s.ssId=r.sharedStrings.add(s.text)),r.hyperlinks.push({address:s.address,target:s.hyperlink,tooltip:s.tooltip});break;case n.ValueType.Merge:r.merges.add(s);break;case n.ValueType.Formula:if(r.date1904&&(s.date1904=!0),s.shareType==="shared"&&(s.si=r.siFormulae++),s.formula)r.formulae[s.address]=s;else if(s.sharedFormula){const c=r.formulae[s.sharedFormula];if(!c)throw new Error("Shared Formula master must exist above and or left of clone for cell "+s.address);c.si===void 0?(c.shareType="shared",c.si=r.siFormulae++,c.range=new l(c.address,s.address)):c.range&&c.range.expandToAddress(s.address),s.si=c.si}}}renderFormula(s,r){let i=null;switch(r.shareType){case"shared":i={t:"shared",ref:r.ref||r.range.range,si:r.si};break;case"array":i={t:"array",ref:r.ref};break;default:r.si!==void 0&&(i={t:"shared",si:r.si})}switch(e(r.result)){case n.ValueType.Null:s.leafNode("f",i,r.formula);break;case n.ValueType.String:s.addAttribute("t","str"),s.leafNode("f",i,r.formula),s.leafNode("v",null,r.result);break;case n.ValueType.Number:s.leafNode("f",i,r.formula),s.leafNode("v",null,r.result);break;case n.ValueType.Boolean:s.addAttribute("t","b"),s.leafNode("f",i,r.formula),s.leafNode("v",null,r.result?1:0);break;case n.ValueType.Error:s.addAttribute("t","e"),s.leafNode("f",i,r.formula),s.leafNode("v",null,r.result.error);break;case n.ValueType.Date:s.leafNode("f",i,r.formula),s.leafNode("v",null,p.dateToExcel(r.result,r.date1904));break;default:throw new Error("I could not understand type of value")}}render(s,r){if(r.type!==n.ValueType.Null||r.styleId){switch(s.openNode("c"),s.addAttribute("r",r.address),r.styleId&&s.addAttribute("s",r.styleId),r.type){case n.ValueType.Null:break;case n.ValueType.Number:s.leafNode("v",null,r.value);break;case n.ValueType.Boolean:s.addAttribute("t","b"),s.leafNode("v",null,r.value?"1":"0");break;case n.ValueType.Error:s.addAttribute("t","e"),s.leafNode("v",null,r.value.error);break;case n.ValueType.String:case n.ValueType.RichText:r.ssId!==void 0?(s.addAttribute("t","s"),s.leafNode("v",null,r.ssId)):r.value&&r.value.richText?(s.addAttribute("t","inlineStr"),s.openNode("is"),r.value.richText.forEach(i=>{this.richTextXForm.render(s,i)}),s.closeNode("is")):(s.addAttribute("t","str"),s.leafNode("v",null,r.value));break;case n.ValueType.Date:s.leafNode("v",null,p.dateToExcel(r.value,r.date1904));break;case n.ValueType.Hyperlink:r.ssId!==void 0?(s.addAttribute("t","s"),s.leafNode("v",null,r.ssId)):(s.addAttribute("t","str"),s.leafNode("v",null,r.text));break;case n.ValueType.Formula:this.renderFormula(s,r);break;case n.ValueType.Merge:}s.closeNode()}}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case"c":return this.model={address:s.attributes.r},this.t=s.attributes.t,s.attributes.s&&(this.model.styleId=parseInt(s.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=s.attributes.si,this.model.shareType=s.attributes.t,this.model.ref=s.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(s),!0;default:return!1}}parseText(s){if(this.parser)this.parser.parseText(s);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+s:s;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+s:s:this.model.value=this.model.value?this.model.value+s:s}}parseClose(s){switch(s){case"c":{const{model:r}=this;if(r.formula||r.shareType)r.type=n.ValueType.Formula,r.value&&(this.t==="str"?r.result=p.xmlDecode(r.value):this.t==="b"?r.result=parseInt(r.value,10)!==0:this.t==="e"?r.result={error:r.value}:r.result=parseFloat(r.value),r.value=void 0);else if(r.value!==void 0)switch(this.t){case"s":r.type=n.ValueType.String,r.value=parseInt(r.value,10);break;case"str":r.type=n.ValueType.String,r.value=p.xmlDecode(r.value);break;case"inlineStr":r.type=n.ValueType.String;break;case"b":r.type=n.ValueType.Boolean,r.value=parseInt(r.value,10)!==0;break;case"e":r.type=n.ValueType.Error,r.value={error:r.value};break;default:r.type=n.ValueType.Number,r.value=parseFloat(r.value)}else r.styleId?r.type=n.ValueType.Null:r.type=n.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(s),!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(s),!0)}}reconcile(s,r){const i=s.styleId&&r.styles&&r.styles.getStyleModel(s.styleId);switch(i&&(s.style=i),s.styleId!==void 0&&(s.styleId=void 0),s.type){case n.ValueType.String:typeof s.value=="number"&&r.sharedStrings&&(s.value=r.sharedStrings.getString(s.value)),s.value.richText&&(s.type=n.ValueType.RichText);break;case n.ValueType.Number:i&&p.isDateFmt(i.numFmt)&&(s.type=n.ValueType.Date,s.value=p.excelToDate(s.value,r.date1904));break;case n.ValueType.Formula:s.result!==void 0&&i&&p.isDateFmt(i.numFmt)&&(s.result=p.excelToDate(s.result,r.date1904)),s.shareType==="shared"&&(s.ref?r.formulae[s.si]=s.address:(s.sharedFormula=r.formulae[s.si],delete s.shareType),delete s.si)}const c=r.hyperlinkMap[s.address];c&&(s.type===n.ValueType.Formula?(s.text=s.result,s.result=void 0):(s.text=s.value,s.value=void 0),s.type=n.ValueType.Hyperlink,s.hyperlink=c);const h=r.commentsMap&&r.commentsMap[s.address];h&&(s.comment=h)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(a,T,_){const p=a("../../base-xform");T.exports=class extends p{get tag(){return"x14:cfIcon"}render(o,l){o.leafNode(this.tag,{iconSet:l.iconSet,iconId:l.iconId})}parseOpen(o){let{attributes:l}=o;this.model={iconSet:l.iconSet,iconId:p.toIntValue(l.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(a,T,_){const{v4:p}=a("uuid"),o=a("../../base-xform"),l=a("../../composite-xform"),n=a("./databar-ext-xform"),t=a("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class s extends l{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new n,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(i){return i.type==="dataBar"?n.isExt(i):!(i.type!=="iconSet"||!i.custom&&!e[i.iconSet])}prepare(i){s.isExt(i)&&(i.x14Id=`{${p()}}`.toUpperCase())}render(i,c){if(s.isExt(c))switch(c.type){case"dataBar":this.renderDataBar(i,c);break;case"iconSet":this.renderIconSet(i,c)}}renderDataBar(i,c){i.openNode(this.tag,{type:"dataBar",id:c.x14Id}),this.databarXform.render(i,c),i.closeNode()}renderIconSet(i,c){i.openNode(this.tag,{type:"iconSet",priority:c.priority,id:c.x14Id||`{${p()}}`}),this.iconSetXform.render(i,c),i.closeNode()}createNewModel(i){let{attributes:c}=i;return{type:c.type,x14Id:c.id,priority:o.toIntValue(c.priority)}}onParserClose(i,c){Object.assign(this.model,c.model)}}T.exports=s},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(a,T,_){const p=a("../../composite-xform"),o=a("./f-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(l,n){l.openNode(this.tag,{type:n.type}),n.value!==void 0&&this.fExtXform.render(l,n.value),l.closeNode()}createNewModel(l){return{type:l.attributes.type}}onParserClose(l,n){switch(l){case"xm:f":this.model.value=n.model?parseFloat(n.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(a,T,_){const p=a("../../composite-xform"),o=a("./sqref-ext-xform"),l=a("./cf-rule-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new l}}get tag(){return"x14:conditionalFormatting"}prepare(n,t){n.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(n,t){t.rules.some(l.isExt)&&(n.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(l.isExt).forEach(e=>this.cfRule.render(n,e)),this.sqRef.render(n,t.ref),n.closeNode())}createNewModel(){return{rules:[]}}onParserClose(n,t){switch(n){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(a,T,_){const p=a("../../composite-xform"),o=a("./cf-rule-ext-xform"),l=a("./conditional-formatting-ext-xform");T.exports=class extends p{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new l}}get tag(){return"x14:conditionalFormattings"}hasContent(n){return n.hasExtContent===void 0&&(n.hasExtContent=n.some(t=>t.rules.some(o.isExt))),n.hasExtContent}prepare(n,t){n.forEach(e=>{this.cfXform.prepare(e,t)})}render(n,t){this.hasContent(t)&&(n.openNode(this.tag),t.forEach(e=>this.cfXform.render(n,e)),n.closeNode())}createNewModel(){return[]}onParserClose(n,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(a,T,_){const p=a("../../base-xform"),o=a("../../composite-xform"),l=a("../../style/color-xform"),n=a("./cfvo-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new n,"x14:borderColor":this.borderColorXform=new l("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new l("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new l("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new l("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(s=>{this.cfvoXform.render(t,s)}),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[,s]=t.split(":");switch(s){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[s]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(a,T,_){const p=a("../../base-xform");T.exports=class extends p{get tag(){return"xm:f"}render(o,l){o.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(a,T,_){const p=a("../../base-xform"),o=a("../../composite-xform"),l=a("./cfvo-ext-xform"),n=a("./cf-icon-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new l,"x14:cfIcon":this.cfIconXform=new n}}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(s=>{this.cfvoXform.render(t,s)}),e.icons&&e.icons.forEach((s,r)=>{s.iconId=r,this.cfIconXform.render(t,s)}),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[,s]=t.split(":");switch(s){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[s]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(a,T,_){const p=a("../../base-xform");T.exports=class extends p{get tag(){return"xm:sqref"}render(o,l){o.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(a,T,_){const p=a("../../base-xform"),o=a("../../composite-xform"),l=a("../../../../doc/range"),n=a("./databar-xform"),t=a("./ext-lst-ref-xform"),e=a("./formula-xform"),s=a("./color-scale-xform"),r=a("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},c=u=>{const{type:d,operator:f}=u;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 n,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new s,iconSet:this.iconSetXform=new r}}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(w=>{this.formulaXform.render(d,w)}),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 w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new l(x.ref),{tl:N}=A;switch(x.operator){case"containsText":return`NOT(ISERROR(SEARCH("${x.text}",${N})))`;case"containsBlanks":return`LEN(TRIM(${N}))=0`;case"notContainsBlanks":return`LEN(TRIM(${N}))>0`;case"containsErrors":return`ISERROR(${N})`;case"notContainsErrors":return`NOT(ISERROR(${N}))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}renderTimePeriod(d,f){d.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new l(x.ref),{tl:N}=A;switch(x.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${N},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${N},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${N},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${N},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${N},1)=TODAY()-1`;case"today":return`FLOOR(${N},1)=TODAY()`;case"tomorrow":return`FLOOR(${N},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${N},1)<=6,FLOOR(${N},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0-1)),YEAR(${N})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${N})=MONTH(TODAY()),YEAR(${N})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0+1)),YEAR(${N})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);w&&this.formulaXform.render(d,w),d.closeNode()}createNewModel(d){let{attributes:f}=d;return{...c(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(a,T,_){const p=a("../../base-xform");T.exports=class extends p{get tag(){return"cfvo"}render(o,l){o.leafNode(this.tag,{type:l.type,val:l.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(a,T,_){const p=a("../../composite-xform"),o=a("../../style/color-xform"),l=a("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new l,color:this.colorXform=new o}}get tag(){return"colorScale"}render(n,t){n.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(n,e)}),t.color.forEach(e=>{this.colorXform.render(n,e)}),n.closeNode()}createNewModel(n){return{cfvo:[],color:[]}}onParserClose(n,t){this.model[n].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(a,T,_){const p=a("../../composite-xform"),o=a("./cf-rule-xform");T.exports=class extends p{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(l,n){n.rules.some(o.isPrimitive)&&(l.openNode(this.tag,{sqref:n.ref}),n.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=n.ref,this.map.cfRule.render(l,t))}),l.closeNode())}createNewModel(l){let{attributes:n}=l;return{ref:n.sqref,rules:[]}}onParserClose(l,n){this.model.rules.push(n.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(a,T,_){const p=a("../../base-xform"),o=a("./conditional-formatting-xform");T.exports=class extends p{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(l,n){let t=l.reduce((e,s)=>Math.max(e,...s.rules.map(r=>r.priority||0)),1);l.forEach(e=>{e.rules.forEach(s=>{s.priority||(s.priority=t++),s.style&&(s.dxfId=n.styles.addDxfStyle(s.style))})})}render(l,n){n.forEach(t=>{this.cfXform.render(l,t)})}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){this.parser&&this.parser.parseText(l)}parseClose(l){return!!this.parser&&(!!this.parser.parseClose(l)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(l,n){l.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=n.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(a,T,_){const p=a("../../composite-xform"),o=a("../../style/color-xform"),l=a("./cfvo-xform");T.exports=class extends p{constructor(){super(),this.map={cfvo:this.cfvoXform=new l,color:this.colorXform=new o}}get tag(){return"dataBar"}render(n,t){n.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(n,e)}),this.colorXform.render(n,t.color),n.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(n,t){switch(n){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(a,T,_){const p=a("../../base-xform"),o=a("../../composite-xform");class l extends p{get tag(){return"x14:id"}render(e,s){e.leafNode(this.tag,null,s)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class n extends o{constructor(){super(),this.map={"x14:id":this.idXform=new l}}get tag(){return"ext"}render(e,s){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,s.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,s){this.model.x14Id=s.model}}T.exports=class extends o{constructor(){super(),this.map={ext:new n}}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(a,T,_){const p=a("../../base-xform");T.exports=class extends p{get tag(){return"formula"}render(o,l){o.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(a,T,_){const p=a("../../base-xform"),o=a("../../composite-xform"),l=a("./cfvo-xform");T.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new l}}get tag(){return"iconSet"}render(n,t){n.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(n,e)}),n.closeNode()}createNewModel(n){let{attributes:t}=n;return{iconSet:p.toStringValue(t.iconSet,"3TrafficLights"),reverse:p.toBoolValue(t.reverse),showValue:p.toBoolValue(t.showValue),cfvo:[]}}onParserClose(n,t){this.model[n].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(a,T,_){const p=a("../../../utils/utils"),o=a("../base-xform");T.exports=class extends o{get tag(){return"col"}prepare(l,n){const t=n.styles.addStyleModel(l.style||{});t&&(l.styleId=t)}render(l,n){l.openNode("col"),l.addAttribute("min",n.min),l.addAttribute("max",n.max),n.width&&l.addAttribute("width",n.width),n.styleId&&l.addAttribute("style",n.styleId),n.hidden&&l.addAttribute("hidden","1"),n.bestFit&&l.addAttribute("bestFit","1"),n.outlineLevel&&l.addAttribute("outlineLevel",n.outlineLevel),n.collapsed&&l.addAttribute("collapsed","1"),l.addAttribute("customWidth","1"),l.closeNode()}parseOpen(l){if(l.name==="col"){const n=this.model={min:parseInt(l.attributes.min||"0",10),max:parseInt(l.attributes.max||"0",10),width:l.attributes.width===void 0?void 0:parseFloat(l.attributes.width||"0")};return l.attributes.style&&(n.styleId=parseInt(l.attributes.style,10)),p.parseBoolean(l.attributes.hidden)&&(n.hidden=!0),p.parseBoolean(l.attributes.bestFit)&&(n.bestFit=!0),l.attributes.outlineLevel&&(n.outlineLevel=parseInt(l.attributes.outlineLevel,10)),p.parseBoolean(l.attributes.collapsed)&&(n.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(l,n){l.styleId&&(l.style=n.styles.getStyleModel(l.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(a,T,_){const p=a("../../../utils/under-dash"),o=a("../../../utils/utils"),l=a("../../../utils/col-cache"),n=a("../base-xform"),t=a("../../../doc/range");function e(r,i,c,h){const u=i[c];u!==void 0?r[c]=u:h!==void 0&&(r[c]=h)}function s(r,i,c,h){const u=i[c];u!==void 0?r[c]=o.parseBoolean(u):h!==void 0&&(r[c]=h)}T.exports=class extends n{get tag(){return"dataValidations"}render(r,i){const c=function(h){const u=p.map(h,(w,x)=>({address:x,dataValidation:w,marked:!1})).sort((w,x)=>p.strcmp(w.address,x.address)),d=p.keyBy(u,"address"),f=(w,x,A)=>{for(let N=0;N{if(!w.marked){const x=l.decodeEx(w.address);if(x.dimensions)return d[x.dimensions].marked=!0,{...w.dataValidation,sqref:w.address};let A=1,N=l.encodeAddress(x.row+A,x.col);for(;h[N]&&p.isEqual(w.dataValidation,h[N]);)A++,N=l.encodeAddress(x.row+A,x.col);let L=1;for(;f(x,A,x.col+L);)L++;for(let j=0;j1||L>1){const j=x.row+(A-1),P=x.col+(L-1);return{...w.dataValidation,sqref:`${w.address}:${l.encodeAddress(j,P)}`}}return{...w.dataValidation,sqref:w.address}}return null}).filter(Boolean)}(i);c.length&&(r.openNode("dataValidations",{count:c.length}),c.forEach(h=>{r.openNode("dataValidation"),h.type!=="any"&&(r.addAttribute("type",h.type),h.operator&&h.type!=="list"&&h.operator!=="between"&&r.addAttribute("operator",h.operator),h.allowBlank&&r.addAttribute("allowBlank","1")),h.showInputMessage&&r.addAttribute("showInputMessage","1"),h.promptTitle&&r.addAttribute("promptTitle",h.promptTitle),h.prompt&&r.addAttribute("prompt",h.prompt),h.showErrorMessage&&r.addAttribute("showErrorMessage","1"),h.errorStyle&&r.addAttribute("errorStyle",h.errorStyle),h.errorTitle&&r.addAttribute("errorTitle",h.errorTitle),h.error&&r.addAttribute("error",h.error),r.addAttribute("sqref",h.sqref),(h.formulae||[]).forEach((u,d)=>{r.openNode("formula"+(d+1)),h.type==="date"?r.writeText(o.dateToExcel(new Date(u))):r.writeText(u),r.closeNode()}),r.closeNode()}),r.closeNode())}parseOpen(r){switch(r.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=r.attributes.sqref;const i={type:r.attributes.type||"any",formulae:[]};switch(r.attributes.type&&s(i,r.attributes,"allowBlank"),s(i,r.attributes,"showInputMessage"),s(i,r.attributes,"showErrorMessage"),i.type){case"any":case"list":case"custom":break;default:e(i,r.attributes,"operator","between")}return e(i,r.attributes,"promptTitle"),e(i,r.attributes,"prompt"),e(i,r.attributes,"errorStyle"),e(i,r.attributes,"errorTitle"),e(i,r.attributes,"error"),this._dataValidation=i,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(r){this._formula&&this._formula.push(r)}parseClose(r){switch(r){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(c=>{this.model[c]=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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"dimension"}render(o,l){l&&o.leafNode("dimension",{ref:l})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"drawing"}render(o,l){l&&o.leafNode(this.tag,{"r:id":l.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(a,T,_){const p=a("../composite-xform"),o=a("./cf-ext/conditional-formattings-ext-xform");class l 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 l}}get tag(){return"extLst"}prepare(n,t){this.ext.prepare(n,t)}hasContent(n){return this.ext.hasContent(n)}render(n,t){this.hasContent(t)&&(n.openNode("extLst"),this.ext.render(n,t),n.closeNode())}createNewModel(){return{}}onParserClose(n,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"headerFooter"}render(o,l){if(l){o.addRollback();let n=!1;o.openNode("headerFooter"),l.differentFirst&&(o.addAttribute("differentFirst","1"),n=!0),l.differentOddEven&&(o.addAttribute("differentOddEven","1"),n=!0),l.oddHeader&&typeof l.oddHeader=="string"&&(o.leafNode("oddHeader",null,l.oddHeader),n=!0),l.oddFooter&&typeof l.oddFooter=="string"&&(o.leafNode("oddFooter",null,l.oddFooter),n=!0),l.evenHeader&&typeof l.evenHeader=="string"&&(o.leafNode("evenHeader",null,l.evenHeader),n=!0),l.evenFooter&&typeof l.evenFooter=="string"&&(o.leafNode("evenFooter",null,l.evenFooter),n=!0),l.firstHeader&&typeof l.firstHeader=="string"&&(o.leafNode("firstHeader",null,l.firstHeader),n=!0),l.firstFooter&&typeof l.firstFooter=="string"&&(o.leafNode("firstFooter",null,l.firstFooter),n=!0),n?(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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"hyperlink"}render(o,l){this.isInternalLink(l)?o.leafNode("hyperlink",{ref:l.address,"r:id":l.rId,tooltip:l.tooltip,location:l.target}):o.leafNode("hyperlink",{ref:l.address,"r:id":l.rId,tooltip:l.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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"mergeCell"}render(o,l){o.leafNode("mergeCell",{ref:l})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(a,T,_){const p=a("../../../utils/under-dash"),o=a("../../../doc/range"),l=a("../../../utils/col-cache"),n=a("../../../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,s=>{const r=l.decode(s);for(let i=r.top;i<=r.bottom;i++){const c=e[i-1];for(let h=r.left;h<=r.right;h++){const u=c.cells[h-1];u?u.type===n.ValueType.Merge&&(u.master=r.tl):c.cells[h]={type:n.ValueType.Null,address:l.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(a,T,_){const p=a("../base-xform"),o=l=>l!==void 0;T.exports=class extends p{get tag(){return"outlinePr"}render(l,n){return!(!n||!o(n.summaryBelow)&&!o(n.summaryRight))&&(l.leafNode(this.tag,{summaryBelow:o(n.summaryBelow)?Number(n.summaryBelow):void 0,summaryRight:o(n.summaryRight)?Number(n.summaryRight):void 0}),!0)}parseOpen(l){return l.name===this.tag&&(this.model={summaryBelow:o(l.attributes.summaryBelow)?!!Number(l.attributes.summaryBelow):void 0,summaryRight:o(l.attributes.summaryRight)?!!Number(l.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"brk"}render(o,l){o.leafNode("brk",l)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(a,T,_){const p=a("../../../utils/under-dash"),o=a("../base-xform");T.exports=class extends o{get tag(){return"pageMargins"}render(l,n){if(n){const t={left:n.left,right:n.right,top:n.top,bottom:n.bottom,header:n.header,footer:n.footer};p.some(t,e=>e!==void 0)&&l.leafNode(this.tag,t)}}parseOpen(l){switch(l.name){case this.tag:return this.model={left:parseFloat(l.attributes.left||.7),right:parseFloat(l.attributes.right||.7),top:parseFloat(l.attributes.top||.75),bottom:parseFloat(l.attributes.bottom||.75),header:parseFloat(l.attributes.header||.3),footer:parseFloat(l.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"pageSetUpPr"}render(o,l){return!(!l||!l.fitToPage)&&(o.leafNode(this.tag,{fitToPage:l.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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../base-xform");function l(s){return s?"1":void 0}function n(s){switch(s){case"overThenDown":return s;default:return}}function t(s){switch(s){case"atEnd":case"asDisplyed":return s;default:return}}function e(s){switch(s){case"dash":case"blank":case"NA":return s;default:return}}T.exports=class extends o{get tag(){return"pageSetup"}render(s,r){if(r){const i={paperSize:r.paperSize,orientation:r.orientation,horizontalDpi:r.horizontalDpi,verticalDpi:r.verticalDpi,pageOrder:n(r.pageOrder),blackAndWhite:l(r.blackAndWhite),draft:l(r.draft),cellComments:t(r.cellComments),errors:e(r.errors),scale:r.scale,fitToWidth:r.fitToWidth,fitToHeight:r.fitToHeight,firstPageNumber:r.firstPageNumber,useFirstPageNumber:l(r.firstPageNumber),usePrinterDefaults:l(r.usePrinterDefaults),copies:r.copies};p.some(i,c=>c!==void 0)&&s.leafNode(this.tag,i)}}parseOpen(s){switch(s.name){case this.tag:return this.model={paperSize:(r=s.attributes.paperSize,r!==void 0?parseInt(r,10):void 0),orientation:s.attributes.orientation||"portrait",horizontalDpi:parseInt(s.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(s.attributes.verticalDpi||"4294967295",10),pageOrder:s.attributes.pageOrder||"downThenOver",blackAndWhite:s.attributes.blackAndWhite==="1",draft:s.attributes.draft==="1",cellComments:s.attributes.cellComments||"None",errors:s.attributes.errors||"displayed",scale:parseInt(s.attributes.scale||"100",10),fitToWidth:parseInt(s.attributes.fitToWidth||"1",10),fitToHeight:parseInt(s.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(s.attributes.firstPageNumber||"1",10),useFirstPageNumber:s.attributes.useFirstPageNumber==="1",usePrinterDefaults:s.attributes.usePrinterDefaults==="1",copies:parseInt(s.attributes.copies||"1",10)},!0;default:return!1}var r}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"picture"}render(o,l){l&&o.leafNode(this.tag,{"r:id":l.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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../base-xform");function l(n){return n?"1":void 0}T.exports=class extends o{get tag(){return"printOptions"}render(n,t){if(t){const e={headings:l(t.showRowColHeaders),gridLines:l(t.showGridLines),horizontalCentered:l(t.horizontalCentered),verticalCentered:l(t.verticalCentered)};p.some(e,s=>s!==void 0)&&n.leafNode(this.tag,e)}}parseOpen(n){switch(n.name){case this.tag:return this.model={showRowColHeaders:n.attributes.headings==="1",showGridLines:n.attributes.gridLines==="1",horizontalCentered:n.attributes.horizontalCentered==="1",verticalCentered:n.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(a,T,_){const p=a("./page-breaks-xform"),o=a("../list-xform");T.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new p})}render(l,n){if(n&&n.length){l.openNode(this.tag,this.$),this.count&&(l.addAttribute(this.$count,n.length),l.addAttribute("manualBreakCount",n.length));const{childXform:t}=this;n.forEach(e=>{t.render(l,e)}),l.closeNode()}else this.empty&&l.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(a,T,_){const p=a("../base-xform"),o=a("../../../utils/utils"),l=a("./cell-xform");T.exports=class extends p{constructor(n){super(),this.maxItems=n&&n.maxItems,this.map={c:new l}}get tag(){return"row"}prepare(n,t){const e=t.styles.addStyleModel(n.style);e&&(n.styleId=e);const s=this.map.c;n.cells.forEach(r=>{s.prepare(r,t)})}render(n,t,e){n.openNode("row"),n.addAttribute("r",t.number),t.height&&(n.addAttribute("ht",t.height),n.addAttribute("customHeight","1")),t.hidden&&n.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&n.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(n.addAttribute("s",t.styleId),n.addAttribute("customFormat","1")),n.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&n.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&n.addAttribute("collapsed","1");const s=this.map.c;t.cells.forEach(r=>{s.render(n,r,e)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;if(n.name==="row"){this.numRowsSeen+=1;const t=n.attributes.spans?n.attributes.spans.split(":").map(s=>parseInt(s,10)):[void 0,void 0],e=this.model={number:parseInt(n.attributes.r,10),min:t[0],max:t[1],cells:[]};return n.attributes.s&&(e.styleId=parseInt(n.attributes.s,10)),o.parseBoolean(n.attributes.hidden)&&(e.hidden=!0),o.parseBoolean(n.attributes.bestFit)&&(e.bestFit=!0),n.attributes.ht&&(e.height=parseFloat(n.attributes.ht)),n.attributes.outlineLevel&&(e.outlineLevel=parseInt(n.attributes.outlineLevel,10)),o.parseBoolean(n.attributes.collapsed)&&(e.collapsed=!0),!0}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){if(!this.parser.parseClose(n)){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(n,t){n.style=n.styleId?t.styles.getStyleModel(n.styleId):{},n.styleId!==void 0&&(n.styleId=void 0);const e=this.map.c;n.cells.forEach(s=>{e.reconcile(s,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(a,T,_){const p=a("../../../utils/under-dash"),o=a("../base-xform");T.exports=class extends o{get tag(){return"sheetFormatPr"}render(l,n){if(n){const t={defaultRowHeight:n.defaultRowHeight,outlineLevelRow:n.outlineLevelRow,outlineLevelCol:n.outlineLevelCol,"x14ac:dyDescent":n.dyDescent};n.defaultColWidth&&(t.defaultColWidth=n.defaultColWidth),n.defaultRowHeight&&n.defaultRowHeight===15||(t.customHeight="1"),p.some(t,e=>e!==void 0)&&l.leafNode("sheetFormatPr",t)}}parseOpen(l){return l.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(l.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(l.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(l.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(l.attributes.outlineLevelCol||"0",10)},l.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(l.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(a,T,_){const p=a("../base-xform"),o=a("../style/color-xform"),l=a("./page-setup-properties-xform"),n=a("./outline-properties-xform");T.exports=class extends p{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new l,outlinePr:new n}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let s=!1;s=this.map.tabColor.render(t,e.tabColor)||s,s=this.map.pageSetUpPr.render(t,e.pageSetup)||s,s=this.map.outlinePr.render(t,e.outlineProperties)||s,s?(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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../base-xform");function l(t,e){return t?e:void 0}function n(t,e){return t===e||void 0}T.exports=class extends o{get tag(){return"sheetProtection"}render(t,e){if(e){const s={sheet:l(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:l(e.formatCells,"0"),formatColumns:l(e.formatColumns,"0"),formatRows:l(e.formatRows,"0"),insertColumns:l(e.insertColumns,"0"),insertRows:l(e.insertRows,"0"),insertHyperlinks:l(e.insertHyperlinks,"0"),deleteColumns:l(e.deleteColumns,"0"),deleteRows:l(e.deleteRows,"0"),sort:l(e.sort,"0"),autoFilter:l(e.autoFilter,"0"),pivotTables:l(e.pivotTables,"0")};e.sheet&&(s.algorithmName=e.algorithmName,s.hashValue=e.hashValue,s.saltValue=e.saltValue,s.spinCount=e.spinCount,s.objects=l(e.objects===!1,"1"),s.scenarios=l(e.scenarios===!1,"1")),p.some(s,r=>r!==void 0)&&t.leafNode(this.tag,s)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:n(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:n(t.attributes.formatCells,"0"),formatColumns:n(t.attributes.formatColumns,"0"),formatRows:n(t.attributes.formatRows,"0"),insertColumns:n(t.attributes.insertColumns,"0"),insertRows:n(t.attributes.insertRows,"0"),insertHyperlinks:n(t.attributes.insertHyperlinks,"0"),deleteColumns:n(t.attributes.deleteColumns,"0"),deleteRows:n(t.attributes.deleteRows,"0"),sort:n(t.attributes.sort,"0"),autoFilter:n(t.attributes.autoFilter,"0"),pivotTables:n(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(a,T,_){const p=a("../../../utils/col-cache"),o=a("../base-xform"),l={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends o{get tag(){return"sheetView"}prepare(n){switch(n.state){case"frozen":case"split":break;default:n.state="normal"}}render(n,t){n.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(h,u,d){d&&n.addAttribute(h,u)};let s,r,i,c;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":r=t.xSplit||0,i=t.ySplit||0,s=t.topLeftCell||p.getAddress(i+1,r+1).address,c=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",n.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:s,activePane:c,state:"frozen"}),n.leafNode("selection",{pane:c,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),n.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),n.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&n.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}n.closeNode()}parseOpen(n){switch(n.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(n.attributes.workbookViewId,10),rightToLeft:n.attributes.rightToLeft==="1",tabSelected:n.attributes.tabSelected==="1",showRuler:n.attributes.showRuler!=="0",showRowColHeaders:n.attributes.showRowColHeaders!=="0",showGridLines:n.attributes.showGridLines!=="0",zoomScale:parseInt(n.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(n.attributes.zoomScaleNormal||"100",10),style:n.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(n.attributes.xSplit||"0",10),ySplit:parseInt(n.attributes.ySplit||"0",10),topLeftCell:n.attributes.topLeftCell,activePane:n.attributes.activePane||"topLeft",state:n.attributes.state},!0;case"selection":{const t=n.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:n.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(n){let t,e;switch(n){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:l[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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"tablePart"}render(o,l){l&&o.leafNode(this.tag,{"r:id":l.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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../../../utils/col-cache"),l=a("../../../utils/xml-stream"),n=a("../../rel-type"),t=a("./merges"),e=a("../base-xform"),s=a("../list-xform"),r=a("./row-xform"),i=a("./col-xform"),c=a("./dimension-xform"),h=a("./hyperlink-xform"),u=a("./merge-cell-xform"),d=a("./data-validations-xform"),f=a("./sheet-properties-xform"),w=a("./sheet-format-properties-xform"),x=a("./sheet-view-xform"),A=a("./sheet-protection-xform"),N=a("./page-margins-xform"),L=a("./page-setup-xform"),j=a("./print-options-xform"),P=a("./auto-filter-xform"),F=a("./picture-xform"),H=a("./drawing-xform"),D=a("./table-part-xform"),S=a("./row-breaks-xform"),M=a("./header-footer-xform"),v=a("./cf/conditional-formattings-xform"),m=a("./ext-lst-xform"),b=(y,k)=>{if(!k||!k.length)return y;if(!y||!y.length)return k;const R={},I={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach(U=>{const{x14Id:q}=U;q&&(I[q]=U)})}),k.forEach(z=>{z.rules.forEach(U=>{const q=I[U.x14Id];q?((O,V)=>{Object.keys(V).forEach(E=>{const C=O[E],B=V[E];C===void 0&&B!==void 0&&(O[E]=B)})})(q,U):R[z.ref]?R[z.ref].rules.push(U):y.push({ref:z.ref,rules:[U]})})}),y};class g extends e{constructor(k){super();const{maxRows:R,maxCols:I,ignoreNodes:z}=k||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new c,sheetViews:new s({tag:"sheetViews",count:!1,childXform:new x}),sheetFormatPr:new w,cols:new s({tag:"cols",count:!1,childXform:new i}),sheetData:new s({tag:"sheetData",count:!1,empty:!0,childXform:new r({maxItems:I}),maxItems:R}),autoFilter:new P,mergeCells:new s({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new S,hyperlinks:new s({tag:"hyperlinks",count:!1,childXform:new h}),pageMargins:new N,dataValidations:new d,pageSetup:new L,headerFooter:new M,printOptions:new j,picture:new F,drawing:new H,sheetProtection:new A,tableParts:new s({tag:"tableParts",count:!0,childXform:new D}),conditionalFormatting:new v,extLst:new m}}prepare(k,R){R.merges=new t,k.hyperlinks=R.hyperlinks=[],k.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(k.cols,R),this.map.sheetData.prepare(k.rows,R),this.map.conditionalFormatting.prepare(k.conditionalFormattings,R),k.mergeCells=R.merges.mergeCells;const I=k.rels=[];function z(O){return"rId"+(O.length+1)}if(k.hyperlinks.forEach(O=>{const V=z(I);O.rId=V,I.push({Id:V,Type:n.Hyperlink,Target:O.target,TargetMode:"External"})}),k.comments.length>0){const O={Id:z(I),Type:n.Comments,Target:`../comments${k.id}.xml`};I.push(O);const V={Id:z(I),Type:n.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};I.push(V),k.comments.forEach(E=>{E.refAddress=o.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+k.id,vmlDrawing:"vmlDrawing"+k.id})}const U=[];let q;k.media.forEach(O=>{if(O.type==="background"){const V=z(I);q=R.media[O.imageId],I.push({Id:V,Type:n.Image,Target:`../media/${q.name}.${q.extension}`}),k.background={rId:V},k.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:V}=k;q=R.media[O.imageId],V||(V=k.drawing={rId:z(I),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push(V),I.push({Id:V.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${V.name}.xml`}));let E=this.preImageId===O.imageId?U[O.imageId]:U[V.rels.length];E||(E=z(V.rels),U[V.rels.length]=E,V.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${q.name}.${q.extension}`}));const C={picture:{rId:E},range:O.range};if(O.hyperlinks&&O.hyperlinks.hyperlink){const B=z(V.rels);U[V.rels.length]=B,C.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:B},V.rels.push({Id:B,Type:n.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,V.anchors.push(C)}}),k.tables.forEach(O=>{const V=z(I);O.rId=V,I.push({Id:V,Type:n.Table,Target:"../tables/"+O.target}),O.columns.forEach(E=>{const{style:C}=E;C&&(E.dxfId=R.styles.addDxfStyle(C))})}),this.map.extLst.prepare(k,R)}render(k,R){k.openXml(l.StdDocAttributes),k.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const I=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&&(I.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},U=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(k,z),this.map.dimension.render(k,R.dimensions),this.map.sheetViews.render(k,R.views),this.map.sheetFormatPr.render(k,I),this.map.cols.render(k,R.cols),this.map.sheetData.render(k,R.rows),this.map.sheetProtection.render(k,O),this.map.autoFilter.render(k,R.autoFilter),this.map.mergeCells.render(k,R.mergeCells),this.map.conditionalFormatting.render(k,R.conditionalFormattings),this.map.dataValidations.render(k,R.dataValidations),this.map.hyperlinks.render(k,R.hyperlinks),this.map.printOptions.render(k,q),this.map.pageMargins.render(k,U),this.map.pageSetup.render(k,R.pageSetup),this.map.headerFooter.render(k,R.headerFooter),this.map.rowBreaks.render(k,R.rowBreaks),this.map.drawing.render(k,R.drawing),this.map.picture.render(k,R.background),this.map.tableParts.render(k,R.tables),this.map.extLst.render(k,R),R.rels&&R.rels.forEach(V=>{V.Type===n.VmlDrawing&&k.leafNode("legacyDrawing",{"r:id":V.Id})}),k.closeNode()}parseOpen(k){return this.parser?(this.parser.parseOpen(k),!0):k.name==="worksheet"?(p.each(this.map,R=>{R.reset()}),!0):(this.map[k.name]&&!this.ignoreNodes.includes(k.name)&&(this.parser=this.map[k.name],this.parser.parseOpen(k)),!0)}parseText(k){this.parser&&this.parser.parseText(k)}parseClose(k){if(this.parser)return this.parser.parseClose(k)||(this.parser=void 0),!0;switch(k){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 I={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(I,this.map.pageSetup.model,this.map.printOptions.model),U=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:U},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(k,R){const I=(k.relationships||[]).reduce((U,q)=>{if(U[q.Id]=q,q.Type===n.Comments&&(k.comments=R.comments[q.Target].comments),q.Type===n.VmlDrawing&&k.comments&&k.comments.length){const O=R.vmlDrawings[q.Target].comments;k.comments.forEach((V,E)=>{V.note=Object.assign({},V.note,O[E])})}return U},{});if(R.commentsMap=(k.comments||[]).reduce((U,q)=>(q.ref&&(U[q.ref]=q),U),{}),R.hyperlinkMap=(k.hyperlinks||[]).reduce((U,q)=>(q.rId&&(U[q.address]=I[q.rId].Target),U),{}),R.formulae={},k.rows=k.rows&&k.rows.filter(Boolean)||[],k.rows.forEach(U=>{U.cells=U.cells&&U.cells.filter(Boolean)||[]}),this.map.cols.reconcile(k.cols,R),this.map.sheetData.reconcile(k.rows,R),this.map.conditionalFormatting.reconcile(k.conditionalFormattings,R),k.media=[],k.drawing){const U=I[k.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(U){const q=U[1];R.drawings[q].anchors.forEach(O=>{if(O.medium){const V={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};k.media.push(V)}})}}const z=k.background&&I[k.background.rId];if(z){const U=z.Target.split("/media/")[1],q=R.mediaIndex&&R.mediaIndex[U];q!==void 0&&k.media.push({type:"background",imageId:q})}k.tables=(k.tables||[]).map(U=>{const q=I[U.rId];return R.tables[q.Target]}),delete k.relationships,delete k.hyperlinks,delete k.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(a,T,_){const p=a("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,l){l&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(a,T,_){const p=a("../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(l){try{return Number.isNaN(l.getTime())?"":l.toISOString()}catch{return""}},this._parse=o.parse||function(l){return new Date(l)}}render(o,l){l&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(l)):o.writeText(this._format(l)),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(a,T,_){const p=a("../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,l){(l||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,l):o.writeText(l),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(a,T,_){const p=a("../base-xform");T.exports=class extends p{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,l){l!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,l):o.writeText(l),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(a,T,_){const p=a("./base-xform"),o=a("../../utils/xml-stream");T.exports=class extends p{constructor(l){super(),this._model=l}render(l){if(!this._xml){const n=new o;(function t(e,s){e.openNode(s.tag,s.$),s.c&&s.c.forEach(r=>{t(e,r)}),s.t&&e.writeText(s.t),e.closeNode()})(n,this._model),this._xml=n.xml}l.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(l){switch(l){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(a,T,_){const p=a("./text-xform"),o=a("./rich-text-xform"),l=a("../base-xform");T.exports=class extends l{constructor(){super(),this.map={r:new o,t:new p}}get tag(){return"rPh"}render(n,t){if(n.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(s=>{e.render(n,s)})}else t&&this.map.t.render(n,t.text);n.closeNode()}parseOpen(n){const{name:t}=n;return this.parser?(this.parser.parseOpen(n),!0):t===this.tag?(this.model={sb:parseInt(n.attributes.sb,10),eb:parseInt(n.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(n),!0))}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser){if(!this.parser.parseClose(n)){switch(n){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(n){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(a,T,_){const p=a("./text-xform"),o=a("../style/font-xform"),l=a("../base-xform");class n extends l{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(n.FONT_OPTIONS))}render(e,s){s=s||this.model,e.openNode("r"),s.font&&this.fontXform.render(e,s.font),this.textXform.render(e,s.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}}}n.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=n},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(a,T,_){const p=a("./text-xform"),o=a("./rich-text-xform"),l=a("./phonetic-text-xform"),n=a("../base-xform");T.exports=class extends n{constructor(t){super(),this.model=t,this.map={r:new o,t:new p,rPh:new l}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(s=>{this.map.r.render(t,s)}):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(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("./shared-string-xform");T.exports=class extends o{constructor(n){super(),this.model=n||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new l)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(n){return this.model.values[n]}add(n){return n.richText?this.addRichText(n):this.addText(n)}addText(n){let t=this.hash[n];return t===void 0&&(t=this.hash[n]=this.model.values.length,this.model.values.push(n)),this.model.count++,t}addRichText(n){const t=this.sharedStringXform.toXml(n);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(n)),this.model.count++,e}render(n,t){t=t||this._values,n.openXml(p.StdDocAttributes),n.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(s=>{e.render(n,s)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(n),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(n){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+n)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"t"}render(o,l){o.openNode("t"),/^\s|\n|\s$/.test(l)&&o.addAttribute("xml:space","preserve"),o.writeText(l),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,l)=>String.fromCharCode(parseInt(l,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(a,T,_){const p=a("../../../doc/enums"),o=a("../../../utils/utils"),l=a("../base-xform"),n={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,s)=>(e[s]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,s)=>(e[s]=!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=n.textRotation(e)){if(e==="vertical")return 255;const s=Math.round(e);if(s>=0&&s<=90)return s;if(s<0&&s>=-90)return 90-s}},toModel(e){const s=o.validInt(e);if(s!==void 0){if(s===255)return"vertical";if(s>=0&&s<=90)return s;if(s>90&&s<=180)return 90-s}}};T.exports=class extends l{get tag(){return"alignment"}render(e,s){e.addRollback(),e.openNode("alignment");let r=!1;function i(c,h){h&&(e.addAttribute(c,h),r=!0)}i("horizontal",n.horizontal(s.horizontal)),i("vertical",n.vertical(s.vertical)),i("wrapText",!!n.wrapText(s.wrapText)&&"1"),i("shrinkToFit",!!n.shrinkToFit(s.shrinkToFit)&&"1"),i("indent",n.indent(s.indent)),i("textRotation",t.toXml(s.textRotation)),i("readingOrder",n.readingOrder(s.readingOrder)),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const s={};let r=!1;function i(c,h,u){c&&(s[h]=u,r=!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=r?s:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(a,T,_){const p=a("../base-xform"),o=a("../../../utils/utils"),l=a("./color-xform");class n extends p{constructor(e){super(),this.name=e,this.map={color:new l}}get tag(){return this.name}render(e,s,r){const i=s&&s.color||r||this.defaultColor;e.openNode(this.name),s&&s.style&&(e.addAttribute("style",s.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:s}=e.attributes;return this.model=s?{style:s}: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 n.validStyleValues[e]}}n.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 n("top"),left:new n("left"),bottom:new n("bottom"),right:new n("right"),diagonal:new n("diagonal")}}render(t,e){const{color:s}=e;function r(i,c){i&&!i.color&&e.color&&(i={...i,color:e.color}),c.render(t,i,s)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),r(e.left,this.map.left),r(e.right,this.map.right),r(e.top,this.map.top),r(e.bottom,this.map.bottom),r(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={},s=function(r,i,c){i&&(c&&Object.assign(i,c),e[r]=i)};s("left",this.map.left.model),s("right",this.map.right.model),s("top",this.map.top.model),s("bottom",this.map.bottom.model),s("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,l){return!!l&&(o.openNode(this.name),l.argb?o.addAttribute("rgb",l.argb):l.theme!==void 0?(o.addAttribute("theme",l.theme),l.tint!==void 0&&o.addAttribute("tint",l.tint)):l.indexed!==void 0?o.addAttribute("indexed",l.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(a,T,_){const p=a("../base-xform"),o=a("./alignment-xform"),l=a("./border-xform"),n=a("./fill-xform"),t=a("./font-xform"),e=a("./numfmt-xform"),s=a("./protection-xform");T.exports=class extends p{constructor(){super(),this.map={alignment:new o,border:new l,fill:new n,font:new t,numFmt:new e,protection:new s}}get tag(){return"dxf"}render(r,i){if(r.openNode(this.tag),i.font&&this.map.font.render(r,i.font),i.numFmt&&i.numFmtId){const c={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(r,c)}i.fill&&this.map.fill.render(r,i.fill),i.alignment&&this.map.alignment.render(r,i.alignment),i.border&&this.map.border.render(r,i.border),i.protection&&this.map.protection.render(r,i.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r),!0}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):r!==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(a,T,_){const p=a("../base-xform"),o=a("./color-xform");class l extends p{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(r,i){r.openNode("stop"),r.addAttribute("position",i.position),this.map.color.render(r,i.color),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"stop":return this.model={position:parseFloat(r.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(r),!0;default:return!1}}parseText(){}parseClose(r){return!!this.parser&&(this.parser.parseClose(r)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class n extends p{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(r,i){r.openNode("patternFill"),r.addAttribute("patternType",i.pattern),i.fgColor&&this.map.fgColor.render(r,i.fgColor),i.bgColor&&this.map.bgColor.render(r,i.bgColor),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"patternFill":return this.model={type:"pattern",pattern:r.attributes.patternType},!0;default:return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return!!this.parser&&(this.parser.parseClose(r)||(this.parser.model&&(this.model[r]=this.parser.model),this.parser=void 0),!0)}}class t extends p{constructor(){super(),this.map={stop:new l}}get name(){return"gradient"}get tag(){return"gradientFill"}render(r,i){switch(r.openNode("gradientFill"),i.gradient){case"angle":r.addAttribute("degree",i.degree);break;case"path":r.addAttribute("type","path"),i.center.left&&(r.addAttribute("left",i.center.left),i.center.right===void 0&&r.addAttribute("right",i.center.left)),i.center.right&&r.addAttribute("right",i.center.right),i.center.top&&(r.addAttribute("top",i.center.top),i.center.bottom===void 0&&r.addAttribute("bottom",i.center.top)),i.center.bottom&&r.addAttribute("bottom",i.center.bottom)}const c=this.map.stop;i.stops.forEach(h=>{c.render(r,h)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"gradientFill":{const i=this.model={stops:[]};return r.attributes.degree?(i.gradient="angle",i.degree=parseInt(r.attributes.degree,10)):r.attributes.type==="path"&&(i.gradient="path",i.center={left:r.attributes.left?parseFloat(r.attributes.left):0,top:r.attributes.top?parseFloat(r.attributes.top):0},r.attributes.right!==r.attributes.left&&(i.center.right=r.attributes.right?parseFloat(r.attributes.right):0),r.attributes.bottom!==r.attributes.top&&(i.center.bottom=r.attributes.bottom?parseFloat(r.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,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.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends p{constructor(){super(),this.map={patternFill:new n,gradientFill:new t}}get tag(){return"fill"}render(r,i){switch(r.addRollback(),r.openNode("fill"),i.type){case"pattern":this.map.patternFill.render(r,i);break;case"gradient":this.map.gradientFill.render(r,i);break;default:return void r.rollback()}r.closeNode(),r.commit()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"fill":return this.model={},!0;default:return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return!!this.parser&&(this.parser.parseClose(r)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(r){return e.validPatternValues[r]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((s,r)=>(s[r]=!0,s),{}),e.StopXform=l,e.PatternFillXform=n,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(a,T,_){const p=a("./color-xform"),o=a("../simple/boolean-xform"),l=a("../simple/integer-xform"),n=a("../simple/string-xform"),t=a("./underline-xform"),e=a("../../../utils/under-dash"),s=a("../base-xform");class r extends s{constructor(c){super(),this.options=c||r.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 l({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 l({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new n({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new n({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 l({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new n({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(c,h){const{map:u}=this;c.openNode(this.options.tagName),e.each(this.map,(d,f)=>{u[f].xform.render(c,h[d.prop])}),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;if(this.map[c.name])return this.parser=this.map[c.name].xform,this.parser.parseOpen(c);switch(c.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser&&!this.parser.parseClose(c)){const h=this.map[c];return this.parser.model&&(this.model[h.prop]=this.parser.model),this.parser=void 0,!0}switch(c){case this.options.tagName:return!1;default:return!0}}}r.OPTIONS={tagName:"font",fontNameTag:"name"},T.exports=r},{"../../../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(a,T,_){const p=a("../../../utils/under-dash"),o=a("../../defaultnumformats"),l=a("../base-xform"),n=function(){const e={};return p.each(o,(s,r)=>{s.f&&(e[s.f]=parseInt(r,10))}),e}();class t extends l{constructor(s,r){super(),this.id=s,this.formatCode=r}get tag(){return"numFmt"}render(s,r){s.leafNode("numFmt",{numFmtId:r.id,formatCode:r.formatCode})}parseOpen(s){switch(s.name){case"numFmt":return this.model={id:parseInt(s.attributes.numFmtId,10),formatCode:s.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return n[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(a,T,_){const p=a("../base-xform"),o={boolean:(l,n)=>l===void 0?n:l};T.exports=class extends p{get tag(){return"protection"}render(l,n){l.addRollback(),l.openNode("protection");let t=!1;function e(s,r){r!==void 0&&(l.addAttribute(s,r),t=!0)}e("locked",o.boolean(n.locked,!0)?void 0:"0"),e("hidden",o.boolean(n.hidden,!1)?"1":void 0),l.closeNode(),t?l.commit():l.rollback()}parseOpen(l){const n={locked:l.attributes.locked!=="0",hidden:l.attributes.hidden==="1"},t=!n.locked||n.hidden;this.model=t?n:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(a,T,_){const p=a("../base-xform"),o=a("./alignment-xform"),l=a("./protection-xform");T.exports=class extends p{constructor(n){super(),this.xfId=!(!n||!n.xfId),this.map={alignment:new o,protection:new l}}get tag(){return"xf"}render(n,t){n.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&n.addAttribute("xfId",t.xfId||0),t.numFmtId&&n.addAttribute("applyNumberFormat","1"),t.fontId&&n.addAttribute("applyFont","1"),t.fillId&&n.addAttribute("applyFill","1"),t.borderId&&n.addAttribute("applyBorder","1"),t.alignment&&n.addAttribute("applyAlignment","1"),t.protection&&n.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(n,t.alignment),t.protection&&this.map.protection.render(n,t.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"xf":return this.model={numFmtId:parseInt(n.attributes.numFmtId,10),fontId:parseInt(n.attributes.fontId,10),fillId:parseInt(n.attributes.fillId,10),borderId:parseInt(n.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(n.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(n),!0;case"protection":return this.parser=this.map.protection,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.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):n!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(a,T,_){const p=a("../../../doc/enums"),o=a("../../../utils/xml-stream"),l=a("../base-xform"),n=a("../static-xform"),t=a("../list-xform"),e=a("./font-xform"),s=a("./fill-xform"),r=a("./border-xform"),i=a("./numfmt-xform"),c=a("./style-xform"),h=a("./dxf-xform");class u extends l{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 s}),borders:new t({tag:"borders",count:!0,childXform:new r}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new c}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new c({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new h}),numFmt:new i,font:new e,fill:new s,border:new r,style:new c({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.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,w){w=w||this.model,f.openXml(o.StdDocAttributes),f.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(f.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(x=>{f.writeXml(x)}),f.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("fills",{count:w.fills.length}),w.fills.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("borders",{count:w.borders.length}),w.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:w.styles.length}),w.styles.forEach(x=>{f.writeXml(x)}),f.closeNode()):(this.map.numFmts.render(f,w.numFmts),this.map.fonts.render(f,w.fonts),this.map.fills.render(f,w.fills),this.map.borders.render(f,w.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,w.styles)),u.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,w.dxfs),u.STATIC_XFORMS.tableStyles.render(f),u.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 w=(x,A)=>{A.model&&A.model.length&&(this.model[x]=A.model)};if(w("numFmts",this.map.numFmts),w("fonts",this.map.fonts),w("fills",this.map.fills),w("borders",this.map.borders),w("styles",this.map.cellXfs),w("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,w){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(w=w||p.ValueType.Number,f.numFmt)x.numFmtId=this._addNumFmtStr(f.numFmt);else switch(w){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 w=this.model.styles[f];if(!w)return null;let x=this.index.model[f];if(x)return x;if(x=this.index.model[f]={},w.numFmtId){const N=this.index.numFmt[w.numFmtId]||i.getDefaultFmtCode(w.numFmtId);N&&(x.numFmt=N)}function A(N,L,j){if(j||j===0){const P=L[j];P&&(x[N]=P)}}return A("font",this.model.fonts,w.fontId),A("border",this.model.borders,w.borderId),A("fill",this.model.fills,w.fillId),w.alignment&&(x.alignment=w.alignment),w.protection&&(x.protection=w.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 w=this.map.style.toXml(f);let x=this.index.style[w];return x===void 0&&(x=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),x}_addNumFmtStr(f){let w=i.getDefaultFmtId(f);if(w!==void 0||(w=this.index.numFmt[f],w!==void 0))return w;w=this.index.numFmt[f]=164+this.model.numFmts.length;const x=this.map.numFmt.toXml({id:w,formatCode:f});return this.model.numFmts.push(x),w}_addFont(f){const w=this.map.font.toXml(f);let x=this.index.font[w];return x===void 0&&(x=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),x}_addBorder(f){const w=this.map.border.toXml(f);let x=this.index.border[w];return x===void 0&&(x=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),x}_addFill(f){const w=this.map.fill.toXml(f);let x=this.index.fill[w];return x===void 0&&(x=this.index.fill[w]=this.model.fills.length,this.model.fills.push(w)),x}}u.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"},u.STATIC_XFORMS={cellStyles:new n({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new n({tag:"dxfs",$:{count:0}}),tableStyles:new n({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new n({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"}}]}]})},u.Mock=class extends u{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=u},{"../../../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(a,T,_){const p=a("../base-xform");class o extends p{constructor(n){super(),this.model=n}get tag(){return"u"}render(n,t){if((t=t||this.model)===!0)n.leafNode("u");else{const e=o.Attributes[t];e&&n.leafNode("u",e)}}parseOpen(n){n.name==="u"&&(this.model=n.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(a,T,_){const p=a("../base-xform"),o=a("./filter-column-xform");T.exports=class extends p{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(l){l.columns.forEach((n,t)=>{this.map.filterColumn.prepare(n,{index:t})})}render(l,n){return l.openNode(this.tag,{ref:n.autoFilterRef}),n.columns.forEach(t=>{this.map.filterColumn.render(l,t)}),l.closeNode(),!0}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case this.tag:return this.model={autoFilterRef:l.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[l.name],this.parser)return this.parseOpen(l),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(l))}}parseText(l){this.parser&&this.parser.parseText(l)}parseClose(l){if(this.parser)return this.parser.parseClose(l)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(l){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+l)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"customFilter"}render(o,l){o.leafNode(this.tag,{val:l.val,operator:l.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(a,T,_){const p=a("../base-xform"),o=a("../list-xform"),l=a("./custom-filter-xform"),n=a("./filter-xform");T.exports=class extends p{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new l}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new n})}}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(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"filter"}render(o,l){o.leafNode(this.tag,{val:l.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"tableColumn"}prepare(o,l){o.id=l.index+1}render(o,l){return o.leafNode(this.tag,{id:l.id.toString(),name:l.name,totalsRowLabel:l.totalsRowLabel,totalsRowFunction:l.totalsRowFunction,dxfId:l.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:l}=o;return this.model={name:l.name,totalsRowLabel:l.totalsRowLabel,totalsRowFunction:l.totalsRowFunction,dxfId:l.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(a,T,_){const p=a("../base-xform");T.exports=class extends p{get tag(){return"tableStyleInfo"}render(o,l){return o.leafNode(this.tag,{name:l.theme?l.theme:void 0,showFirstColumn:l.showFirstColumn?"1":"0",showLastColumn:l.showLastColumn?"1":"0",showRowStripes:l.showRowStripes?"1":"0",showColumnStripes:l.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:l}=o;return this.model={theme:l.name?l.name:null,showFirstColumn:l.showFirstColumn==="1",showLastColumn:l.showLastColumn==="1",showRowStripes:l.showRowStripes==="1",showColumnStripes:l.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(a,T,_){const p=a("../../../utils/xml-stream"),o=a("../base-xform"),l=a("../list-xform"),n=a("./auto-filter-xform"),t=a("./table-column-xform"),e=a("./table-style-info-xform");class s extends o{constructor(){super(),this.map={autoFilter:new n,tableColumns:new l({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,c){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,c)}get tag(){return"table"}render(i,c){i.openXml(p.StdDocAttributes),i.openNode(this.tag,{...s.TABLE_ATTRIBUTES,id:c.id,name:c.name,displayName:c.displayName||c.name,ref:c.tableRef,totalsRowCount:c.totalsRow?"1":void 0,totalsRowShown:c.totalsRow?void 0:"1",headerRowCount:c.headerRow?"1":"0"}),this.map.autoFilter.render(i,c),this.map.tableColumns.render(i,c.columns),this.map.tableStyleInfo.render(i,c.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:c,attributes:h}=i;switch(c){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((c,h)=>{this.model.columns[h].filterButton=c.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,c){i.columns.forEach(h=>{h.dxfId!==void 0&&(h.style=c.styles.getDxfStyle(h.dxfId))})}}s.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=s},{"../../../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(a,T,_){(function(p,o){(function(){const l=a("fs"),n=a("jszip"),{PassThrough:t}=a("readable-stream"),e=a("../utils/zip-stream"),s=a("../utils/stream-buf"),r=a("../utils/utils"),i=a("../utils/xml-stream"),{bufferToString:c}=a("../utils/browser-buffer-decode"),h=a("./xform/style/styles-xform"),u=a("./xform/core/core-xform"),d=a("./xform/strings/shared-strings-xform"),f=a("./xform/core/relationships-xform"),w=a("./xform/core/content-types-xform"),x=a("./xform/core/app-xform"),A=a("./xform/book/workbook-xform"),N=a("./xform/sheet/worksheet-xform"),L=a("./xform/drawing/drawing-xform"),j=a("./xform/table/table-xform"),P=a("./xform/comment/comments-xform"),F=a("./xform/comment/vml-notes-xform"),H=a("./xml/theme1");class D{constructor(M){this.workbook=M}async readFile(M,v){if(!await r.fs.exists(M))throw new Error("File not found: "+M);const m=l.createReadStream(M);try{const b=await this.read(m,v);return m.close(),b}catch(b){throw m.close(),b}}parseRels(M){return new f().parseStream(M)}parseWorkbook(M){return new A().parseStream(M)}parseSharedStrings(M){return new d().parseStream(M)}reconcile(M,v){const m=new A,b=new N(v),g=new L,y=new j;m.reconcile(M);const k={media:M.media,mediaIndex:M.mediaIndex};Object.keys(M.drawings).forEach(z=>{const U=M.drawings[z],q=M.drawingRels[z];q&&(k.rels=q.reduce((O,V)=>(O[V.Id]=V,O),{}),(U.anchors||[]).forEach(O=>{const V=O.picture&&O.picture.hyperlinks;V&&k.rels[V.rId]&&(V.hyperlink=k.rels[V.rId].Target,delete V.rId)}),g.reconcile(U,k))});const R={styles:M.styles};Object.values(M.tables).forEach(z=>{y.reconcile(z,R)});const I={styles:M.styles,sharedStrings:M.sharedStrings,media:M.media,mediaIndex:M.mediaIndex,date1904:M.properties&&M.properties.date1904,drawings:M.drawings,comments:M.comments,tables:M.tables,vmlDrawings:M.vmlDrawings};M.worksheets.forEach(z=>{z.relationships=M.worksheetRels[z.sheetNo],b.reconcile(z,I)}),delete M.worksheetHash,delete M.worksheetRels,delete M.globalRels,delete M.sharedStrings,delete M.workbookRels,delete M.sheetDefs,delete M.styles,delete M.mediaIndex,delete M.drawings,delete M.drawingRels,delete M.vmlDrawings}async _processWorksheetEntry(M,v,m,b,g){const y=new N(b),k=await y.parseStream(M);k.sheetNo=m,v.worksheetHash[g]=k,v.worksheets.push(k)}async _processCommentEntry(M,v,m){const b=new P,g=await b.parseStream(M);v.comments[`../${m}.xml`]=g}async _processTableEntry(M,v,m){const b=new j,g=await b.parseStream(M);v.tables[`../tables/${m}.xml`]=g}async _processWorksheetRelsEntry(M,v,m){const b=new f,g=await b.parseStream(M);v.worksheetRels[m]=g}async _processMediaEntry(M,v,m){const b=m.lastIndexOf(".");if(b>=1){const g=m.substr(b+1),y=m.substr(0,b);await new Promise((k,R)=>{const I=new s;I.on("finish",()=>{v.mediaIndex[m]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:I.toBuffer()};v.media.push(z),k()}),M.on("error",z=>{R(z)}),M.pipe(I)})}}async _processDrawingEntry(M,v,m){const b=new L,g=await b.parseStream(M);v.drawings[m]=g}async _processDrawingRelsEntry(M,v,m){const b=new f,g=await b.parseStream(M);v.drawingRels[m]=g}async _processVmlDrawingEntry(M,v,m){const b=new F,g=await b.parseStream(M);v.vmlDrawings[`../drawings/${m}.vml`]=g}async _processThemeEntry(M,v,m){await new Promise((b,g)=>{const y=new s;M.on("error",g),y.on("error",g),y.on("finish",()=>{v.themes[m]=y.read().toString(),b()}),M.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(M,v){!M[Symbol.asyncIterator]&&M.pipe&&(M=M.pipe(new t));const m=[];for await(const b of M)m.push(b);return this.load(o.concat(m),v)}async load(M,v){let m;m=v&&v.base64?o.from(M.toString(),"base64"):M;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await n.loadAsync(m);for(const y of Object.values(g.files))if(!y.dir){let k,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))k=new t,k.write(await y.async("nodebuffer"));else{let I;k=new t({writableObjectMode:!0,readableObjectMode:!0}),I=p.browser?c(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let U=0;U{if(m.type==="image"){const b=`xl/media/${m.name}.${m.extension}`;if(m.filename){const g=await function(y,k){return new Promise((R,I)=>{l.readFile(y,k,(z,U)=>{z?I(z):R(U)})})}(m.filename);return M.append(g,{name:b})}if(m.buffer)return M.append(m.buffer,{name:b});if(m.base64){const g=m.base64,y=g.substring(g.indexOf(",")+1);return M.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(M,v){const m=new L,b=new f;v.worksheets.forEach(g=>{const{drawing:y}=g;if(y){m.prepare(y,{});let k=m.toXml(y);M.append(k,{name:`xl/drawings/${y.name}.xml`}),k=b.toXml(y.rels),M.append(k,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(M,v){const m=new j;v.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{m.prepare(y,{});const k=m.toXml(y);M.append(k,{name:"xl/tables/"+y.target})})})}async addContentTypes(M,v){const m=new w().toXml(v);M.append(m,{name:"[Content_Types].xml"})}async addApp(M,v){const m=new x().toXml(v);M.append(m,{name:"docProps/app.xml"})}async addCore(M,v){const m=new u;M.append(m.toXml(v),{name:"docProps/core.xml"})}async addThemes(M,v){const m=v.themes||{theme1:H};Object.keys(m).forEach(b=>{const g=m[b],y=`xl/theme/${b}.xml`;M.append(g,{name:y})})}async addOfficeRels(M){const v=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"}]);M.append(v,{name:"_rels/.rels"})}async addWorkbookRels(M,v){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"}];v.sharedStrings.count&&b.push({Id:"rId"+m++,Type:D.RelType.SharedStrings,Target:"sharedStrings.xml"}),v.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);M.append(g,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(M,v){v.sharedStrings&&v.sharedStrings.count&&M.append(v.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(M,v){const{xml:m}=v.styles;m&&M.append(m,{name:"xl/styles.xml"})}async addWorkbook(M,v){const m=new A;M.append(m.toXml(v),{name:"xl/workbook.xml"})}async addWorksheets(M,v){const m=new N,b=new f,g=new P,y=new F;v.worksheets.forEach(k=>{let R=new i;m.render(R,k),M.append(R.xml,{name:`xl/worksheets/sheet${k.id}.xml`}),k.rels&&k.rels.length&&(R=new i,b.render(R,k.rels),M.append(R.xml,{name:`xl/worksheets/_rels/sheet${k.id}.xml.rels`})),k.comments.length>0&&(R=new i,g.render(R,k),M.append(R.xml,{name:`xl/comments${k.id}.xml`}),R=new i,y.render(R,k),M.append(R.xml,{name:`xl/drawings/vmlDrawing${k.id}.vml`}))})}_finalize(M){return new Promise((v,m)=>{M.on("finish",()=>{v(this)}),M.on("error",m),M.finalize()})}prepareModel(M,v){M.creator=M.creator||"ExcelJS",M.lastModifiedBy=M.lastModifiedBy||"ExcelJS",M.created=M.created||new Date,M.modified=M.modified||new Date,M.useSharedStrings=v.useSharedStrings===void 0||v.useSharedStrings,M.useStyles=v.useStyles===void 0||v.useStyles,M.sharedStrings=new d,M.styles=M.useStyles?new h(!0):new h.Mock;const m=new A,b=new N;m.prepare(M);const g={sharedStrings:M.sharedStrings,styles:M.styles,date1904:M.properties.date1904,drawingsCount:0,media:M.media};g.drawings=M.drawings=[],g.commentRefs=M.commentRefs=[];let y=0;M.tables=[],M.worksheets.forEach(k=>{k.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,M.tables.push(R)}),b.prepare(k,g)})}async write(M,v){v=v||{};const{model:m}=this.workbook,b=new e.ZipWriter(v.zip);return b.pipe(M),this.prepareModel(m,v),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(M,v){const m=l.createWriteStream(M);return new Promise((b,g)=>{m.on("finish",()=>{b()}),m.on("error",y=>{g(y)}),this.write(m,v).then(()=>{m.end()}).catch(y=>{g(y)})})}async writeBuffer(M){const v=new s;return await this.write(v,M),v.read()}}D.RelType=a("./rel-type"),T.exports=D}).call(this)}).call(this,a("_process"),a("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(a,T,_){T.exports=` `},{}],146:[function(a,T,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvFormatterStream=void 0;const o=a("stream"),l=a("./formatter");class n extends o.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new l.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,s,r){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(c,h)=>c?(i=!0,r(c)):(h&&h.forEach(u=>{this.push(p.from(u,"utf8"))}),i=!0,r()))}catch(c){if(i)throw c;r(c)}}_flush(e){this.rowFormatter.finish((s,r)=>s?e(s):(r&&r.forEach(i=>{this.push(p.from(i,"utf8"))}),e()))}}_.CsvFormatterStream=n}).call(this)}).call(this,a("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(a,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(a,T,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=void 0;const o=p(a("lodash.isboolean")),l=p(a("lodash.isnil")),n=p(a("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}${n.default(t.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const s=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(s)?s:Array.isArray(s)?s[t]:this._headers!==null&&s[this._headers[t]]}format(t,e,s){const r=(""+(l.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:i}=this;return i.quote!==""&&r.indexOf(i.quote)!==-1?this.quoteField(r.replace(this.REPLACE_REGEXP,i.escapedQuote)):r.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(e,s)?this.quoteField(r):r}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(a,T,_){var p=function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowFormatter=void 0;const o=p(a("lodash.isfunction")),l=p(a("lodash.isequal")),n=a("./FieldFormatter"),t=a("../types");class e{constructor(r){this.rowCount=0,this.formatterOptions=r,this.fieldFormatter=new n.FieldFormatter(r),this.headers=r.headers,this.shouldWriteHeaders=r.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),r.transform&&(this.rowTransform=r.transform)}static isRowHashArray(r){return!!Array.isArray(r)&&Array.isArray(r[0])&&r[0].length===2}static isRowArray(r){return Array.isArray(r)&&!this.isRowHashArray(r)}static gatherHeaders(r){return e.isRowHashArray(r)?r.map(i=>i[0]):Array.isArray(r)?r:Object.keys(r)}static createTransform(r){return t.isSyncTransform(r)?(i,c)=>{let h=null;try{h=r(i)}catch(u){return c(u)}return c(null,h)}:(i,c)=>{r(i,c)}}set rowTransform(r){if(!o.default(r))throw new TypeError("The transform should be a function");this._rowTransform=e.createTransform(r)}format(r,i){this.callTransformer(r,(c,h)=>{if(c)return i(c);if(!r)return i(null);const u=[];if(h){const{shouldFormatColumns:d,headers:f}=this.checkHeaders(h);if(this.shouldWriteHeaders&&f&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(f,!0)),this.hasWrittenHeaders=!0),d){const w=this.gatherColumns(h);u.push(this.formatColumns(w,!1))}}return i(null,u)})}finish(r){const i=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return r(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),r(null,i)}checkHeaders(r){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const i=e.gatherHeaders(r);return this.headers=i,this.fieldFormatter.headers=i,this.shouldWriteHeaders?{shouldFormatColumns:!l.default(i,r),headers:i}:{shouldFormatColumns:!0,headers:null}}gatherColumns(r){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(r)?e.isRowHashArray(r)?this.headers.map((i,c)=>{const h=r[c];return h?h[1]:""}):e.isRowArray(r)&&!this.shouldWriteHeaders?r:this.headers.map((i,c)=>r[c]):this.headers.map(i=>r[i])}callTransformer(r,i){return this._rowTransform?this._rowTransform(r,i):i(null,r)}formatColumns(r,i){const c=r.map((u,d)=>this.fieldFormatter.format(u,d,i)).join(this.formatterOptions.delimiter),{rowCount:h}=this;return this.rowCount+=1,h?[this.formatterOptions.rowDelimiter,c].join(""):c}}_.RowFormatter=e},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=_.RowFormatter=void 0;var p=a("./RowFormatter");Object.defineProperty(_,"RowFormatter",{enumerable:!0,get:function(){return p.RowFormatter}});var o=a("./FieldFormatter");Object.defineProperty(_,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(a,T,_){(function(p){(function(){var o=Object.create?function(d,f,w,x){x===void 0&&(x=w),Object.defineProperty(d,x,{enumerable:!0,get:function(){return f[w]}})}:function(d,f,w,x){x===void 0&&(x=w),d[x]=f[w]},l=Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f},n=function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var w in d)w!=="default"&&Object.prototype.hasOwnProperty.call(d,w)&&o(f,d,w);return l(f,d),f},t=function(d,f){for(var w in d)w==="default"||Object.prototype.hasOwnProperty.call(f,w)||o(f,d,w)};Object.defineProperty(_,"__esModule",{value:!0}),_.writeToPath=_.writeToString=_.writeToBuffer=_.writeToStream=_.write=_.format=_.FormatterOptions=_.CsvFormatterStream=void 0;const e=a("util"),s=a("stream"),r=n(a("fs")),i=a("./FormatterOptions"),c=a("./CsvFormatterStream");t(a("./types"),_);var h=a("./CsvFormatterStream");Object.defineProperty(_,"CsvFormatterStream",{enumerable:!0,get:function(){return h.CsvFormatterStream}});var u=a("./FormatterOptions");Object.defineProperty(_,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),_.format=d=>new c.CsvFormatterStream(new i.FormatterOptions(d)),_.write=(d,f)=>{const w=_.format(f),x=e.promisify((A,N)=>{w.write(A,void 0,N)});return d.reduce((A,N)=>A.then(()=>x(N)),Promise.resolve()).then(()=>w.end()).catch(A=>{w.emit("error",A)}),w},_.writeToStream=(d,f,w)=>_.write(f,w).pipe(d),_.writeToBuffer=function(d){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=[],x=new s.Writable({write(A,N,L){w.push(A),L()}});return new Promise((A,N)=>{x.on("error",N).on("finish",()=>A(p.concat(w))),_.write(d,f).pipe(x)})},_.writeToString=(d,f)=>_.writeToBuffer(d,f).then(w=>w.toString()),_.writeToPath=(d,f,w)=>{const x=r.createWriteStream(d,{encoding:"utf8"});return _.write(f,w).pipe(x)}}).call(this)}).call(this,a("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1},{}],153:[function(a,T,_){(function(p){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvParserStream=void 0;const o=a("string_decoder"),l=a("stream"),n=a("./transforms"),t=a("./parser");class e extends l.Transform{constructor(r){super({objectMode:r.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=r,this.parser=new t.Parser(r),this.headerTransformer=new n.HeaderTransformer(r),this.decoder=new o.StringDecoder(r.encoding),this.rowTransformerValidator=new n.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(r){return this.rowTransformerValidator.rowTransform=r,this}validate(r){return this.rowTransformerValidator.rowValidator=r,this}emit(r){if(r==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var i=arguments.length,c=new Array(i>1?i-1:0),h=1;h{const d=x=>x?i(x):u%100!=0?h(u+1):void p(()=>h(u+1));if(this.checkAndEmitHeaders(),u>=c||this.hasHitRowLimit)return i();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const f=r[u];this.rowCount+=1,this.parsedRowCount+=1;const w=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,w,A.reason);return d()})};h(0)}transformRow(r,i){try{this.headerTransformer.transform(r,(c,h)=>c?i(c):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:r}):this.skipRow(i):i(new Error("Expected result from header transform")))}catch(c){i(c)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(r){return this.rowCount-=1,r(null,{row:null,isValid:!0})}pushRow(r,i){try{this.parserOptions.objectMode?this.push(r):this.push(JSON.stringify(r)),i()}catch(c){i(c)}}static wrapDoneCallback(r){let i=!1;return function(c){if(c){if(i)throw c;return i=!0,void r(c)}for(var h=arguments.length,u=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=!l.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(a,T,_){var p=Object.create?function(h,u,d,f){f===void 0&&(f=d),Object.defineProperty(h,f,{enumerable:!0,get:function(){return u[d]}})}:function(h,u,d,f){f===void 0&&(f=d),h[f]=u[d]},o=Object.create?function(h,u){Object.defineProperty(h,"default",{enumerable:!0,value:u})}:function(h,u){h.default=u},l=function(h){if(h&&h.__esModule)return h;var u={};if(h!=null)for(var d in h)d!=="default"&&Object.prototype.hasOwnProperty.call(h,d)&&p(u,h,d);return o(u,h),u},n=function(h,u){for(var d in h)d==="default"||Object.prototype.hasOwnProperty.call(u,d)||p(u,h,d)};Object.defineProperty(_,"__esModule",{value:!0}),_.parseString=_.parseFile=_.parseStream=_.parse=_.ParserOptions=_.CsvParserStream=void 0;const t=l(a("fs")),e=a("stream"),s=a("./ParserOptions"),r=a("./CsvParserStream");n(a("./types"),_);var i=a("./CsvParserStream");Object.defineProperty(_,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var c=a("./ParserOptions");Object.defineProperty(_,"ParserOptions",{enumerable:!0,get:function(){return c.ParserOptions}}),_.parse=h=>new r.CsvParserStream(new s.ParserOptions(h)),_.parseStream=(h,u)=>h.pipe(new r.CsvParserStream(new s.ParserOptions(u))),_.parseFile=function(h){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(h).pipe(new r.CsvParserStream(new s.ParserOptions(u)))},_.parseString=(h,u)=>{const d=new e.Readable;return d.push(h),d.push(null),d.pipe(new r.CsvParserStream(new s.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Parser=void 0;const p=a("./Scanner"),o=a("./RowParser"),l=a("./Token");class n{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,s){const r=new p.Scanner({line:n.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:s});return this.parserOptions.supportsComments?this.parseWithComments(r):this.parseWithoutComments(r)}parseWithoutComments(e){const s=[];let r=!0;for(;r;)r=this.parseRow(e,s);return{line:e.line,rows:s}}parseWithComments(e){const{parserOptions:s}=this,r=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(l.Token.isTokenComment(i,s)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows:r};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:r};e.truncateToCursor()}else if(!this.parseRow(e,r))break;return{line:e.line,rows:r}}parseRow(e,s){if(!e.nextNonSpaceToken)return!1;const r=this.rowParser.parse(e);return r!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(r)||s.push(r),!0)}}_.Parser=n},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.RowParser=void 0;const p=a("./column"),o=a("./Token");_.RowParser=class{constructor(l){this.parserOptions=l,this.columnParser=new p.ColumnParser(l)}static isEmptyRow(l){return l.join("").replace(/\s+/g,"")===""}parse(l){const{parserOptions:n}=this,{hasMoreData:t}=l,e=l,s=[];let r=this.getStartToken(e,s);for(;r;){if(o.Token.isTokenRowDelimiter(r))return e.advancePastToken(r),!e.hasMoreCharacters&&o.Token.isTokenCarriageReturn(r,n)&&t?null:(e.truncateToCursor(),s);if(!this.shouldSkipColumnParse(e,r,s)){const i=this.columnParser.parse(e);if(i===null)return null;s.push(i)}r=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),s)}getStartToken(l,n){const t=l.nextNonSpaceToken;return t!==null&&o.Token.isTokenDelimiter(t,this.parserOptions)?(n.push(""),l.nextNonSpaceToken):t}shouldSkipColumnParse(l,n,t){const{parserOptions:e}=this;if(o.Token.isTokenDelimiter(n,e)){l.advancePastToken(n);const s=l.nextCharacterToken;if(!l.hasMoreCharacters||s!==null&&o.Token.isTokenRowDelimiter(s)||s!==null&&o.Token.isTokenDelimiter(s,e))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Scanner=void 0;const p=a("./Token"),o=/((?:\r\n)|\n|\r)/;_.Scanner=class{constructor(l){this.cursor=0,this.line=l.line,this.lineLength=this.line.length,this.parserOptions=l.parserOptions,this.hasMoreData=l.hasMoreData,this.cursor=l.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:l}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(l.search(n)===-1)return null;const t=n.exec(l);if(t==null)return null;const e=t[1],s=this.cursor+(t.index||0);return new p.Token({token:e,startCursor:s,endCursor:s+e.length-1})}get nextCharacterToken(){const{cursor:l,lineLength:n}=this;return n<=l?null:new p.Token({token:this.line[l],startCursor:l,endCursor:l})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const l=o.exec(this.lineFromCursor);return l?(this.cursor+=(l.index||0)+l[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(l){return this.cursor=l,this}advanceToToken(l){return this.cursor=l.startCursor,this}advancePastToken(l){return this.cursor=l.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(a,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(a,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(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnParser=void 0;const p=a("./NonQuotedColumnParser"),o=a("./QuotedColumnParser"),l=a("../Token");_.ColumnParser=class{constructor(n){this.parserOptions=n,this.quotedColumnParser=new o.QuotedColumnParser(n),this.nonQuotedColumnParser=new p.NonQuotedColumnParser(n)}parse(n){const{nextNonSpaceToken:t}=n;return t!==null&&l.Token.isTokenQuote(t,this.parserOptions)?(n.advanceToToken(t),this.quotedColumnParser.parse(n)):this.nonQuotedColumnParser.parse(n)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.NonQuotedColumnParser=void 0;const p=a("./ColumnFormatter"),o=a("../Token");_.NonQuotedColumnParser=class{constructor(l){this.parserOptions=l,this.columnFormatter=new p.ColumnFormatter(l)}parse(l){if(!l.hasMoreCharacters)return null;const{parserOptions:n}=this,t=[];let e=l.nextCharacterToken;for(;e&&!o.Token.isTokenDelimiter(e,n)&&!o.Token.isTokenRowDelimiter(e);e=l.nextCharacterToken)t.push(e.token),l.advancePastToken(e);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=void 0;const p=a("./ColumnFormatter"),o=a("../Token");_.QuotedColumnParser=class{constructor(l){this.parserOptions=l,this.columnFormatter=new p.ColumnFormatter(l)}parse(l){if(!l.hasMoreCharacters)return null;const n=l.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(l);if(!t){if(l.advanceTo(n),!l.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${l.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(l),e}gatherDataBetweenQuotes(l){const{parserOptions:n}=this;let t=!1,e=!1;const s=[];let r=l.nextCharacterToken;for(;!e&&r!==null;r=l.nextCharacterToken){const i=o.Token.isTokenQuote(r,n);if(!t&&i)t=!0;else if(t)if(o.Token.isTokenEscapeCharacter(r,n)){l.advancePastToken(r);const c=l.nextCharacterToken;c!==null&&(o.Token.isTokenQuote(c,n)||o.Token.isTokenEscapeCharacter(c,n))?(s.push(c.token),r=c):i?e=!0:s.push(r.token)}else i?e=!0:s.push(r.token);l.advancePastToken(r)}return{col:this.columnFormatter.format(s.join("")),foundClosingQuote:e}}checkForMalformedColumn(l){const{parserOptions:n}=this,{nextNonSpaceToken:t}=l;if(t){const e=o.Token.isTokenDelimiter(t,n),s=o.Token.isTokenRowDelimiter(t);if(!e&&!s){const r=l.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${n.escapedDelimiter}' OR new line got: '${t.token}'. at '${r}`)}l.advanceToToken(t)}else l.hasMoreData||l.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=void 0;var p=a("./ColumnParser");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return p.ColumnParser}});var o=a("./NonQuotedColumnParser");Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var l=a("./QuotedColumnParser");Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return l.QuotedColumnParser}});var n=a("./ColumnFormatter");Object.defineProperty(_,"ColumnFormatter",{enumerable:!0,get:function(){return n.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=_.Token=_.Scanner=_.RowParser=_.Parser=void 0;var p=a("./Parser");Object.defineProperty(_,"Parser",{enumerable:!0,get:function(){return p.Parser}});var o=a("./RowParser");Object.defineProperty(_,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var l=a("./Scanner");Object.defineProperty(_,"Scanner",{enumerable:!0,get:function(){return l.Scanner}});var n=a("./Token");Object.defineProperty(_,"Token",{enumerable:!0,get:function(){return n.Token}});var t=a("./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(a,T,_){var p=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=void 0;const o=p(a("lodash.isundefined")),l=p(a("lodash.isfunction")),n=p(a("lodash.uniq")),t=p(a("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):l.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,s){return this.shouldMapRow(e)?s(null,this.processRow(e)):s(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:s}=this;if(!this.headersTransform&&s.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:s}=this;if(!s.discardUnmappedColumns&&e.length>this.headersLength){if(!s.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 s.strictColumnHandling&&e.length!!i);if(n.default(r).length!==r.length){const i=t.default(r),c=Object.keys(i).filter(h=>i[h].length>1);throw new Error("Duplicate headers found "+JSON.stringify(c))}this.headers=e,this.receivedHeaders=!0,this.headersLength=((s=this.headers)===null||s===void 0?void 0:s.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(a,T,_){var p=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowTransformerValidator=void 0;const o=p(a("lodash.isfunction")),l=a("../types");class n{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return l.isSyncTransform(e)?(s,r)=>{let i=null;try{i=e(s)}catch(c){return r(c)}return r(null,i)}:e}static createValidator(e){return l.isSyncValidate(e)?(s,r)=>{r(null,{row:s,isValid:e(s)})}:(s,r)=>{e(s,(i,c,h)=>i?r(i):r(null,c?{row:s,isValid:c,reason:h}:{row:s,isValid:!1,reason:h}))}}set rowTransform(e){if(!o.default(e))throw new TypeError("The transform should be a function");this._rowTransform=n.createTransform(e)}set rowValidator(e){if(!o.default(e))throw new TypeError("The validate should be a function");this._rowValidator=n.createValidator(e)}transformAndValidate(e,s){return this.callTransformer(e,(r,i)=>r?s(r):i?this.callValidator(i,(c,h)=>c?s(c):h&&!h.isValid?s(null,{row:i,isValid:!1,reason:h.reason}):s(null,{row:i,isValid:!0})):s(null,{row:null,isValid:!0}))}callTransformer(e,s){return this._rowTransform?this._rowTransform(e,s):s(null,e)}callValidator(e,s){return this._rowValidator?this._rowValidator(e,s):s(null,{row:e,isValid:!0})}}_.RowTransformerValidator=n},{"../types":169,"lodash.isfunction":446}],168:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=_.RowTransformerValidator=void 0;var p=a("./RowTransformerValidator");Object.defineProperty(_,"RowTransformerValidator",{enumerable:!0,get:function(){return p.RowTransformerValidator}});var o=a("./HeaderTransformer");Object.defineProperty(_,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(a,T,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncValidate=_.isSyncTransform=void 0,_.isSyncTransform=p=>p.length===1,_.isSyncValidate=p=>p.length===1},{}],170:[function(a,T,_){const p=_;p.bignum=a("bn.js"),p.define=a("./asn1/api").define,p.base=a("./asn1/base"),p.constants=a("./asn1/constants"),p.decoders=a("./asn1/decoders"),p.encoders=a("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(a,T,_){const p=a("./encoders"),o=a("./decoders"),l=a("inherits");function n(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}_.define=function(t,e){return new n(t,e)},n.prototype._createNamed=function(t){const e=this.name;function s(r){this._initNamed(r,e)}return l(s,t),s.prototype._initNamed=function(r,i){t.call(this,r,i)},new s(this)},n.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(o[t])),this.decoders[t]},n.prototype.decode=function(t,e,s){return this._getDecoder(e).decode(t,s)},n.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(p[t])),this.encoders[t]},n.prototype.encode=function(t,e,s){return this._getEncoder(e).encode(t,s)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(a,T,_){const p=a("inherits"),o=a("../base/reporter").Reporter,l=a("safer-buffer").Buffer;function n(e,s){o.call(this,s),l.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,s){if(Array.isArray(e))this.length=0,this.value=e.map(function(r){return t.isEncoderBuffer(r)||(r=new t(r,s)),this.length+=r.length,r},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return s.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=l.byteLength(e);else{if(!l.isBuffer(e))return s.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}p(n,o),_.DecoderBuffer=n,n.isDecoderBuffer=function(e){return e instanceof n?!0:typeof e=="object"&&l.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"},n.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},n.prototype.restore=function(e){const s=new n(this.base);return s.offset=e.offset,s.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),s},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},n.prototype.skip=function(e,s){if(!(this.offset+e<=this.length))return this.error(s||"DecoderBuffer overrun");const r=new n(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},n.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,s){return e||(e=l.alloc(this.length)),s||(s=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,s),s+=r.length}):(typeof this.value=="number"?e[s]=this.value:typeof this.value=="string"?e.write(this.value,s):l.isBuffer(this.value)&&this.value.copy(e,s),s+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(a,T,_){const p=_;p.Reporter=a("./reporter").Reporter,p.DecoderBuffer=a("./buffer").DecoderBuffer,p.EncoderBuffer=a("./buffer").EncoderBuffer,p.Node=a("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(a,T,_){const p=a("../base/reporter").Reporter,o=a("../base/buffer").EncoderBuffer,l=a("../base/buffer").DecoderBuffer,n=a("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 s(i,c,h){const u={};this._baseState=u,u.name=h,u.enc=i,u.parent=c||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}T.exports=s;const r=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];s.prototype.clone=function(){const i=this._baseState,c={};r.forEach(function(u){c[u]=i[u]});const h=new this.constructor(c.parent);return h._baseState=c,h},s.prototype._wrap=function(){const i=this._baseState;e.forEach(function(c){this[c]=function(){const h=new this.constructor(this);return i.children.push(h),h[c].apply(h,arguments)}},this)},s.prototype._init=function(i){const c=this._baseState;n(c.parent===null),i.call(this),c.children=c.children.filter(function(h){return h._baseState.parent===this},this),n.equal(c.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(i){const c=this._baseState,h=i.filter(function(u){return u instanceof this.constructor},this);i=i.filter(function(u){return!(u instanceof this.constructor)},this),h.length!==0&&(n(c.children===null),c.children=h,h.forEach(function(u){u._baseState.parent=this},this)),i.length!==0&&(n(c.args===null),c.args=i,c.reverseArgs=i.map(function(u){if(typeof u!="object"||u.constructor!==Object)return u;const d={};return Object.keys(u).forEach(function(f){f==(0|f)&&(f|=0);const w=u[f];d[w]=f}),d}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(i){s.prototype[i]=function(){const c=this._baseState;throw new Error(i+" not implemented for encoding: "+c.enc)}}),t.forEach(function(i){s.prototype[i]=function(){const c=this._baseState,h=Array.prototype.slice.call(arguments);return n(c.tag===null),c.tag=i,this._useArgs(h),this}}),s.prototype.use=function(i){n(i);const c=this._baseState;return n(c.use===null),c.use=i,this},s.prototype.optional=function(){return this._baseState.optional=!0,this},s.prototype.def=function(i){const c=this._baseState;return n(c.default===null),c.default=i,c.optional=!0,this},s.prototype.explicit=function(i){const c=this._baseState;return n(c.explicit===null&&c.implicit===null),c.explicit=i,this},s.prototype.implicit=function(i){const c=this._baseState;return n(c.explicit===null&&c.implicit===null),c.implicit=i,this},s.prototype.obj=function(){const i=this._baseState,c=Array.prototype.slice.call(arguments);return i.obj=!0,c.length!==0&&this._useArgs(c),this},s.prototype.key=function(i){const c=this._baseState;return n(c.key===null),c.key=i,this},s.prototype.any=function(){return this._baseState.any=!0,this},s.prototype.choice=function(i){const c=this._baseState;return n(c.choice===null),c.choice=i,this._useArgs(Object.keys(i).map(function(h){return i[h]})),this},s.prototype.contains=function(i){const c=this._baseState;return n(c.use===null),c.contains=i,this},s.prototype._decode=function(i,c){const h=this._baseState;if(h.parent===null)return i.wrapResult(h.children[0]._decode(i,c));let u,d=h.default,f=!0,w=null;if(h.key!==null&&(w=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,c):this._decodeChoice(i,c),f=!0}catch{f=!1}i.restore(A)}}if(h.obj&&f&&(u=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 N=this._decodeTag(i,h.implicit!==null?h.implicit:h.tag,h.any);if(i.isError(N))return N;h.any?d=i.raw(A):i=N}if(c&&c.track&&h.tag!==null&&c.track(i.path(),x,i.length,"tagged"),c&&c.track&&h.tag!==null&&c.track(i.path(),i.offset,i.length,"content"),h.any||(d=h.choice===null?this._decodeGeneric(h.tag,i,c):this._decodeChoice(i,c)),i.isError(d))return d;if(h.any||h.choice!==null||h.children===null||h.children.forEach(function(A){A._decode(i,c)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){const A=new l(d);d=this._getUse(h.contains,i._reporterState.obj)._decode(A,c)}}return h.obj&&f&&(d=i.leaveObject(u)),h.key===null||d===null&&f!==!0?w!==null&&i.exitKey(w):i.leaveKey(w,h.key,d),d},s.prototype._decodeGeneric=function(i,c,h){const u=this._baseState;return i==="seq"||i==="set"?null:i==="seqof"||i==="setof"?this._decodeList(c,i,u.args[0],h):/str$/.test(i)?this._decodeStr(c,i,h):i==="objid"&&u.args?this._decodeObjid(c,u.args[0],u.args[1],h):i==="objid"?this._decodeObjid(c,null,null,h):i==="gentime"||i==="utctime"?this._decodeTime(c,i,h):i==="null_"?this._decodeNull(c,h):i==="bool"?this._decodeBool(c,h):i==="objDesc"?this._decodeStr(c,i,h):i==="int"||i==="enum"?this._decodeInt(c,u.args&&u.args[0],h):u.use!==null?this._getUse(u.use,c._reporterState.obj)._decode(c,h):c.error("unknown tag: "+i)},s.prototype._getUse=function(i,c){const h=this._baseState;return h.useDecoder=this._use(i,c),n(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},s.prototype._decodeChoice=function(i,c){const h=this._baseState;let u=null,d=!1;return Object.keys(h.choice).some(function(f){const w=i.save(),x=h.choice[f];try{const A=x._decode(i,c);if(i.isError(A))return!1;u={type:f,value:A},d=!0}catch{return i.restore(w),!1}return!0},this),d?u:i.error("Choice not matched")},s.prototype._createEncoderBuffer=function(i){return new o(i,this.reporter)},s.prototype._encode=function(i,c,h){const u=this._baseState;if(u.default!==null&&u.default===i)return;const d=this._encodeValue(i,c,h);return d===void 0||this._skipDefault(d,c,h)?void 0:d},s.prototype._encodeValue=function(i,c,h){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(i,c||new p);let d=null;if(this.reporter=c,u.optional&&i===void 0){if(u.default===null)return;i=u.default}let f=null,w=!1;if(u.any)d=this._createEncoderBuffer(i);else if(u.choice)d=this._encodeChoice(i,c);else if(u.contains)f=this._getUse(u.contains,h)._encode(i,c),w=!0;else if(u.children)f=u.children.map(function(x){if(x._baseState.tag==="null_")return x._encode(null,c,i);if(x._baseState.key===null)return c.error("Child should have a key");const A=c.enterKey(x._baseState.key);if(typeof i!="object")return c.error("Child expected, but input is not object");const N=x._encode(i[x._baseState.key],c,i);return c.leaveKey(A),N},this).filter(function(x){return x}),f=this._createEncoderBuffer(f);else if(u.tag==="seqof"||u.tag==="setof"){if(!u.args||u.args.length!==1)return c.error("Too many args for : "+u.tag);if(!Array.isArray(i))return c.error("seqof/setof, but data is not Array");const x=this.clone();x._baseState.implicit=null,f=this._createEncoderBuffer(i.map(function(A){const N=this._baseState;return this._getUse(N.args[0],i)._encode(A,c)},x))}else u.use!==null?d=this._getUse(u.use,h)._encode(i,c):(f=this._encodePrimitive(u.tag,i),w=!0);if(!u.any&&u.choice===null){const x=u.implicit!==null?u.implicit:u.tag,A=u.implicit===null?"universal":"context";x===null?u.use===null&&c.error("Tag could be omitted only for .use()"):u.use===null&&(d=this._encodeComposite(x,w,A,f))}return u.explicit!==null&&(d=this._encodeComposite(u.explicit,!1,"context",d)),d},s.prototype._encodeChoice=function(i,c){const h=this._baseState,u=h.choice[i.type];return u||n(!1,i.type+" not found in "+JSON.stringify(Object.keys(h.choice))),u._encode(i.value,c)},s.prototype._encodePrimitive=function(i,c){const h=this._baseState;if(/str$/.test(i))return this._encodeStr(c,i);if(i==="objid"&&h.args)return this._encodeObjid(c,h.reverseArgs[0],h.args[1]);if(i==="objid")return this._encodeObjid(c,null,null);if(i==="gentime"||i==="utctime")return this._encodeTime(c,i);if(i==="null_")return this._encodeNull();if(i==="int"||i==="enum")return this._encodeInt(c,h.args&&h.reverseArgs[0]);if(i==="bool")return this._encodeBool(c);if(i==="objDesc")return this._encodeStr(c,i);throw new Error("Unsupported tag: "+i)},s.prototype._isNumstr=function(i){return/^[0-9 ]*$/.test(i)},s.prototype._isPrintstr=function(i){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(i)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(a,T,_){const p=a("inherits");function o(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}function l(n,t){this.path=n,this.rethrow(t)}_.Reporter=o,o.prototype.isError=function(n){return n instanceof l},o.prototype.save=function(){const n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},o.prototype.restore=function(n){const t=this._reporterState;t.obj=n.obj,t.path=t.path.slice(0,n.pathLen)},o.prototype.enterKey=function(n){return this._reporterState.path.push(n)},o.prototype.exitKey=function(n){const t=this._reporterState;t.path=t.path.slice(0,n-1)},o.prototype.leaveKey=function(n,t,e){const s=this._reporterState;this.exitKey(n),s.obj!==null&&(s.obj[t]=e)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const n=this._reporterState,t=n.obj;return n.obj={},t},o.prototype.leaveObject=function(n){const t=this._reporterState,e=t.obj;return t.obj=n,e},o.prototype.error=function(n){let t;const e=this._reporterState,s=n instanceof l;if(t=s?n:new l(e.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),n.message||n,n.stack),!e.options.partial)throw t;return s||e.errors.push(t),t},o.prototype.wrapResult=function(n){const t=this._reporterState;return t.options.partial?{result:this.isError(n)?null:n,errors:t.errors}:n},p(l,Error),l.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,l),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(a,T,_){function p(o){const l={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];l[t]=n}),l}_.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(a,T,_){const p=_;p._reverse=function(o){const l={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];l[t]=n}),l},p.der=a("./der")},{"./der":176}],178:[function(a,T,_){const p=a("inherits"),o=a("bn.js"),l=a("../base/buffer").DecoderBuffer,n=a("../base/node"),t=a("../constants/der");function e(c){this.enc="der",this.name=c.name,this.entity=c,this.tree=new s,this.tree._init(c.body)}function s(c){n.call(this,"der",c)}function r(c,h){let u=c.readUInt8(h);if(c.isError(u))return u;const d=t.tagClass[u>>6],f=(32&u)==0;if((31&u)==31){let w=u;for(u=0;(128&w)==128;){if(w=c.readUInt8(h),c.isError(w))return w;u<<=7,u|=127&w}}else u&=31;return{cls:d,primitive:f,tag:u,tagStr:t.tag[u]}}function i(c,h,u){let d=c.readUInt8(u);if(c.isError(d))return d;if(!h&&d===128)return null;if(!(128&d))return d;const f=127&d;if(f>4)return c.error("length octect is too long");d=0;for(let w=0;w=31?N.error("Multi-octet tag encoding unsupported"):(x||(L|=32),L|=n.tagClassByName[A||"universal"]<<6,L)}(r,i,c,this.reporter);if(h.length<128){const w=o.alloc(2);return w[0]=u,w[1]=h.length,this._createEncoderBuffer([w,h])}let d=1;for(let w=h.length;w>=256;w>>=8)d++;const f=o.alloc(2+d);f[0]=u,f[1]=128|d;for(let w=1+d,x=h.length;x>0;w--,x>>=8)f[w]=255&x;return this._createEncoderBuffer([f,h])},e.prototype._encodeStr=function(r,i){if(i==="bitstr")return this._createEncoderBuffer([0|r.unused,r.data]);if(i==="bmpstr"){const c=o.alloc(2*r.length);for(let h=0;h=40)return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}let h=0;for(let f=0;f=128;w>>=7)h++}const u=o.alloc(h);let d=u.length-1;for(let f=r.length-1;f>=0;f--){let w=r[f];for(u[d--]=127&w;(w>>=7)>0;)u[d--]=128|127&w}return this._createEncoderBuffer(u)},e.prototype._encodeTime=function(r,i){let c;const h=new Date(r);return i==="gentime"?c=[s(h.getUTCFullYear()),s(h.getUTCMonth()+1),s(h.getUTCDate()),s(h.getUTCHours()),s(h.getUTCMinutes()),s(h.getUTCSeconds()),"Z"].join(""):i==="utctime"?c=[s(h.getUTCFullYear()%100),s(h.getUTCMonth()+1),s(h.getUTCDate()),s(h.getUTCHours()),s(h.getUTCMinutes()),s(h.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+i+" time is not supported yet"),this._encodeStr(c,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(r,i){if(typeof r=="string"){if(!i)return this.reporter.error("String int or enum given, but no values map");if(!i.hasOwnProperty(r))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(r));r=i[r]}if(typeof r!="number"&&!o.isBuffer(r)){const u=r.toArray();!r.sign&&128&u[0]&&u.unshift(0),r=o.from(u)}if(o.isBuffer(r)){let u=r.length;r.length===0&&u++;const d=o.alloc(u);return r.copy(d),r.length===0&&(d[0]=0),this._createEncoderBuffer(d)}if(r<128)return this._createEncoderBuffer(r);if(r<256)return this._createEncoderBuffer([0,r]);let c=1;for(let u=r;u>=256;u>>=8)c++;const h=new Array(c);for(let u=h.length-1;u>=0;u--)h[u]=255&r,r>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(o.from(h))},e.prototype._encodeBool=function(r){return this._createEncoderBuffer(r?255:0)},e.prototype._use=function(r,i){return typeof r=="function"&&(r=r(i)),r._getEncoder("der").tree},e.prototype._skipDefault=function(r,i,c){const h=this._baseState;let u;if(h.default===null)return!1;const d=r.join();if(h.defaultBuffer===void 0&&(h.defaultBuffer=this._encodeValue(h.default,i,c).join()),d.length!==h.defaultBuffer.length)return!1;for(u=0;u=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function r(S,M,v){var m=s(S,v);return v-1>=M&&(m|=s(S,v-1)<<4),m}function i(S,M,v,m){for(var b=0,g=Math.min(S.length,v),y=M;y=49?k-49+10:k>=17?k-17+10:k}return b}t.isBN=function(S){return S instanceof t||S!==null&&typeof S=="object"&&S.constructor.wordSize===t.wordSize&&Array.isArray(S.words)},t.max=function(S,M){return S.cmp(M)>0?S:M},t.min=function(S,M){return S.cmp(M)<0?S:M},t.prototype._init=function(S,M,v){if(typeof S=="number")return this._initNumber(S,M,v);if(typeof S=="object")return this._initArray(S,M,v);M==="hex"&&(M=16),l(M===(0|M)&&M>=2&&M<=36);var m=0;(S=S.toString().replace(/\s+/g,""))[0]==="-"&&(m++,this.negative=1),m=0;m-=3)g=S[m]|S[m-1]<<8|S[m-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(v==="le")for(m=0,b=0;m>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(S,M,v){this.length=Math.ceil((S.length-M)/6),this.words=new Array(this.length);for(var m=0;m=M;m-=2)b=r(S,M,m)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(m=(S.length-M)%2==0?M+1:M;m=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(S,M,v){this.words=[0],this.length=1;for(var m=0,b=1;b<=67108863;b*=M)m++;m--,b=b/M|0;for(var g=S.length-v,y=g%m,k=Math.min(g,g-y)+v,R=0,I=v;I1&&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 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"],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],u=[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(S,M,v){v.negative=M.negative^S.negative;var m=S.length+M.length|0;v.length=m,m=m-1|0;var b=0|S.words[0],g=0|M.words[0],y=b*g,k=67108863&y,R=y/67108864|0;v.words[0]=k;for(var I=1;I>>26,U=67108863&R,q=Math.min(I,M.length-1),O=Math.max(0,I-S.length+1);O<=q;O++){var V=I-O|0;z+=(y=(b=0|S.words[V])*(g=0|M.words[O])+U)/67108864|0,U=67108863&y}v.words[I]=0|U,R=0|z}return R!==0?v.words[I]=0|R:v.length--,v.strip()}t.prototype.toString=function(S,M){var v;if(M=0|M||1,(S=S||10)===16||S==="hex"){v="";for(var m=0,b=0,g=0;g>>24-m&16777215)!==0||g!==this.length-1?c[6-k.length]+k+v:k+v,(m+=2)>=26&&(m-=26,g--)}for(b!==0&&(v=b.toString(16)+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(S===(0|S)&&S>=2&&S<=36){var R=h[S],I=u[S];v="";var z=this.clone();for(z.negative=0;!z.isZero();){var U=z.modn(I).toString(S);v=(z=z.idivn(I)).isZero()?U+v:c[R-U.length]+U+v}for(this.isZero()&&(v="0"+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}l(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var S=this.words[0];return this.length===2?S+=67108864*this.words[1]:this.length===3&&this.words[2]===1?S+=4503599627370496+67108864*this.words[1]:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-S:S},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(S,M){return l(e!==void 0),this.toArrayLike(e,S,M)},t.prototype.toArray=function(S,M){return this.toArrayLike(Array,S,M)},t.prototype.toArrayLike=function(S,M,v){var m=this.byteLength(),b=v||Math.max(1,m);l(m<=b,"byte array longer than desired length"),l(b>0,"Requested array length <= 0"),this.strip();var g,y,k=M==="le",R=new S(b),I=this.clone();if(k){for(y=0;!I.isZero();y++)g=I.andln(255),I.iushrn(8),R[y]=g;for(;y=4096&&(v+=13,M>>>=13),M>=64&&(v+=7,M>>>=7),M>=8&&(v+=4,M>>>=4),M>=2&&(v+=2,M>>>=2),v+M},t.prototype._zeroBits=function(S){if(S===0)return 26;var M=S,v=0;return!(8191&M)&&(v+=13,M>>>=13),!(127&M)&&(v+=7,M>>>=7),!(15&M)&&(v+=4,M>>>=4),!(3&M)&&(v+=2,M>>>=2),!(1&M)&&v++,v},t.prototype.bitLength=function(){var S=this.words[this.length-1],M=this._countBits(S);return 26*(this.length-1)+M},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var S=0,M=0;MS.length?this.clone().ior(S):S.clone().ior(this)},t.prototype.uor=function(S){return this.length>S.length?this.clone().iuor(S):S.clone().iuor(this)},t.prototype.iuand=function(S){var M;M=this.length>S.length?S:this;for(var v=0;vS.length?this.clone().iand(S):S.clone().iand(this)},t.prototype.uand=function(S){return this.length>S.length?this.clone().iuand(S):S.clone().iuand(this)},t.prototype.iuxor=function(S){var M,v;this.length>S.length?(M=this,v=S):(M=S,v=this);for(var m=0;mS.length?this.clone().ixor(S):S.clone().ixor(this)},t.prototype.uxor=function(S){return this.length>S.length?this.clone().iuxor(S):S.clone().iuxor(this)},t.prototype.inotn=function(S){l(typeof S=="number"&&S>=0);var M=0|Math.ceil(S/26),v=S%26;this._expand(M),v>0&&M--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},t.prototype.notn=function(S){return this.clone().inotn(S)},t.prototype.setn=function(S,M){l(typeof S=="number"&&S>=0);var v=S/26|0,m=S%26;return this._expand(v+1),this.words[v]=M?this.words[v]|1<S.length?(v=this,m=S):(v=S,m=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=v.length,b!==0)this.words[this.length]=b,this.length++;else if(v!==this)for(;gS.length?this.clone().iadd(S):S.clone().iadd(this)},t.prototype.isub=function(S){if(S.negative!==0){S.negative=0;var M=this.iadd(S);return S.negative=1,M._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(S),this.negative=1,this._normSign();var v,m,b=this.cmp(S);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(v=this,m=S):(v=S,m=this);for(var g=0,y=0;y>26,this.words[y]=67108863&M;for(;g!==0&&y>26,this.words[y]=67108863&M;if(g===0&&y>>13,O=0|y[1],V=8191&O,E=O>>>13,C=0|y[2],B=8191&C,$=C>>>13,Y=0|y[3],W=8191&Y,G=Y>>>13,Q=0|y[4],et=8191&Q,X=Q>>>13,J=0|y[5],Z=8191&J,nt=J>>>13,rt=0|y[6],st=8191&rt,lt=rt>>>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,St=0|k[0],mt=8191&St,kt=St>>>13,Mt=0|k[1],Ct=8191&Mt,Jt=Mt>>>13,se=0|k[2],It=8191&se,re=se>>>13,Gt=0|k[3],Ht=8191&Gt,ce=Gt>>>13,ne=0|k[4],Ft=8191&ne,Qt=ne>>>13,le=0|k[5],Bt=8191&le,ie=le>>>13,ue=0|k[6],$t=8191&ue,tt=ue>>>13,it=0|k[7],ct=8191&it,vt=it>>>13,Nt=0|k[8],wt=8191&Nt,Lt=Nt>>>13,Pt=0|k[9],Ot=8191&Pt,Vt=Pt>>>13;v.negative=S.negative^M.negative,v.length=19;var zt=(I+(m=Math.imul(U,mt))|0)+((8191&(b=(b=Math.imul(U,kt))+Math.imul(q,mt)|0))<<13)|0;I=((g=Math.imul(q,kt))+(b>>>13)|0)+(zt>>>26)|0,zt&=67108863,m=Math.imul(V,mt),b=(b=Math.imul(V,kt))+Math.imul(E,mt)|0,g=Math.imul(E,kt);var Yt=(I+(m=m+Math.imul(U,Ct)|0)|0)+((8191&(b=(b=b+Math.imul(U,Jt)|0)+Math.imul(q,Ct)|0))<<13)|0;I=((g=g+Math.imul(q,Jt)|0)+(b>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,m=Math.imul(B,mt),b=(b=Math.imul(B,kt))+Math.imul($,mt)|0,g=Math.imul($,kt),m=m+Math.imul(V,Ct)|0,b=(b=b+Math.imul(V,Jt)|0)+Math.imul(E,Ct)|0,g=g+Math.imul(E,Jt)|0;var me=(I+(m=m+Math.imul(U,It)|0)|0)+((8191&(b=(b=b+Math.imul(U,re)|0)+Math.imul(q,It)|0))<<13)|0;I=((g=g+Math.imul(q,re)|0)+(b>>>13)|0)+(me>>>26)|0,me&=67108863,m=Math.imul(W,mt),b=(b=Math.imul(W,kt))+Math.imul(G,mt)|0,g=Math.imul(G,kt),m=m+Math.imul(B,Ct)|0,b=(b=b+Math.imul(B,Jt)|0)+Math.imul($,Ct)|0,g=g+Math.imul($,Jt)|0,m=m+Math.imul(V,It)|0,b=(b=b+Math.imul(V,re)|0)+Math.imul(E,It)|0,g=g+Math.imul(E,re)|0;var he=(I+(m=m+Math.imul(U,Ht)|0)|0)+((8191&(b=(b=b+Math.imul(U,ce)|0)+Math.imul(q,Ht)|0))<<13)|0;I=((g=g+Math.imul(q,ce)|0)+(b>>>13)|0)+(he>>>26)|0,he&=67108863,m=Math.imul(et,mt),b=(b=Math.imul(et,kt))+Math.imul(X,mt)|0,g=Math.imul(X,kt),m=m+Math.imul(W,Ct)|0,b=(b=b+Math.imul(W,Jt)|0)+Math.imul(G,Ct)|0,g=g+Math.imul(G,Jt)|0,m=m+Math.imul(B,It)|0,b=(b=b+Math.imul(B,re)|0)+Math.imul($,It)|0,g=g+Math.imul($,re)|0,m=m+Math.imul(V,Ht)|0,b=(b=b+Math.imul(V,ce)|0)+Math.imul(E,Ht)|0,g=g+Math.imul(E,ce)|0;var ye=(I+(m=m+Math.imul(U,Ft)|0)|0)+((8191&(b=(b=b+Math.imul(U,Qt)|0)+Math.imul(q,Ft)|0))<<13)|0;I=((g=g+Math.imul(q,Qt)|0)+(b>>>13)|0)+(ye>>>26)|0,ye&=67108863,m=Math.imul(Z,mt),b=(b=Math.imul(Z,kt))+Math.imul(nt,mt)|0,g=Math.imul(nt,kt),m=m+Math.imul(et,Ct)|0,b=(b=b+Math.imul(et,Jt)|0)+Math.imul(X,Ct)|0,g=g+Math.imul(X,Jt)|0,m=m+Math.imul(W,It)|0,b=(b=b+Math.imul(W,re)|0)+Math.imul(G,It)|0,g=g+Math.imul(G,re)|0,m=m+Math.imul(B,Ht)|0,b=(b=b+Math.imul(B,ce)|0)+Math.imul($,Ht)|0,g=g+Math.imul($,ce)|0,m=m+Math.imul(V,Ft)|0,b=(b=b+Math.imul(V,Qt)|0)+Math.imul(E,Ft)|0,g=g+Math.imul(E,Qt)|0;var ve=(I+(m=m+Math.imul(U,Bt)|0)|0)+((8191&(b=(b=b+Math.imul(U,ie)|0)+Math.imul(q,Bt)|0))<<13)|0;I=((g=g+Math.imul(q,ie)|0)+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,m=Math.imul(st,mt),b=(b=Math.imul(st,kt))+Math.imul(lt,mt)|0,g=Math.imul(lt,kt),m=m+Math.imul(Z,Ct)|0,b=(b=b+Math.imul(Z,Jt)|0)+Math.imul(nt,Ct)|0,g=g+Math.imul(nt,Jt)|0,m=m+Math.imul(et,It)|0,b=(b=b+Math.imul(et,re)|0)+Math.imul(X,It)|0,g=g+Math.imul(X,re)|0,m=m+Math.imul(W,Ht)|0,b=(b=b+Math.imul(W,ce)|0)+Math.imul(G,Ht)|0,g=g+Math.imul(G,ce)|0,m=m+Math.imul(B,Ft)|0,b=(b=b+Math.imul(B,Qt)|0)+Math.imul($,Ft)|0,g=g+Math.imul($,Qt)|0,m=m+Math.imul(V,Bt)|0,b=(b=b+Math.imul(V,ie)|0)+Math.imul(E,Bt)|0,g=g+Math.imul(E,ie)|0;var Se=(I+(m=m+Math.imul(U,$t)|0)|0)+((8191&(b=(b=b+Math.imul(U,tt)|0)+Math.imul(q,$t)|0))<<13)|0;I=((g=g+Math.imul(q,tt)|0)+(b>>>13)|0)+(Se>>>26)|0,Se&=67108863,m=Math.imul(dt,mt),b=(b=Math.imul(dt,kt))+Math.imul(xt,mt)|0,g=Math.imul(xt,kt),m=m+Math.imul(st,Ct)|0,b=(b=b+Math.imul(st,Jt)|0)+Math.imul(lt,Ct)|0,g=g+Math.imul(lt,Jt)|0,m=m+Math.imul(Z,It)|0,b=(b=b+Math.imul(Z,re)|0)+Math.imul(nt,It)|0,g=g+Math.imul(nt,re)|0,m=m+Math.imul(et,Ht)|0,b=(b=b+Math.imul(et,ce)|0)+Math.imul(X,Ht)|0,g=g+Math.imul(X,ce)|0,m=m+Math.imul(W,Ft)|0,b=(b=b+Math.imul(W,Qt)|0)+Math.imul(G,Ft)|0,g=g+Math.imul(G,Qt)|0,m=m+Math.imul(B,Bt)|0,b=(b=b+Math.imul(B,ie)|0)+Math.imul($,Bt)|0,g=g+Math.imul($,ie)|0,m=m+Math.imul(V,$t)|0,b=(b=b+Math.imul(V,tt)|0)+Math.imul(E,$t)|0,g=g+Math.imul(E,tt)|0;var K=(I+(m=m+Math.imul(U,ct)|0)|0)+((8191&(b=(b=b+Math.imul(U,vt)|0)+Math.imul(q,ct)|0))<<13)|0;I=((g=g+Math.imul(q,vt)|0)+(b>>>13)|0)+(K>>>26)|0,K&=67108863,m=Math.imul(yt,mt),b=(b=Math.imul(yt,kt))+Math.imul(Rt,mt)|0,g=Math.imul(Rt,kt),m=m+Math.imul(dt,Ct)|0,b=(b=b+Math.imul(dt,Jt)|0)+Math.imul(xt,Ct)|0,g=g+Math.imul(xt,Jt)|0,m=m+Math.imul(st,It)|0,b=(b=b+Math.imul(st,re)|0)+Math.imul(lt,It)|0,g=g+Math.imul(lt,re)|0,m=m+Math.imul(Z,Ht)|0,b=(b=b+Math.imul(Z,ce)|0)+Math.imul(nt,Ht)|0,g=g+Math.imul(nt,ce)|0,m=m+Math.imul(et,Ft)|0,b=(b=b+Math.imul(et,Qt)|0)+Math.imul(X,Ft)|0,g=g+Math.imul(X,Qt)|0,m=m+Math.imul(W,Bt)|0,b=(b=b+Math.imul(W,ie)|0)+Math.imul(G,Bt)|0,g=g+Math.imul(G,ie)|0,m=m+Math.imul(B,$t)|0,b=(b=b+Math.imul(B,tt)|0)+Math.imul($,$t)|0,g=g+Math.imul($,tt)|0,m=m+Math.imul(V,ct)|0,b=(b=b+Math.imul(V,vt)|0)+Math.imul(E,ct)|0,g=g+Math.imul(E,vt)|0;var ot=(I+(m=m+Math.imul(U,wt)|0)|0)+((8191&(b=(b=b+Math.imul(U,Lt)|0)+Math.imul(q,wt)|0))<<13)|0;I=((g=g+Math.imul(q,Lt)|0)+(b>>>13)|0)+(ot>>>26)|0,ot&=67108863,m=Math.imul(At,mt),b=(b=Math.imul(At,kt))+Math.imul(jt,mt)|0,g=Math.imul(jt,kt),m=m+Math.imul(yt,Ct)|0,b=(b=b+Math.imul(yt,Jt)|0)+Math.imul(Rt,Ct)|0,g=g+Math.imul(Rt,Jt)|0,m=m+Math.imul(dt,It)|0,b=(b=b+Math.imul(dt,re)|0)+Math.imul(xt,It)|0,g=g+Math.imul(xt,re)|0,m=m+Math.imul(st,Ht)|0,b=(b=b+Math.imul(st,ce)|0)+Math.imul(lt,Ht)|0,g=g+Math.imul(lt,ce)|0,m=m+Math.imul(Z,Ft)|0,b=(b=b+Math.imul(Z,Qt)|0)+Math.imul(nt,Ft)|0,g=g+Math.imul(nt,Qt)|0,m=m+Math.imul(et,Bt)|0,b=(b=b+Math.imul(et,ie)|0)+Math.imul(X,Bt)|0,g=g+Math.imul(X,ie)|0,m=m+Math.imul(W,$t)|0,b=(b=b+Math.imul(W,tt)|0)+Math.imul(G,$t)|0,g=g+Math.imul(G,tt)|0,m=m+Math.imul(B,ct)|0,b=(b=b+Math.imul(B,vt)|0)+Math.imul($,ct)|0,g=g+Math.imul($,vt)|0,m=m+Math.imul(V,wt)|0,b=(b=b+Math.imul(V,Lt)|0)+Math.imul(E,wt)|0,g=g+Math.imul(E,Lt)|0;var ft=(I+(m=m+Math.imul(U,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(U,Vt)|0)+Math.imul(q,Ot)|0))<<13)|0;I=((g=g+Math.imul(q,Vt)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,m=Math.imul(At,Ct),b=(b=Math.imul(At,Jt))+Math.imul(jt,Ct)|0,g=Math.imul(jt,Jt),m=m+Math.imul(yt,It)|0,b=(b=b+Math.imul(yt,re)|0)+Math.imul(Rt,It)|0,g=g+Math.imul(Rt,re)|0,m=m+Math.imul(dt,Ht)|0,b=(b=b+Math.imul(dt,ce)|0)+Math.imul(xt,Ht)|0,g=g+Math.imul(xt,ce)|0,m=m+Math.imul(st,Ft)|0,b=(b=b+Math.imul(st,Qt)|0)+Math.imul(lt,Ft)|0,g=g+Math.imul(lt,Qt)|0,m=m+Math.imul(Z,Bt)|0,b=(b=b+Math.imul(Z,ie)|0)+Math.imul(nt,Bt)|0,g=g+Math.imul(nt,ie)|0,m=m+Math.imul(et,$t)|0,b=(b=b+Math.imul(et,tt)|0)+Math.imul(X,$t)|0,g=g+Math.imul(X,tt)|0,m=m+Math.imul(W,ct)|0,b=(b=b+Math.imul(W,vt)|0)+Math.imul(G,ct)|0,g=g+Math.imul(G,vt)|0,m=m+Math.imul(B,wt)|0,b=(b=b+Math.imul(B,Lt)|0)+Math.imul($,wt)|0,g=g+Math.imul($,Lt)|0;var pt=(I+(m=m+Math.imul(V,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(V,Vt)|0)+Math.imul(E,Ot)|0))<<13)|0;I=((g=g+Math.imul(E,Vt)|0)+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,m=Math.imul(At,It),b=(b=Math.imul(At,re))+Math.imul(jt,It)|0,g=Math.imul(jt,re),m=m+Math.imul(yt,Ht)|0,b=(b=b+Math.imul(yt,ce)|0)+Math.imul(Rt,Ht)|0,g=g+Math.imul(Rt,ce)|0,m=m+Math.imul(dt,Ft)|0,b=(b=b+Math.imul(dt,Qt)|0)+Math.imul(xt,Ft)|0,g=g+Math.imul(xt,Qt)|0,m=m+Math.imul(st,Bt)|0,b=(b=b+Math.imul(st,ie)|0)+Math.imul(lt,Bt)|0,g=g+Math.imul(lt,ie)|0,m=m+Math.imul(Z,$t)|0,b=(b=b+Math.imul(Z,tt)|0)+Math.imul(nt,$t)|0,g=g+Math.imul(nt,tt)|0,m=m+Math.imul(et,ct)|0,b=(b=b+Math.imul(et,vt)|0)+Math.imul(X,ct)|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(G,wt)|0,g=g+Math.imul(G,Lt)|0;var Tt=(I+(m=m+Math.imul(B,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(B,Vt)|0)+Math.imul($,Ot)|0))<<13)|0;I=((g=g+Math.imul($,Vt)|0)+(b>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,m=Math.imul(At,Ht),b=(b=Math.imul(At,ce))+Math.imul(jt,Ht)|0,g=Math.imul(jt,ce),m=m+Math.imul(yt,Ft)|0,b=(b=b+Math.imul(yt,Qt)|0)+Math.imul(Rt,Ft)|0,g=g+Math.imul(Rt,Qt)|0,m=m+Math.imul(dt,Bt)|0,b=(b=b+Math.imul(dt,ie)|0)+Math.imul(xt,Bt)|0,g=g+Math.imul(xt,ie)|0,m=m+Math.imul(st,$t)|0,b=(b=b+Math.imul(st,tt)|0)+Math.imul(lt,$t)|0,g=g+Math.imul(lt,tt)|0,m=m+Math.imul(Z,ct)|0,b=(b=b+Math.imul(Z,vt)|0)+Math.imul(nt,ct)|0,g=g+Math.imul(nt,vt)|0,m=m+Math.imul(et,wt)|0,b=(b=b+Math.imul(et,Lt)|0)+Math.imul(X,wt)|0,g=g+Math.imul(X,Lt)|0;var bt=(I+(m=m+Math.imul(W,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(W,Vt)|0)+Math.imul(G,Ot)|0))<<13)|0;I=((g=g+Math.imul(G,Vt)|0)+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,m=Math.imul(At,Ft),b=(b=Math.imul(At,Qt))+Math.imul(jt,Ft)|0,g=Math.imul(jt,Qt),m=m+Math.imul(yt,Bt)|0,b=(b=b+Math.imul(yt,ie)|0)+Math.imul(Rt,Bt)|0,g=g+Math.imul(Rt,ie)|0,m=m+Math.imul(dt,$t)|0,b=(b=b+Math.imul(dt,tt)|0)+Math.imul(xt,$t)|0,g=g+Math.imul(xt,tt)|0,m=m+Math.imul(st,ct)|0,b=(b=b+Math.imul(st,vt)|0)+Math.imul(lt,ct)|0,g=g+Math.imul(lt,vt)|0,m=m+Math.imul(Z,wt)|0,b=(b=b+Math.imul(Z,Lt)|0)+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Lt)|0;var gt=(I+(m=m+Math.imul(et,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(et,Vt)|0)+Math.imul(X,Ot)|0))<<13)|0;I=((g=g+Math.imul(X,Vt)|0)+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,m=Math.imul(At,Bt),b=(b=Math.imul(At,ie))+Math.imul(jt,Bt)|0,g=Math.imul(jt,ie),m=m+Math.imul(yt,$t)|0,b=(b=b+Math.imul(yt,tt)|0)+Math.imul(Rt,$t)|0,g=g+Math.imul(Rt,tt)|0,m=m+Math.imul(dt,ct)|0,b=(b=b+Math.imul(dt,vt)|0)+Math.imul(xt,ct)|0,g=g+Math.imul(xt,vt)|0,m=m+Math.imul(st,wt)|0,b=(b=b+Math.imul(st,Lt)|0)+Math.imul(lt,wt)|0,g=g+Math.imul(lt,Lt)|0;var Kt=(I+(m=m+Math.imul(Z,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(Z,Vt)|0)+Math.imul(nt,Ot)|0))<<13)|0;I=((g=g+Math.imul(nt,Vt)|0)+(b>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,m=Math.imul(At,$t),b=(b=Math.imul(At,tt))+Math.imul(jt,$t)|0,g=Math.imul(jt,tt),m=m+Math.imul(yt,ct)|0,b=(b=b+Math.imul(yt,vt)|0)+Math.imul(Rt,ct)|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 Wt=(I+(m=m+Math.imul(st,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(st,Vt)|0)+Math.imul(lt,Ot)|0))<<13)|0;I=((g=g+Math.imul(lt,Vt)|0)+(b>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,m=Math.imul(At,ct),b=(b=Math.imul(At,vt))+Math.imul(jt,ct)|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 qt=(I+(m=m+Math.imul(dt,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(dt,Vt)|0)+Math.imul(xt,Ot)|0))<<13)|0;I=((g=g+Math.imul(xt,Vt)|0)+(b>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(At,wt),b=(b=Math.imul(At,Lt))+Math.imul(jt,wt)|0,g=Math.imul(jt,Lt);var Dt=(I+(m=m+Math.imul(yt,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(yt,Vt)|0)+Math.imul(Rt,Ot)|0))<<13)|0;I=((g=g+Math.imul(Rt,Vt)|0)+(b>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var oe=(I+(m=Math.imul(At,Ot))|0)+((8191&(b=(b=Math.imul(At,Vt))+Math.imul(jt,Ot)|0))<<13)|0;return I=((g=Math.imul(jt,Vt))+(b>>>13)|0)+(oe>>>26)|0,oe&=67108863,R[0]=zt,R[1]=Yt,R[2]=me,R[3]=he,R[4]=ye,R[5]=ve,R[6]=Se,R[7]=K,R[8]=ot,R[9]=ft,R[10]=pt,R[11]=Tt,R[12]=bt,R[13]=gt,R[14]=Kt,R[15]=Wt,R[16]=qt,R[17]=Dt,R[18]=oe,I!==0&&(R[19]=I,v.length++),v};function w(S,M,v){return new x().mulp(S,M,v)}function x(S,M){this.x=S,this.y=M}Math.imul||(f=d),t.prototype.mulTo=function(S,M){var v=this.length+S.length;return this.length===10&&S.length===10?f(this,S,M):v<63?d(this,S,M):v<1024?function(m,b,g){g.negative=b.negative^m.negative,g.length=m.length+b.length;for(var y=0,k=0,R=0;R>>26)|0)>>>26,I&=67108863}g.words[R]=z,y=I,I=k}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,S,M):w(this,S,M)},x.prototype.makeRBT=function(S){for(var M=new Array(S),v=t.prototype._countBits(S)-1,m=0;m>=1;return m},x.prototype.permute=function(S,M,v,m,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,v[2*g+1]=8191&b,b>>>=13;for(g=2*M;g>=26,M+=m/67108864|0,M+=b>>>26,this.words[v]=67108863&b}return M!==0&&(this.words[v]=M,this.length++),this},t.prototype.muln=function(S){return this.clone().imuln(S)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(S){var M=function(g){for(var y=new Array(g.bitLength()),k=0;k>>I}return y}(S);if(M.length===0)return new t(1);for(var v=this,m=0;m=0);var M,v=S%26,m=(S-v)/26,b=67108863>>>26-v<<26-v;if(v!==0){var g=0;for(M=0;M>>26-v}g&&(this.words[M]=g,this.length++)}if(m!==0){for(M=this.length-1;M>=0;M--)this.words[M+m]=this.words[M];for(M=0;M=0),m=M?(M-M%26)/26:0;var b=S%26,g=Math.min((S-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(I!==0||R>=m);R--){var z=0|this.words[R];this.words[R]=I<<26-b|z>>>b,I=z&y}return k&&I!==0&&(k.words[k.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(S,M,v){return l(this.negative===0),this.iushrn(S,M,v)},t.prototype.shln=function(S){return this.clone().ishln(S)},t.prototype.ushln=function(S){return this.clone().iushln(S)},t.prototype.shrn=function(S){return this.clone().ishrn(S)},t.prototype.ushrn=function(S){return this.clone().iushrn(S)},t.prototype.testn=function(S){l(typeof S=="number"&&S>=0);var M=S%26,v=(S-M)/26,m=1<=0);var M=S%26,v=(S-M)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(M!==0&&v++,this.length=Math.min(v,this.length),M!==0){var m=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(S){if(l(typeof S=="number"),l(S<67108864),S<0)return this.iaddn(-S);if(this.negative!==0)return this.negative=0,this.iaddn(S),this.negative=1,this;if(this.words[0]-=S,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var M=0;M>26)-(k/67108864|0),this.words[m+v]=67108863&b}for(;m>26,this.words[m+v]=67108863&b;if(y===0)return this.strip();for(l(y===-1),y=0,m=0;m>26,this.words[m]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(S,M){var v=(this.length,S.length),m=this.clone(),b=S,g=0|b.words[b.length-1];(v=26-this._countBits(g))!==0&&(b=b.ushln(v),m.iushln(v),g=0|b.words[b.length-1]);var y,k=m.length-b.length;if(M!=="mod"){(y=new t(null)).length=k+1,y.words=new Array(y.length);for(var R=0;R=0;z--){var U=67108864*(0|m.words[b.length+z])+(0|m.words[b.length+z-1]);for(U=Math.min(U/g|0,67108863),m._ishlnsubmul(b,U,z);m.negative!==0;)U--,m.negative=0,m._ishlnsubmul(b,1,z),m.isZero()||(m.negative^=1);y&&(y.words[z]=U)}return y&&y.strip(),m.strip(),M!=="div"&&v!==0&&m.iushrn(v),{div:y||null,mod:m}},t.prototype.divmod=function(S,M,v){return l(!S.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&S.negative===0?(g=this.neg().divmod(S,M),M!=="mod"&&(m=g.div.neg()),M!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.iadd(S)),{div:m,mod:b}):this.negative===0&&S.negative!==0?(g=this.divmod(S.neg(),M),M!=="mod"&&(m=g.div.neg()),{div:m,mod:g.mod}):this.negative&S.negative?(g=this.neg().divmod(S.neg(),M),M!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.isub(S)),{div:g.div,mod:b}):S.length>this.length||this.cmp(S)<0?{div:new t(0),mod:this}:S.length===1?M==="div"?{div:this.divn(S.words[0]),mod:null}:M==="mod"?{div:null,mod:new t(this.modn(S.words[0]))}:{div:this.divn(S.words[0]),mod:new t(this.modn(S.words[0]))}:this._wordDiv(S,M);var m,b,g},t.prototype.div=function(S){return this.divmod(S,"div",!1).div},t.prototype.mod=function(S){return this.divmod(S,"mod",!1).mod},t.prototype.umod=function(S){return this.divmod(S,"mod",!0).mod},t.prototype.divRound=function(S){var M=this.divmod(S);if(M.mod.isZero())return M.div;var v=M.div.negative!==0?M.mod.isub(S):M.mod,m=S.ushrn(1),b=S.andln(1),g=v.cmp(m);return g<0||b===1&&g===0?M.div:M.div.negative!==0?M.div.isubn(1):M.div.iaddn(1)},t.prototype.modn=function(S){l(S<=67108863);for(var M=(1<<26)%S,v=0,m=this.length-1;m>=0;m--)v=(M*v+(0|this.words[m]))%S;return v},t.prototype.idivn=function(S){l(S<=67108863);for(var M=0,v=this.length-1;v>=0;v--){var m=(0|this.words[v])+67108864*M;this.words[v]=m/S|0,M=m%S}return this.strip()},t.prototype.divn=function(S){return this.clone().idivn(S)},t.prototype.egcd=function(S){l(S.negative===0),l(!S.isZero());var M=this,v=S.clone();M=M.negative!==0?M.umod(S):M.clone();for(var m=new t(1),b=new t(0),g=new t(0),y=new t(1),k=0;M.isEven()&&v.isEven();)M.iushrn(1),v.iushrn(1),++k;for(var R=v.clone(),I=M.clone();!M.isZero();){for(var z=0,U=1;!(M.words[0]&U)&&z<26;++z,U<<=1);if(z>0)for(M.iushrn(z);z-- >0;)(m.isOdd()||b.isOdd())&&(m.iadd(R),b.isub(I)),m.iushrn(1),b.iushrn(1);for(var q=0,O=1;!(v.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(v.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(I)),g.iushrn(1),y.iushrn(1);M.cmp(v)>=0?(M.isub(v),m.isub(g),b.isub(y)):(v.isub(M),g.isub(m),y.isub(b))}return{a:g,b:y,gcd:v.iushln(k)}},t.prototype._invmp=function(S){l(S.negative===0),l(!S.isZero());var M=this,v=S.clone();M=M.negative!==0?M.umod(S):M.clone();for(var m,b=new t(1),g=new t(0),y=v.clone();M.cmpn(1)>0&&v.cmpn(1)>0;){for(var k=0,R=1;!(M.words[0]&R)&&k<26;++k,R<<=1);if(k>0)for(M.iushrn(k);k-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var I=0,z=1;!(v.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(v.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);M.cmp(v)>=0?(M.isub(v),b.isub(g)):(v.isub(M),g.isub(b))}return(m=M.cmpn(1)===0?b:g).cmpn(0)<0&&m.iadd(S),m},t.prototype.gcd=function(S){if(this.isZero())return S.abs();if(S.isZero())return this.abs();var M=this.clone(),v=S.clone();M.negative=0,v.negative=0;for(var m=0;M.isEven()&&v.isEven();m++)M.iushrn(1),v.iushrn(1);for(;;){for(;M.isEven();)M.iushrn(1);for(;v.isEven();)v.iushrn(1);var b=M.cmp(v);if(b<0){var g=M;M=v,v=g}else if(b===0||v.cmpn(1)===0)break;M.isub(v)}return v.iushln(m)},t.prototype.invm=function(S){return this.egcd(S).a.umod(S)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(S){return this.words[0]&S},t.prototype.bincn=function(S){l(typeof S=="number");var M=S%26,v=(S-M)/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(S){var M,v=S<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;if(this.strip(),this.length>1)M=1;else{v&&(S=-S),l(S<=67108863,"Number is too big");var m=0|this.words[0];M=m===S?0:mS.length)return 1;if(this.length=0;v--){var m=0|this.words[v],b=0|S.words[v];if(m!==b){mb&&(M=1);break}}return M},t.prototype.gtn=function(S){return this.cmpn(S)===1},t.prototype.gt=function(S){return this.cmp(S)===1},t.prototype.gten=function(S){return this.cmpn(S)>=0},t.prototype.gte=function(S){return this.cmp(S)>=0},t.prototype.ltn=function(S){return this.cmpn(S)===-1},t.prototype.lt=function(S){return this.cmp(S)===-1},t.prototype.lten=function(S){return this.cmpn(S)<=0},t.prototype.lte=function(S){return this.cmp(S)<=0},t.prototype.eqn=function(S){return this.cmpn(S)===0},t.prototype.eq=function(S){return this.cmp(S)===0},t.red=function(S){return new H(S)},t.prototype.toRed=function(S){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),S.convertTo(this)._forceRed(S)},t.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(S){return this.red=S,this},t.prototype.forceRed=function(S){return l(!this.red,"Already a number in reduction context"),this._forceRed(S)},t.prototype.redAdd=function(S){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,S)},t.prototype.redIAdd=function(S){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,S)},t.prototype.redSub=function(S){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,S)},t.prototype.redISub=function(S){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,S)},t.prototype.redShl=function(S){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,S)},t.prototype.redMul=function(S){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.mul(this,S)},t.prototype.redIMul=function(S){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.imul(this,S)},t.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(S){return l(this.red&&!S.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,S)};var A={k256:null,p224:null,p192:null,p25519:null};function N(S,M){this.name=S,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 L(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function F(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function H(S){if(typeof S=="string"){var M=t._prime(S);this.m=M.p,this.prime=M}else l(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}function D(S){H.call(this,S),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)}N.prototype._tmp=function(){var S=new t(null);return S.words=new Array(Math.ceil(this.n/13)),S},N.prototype.ireduce=function(S){var M,v=S;do this.split(v,this.tmp),M=(v=(v=this.imulK(v)).iadd(this.tmp)).bitLength();while(M>this.n);var m=M0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},N.prototype.split=function(S,M){S.iushrn(this.n,0,M)},N.prototype.imulK=function(S){return S.imul(this.k)},n(L,N),L.prototype.split=function(S,M){for(var v=Math.min(S.length,9),m=0;m>>22,b=g}b>>>=22,S.words[m-10]=b,b===0&&S.length>10?S.length-=10:S.length-=9},L.prototype.imulK=function(S){S.words[S.length]=0,S.words[S.length+1]=0,S.length+=2;for(var M=0,v=0;v>>=26,S.words[v]=b,M=m}return M!==0&&(S.words[S.length++]=M),S},t._prime=function(S){if(A[S])return A[S];var M;if(S==="k256")M=new L;else if(S==="p224")M=new j;else if(S==="p192")M=new P;else{if(S!=="p25519")throw new Error("Unknown prime "+S);M=new F}return A[S]=M,M},H.prototype._verify1=function(S){l(S.negative===0,"red works only with positives"),l(S.red,"red works only with red numbers")},H.prototype._verify2=function(S,M){l((S.negative|M.negative)==0,"red works only with positives"),l(S.red&&S.red===M.red,"red works only with red numbers")},H.prototype.imod=function(S){return this.prime?this.prime.ireduce(S)._forceRed(this):S.umod(this.m)._forceRed(this)},H.prototype.neg=function(S){return S.isZero()?S.clone():this.m.sub(S)._forceRed(this)},H.prototype.add=function(S,M){this._verify2(S,M);var v=S.add(M);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},H.prototype.iadd=function(S,M){this._verify2(S,M);var v=S.iadd(M);return v.cmp(this.m)>=0&&v.isub(this.m),v},H.prototype.sub=function(S,M){this._verify2(S,M);var v=S.sub(M);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},H.prototype.isub=function(S,M){this._verify2(S,M);var v=S.isub(M);return v.cmpn(0)<0&&v.iadd(this.m),v},H.prototype.shl=function(S,M){return this._verify1(S),this.imod(S.ushln(M))},H.prototype.imul=function(S,M){return this._verify2(S,M),this.imod(S.imul(M))},H.prototype.mul=function(S,M){return this._verify2(S,M),this.imod(S.mul(M))},H.prototype.isqr=function(S){return this.imul(S,S.clone())},H.prototype.sqr=function(S){return this.mul(S,S)},H.prototype.sqrt=function(S){if(S.isZero())return S.clone();var M=this.m.andln(3);if(l(M%2==1),M===3){var v=this.m.add(new t(1)).iushrn(2);return this.pow(S,v)}for(var m=this.m.subn(1),b=0;!m.isZero()&&m.andln(1)===0;)b++,m.iushrn(1);l(!m.isZero());var g=new t(1).toRed(this),y=g.redNeg(),k=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new t(2*R*R).toRed(this);this.pow(R,k).cmp(y)!==0;)R.redIAdd(y);for(var I=this.pow(R,m),z=this.pow(S,m.addn(1).iushrn(1)),U=this.pow(S,m),q=b;U.cmp(g)!==0;){for(var O=U,V=0;O.cmp(g)!==0;V++)O=O.redSqr();l(V=0;m--){for(var R=M.words[m],I=k-1;I>=0;I--){var z=R>>I&1;b!==v[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||m===0&&I===0)&&(b=this.mul(b,v[g]),y=0,g=0)):y=0}k=26}return b},H.prototype.convertTo=function(S){var M=S.umod(this.m);return M===S?M.clone():M},H.prototype.convertFrom=function(S){var M=S.clone();return M.red=null,M},t.mont=function(S){return new D(S)},n(D,H),D.prototype.convertTo=function(S){return this.imod(S.ushln(this.shift))},D.prototype.convertFrom=function(S){var M=this.imod(S.mul(this.rinv));return M.red=null,M},D.prototype.imul=function(S,M){if(S.isZero()||M.isZero())return S.words[0]=0,S.length=1,S;var v=S.imul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.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)},D.prototype.mul=function(S,M){if(S.isZero()||M.isZero())return new t(0)._forceRed(this);var v=S.mul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.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)},D.prototype.invm=function(S){return this.imod(S._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],185:[function(a,T,_){_.byteLength=function(i){var c=s(i),h=c[0],u=c[1];return 3*(h+u)/4-u},_.toByteArray=function(i){var c,h,u=s(i),d=u[0],f=u[1],w=new l(function(N,L,j){return 3*(L+j)/4-j}(0,d,f)),x=0,A=f>0?d-4:d;for(h=0;h>16&255,w[x++]=c>>8&255,w[x++]=255&c;return f===2&&(c=o[i.charCodeAt(h)]<<2|o[i.charCodeAt(h+1)]>>4,w[x++]=255&c),f===1&&(c=o[i.charCodeAt(h)]<<10|o[i.charCodeAt(h+1)]<<4|o[i.charCodeAt(h+2)]>>2,w[x++]=c>>8&255,w[x++]=255&c),w},_.fromByteArray=function(i){for(var c,h=i.length,u=h%3,d=[],f=0,w=h-u;fw?w:f+16383));return u===1?(c=i[h-1],d.push(p[c>>2]+p[c<<4&63]+"==")):u===2&&(c=(i[h-2]<<8)+i[h-1],d.push(p[c>>10]+p[c>>4&63]+p[c<<2&63]+"=")),d.join("")};for(var p=[],o=[],l=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var h=i.indexOf("=");return h===-1&&(h=c),[h,h===c?0:4-h%4]}function r(i,c,h){for(var u,d,f=[],w=c;w>18&63]+p[d>>12&63]+p[d>>6&63]+p[63&d]);return f.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],186:[function(a,T,_){(function(p,o){function l(v,m){if(!v)throw new Error(m||"Assertion failed")}function n(v,m){v.super_=m;var b=function(){};b.prototype=m.prototype,v.prototype=new b,v.prototype.constructor=v}function t(v,m,b){if(t.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&(m!=="le"&&m!=="be"||(b=m,m=10),this._init(v||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:a("buffer").Buffer}catch{}function s(v,m){var b=v.charCodeAt(m);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void l(!1,"Invalid character in "+v)}function r(v,m,b){var g=s(v,b);return b-1>=m&&(g|=s(v,b-1)<<4),g}function i(v,m,b,g){for(var y=0,k=0,R=Math.min(v.length,b),I=m;I=49?z-49+10:z>=17?z-17+10:z,l(z>=0&&k0?v:m},t.min=function(v,m){return v.cmp(m)<0?v:m},t.prototype._init=function(v,m,b){if(typeof v=="number")return this._initNumber(v,m,b);if(typeof v=="object")return this._initArray(v,m,b);m==="hex"&&(m=16),l(m===(0|m)&&m>=2&&m<=36);var g=0;(v=v.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)k=v[g]|v[g-1]<<8|v[g-2]<<16,this.words[y]|=k<>>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(v,m,b){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var g=0;g=m;g-=2)y=r(v,m,g)<=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;else for(g=(v.length-m)%2==0?m+1:m;g=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;this._strip()},t.prototype._parseBase=function(v,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 k=v.length-b,R=k%g,I=Math.min(k,k-R)+b,z=0,U=b;U1&&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 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"],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(v,m){var b;if(m=0|m||1,(v=v||10)===16||v==="hex"){b="";for(var g=0,y=0,k=0;k>>24-g&16777215,(g+=2)>=26&&(g-=26,k--),b=y!==0||k!==this.length-1?u[6-I.length]+I+b:I+b}for(y!==0&&(b=y.toString(16)+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(v===(0|v)&&v>=2&&v<=36){var z=d[v],U=f[v];b="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modrn(U).toString(v);b=(q=q.idivn(U)).isZero()?O+b:u[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}l(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=67108864*this.words[1]:this.length===3&&this.words[2]===1?v+=4503599627370496+67108864*this.words[1]:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(v,m){return this.toArrayLike(e,v,m)}),t.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};function w(v,m,b){b.negative=m.negative^v.negative;var g=v.length+m.length|0;b.length=g,g=g-1|0;var y=0|v.words[0],k=0|m.words[0],R=y*k,I=67108863&R,z=R/67108864|0;b.words[0]=I;for(var U=1;U>>26,O=67108863&z,V=Math.min(U,m.length-1),E=Math.max(0,U-v.length+1);E<=V;E++){var C=U-E|0;q+=(R=(y=0|v.words[C])*(k=0|m.words[E])+O)/67108864|0,O=67108863&R}b.words[U]=0|O,z=0|q}return z!==0?b.words[U]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(v,m,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);l(g<=y,"byte array longer than desired length"),l(y>0,"Requested array length <= 0");var k=function(R,I){return R.allocUnsafe?R.allocUnsafe(I):new R(I)}(v,y);return this["_toArrayLike"+(m==="le"?"LE":"BE")](k,g),k},t.prototype._toArrayLikeLE=function(v,m){for(var b=0,g=0,y=0,k=0;y>8&255),b>16&255),k===6?(b>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b=0&&(v[b--]=R>>8&255),b>=0&&(v[b--]=R>>16&255),k===6?(b>=0&&(v[b--]=R>>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b>=0)for(v[b--]=g;b>=0;)v[b--]=0},Math.clz32?t.prototype._countBits=function(v){return 32-Math.clz32(v)}:t.prototype._countBits=function(v){var m=v,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(v){if(v===0)return 26;var m=v,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 v=this.words[this.length-1],m=this._countBits(v);return 26*(this.length-1)+m},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},t.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},t.prototype.iuand=function(v){var m;m=this.length>v.length?v:this;for(var b=0;bv.length?this.clone().iand(v):v.clone().iand(this)},t.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},t.prototype.iuxor=function(v){var m,b;this.length>v.length?(m=this,b=v):(m=v,b=this);for(var g=0;gv.length?this.clone().ixor(v):v.clone().ixor(this)},t.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},t.prototype.inotn=function(v){l(typeof v=="number"&&v>=0);var m=0|Math.ceil(v/26),b=v%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(v){return this.clone().inotn(v)},t.prototype.setn=function(v,m){l(typeof v=="number"&&v>=0);var b=v/26|0,g=v%26;return this._expand(b+1),this.words[b]=m?this.words[b]|1<v.length?(b=this,g=v):(b=v,g=this);for(var y=0,k=0;k>>26;for(;y!==0&&k>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;kv.length?this.clone().iadd(v):v.clone().iadd(this)},t.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var b,g,y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=v):(b=v,g=this);for(var k=0,R=0;R>26,this.words[R]=67108863&m;for(;k!==0&&R>26,this.words[R]=67108863&m;if(k===0&&R>>13,E=0|R[1],C=8191&E,B=E>>>13,$=0|R[2],Y=8191&$,W=$>>>13,G=0|R[3],Q=8191&G,et=G>>>13,X=0|R[4],J=8191&X,Z=X>>>13,nt=0|R[5],rt=8191&nt,st=nt>>>13,lt=0|R[6],ut=8191<,dt=lt>>>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],St=8191&jt,mt=jt>>>13,kt=0|I[0],Mt=8191&kt,Ct=kt>>>13,Jt=0|I[1],se=8191&Jt,It=Jt>>>13,re=0|I[2],Gt=8191&re,Ht=re>>>13,ce=0|I[3],ne=8191&ce,Ft=ce>>>13,Qt=0|I[4],le=8191&Qt,Bt=Qt>>>13,ie=0|I[5],ue=8191&ie,$t=ie>>>13,tt=0|I[6],it=8191&tt,ct=tt>>>13,vt=0|I[7],Nt=8191&vt,wt=vt>>>13,Lt=0|I[8],Pt=8191&Lt,Ot=Lt>>>13,Vt=0|I[9],zt=8191&Vt,Yt=Vt>>>13;b.negative=v.negative^m.negative,b.length=19;var me=(U+(g=Math.imul(O,Mt))|0)+((8191&(y=(y=Math.imul(O,Ct))+Math.imul(V,Mt)|0))<<13)|0;U=((k=Math.imul(V,Ct))+(y>>>13)|0)+(me>>>26)|0,me&=67108863,g=Math.imul(C,Mt),y=(y=Math.imul(C,Ct))+Math.imul(B,Mt)|0,k=Math.imul(B,Ct);var he=(U+(g=g+Math.imul(O,se)|0)|0)+((8191&(y=(y=y+Math.imul(O,It)|0)+Math.imul(V,se)|0))<<13)|0;U=((k=k+Math.imul(V,It)|0)+(y>>>13)|0)+(he>>>26)|0,he&=67108863,g=Math.imul(Y,Mt),y=(y=Math.imul(Y,Ct))+Math.imul(W,Mt)|0,k=Math.imul(W,Ct),g=g+Math.imul(C,se)|0,y=(y=y+Math.imul(C,It)|0)+Math.imul(B,se)|0,k=k+Math.imul(B,It)|0;var ye=(U+(g=g+Math.imul(O,Gt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ht)|0)+Math.imul(V,Gt)|0))<<13)|0;U=((k=k+Math.imul(V,Ht)|0)+(y>>>13)|0)+(ye>>>26)|0,ye&=67108863,g=Math.imul(Q,Mt),y=(y=Math.imul(Q,Ct))+Math.imul(et,Mt)|0,k=Math.imul(et,Ct),g=g+Math.imul(Y,se)|0,y=(y=y+Math.imul(Y,It)|0)+Math.imul(W,se)|0,k=k+Math.imul(W,It)|0,g=g+Math.imul(C,Gt)|0,y=(y=y+Math.imul(C,Ht)|0)+Math.imul(B,Gt)|0,k=k+Math.imul(B,Ht)|0;var ve=(U+(g=g+Math.imul(O,ne)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ft)|0)+Math.imul(V,ne)|0))<<13)|0;U=((k=k+Math.imul(V,Ft)|0)+(y>>>13)|0)+(ve>>>26)|0,ve&=67108863,g=Math.imul(J,Mt),y=(y=Math.imul(J,Ct))+Math.imul(Z,Mt)|0,k=Math.imul(Z,Ct),g=g+Math.imul(Q,se)|0,y=(y=y+Math.imul(Q,It)|0)+Math.imul(et,se)|0,k=k+Math.imul(et,It)|0,g=g+Math.imul(Y,Gt)|0,y=(y=y+Math.imul(Y,Ht)|0)+Math.imul(W,Gt)|0,k=k+Math.imul(W,Ht)|0,g=g+Math.imul(C,ne)|0,y=(y=y+Math.imul(C,Ft)|0)+Math.imul(B,ne)|0,k=k+Math.imul(B,Ft)|0;var Se=(U+(g=g+Math.imul(O,le)|0)|0)+((8191&(y=(y=y+Math.imul(O,Bt)|0)+Math.imul(V,le)|0))<<13)|0;U=((k=k+Math.imul(V,Bt)|0)+(y>>>13)|0)+(Se>>>26)|0,Se&=67108863,g=Math.imul(rt,Mt),y=(y=Math.imul(rt,Ct))+Math.imul(st,Mt)|0,k=Math.imul(st,Ct),g=g+Math.imul(J,se)|0,y=(y=y+Math.imul(J,It)|0)+Math.imul(Z,se)|0,k=k+Math.imul(Z,It)|0,g=g+Math.imul(Q,Gt)|0,y=(y=y+Math.imul(Q,Ht)|0)+Math.imul(et,Gt)|0,k=k+Math.imul(et,Ht)|0,g=g+Math.imul(Y,ne)|0,y=(y=y+Math.imul(Y,Ft)|0)+Math.imul(W,ne)|0,k=k+Math.imul(W,Ft)|0,g=g+Math.imul(C,le)|0,y=(y=y+Math.imul(C,Bt)|0)+Math.imul(B,le)|0,k=k+Math.imul(B,Bt)|0;var K=(U+(g=g+Math.imul(O,ue)|0)|0)+((8191&(y=(y=y+Math.imul(O,$t)|0)+Math.imul(V,ue)|0))<<13)|0;U=((k=k+Math.imul(V,$t)|0)+(y>>>13)|0)+(K>>>26)|0,K&=67108863,g=Math.imul(ut,Mt),y=(y=Math.imul(ut,Ct))+Math.imul(dt,Mt)|0,k=Math.imul(dt,Ct),g=g+Math.imul(rt,se)|0,y=(y=y+Math.imul(rt,It)|0)+Math.imul(st,se)|0,k=k+Math.imul(st,It)|0,g=g+Math.imul(J,Gt)|0,y=(y=y+Math.imul(J,Ht)|0)+Math.imul(Z,Gt)|0,k=k+Math.imul(Z,Ht)|0,g=g+Math.imul(Q,ne)|0,y=(y=y+Math.imul(Q,Ft)|0)+Math.imul(et,ne)|0,k=k+Math.imul(et,Ft)|0,g=g+Math.imul(Y,le)|0,y=(y=y+Math.imul(Y,Bt)|0)+Math.imul(W,le)|0,k=k+Math.imul(W,Bt)|0,g=g+Math.imul(C,ue)|0,y=(y=y+Math.imul(C,$t)|0)+Math.imul(B,ue)|0,k=k+Math.imul(B,$t)|0;var ot=(U+(g=g+Math.imul(O,it)|0)|0)+((8191&(y=(y=y+Math.imul(O,ct)|0)+Math.imul(V,it)|0))<<13)|0;U=((k=k+Math.imul(V,ct)|0)+(y>>>13)|0)+(ot>>>26)|0,ot&=67108863,g=Math.imul(_t,Mt),y=(y=Math.imul(_t,Ct))+Math.imul(yt,Mt)|0,k=Math.imul(yt,Ct),g=g+Math.imul(ut,se)|0,y=(y=y+Math.imul(ut,It)|0)+Math.imul(dt,se)|0,k=k+Math.imul(dt,It)|0,g=g+Math.imul(rt,Gt)|0,y=(y=y+Math.imul(rt,Ht)|0)+Math.imul(st,Gt)|0,k=k+Math.imul(st,Ht)|0,g=g+Math.imul(J,ne)|0,y=(y=y+Math.imul(J,Ft)|0)+Math.imul(Z,ne)|0,k=k+Math.imul(Z,Ft)|0,g=g+Math.imul(Q,le)|0,y=(y=y+Math.imul(Q,Bt)|0)+Math.imul(et,le)|0,k=k+Math.imul(et,Bt)|0,g=g+Math.imul(Y,ue)|0,y=(y=y+Math.imul(Y,$t)|0)+Math.imul(W,ue)|0,k=k+Math.imul(W,$t)|0,g=g+Math.imul(C,it)|0,y=(y=y+Math.imul(C,ct)|0)+Math.imul(B,it)|0,k=k+Math.imul(B,ct)|0;var ft=(U+(g=g+Math.imul(O,Nt)|0)|0)+((8191&(y=(y=y+Math.imul(O,wt)|0)+Math.imul(V,Nt)|0))<<13)|0;U=((k=k+Math.imul(V,wt)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,g=Math.imul(Et,Mt),y=(y=Math.imul(Et,Ct))+Math.imul(At,Mt)|0,k=Math.imul(At,Ct),g=g+Math.imul(_t,se)|0,y=(y=y+Math.imul(_t,It)|0)+Math.imul(yt,se)|0,k=k+Math.imul(yt,It)|0,g=g+Math.imul(ut,Gt)|0,y=(y=y+Math.imul(ut,Ht)|0)+Math.imul(dt,Gt)|0,k=k+Math.imul(dt,Ht)|0,g=g+Math.imul(rt,ne)|0,y=(y=y+Math.imul(rt,Ft)|0)+Math.imul(st,ne)|0,k=k+Math.imul(st,Ft)|0,g=g+Math.imul(J,le)|0,y=(y=y+Math.imul(J,Bt)|0)+Math.imul(Z,le)|0,k=k+Math.imul(Z,Bt)|0,g=g+Math.imul(Q,ue)|0,y=(y=y+Math.imul(Q,$t)|0)+Math.imul(et,ue)|0,k=k+Math.imul(et,$t)|0,g=g+Math.imul(Y,it)|0,y=(y=y+Math.imul(Y,ct)|0)+Math.imul(W,it)|0,k=k+Math.imul(W,ct)|0,g=g+Math.imul(C,Nt)|0,y=(y=y+Math.imul(C,wt)|0)+Math.imul(B,Nt)|0,k=k+Math.imul(B,wt)|0;var pt=(U+(g=g+Math.imul(O,Pt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ot)|0)+Math.imul(V,Pt)|0))<<13)|0;U=((k=k+Math.imul(V,Ot)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(St,Mt),y=(y=Math.imul(St,Ct))+Math.imul(mt,Mt)|0,k=Math.imul(mt,Ct),g=g+Math.imul(Et,se)|0,y=(y=y+Math.imul(Et,It)|0)+Math.imul(At,se)|0,k=k+Math.imul(At,It)|0,g=g+Math.imul(_t,Gt)|0,y=(y=y+Math.imul(_t,Ht)|0)+Math.imul(yt,Gt)|0,k=k+Math.imul(yt,Ht)|0,g=g+Math.imul(ut,ne)|0,y=(y=y+Math.imul(ut,Ft)|0)+Math.imul(dt,ne)|0,k=k+Math.imul(dt,Ft)|0,g=g+Math.imul(rt,le)|0,y=(y=y+Math.imul(rt,Bt)|0)+Math.imul(st,le)|0,k=k+Math.imul(st,Bt)|0,g=g+Math.imul(J,ue)|0,y=(y=y+Math.imul(J,$t)|0)+Math.imul(Z,ue)|0,k=k+Math.imul(Z,$t)|0,g=g+Math.imul(Q,it)|0,y=(y=y+Math.imul(Q,ct)|0)+Math.imul(et,it)|0,k=k+Math.imul(et,ct)|0,g=g+Math.imul(Y,Nt)|0,y=(y=y+Math.imul(Y,wt)|0)+Math.imul(W,Nt)|0,k=k+Math.imul(W,wt)|0,g=g+Math.imul(C,Pt)|0,y=(y=y+Math.imul(C,Ot)|0)+Math.imul(B,Pt)|0,k=k+Math.imul(B,Ot)|0;var Tt=(U+(g=g+Math.imul(O,zt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Yt)|0)+Math.imul(V,zt)|0))<<13)|0;U=((k=k+Math.imul(V,Yt)|0)+(y>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,g=Math.imul(St,se),y=(y=Math.imul(St,It))+Math.imul(mt,se)|0,k=Math.imul(mt,It),g=g+Math.imul(Et,Gt)|0,y=(y=y+Math.imul(Et,Ht)|0)+Math.imul(At,Gt)|0,k=k+Math.imul(At,Ht)|0,g=g+Math.imul(_t,ne)|0,y=(y=y+Math.imul(_t,Ft)|0)+Math.imul(yt,ne)|0,k=k+Math.imul(yt,Ft)|0,g=g+Math.imul(ut,le)|0,y=(y=y+Math.imul(ut,Bt)|0)+Math.imul(dt,le)|0,k=k+Math.imul(dt,Bt)|0,g=g+Math.imul(rt,ue)|0,y=(y=y+Math.imul(rt,$t)|0)+Math.imul(st,ue)|0,k=k+Math.imul(st,$t)|0,g=g+Math.imul(J,it)|0,y=(y=y+Math.imul(J,ct)|0)+Math.imul(Z,it)|0,k=k+Math.imul(Z,ct)|0,g=g+Math.imul(Q,Nt)|0,y=(y=y+Math.imul(Q,wt)|0)+Math.imul(et,Nt)|0,k=k+Math.imul(et,wt)|0,g=g+Math.imul(Y,Pt)|0,y=(y=y+Math.imul(Y,Ot)|0)+Math.imul(W,Pt)|0,k=k+Math.imul(W,Ot)|0;var bt=(U+(g=g+Math.imul(C,zt)|0)|0)+((8191&(y=(y=y+Math.imul(C,Yt)|0)+Math.imul(B,zt)|0))<<13)|0;U=((k=k+Math.imul(B,Yt)|0)+(y>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(St,Gt),y=(y=Math.imul(St,Ht))+Math.imul(mt,Gt)|0,k=Math.imul(mt,Ht),g=g+Math.imul(Et,ne)|0,y=(y=y+Math.imul(Et,Ft)|0)+Math.imul(At,ne)|0,k=k+Math.imul(At,Ft)|0,g=g+Math.imul(_t,le)|0,y=(y=y+Math.imul(_t,Bt)|0)+Math.imul(yt,le)|0,k=k+Math.imul(yt,Bt)|0,g=g+Math.imul(ut,ue)|0,y=(y=y+Math.imul(ut,$t)|0)+Math.imul(dt,ue)|0,k=k+Math.imul(dt,$t)|0,g=g+Math.imul(rt,it)|0,y=(y=y+Math.imul(rt,ct)|0)+Math.imul(st,it)|0,k=k+Math.imul(st,ct)|0,g=g+Math.imul(J,Nt)|0,y=(y=y+Math.imul(J,wt)|0)+Math.imul(Z,Nt)|0,k=k+Math.imul(Z,wt)|0,g=g+Math.imul(Q,Pt)|0,y=(y=y+Math.imul(Q,Ot)|0)+Math.imul(et,Pt)|0,k=k+Math.imul(et,Ot)|0;var gt=(U+(g=g+Math.imul(Y,zt)|0)|0)+((8191&(y=(y=y+Math.imul(Y,Yt)|0)+Math.imul(W,zt)|0))<<13)|0;U=((k=k+Math.imul(W,Yt)|0)+(y>>>13)|0)+(gt>>>26)|0,gt&=67108863,g=Math.imul(St,ne),y=(y=Math.imul(St,Ft))+Math.imul(mt,ne)|0,k=Math.imul(mt,Ft),g=g+Math.imul(Et,le)|0,y=(y=y+Math.imul(Et,Bt)|0)+Math.imul(At,le)|0,k=k+Math.imul(At,Bt)|0,g=g+Math.imul(_t,ue)|0,y=(y=y+Math.imul(_t,$t)|0)+Math.imul(yt,ue)|0,k=k+Math.imul(yt,$t)|0,g=g+Math.imul(ut,it)|0,y=(y=y+Math.imul(ut,ct)|0)+Math.imul(dt,it)|0,k=k+Math.imul(dt,ct)|0,g=g+Math.imul(rt,Nt)|0,y=(y=y+Math.imul(rt,wt)|0)+Math.imul(st,Nt)|0,k=k+Math.imul(st,wt)|0,g=g+Math.imul(J,Pt)|0,y=(y=y+Math.imul(J,Ot)|0)+Math.imul(Z,Pt)|0,k=k+Math.imul(Z,Ot)|0;var Kt=(U+(g=g+Math.imul(Q,zt)|0)|0)+((8191&(y=(y=y+Math.imul(Q,Yt)|0)+Math.imul(et,zt)|0))<<13)|0;U=((k=k+Math.imul(et,Yt)|0)+(y>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,g=Math.imul(St,le),y=(y=Math.imul(St,Bt))+Math.imul(mt,le)|0,k=Math.imul(mt,Bt),g=g+Math.imul(Et,ue)|0,y=(y=y+Math.imul(Et,$t)|0)+Math.imul(At,ue)|0,k=k+Math.imul(At,$t)|0,g=g+Math.imul(_t,it)|0,y=(y=y+Math.imul(_t,ct)|0)+Math.imul(yt,it)|0,k=k+Math.imul(yt,ct)|0,g=g+Math.imul(ut,Nt)|0,y=(y=y+Math.imul(ut,wt)|0)+Math.imul(dt,Nt)|0,k=k+Math.imul(dt,wt)|0,g=g+Math.imul(rt,Pt)|0,y=(y=y+Math.imul(rt,Ot)|0)+Math.imul(st,Pt)|0,k=k+Math.imul(st,Ot)|0;var Wt=(U+(g=g+Math.imul(J,zt)|0)|0)+((8191&(y=(y=y+Math.imul(J,Yt)|0)+Math.imul(Z,zt)|0))<<13)|0;U=((k=k+Math.imul(Z,Yt)|0)+(y>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(St,ue),y=(y=Math.imul(St,$t))+Math.imul(mt,ue)|0,k=Math.imul(mt,$t),g=g+Math.imul(Et,it)|0,y=(y=y+Math.imul(Et,ct)|0)+Math.imul(At,it)|0,k=k+Math.imul(At,ct)|0,g=g+Math.imul(_t,Nt)|0,y=(y=y+Math.imul(_t,wt)|0)+Math.imul(yt,Nt)|0,k=k+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,k=k+Math.imul(dt,Ot)|0;var qt=(U+(g=g+Math.imul(rt,zt)|0)|0)+((8191&(y=(y=y+Math.imul(rt,Yt)|0)+Math.imul(st,zt)|0))<<13)|0;U=((k=k+Math.imul(st,Yt)|0)+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,g=Math.imul(St,it),y=(y=Math.imul(St,ct))+Math.imul(mt,it)|0,k=Math.imul(mt,ct),g=g+Math.imul(Et,Nt)|0,y=(y=y+Math.imul(Et,wt)|0)+Math.imul(At,Nt)|0,k=k+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,k=k+Math.imul(yt,Ot)|0;var Dt=(U+(g=g+Math.imul(ut,zt)|0)|0)+((8191&(y=(y=y+Math.imul(ut,Yt)|0)+Math.imul(dt,zt)|0))<<13)|0;U=((k=k+Math.imul(dt,Yt)|0)+(y>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,g=Math.imul(St,Nt),y=(y=Math.imul(St,wt))+Math.imul(mt,Nt)|0,k=Math.imul(mt,wt),g=g+Math.imul(Et,Pt)|0,y=(y=y+Math.imul(Et,Ot)|0)+Math.imul(At,Pt)|0,k=k+Math.imul(At,Ot)|0;var oe=(U+(g=g+Math.imul(_t,zt)|0)|0)+((8191&(y=(y=y+Math.imul(_t,Yt)|0)+Math.imul(yt,zt)|0))<<13)|0;U=((k=k+Math.imul(yt,Yt)|0)+(y>>>13)|0)+(oe>>>26)|0,oe&=67108863,g=Math.imul(St,Pt),y=(y=Math.imul(St,Ot))+Math.imul(mt,Pt)|0,k=Math.imul(mt,Ot);var de=(U+(g=g+Math.imul(Et,zt)|0)|0)+((8191&(y=(y=y+Math.imul(Et,Yt)|0)+Math.imul(At,zt)|0))<<13)|0;U=((k=k+Math.imul(At,Yt)|0)+(y>>>13)|0)+(de>>>26)|0,de&=67108863;var te=(U+(g=Math.imul(St,zt))|0)+((8191&(y=(y=Math.imul(St,Yt))+Math.imul(mt,zt)|0))<<13)|0;return U=((k=Math.imul(mt,Yt))+(y>>>13)|0)+(te>>>26)|0,te&=67108863,z[0]=me,z[1]=he,z[2]=ye,z[3]=ve,z[4]=Se,z[5]=K,z[6]=ot,z[7]=ft,z[8]=pt,z[9]=Tt,z[10]=bt,z[11]=gt,z[12]=Kt,z[13]=Wt,z[14]=qt,z[15]=Dt,z[16]=oe,z[17]=de,z[18]=te,U!==0&&(z[19]=U,b.length++),b};function A(v,m,b){b.negative=m.negative^v.negative,b.length=v.length+m.length;for(var g=0,y=0,k=0;k>>26)|0)>>>26,R&=67108863}b.words[k]=I,g=R,R=y}return g!==0?b.words[k]=g:b.length--,b._strip()}function N(v,m,b){return A(v,m,b)}Math.imul||(x=w),t.prototype.mulTo=function(v,m){var b=this.length+v.length;return this.length===10&&v.length===10?x(this,v,m):b<63?w(this,v,m):b<1024?A(this,v,m):N(this,v,m)},t.prototype.mul=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},t.prototype.mulf=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),N(this,v,m)},t.prototype.imul=function(v){return this.clone().mulTo(v,this)},t.prototype.imuln=function(v){var m=v<0;m&&(v=-v),l(typeof v=="number"),l(v<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=k>>>26,this.words[g]=67108863&k}return b!==0&&(this.words[g]=b,this.length++),m?this.ineg():this},t.prototype.muln=function(v){return this.clone().imuln(v)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(v){var m=function(k){for(var R=new Array(k.bitLength()),I=0;I>>U&1}return R}(v);if(m.length===0)return new t(1);for(var b=this,g=0;g=0);var m,b=v%26,g=(v-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var k=0;for(m=0;m>>26-b}k&&(this.words[m]=k,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=v%26,k=Math.min((v-y)/26,this.length),R=67108863^67108863>>>y<k)for(this.length-=k,z=0;z=0&&(U!==0||z>=g);z--){var q=0|this.words[z];this.words[z]=U<<26-y|q>>>y,U=q&R}return I&&U!==0&&(I.words[I.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(v,m,b){return l(this.negative===0),this.iushrn(v,m,b)},t.prototype.shln=function(v){return this.clone().ishln(v)},t.prototype.ushln=function(v){return this.clone().iushln(v)},t.prototype.shrn=function(v){return this.clone().ishrn(v)},t.prototype.ushrn=function(v){return this.clone().iushrn(v)},t.prototype.testn=function(v){l(typeof v=="number"&&v>=0);var m=v%26,b=(v-m)/26,g=1<=0);var m=v%26,b=(v-m)/26;if(l(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(v){if(l(typeof v=="number"),l(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(I/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(l(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(v,m){var b=(this.length,v.length),g=this.clone(),y=v,k=0|y.words[y.length-1];(b=26-this._countBits(k))!==0&&(y=y.ushln(b),g.iushln(b),k=0|y.words[y.length-1]);var R,I=g.length-y.length;if(m!=="mod"){(R=new t(null)).length=I+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/k|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(v,m,b){return l(!v.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&v.negative===0?(k=this.neg().divmod(v,m),m!=="mod"&&(g=k.div.neg()),m!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.iadd(v)),{div:g,mod:y}):this.negative===0&&v.negative!==0?(k=this.divmod(v.neg(),m),m!=="mod"&&(g=k.div.neg()),{div:g,mod:k.mod}):this.negative&v.negative?(k=this.neg().divmod(v.neg(),m),m!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.isub(v)),{div:k.div,mod:y}):v.length>this.length||this.cmp(v)<0?{div:new t(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new t(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new t(this.modrn(v.words[0]))}:this._wordDiv(v,m);var g,y,k},t.prototype.div=function(v){return this.divmod(v,"div",!1).div},t.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},t.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},t.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var b=m.div.negative!==0?m.mod.isub(v):m.mod,g=v.ushrn(1),y=v.andln(1),k=b.cmp(g);return k<0||y===1&&k===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},t.prototype.modrn=function(v){var m=v<0;m&&(v=-v),l(v<=67108863);for(var b=(1<<26)%v,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%v;return m?-g:g},t.prototype.modn=function(v){return this.modrn(v)},t.prototype.idivn=function(v){var m=v<0;m&&(v=-v),l(v<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/v|0,b=y%v}return this._strip(),m?this.ineg():this},t.prototype.divn=function(v){return this.clone().idivn(v)},t.prototype.egcd=function(v){l(v.negative===0),l(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g=new t(1),y=new t(0),k=new t(0),R=new t(1),I=0;m.isEven()&&b.isEven();)m.iushrn(1),b.iushrn(1),++I;for(var z=b.clone(),U=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(U)),g.iushrn(1),y.iushrn(1);for(var V=0,E=1;!(b.words[0]&E)&&V<26;++V,E<<=1);if(V>0)for(b.iushrn(V);V-- >0;)(k.isOdd()||R.isOdd())&&(k.iadd(z),R.isub(U)),k.iushrn(1),R.iushrn(1);m.cmp(b)>=0?(m.isub(b),g.isub(k),y.isub(R)):(b.isub(m),k.isub(g),R.isub(y))}return{a:k,b:R,gcd:b.iushln(I)}},t.prototype._invmp=function(v){l(v.negative===0),l(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g,y=new t(1),k=new t(0),R=b.clone();m.cmpn(1)>0&&b.cmpn(1)>0;){for(var I=0,z=1;!(m.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(m.iushrn(I);I-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var U=0,q=1;!(b.words[0]&q)&&U<26;++U,q<<=1);if(U>0)for(b.iushrn(U);U-- >0;)k.isOdd()&&k.iadd(R),k.iushrn(1);m.cmp(b)>=0?(m.isub(b),y.isub(k)):(b.isub(m),k.isub(y))}return(g=m.cmpn(1)===0?y:k).cmpn(0)<0&&g.iadd(v),g},t.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),b=v.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 k=m;m=b,b=k}else if(y===0||b.cmpn(1)===0)break;m.isub(b)}return b.iushln(g)},t.prototype.invm=function(v){return this.egcd(v).a.umod(v)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(v){return this.words[0]&v},t.prototype.bincn=function(v){l(typeof v=="number");var m=v%26,b=(v-m)/26,g=1<>>26,R&=67108863,this.words[k]=R}return y!==0&&(this.words[k]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(v){var m,b=v<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&&(v=-v),l(v<=67108863,"Number is too big");var g=0|this.words[0];m=g===v?0:gv.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|v.words[b];if(g!==y){gy&&(m=1);break}}return m},t.prototype.gtn=function(v){return this.cmpn(v)===1},t.prototype.gt=function(v){return this.cmp(v)===1},t.prototype.gten=function(v){return this.cmpn(v)>=0},t.prototype.gte=function(v){return this.cmp(v)>=0},t.prototype.ltn=function(v){return this.cmpn(v)===-1},t.prototype.lt=function(v){return this.cmp(v)===-1},t.prototype.lten=function(v){return this.cmpn(v)<=0},t.prototype.lte=function(v){return this.cmp(v)<=0},t.prototype.eqn=function(v){return this.cmpn(v)===0},t.prototype.eq=function(v){return this.cmp(v)===0},t.red=function(v){return new S(v)},t.prototype.toRed=function(v){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},t.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(v){return this.red=v,this},t.prototype.forceRed=function(v){return l(!this.red,"Already a number in reduction context"),this._forceRed(v)},t.prototype.redAdd=function(v){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},t.prototype.redIAdd=function(v){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},t.prototype.redSub=function(v){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},t.prototype.redISub=function(v){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},t.prototype.redShl=function(v){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},t.prototype.redMul=function(v){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},t.prototype.redIMul=function(v){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},t.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(v){return l(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var L={k256:null,p224:null,p192:null,p25519:null};function j(v,m){this.name=v,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 F(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function H(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function D(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(v){if(typeof v=="string"){var m=t._prime(v);this.m=m.p,this.prime=m}else l(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}function M(v){S.call(this,v),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 v=new t(null);return v.words=new Array(Math.ceil(this.n/13)),v},j.prototype.ireduce=function(v){var m,b=v;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(v,m){v.iushrn(this.n,0,m)},j.prototype.imulK=function(v){return v.imul(this.k)},n(P,j),P.prototype.split=function(v,m){for(var b=Math.min(v.length,9),g=0;g>>22,y=k}y>>>=22,v.words[g-10]=y,y===0&&v.length>10?v.length-=10:v.length-=9},P.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,b=0;b>>=26,v.words[b]=y,m=g}return m!==0&&(v.words[v.length++]=m),v},t._prime=function(v){if(L[v])return L[v];var m;if(v==="k256")m=new P;else if(v==="p224")m=new F;else if(v==="p192")m=new H;else{if(v!=="p25519")throw new Error("Unknown prime "+v);m=new D}return L[v]=m,m},S.prototype._verify1=function(v){l(v.negative===0,"red works only with positives"),l(v.red,"red works only with red numbers")},S.prototype._verify2=function(v,m){l((v.negative|m.negative)==0,"red works only with positives"),l(v.red&&v.red===m.red,"red works only with red numbers")},S.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(c(v,v.umod(this.m)._forceRed(this)),v)},S.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},S.prototype.add=function(v,m){this._verify2(v,m);var b=v.add(m);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},S.prototype.iadd=function(v,m){this._verify2(v,m);var b=v.iadd(m);return b.cmp(this.m)>=0&&b.isub(this.m),b},S.prototype.sub=function(v,m){this._verify2(v,m);var b=v.sub(m);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},S.prototype.isub=function(v,m){this._verify2(v,m);var b=v.isub(m);return b.cmpn(0)<0&&b.iadd(this.m),b},S.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},S.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},S.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},S.prototype.isqr=function(v){return this.imul(v,v.clone())},S.prototype.sqr=function(v){return this.mul(v,v)},S.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(l(m%2==1),m===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(v,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);l(!g.isZero());var k=new t(1).toRed(this),R=k.redNeg(),I=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,I).cmp(R)!==0;)z.redIAdd(R);for(var U=this.pow(z,g),q=this.pow(v,g.addn(1).iushrn(1)),O=this.pow(v,g),V=y;O.cmp(k)!==0;){for(var E=O,C=0;E.cmp(k)!==0;C++)E=E.redSqr();l(C=0;g--){for(var z=m.words[g],U=I-1;U>=0;U--){var q=z>>U&1;y!==b[0]&&(y=this.sqr(y)),q!==0||k!==0?(k<<=1,k|=q,(++R===4||g===0&&U===0)&&(y=this.mul(y,b[k]),R=0,k=0)):R=0}I=26}return y},S.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},S.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},t.mont=function(v){return new M(v)},n(M,S),M.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},M.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},M.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var b=v.imul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),k=y;return y.cmp(this.m)>=0?k=y.isub(this.m):y.cmpn(0)<0&&(k=y.iadd(this.m)),k._forceRed(this)},M.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new t(0)._forceRed(this);var b=v.mul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),k=y;return y.cmp(this.m)>=0?k=y.isub(this.m):y.cmpn(0)<0&&(k=y.iadd(this.m)),k._forceRed(this)},M.prototype.invm=function(v){return this.imod(v._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],187:[function(a,T,_){var p;function o(n){this.rand=n}if(T.exports=function(n){return p||(p=new o(null)),p.generate(n)},T.exports.Rand=o,o.prototype.generate=function(n){return this._rand(n)},o.prototype._rand=function(n){if(this.rand.getBytes)return this.rand.getBytes(n);for(var t=new Uint8Array(n),e=0;e>>24]^N[F>>>16&255]^L[H>>>8&255]^j[255&D]^i[S++],f=A[F>>>24]^N[H>>>16&255]^L[D>>>8&255]^j[255&P]^i[S++],w=A[H>>>24]^N[D>>>16&255]^L[P>>>8&255]^j[255&F]^i[S++],x=A[D>>>24]^N[P>>>16&255]^L[F>>>8&255]^j[255&H]^i[S++],P=d,F=f,H=w,D=x;return d=(h[P>>>24]<<24|h[F>>>16&255]<<16|h[H>>>8&255]<<8|h[255&D])^i[S++],f=(h[F>>>24]<<24|h[H>>>16&255]<<16|h[D>>>8&255]<<8|h[255&P])^i[S++],w=(h[H>>>24]<<24|h[D>>>16&255]<<16|h[P>>>8&255]<<8|h[255&F])^i[S++],x=(h[D>>>24]<<24|h[P>>>16&255]<<16|h[F>>>8&255]<<8|h[255&H])^i[S++],[d>>>=0,f>>>=0,w>>>=0,x>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var r=new Array(256),i=0;i<256;i++)r[i]=i<128?i<<1:i<<1^283;for(var c=[],h=[],u=[[],[],[],[]],d=[[],[],[],[]],f=0,w=0,x=0;x<256;++x){var A=w^w<<1^w<<2^w<<3^w<<4;A=A>>>8^255&A^99,c[f]=A,h[A]=f;var N=r[f],L=r[N],j=r[L],P=257*r[A]^16843008*A;u[0][f]=P<<24|P>>>8,u[1][f]=P<<16|P>>>16,u[2][f]=P<<8|P>>>24,u[3][f]=P,P=16843009*j^65537*L^257*N^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=w=1:(f=N^r[r[r[j^N]]],w^=r[r[w]])}return{SBOX:c,INV_SBOX:h,SUB_MIX:u,INV_SUB_MIX:d}}();function s(r){this._key=o(r),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var r=this._key,i=r.length,c=i+6,h=4*(c+1),u=[],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]),u[d]=u[d-i]^f}for(var w=[],x=0;x>>24]]^e.INV_SUB_MIX[1][e.SBOX[N>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[N>>>8&255]]^e.INV_SUB_MIX[3][e.SBOX[255&N]]}this._nRounds=c,this._keySchedule=u,this._invKeySchedule=w},s.prototype.encryptBlockRaw=function(r){return n(r=o(r),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},s.prototype.encryptBlock=function(r){var i=this.encryptBlockRaw(r),c=p.allocUnsafe(16);return c.writeUInt32BE(i[0],0),c.writeUInt32BE(i[1],4),c.writeUInt32BE(i[2],8),c.writeUInt32BE(i[3],12),c},s.prototype.decryptBlock=function(r){var i=(r=o(r))[1];r[1]=r[3],r[3]=i;var c=n(r,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),h=p.allocUnsafe(16);return h.writeUInt32BE(c[0],0),h.writeUInt32BE(c[3],4),h.writeUInt32BE(c[2],8),h.writeUInt32BE(c[1],12),h},s.prototype.scrub=function(){l(this._keySchedule),l(this._invKeySchedule),l(this._key)},T.exports.AES=s},{"safe-buffer":494}],190:[function(a,T,_){var p=a("./aes"),o=a("safe-buffer").Buffer,l=a("cipher-base"),n=a("inherits"),t=a("./ghash"),e=a("buffer-xor"),s=a("./incr32");function r(i,c,h,u){l.call(this);var d=o.alloc(4,0);this._cipher=new p.AES(c);var f=this._cipher.encryptBlock(d);this._ghash=new t(f),h=function(w,x,A){if(x.length===12)return w._finID=o.concat([x,o.from([0,0,0,1])]),o.concat([x,o.from([0,0,0,2])]);var N=new t(A),L=x.length,j=L%16;N.update(x),j&&(j=16-j,N.update(o.alloc(j,0))),N.update(o.alloc(8,0));var P=8*L,F=o.alloc(8);F.writeUIntBE(P,0,8),N.update(F),w._finID=N.state;var H=o.from(w._finID);return s(H),H}(this,h,f),this._prev=o.from(h),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}n(r,l),r.prototype._update=function(i){if(!this._called&&this._alen){var c=16-this._alen%16;c<16&&(c=o.alloc(c,0),this._ghash.update(c))}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},r.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(c,h){var u=0;c.length!==h.length&&u++;for(var d=Math.min(c.length,h.length),f=0;f16)throw new Error("unable to decrypt data");for(var f=-1;++f16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u}else if(this.cache.length>=16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u;return null},i.prototype.flush=function(){if(this.cache.length)return this.cache},_.createDecipher=function(h,u){var d=l[h.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var f=s(u,!1,d.key,d.iv);return c(h,f.key,f.iv)},_.createDecipheriv=c},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(a,T,_){var p=a("./modes"),o=a("./authCipher"),l=a("safe-buffer").Buffer,n=a("./streamCipher"),t=a("cipher-base"),e=a("./aes"),s=a("evp_bytestokey");function r(u,d,f){t.call(this),this._cache=new c,this._cipher=new e.AES(d),this._prev=l.from(f),this._mode=u,this._autopadding=!0}a("inherits")(r,t),r.prototype._update=function(u){var d,f;this._cache.add(u);for(var w=[];d=this._cache.get();)f=this._mode.encrypt(this,d),w.push(f);return l.concat(w)};var i=l.alloc(16,16);function c(){this.cache=l.allocUnsafe(0)}function h(u,d,f){var w=p[u.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=l.from(d)),d.length!==w.key/8)throw new TypeError("invalid key length "+d.length);if(typeof f=="string"&&(f=l.from(f)),w.mode!=="GCM"&&f.length!==w.iv)throw new TypeError("invalid iv length "+f.length);return w.type==="stream"?new n(w.module,d,f):w.type==="auth"?new o(w.module,d,f):new r(w.module,d,f)}r.prototype._final=function(){var u=this._cache.flush();if(this._autopadding)return u=this._mode.encrypt(this,u),this._cipher.scrub(),u;if(!u.equals(i))throw this._cipher.scrub(),new Error("data not multiple of block length")},r.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},c.prototype.add=function(u){this.cache=l.concat([this.cache,u])},c.prototype.get=function(){if(this.cache.length>15){var u=this.cache.slice(0,16);return this.cache=this.cache.slice(16),u}return null},c.prototype.flush=function(){for(var u=16-this.cache.length,d=l.allocUnsafe(u),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 n(t){this.h=t,this.state=p.alloc(16,0),this.cache=p.allocUnsafe(0)}n.prototype.ghash=function(t){for(var e=-1;++e0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,s&&(r[0]=r[0]^225<<24)}this.state=l(i)},n.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)},n.prototype.final=function(t,e){return this.cache.length&&this.ghash(p.concat([this.cache,o],16)),this.ghash(l([0,t,0,e])),this.state},T.exports=n},{"safe-buffer":494}],195:[function(a,T,_){T.exports=function(p){for(var o,l=p.length;l--;){if((o=p.readUInt8(l))!==255){o++,p.writeUInt8(o,l);break}p.writeUInt8(0,l)}}},{}],196:[function(a,T,_){var p=a("buffer-xor");_.encrypt=function(o,l){var n=p(l,o._prev);return o._prev=o._cipher.encryptBlock(n),o._prev},_.decrypt=function(o,l){var n=o._prev;o._prev=l;var t=o._cipher.decryptBlock(l);return p(t,n)}},{"buffer-xor":219}],197:[function(a,T,_){var p=a("safe-buffer").Buffer,o=a("buffer-xor");function l(n,t,e){var s=t.length,r=o(t,n._cache);return n._cache=n._cache.slice(s),n._prev=p.concat([n._prev,e?t:r]),r}_.encrypt=function(n,t,e){for(var s,r=p.allocUnsafe(0);t.length;){if(n._cache.length===0&&(n._cache=n._cipher.encryptBlock(n._prev),n._prev=p.allocUnsafe(0)),!(n._cache.length<=t.length)){r=p.concat([r,l(n,t,e)]);break}s=n._cache.length,r=p.concat([r,l(n,t.slice(0,s),e)]),t=t.slice(s)}return r}},{"buffer-xor":219,"safe-buffer":494}],198:[function(a,T,_){var p=a("safe-buffer").Buffer;function o(n,t,e){for(var s,r,i=-1,c=0;++i<8;)s=t&1<<7-i?128:0,c+=(128&(r=n._cipher.encryptBlock(n._prev)[0]^s))>>i%8,n._prev=l(n._prev,e?s:r);return c}function l(n,t){var e=n.length,s=-1,r=p.allocUnsafe(n.length);for(n=p.concat([n,p.from([t])]);++s>7;return r}_.encrypt=function(n,t,e){for(var s=t.length,r=p.allocUnsafe(s),i=-1;++i=0||!s.umod(e.prime1)||!s.umod(e.prime2));return s}function t(e,s){var r=function(L){var j=n(L);return{blinder:j.toRed(o.mont(L.modulus)).redPow(new o(L.publicExponent)).fromRed(),unblinder:j.invm(L.modulus)}}(s),i=s.modulus.byteLength(),c=new o(e).mul(r.blinder).umod(s.modulus),h=c.toRed(o.mont(s.prime1)),u=c.toRed(o.mont(s.prime2)),d=s.coefficient,f=s.prime1,w=s.prime2,x=h.redPow(s.exponent1).fromRed(),A=u.redPow(s.exponent2).fromRed(),N=x.isub(A).imul(d).umod(f).imul(w);return A.iadd(N).imul(r.unblinder).umod(s.modulus).toArrayLike(p,"be",i)}t.getr=n,T.exports=t}).call(this)}).call(this,a("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(a,T,_){T.exports=a("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(a,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(a,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(a,T,_){var p=a("safe-buffer").Buffer,o=a("create-hash"),l=a("readable-stream"),n=a("inherits"),t=a("./sign"),e=a("./verify"),s=a("./algorithms.json");function r(u){l.Writable.call(this);var d=s[u];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(u){l.Writable.call(this);var d=s[u];if(!d)throw new Error("Unknown message digest");this._hash=o(d.hash),this._tag=d.id,this._signType=d.sign}function c(u){return new r(u)}function h(u){return new i(u)}Object.keys(s).forEach(function(u){s[u].id=p.from(s[u].id,"hex"),s[u.toLowerCase()]=s[u]}),n(r,l.Writable),r.prototype._write=function(u,d,f){this._hash.update(u),f()},r.prototype.update=function(u,d){return typeof u=="string"&&(u=p.from(u,d)),this._hash.update(u),this},r.prototype.sign=function(u,d){this.end();var f=this._hash.digest(),w=t(f,u,this._hashType,this._signType,this._tag);return d?w.toString(d):w},n(i,l.Writable),i.prototype._write=function(u,d,f){this._hash.update(u),f()},i.prototype.update=function(u,d){return typeof u=="string"&&(u=p.from(u,d)),this._hash.update(u),this},i.prototype.verify=function(u,d,f){typeof d=="string"&&(d=p.from(d,f)),this.end();var w=this._hash.digest();return e(d,w,u,this._signType,this._tag)},T.exports={Sign:c,Verify:h,createSign:c,createVerify:h}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(a,T,_){var p=a("safe-buffer").Buffer,o=a("create-hmac"),l=a("browserify-rsa"),n=a("elliptic").ec,t=a("bn.js"),e=a("parse-asn1"),s=a("./curves.json");function r(u,d,f,w){if((u=p.from(u.toArray())).length0&&f.ishrn(w),f}function c(u,d,f){var w,x;do{for(w=p.alloc(0);8*w.length=r)throw new Error("invalid sig")}T.exports=function(s,r,i,c,h){var u=n(i);if(u.type==="ec"){if(c!=="ecdsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,j,P){var F=t[P.data.algorithm.curve.join(".")];if(!F)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var H=new l(F),D=P.data.subjectPrivateKey.data;return H.verify(j,L,D)}(s,r,u)}if(u.type==="dsa"){if(c!=="dsa")throw new Error("wrong public key type");return function(L,j,P){var F=P.data.p,H=P.data.q,D=P.data.g,S=P.data.pub_key,M=n.signature.decode(L,"der"),v=M.s,m=M.r;e(v,H),e(m,H);var b=o.mont(F),g=v.invm(H);return D.toRed(b).redPow(new o(j).mul(g).mod(H)).fromRed().mul(S.toRed(b).redPow(m.mul(g).mod(H)).fromRed()).mod(F).mod(H).cmp(m)===0}(s,r,u)}if(c!=="rsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");r=p.concat([h,r]);for(var d=u.modulus.byteLength(),f=[1],w=0;r.length+f.length+2>5==6?2:u>>4==14?3:u>>3==30?4:u>>6==2?-1:-2}function t(u){var d=this.lastTotal-this.lastNeed,f=function(w,x,A){if((192&x[0])!=128)return w.lastNeed=0,"�";if(w.lastNeed>1&&x.length>1){if((192&x[1])!=128)return w.lastNeed=1,"�";if(w.lastNeed>2&&x.length>2&&(192&x[2])!=128)return w.lastNeed=2,"�"}}(this,u);return f!==void 0?f:this.lastNeed<=u.length?(u.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(u.copy(this.lastChar,d,0,u.length),void(this.lastNeed-=u.length))}function e(u,d){if((u.length-d)%2==0){var f=u.toString("utf16le",d);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",d,u.length-1)}function s(u){var d=u&&u.length?this.write(u):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,f)}return d}function r(u,d){var f=(u.length-d)%3;return f===0?u.toString("base64",d):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",d,u.length-f))}function i(u){var d=u&&u.length?this.write(u):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function c(u){return u.toString(this.encoding)}function h(u){return u&&u.length?this.write(u):""}_.StringDecoder=l,l.prototype.write=function(u){if(u.length===0)return"";var d,f;if(this.lastNeed){if((d=this.fillLast(u))===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f=0?(j>0&&(x.lastNeed=j-1),j):--L=0?(j>0&&(x.lastNeed=j-2),j):--L=0?(j>0&&(j===2?j=0:x.lastNeed=j-3),j):0}(this,u,d);if(!this.lastNeed)return u.toString("utf8",d);this.lastTotal=f;var w=u.length-(f-this.lastNeed);return u.copy(this.lastChar,0,w),u.toString("utf8",d,w)},l.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length}},{"safe-buffer":217}],219:[function(a,T,_){(function(p){(function(){T.exports=function(o,l){for(var n=Math.min(o.length,l.length),t=new p(n),e=0;e2147483647)throw new RangeError('The value "'+E+'" is invalid for option "size"');var C=new Uint8Array(E);return C.__proto__=t.prototype,C}function t(E,C,B){if(typeof E=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return r(E)}return e(E,C,B)}function e(E,C,B){if(typeof E=="string")return function(W,G){if(typeof G=="string"&&G!==""||(G="utf8"),!t.isEncoding(G))throw new TypeError("Unknown encoding: "+G);var Q=0|h(W,G),et=n(Q),X=et.write(W,G);return X!==Q&&(et=et.slice(0,X)),et}(E,C);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,G,Q){if(G<0||W.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|E}function h(E,C){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 B=E.length,$=arguments.length>2&&arguments[2]===!0;if(!$&&B===0)return 0;for(var Y=!1;;)switch(C){case"ascii":case"latin1":case"binary":return B;case"utf8":case"utf-8":return z(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*B;case"hex":return B>>>1;case"base64":return U(E).length;default:if(Y)return $?-1:z(E).length;C=(""+C).toLowerCase(),Y=!0}}function u(E,C,B){var $=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((B===void 0||B>this.length)&&(B=this.length),B<=0)||(B>>>=0)<=(C>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return M(this,C,B);case"utf8":case"utf-8":return H(this,C,B);case"ascii":return D(this,C,B);case"latin1":case"binary":return S(this,C,B);case"base64":return F(this,C,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,C,B);default:if($)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),$=!0}}function d(E,C,B){var $=E[C];E[C]=E[B],E[B]=$}function f(E,C,B,$,Y){if(E.length===0)return-1;if(typeof B=="string"?($=B,B=0):B>2147483647?B=2147483647:B<-2147483648&&(B=-2147483648),V(B=+B)&&(B=Y?0:E.length-1),B<0&&(B=E.length+B),B>=E.length){if(Y)return-1;B=E.length-1}else if(B<0){if(!Y)return-1;B=0}if(typeof C=="string"&&(C=t.from(C,$)),t.isBuffer(C))return C.length===0?-1:w(E,C,B,$,Y);if(typeof C=="number")return C&=255,typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(E,C,B):Uint8Array.prototype.lastIndexOf.call(E,C,B):w(E,[C],B,$,Y);throw new TypeError("val must be string, number or Buffer")}function w(E,C,B,$,Y){var W,G=1,Q=E.length,et=C.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(E.length<2||C.length<2)return-1;G=2,Q/=2,et/=2,B/=2}function X(rt,st){return G===1?rt[st]:rt.readUInt16BE(st*G)}if(Y){var J=-1;for(W=B;WQ&&(B=Q-et),W=B;W>=0;W--){for(var Z=!0,nt=0;ntY&&($=Y):$=Y;var W=C.length;$>W/2&&($=W/2);for(var G=0;G<$;++G){var Q=parseInt(C.substr(2*G,2),16);if(V(Q))return G;E[B+G]=Q}return G}function A(E,C,B,$){return q(z(C,E.length-B),E,B,$)}function N(E,C,B,$){return q(function(Y){for(var W=[],G=0;G>8,et=G%256,X.push(et),X.push(Q);return X}(C,E.length-B),E,B,$)}function F(E,C,B){return C===0&&B===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(C,B))}function H(E,C,B){B=Math.min(E.length,B);for(var $=[],Y=C;Y239?4:X>223?3:X>191?2:1;if(Y+Z<=B)switch(Z){case 1:X<128&&(J=X);break;case 2:(192&(W=E[Y+1]))==128&&(et=(31&X)<<6|63&W)>127&&(J=et);break;case 3:W=E[Y+1],G=E[Y+2],(192&W)==128&&(192&G)==128&&(et=(15&X)<<12|(63&W)<<6|63&G)>2047&&(et<55296||et>57343)&&(J=et);break;case 4:W=E[Y+1],G=E[Y+2],Q=E[Y+3],(192&W)==128&&(192&G)==128&&(192&Q)==128&&(et=(15&X)<<18|(63&W)<<12|(63&G)<<6|63&Q)>65535&&et<1114112&&(J=et)}J===null?(J=65533,Z=1):J>65535&&(J-=65536,$.push(J>>>10&1023|55296),J=56320|1023&J),$.push(J),Y+=Z}return function(nt){var rt=nt.length;if(rt<=4096)return String.fromCharCode.apply(String,nt);for(var st="",lt=0;lt"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,C,B){return e(E,C,B)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(E,C,B){return function($,Y,W){return s($),$<=0?n($):Y!==void 0?typeof W=="string"?n($).fill(Y,W):n($).fill(Y):n($)}(E,C,B)},t.allocUnsafe=function(E){return r(E)},t.allocUnsafeSlow=function(E){return r(E)},t.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==t.prototype},t.compare=function(E,C){if(O(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),O(C,Uint8Array)&&(C=t.from(C,C.offset,C.byteLength)),!t.isBuffer(E)||!t.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===C)return 0;for(var B=E.length,$=C.length,Y=0,W=Math.min(B,$);YC&&(E+=" ... "),""},t.prototype.compare=function(E,C,B,$,Y){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(C===void 0&&(C=0),B===void 0&&(B=E?E.length:0),$===void 0&&($=0),Y===void 0&&(Y=this.length),C<0||B>E.length||$<0||Y>this.length)throw new RangeError("out of range index");if($>=Y&&C>=B)return 0;if($>=Y)return-1;if(C>=B)return 1;if(this===E)return 0;for(var W=(Y>>>=0)-($>>>=0),G=(B>>>=0)-(C>>>=0),Q=Math.min(W,G),et=this.slice($,Y),X=E.slice(C,B),J=0;J>>=0,isFinite(B)?(B>>>=0,$===void 0&&($="utf8")):($=B,B=void 0)}var Y=this.length-C;if((B===void 0||B>Y)&&(B=Y),E.length>0&&(B<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");for(var W=!1;;)switch($){case"hex":return x(this,E,C,B);case"utf8":case"utf-8":return A(this,E,C,B);case"ascii":return N(this,E,C,B);case"latin1":case"binary":return L(this,E,C,B);case"base64":return j(this,E,C,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,C,B);default:if(W)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),W=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(E,C,B){var $="";B=Math.min(E.length,B);for(var Y=C;Y$)&&(B=$);for(var Y="",W=C;WB)throw new RangeError("Trying to access beyond buffer length")}function b(E,C,B,$,Y,W){if(!t.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>Y||CE.length)throw new RangeError("Index out of range")}function g(E,C,B,$,Y,W){if(B+$>E.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("Index out of range")}function y(E,C,B,$,Y){return C=+C,B>>>=0,Y||g(E,0,B,4),l.write(E,C,B,$,23,4),B+4}function k(E,C,B,$,Y){return C=+C,B>>>=0,Y||g(E,0,B,8),l.write(E,C,B,$,52,8),B+8}t.prototype.slice=function(E,C){var B=this.length;(E=~~E)<0?(E+=B)<0&&(E=0):E>B&&(E=B),(C=C===void 0?B:~~C)<0?(C+=B)<0&&(C=0):C>B&&(C=B),C>>=0,C>>>=0,B||m(E,C,this.length);for(var $=this[E],Y=1,W=0;++W>>=0,C>>>=0,B||m(E,C,this.length);for(var $=this[E+--C],Y=1;C>0&&(Y*=256);)$+=this[E+--C]*Y;return $},t.prototype.readUInt8=function(E,C){return E>>>=0,C||m(E,1,this.length),this[E]},t.prototype.readUInt16LE=function(E,C){return E>>>=0,C||m(E,2,this.length),this[E]|this[E+1]<<8},t.prototype.readUInt16BE=function(E,C){return E>>>=0,C||m(E,2,this.length),this[E]<<8|this[E+1]},t.prototype.readUInt32LE=function(E,C){return E>>>=0,C||m(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+16777216*this[E+3]},t.prototype.readUInt32BE=function(E,C){return E>>>=0,C||m(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},t.prototype.readIntLE=function(E,C,B){E>>>=0,C>>>=0,B||m(E,C,this.length);for(var $=this[E],Y=1,W=0;++W=(Y*=128)&&($-=Math.pow(2,8*C)),$},t.prototype.readIntBE=function(E,C,B){E>>>=0,C>>>=0,B||m(E,C,this.length);for(var $=C,Y=1,W=this[E+--$];$>0&&(Y*=256);)W+=this[E+--$]*Y;return W>=(Y*=128)&&(W-=Math.pow(2,8*C)),W},t.prototype.readInt8=function(E,C){return E>>>=0,C||m(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},t.prototype.readInt16LE=function(E,C){E>>>=0,C||m(E,2,this.length);var B=this[E]|this[E+1]<<8;return 32768&B?4294901760|B:B},t.prototype.readInt16BE=function(E,C){E>>>=0,C||m(E,2,this.length);var B=this[E+1]|this[E]<<8;return 32768&B?4294901760|B:B},t.prototype.readInt32LE=function(E,C){return E>>>=0,C||m(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},t.prototype.readInt32BE=function(E,C){return E>>>=0,C||m(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},t.prototype.readFloatLE=function(E,C){return E>>>=0,C||m(E,4,this.length),l.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,C){return E>>>=0,C||m(E,4,this.length),l.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,C){return E>>>=0,C||m(E,8,this.length),l.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,C){return E>>>=0,C||m(E,8,this.length),l.read(this,E,!1,52,8)},t.prototype.writeUIntLE=function(E,C,B,$){E=+E,C>>>=0,B>>>=0,$||b(this,E,C,B,Math.pow(2,8*B)-1,0);var Y=1,W=0;for(this[C]=255&E;++W>>=0,B>>>=0,$||b(this,E,C,B,Math.pow(2,8*B)-1,0);var Y=B-1,W=1;for(this[C+Y]=255&E;--Y>=0&&(W*=256);)this[C+Y]=E/W&255;return C+B},t.prototype.writeUInt8=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,1,255,0),this[C]=255&E,C+1},t.prototype.writeUInt16LE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,2,65535,0),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeUInt16BE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,2,65535,0),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeUInt32LE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,4,4294967295,0),this[C+3]=E>>>24,this[C+2]=E>>>16,this[C+1]=E>>>8,this[C]=255&E,C+4},t.prototype.writeUInt32BE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,4,4294967295,0),this[C]=E>>>24,this[C+1]=E>>>16,this[C+2]=E>>>8,this[C+3]=255&E,C+4},t.prototype.writeIntLE=function(E,C,B,$){if(E=+E,C>>>=0,!$){var Y=Math.pow(2,8*B-1);b(this,E,C,B,Y-1,-Y)}var W=0,G=1,Q=0;for(this[C]=255&E;++W>0)-Q&255;return C+B},t.prototype.writeIntBE=function(E,C,B,$){if(E=+E,C>>>=0,!$){var Y=Math.pow(2,8*B-1);b(this,E,C,B,Y-1,-Y)}var W=B-1,G=1,Q=0;for(this[C+W]=255&E;--W>=0&&(G*=256);)E<0&&Q===0&&this[C+W+1]!==0&&(Q=1),this[C+W]=(E/G>>0)-Q&255;return C+B},t.prototype.writeInt8=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,1,127,-128),E<0&&(E=255+E+1),this[C]=255&E,C+1},t.prototype.writeInt16LE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,2,32767,-32768),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeInt16BE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,2,32767,-32768),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeInt32LE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,4,2147483647,-2147483648),this[C]=255&E,this[C+1]=E>>>8,this[C+2]=E>>>16,this[C+3]=E>>>24,C+4},t.prototype.writeInt32BE=function(E,C,B){return E=+E,C>>>=0,B||b(this,E,C,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[C]=E>>>24,this[C+1]=E>>>16,this[C+2]=E>>>8,this[C+3]=255&E,C+4},t.prototype.writeFloatLE=function(E,C,B){return y(this,E,C,!0,B)},t.prototype.writeFloatBE=function(E,C,B){return y(this,E,C,!1,B)},t.prototype.writeDoubleLE=function(E,C,B){return k(this,E,C,!0,B)},t.prototype.writeDoubleBE=function(E,C,B){return k(this,E,C,!1,B)},t.prototype.copy=function(E,C,B,$){if(!t.isBuffer(E))throw new TypeError("argument should be a Buffer");if(B||(B=0),$||$===0||($=this.length),C>=E.length&&(C=E.length),C||(C=0),$>0&&$=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),E.length-C<$-B&&($=E.length-C+B);var Y=$-B;if(this===E&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(C,B,$);else if(this===E&&B=0;--W)E[W+C]=this[W+B];else Uint8Array.prototype.set.call(E,this.subarray(B,$),C);return Y},t.prototype.fill=function(E,C,B,$){if(typeof E=="string"){if(typeof C=="string"?($=C,C=0,B=this.length):typeof B=="string"&&($=B,B=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!t.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(E.length===1){var Y=E.charCodeAt(0);($==="utf8"&&Y<128||$==="latin1")&&(E=Y)}}else typeof E=="number"&&(E&=255);if(C<0||this.length>>=0,B=B===void 0?this.length:B>>>0,E||(E=0),typeof E=="number")for(W=C;W55295&&B<57344){if(!Y){if(B>56319){(C-=3)>-1&&W.push(239,191,189);continue}if(G+1===$){(C-=3)>-1&&W.push(239,191,189);continue}Y=B;continue}if(B<56320){(C-=3)>-1&&W.push(239,191,189),Y=B;continue}B=65536+(Y-55296<<10|B-56320)}else Y&&(C-=3)>-1&&W.push(239,191,189);if(Y=null,B<128){if((C-=1)<0)break;W.push(B)}else if(B<2048){if((C-=2)<0)break;W.push(B>>6|192,63&B|128)}else if(B<65536){if((C-=3)<0)break;W.push(B>>12|224,B>>6&63|128,63&B|128)}else{if(!(B<1114112))throw new Error("Invalid code point");if((C-=4)<0)break;W.push(B>>18|240,B>>12&63|128,B>>6&63|128,63&B|128)}}return W}function U(E){return o.toByteArray(function(C){if((C=(C=C.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;C.length%4!=0;)C+="=";return C}(E))}function q(E,C,B,$){for(var Y=0;Y<$&&!(Y+B>=C.length||Y>=E.length);++Y)C[Y+B]=E[Y];return Y}function O(E,C){return E instanceof C||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===C.name}function V(E){return E!=E}}).call(this)}).call(this,a("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(a,T,_){var p=a("safe-buffer").Buffer,o=a("stream").Transform,l=a("string_decoder").StringDecoder;function n(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}a("inherits")(n,o),n.prototype.update=function(t,e,s){typeof t=="string"&&(t=p.from(t,e));var r=this._update(t);return this.hashMode?this:(s&&(r=this._toString(r,s)),r)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,e,s){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){r=i}finally{s(r)}},n.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(s){e=s}t(e)},n.prototype._finalOrDigest=function(t){var e=this.__final()||p.alloc(0);return t&&(e=this._toString(e,t,!0)),e},n.prototype._toString=function(t,e,s){if(this._decoder||(this._decoder=new l(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return s&&(r+=this._decoder.end()),r},T.exports=n},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(a,T,_){var p=a("../internals/is-callable"),o=a("../internals/try-to-string"),l=TypeError;T.exports=function(n){if(p(n))return n;throw new l(o(n)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(a,T,_){var p=a("../internals/is-constructor"),o=a("../internals/try-to-string"),l=TypeError;T.exports=function(n){if(p(n))return n;throw new l(o(n)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(a,T,_){var p=a("../internals/is-callable"),o=String,l=TypeError;T.exports=function(n){if(typeof n=="object"||p(n))return n;throw new l("Can't set "+o(n)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(a,T,_){var p=a("../internals/well-known-symbol"),o=a("../internals/object-create"),l=a("../internals/object-define-property").f,n=p("unscopables"),t=Array.prototype;t[n]===void 0&&l(t,n,{configurable:!0,value:o(null)}),T.exports=function(e){t[n][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(a,T,_){var p=a("../internals/object-is-prototype-of"),o=TypeError;T.exports=function(l,n){if(p(n,l))return l;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(a,T,_){var p=a("../internals/is-object"),o=String,l=TypeError;T.exports=function(n){if(p(n))return n;throw new l(o(n)+" is not an object")}},{"../internals/is-object":289}],228:[function(a,T,_){var p=a("../internals/to-indexed-object"),o=a("../internals/to-absolute-index"),l=a("../internals/length-of-array-like"),n=function(t){return function(e,s,r){var i,c=p(e),h=l(c),u=o(r,h);if(t&&s!=s){for(;h>u;)if((i=c[u++])!=i)return!0}else for(;h>u;u++)if((t||u in c)&&c[u]===s)return t||u||0;return!t&&-1}};T.exports={includes:n(!0),indexOf:n(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(a,T,_){var p=a("../internals/function-bind-context"),o=a("../internals/function-uncurry-this"),l=a("../internals/indexed-object"),n=a("../internals/to-object"),t=a("../internals/length-of-array-like"),e=a("../internals/array-species-create"),s=o([].push),r=function(i){var c=i===1,h=i===2,u=i===3,d=i===4,f=i===6,w=i===7,x=i===5||f;return function(A,N,L,j){for(var P,F,H=n(A),D=l(H),S=p(N,L),M=t(D),v=0,m=j||e,b=c?m(A,M):h||w?m(A,0):void 0;M>v;v++)if((x||v in D)&&(F=S(P=D[v],v,H),i))if(c)b[v]=F;else if(F)switch(i){case 3:return!0;case 5:return P;case 6:return v;case 2:s(b,P)}else switch(i){case 4:return!1;case 7:s(b,P)}return f?-1:u||d?d:b}};T.exports={forEach:r(0),map:r(1),filter:r(2),some:r(3),every:r(4),find:r(5),findIndex:r(6),filterReject:r(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(a,T,_){var p=a("../internals/to-absolute-index"),o=a("../internals/length-of-array-like"),l=a("../internals/create-property"),n=Array,t=Math.max;T.exports=function(e,s,r){for(var i=o(e),c=p(s,i),h=p(r===void 0?i:r,i),u=n(t(h-c,0)),d=0;c0&&p[0]<4?1:+(p[0]+p[1])),!o&&n&&(!(p=n.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=n.match(/Chrome\/(\d+)/))&&(o=+p[1]),T.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(a,T,_){T.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(a,T,_){var p=a("../internals/global"),o=a("../internals/object-get-own-property-descriptor").f,l=a("../internals/create-non-enumerable-property"),n=a("../internals/define-built-in"),t=a("../internals/define-global-property"),e=a("../internals/copy-constructor-properties"),s=a("../internals/is-forced");T.exports=function(r,i){var c,h,u,d,f,w=r.target,x=r.global,A=r.stat;if(c=x?p:A?p[w]||t(w,{}):(p[w]||{}).prototype)for(h in i){if(d=i[h],u=r.dontCallGetSet?(f=o(c,h))&&f.value:c[h],!s(x?h:w+(A?".":"#")+h,r.forced)&&u!==void 0){if(typeof d==typeof u)continue;e(d,u)}(r.sham||u&&u.sham)&&l(d,"sham",!0),n(c,h,d,r)}}},{"../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(a,T,_){T.exports=function(p){try{return!!p()}catch{return!0}}},{}],261:[function(a,T,_){var p=a("../internals/function-bind-native"),o=Function.prototype,l=o.apply,n=o.call;T.exports=typeof Reflect=="object"&&Reflect.apply||(p?n.bind(l):function(){return n.apply(l,arguments)})},{"../internals/function-bind-native":263}],262:[function(a,T,_){var p=a("../internals/function-uncurry-this-clause"),o=a("../internals/a-callable"),l=a("../internals/function-bind-native"),n=p(p.bind);T.exports=function(t,e){return o(t),e===void 0?t:l?n(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(a,T,_){var p=a("../internals/fails");T.exports=!p(function(){var o=(function(){}).bind();return typeof o!="function"||o.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(a,T,_){var p=a("../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(a,T,_){var p=a("../internals/descriptors"),o=a("../internals/has-own-property"),l=Function.prototype,n=p&&Object.getOwnPropertyDescriptor,t=o(l,"name"),e=t&&(function(){}).name==="something",s=t&&(!p||p&&n(l,"name").configurable);T.exports={EXISTS:t,PROPER:e,CONFIGURABLE:s}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(a,T,_){var p=a("../internals/function-uncurry-this"),o=a("../internals/a-callable");T.exports=function(l,n,t){try{return p(o(Object.getOwnPropertyDescriptor(l,n)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(a,T,_){var p=a("../internals/classof-raw"),o=a("../internals/function-uncurry-this");T.exports=function(l){if(p(l)==="Function")return o(l)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(a,T,_){var p=a("../internals/function-bind-native"),o=Function.prototype,l=o.call,n=p&&o.bind.bind(l,l);T.exports=p?n:function(t){return function(){return l.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(a,T,_){var p=a("../internals/global"),o=a("../internals/is-callable"),l=function(n){return o(n)?n:void 0};T.exports=function(n,t){return arguments.length<2?l(p[n]):p[n]&&p[n][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(a,T,_){var p=a("../internals/classof"),o=a("../internals/get-method"),l=a("../internals/is-null-or-undefined"),n=a("../internals/iterators"),t=a("../internals/well-known-symbol")("iterator");T.exports=function(e){if(!l(e))return o(e,t)||o(e,"@@iterator")||n[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(a,T,_){var p=a("../internals/function-call"),o=a("../internals/a-callable"),l=a("../internals/an-object"),n=a("../internals/try-to-string"),t=a("../internals/get-iterator-method"),e=TypeError;T.exports=function(s,r){var i=arguments.length<2?t(s):r;if(o(i))return l(p(i,s));throw new e(n(s)+" 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(a,T,_){var p=a("../internals/function-uncurry-this"),o=a("../internals/is-array"),l=a("../internals/is-callable"),n=a("../internals/classof-raw"),t=a("../internals/to-string"),e=p([].push);T.exports=function(s){if(l(s))return s;if(o(s)){for(var r=s.length,i=[],c=0;cL;L++)if((P=y(f[L]))&&s(d,P))return P;return new u(!1)}A=r(f,N)}for(F=M?f.next:A.next;!(H=o(F,A)).done;){try{P=y(H.value)}catch(k){c(A,"throw",k)}if(typeof P=="object"&&P&&s(d,P))return P}return new u(!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(a,T,_){var p=a("../internals/function-call"),o=a("../internals/an-object"),l=a("../internals/get-method");T.exports=function(n,t,e){var s,r;o(n);try{if(!(s=l(n,"return"))){if(t==="throw")throw e;return e}s=p(s,n)}catch(i){r=!0,s=i}if(t==="throw")throw e;if(r)throw s;return o(s),e}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(a,T,_){var p=a("../internals/iterators-core").IteratorPrototype,o=a("../internals/object-create"),l=a("../internals/create-property-descriptor"),n=a("../internals/set-to-string-tag"),t=a("../internals/iterators"),e=function(){return this};T.exports=function(s,r,i,c){var h=r+" Iterator";return s.prototype=o(p,{next:l(+!c,i)}),n(s,h,!1,!0),t[h]=e,s}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(a,T,_){var p=a("../internals/export"),o=a("../internals/function-call"),l=a("../internals/is-pure"),n=a("../internals/function-name"),t=a("../internals/is-callable"),e=a("../internals/iterator-create-constructor"),s=a("../internals/object-get-prototype-of"),r=a("../internals/object-set-prototype-of"),i=a("../internals/set-to-string-tag"),c=a("../internals/create-non-enumerable-property"),h=a("../internals/define-built-in"),u=a("../internals/well-known-symbol"),d=a("../internals/iterators"),f=a("../internals/iterators-core"),w=n.PROPER,x=n.CONFIGURABLE,A=f.IteratorPrototype,N=f.BUGGY_SAFARI_ITERATORS,L=u("iterator"),j=function(){return this};T.exports=function(P,F,H,D,S,M,v){e(H,F,D);var m,b,g,y=function(O){if(O===S&&U)return U;if(!N&&O&&O in I)return I[O];switch(O){case"keys":case"values":case"entries":return function(){return new H(this,O)}}return function(){return new H(this)}},k=F+" Iterator",R=!1,I=P.prototype,z=I[L]||I["@@iterator"]||S&&I[S],U=!N&&z||y(S),q=F==="Array"&&I.entries||z;if(q&&(m=s(q.call(new P)))!==Object.prototype&&m.next&&(l||s(m)===A||(r?r(m,A):t(m[L])||h(m,L,j)),i(m,k,!0,!0),l&&(d[k]=j)),w&&S==="values"&&z&&z.name!=="values"&&(!l&&x?c(I,"name","values"):(R=!0,U=function(){return o(z,this)})),S)if(b={values:y("values"),keys:M?U:y("keys"),entries:y("entries")},v)for(g in b)(N||R||!(g in I))&&h(I,g,b[g]);else p({target:F,proto:!0,forced:N||R},b);return l&&!v||I[L]===U||h(I,L,U,{name:S}),d[F]=U,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(a,T,_){var p,o,l,n=a("../internals/fails"),t=a("../internals/is-callable"),e=a("../internals/is-object"),s=a("../internals/object-create"),r=a("../internals/object-get-prototype-of"),i=a("../internals/define-built-in"),c=a("../internals/well-known-symbol"),h=a("../internals/is-pure"),u=c("iterator"),d=!1;[].keys&&("next"in(l=[].keys())?(o=r(r(l)))!==Object.prototype&&(p=o):d=!0),!e(p)||n(function(){var f={};return p[u].call(f)!==f})?p={}:h&&(p=s(p)),t(p[u])||i(p,u,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(a,T,_){arguments[4][276][0].apply(_,arguments)},{dup:276}],299:[function(a,T,_){var p=a("../internals/to-length");T.exports=function(o){return p(o.length)}},{"../internals/to-length":343}],300:[function(a,T,_){var p=a("../internals/function-uncurry-this"),o=a("../internals/fails"),l=a("../internals/is-callable"),n=a("../internals/has-own-property"),t=a("../internals/descriptors"),e=a("../internals/function-name").CONFIGURABLE,s=a("../internals/inspect-source"),r=a("../internals/internal-state"),i=r.enforce,c=r.get,h=String,u=Object.defineProperty,d=p("".slice),f=p("".replace),w=p([].join),x=t&&!o(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=T.exports=function(L,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),(!n(L,"name")||e&&L.name!==j)&&(t?u(L,"name",{value:j,configurable:!0}):L.name=j),x&&P&&n(P,"arity")&&L.length!==P.arity&&u(L,"length",{value:P.arity});try{P&&n(P,"constructor")&&P.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch{}var F=i(L);return n(F,"source")||(F.source=w(A,typeof j=="string"?j:"")),L};Function.prototype.toString=N(function(){return l(this)&&c(this).source||s(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(a,T,_){var p=Math.ceil,o=Math.floor;T.exports=Math.trunc||function(l){var n=+l;return(n>0?o:p)(n)}},{}],302:[function(a,T,_){var p,o,l,n,t,e=a("../internals/global"),s=a("../internals/function-bind-context"),r=a("../internals/object-get-own-property-descriptor").f,i=a("../internals/task").set,c=a("../internals/queue"),h=a("../internals/engine-is-ios"),u=a("../internals/engine-is-ios-pebble"),d=a("../internals/engine-is-webos-webkit"),f=a("../internals/engine-is-node"),w=e.MutationObserver||e.WebKitMutationObserver,x=e.document,A=e.process,N=e.Promise,L=r(e,"queueMicrotask"),j=L&&L.value;if(!j){var P=new c,F=function(){var H,D;for(f&&(H=A.domain)&&H.exit();D=P.get();)try{D()}catch(S){throw P.head&&p(),S}H&&H.enter()};h||f||d||!w||!x?!u&&N&&N.resolve?((n=N.resolve(void 0)).constructor=N,t=s(n.then,n),p=function(){t(F)}):f?p=function(){A.nextTick(F)}:(i=s(i,e),p=function(){i(F)}):(o=!0,l=x.createTextNode(""),new w(F).observe(l,{characterData:!0}),p=function(){l.data=o=!o}),j=function(H){P.head||p(),P.add(H)}}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(a,T,_){var p=a("../internals/a-callable"),o=TypeError,l=function(n){var t,e;this.promise=new n(function(s,r){if(t!==void 0||e!==void 0)throw new o("Bad Promise constructor");t=s,e=r}),this.resolve=p(t),this.reject=p(e)};T.exports.f=function(n){return new l(n)}},{"../internals/a-callable":222}],304:[function(a,T,_){var p=a("../internals/is-regexp"),o=TypeError;T.exports=function(l){if(p(l))throw new o("The method doesn't accept regular expressions");return l}},{"../internals/is-regexp":291}],305:[function(a,T,_){var p=a("../internals/descriptors"),o=a("../internals/function-uncurry-this"),l=a("../internals/function-call"),n=a("../internals/fails"),t=a("../internals/object-keys"),e=a("../internals/object-get-own-property-symbols"),s=a("../internals/object-property-is-enumerable"),r=a("../internals/to-object"),i=a("../internals/indexed-object"),c=Object.assign,h=Object.defineProperty,u=o([].concat);T.exports=!c||n(function(){if(p&&c({b:1},c(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},f={},w=Symbol("assign detection");return d[w]=7,"abcdefghijklmnopqrst".split("").forEach(function(x){f[x]=x}),c({},d)[w]!==7||t(c({},f)).join("")!=="abcdefghijklmnopqrst"})?function(d,f){for(var w=r(d),x=arguments.length,A=1,N=e.f,L=s.f;x>A;)for(var j,P=i(arguments[A++]),F=N?u(t(P),N(P)):t(P),H=F.length,D=0;H>D;)j=F[D++],p&&!l(L,P,j)||(w[j]=P[j]);return w}:c},{"../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(a,T,_){var p,o=a("../internals/an-object"),l=a("../internals/object-define-properties"),n=a("../internals/enum-bug-keys"),t=a("../internals/hidden-keys"),e=a("../internals/html"),s=a("../internals/document-create-element"),r=a("../internals/shared-key"),i=r("IE_PROTO"),c=function(){},h=function(f){return"