var cr=Object.defineProperty,hr=Object.defineProperties;var fr=Object.getOwnPropertyDescriptors;var er=Object.getOwnPropertySymbols;var dr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable;var rr=(ne,ie)=>{if(ie=Symbol[ne])return ie;throw Error("Symbol."+ne+" is not defined")};var nr=(ne,ie,s)=>ie in ne?cr(ne,ie,{enumerable:!0,configurable:!0,writable:!0,value:s}):ne[ie]=s,ye=(ne,ie)=>{for(var s in ie||(ie={}))dr.call(ie,s)&&nr(ne,s,ie[s]);if(er)for(var s of er(ie))pr.call(ie,s)&&nr(ne,s,ie[s]);return ne},Ee=(ne,ie)=>hr(ne,fr(ie));var Kt=(ne,ie,s)=>new Promise((T,S)=>{var m=n=>{try{a(s.next(n))}catch(t){S(t)}},o=n=>{try{a(s.throw(n))}catch(t){S(t)}},a=n=>n.done?T(n.value):Promise.resolve(n.value).then(m,o);a((s=s.apply(ne,ie)).next())}),$e=function(ne,ie){this[0]=ne,this[1]=ie},ir=(ne,ie,s)=>{var T=(o,a,n,t)=>{try{var e=s[o](a),l=(a=e.value)instanceof $e,r=e.done;Promise.resolve(l?a[0]:a).then(i=>l?T(o==="return"?o:"next",a[1]?{done:i.done,value:i.value}:i,n,t):n({value:i,done:r})).catch(i=>T("throw",i,n,t))}catch(i){t(i)}},S=o=>m[o]=a=>new Promise((n,t)=>T(o,a,n,t)),m={};return s=s.apply(ne,ie),m[Symbol.asyncIterator]=()=>m,S("next"),S("throw"),S("return"),m};var Ve=(ne,ie,s)=>(ie=ne[rr("asyncIterator")])?ie.call(ne):(ne=ne[rr("iterator")](),ie={},s=(T,S)=>(S=ne[T])&&(ie[T]=m=>new Promise((o,a,n)=>(m=S.call(ne,m),n=m.done,Promise.resolve(m.value).then(t=>o({value:t,done:n}),a)))),s("next"),s("return"),ie);import{a as mr,B as br}from"./index-8a6826ba.js";import{u as gr,B as yr}from"./useTable-e949a6b7.js";import"./useForm-baba730a.js";import{c as Vt,d as vr,ab as wr,ac as _r,Q as sr,ad as xr}from"./antd-0679333d.js";import{ap as qe,_ as kr}from"./index.js";import{d as Sr,f as Ke,a6 as Cr,Z as We,a4 as Ze,a5 as Ne,$ as or,k as Xe,u as ke,G as Ge,a0 as Mr,l as ar,_ as Tr,a8 as Je,F as Er,a9 as Ar}from"./vue-72a104e4.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";var lr={exports:{}};/*! ExcelJS 19-10-2023 */(function(ne,ie){(function(s){ne.exports=s()})(function(){return function s(T,S,m){function o(t,e){if(!S[t]){if(!T[t]){var l=typeof qe=="function"&&qe;if(!e&&l)return l(t,!0);if(a)return a(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=S[t]={exports:{}};T[t][0].call(i.exports,function(c){return o(T[t][1][c]||c)},i,i.exports,s,T,S,m)}return S[t].exports}for(var a=typeof qe=="function"&&qe,n=0;n{const d=this.workbook.addWorksheet(c.sheetName),h=c.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],v=c.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=h.reduce((P,D)=>{if(P)return P;const H=t(A,D,!0);return H.isValid()?H:null},null);if(L)return new Date(L.valueOf());const j=r[A];return j!==void 0?j:A},_=o.parse(c.parserOptions).on("data",A=>{d.addRow(A.map(v))}).on("end",()=>{_.emit("worksheet",d)});_.on("worksheet",f).on("error",u),i.pipe(_)})}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((f,u)=>{c=c||{};const d=this.workbook.getWorksheet(c.sheetName||c.sheetId),h=o.format(c.formatterOptions);i.on("finish",()=>{f()}),h.on("error",u),h.pipe(i);const{dateFormat:v,dateUTC:_}=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 v?_?t.utc(j).format(v):t(j).format(v):_?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 l=m.decodeAddress(t);this.nativeCol=l.col+e,this.nativeColOff=0,this.nativeRow=l.row+e,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+e,this.row=t.row+e):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(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(s,T,S){const m=s("../utils/col-cache"),o=s("../utils/under-dash"),a=s("./enums"),{slideFormula:n}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,c,f){if(!i||!c)throw new Error("A Cell needs a Row");this._row=i,this._column=c,m.validateAddress(f),this._address=f,this._value=l.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,f){const u=i&&i.numFmt||c&&c.numFmt;u&&(f.numFmt=u);const d=i&&i.font||c&&c.font;d&&(f.font=d);const h=i&&i.alignment||c&&c.alignment;h&&(f.alignment=h);const v=i&&i.border||c&&c.border;v&&(f.border=v);const _=i&&i.fill||c&&c.fill;_&&(f.fill=_);const A=i&&i.protection||c&&c.protection;return A&&(f.protection=A),f}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=l.create(e.Types.Merge,this,i),c||(this.style=i.style)}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(i){return this._value.type===e.Types.Merge&&this._value.isMergedTo(i)}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(i){this.type!==e.Types.Merge?(this._value.release(),this._value=l.create(l.getType(i),this,i)):this._value.master.value=i}get note(){return this._comment&&this._comment.note}set note(i){this._comment=new t(i)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(i){this.type===e.Types.String&&(this._value=l.create(e.Types.Hyperlink,this,{text:this._value.value,hyperlink:i}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:i}=this._row;return{sheetName:i.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(i){this.names=[i]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(i){const{definedNames:c}=this.workbook;c.removeAllNames(this.fullAddress),i.forEach(f=>{c.addEx(this.fullAddress,f)})}addName(i){this.workbook.definedNames.addEx(this.fullAddress,i)}removeName(i){this.workbook.definedNames.removeEx(this.fullAddress,i)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(i){this._dataValidations.add(this.address,i)}get model(){const{model:i}=this._value;return i.style=this.style,this._comment&&(i.comment=this._comment.model),i}set model(i){if(this._value.release(),this._value=l.create(i.type,this),this._value.model=i,i.comment)switch(i.comment.type){case"note":this._comment=t.fromModel(i.comment)}i.style?this.style=i.style:this.style={}}}e.Types=a.ValueType;const l={getType: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=f=>{const u=r[f];u&&(i[f]=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(l.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?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.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?a.ValueType.Null:r instanceof String||typeof r=="string"?a.ValueType.String:typeof r=="number"?a.ValueType.Number:r instanceof Date?a.ValueType.Date:r.text&&r.hyperlink?a.ValueType.Hyperlink:r.formula?a.ValueType.Formula:a.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 f=this.types[r];if(!f)throw new Error("Could not create Value of type "+r);return new f(i,c)}};T.exports=e},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(s,T,S){const m=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache");class n{constructor(e,l,r){this._worksheet=e,this._number=l,r!==!1&&(this.defn=r)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=e.width!==void 0?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){e!==void 0?(this._header=e,this.headers.forEach((l,r)=>{this._worksheet.getCell(r+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&m.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,l){const r=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(i,c)=>{l(i.getCell(r),c)})}get values(){const e=[];return this.eachCell((l,r)=>{l&&l.type!==o.ValueType.Null&&(e[r]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let r=0;e.hasOwnProperty("0")&&(r=1),e.forEach((i,c)=>{this._worksheet.getCell(c+r,l).value=i})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(r=>{r[e]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const l=[];let 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},l.push(r))}),l.length?l:void 0}static fromModel(e,l){const r=[];let i=1,c=0;for(l=(l=l||[]).sort(function(f,u){return f.min-u.min});c{l.removeCellEx(e)})}forEach(e){m.each(this.matrixMap,(l,r)=>{l.forEach(i=>{e(r,i)})})}getNames(e){return this.getNamesEx(o.decodeEx(e))}getNamesEx(e){return m.map(this.matrixMap,(l,r)=>l.findCellEx(e)&&r).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:r}=l,i=new n(l.row,l.col,l.row,l.col,r);let c,f;function u(h,v){const _=e.findCellAt(r,h,l.col);return!(!_||!_.mark)&&(i[v]=h,_.mark=!1,!0)}for(f=l.row-1;u(f,"top");f--);for(f=l.row+1;u(f,"bottom");f++);function d(h,v){const _=[];for(f=i.top;f<=i.bottom;f++){const A=e.findCellAt(r,f,h);if(!A||!A.mark)return!1;_.push(A)}i[v]=h;for(let A=0;A<_.length;A++)_[A].mark=!1;return!0}for(c=l.col-1;d(c,"left");c--);for(c=l.col+1;d(c,"right");c++);return i}getRanges(e,l){return(l=l||this.matrixMap[e])?(l.forEach(r=>{r.mark=!0}),{name:e,ranges:l.map(r=>r.mark&&this._explore(l,r)).filter(Boolean).map(r=>r.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(r,i,c)=>{r&&(r.row===i&&r.col===c||(r.row=i,r.col=c,r.address=o.n2l(c)+i))})}spliceRows(e,l,r,i){m.each(this.matrixMap,c=>{c.spliceRows(e,l,r,i),this.normaliseMatrix(c,e)})}spliceColumns(e,l,r,i){m.each(this.matrixMap,c=>{c.spliceColumns(e,l,r,i),this.normaliseMatrix(c,e)})}get model(){return m.map(this.matrixMap,(e,l)=>this.getRanges(l,e)).filter(e=>e.ranges.length)}set model(e){const l=this.matrixMap={};e.forEach(r=>{const i=l[r.name]=new a;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(s,T,S){T.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(s,T,S){const m=s("../utils/col-cache"),o=s("./anchor");T.exports=class{constructor(a,n){this.worksheet=a,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(a){let{type:n,imageId:t,range:e,hyperlinks:l}=a;if(this.type=n,this.imageId=t,n==="image")if(typeof e=="string"){const r=m.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:l||e.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(s,T,S){const m=s("../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 m.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(s,T,S){const m=s("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(n,t,e,l,r){if(arguments.length<4){const i=m.decodeAddress(n),c=m.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,l),bottom:Math.max(n,e),right:Math.max(t,l),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=m.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,l){(!this.model.top||nthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(n){if(n){const{dimensions:t,number:e}=n;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(n){const t=m.decodeEx(n);this.expand(t.row,t.col,t.row,t.col)}get tl(){return m.n2l(this.left)+this.top}get $t$l(){return`$${m.n2l(this.left)}$${this.top}`}get br(){return m.n2l(this.right)+this.bottom}get $b$r(){return`$${m.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=m.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(m.encodeAddress(e,t),e,t)}}T.exports=o},{"../utils/col-cache":19}],11:[function(s,T,S){const m=s("../utils/under-dash"),o=s("./enums"),a=s("../utils/col-cache"),n=s("./cell");T.exports=class{constructor(t,e){this._worksheet=t,this._number=e,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const l=this._worksheet.getColumn(t.col);e=new n(this,l,t.address),this._cells[t.col-1]=e}return e}getCell(t){if(typeof t=="string"){const e=this._worksheet.getColumnKey(t);t=e?e.number:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var r=arguments.length,i=new Array(r>2?r-2:0),c=2;c0)for(d=u;d>=l;d--)h=this._cells[d-1],h?(v=this.getCell(d+f),v.value=h.value,v.style=h.style,v._comment=h._comment):this._cells[d+f-1]=void 0;for(d=0;d{l&&l.type!==o.ValueType.Null&&e(l,r+1)})}addPageBreak(t,e){const l=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),l.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((l,r)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,r+e),row:this._number,col:r+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[l])})}get hasValues(){return m.some(this._cells,t=>t&&t.type!==o.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,e=0;return this._cells.forEach(l=>{l&&l.type!==o.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[t]=e)}),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,l=0;return this._cells.forEach(r=>{if(r){const i=r.model;i&&((!e||e>r.col)&&(e=r.col),l{switch(l.type){case n.Types.Merge:break;default:{let r;if(l.address)r=a.decodeAddress(l.address);else if(e){const{row:i}=e,c=e.col+1;r={row:i,col:c,address:a.encodeAddress(i,c),$col$row:`$${a.n2l(c)}$${i}`}}e=r,this.getCellEx(r).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(s,T,S){const m=s("../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(a,n){this.worksheet=a,n&&(this.table=n,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:a}=this,n=(f,u,d)=>{f[u]===void 0&&(f[u]=d)};n(a,"headerRow",!0),n(a,"totalsRow",!1),n(a,"style",{}),n(a.style,"theme","TableStyleMedium2"),n(a.style,"showFirstColumn",!1),n(a.style,"showLastColumn",!1),n(a.style,"showRowStripes",!1),n(a.style,"showColumnStripes",!1);const t=(f,u)=>{if(!f)throw new Error(u)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=m.decodeAddress(a.ref);const{row:e,col:l}=a.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:r,filterHeight:i,tableHeight:c}=this;a.autoFilterRef=m.encode(e,l,e+i-1,l+r-1),a.tableRef=m.encode(e,l,e+c-1,l+r-1),a.columns.forEach((f,u)=>{t(f.name,`Column ${u} must have a name`),u===0?n(f,"totalsRowLabel","Total"):(n(f,"totalsRowFunction","none"),f.totalsRowFormula=this.getFormula(f))})}store(){const a=(i,c)=>{c&&Object.keys(c).forEach(f=>{i[f]=c[f]})},{worksheet:n,table:t}=this,{row:e,col:l}=t.tl;let r=0;if(t.headerRow){const i=n.getRow(e+r++);t.columns.forEach((c,f)=>{const{style:u,name:d}=c,h=i.getCell(l+f);h.value=d,a(h,u)})}if(t.rows.forEach(i=>{const c=n.getRow(e+r++);i.forEach((f,u)=>{const d=c.getCell(l+u);d.value=f,a(d,t.columns[u].style)})}),t.totalsRow){const i=n.getRow(e+r++);t.columns.forEach((c,f)=>{const u=i.getCell(l+f);if(f===0)u.value=c.totalsRowLabel;else{const d=this.getFormula(c);u.value=d?{formula:c.totalsRowFormula,result:c.totalsRowResult}:null}a(u,c.style)})}}load(a){const{table:n}=this,{row:t,col:e}=n.tl;let l=0;if(n.headerRow){const r=a.getRow(t+l++);n.columns.forEach((i,c)=>{r.getCell(e+c).value=i.name})}if(n.rows.forEach(r=>{const i=a.getRow(t+l++);r.forEach((c,f)=>{i.getCell(e+f).value=c})}),n.totalsRow){const r=a.getRow(t+l++);n.columns.forEach((i,c)=>{const f=r.getCell(e+c);c===0?f.value=i.totalsRowLabel:this.getFormula(i)&&(f.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const a=m.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(a,n)}getColumn(a){const n=this.table.columns[a];return new o(this,n,a)}addColumn(a,n,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((e,l)=>{e.push(n[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((e,l)=>{e.splice(t,0,n[l])}))}removeColumns(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,n),this.table.rows.forEach(t=>{t.splice(a,n)})}_assign(a,n,t){this.cacheState(),a[n]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(s,T,S){const m=s("./worksheet"),o=s("./defined-names"),a=s("../xlsx/xlsx"),n=s("../csv/csv");T.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new o}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new n(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>f?u.orderNo:f,0),i=Object.assign({},e,{id:l,name:t,orderNo:r+1,workbook:this}),c=new m(i);return this._worksheets[l]=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:l,name:r,state:i}=e,c=t.sheets&&t.sheets.findIndex(f=>f.id===l);(this._worksheets[l]=new m({id:l,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(s,T,S){const m=s("../utils/under-dash"),o=s("../utils/col-cache"),a=s("./range"),n=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),r=s("./table"),i=s("./data-validations"),c=s("../utils/encryptor"),{copyStyle:f}=s("../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&&(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 a;return this._rows.forEach(d=>{if(d){const h=d.dimensions;h&&u.expand(d.number,h.min,d.number,h.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((v,_)=>{const A=(_.header?1:_.headers&&_.headers.length)||0;return Math.max(v,A)},0);let d=1;const h=this._columns=[];u.forEach(v=>{const _=new t(this,d++,!1);h.push(_),_.defn=v})}getColumnKey(u){return this._keys[u]}setColumnKey(u,d){this._keys[u]=d}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){m.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 h=this._rows.length;for(var v=arguments.length,_=new Array(v>2?v-2:0),A=2;A0)for(let P=0;P{D.push(B[P]||null)});const H=this.getRow(P+1);H.splice.apply(H,D)}else this._rows.forEach(P=>{P&&P.splice(u,d)});const N=_.length-d,L=u+d,j=this._columns.length;if(N<0)for(let P=u+_.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(h=>{h.eachCell(v=>{let{col:_}=v;u[_]||(u[_]=!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 h=[];for(let v=u;v1&&arguments[1]!==void 0?arguments[1]:"n";const h=this._nextRow,v=this.getRow(h);return v.values=u,this._setStyleOption(h,d[0]==="i"?d:"n"),v}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=[];return u.forEach(v=>{h.push(this.addRow(v,d))}),h}insertRow(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,d),this._setStyleOption(u,h),this.getRow(u)}insertRows(u,d){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...d),h!=="n")for(let v=0;v1&&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 h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this.getRow(u),_=this.getRow(d);_.style=f(v.style),v.eachCell({includeEmpty:h},(A,N)=>{_.getCell(N).style=f(A.style)}),_.height=v.height}duplicateRow(u,d){let h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const v=this._rows[u-1],_=new Array(d).fill(v.values);this.spliceRows(u+1,h?0:d,..._);for(let A=0;A{N.getCell(j).style=L.style})}}spliceRows(u,d){const h=u+d;for(var v=arguments.length,_=new Array(v>2?v-2:0),A=2;A{H.getCell(x).style=B.style}),this._rows[P-1]=void 0}else this._rows[P+L-1]=void 0;else if(L>0)for(P=j;P>=h;P--)if(D=this._rows[P-1],D){const H=this.getRow(P+L);H.values=D.values,H.style=D.style,H.height=D.height,D.eachCell({includeEmpty:!0},(B,x)=>{if(H.getCell(x).style=B.style,B._value.constructor.name==="MergeValue"){const M=this.getRow(B._row._number+N).getCell(x),w=B._value._master,p=this.getRow(w._row._number+N).getCell(w._column._number);M.merge(p)}})}else this._rows[P+L-1]=void 0;for(P=0;P{h&&h.hasValues&&d(h,h.number)})}getSheetValues(){const u=[];return this._rows.forEach(d=>{d&&(u[d.number]=d.values)}),u}findCell(u,d){const h=o.getAddress(u,d),v=this._rows[h.row-1];return v?v.findCell(h.col):void 0}getCell(u,d){const h=o.getAddress(u,d);return this.getRow(h.row).getCellEx(h)}mergeCells(){for(var u=arguments.length,d=new Array(u),h=0;h{if(v.intersects(u))throw new Error("Cannot merge already merged cells")});const h=this.getCell(u.top,u.left);for(let v=u.top;v<=u.bottom;v++)for(let _=u.left;_<=u.right;_++)(v>u.top||_>u.left)&&this.getCell(v,_).merge(h,d);this._merges[h.address]=u}_unMergeMaster(u){const d=this._merges[u.address];if(d){for(let h=d.top;h<=d.bottom;h++)for(let v=d.left;v<=d.right;v++)this.getCell(h,v).unmerge();delete this._merges[u.address]}}get hasMerges(){return m.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,d=new Array(u),h=0;h3&&arguments[3]!==void 0?arguments[3]:"shared";const _=o.decode(u),{top:A,left:N,bottom:L,right:j}=_,P=j-N+1,D=o.encodeAddress(A,N),H=v==="shared";let B;B=typeof h=="function"?h:Array.isArray(h)?Array.isArray(h[0])?(M,w)=>h[M-A][w-N]:(M,w)=>h[(M-A)*P+(w-N)]:()=>{};let x=!0;for(let M=A;M<=L;M++)for(let w=N;w<=j;w++)x?(this.getCell(M,w).value={shareType:v,formula:d,ref:u,result:B(M,w)},x=!1):this.getCell(M,w).value=H?{sharedFormula:D,result:B(M,w)}:B(M,w)}addImage(u,d){const h={type:"image",imageId:u,range:d};this._media.push(new l(this,h))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){const d={type:"background",imageId:u};this._media.push(new l(this,d))}getBackgroundImageId(){const u=this._media.find(d=>d.type==="background");return u&&u.imageId}protect(u,d){return new Promise(h=>{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),h()})}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 this.properties.tabColor}set tabColor(u){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(v=>v.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(v=>v.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const d=u.rows=[],h=u.dimensions=new a;return this._rows.forEach(v=>{const _=v&&v.model;_&&(h.expand(_.number,_.min,_.number,_.max),d.push(_))}),u.merges=[],m.each(this._merges,v=>{u.merges.push(v.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(d=>{const h=new n(this,d.number);this._rows[h.number-1]=h,h.model=d})}_parseMergeCells(u){m.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 l(this,d)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((d,h)=>{const v=new r;return v.model=h,d[h.name]=v,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(s,T,S){s("core-js/modules/es.promise"),s("core-js/modules/es.promise.finally"),s("core-js/modules/es.object.assign"),s("core-js/modules/es.object.keys"),s("core-js/modules/es.object.values"),s("core-js/modules/es.symbol"),s("core-js/modules/es.symbol.async-iterator"),s("core-js/modules/es.array.iterator"),s("core-js/modules/es.array.includes"),s("core-js/modules/es.array.find-index"),s("core-js/modules/es.array.find"),s("core-js/modules/es.string.from-code-point"),s("core-js/modules/es.string.includes"),s("core-js/modules/es.number.is-nan"),s("regenerator-runtime/runtime");const m={Workbook:s("./doc/workbook")},o=s("./doc/enums");Object.keys(o).forEach(a=>{m[a]=o[a]}),T.exports=m},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(s,T,S){const m=typeof TextDecoder=="undefined"?null:new TextDecoder("utf-8");S.bufferToString=function(o){return typeof o=="string"?o:m?m.decode(o):o.toString()}},{}],17:[function(s,T,S){const m=typeof TextEncoder=="undefined"?null:new TextEncoder("utf-8"),{Buffer:o}=s("buffer");S.stringToBuffer=function(a){return typeof a!="string"?a:m?o.from(m.encode(a).buffer):o.from(a)}},{buffer:220}],18:[function(s,T,S){const m=s("./under-dash"),o=s("./col-cache");T.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(o.decodeEx(a))}getCell(a){return this.findCellEx(o.decodeEx(a),!0)}findCell(a){return this.findCellEx(o.decodeEx(a),!1)}findCellAt(a,n,t){const e=this.sheets[a],l=e&&e[n];return l&&l[t]}addCellEx(a){if(a.top)for(let n=a.top;n<=a.bottom;n++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,n,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,n){const t=this.findSheet(a,n),e=this.findSheetRow(t,a,n);return this.findRowCell(e,a,n)}getCellAt(a,n,t){const e=this.sheets[a]||(this.sheets[a]=[]),l=e[n]||(e[n]=[]);return l[t]||(l[t]={sheetName:a,address:o.n2l(t)+n,row:n,col:t})}removeCellEx(a){const n=this.findSheet(a);if(!n)return;const t=this.findSheetRow(n,a);t&&delete t[a.col]}forEachInSheet(a,n){const t=this.sheets[a];t&&t.forEach((e,l)=>{e&&e.forEach((r,i)=>{r&&n(r,l,i)})})}forEach(a){m.each(this.sheets,(n,t)=>{this.forEachInSheet(t,a)})}map(a){const n=[];return this.forEach(t=>{n.push(a(t))}),n}findSheet(a,n){const t=a.sheetName;return this.sheets[t]?this.sheets[t]:n?this.sheets[t]=[]:void 0}findSheetRow(a,n,t){const{row:e}=n;return a&&a[e]?a[e]:t?a[e]=[]:void 0}findRowCell(a,n,t){const{col:e}=n;return a&&a[e]?a[e]:t?a[e]=this.template?Object.assign(n,JSON.parse(JSON.stringify(this.template))):n:void 0}spliceRows(a,n,t,e){const l=this.sheets[a];if(l){const r=[];for(let i=0;i{i.splice(n,t,...r)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,S){const m=/^[A-Z]+\d+$/,o={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:a=>a<=26?1:a<=676?2:3,_fill(a){let n,t,e,l,r,i=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;i<=26;)n=this._dictionary[i-1],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(i=27;i<=702;)t=i-27,e=t%26,l=Math.floor(t/26),n=this._dictionary[l]+this._dictionary[e],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(i=703;i<=16384;)t=i-703,e=t%26,l=Math.floor(t/26)%26,r=Math.floor(t/676),n=this._dictionary[r]+this._dictionary[l]+this._dictionary[e],this._n2l[i]=n,this._l2n[n]=i,i++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!m.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){const n=a.length<5&&this._hash[a];if(n)return n;let t=!1,e="",l=0,r=!1,i="",c=0;for(let u,d=0;d=65&&u<=90)t=!0,e+=a[d],l=26*l+u-64;else if(u>=48&&u<=57)r=!0,i+=a[d],c=10*c+u-48;else if(r&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;r||(c=void 0);const f={address:a=e+i,col:l,row:c,$col$row:`$${e}$${i}`};return l<=100&&c<=100&&(this._hash[a]=f,this._hash[f.$col$row]=f),f},getAddress(a,n){if(n){const t=this.n2l(n)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){const n=a.split(":");if(n.length===2){const t=this.decodeAddress(n[0]),e=this.decodeAddress(n[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){const n=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=n[1]||n[2],e=n[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),c=this.decodeAddress(l[1]);const f=Math.min(i.row,c.row),u=Math.min(i.col,c.col),d=Math.max(i.row,c.row),h=Math.max(i.col,c.col);return i=this.n2l(u)+f,c=this.n2l(h)+d,{top:f,left:u,bottom:d,right:h,sheetName:t,tl:{address:i,col:u,row:f,$col$row:`$${this.n2l(u)}$${f}`,sheetName:t},br:{address:c,col:h,row:d,$col$row:`$${this.n2l(h)}$${d}`,sheetName:t},dimensions:`${i}:${c}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const r=this.decodeAddress(e);return t?ye({sheetName:t},r):r},encodeAddress:(a,n)=>o.n2l(n)+a,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,n){const[t,e,,l,r]=a,[i,c]=n;return i>=t&&i<=l&&c>=e&&c<=r}};T.exports=o},{}],20:[function(s,T,S){const m=(a,n)=>ye(ye({},a),n.reduce((t,e)=>(a[e]&&(t[e]=ye({},a[e])),t),{})),o=function(a,n,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(n[t]=m(a[t],e))};S.copyStyle=a=>{if(!a)return a;if(n=a,Object.keys(n).length===0)return{};var n;const t=ye({},a);return o(a,t,"font",["color"]),o(a,t,"alignment"),o(a,t,"protection"),a.border&&(o(a,t,"border"),o(a.border,t.border,"top",["color"]),o(a.border,t.border,"left",["color"]),o(a.border,t.border,"bottom",["color"]),o(a.border,t.border,"right",["color"]),o(a.border,t.border,"diagonal",["color"])),a.fill&&(o(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(e=>m(e,["color"])))),t}},{}],21:[function(s,T,S){(function(m){(function(){const o=s("crypto"),a={hash(n){const t=o.createHash(n);for(var e=arguments.length,l=new Array(e>1?e-1:0),r=1;ro.randomBytes(n)};T.exports=a}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,S){const{SaxesParser:m}=s("saxes"),{PassThrough:o}=s("readable-stream"),{bufferToString:a}=s("./browser-buffer-decode");T.exports=function(n){return ir(this,null,function*(){n.pipe&&!n[Symbol.asyncIterator]&&(n=n.pipe(new o));const t=new m;let e;t.on("error",u=>{e=u});let l=[];t.on("opentag",u=>l.push({eventType:"opentag",value:u})),t.on("text",u=>l.push({eventType:"text",value:u})),t.on("closetag",u=>l.push({eventType:"closetag",value:u}));try{for(var r=Ve(n),i,c,f;i=!(c=yield new $e(r.next())).done;i=!1){const u=c.value;if(t.write(a(u)),e)throw e;yield l,l=[]}}catch(c){f=[c]}finally{try{i&&(c=r.return)&&(yield new $e(c.call(r)))}finally{if(f)throw f[0]}}})}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,T,S){const m=s("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(n,t,e){const l=m.decode(t),r=m.decode(e);return n.replace(o,(i,c,f,u,d)=>{if(d)return i;const h=a.exec(u);if(h){const v=h[1],_=h[2].toUpperCase(),A=h[3],N=h[4];if(_.length>3||_.length===3&&_>"XFD")return i;let L=m.l2n(_),j=parseInt(N,10);return v||(L+=r.col-l.col),A||(j+=r.row-l.row),(c||"")+(v||"")+m.n2l(L)+(A||"")+j}return i})}}},{"./col-cache":19}],24:[function(s,T,S){(function(m,o){(function(){const a=s("readable-stream"),n=s("./utils"),t=s("./string-buf");class e{constructor(d,h){this._data=d,this._encoding=h}get length(){return this.toBuffer().length}copy(d,h,v,_){return this.toBuffer().copy(d,h,v,_)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class l{constructor(d){this._data=d}get length(){return this._data.length}copy(d,h,v,_){return this._data._buf.copy(d,h,v,_)}toBuffer(){return this._data.toBuffer()}}class r{constructor(d){this._data=d}get length(){return this._data.length}copy(d,h,v,_){this._data.copy(d,h,v,_)}toBuffer(){return this._data}}class i{constructor(d){this.size=d,this.buffer=o.alloc(d),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const d=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(d,0,this.iRead,this.iWrite),d}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(d){let h;return d===0?null:d===void 0||d>=this.length?(h=this.toBuffer(),this.iRead=this.iWrite,h):(h=o.alloc(d),this.buffer.copy(h,0,this.iRead,d),this.iRead+=d,h)}write(d,h,v){const _=Math.min(v,this.size-this.iWrite);return d.copy(this.buffer,this.iWrite,h,h+_),this.iWrite+=_,_}}const c=function(u){u=u||{},this.bufSize=u.bufSize||1048576,this.buffers=[],this.batch=u.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};n.inherits(c,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(u=>u.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const d=this.buffers[this.buffers.length-1];if(!d.full)return d}const u=new i(this.bufSize);return this.buffers.push(u),u},_pipe(u){return Kt(this,null,function*(){yield Promise.all(this.pipes.map(function(d){return new Promise(h=>{d.write(u.toBuffer(),()=>{h()})})}))})},_writeToBuffers(u){let d=0;const h=u.length;for(;d1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(v),m.nextTick(h)):(yield this._pipe(v),h());else this.paused||this.emit("data",v.toBuffer()),this._writeToBuffers(v),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(u,d,h){const v=_=>{_?h(_):(this._flush(),this.pipes.forEach(A=>{A.end()}),this.emit("finish"))};u?this.write(u,d,v):v()},read(u){let d;if(u){for(d=[];u&&this.buffers.length&&!this.buffers[0].eod;){const h=this.buffers[0],v=h.read(u);u-=v.length,d.push(v),h.eod&&h.full&&this.buffers.shift()}return o.concat(d)}return d=this.buffers.map(h=>h.toBuffer()).filter(Boolean),this.buffers=[],o.concat(d)},setEncoding(u){this.encoding=u},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(u){this.pipes.push(u),!this.paused&&this.buffers.length&&this.end()},unpipe(u){this.pipes=this.pipes.filter(d=>d!==u)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=c}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(s,T,S){(function(m){(function(){T.exports=class{constructor(o){this._buf=m.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=m.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let a=2*this._buf.length;for(;a=this._buf.length-4;)this._grow(this._inPos+o.length),a=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=a}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,S){const{toString:m}=Object.prototype,o=/["&<>]/,a={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,l)=>(e[l[t]]=l,e),{}),isEqual:function(n,t){const e=typeof n,l=typeof t,r=Array.isArray(n),i=Array.isArray(t);let c;if(e!==l)return!1;switch(typeof n){case"object":if(r||i)return!(!r||!i)&&n.length===t.length&&n.every((f,u)=>{const d=t[u];return a.isEqual(f,d)});if(n===null||t===null)return n===t;if(c=Object.keys(n),Object.keys(t).length!==c.length)return!1;for(const f of c)if(!t.hasOwnProperty(f))return!1;return a.every(n,(f,u)=>{const d=t[u];return a.isEqual(f,d)});default:return n===t}},escapeHtml(n){const t=o.exec(n);if(!t)return n;let e="",l="",r=0,i=t.index;for(;i":l=">";break;default:continue}r!==i&&(e+=n.substring(r,i)),r=i+1,e+=l}return r!==i?e+n.substring(r,i):e},strcmp:(n,t)=>nt?1:0,isUndefined:n=>m.call(n)==="[object Undefined]",isObject:n=>m.call(n)==="[object Object]",deepMerge(){const n=arguments[0]||{},{length:t}=arguments;let e,l,r;function i(c,f){e=n[f],r=Array.isArray(c),a.isObject(c)||r?(r?(r=!1,l=e&&Array.isArray(e)?e:[]):l=e&&a.isObject(e)?e:{},n[f]=a.deepMerge(l,c)):a.isUndefined(c)||(n[f]=c)}for(let c=0;c&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{m.setImmediate?o(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,r,i){e.super_=l,i||(i=r,r=null),r&&Object.keys(r).forEach(f=>{Object.defineProperty(e,f,Object.getOwnPropertyDescriptor(r,f))});const c={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(f=>{c[f]=Object.getOwnPropertyDescriptor(i,f)}),e.prototype=Object.create(l.prototype,c)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const r=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(r)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=n.exec(e);if(!l)return e;let r="",i="",c=0,f=l.index;for(;f=11&&u!==13)){i="";break}continue}c!==f&&(r+=e.substring(c,f)),c=f+1,i&&(r+=i)}return c!==f?r+e.substring(c,f):r},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{a.access(e,a.constants.F_OK,r=>{l(!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 Vt!="undefined"?Vt:typeof self!="undefined"?self:typeof window!="undefined"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,T,S){const m=s("./under-dash"),o=s("./utils");function a(e,l,r){e.push(` ${l}="${o.xmlEncode(r.toString())}"`)}function n(e,l){if(l){const r=[];m.each(l,(i,c)=>{i!==void 0&&a(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(l){const r=this._xml;r.push(" `)}openNode(l,r){const i=this.tos,c=this._xml;i&&this.open&&c.push(">"),this._stack.push(l),c.push("<"),c.push(l),n(c,r),this.leaf=!0,this.open=!0}addAttribute(l,r){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r!==void 0&&a(this._xml,l,r)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n(this._xml,l)}writeText(l){const r=this._xml;this.open&&(r.push(">"),this.open=!1),this.leaf=!1,r.push(o.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),r=this._xml;this.leaf?r.push("/>"):(r.push("")),this.open=!1,this.leaf=!1}leafNode(l,r,i){this.openNode(l,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 l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},T.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,T,S){(function(m){(function(){const o=s("events"),a=s("jszip"),n=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends o.EventEmitter{constructor(r){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},r),this.zip=new a,this.stream=new n}append(r,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,r,{base64:!0}):(m.browser&&typeof r=="string"&&(r=t(r)),this.zip.file(i.name,r))}finalize(){return Kt(this,null,function*(){const r=yield 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,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,T,S){T.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(s,T,S){T.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(s,T,S){const m=s("../../utils/parse-sax"),o=s("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}parse(t){return Kt(this,null,function*(){try{for(var e=Ve(t),l,r,i;l=!(r=yield e.next()).done;l=!1){const c=r.value;for(const{eventType:f,value:u}of c)if(f==="opentag")this.parseOpen(u);else if(f==="text")this.parseText(u);else if(f==="closetag"&&!this.parseClose(u.name))return this.model}}catch(r){i=[r]}finally{try{l&&(r=e.return)&&(yield r.call(e))}finally{if(i)throw i[0]}}return this.model})}parseStream(t){return Kt(this,null,function*(){return this.parse(m(t))})}get xml(){return this.toXml(this.model)}toXml(t){const e=new o;return this.render(e,t),e.xml}static toAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t.toString()}static toStringAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toStringValue(t,e){return t===void 0?e:t}static toBoolAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return e}else if(l||t!==e)return t?"1":"0"}static toBoolValue(t,e){return t===void 0?e:t==="1"}static toIntAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toIntValue(t,e){return t===void 0?e:parseInt(t,10)}static toFloatAttribute(t,e){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/col-cache");function a(t){try{return o.decodeEx(t),!0}catch(e){return!1}}function n(t){const e=[];let l=!1,r="";return t.split(",").forEach(i=>{if(!i)return;const c=(i.match(/'/g)||[]).length;if(!c)return void(l?r+=i+",":a(i)&&e.push(i));const f=c%2==0;!l&&f&&a(i)?e.push(i):l&&!f?(l=!1,a(r+i)&&e.push(r+i),r=""):(l=!0,r+=i+",")}),e}T.exports=class extends m{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(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{render(a,n){a.leafNode("sheet",{sheetId:n.id,name:n.name,state:n.state,"r:id":n.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:m.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){const n={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(n.visibility=a.visibility),o.leafNode("workbookView",n)}parseOpen(o){if(o.name==="workbookView"){const a=this.model={},n=function(e,l,r){const i=l!==void 0?a[e]=l:r;i!==void 0&&(a[e]=i)},t=function(e,l,r){const i=l!==void 0?a[e]=parseInt(l,10):r;i!==void 0&&(a[e]=i)};return t("x",o.attributes.xWindow,0),t("y",o.attributes.yWindow,0),t("width",o.attributes.windowWidth,25e3),t("height",o.attributes.windowHeight,1e4),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(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),n=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),r=s("./sheet-xform"),i=s("./workbook-view-xform"),c=s("./workbook-properties-xform"),f=s("./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 l}),calcPr:new f}}prepare(h){h.sheets=h.worksheets;const v=[];let _=0;h.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:_};v.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:_};v.push(L)}_++}),v.length&&(h.definedNames=h.definedNames.concat(v)),(h.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(h,v){h.openXml(a.StdDocAttributes),h.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(h),this.map.workbookPr.render(h,v.properties),this.map.bookViews.render(h,v.views),this.map.sheets.render(h,v.sheets),this.map.definedNames.render(h,v.definedNames),this.map.calcPr.render(h,v.calcProperties),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;switch(h.name){case"workbook":return!0;default:return this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h),!0}}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser)return this.parser.parseClose(h)||(this.parser=void 0),!0;switch(h){case"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(h){const v=(h.workbookRels||[]).reduce((j,P)=>(j[P.Id]=P,j),{}),_=[];let A,N=0;(h.sheets||[]).forEach(j=>{const P=v[j.rId];P&&(A=h.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=j.name,A.id=j.id,A.state=j.state,_[N++]=A))});const L=[];m.each(h.definedNames,j=>{if(j.name==="_xlnm.Print_Area"){if(A=_[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=_[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=j.ranges.join(","),D=/\$/g,H=/\$\d+:\$\d+/,B=P.match(H);if(B&&B.length){const w=B[0];A.pageSetup.printTitlesRow=w.replace(D,"")}const x=/\$[A-Z]+:\$[A-Z]+/,M=P.match(x);if(M&&M.length){const w=M[0];A.pageSetup.printTitlesColumn=w.replace(D,"")}}}else L.push(j)}),h.definedNames=L,h.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(s,T,S){const m=s("../strings/rich-text-xform"),o=s("../../../utils/utils"),a=s("../base-xform"),n=T.exports=function(t){this.model=t};o.inherits(n,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new m),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model=ye({type:"note",note:{texts:[]}},t.attributes),!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../../../utils/utils"),a=s("../base-xform"),n=s("./comment-xform"),t=T.exports=function(){this.map={comment:new n}};o.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,l){l=l||this.model,e.openXml(m.StdDocAttributes),e.openNode("comments",t.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),l.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(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a,n){(a===n[2]||this.tag==="x:SizeWithCells"&&a===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(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"x:Anchor"}getAnchorRect(o){const a=Math.floor(o.left),n=Math.floor(68*(o.left-a)),t=Math.floor(o.top),e=Math.floor(18*(o.top-t)),l=Math.floor(o.right),r=Math.floor(68*(o.right-l)),i=Math.floor(o.bottom);return[a,n,t,e,l,r,i,Math.floor(18*(o.bottom-i))]}getDefaultRect(o){const a=o.col,n=Math.max(o.row-2,0);return[a,6,n,14,a+2,2,n+4,16]}render(o,a){const n=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.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(s,T,S){const m=s("../base-xform"),o=s("./vml-anchor-xform"),a=s("./style/vml-protection-xform"),n=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends m{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new n({tag:"x:SizeWithCells"}),"x:MoveWithCells":new n({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:r,editAs:i}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,i,t),this.map["x:SizeWithCells"].render(e,i,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,r.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,r.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./vml-shape-xform");class n extends o{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(e,l){e.openXml(m.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(),l.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,l){e.anchors.forEach(r=>{r.br?this.map["xdr:twoCellAnchor"].reconcile(r,l):this.map["xdr:oneCellAnchor"].reconcile(r,l)})}}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(s,T,S){const m=s("../base-xform"),o=s("./vml-textbox-xform"),a=s("./vml-client-data-xform");class n extends m{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new a}}get tag(){return"v:shape"}render(e,l,r){e.openNode("v:shape",n.V_SHAPE_ATTRIBUTES(l,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,l),this.map["x:ClientData"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"v:textbox"}conversionUnit(o,a,n){return`${parseFloat(o)*a.toFixed(2)}${n}`}reverseConversionUnit(o){return(o||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(o,a){const n={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(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(s,T,S){const m=s("./base-xform");T.exports=class extends m{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,a){this.model[o]=a.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,a.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.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(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/string-xform"),n=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends o{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new n,TitleOfParts:new t}}render(r,i){r.openXml(m.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(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform");class a extends o{render(t,e){t.openXml(m.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(r=>{if(r.type==="image"){const i=r.extension;l[i]||(l[i]=!0,t.leafNode("Default",{Extension:i,ContentType:"image/"+i}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(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}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../simple/date-xform"),n=s("../simple/string-xform"),t=s("../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 a({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 a({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(r,i){r.openXml(m.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(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(o,a){o.leafNode("Relationship",a)}parseOpen(o){switch(o.name){case"Relationship":return this.model=o.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./relationship-xform");class n extends o{constructor(){super(),this.map={Relationship:new a}}render(e,l){l=l||this._values,e.openXml(m.StdDocAttributes),e.openNode("Relationships",n.RELATIONSHIPS_ATTRIBUTES),l.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(s,T,S){const m=s("../base-xform");T.exports=class extends m{parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,a){if(o&&o.rId){const n=a.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){const t=n[1],e=a.mediaIndex[t];return a.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,S){const m=s("../base-xform"),o=s("./blip-xform");T.exports=class extends m{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(a,n){a.openNode(this.tag),this.map["a:blip"].render(a,n),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(){}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:blip"}render(o,a){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,T,S){const m=s("../base-xform"),o=s("./hlink-click-xform"),a=s("./ext-lst-xform");T.exports=class extends m{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new a}}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(s,T,S){const m=s("../base-xform"),o=s("../simple/integer-xform");T.exports=class extends m{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(a,n){a.openNode(this.tag),this.map["xdr:col"].render(a,n.nativeCol),this.map["xdr:colOff"].render(a,n.nativeColOff),this.map["xdr:row"].render(a,n.nativeRow),this.map["xdr:rowOff"].render(a,n.nativeRowOff),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(s,T,S){const m=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),n=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new n,"xdr:oneCellAnchor":new t}}prepare(r){r.anchors.forEach((i,c)=>{i.anchorType=function(f){return(typeof f.range=="string"?m.decode(f.range):f.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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,a){o.openNode(this.tag);const n=Math.floor(9525*a.width),t=Math.floor(9525*a.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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"a:hlinkClick"}render(o,a){a.hyperlinks&&a.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(o){switch(o.name){case this.tag:return this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,S){const m=s("../base-xform"),o=s("./c-nv-pr-xform"),a=s("./c-nv-pic-pr-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new a}}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(s,T,S){const m=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),n=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new a({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,l){this.map["xdr:pic"].prepare(e.picture,l)}render(e,l){e.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,l.range.tl),this.map["xdr:ext"].render(e,l.range.ext),this.map["xdr:pic"].render(e,l.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(e,l){e.medium=this.reconcilePicture(e.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(s,T,S){const m=s("../base-xform"),o=s("../static-xform"),a=s("./blip-fill-xform"),n=s("./nv-pic-pr-xform"),t=s("./sp-pr");T.exports=class extends m{constructor(){super(),this.map={"xdr:nvPicPr":new n,"xdr:blipFill":new a,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(e,l){e.index=l.index+1}render(e,l){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,l),this.map["xdr:blipFill"].render(e,l),this.map["xdr:spPr"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(s,T,S){T.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(s,T,S){const m=s("./base-cell-anchor-xform"),o=s("../static-xform"),a=s("./cell-position-xform"),n=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({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(s,T,S){const m=s("./base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,a){const{childXform:n}=this;o&&o.forEach((t,e)=>{a.index=e,n.prepare(t,a)})}render(o,a){if(this.always||a&&a.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,a&&a.length||0);const{childXform:n}=this;(a||[]).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,a){if(o){const{childXform:n}=this;o.forEach(t=>{n.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(s,T,S){const m=s("../../../utils/col-cache"),o=s("../base-xform");T.exports=class extends o{get tag(){return"autoFilter"}render(a,n){if(n)if(typeof n=="string")a.leafNode("autoFilter",{ref:n});else{const t=function(r){return typeof r=="string"?r:m.getAddress(r.row,r.column).address},e=t(n.from),l=t(n.to);e&&l&&a.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform"),a=s("../../../doc/range"),n=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return n.ValueType.Null;if(l instanceof String||typeof l=="string")return n.ValueType.String;if(typeof l=="number")return n.ValueType.Number;if(typeof l=="boolean")return n.ValueType.Boolean;if(l instanceof Date)return n.ValueType.Date;if(l.text&&l.hyperlink)return n.ValueType.Hyperlink;if(l.formula)return n.ValueType.Formula;if(l.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(l,r){const i=r.styles.addStyleModel(l.style||{},function(c){switch(c.type){case n.ValueType.Formula:return e(c.result);default:return c.type}}(l));switch(i&&(l.styleId=i),l.comment&&r.comments.push(Ee(ye({},l.comment),{ref:l.address})),l.type){case n.ValueType.String:case n.ValueType.RichText:r.sharedStrings&&(l.ssId=r.sharedStrings.add(l.value));break;case n.ValueType.Date:r.date1904&&(l.date1904=!0);break;case n.ValueType.Hyperlink:r.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=r.sharedStrings.add(l.text)),r.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case n.ValueType.Merge:r.merges.add(l);break;case n.ValueType.Formula:if(r.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=r.siFormulae++),l.formula)r.formulae[l.address]=l;else if(l.sharedFormula){const c=r.formulae[l.sharedFormula];if(!c)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);c.si===void 0?(c.shareType="shared",c.si=r.siFormulae++,c.range=new a(c.address,l.address)):c.range&&c.range.expandToAddress(l.address),l.si=c.si}}}renderFormula(l,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:l.leafNode("f",i,r.formula);break;case n.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",i,r.formula),l.leafNode("v",null,r.result);break;case n.ValueType.Number:l.leafNode("f",i,r.formula),l.leafNode("v",null,r.result);break;case n.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",i,r.formula),l.leafNode("v",null,r.result?1:0);break;case n.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",i,r.formula),l.leafNode("v",null,r.result.error);break;case n.ValueType.Date:l.leafNode("f",i,r.formula),l.leafNode("v",null,m.dateToExcel(r.result,r.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,r){if(r.type!==n.ValueType.Null||r.styleId){switch(l.openNode("c"),l.addAttribute("r",r.address),r.styleId&&l.addAttribute("s",r.styleId),r.type){case n.ValueType.Null:break;case n.ValueType.Number:l.leafNode("v",null,r.value);break;case n.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,r.value?"1":"0");break;case n.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,r.value.error);break;case n.ValueType.String:case n.ValueType.RichText:r.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,r.ssId)):r.value&&r.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),r.value.richText.forEach(i=>{this.richTextXForm.render(l,i)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,r.value));break;case n.ValueType.Date:l.leafNode("v",null,m.dateToExcel(r.value,r.date1904));break;case n.ValueType.Hyperlink:r.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,r.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,r.text));break;case n.ValueType.Formula:this.renderFormula(l,r);break;case n.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:r}=this;if(r.formula||r.shareType)r.type=n.ValueType.Formula,r.value&&(this.t==="str"?r.result=m.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=m.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(l),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(l),!0)}}reconcile(l,r){const i=l.styleId&&r.styles&&r.styles.getStyleModel(l.styleId);switch(i&&(l.style=i),l.styleId!==void 0&&(l.styleId=void 0),l.type){case n.ValueType.String:typeof l.value=="number"&&r.sharedStrings&&(l.value=r.sharedStrings.getString(l.value)),l.value.richText&&(l.type=n.ValueType.RichText);break;case n.ValueType.Number:i&&m.isDateFmt(i.numFmt)&&(l.type=n.ValueType.Date,l.value=m.excelToDate(l.value,r.date1904));break;case n.ValueType.Formula:l.result!==void 0&&i&&m.isDateFmt(i.numFmt)&&(l.result=m.excelToDate(l.result,r.date1904)),l.shareType==="shared"&&(l.ref?r.formulae[l.si]=l.address:(l.sharedFormula=r.formulae[l.si],delete l.shareType),delete l.si)}const c=r.hyperlinkMap[l.address];c&&(l.type===n.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=n.ValueType.Hyperlink,l.hyperlink=c);const f=r.commentsMap&&r.commentsMap[l.address];f&&(l.comment=f)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"x14:cfIcon"}render(o,a){o.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(o){let{attributes:a}=o;this.model={iconSet:a.iconSet,iconId:m.toIntValue(a.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,S){const{v4:m}=s("uuid"),o=s("../../base-xform"),a=s("../../composite-xform"),n=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new 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){l.isExt(i)&&(i.x14Id=`{${m()}}`.toUpperCase())}render(i,c){if(l.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||`{${m()}}`}),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=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(s,T,S){const m=s("../../composite-xform"),o=s("./f-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(a,n){a.openNode(this.tag,{type:n.type}),n.value!==void 0&&this.fExtXform.render(a,n.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,n){switch(a){case"xm:f":this.model.value=n.model?parseFloat(n.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,T,S){const m=s("../../composite-xform"),o=s("./sqref-ext-xform"),a=s("./cf-rule-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(n,t){n.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(n,t){t.rules.some(a.isExt)&&(n.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.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(s,T,S){const m=s("../../composite-xform"),o=s("./cf-rule-ext-xform"),a=s("./conditional-formatting-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}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(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../style/color-xform"),n=s("./cfvo-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new n,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:m.toIntAttribute(e.minLength,0,!0),maxLength:m.toIntAttribute(e.maxLength,100,!0),border:m.toBoolAttribute(e.border,!1),gradient:m.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:m.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:m.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:m.toAttribute(e.axisPosition,"auto"),direction:m.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:m.toIntValue(e.minLength,0),maxLength:m.toIntValue(e.maxLength,100),border:m.toBoolValue(e.border,!1),gradient:m.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:m.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:m.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:m.toStringValue(e.axisPosition,"auto"),direction:m.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"xm:f"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-ext-xform"),n=s("./cf-icon-ext-xform");T.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new n}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:m.toStringAttribute(e.iconSet),reverse:m.toBoolAttribute(e.reverse,!1),showValue:m.toBoolAttribute(e.showValue,!0),custom:m.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),e.icons&&e.icons.forEach((l,r)=>{l.iconId=r,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:m.toStringValue(e.iconSet,"3TrafficLights"),reverse:m.toBoolValue(e.reverse,!1),showValue:m.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[l]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"xm:sqref"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("../../../../doc/range"),n=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),r=s("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},c=u=>{const{type:d,operator:h}=u;switch(d){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:d};default:return{type:d,operator:h}}};class f 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 l,iconSet:this.iconSetXform=new r}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!i[d.iconSet]}render(d,h){switch(h.type){case"expression":this.renderExpression(d,h);break;case"cellIs":this.renderCellIs(d,h);break;case"top10":this.renderTop10(d,h);break;case"aboveAverage":this.renderAboveAverage(d,h);break;case"dataBar":this.renderDataBar(d,h);break;case"colorScale":this.renderColorScale(d,h);break;case"iconSet":this.renderIconSet(d,h);break;case"containsText":this.renderText(d,h);break;case"timePeriod":this.renderTimePeriod(d,h)}}renderExpression(d,h){d.openNode(this.tag,{type:"expression",dxfId:h.dxfId,priority:h.priority}),this.formulaXform.render(d,h.formulae[0]),d.closeNode()}renderCellIs(d,h){d.openNode(this.tag,{type:"cellIs",dxfId:h.dxfId,priority:h.priority,operator:h.operator}),h.formulae.forEach(v=>{this.formulaXform.render(d,v)}),d.closeNode()}renderTop10(d,h){d.leafNode(this.tag,{type:"top10",dxfId:h.dxfId,priority:h.priority,percent:m.toBoolAttribute(h.percent,!1),bottom:m.toBoolAttribute(h.bottom,!1),rank:m.toIntValue(h.rank,10,!0)})}renderAboveAverage(d,h){d.leafNode(this.tag,{type:"aboveAverage",dxfId:h.dxfId,priority:h.priority,aboveAverage:m.toBoolAttribute(h.aboveAverage,!0)})}renderDataBar(d,h){d.openNode(this.tag,{type:"dataBar",priority:h.priority}),this.databarXform.render(d,h),this.extLstRefXform.render(d,h),d.closeNode()}renderColorScale(d,h){d.openNode(this.tag,{type:"colorScale",priority:h.priority}),this.colorScaleXform.render(d,h),d.closeNode()}renderIconSet(d,h){f.isPrimitive(h)&&(d.openNode(this.tag,{type:"iconSet",priority:h.priority}),this.iconSetXform.render(d,h),d.closeNode())}renderText(d,h){d.openNode(this.tag,{type:h.operator,dxfId:h.dxfId,priority:h.priority,operator:m.toStringAttribute(h.operator,"containsText")});const v=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new a(_.ref),{tl:N}=A;switch(_.operator){case"containsText":return`NOT(ISERROR(SEARCH("${_.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}})(h);v&&this.formulaXform.render(d,v),d.closeNode()}renderTimePeriod(d,h){d.openNode(this.tag,{type:"timePeriod",dxfId:h.dxfId,priority:h.priority,timePeriod:h.timePeriod});const v=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new a(_.ref),{tl:N}=A;switch(_.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}})(h);v&&this.formulaXform.render(d,v),d.closeNode()}createNewModel(d){let{attributes:h}=d;return Ee(ye({},c(h)),{dxfId:m.toIntValue(h.dxfId),priority:m.toIntValue(h.priority),timePeriod:h.timePeriod,percent:m.toBoolValue(h.percent),bottom:m.toBoolValue(h.bottom),rank:m.toIntValue(h.rank),aboveAverage:m.toBoolValue(h.aboveAverage)})}onParserClose(d,h){switch(d){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,h.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(h.model)}}}T.exports=f},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"cfvo"}render(o,a){o.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(o){this.model={type:o.attributes.type,value:m.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,S){const m=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,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(s,T,S){const m=s("../../composite-xform"),o=s("./cf-rule-xform");T.exports=class extends m{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(a,n){n.rules.some(o.isPrimitive)&&(a.openNode(this.tag,{sqref:n.ref}),n.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=n.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:n}=a;return{ref:n.sqref,rules:[]}}onParserClose(a,n){this.model.rules.push(n.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,S){const m=s("../../base-xform"),o=s("./conditional-formatting-xform");T.exports=class extends m{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,n){let t=a.reduce((e,l)=>Math.max(e,...l.rules.map(r=>r.priority||0)),1);a.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=n.styles.addDxfStyle(l.style))})})}render(a,n){n.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(a),!0;default:return!1}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(!!this.parser.parseClose(a)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,n){a.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(s,T,S){const m=s("../../composite-xform"),o=s("../../style/color-xform"),a=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,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(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform");class a extends m{get tag(){return"x14:id"}render(e,l){e.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class n extends o{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(e,l){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,l.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,l){this.model.x14Id=l.model}}T.exports=class extends o{constructor(){super(),this.map={ext:new 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(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"formula"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,S){const m=s("../../base-xform"),o=s("../../composite-xform"),a=s("./cfvo-xform");T.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(n,t){n.openNode(this.tag,{iconSet:m.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:m.toBoolAttribute(t.reverse,!1),showValue:m.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(e=>{this.cfvoXform.render(n,e)}),n.closeNode()}createNewModel(n){let{attributes:t}=n;return{iconSet:m.toStringValue(t.iconSet,"3TrafficLights"),reverse:m.toBoolValue(t.reverse),showValue:m.toBoolValue(t.showValue),cfvo:[]}}onParserClose(n,t){this.model[n].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,T,S){const m=s("../../../utils/utils"),o=s("../base-xform");T.exports=class extends o{get tag(){return"col"}prepare(a,n){const t=n.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,n){a.openNode("col"),a.addAttribute("min",n.min),a.addAttribute("max",n.max),n.width&&a.addAttribute("width",n.width),n.styleId&&a.addAttribute("style",n.styleId),n.hidden&&a.addAttribute("hidden","1"),n.bestFit&&a.addAttribute("bestFit","1"),n.outlineLevel&&a.addAttribute("outlineLevel",n.outlineLevel),n.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){const n=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(n.styleId=parseInt(a.attributes.style,10)),m.parseBoolean(a.attributes.hidden)&&(n.hidden=!0),m.parseBoolean(a.attributes.bestFit)&&(n.bestFit=!0),a.attributes.outlineLevel&&(n.outlineLevel=parseInt(a.attributes.outlineLevel,10)),m.parseBoolean(a.attributes.collapsed)&&(n.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,n){a.styleId&&(a.style=n.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/utils"),a=s("../../../utils/col-cache"),n=s("../base-xform"),t=s("../../../doc/range");function e(r,i,c,f){const u=i[c];u!==void 0?r[c]=u:f!==void 0&&(r[c]=f)}function l(r,i,c,f){const u=i[c];u!==void 0?r[c]=o.parseBoolean(u):f!==void 0&&(r[c]=f)}T.exports=class extends n{get tag(){return"dataValidations"}render(r,i){const c=function(f){const u=m.map(f,(v,_)=>({address:_,dataValidation:v,marked:!1})).sort((v,_)=>m.strcmp(v.address,_.address)),d=m.keyBy(u,"address"),h=(v,_,A)=>{for(let N=0;N<_;N++){const L=a.encodeAddress(v.row+N,A);if(!f[L]||!m.isEqual(f[v.address],f[L]))return!1}return!0};return u.map(v=>{if(!v.marked){const _=a.decodeEx(v.address);if(_.dimensions)return d[_.dimensions].marked=!0,Ee(ye({},v.dataValidation),{sqref:v.address});let A=1,N=a.encodeAddress(_.row+A,_.col);for(;f[N]&&m.isEqual(v.dataValidation,f[N]);)A++,N=a.encodeAddress(_.row+A,_.col);let L=1;for(;h(_,A,_.col+L);)L++;for(let j=0;j1||L>1){const j=_.row+(A-1),P=_.col+(L-1);return Ee(ye({},v.dataValidation),{sqref:`${v.address}:${a.encodeAddress(j,P)}`})}return Ee(ye({},v.dataValidation),{sqref:v.address})}return null}).filter(Boolean)}(i);c.length&&(r.openNode("dataValidations",{count:c.length}),c.forEach(f=>{r.openNode("dataValidation"),f.type!=="any"&&(r.addAttribute("type",f.type),f.operator&&f.type!=="list"&&f.operator!=="between"&&r.addAttribute("operator",f.operator),f.allowBlank&&r.addAttribute("allowBlank","1")),f.showInputMessage&&r.addAttribute("showInputMessage","1"),f.promptTitle&&r.addAttribute("promptTitle",f.promptTitle),f.prompt&&r.addAttribute("prompt",f.prompt),f.showErrorMessage&&r.addAttribute("showErrorMessage","1"),f.errorStyle&&r.addAttribute("errorStyle",f.errorStyle),f.errorTitle&&r.addAttribute("errorTitle",f.errorTitle),f.error&&r.addAttribute("error",f.error),r.addAttribute("sqref",f.sqref),(f.formulae||[]).forEach((u,d)=>{r.openNode("formula"+(d+1)),f.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&&l(i,r.attributes,"allowBlank"),l(i,r.attributes,"showInputMessage"),l(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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"dimension"}render(o,a){a&&o.leafNode("dimension",{ref:a})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"drawing"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,S){const m=s("../composite-xform"),o=s("./cf-ext/conditional-formattings-ext-xform");class a extends m{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 m{constructor(){super(),this.map={ext:this.ext=new a}}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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"headerFooter"}render(o,a){if(a){o.addRollback();let n=!1;o.openNode("headerFooter"),a.differentFirst&&(o.addAttribute("differentFirst","1"),n=!0),a.differentOddEven&&(o.addAttribute("differentOddEven","1"),n=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(o.leafNode("oddHeader",null,a.oddHeader),n=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(o.leafNode("oddFooter",null,a.oddFooter),n=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(o.leafNode("evenHeader",null,a.evenHeader),n=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(o.leafNode("evenFooter",null,a.evenFooter),n=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(o.leafNode("firstHeader",null,a.firstHeader),n=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(o.leafNode("firstFooter",null,a.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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"hyperlink"}render(o,a){this.isInternalLink(a)?o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"mergeCell"}render(o,a){o.leafNode("mergeCell",{ref:a})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../doc/range"),a=s("../../../utils/col-cache"),n=s("../../../doc/enums");T.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new o(e)}}get mergeCells(){return m.map(this.merges,t=>t.range)}reconcile(t,e){m.each(t,l=>{const r=a.decode(l);for(let i=r.top;i<=r.bottom;i++){const c=e[i-1];for(let f=r.left;f<=r.right;f++){const u=c.cells[f-1];u?u.type===n.ValueType.Merge&&(u.master=r.tl):c.cells[f]={type:n.ValueType.Null,address:a.encodeAddress(i,f)}}}})}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(s,T,S){const m=s("../base-xform"),o=a=>a!==void 0;T.exports=class extends m{get tag(){return"outlinePr"}render(a,n){return!(!n||!o(n.summaryBelow)&&!o(n.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:o(n.summaryBelow)?Number(n.summaryBelow):void 0,summaryRight:o(n.summaryRight)?Number(n.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:o(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:o(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"brk"}render(o,a){o.leafNode("brk",a)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"pageMargins"}render(a,n){if(n){const t={left:n.left,right:n.right,top:n.top,bottom:n.bottom,header:n.header,footer:n.footer};m.some(t,e=>e!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){switch(a.name){case this.tag:return this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"pageSetUpPr"}render(o,a){return!(!a||!a.fitToPage)&&(o.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(l){return l?"1":void 0}function n(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}T.exports=class extends o{get tag(){return"pageSetup"}render(l,r){if(r){const i={paperSize:r.paperSize,orientation:r.orientation,horizontalDpi:r.horizontalDpi,verticalDpi:r.verticalDpi,pageOrder:n(r.pageOrder),blackAndWhite:a(r.blackAndWhite),draft:a(r.draft),cellComments:t(r.cellComments),errors:e(r.errors),scale:r.scale,fitToWidth:r.fitToWidth,fitToHeight:r.fitToHeight,firstPageNumber:r.firstPageNumber,useFirstPageNumber:a(r.firstPageNumber),usePrinterDefaults:a(r.usePrinterDefaults),copies:r.copies};m.some(i,c=>c!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(r=l.attributes.paperSize,r!==void 0?parseInt(r,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var r}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"picture"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(n){return n?"1":void 0}T.exports=class extends o{get tag(){return"printOptions"}render(n,t){if(t){const e={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};m.some(e,l=>l!==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(s,T,S){const m=s("./page-breaks-xform"),o=s("../list-xform");T.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new m})}render(a,n){if(n&&n.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,n.length),a.addAttribute("manualBreakCount",n.length));const{childXform:t}=this;n.forEach(e=>{t.render(a,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/utils"),a=s("./cell-xform");T.exports=class extends m{constructor(n){super(),this.maxItems=n&&n.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(n,t){const e=t.styles.addStyleModel(n.style);e&&(n.styleId=e);const l=this.map.c;n.cells.forEach(r=>{l.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 l=this.map.c;t.cells.forEach(r=>{l.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(l=>parseInt(l,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(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");T.exports=class extends o{get tag(){return"sheetFormatPr"}render(a,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"),m.some(t,e=>e!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,S){const m=s("../base-xform"),o=s("../style/color-xform"),a=s("./page-setup-properties-xform"),n=s("./outline-properties-xform");T.exports=class extends m{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new a,outlinePr:new n}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../base-xform");function a(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 l={sheet:a(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:a(e.formatCells,"0"),formatColumns:a(e.formatColumns,"0"),formatRows:a(e.formatRows,"0"),insertColumns:a(e.insertColumns,"0"),insertRows:a(e.insertRows,"0"),insertHyperlinks:a(e.insertHyperlinks,"0"),deleteColumns:a(e.deleteColumns,"0"),deleteRows:a(e.deleteRows,"0"),sort:a(e.sort,"0"),autoFilter:a(e.autoFilter,"0"),pivotTables:a(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=a(e.objects===!1,"1"),l.scenarios=a(e.scenarios===!1,"1")),m.some(l,r=>r!==void 0)&&t.leafNode(this.tag,l)}}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(s,T,S){const m=s("../../../utils/col-cache"),o=s("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends o{get tag(){return"sheetView"}prepare(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(f,u,d){d&&n.addAttribute(f,u)};let l,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,l=t.topLeftCell||m.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:l,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:a[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(t.activePane=this.pane.activePane),e=this.selections[this.pane.activePane],e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},e=this.selections.topLeft,e&&e.activeCell&&(t.activeCell=e.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tablePart"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../../utils/col-cache"),a=s("../../../utils/xml-stream"),n=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),r=s("./row-xform"),i=s("./col-xform"),c=s("./dimension-xform"),f=s("./hyperlink-xform"),u=s("./merge-cell-xform"),d=s("./data-validations-xform"),h=s("./sheet-properties-xform"),v=s("./sheet-format-properties-xform"),_=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),N=s("./page-margins-xform"),L=s("./page-setup-xform"),j=s("./print-options-xform"),P=s("./auto-filter-xform"),D=s("./picture-xform"),H=s("./drawing-xform"),B=s("./table-part-xform"),x=s("./row-breaks-xform"),M=s("./header-footer-xform"),w=s("./cf/conditional-formattings-xform"),p=s("./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,$)=>{Object.keys($).forEach(E=>{const C=O[E],F=$[E];C===void 0&&F!==void 0&&(O[E]=F)})})(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 h,dimension:new c,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new _}),sheetFormatPr:new v,cols:new l({tag:"cols",count:!1,childXform:new i}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new r({maxItems:I}),maxItems:R}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new x,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new f}),pageMargins:new N,dataValidations:new d,pageSetup:new L,headerFooter:new M,printOptions:new j,picture:new D,drawing:new H,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new w,extLst:new p}}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 $=z(I);O.rId=$,I.push({Id:$,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 $={Id:z(I),Type:n.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};I.push($),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 $=z(I);q=R.media[O.imageId],I.push({Id:$,Type:n.Image,Target:`../media/${q.name}.${q.extension}`}),k.background={rId:$},k.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:$}=k;q=R.media[O.imageId],$||($=k.drawing={rId:z(I),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push($),I.push({Id:$.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${$.name}.xml`}));let E=this.preImageId===O.imageId?U[O.imageId]:U[$.rels.length];E||(E=z($.rels),U[$.rels.length]=E,$.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 F=z($.rels);U[$.rels.length]=F,C.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:F},$.rels.push({Id:F,Type:n.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,$.anchors.push(C)}}),k.tables.forEach(O=>{const $=z(I);O.rId=$,I.push({Id:$,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(a.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($=>{$.Type===n.VmlDrawing&&k.leafNode("legacyDrawing",{"r:id":$.Id})}),k.closeNode()}parseOpen(k){return this.parser?(this.parser.parseOpen(k),!0):k.name==="worksheet"?(m.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(($,E)=>{$.note=Object.assign({},$.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 $={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};k.media.push($)}})}}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(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,a){a&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch(n){return""}},this._parse=o.parse||function(a){return new Date(a)}}render(o,a){a&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(a)):o.writeText(this._format(a)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,a){(a||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,a){a!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,S){const m=s("./base-xform"),o=s("../../utils/xml-stream");T.exports=class extends m{constructor(a){super(),this._model=a}render(a){if(!this._xml){const n=new o;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(r=>{t(e,r)}),l.t&&e.writeText(l.t),e.closeNode()})(n,this._model),this._xml=n.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){switch(a){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(s,T,S){const m=s("./text-xform"),o=s("./rich-text-xform"),a=s("../base-xform");T.exports=class extends a{constructor(){super(),this.map={r:new o,t:new m}}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(l=>{e.render(n,l)})}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(s,T,S){const m=s("./text-xform"),o=s("../style/font-xform"),a=s("../base-xform");class n extends a{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new m)}get fontXform(){return this._fontXform||(this._fontXform=new o(n.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}n.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=n},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,T,S){const m=s("./text-xform"),o=s("./rich-text-xform"),a=s("./phonetic-text-xform"),n=s("../base-xform");T.exports=class extends n{constructor(t){super(),this.model=t,this.map={r:new o,t:new m,rPh:new a}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):e!=null&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("./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 a)}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(m.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(l=>{e.render(n,l)}),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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"t"}render(o,a){o.openNode("t"),/^\s|\n|\s$/.test(a)&&o.addAttribute("xml:space","preserve"),o.writeText(a),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(o){switch(o.name){case"t":return this._text=[],!0;default:return!1}}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,S){const m=s("../../../doc/enums"),o=s("../../../utils/utils"),a=s("../base-xform"),n={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),vertical(e){return e==="middle"?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case"vertical":return e;default:return(e=o.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=o.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return m.ReadingOrder.LeftToRight;case"rtl":return m.ReadingOrder.RightToLeft;default:return}}},t={toXml(e){if(e=n.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=o.validInt(e);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};T.exports=class extends a{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let r=!1;function i(c,f){f&&(e.addAttribute(c,f),r=!0)}i("horizontal",n.horizontal(l.horizontal)),i("vertical",n.vertical(l.vertical)),i("wrapText",!!n.wrapText(l.wrapText)&&"1"),i("shrinkToFit",!!n.shrinkToFit(l.shrinkToFit)&&"1"),i("indent",n.indent(l.indent)),i("textRotation",t.toXml(l.textRotation)),i("readingOrder",n.readingOrder(l.readingOrder)),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const l={};let r=!1;function i(c,f,u){c&&(l[f]=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?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,T,S){const m=s("../base-xform"),o=s("../../../utils/utils"),a=s("./color-xform");class n extends m{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,l,r){const i=l&&l.color||r||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),i&&this.map.color.render(e,i)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return 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 m{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:l}=e;function r(i,c){i&&!i.color&&e.color&&(i=Ee(ye({},i),{color:e.color})),c.render(t,i,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),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={},l=function(r,i,c){i&&(c&&Object.assign(i,c),e[r]=i)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,a){return!!a&&(o.openNode(this.name),a.argb?o.addAttribute("rgb",a.argb):a.theme!==void 0?(o.addAttribute("theme",a.theme),a.tint!==void 0&&o.addAttribute("tint",a.tint)):a.indexed!==void 0?o.addAttribute("indexed",a.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(s,T,S){const m=s("../base-xform"),o=s("./alignment-xform"),a=s("./border-xform"),n=s("./fill-xform"),t=s("./font-xform"),e=s("./numfmt-xform"),l=s("./protection-xform");T.exports=class extends m{constructor(){super(),this.map={alignment:new o,border:new a,fill:new n,font:new t,numFmt:new e,protection:new l}}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(s,T,S){const m=s("../base-xform"),o=s("./color-xform");class a extends m{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 m{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 m{constructor(){super(),this.map={stop:new a}}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(f=>{c.render(r,f)}),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 m{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((l,r)=>(l[r]=!0,l),{}),e.StopXform=a,e.PatternFillXform=n,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,T,S){const m=s("./color-xform"),o=s("../simple/boolean-xform"),a=s("../simple/integer-xform"),n=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class r extends l{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 a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new m},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new 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 a({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,f){const{map:u}=this;c.openNode(this.options.tagName),e.each(this.map,(d,h)=>{u[h].xform.render(c,f[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 f=this.map[c];return this.parser.model&&(this.model[f.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(s,T,S){const m=s("../../../utils/under-dash"),o=s("../../defaultnumformats"),a=s("../base-xform"),n=function(){const e={};return m.each(o,(l,r)=>{l.f&&(e[l.f]=parseInt(r,10))}),e}();class t extends a{constructor(l,r){super(),this.id=l,this.formatCode=r}get tag(){return"numFmt"}render(l,r){l.leafNode("numFmt",{numFmtId:r.id,formatCode:r.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return 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(s,T,S){const m=s("../base-xform"),o={boolean:(a,n)=>a===void 0?n:a};T.exports=class extends m{get tag(){return"protection"}render(a,n){a.addRollback(),a.openNode("protection");let t=!1;function e(l,r){r!==void 0&&(a.addAttribute(l,r),t=!0)}e("locked",o.boolean(n.locked,!0)?void 0:"0"),e("hidden",o.boolean(n.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){const n={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!n.locked||n.hidden;this.model=t?n:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,T,S){const m=s("../base-xform"),o=s("./alignment-xform"),a=s("./protection-xform");T.exports=class extends m{constructor(n){super(),this.xfId=!(!n||!n.xfId),this.map={alignment:new o,protection:new a}}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(s,T,S){const m=s("../../../doc/enums"),o=s("../../../utils/xml-stream"),a=s("../base-xform"),n=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),r=s("./border-xform"),i=s("./numfmt-xform"),c=s("./style-xform"),f=s("./dxf-xform");class u extends a{constructor(h){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new i}),fonts:new t({tag:"fonts",count:!0,childXform:new e,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new 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 f}),numFmt:new i,font:new e,fill:new l,border:new r,style:new c({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},h&&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(h,v){v=v||this.model,h.openXml(o.StdDocAttributes),h.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(v.numFmts&&v.numFmts.length&&(h.openNode("numFmts",{count:v.numFmts.length}),v.numFmts.forEach(_=>{h.writeXml(_)}),h.closeNode()),v.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),h.openNode("fonts",{count:v.fonts.length,"x14ac:knownFonts":1}),v.fonts.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("fills",{count:v.fills.length}),v.fills.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("borders",{count:v.borders.length}),v.borders.forEach(_=>{h.writeXml(_)}),h.closeNode(),this.map.cellStyleXfs.render(h,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),h.openNode("cellXfs",{count:v.styles.length}),v.styles.forEach(_=>{h.writeXml(_)}),h.closeNode()):(this.map.numFmts.render(h,v.numFmts),this.map.fonts.render(h,v.fonts),this.map.fills.render(h,v.fills),this.map.borders.render(h,v.borders),this.map.cellStyleXfs.render(h,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(h,v.styles)),u.STATIC_XFORMS.cellStyles.render(h),this.map.dxfs.render(h,v.dxfs),u.STATIC_XFORMS.tableStyles.render(h),u.STATIC_XFORMS.extLst.render(h),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;switch(h.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h),!0}}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser)return this.parser.parseClose(h)||(this.parser=void 0),!0;switch(h){case"styleSheet":{this.model={};const v=(_,A)=>{A.model&&A.model.length&&(this.model[_]=A.model)};if(v("numFmts",this.map.numFmts),v("fonts",this.map.fonts),v("fills",this.map.fills),v("borders",this.map.borders),v("styles",this.map.cellXfs),v("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const _=this.index.numFmt;this.model.numFmts.forEach(A=>{_[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(h,v){if(!h)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(h))return this.weakMap.get(h);const _={};if(v=v||m.ValueType.Number,h.numFmt)_.numFmtId=this._addNumFmtStr(h.numFmt);else switch(v){case m.ValueType.Number:_.numFmtId=this._addNumFmtStr("General");break;case m.ValueType.Date:_.numFmtId=this._addNumFmtStr("mm-dd-yy")}h.font&&(_.fontId=this._addFont(h.font)),h.border&&(_.borderId=this._addBorder(h.border)),h.fill&&(_.fillId=this._addFill(h.fill)),h.alignment&&(_.alignment=h.alignment),h.protection&&(_.protection=h.protection);const A=this._addStyle(_);return this.weakMap&&this.weakMap.set(h,A),A}getStyleModel(h){const v=this.model.styles[h];if(!v)return null;let _=this.index.model[h];if(_)return _;if(_=this.index.model[h]={},v.numFmtId){const N=this.index.numFmt[v.numFmtId]||i.getDefaultFmtCode(v.numFmtId);N&&(_.numFmt=N)}function A(N,L,j){if(j||j===0){const P=L[j];P&&(_[N]=P)}}return A("font",this.model.fonts,v.fontId),A("border",this.model.borders,v.borderId),A("fill",this.model.fills,v.fillId),v.alignment&&(_.alignment=v.alignment),v.protection&&(_.protection=v.protection),_}addDxfStyle(h){return h.numFmt&&(h.numFmtId=this._addNumFmtStr(h.numFmt)),this.model.dxfs.push(h),this.model.dxfs.length-1}getDxfStyle(h){return this.model.dxfs[h]}_addStyle(h){const v=this.map.style.toXml(h);let _=this.index.style[v];return _===void 0&&(_=this.index.style[v]=this.model.styles.length,this.model.styles.push(v)),_}_addNumFmtStr(h){let v=i.getDefaultFmtId(h);if(v!==void 0||(v=this.index.numFmt[h],v!==void 0))return v;v=this.index.numFmt[h]=164+this.model.numFmts.length;const _=this.map.numFmt.toXml({id:v,formatCode:h});return this.model.numFmts.push(_),v}_addFont(h){const v=this.map.font.toXml(h);let _=this.index.font[v];return _===void 0&&(_=this.index.font[v]=this.model.fonts.length,this.model.fonts.push(v)),_}_addBorder(h){const v=this.map.border.toXml(h);let _=this.index.border[v];return _===void 0&&(_=this.index.border[v]=this.model.borders.length,this.model.borders.push(v)),_}_addFill(h){const v=this.map.fill.toXml(h);let _=this.index.fill[v];return _===void 0&&(_=this.index.fill[v]=this.model.fills.length,this.model.fills.push(v)),_}}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,h){switch(h){case m.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(s,T,S){const m=s("../base-xform");class o extends m{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(s,T,S){const m=s("../base-xform"),o=s("./filter-column-xform");T.exports=class extends m{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((n,t)=>{this.map.filterColumn.prepare(n,{index:t})})}render(a,n){return a.openNode(this.tag,{ref:n.autoFilterRef}),n.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.parseOpen(a),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(a))}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"customFilter"}render(o,a){o.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,S){const m=s("../base-xform"),o=s("../list-xform"),a=s("./custom-filter-xform"),n=s("./filter-xform");T.exports=class extends m{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new 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(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"filter"}render(o,a){o.leafNode(this.tag,{val:a.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tableColumn"}prepare(o,a){o.id=a.index+1}render(o,a){return o.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"tableStyleInfo"}render(o,a){return o.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,S){const m=s("../../../utils/xml-stream"),o=s("../base-xform"),a=s("../list-xform"),n=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends o{constructor(){super(),this.map={autoFilter:new n,tableColumns:new a({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(m.StdDocAttributes),i.openNode(this.tag,Ee(ye({},l.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:f}=i;switch(c){case this.tag:this.reset(),this.model={name:f.name,displayName:f.displayName||f.name,tableRef:f.ref,totalsRow:f.totalsRowCount==="1",headerRow:f.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,f)=>{this.model.columns[f].filterButton=c.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,c){i.columns.forEach(f=>{f.dxfId!==void 0&&(f.style=c.styles.getDxfStyle(f.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},T.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(s,T,S){(function(m,o){(function(){const a=s("fs"),n=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),r=s("../utils/utils"),i=s("../utils/xml-stream"),{bufferToString:c}=s("../utils/browser-buffer-decode"),f=s("./xform/style/styles-xform"),u=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),h=s("./xform/core/relationships-xform"),v=s("./xform/core/content-types-xform"),_=s("./xform/core/app-xform"),A=s("./xform/book/workbook-xform"),N=s("./xform/sheet/worksheet-xform"),L=s("./xform/drawing/drawing-xform"),j=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),D=s("./xform/comment/vml-notes-xform"),H=s("./xml/theme1");class B{constructor(M){this.workbook=M}readFile(M,w){return Kt(this,null,function*(){if(!(yield r.fs.exists(M)))throw new Error("File not found: "+M);const p=a.createReadStream(M);try{const b=yield this.read(p,w);return p.close(),b}catch(b){throw p.close(),b}})}parseRels(M){return new h().parseStream(M)}parseWorkbook(M){return new A().parseStream(M)}parseSharedStrings(M){return new d().parseStream(M)}reconcile(M,w){const p=new A,b=new N(w),g=new L,y=new j;p.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,$)=>(O[$.Id]=$,O),{}),(U.anchors||[]).forEach(O=>{const $=O.picture&&O.picture.hyperlinks;$&&k.rels[$.rId]&&($.hyperlink=k.rels[$.rId].Target,delete $.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}_processWorksheetEntry(M,w,p,b,g){return Kt(this,null,function*(){const y=new N(b),k=yield y.parseStream(M);k.sheetNo=p,w.worksheetHash[g]=k,w.worksheets.push(k)})}_processCommentEntry(M,w,p){return Kt(this,null,function*(){const b=new P,g=yield b.parseStream(M);w.comments[`../${p}.xml`]=g})}_processTableEntry(M,w,p){return Kt(this,null,function*(){const b=new j,g=yield b.parseStream(M);w.tables[`../tables/${p}.xml`]=g})}_processWorksheetRelsEntry(M,w,p){return Kt(this,null,function*(){const b=new h,g=yield b.parseStream(M);w.worksheetRels[p]=g})}_processMediaEntry(M,w,p){return Kt(this,null,function*(){const b=p.lastIndexOf(".");if(b>=1){const g=p.substr(b+1),y=p.substr(0,b);yield new Promise((k,R)=>{const I=new l;I.on("finish",()=>{w.mediaIndex[p]=w.media.length,w.mediaIndex[y]=w.media.length;const z={type:"image",name:y,extension:g,buffer:I.toBuffer()};w.media.push(z),k()}),M.on("error",z=>{R(z)}),M.pipe(I)})}})}_processDrawingEntry(M,w,p){return Kt(this,null,function*(){const b=new L,g=yield b.parseStream(M);w.drawings[p]=g})}_processDrawingRelsEntry(M,w,p){return Kt(this,null,function*(){const b=new h,g=yield b.parseStream(M);w.drawingRels[p]=g})}_processVmlDrawingEntry(M,w,p){return Kt(this,null,function*(){const b=new D,g=yield b.parseStream(M);w.vmlDrawings[`../drawings/${p}.vml`]=g})}_processThemeEntry(M,w,p){return Kt(this,null,function*(){yield new Promise((b,g)=>{const y=new l;M.on("error",g),y.on("error",g),y.on("finish",()=>{w.themes[p]=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")}read(M,w){return Kt(this,null,function*(){!M[Symbol.asyncIterator]&&M.pipe&&(M=M.pipe(new t));const p=[];try{for(var b=Ve(M),g,y,k;g=!(y=yield b.next()).done;g=!1){const R=y.value;p.push(R)}}catch(y){k=[y]}finally{try{g&&(y=b.return)&&(yield y.call(b))}finally{if(k)throw k[0]}}return this.load(o.concat(p),w)})}load(M,w){return Kt(this,null,function*(){let p;p=w&&w.base64?o.from(M.toString(),"base64"):M;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=yield n.loadAsync(p);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(yield y.async("nodebuffer"));else{let I;k=new t({writableObjectMode:!0,readableObjectMode:!0}),I=m.browser?c(yield y.async("nodebuffer")):yield y.async("string");const z=16384;for(let U=0;UKt(this,null,function*(){if(p.type==="image"){const b=`xl/media/${p.name}.${p.extension}`;if(p.filename){const g=yield function(y,k){return new Promise((R,I)=>{a.readFile(y,k,(z,U)=>{z?I(z):R(U)})})}(p.filename);return M.append(g,{name:b})}if(p.buffer)return M.append(p.buffer,{name:b});if(p.base64){const g=p.base64,y=g.substring(g.indexOf(",")+1);return M.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")})))})}addDrawings(M,w){const p=new L,b=new h;w.worksheets.forEach(g=>{const{drawing:y}=g;if(y){p.prepare(y,{});let k=p.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,w){const p=new j;w.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{p.prepare(y,{});const k=p.toXml(y);M.append(k,{name:"xl/tables/"+y.target})})})}addContentTypes(M,w){return Kt(this,null,function*(){const p=new v().toXml(w);M.append(p,{name:"[Content_Types].xml"})})}addApp(M,w){return Kt(this,null,function*(){const p=new _().toXml(w);M.append(p,{name:"docProps/app.xml"})})}addCore(M,w){return Kt(this,null,function*(){const p=new u;M.append(p.toXml(w),{name:"docProps/core.xml"})})}addThemes(M,w){return Kt(this,null,function*(){const p=w.themes||{theme1:H};Object.keys(p).forEach(b=>{const g=p[b],y=`xl/theme/${b}.xml`;M.append(g,{name:y})})})}addOfficeRels(M){return Kt(this,null,function*(){const w=new h().toXml([{Id:"rId1",Type:B.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:B.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:B.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);M.append(w,{name:"_rels/.rels"})})}addWorkbookRels(M,w){return Kt(this,null,function*(){let p=1;const b=[{Id:"rId"+p++,Type:B.RelType.Styles,Target:"styles.xml"},{Id:"rId"+p++,Type:B.RelType.Theme,Target:"theme/theme1.xml"}];w.sharedStrings.count&&b.push({Id:"rId"+p++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),w.worksheets.forEach(y=>{y.rId="rId"+p++,b.push({Id:y.rId,Type:B.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new h().toXml(b);M.append(g,{name:"xl/_rels/workbook.xml.rels"})})}addSharedStrings(M,w){return Kt(this,null,function*(){w.sharedStrings&&w.sharedStrings.count&&M.append(w.sharedStrings.xml,{name:"xl/sharedStrings.xml"})})}addStyles(M,w){return Kt(this,null,function*(){const{xml:p}=w.styles;p&&M.append(p,{name:"xl/styles.xml"})})}addWorkbook(M,w){return Kt(this,null,function*(){const p=new A;M.append(p.toXml(w),{name:"xl/workbook.xml"})})}addWorksheets(M,w){return Kt(this,null,function*(){const p=new N,b=new h,g=new P,y=new D;w.worksheets.forEach(k=>{let R=new i;p.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((w,p)=>{M.on("finish",()=>{w(this)}),M.on("error",p),M.finalize()})}prepareModel(M,w){M.creator=M.creator||"ExcelJS",M.lastModifiedBy=M.lastModifiedBy||"ExcelJS",M.created=M.created||new Date,M.modified=M.modified||new Date,M.useSharedStrings=w.useSharedStrings===void 0||w.useSharedStrings,M.useStyles=w.useStyles===void 0||w.useStyles,M.sharedStrings=new d,M.styles=M.useStyles?new f(!0):new f.Mock;const p=new A,b=new N;p.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)})}write(M,w){return Kt(this,null,function*(){w=w||{};const{model:p}=this.workbook,b=new e.ZipWriter(w.zip);return b.pipe(M),this.prepareModel(p,w),yield this.addContentTypes(b,p),yield this.addOfficeRels(b,p),yield this.addWorkbookRels(b,p),yield this.addWorksheets(b,p),yield this.addSharedStrings(b,p),yield this.addDrawings(b,p),yield this.addTables(b,p),yield Promise.all([this.addThemes(b,p),this.addStyles(b,p)]),yield this.addMedia(b,p),yield Promise.all([this.addApp(b,p),this.addCore(b,p)]),yield this.addWorkbook(b,p),this._finalize(b)})}writeFile(M,w){const p=a.createWriteStream(M);return new Promise((b,g)=>{p.on("finish",()=>{b()}),p.on("error",y=>{g(y)}),this.write(p,w).then(()=>{p.end()}).catch(y=>{g(y)})})}writeBuffer(M){return Kt(this,null,function*(){const w=new l;return yield this.write(w,M),w.read()})}}B.RelType=s("./rel-type"),T.exports=B}).call(this)}).call(this,s("_process"),s("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(s,T,S){T.exports=` `},{}],146:[function(s,T,S){(function(m){(function(){Object.defineProperty(S,"__esModule",{value:!0}),S.CsvFormatterStream=void 0;const o=s("stream"),a=s("./formatter");class n extends o.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new a.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,l,r){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(c,f)=>c?(i=!0,r(c)):(f&&f.forEach(u=>{this.push(m.from(u,"utf8"))}),i=!0,r()))}catch(c){if(i)throw c;r(c)}}_flush(e){this.rowFormatter.finish((l,r)=>l?e(l):(r&&r.forEach(i=>{this.push(m.from(i,"utf8"))}),e()))}}S.CsvFormatterStream=n}).call(this)}).call(this,s("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.FormatterOptions=void 0,S.FormatterOptions=class{constructor(){let m=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,m||{}),(m==null?void 0:m.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(m==null?void 0:m.quote)===!0?this.quote='"':(m==null?void 0:m.quote)===!1&&(this.quote=""),typeof(m==null?void 0:m.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((o=m.writeHeaders)===null||o===void 0||o),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(s,T,S){var m=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S,"__esModule",{value:!0}),S.FieldFormatter=void 0;const o=m(s("lodash.isboolean")),a=m(s("lodash.isnil")),n=m(s("lodash.escaperegexp"));S.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 l=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,e,l){const r=(""+(a.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,l)?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(s,T,S){var m=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(S,"__esModule",{value:!0}),S.RowFormatter=void 0;const o=m(s("lodash.isfunction")),a=m(s("lodash.isequal")),n=s("./FieldFormatter"),t=s("../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 f=null;try{f=r(i)}catch(u){return c(u)}return c(null,f)}:(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,f)=>{if(c)return i(c);if(!r)return i(null);const u=[];if(f){const{shouldFormatColumns:d,headers:h}=this.checkHeaders(f);if(this.shouldWriteHeaders&&h&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(h,!0)),this.hasWrittenHeaders=!0),d){const v=this.gatherColumns(f);u.push(this.formatColumns(v,!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:!a.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 f=r[c];return f?f[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:f}=this;return this.rowCount+=1,f?[this.formatterOptions.rowDelimiter,c].join(""):c}}S.RowFormatter=e},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.FieldFormatter=S.RowFormatter=void 0;var m=s("./RowFormatter");Object.defineProperty(S,"RowFormatter",{enumerable:!0,get:function(){return m.RowFormatter}});var o=s("./FieldFormatter");Object.defineProperty(S,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(s,T,S){(function(m){(function(){var o=Object.create?function(d,h,v,_){_===void 0&&(_=v),Object.defineProperty(d,_,{enumerable:!0,get:function(){return h[v]}})}:function(d,h,v,_){_===void 0&&(_=v),d[_]=h[v]},a=Object.create?function(d,h){Object.defineProperty(d,"default",{enumerable:!0,value:h})}:function(d,h){d.default=h},n=function(d){if(d&&d.__esModule)return d;var h={};if(d!=null)for(var v in d)v!=="default"&&Object.prototype.hasOwnProperty.call(d,v)&&o(h,d,v);return a(h,d),h},t=function(d,h){for(var v in d)v==="default"||Object.prototype.hasOwnProperty.call(h,v)||o(h,d,v)};Object.defineProperty(S,"__esModule",{value:!0}),S.writeToPath=S.writeToString=S.writeToBuffer=S.writeToStream=S.write=S.format=S.FormatterOptions=S.CsvFormatterStream=void 0;const e=s("util"),l=s("stream"),r=n(s("fs")),i=s("./FormatterOptions"),c=s("./CsvFormatterStream");t(s("./types"),S);var f=s("./CsvFormatterStream");Object.defineProperty(S,"CsvFormatterStream",{enumerable:!0,get:function(){return f.CsvFormatterStream}});var u=s("./FormatterOptions");Object.defineProperty(S,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),S.format=d=>new c.CsvFormatterStream(new i.FormatterOptions(d)),S.write=(d,h)=>{const v=S.format(h),_=e.promisify((A,N)=>{v.write(A,void 0,N)});return d.reduce((A,N)=>A.then(()=>_(N)),Promise.resolve()).then(()=>v.end()).catch(A=>{v.emit("error",A)}),v},S.writeToStream=(d,h,v)=>S.write(h,v).pipe(d),S.writeToBuffer=function(d){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const v=[],_=new l.Writable({write(A,N,L){v.push(A),L()}});return new Promise((A,N)=>{_.on("error",N).on("finish",()=>A(m.concat(v))),S.write(d,h).pipe(_)})},S.writeToString=(d,h)=>S.writeToBuffer(d,h).then(v=>v.toString()),S.writeToPath=(d,h,v)=>{const _=r.createWriteStream(d,{encoding:"utf8"});return S.write(h,v).pipe(_)}}).call(this)}).call(this,s("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.isSyncTransform=void 0,S.isSyncTransform=m=>m.length===1},{}],153:[function(s,T,S){(function(m){(function(){Object.defineProperty(S,"__esModule",{value:!0}),S.CsvParserStream=void 0;const o=s("string_decoder"),a=s("stream"),n=s("./transforms"),t=s("./parser");class e extends a.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),f=1;f{const d=_=>_?i(_):u%100!=0?f(u+1):void m(()=>f(u+1));if(this.checkAndEmitHeaders(),u>=c||this.hasHitRowLimit)return i();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const h=r[u];this.rowCount+=1,this.parsedRowCount+=1;const v=this.rowCount;return this.transformRow(h,(_,A)=>{if(_)return this.rowCount-=1,d(_);if(!A)return d(new Error("expected transform result"));if(A.isValid){if(A.row)return this.pushRow(A.row,d)}else this.emit("data-invalid",A.row,v,A.reason);return d()})};f(0)}transformRow(r,i){try{this.headerTransformer.transform(r,(c,f)=>c?i(c):f?f.isValid?f.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(f.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 f=arguments.length,u=new Array(f>1?f-1:0),d=1;d1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=o.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(s,T,S){var m=Object.create?function(f,u,d,h){h===void 0&&(h=d),Object.defineProperty(f,h,{enumerable:!0,get:function(){return u[d]}})}:function(f,u,d,h){h===void 0&&(h=d),f[h]=u[d]},o=Object.create?function(f,u){Object.defineProperty(f,"default",{enumerable:!0,value:u})}:function(f,u){f.default=u},a=function(f){if(f&&f.__esModule)return f;var u={};if(f!=null)for(var d in f)d!=="default"&&Object.prototype.hasOwnProperty.call(f,d)&&m(u,f,d);return o(u,f),u},n=function(f,u){for(var d in f)d==="default"||Object.prototype.hasOwnProperty.call(u,d)||m(u,f,d)};Object.defineProperty(S,"__esModule",{value:!0}),S.parseString=S.parseFile=S.parseStream=S.parse=S.ParserOptions=S.CsvParserStream=void 0;const t=a(s("fs")),e=s("stream"),l=s("./ParserOptions"),r=s("./CsvParserStream");n(s("./types"),S);var i=s("./CsvParserStream");Object.defineProperty(S,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var c=s("./ParserOptions");Object.defineProperty(S,"ParserOptions",{enumerable:!0,get:function(){return c.ParserOptions}}),S.parse=f=>new r.CsvParserStream(new l.ParserOptions(f)),S.parseStream=(f,u)=>f.pipe(new r.CsvParserStream(new l.ParserOptions(u))),S.parseFile=function(f){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(f).pipe(new r.CsvParserStream(new l.ParserOptions(u)))},S.parseString=(f,u)=>{const d=new e.Readable;return d.push(f),d.push(null),d.pipe(new r.CsvParserStream(new l.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Parser=void 0;const m=s("./Scanner"),o=s("./RowParser"),a=s("./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,l){const r=new m.Scanner({line:n.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(r):this.parseWithoutComments(r)}parseWithoutComments(e){const l=[];let r=!0;for(;r;)r=this.parseRow(e,l);return{line:e.line,rows:l}}parseWithComments(e){const{parserOptions:l}=this,r=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(a.Token.isTokenComment(i,l)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows: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,l){if(!e.nextNonSpaceToken)return!1;const r=this.rowParser.parse(e);return r!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(r)||l.push(r),!0)}}S.Parser=n},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.RowParser=void 0;const m=s("./column"),o=s("./Token");S.RowParser=class{constructor(a){this.parserOptions=a,this.columnParser=new m.ColumnParser(a)}static isEmptyRow(a){return a.join("").replace(/\s+/g,"")===""}parse(a){const{parserOptions:n}=this,{hasMoreData:t}=a,e=a,l=[];let r=this.getStartToken(e,l);for(;r;){if(o.Token.isTokenRowDelimiter(r))return e.advancePastToken(r),!e.hasMoreCharacters&&o.Token.isTokenCarriageReturn(r,n)&&t?null:(e.truncateToCursor(),l);if(!this.shouldSkipColumnParse(e,r,l)){const i=this.columnParser.parse(e);if(i===null)return null;l.push(i)}r=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),l)}getStartToken(a,n){const t=a.nextNonSpaceToken;return t!==null&&o.Token.isTokenDelimiter(t,this.parserOptions)?(n.push(""),a.nextNonSpaceToken):t}shouldSkipColumnParse(a,n,t){const{parserOptions:e}=this;if(o.Token.isTokenDelimiter(n,e)){a.advancePastToken(n);const l=a.nextCharacterToken;if(!a.hasMoreCharacters||l!==null&&o.Token.isTokenRowDelimiter(l)||l!==null&&o.Token.isTokenDelimiter(l,e))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Scanner=void 0;const m=s("./Token"),o=/((?:\r\n)|\n|\r)/;S.Scanner=class{constructor(a){this.cursor=0,this.line=a.line,this.lineLength=this.line.length,this.parserOptions=a.parserOptions,this.hasMoreData=a.hasMoreData,this.cursor=a.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:a}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(a.search(n)===-1)return null;const t=n.exec(a);if(t==null)return null;const e=t[1],l=this.cursor+(t.index||0);return new m.Token({token:e,startCursor:l,endCursor:l+e.length-1})}get nextCharacterToken(){const{cursor:a,lineLength:n}=this;return n<=a?null:new m.Token({token:this.line[a],startCursor:a,endCursor:a})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const a=o.exec(this.lineFromCursor);return a?(this.cursor+=(a.index||0)+a[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(a){return this.cursor=a,this}advanceToToken(a){return this.cursor=a.startCursor,this}advancePastToken(a){return this.cursor=a.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.Token=void 0,S.Token=class{constructor(m){this.token=m.token,this.startCursor=m.startCursor,this.endCursor=m.endCursor}static isTokenRowDelimiter(m){const o=m.token;return o==="\r"||o===` `||o===`\r `}static isTokenCarriageReturn(m,o){return m.token===o.carriageReturn}static isTokenComment(m,o){return o.supportsComments&&!!m&&m.token===o.comment}static isTokenEscapeCharacter(m,o){return m.token===o.escapeChar}static isTokenQuote(m,o){return m.token===o.quote}static isTokenDelimiter(m,o){return m.token===o.delimiter}}},{}],160:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnFormatter=void 0,S.ColumnFormatter=class{constructor(m){m.trim?this.format=o=>o.trim():m.ltrim?this.format=o=>o.trimLeft():m.rtrim?this.format=o=>o.trimRight():this.format=o=>o}}},{}],161:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnParser=void 0;const m=s("./NonQuotedColumnParser"),o=s("./QuotedColumnParser"),a=s("../Token");S.ColumnParser=class{constructor(n){this.parserOptions=n,this.quotedColumnParser=new o.QuotedColumnParser(n),this.nonQuotedColumnParser=new m.NonQuotedColumnParser(n)}parse(n){const{nextNonSpaceToken:t}=n;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(n.advanceToToken(t),this.quotedColumnParser.parse(n)):this.nonQuotedColumnParser.parse(n)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.NonQuotedColumnParser=void 0;const m=s("./ColumnFormatter"),o=s("../Token");S.NonQuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new m.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const{parserOptions:n}=this,t=[];let e=a.nextCharacterToken;for(;e&&!o.Token.isTokenDelimiter(e,n)&&!o.Token.isTokenRowDelimiter(e);e=a.nextCharacterToken)t.push(e.token),a.advancePastToken(e);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.QuotedColumnParser=void 0;const m=s("./ColumnFormatter"),o=s("../Token");S.QuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new m.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const n=a.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(a);if(!t){if(a.advanceTo(n),!a.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${a.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(a),e}gatherDataBetweenQuotes(a){const{parserOptions:n}=this;let t=!1,e=!1;const l=[];let r=a.nextCharacterToken;for(;!e&&r!==null;r=a.nextCharacterToken){const i=o.Token.isTokenQuote(r,n);if(!t&&i)t=!0;else if(t)if(o.Token.isTokenEscapeCharacter(r,n)){a.advancePastToken(r);const c=a.nextCharacterToken;c!==null&&(o.Token.isTokenQuote(c,n)||o.Token.isTokenEscapeCharacter(c,n))?(l.push(c.token),r=c):i?e=!0:l.push(r.token)}else i?e=!0:l.push(r.token);a.advancePastToken(r)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:e}}checkForMalformedColumn(a){const{parserOptions:n}=this,{nextNonSpaceToken:t}=a;if(t){const e=o.Token.isTokenDelimiter(t,n),l=o.Token.isTokenRowDelimiter(t);if(!e&&!l){const r=a.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}`)}a.advanceToToken(t)}else a.hasMoreData||a.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnFormatter=S.QuotedColumnParser=S.NonQuotedColumnParser=S.ColumnParser=void 0;var m=s("./ColumnParser");Object.defineProperty(S,"ColumnParser",{enumerable:!0,get:function(){return m.ColumnParser}});var o=s("./NonQuotedColumnParser");Object.defineProperty(S,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var a=s("./QuotedColumnParser");Object.defineProperty(S,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var n=s("./ColumnFormatter");Object.defineProperty(S,"ColumnFormatter",{enumerable:!0,get:function(){return n.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.QuotedColumnParser=S.NonQuotedColumnParser=S.ColumnParser=S.Token=S.Scanner=S.RowParser=S.Parser=void 0;var m=s("./Parser");Object.defineProperty(S,"Parser",{enumerable:!0,get:function(){return m.Parser}});var o=s("./RowParser");Object.defineProperty(S,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var a=s("./Scanner");Object.defineProperty(S,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var n=s("./Token");Object.defineProperty(S,"Token",{enumerable:!0,get:function(){return n.Token}});var t=s("./column");Object.defineProperty(S,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(S,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(S,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(s,T,S){var m=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0}),S.HeaderTransformer=void 0;const o=m(s("lodash.isundefined")),a=m(s("lodash.isfunction")),n=m(s("lodash.uniq")),t=m(s("lodash.groupby"));S.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,l){return this.shouldMapRow(e)?l(null,this.processRow(e)):l(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&e.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return l.strictColumnHandling&&e.length!!i);if(n.default(r).length!==r.length){const i=t.default(r),c=Object.keys(i).filter(f=>i[f].length>1);throw new Error("Duplicate headers found "+JSON.stringify(c))}this.headers=e,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(s,T,S){var m=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S,"__esModule",{value:!0}),S.RowTransformerValidator=void 0;const o=m(s("lodash.isfunction")),a=s("../types");class n{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(l,r)=>{let i=null;try{i=e(l)}catch(c){return r(c)}return r(null,i)}:e}static createValidator(e){return a.isSyncValidate(e)?(l,r)=>{r(null,{row:l,isValid:e(l)})}:(l,r)=>{e(l,(i,c,f)=>i?r(i):r(null,c?{row:l,isValid:c,reason:f}:{row:l,isValid:!1,reason:f}))}}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,l){return this.callTransformer(e,(r,i)=>r?l(r):i?this.callValidator(i,(c,f)=>c?l(c):f&&!f.isValid?l(null,{row:i,isValid:!1,reason:f.reason}):l(null,{row:i,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(e,l){return this._rowTransform?this._rowTransform(e,l):l(null,e)}callValidator(e,l){return this._rowValidator?this._rowValidator(e,l):l(null,{row:e,isValid:!0})}}S.RowTransformerValidator=n},{"../types":169,"lodash.isfunction":446}],168:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.HeaderTransformer=S.RowTransformerValidator=void 0;var m=s("./RowTransformerValidator");Object.defineProperty(S,"RowTransformerValidator",{enumerable:!0,get:function(){return m.RowTransformerValidator}});var o=s("./HeaderTransformer");Object.defineProperty(S,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.isSyncValidate=S.isSyncTransform=void 0,S.isSyncTransform=m=>m.length===1,S.isSyncValidate=m=>m.length===1},{}],170:[function(s,T,S){const m=S;m.bignum=s("bn.js"),m.define=s("./asn1/api").define,m.base=s("./asn1/base"),m.constants=s("./asn1/constants"),m.decoders=s("./asn1/decoders"),m.encoders=s("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(s,T,S){const m=s("./encoders"),o=s("./decoders"),a=s("inherits");function n(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}S.define=function(t,e){return new n(t,e)},n.prototype._createNamed=function(t){const e=this.name;function l(r){this._initNamed(r,e)}return a(l,t),l.prototype._initNamed=function(r,i){t.call(this,r,i)},new l(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,l){return this._getDecoder(e).decode(t,l)},n.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(m[t])),this.encoders[t]},n.prototype.encode=function(t,e,l){return this._getEncoder(e).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(s,T,S){const m=s("inherits"),o=s("../base/reporter").Reporter,a=s("safer-buffer").Buffer;function n(e,l){o.call(this,l),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,l){if(Array.isArray(e))this.length=0,this.value=e.map(function(r){return t.isEncoderBuffer(r)||(r=new t(r,l)),this.length+=r.length,r},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return l.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return l.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}m(n,o),S.DecoderBuffer=n,n.isDecoderBuffer=function(e){return e instanceof n?!0:typeof e=="object"&&a.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"},n.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},n.prototype.restore=function(e){const l=new n(this.base);return l.offset=e.offset,l.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),l},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,l){if(!(this.offset+e<=this.length))return this.error(l||"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)},S.EncoderBuffer=t,t.isEncoderBuffer=function(e){return e instanceof t?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"},t.prototype.join=function(e,l){return e||(e=a.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,l),l+=r.length}):(typeof this.value=="number"?e[l]=this.value:typeof this.value=="string"?e.write(this.value,l):a.isBuffer(this.value)&&this.value.copy(e,l),l+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(s,T,S){const m=S;m.Reporter=s("./reporter").Reporter,m.DecoderBuffer=s("./buffer").DecoderBuffer,m.EncoderBuffer=s("./buffer").EncoderBuffer,m.Node=s("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(s,T,S){const m=s("../base/reporter").Reporter,o=s("../base/buffer").EncoderBuffer,a=s("../base/buffer").DecoderBuffer,n=s("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],e=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(i,c,f){const u={};this._baseState=u,u.name=f,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=l;const r=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const i=this._baseState,c={};r.forEach(function(u){c[u]=i[u]});const f=new this.constructor(c.parent);return f._baseState=c,f},l.prototype._wrap=function(){const i=this._baseState;e.forEach(function(c){this[c]=function(){const f=new this.constructor(this);return i.children.push(f),f[c].apply(f,arguments)}},this)},l.prototype._init=function(i){const c=this._baseState;n(c.parent===null),i.call(this),c.children=c.children.filter(function(f){return f._baseState.parent===this},this),n.equal(c.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(i){const c=this._baseState,f=i.filter(function(u){return u instanceof this.constructor},this);i=i.filter(function(u){return!(u instanceof this.constructor)},this),f.length!==0&&(n(c.children===null),c.children=f,f.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(h){h==(0|h)&&(h|=0);const v=u[h];d[v]=h}),d}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(i){l.prototype[i]=function(){const c=this._baseState;throw new Error(i+" not implemented for encoding: "+c.enc)}}),t.forEach(function(i){l.prototype[i]=function(){const c=this._baseState,f=Array.prototype.slice.call(arguments);return n(c.tag===null),c.tag=i,this._useArgs(f),this}}),l.prototype.use=function(i){n(i);const c=this._baseState;return n(c.use===null),c.use=i,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(i){const c=this._baseState;return n(c.default===null),c.default=i,c.optional=!0,this},l.prototype.explicit=function(i){const c=this._baseState;return n(c.explicit===null&&c.implicit===null),c.explicit=i,this},l.prototype.implicit=function(i){const c=this._baseState;return n(c.explicit===null&&c.implicit===null),c.implicit=i,this},l.prototype.obj=function(){const i=this._baseState,c=Array.prototype.slice.call(arguments);return i.obj=!0,c.length!==0&&this._useArgs(c),this},l.prototype.key=function(i){const c=this._baseState;return n(c.key===null),c.key=i,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(i){const c=this._baseState;return n(c.choice===null),c.choice=i,this._useArgs(Object.keys(i).map(function(f){return i[f]})),this},l.prototype.contains=function(i){const c=this._baseState;return n(c.use===null),c.contains=i,this},l.prototype._decode=function(i,c){const f=this._baseState;if(f.parent===null)return i.wrapResult(f.children[0]._decode(i,c));let u,d=f.default,h=!0,v=null;if(f.key!==null&&(v=i.enterKey(f.key)),f.optional){let _=null;if(f.explicit!==null?_=f.explicit:f.implicit!==null?_=f.implicit:f.tag!==null&&(_=f.tag),_!==null||f.any){if(h=this._peekTag(i,_,f.any),i.isError(h))return h}else{const A=i.save();try{f.choice===null?this._decodeGeneric(f.tag,i,c):this._decodeChoice(i,c),h=!0}catch(N){h=!1}i.restore(A)}}if(f.obj&&h&&(u=i.enterObject()),h){if(f.explicit!==null){const A=this._decodeTag(i,f.explicit);if(i.isError(A))return A;i=A}const _=i.offset;if(f.use===null&&f.choice===null){let A;f.any&&(A=i.save());const N=this._decodeTag(i,f.implicit!==null?f.implicit:f.tag,f.any);if(i.isError(N))return N;f.any?d=i.raw(A):i=N}if(c&&c.track&&f.tag!==null&&c.track(i.path(),_,i.length,"tagged"),c&&c.track&&f.tag!==null&&c.track(i.path(),i.offset,i.length,"content"),f.any||(d=f.choice===null?this._decodeGeneric(f.tag,i,c):this._decodeChoice(i,c)),i.isError(d))return d;if(f.any||f.choice!==null||f.children===null||f.children.forEach(function(A){A._decode(i,c)}),f.contains&&(f.tag==="octstr"||f.tag==="bitstr")){const A=new a(d);d=this._getUse(f.contains,i._reporterState.obj)._decode(A,c)}}return f.obj&&h&&(d=i.leaveObject(u)),f.key===null||d===null&&h!==!0?v!==null&&i.exitKey(v):i.leaveKey(v,f.key,d),d},l.prototype._decodeGeneric=function(i,c,f){const u=this._baseState;return i==="seq"||i==="set"?null:i==="seqof"||i==="setof"?this._decodeList(c,i,u.args[0],f):/str$/.test(i)?this._decodeStr(c,i,f):i==="objid"&&u.args?this._decodeObjid(c,u.args[0],u.args[1],f):i==="objid"?this._decodeObjid(c,null,null,f):i==="gentime"||i==="utctime"?this._decodeTime(c,i,f):i==="null_"?this._decodeNull(c,f):i==="bool"?this._decodeBool(c,f):i==="objDesc"?this._decodeStr(c,i,f):i==="int"||i==="enum"?this._decodeInt(c,u.args&&u.args[0],f):u.use!==null?this._getUse(u.use,c._reporterState.obj)._decode(c,f):c.error("unknown tag: "+i)},l.prototype._getUse=function(i,c){const f=this._baseState;return f.useDecoder=this._use(i,c),n(f.useDecoder._baseState.parent===null),f.useDecoder=f.useDecoder._baseState.children[0],f.implicit!==f.useDecoder._baseState.implicit&&(f.useDecoder=f.useDecoder.clone(),f.useDecoder._baseState.implicit=f.implicit),f.useDecoder},l.prototype._decodeChoice=function(i,c){const f=this._baseState;let u=null,d=!1;return Object.keys(f.choice).some(function(h){const v=i.save(),_=f.choice[h];try{const A=_._decode(i,c);if(i.isError(A))return!1;u={type:h,value:A},d=!0}catch(A){return i.restore(v),!1}return!0},this),d?u:i.error("Choice not matched")},l.prototype._createEncoderBuffer=function(i){return new o(i,this.reporter)},l.prototype._encode=function(i,c,f){const u=this._baseState;if(u.default!==null&&u.default===i)return;const d=this._encodeValue(i,c,f);return d===void 0||this._skipDefault(d,c,f)?void 0:d},l.prototype._encodeValue=function(i,c,f){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(i,c||new m);let d=null;if(this.reporter=c,u.optional&&i===void 0){if(u.default===null)return;i=u.default}let h=null,v=!1;if(u.any)d=this._createEncoderBuffer(i);else if(u.choice)d=this._encodeChoice(i,c);else if(u.contains)h=this._getUse(u.contains,f)._encode(i,c),v=!0;else if(u.children)h=u.children.map(function(_){if(_._baseState.tag==="null_")return _._encode(null,c,i);if(_._baseState.key===null)return c.error("Child should have a key");const A=c.enterKey(_._baseState.key);if(typeof i!="object")return c.error("Child expected, but input is not object");const N=_._encode(i[_._baseState.key],c,i);return c.leaveKey(A),N},this).filter(function(_){return _}),h=this._createEncoderBuffer(h);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 _=this.clone();_._baseState.implicit=null,h=this._createEncoderBuffer(i.map(function(A){const N=this._baseState;return this._getUse(N.args[0],i)._encode(A,c)},_))}else u.use!==null?d=this._getUse(u.use,f)._encode(i,c):(h=this._encodePrimitive(u.tag,i),v=!0);if(!u.any&&u.choice===null){const _=u.implicit!==null?u.implicit:u.tag,A=u.implicit===null?"universal":"context";_===null?u.use===null&&c.error("Tag could be omitted only for .use()"):u.use===null&&(d=this._encodeComposite(_,v,A,h))}return u.explicit!==null&&(d=this._encodeComposite(u.explicit,!1,"context",d)),d},l.prototype._encodeChoice=function(i,c){const f=this._baseState,u=f.choice[i.type];return u||n(!1,i.type+" not found in "+JSON.stringify(Object.keys(f.choice))),u._encode(i.value,c)},l.prototype._encodePrimitive=function(i,c){const f=this._baseState;if(/str$/.test(i))return this._encodeStr(c,i);if(i==="objid"&&f.args)return this._encodeObjid(c,f.reverseArgs[0],f.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,f.args&&f.reverseArgs[0]);if(i==="bool")return this._encodeBool(c);if(i==="objDesc")return this._encodeStr(c,i);throw new Error("Unsupported tag: "+i)},l.prototype._isNumstr=function(i){return/^[0-9 ]*$/.test(i)},l.prototype._isPrintstr=function(i){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(i)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(s,T,S){const m=s("inherits");function o(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}function a(n,t){this.path=n,this.rethrow(t)}S.Reporter=o,o.prototype.isError=function(n){return n instanceof a},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 l=this._reporterState;this.exitKey(n),l.obj!==null&&(l.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,l=n instanceof a;if(t=l?n:new a(e.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),n.message||n,n.stack),!e.options.partial)throw t;return l||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},m(a,Error),a.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(s,T,S){function m(o){const a={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];a[t]=n}),a}S.tagClass={0:"universal",1:"application",2:"context",3:"private"},S.tagClassByName=m(S.tagClass),S.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"},S.tagByName=m(S.tag)},{}],177:[function(s,T,S){const m=S;m._reverse=function(o){const a={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];a[t]=n}),a},m.der=s("./der")},{"./der":176}],178:[function(s,T,S){const m=s("inherits"),o=s("bn.js"),a=s("../base/buffer").DecoderBuffer,n=s("../base/node"),t=s("../constants/der");function e(c){this.enc="der",this.name=c.name,this.entity=c,this.tree=new l,this.tree._init(c.body)}function l(c){n.call(this,"der",c)}function r(c,f){let u=c.readUInt8(f);if(c.isError(u))return u;const d=t.tagClass[u>>6],h=(32&u)==0;if((31&u)==31){let v=u;for(u=0;(128&v)==128;){if(v=c.readUInt8(f),c.isError(v))return v;u<<=7,u|=127&v}}else u&=31;return{cls:d,primitive:h,tag:u,tagStr:t.tag[u]}}function i(c,f,u){let d=c.readUInt8(u);if(c.isError(d))return d;if(!f&&d===128)return null;if(!(128&d))return d;const h=127&d;if(h>4)return c.error("length octect is too long");d=0;for(let v=0;v=31?N.error("Multi-octet tag encoding unsupported"):(_||(L|=32),L|=n.tagClassByName[A||"universal"]<<6,L)}(r,i,c,this.reporter);if(f.length<128){const v=o.alloc(2);return v[0]=u,v[1]=f.length,this._createEncoderBuffer([v,f])}let d=1;for(let v=f.length;v>=256;v>>=8)d++;const h=o.alloc(2+d);h[0]=u,h[1]=128|d;for(let v=1+d,_=f.length;_>0;v--,_>>=8)h[v]=255&_;return this._createEncoderBuffer([h,f])},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 f=0;f=40)return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}let f=0;for(let h=0;h=128;v>>=7)f++}const u=o.alloc(f);let d=u.length-1;for(let h=r.length-1;h>=0;h--){let v=r[h];for(u[d--]=127&v;(v>>=7)>0;)u[d--]=128|127&v}return this._createEncoderBuffer(u)},e.prototype._encodeTime=function(r,i){let c;const f=new Date(r);return i==="gentime"?c=[l(f.getUTCFullYear()),l(f.getUTCMonth()+1),l(f.getUTCDate()),l(f.getUTCHours()),l(f.getUTCMinutes()),l(f.getUTCSeconds()),"Z"].join(""):i==="utctime"?c=[l(f.getUTCFullYear()%100),l(f.getUTCMonth()+1),l(f.getUTCDate()),l(f.getUTCHours()),l(f.getUTCMinutes()),l(f.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 f=new Array(c);for(let u=f.length-1;u>=0;u--)f[u]=255&r,r>>=8;return 128&f[0]&&f.unshift(0),this._createEncoderBuffer(o.from(f))},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 f=this._baseState;let u;if(f.default===null)return!1;const d=r.join();if(f.defaultBuffer===void 0&&(f.defaultBuffer=this._encodeValue(f.default,i,c).join()),d.length!==f.defaultBuffer.length)return!1;for(u=0;u=65&&w<=70?w-55:w>=97&&w<=102?w-87:w-48&15}function r(x,M,w){var p=l(x,w);return w-1>=M&&(p|=l(x,w-1)<<4),p}function i(x,M,w,p){for(var b=0,g=Math.min(x.length,w),y=M;y=49?k-49+10:k>=17?k-17+10:k}return b}t.isBN=function(x){return x instanceof t||x!==null&&typeof x=="object"&&x.constructor.wordSize===t.wordSize&&Array.isArray(x.words)},t.max=function(x,M){return x.cmp(M)>0?x:M},t.min=function(x,M){return x.cmp(M)<0?x:M},t.prototype._init=function(x,M,w){if(typeof x=="number")return this._initNumber(x,M,w);if(typeof x=="object")return this._initArray(x,M,w);M==="hex"&&(M=16),a(M===(0|M)&&M>=2&&M<=36);var p=0;(x=x.toString().replace(/\s+/g,""))[0]==="-"&&(p++,this.negative=1),p=0;p-=3)g=x[p]|x[p-1]<<8|x[p-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(w==="le")for(p=0,b=0;p>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(x,M,w){this.length=Math.ceil((x.length-M)/6),this.words=new Array(this.length);for(var p=0;p=M;p-=2)b=r(x,M,p)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(p=(x.length-M)%2==0?M+1:M;p=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(x,M,w){this.words=[0],this.length=1;for(var p=0,b=1;b<=67108863;b*=M)p++;p--,b=b/M|0;for(var g=x.length-w,y=g%p,k=Math.min(g,g-y)+w,R=0,I=w;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"],f=[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(x,M,w){w.negative=M.negative^x.negative;var p=x.length+M.length|0;w.length=p,p=p-1|0;var b=0|x.words[0],g=0|M.words[0],y=b*g,k=67108863&y,R=y/67108864|0;w.words[0]=k;for(var I=1;I>>26,U=67108863&R,q=Math.min(I,M.length-1),O=Math.max(0,I-x.length+1);O<=q;O++){var $=I-O|0;z+=(y=(b=0|x.words[$])*(g=0|M.words[O])+U)/67108864|0,U=67108863&y}w.words[I]=0|U,R=0|z}return R!==0?w.words[I]=0|R:w.length--,w.strip()}t.prototype.toString=function(x,M){var w;if(M=0|M||1,(x=x||10)===16||x==="hex"){w="";for(var p=0,b=0,g=0;g>>24-p&16777215)!==0||g!==this.length-1?c[6-k.length]+k+w:k+w,(p+=2)>=26&&(p-=26,g--)}for(b!==0&&(w=b.toString(16)+w);w.length%M!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(x===(0|x)&&x>=2&&x<=36){var R=f[x],I=u[x];w="";var z=this.clone();for(z.negative=0;!z.isZero();){var U=z.modn(I).toString(x);w=(z=z.idivn(I)).isZero()?U+w:c[R-U.length]+U+w}for(this.isZero()&&(w="0"+w);w.length%M!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=67108864*this.words[1]:this.length===3&&this.words[2]===1?x+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(x,M){return a(e!==void 0),this.toArrayLike(e,x,M)},t.prototype.toArray=function(x,M){return this.toArrayLike(Array,x,M)},t.prototype.toArrayLike=function(x,M,w){var p=this.byteLength(),b=w||Math.max(1,p);a(p<=b,"byte array longer than desired length"),a(b>0,"Requested array length <= 0"),this.strip();var g,y,k=M==="le",R=new x(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&&(w+=13,M>>>=13),M>=64&&(w+=7,M>>>=7),M>=8&&(w+=4,M>>>=4),M>=2&&(w+=2,M>>>=2),w+M},t.prototype._zeroBits=function(x){if(x===0)return 26;var M=x,w=0;return!(8191&M)&&(w+=13,M>>>=13),!(127&M)&&(w+=7,M>>>=7),!(15&M)&&(w+=4,M>>>=4),!(3&M)&&(w+=2,M>>>=2),!(1&M)&&w++,w},t.prototype.bitLength=function(){var x=this.words[this.length-1],M=this._countBits(x);return 26*(this.length-1)+M},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,M=0;Mx.length?this.clone().ior(x):x.clone().ior(this)},t.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},t.prototype.iuand=function(x){var M;M=this.length>x.length?x:this;for(var w=0;wx.length?this.clone().iand(x):x.clone().iand(this)},t.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},t.prototype.iuxor=function(x){var M,w;this.length>x.length?(M=this,w=x):(M=x,w=this);for(var p=0;px.length?this.clone().ixor(x):x.clone().ixor(this)},t.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},t.prototype.inotn=function(x){a(typeof x=="number"&&x>=0);var M=0|Math.ceil(x/26),w=x%26;this._expand(M),w>0&&M--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-w),this.strip()},t.prototype.notn=function(x){return this.clone().inotn(x)},t.prototype.setn=function(x,M){a(typeof x=="number"&&x>=0);var w=x/26|0,p=x%26;return this._expand(w+1),this.words[w]=M?this.words[w]|1<x.length?(w=this,p=x):(w=x,p=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=w.length,b!==0)this.words[this.length]=b,this.length++;else if(w!==this)for(;gx.length?this.clone().iadd(x):x.clone().iadd(this)},t.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var M=this.iadd(x);return x.negative=1,M._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var w,p,b=this.cmp(x);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(w=this,p=x):(w=x,p=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],$=8191&O,E=O>>>13,C=0|y[2],F=8191&C,V=C>>>13,Y=0|y[3],W=8191&Y,K=Y>>>13,Q=0|y[4],et=8191&Q,X=Q>>>13,J=0|y[5],G=8191&J,nt=J>>>13,rt=0|y[6],st=8191&rt,at=rt>>>13,lt=0|y[7],ht=8191<,wt=lt>>>13,vt=0|y[8],bt=8191&vt,Et=vt>>>13,Mt=0|y[9],Tt=8191&Mt,Rt=Mt>>>13,_t=0|k[0],dt=8191&_t,xt=_t>>>13,Ct=0|k[1],kt=8191&Ct,Yt=Ct>>>13,re=0|k[2],Ot=8191&re,Qt=re>>>13,Wt=0|k[3],Lt=8191&Wt,ue=Wt>>>13,te=0|k[4],Pt=8191&te,Zt=te>>>13,ae=0|k[5],Bt=8191&ae,ee=ae>>>13,le=0|k[6],Ut=8191&le,tt=le>>>13,it=0|k[7],ut=8191&it,gt=it>>>13,jt=0|k[8],yt=8191&jt,Dt=jt>>>13,It=0|k[9],At=8191&It,zt=It>>>13;w.negative=x.negative^M.negative,w.length=19;var Ft=(I+(p=Math.imul(U,dt))|0)+((8191&(b=(b=Math.imul(U,xt))+Math.imul(q,dt)|0))<<13)|0;I=((g=Math.imul(q,xt))+(b>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,p=Math.imul($,dt),b=(b=Math.imul($,xt))+Math.imul(E,dt)|0,g=Math.imul(E,xt);var qt=(I+(p=p+Math.imul(U,kt)|0)|0)+((8191&(b=(b=b+Math.imul(U,Yt)|0)+Math.imul(q,kt)|0))<<13)|0;I=((g=g+Math.imul(q,Yt)|0)+(b>>>13)|0)+(qt>>>26)|0,qt&=67108863,p=Math.imul(F,dt),b=(b=Math.imul(F,xt))+Math.imul(V,dt)|0,g=Math.imul(V,xt),p=p+Math.imul($,kt)|0,b=(b=b+Math.imul($,Yt)|0)+Math.imul(E,kt)|0,g=g+Math.imul(E,Yt)|0;var de=(I+(p=p+Math.imul(U,Ot)|0)|0)+((8191&(b=(b=b+Math.imul(U,Qt)|0)+Math.imul(q,Ot)|0))<<13)|0;I=((g=g+Math.imul(q,Qt)|0)+(b>>>13)|0)+(de>>>26)|0,de&=67108863,p=Math.imul(W,dt),b=(b=Math.imul(W,xt))+Math.imul(K,dt)|0,g=Math.imul(K,xt),p=p+Math.imul(F,kt)|0,b=(b=b+Math.imul(F,Yt)|0)+Math.imul(V,kt)|0,g=g+Math.imul(V,Yt)|0,p=p+Math.imul($,Ot)|0,b=(b=b+Math.imul($,Qt)|0)+Math.imul(E,Ot)|0,g=g+Math.imul(E,Qt)|0;var ce=(I+(p=p+Math.imul(U,Lt)|0)|0)+((8191&(b=(b=b+Math.imul(U,ue)|0)+Math.imul(q,Lt)|0))<<13)|0;I=((g=g+Math.imul(q,ue)|0)+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,p=Math.imul(et,dt),b=(b=Math.imul(et,xt))+Math.imul(X,dt)|0,g=Math.imul(X,xt),p=p+Math.imul(W,kt)|0,b=(b=b+Math.imul(W,Yt)|0)+Math.imul(K,kt)|0,g=g+Math.imul(K,Yt)|0,p=p+Math.imul(F,Ot)|0,b=(b=b+Math.imul(F,Qt)|0)+Math.imul(V,Ot)|0,g=g+Math.imul(V,Qt)|0,p=p+Math.imul($,Lt)|0,b=(b=b+Math.imul($,ue)|0)+Math.imul(E,Lt)|0,g=g+Math.imul(E,ue)|0;var me=(I+(p=p+Math.imul(U,Pt)|0)|0)+((8191&(b=(b=b+Math.imul(U,Zt)|0)+Math.imul(q,Pt)|0))<<13)|0;I=((g=g+Math.imul(q,Zt)|0)+(b>>>13)|0)+(me>>>26)|0,me&=67108863,p=Math.imul(G,dt),b=(b=Math.imul(G,xt))+Math.imul(nt,dt)|0,g=Math.imul(nt,xt),p=p+Math.imul(et,kt)|0,b=(b=b+Math.imul(et,Yt)|0)+Math.imul(X,kt)|0,g=g+Math.imul(X,Yt)|0,p=p+Math.imul(W,Ot)|0,b=(b=b+Math.imul(W,Qt)|0)+Math.imul(K,Ot)|0,g=g+Math.imul(K,Qt)|0,p=p+Math.imul(F,Lt)|0,b=(b=b+Math.imul(F,ue)|0)+Math.imul(V,Lt)|0,g=g+Math.imul(V,ue)|0,p=p+Math.imul($,Pt)|0,b=(b=b+Math.imul($,Zt)|0)+Math.imul(E,Pt)|0,g=g+Math.imul(E,Zt)|0;var be=(I+(p=p+Math.imul(U,Bt)|0)|0)+((8191&(b=(b=b+Math.imul(U,ee)|0)+Math.imul(q,Bt)|0))<<13)|0;I=((g=g+Math.imul(q,ee)|0)+(b>>>13)|0)+(be>>>26)|0,be&=67108863,p=Math.imul(st,dt),b=(b=Math.imul(st,xt))+Math.imul(at,dt)|0,g=Math.imul(at,xt),p=p+Math.imul(G,kt)|0,b=(b=b+Math.imul(G,Yt)|0)+Math.imul(nt,kt)|0,g=g+Math.imul(nt,Yt)|0,p=p+Math.imul(et,Ot)|0,b=(b=b+Math.imul(et,Qt)|0)+Math.imul(X,Ot)|0,g=g+Math.imul(X,Qt)|0,p=p+Math.imul(W,Lt)|0,b=(b=b+Math.imul(W,ue)|0)+Math.imul(K,Lt)|0,g=g+Math.imul(K,ue)|0,p=p+Math.imul(F,Pt)|0,b=(b=b+Math.imul(F,Zt)|0)+Math.imul(V,Pt)|0,g=g+Math.imul(V,Zt)|0,p=p+Math.imul($,Bt)|0,b=(b=b+Math.imul($,ee)|0)+Math.imul(E,Bt)|0,g=g+Math.imul(E,ee)|0;var ve=(I+(p=p+Math.imul(U,Ut)|0)|0)+((8191&(b=(b=b+Math.imul(U,tt)|0)+Math.imul(q,Ut)|0))<<13)|0;I=((g=g+Math.imul(q,tt)|0)+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,p=Math.imul(ht,dt),b=(b=Math.imul(ht,xt))+Math.imul(wt,dt)|0,g=Math.imul(wt,xt),p=p+Math.imul(st,kt)|0,b=(b=b+Math.imul(st,Yt)|0)+Math.imul(at,kt)|0,g=g+Math.imul(at,Yt)|0,p=p+Math.imul(G,Ot)|0,b=(b=b+Math.imul(G,Qt)|0)+Math.imul(nt,Ot)|0,g=g+Math.imul(nt,Qt)|0,p=p+Math.imul(et,Lt)|0,b=(b=b+Math.imul(et,ue)|0)+Math.imul(X,Lt)|0,g=g+Math.imul(X,ue)|0,p=p+Math.imul(W,Pt)|0,b=(b=b+Math.imul(W,Zt)|0)+Math.imul(K,Pt)|0,g=g+Math.imul(K,Zt)|0,p=p+Math.imul(F,Bt)|0,b=(b=b+Math.imul(F,ee)|0)+Math.imul(V,Bt)|0,g=g+Math.imul(V,ee)|0,p=p+Math.imul($,Ut)|0,b=(b=b+Math.imul($,tt)|0)+Math.imul(E,Ut)|0,g=g+Math.imul(E,tt)|0;var Z=(I+(p=p+Math.imul(U,ut)|0)|0)+((8191&(b=(b=b+Math.imul(U,gt)|0)+Math.imul(q,ut)|0))<<13)|0;I=((g=g+Math.imul(q,gt)|0)+(b>>>13)|0)+(Z>>>26)|0,Z&=67108863,p=Math.imul(bt,dt),b=(b=Math.imul(bt,xt))+Math.imul(Et,dt)|0,g=Math.imul(Et,xt),p=p+Math.imul(ht,kt)|0,b=(b=b+Math.imul(ht,Yt)|0)+Math.imul(wt,kt)|0,g=g+Math.imul(wt,Yt)|0,p=p+Math.imul(st,Ot)|0,b=(b=b+Math.imul(st,Qt)|0)+Math.imul(at,Ot)|0,g=g+Math.imul(at,Qt)|0,p=p+Math.imul(G,Lt)|0,b=(b=b+Math.imul(G,ue)|0)+Math.imul(nt,Lt)|0,g=g+Math.imul(nt,ue)|0,p=p+Math.imul(et,Pt)|0,b=(b=b+Math.imul(et,Zt)|0)+Math.imul(X,Pt)|0,g=g+Math.imul(X,Zt)|0,p=p+Math.imul(W,Bt)|0,b=(b=b+Math.imul(W,ee)|0)+Math.imul(K,Bt)|0,g=g+Math.imul(K,ee)|0,p=p+Math.imul(F,Ut)|0,b=(b=b+Math.imul(F,tt)|0)+Math.imul(V,Ut)|0,g=g+Math.imul(V,tt)|0,p=p+Math.imul($,ut)|0,b=(b=b+Math.imul($,gt)|0)+Math.imul(E,ut)|0,g=g+Math.imul(E,gt)|0;var ot=(I+(p=p+Math.imul(U,yt)|0)|0)+((8191&(b=(b=b+Math.imul(U,Dt)|0)+Math.imul(q,yt)|0))<<13)|0;I=((g=g+Math.imul(q,Dt)|0)+(b>>>13)|0)+(ot>>>26)|0,ot&=67108863,p=Math.imul(Tt,dt),b=(b=Math.imul(Tt,xt))+Math.imul(Rt,dt)|0,g=Math.imul(Rt,xt),p=p+Math.imul(bt,kt)|0,b=(b=b+Math.imul(bt,Yt)|0)+Math.imul(Et,kt)|0,g=g+Math.imul(Et,Yt)|0,p=p+Math.imul(ht,Ot)|0,b=(b=b+Math.imul(ht,Qt)|0)+Math.imul(wt,Ot)|0,g=g+Math.imul(wt,Qt)|0,p=p+Math.imul(st,Lt)|0,b=(b=b+Math.imul(st,ue)|0)+Math.imul(at,Lt)|0,g=g+Math.imul(at,ue)|0,p=p+Math.imul(G,Pt)|0,b=(b=b+Math.imul(G,Zt)|0)+Math.imul(nt,Pt)|0,g=g+Math.imul(nt,Zt)|0,p=p+Math.imul(et,Bt)|0,b=(b=b+Math.imul(et,ee)|0)+Math.imul(X,Bt)|0,g=g+Math.imul(X,ee)|0,p=p+Math.imul(W,Ut)|0,b=(b=b+Math.imul(W,tt)|0)+Math.imul(K,Ut)|0,g=g+Math.imul(K,tt)|0,p=p+Math.imul(F,ut)|0,b=(b=b+Math.imul(F,gt)|0)+Math.imul(V,ut)|0,g=g+Math.imul(V,gt)|0,p=p+Math.imul($,yt)|0,b=(b=b+Math.imul($,Dt)|0)+Math.imul(E,yt)|0,g=g+Math.imul(E,Dt)|0;var ct=(I+(p=p+Math.imul(U,At)|0)|0)+((8191&(b=(b=b+Math.imul(U,zt)|0)+Math.imul(q,At)|0))<<13)|0;I=((g=g+Math.imul(q,zt)|0)+(b>>>13)|0)+(ct>>>26)|0,ct&=67108863,p=Math.imul(Tt,kt),b=(b=Math.imul(Tt,Yt))+Math.imul(Rt,kt)|0,g=Math.imul(Rt,Yt),p=p+Math.imul(bt,Ot)|0,b=(b=b+Math.imul(bt,Qt)|0)+Math.imul(Et,Ot)|0,g=g+Math.imul(Et,Qt)|0,p=p+Math.imul(ht,Lt)|0,b=(b=b+Math.imul(ht,ue)|0)+Math.imul(wt,Lt)|0,g=g+Math.imul(wt,ue)|0,p=p+Math.imul(st,Pt)|0,b=(b=b+Math.imul(st,Zt)|0)+Math.imul(at,Pt)|0,g=g+Math.imul(at,Zt)|0,p=p+Math.imul(G,Bt)|0,b=(b=b+Math.imul(G,ee)|0)+Math.imul(nt,Bt)|0,g=g+Math.imul(nt,ee)|0,p=p+Math.imul(et,Ut)|0,b=(b=b+Math.imul(et,tt)|0)+Math.imul(X,Ut)|0,g=g+Math.imul(X,tt)|0,p=p+Math.imul(W,ut)|0,b=(b=b+Math.imul(W,gt)|0)+Math.imul(K,ut)|0,g=g+Math.imul(K,gt)|0,p=p+Math.imul(F,yt)|0,b=(b=b+Math.imul(F,Dt)|0)+Math.imul(V,yt)|0,g=g+Math.imul(V,Dt)|0;var ft=(I+(p=p+Math.imul($,At)|0)|0)+((8191&(b=(b=b+Math.imul($,zt)|0)+Math.imul(E,At)|0))<<13)|0;I=((g=g+Math.imul(E,zt)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(Tt,Ot),b=(b=Math.imul(Tt,Qt))+Math.imul(Rt,Ot)|0,g=Math.imul(Rt,Qt),p=p+Math.imul(bt,Lt)|0,b=(b=b+Math.imul(bt,ue)|0)+Math.imul(Et,Lt)|0,g=g+Math.imul(Et,ue)|0,p=p+Math.imul(ht,Pt)|0,b=(b=b+Math.imul(ht,Zt)|0)+Math.imul(wt,Pt)|0,g=g+Math.imul(wt,Zt)|0,p=p+Math.imul(st,Bt)|0,b=(b=b+Math.imul(st,ee)|0)+Math.imul(at,Bt)|0,g=g+Math.imul(at,ee)|0,p=p+Math.imul(G,Ut)|0,b=(b=b+Math.imul(G,tt)|0)+Math.imul(nt,Ut)|0,g=g+Math.imul(nt,tt)|0,p=p+Math.imul(et,ut)|0,b=(b=b+Math.imul(et,gt)|0)+Math.imul(X,ut)|0,g=g+Math.imul(X,gt)|0,p=p+Math.imul(W,yt)|0,b=(b=b+Math.imul(W,Dt)|0)+Math.imul(K,yt)|0,g=g+Math.imul(K,Dt)|0;var St=(I+(p=p+Math.imul(F,At)|0)|0)+((8191&(b=(b=b+Math.imul(F,zt)|0)+Math.imul(V,At)|0))<<13)|0;I=((g=g+Math.imul(V,zt)|0)+(b>>>13)|0)+(St>>>26)|0,St&=67108863,p=Math.imul(Tt,Lt),b=(b=Math.imul(Tt,ue))+Math.imul(Rt,Lt)|0,g=Math.imul(Rt,ue),p=p+Math.imul(bt,Pt)|0,b=(b=b+Math.imul(bt,Zt)|0)+Math.imul(Et,Pt)|0,g=g+Math.imul(Et,Zt)|0,p=p+Math.imul(ht,Bt)|0,b=(b=b+Math.imul(ht,ee)|0)+Math.imul(wt,Bt)|0,g=g+Math.imul(wt,ee)|0,p=p+Math.imul(st,Ut)|0,b=(b=b+Math.imul(st,tt)|0)+Math.imul(at,Ut)|0,g=g+Math.imul(at,tt)|0,p=p+Math.imul(G,ut)|0,b=(b=b+Math.imul(G,gt)|0)+Math.imul(nt,ut)|0,g=g+Math.imul(nt,gt)|0,p=p+Math.imul(et,yt)|0,b=(b=b+Math.imul(et,Dt)|0)+Math.imul(X,yt)|0,g=g+Math.imul(X,Dt)|0;var pt=(I+(p=p+Math.imul(W,At)|0)|0)+((8191&(b=(b=b+Math.imul(W,zt)|0)+Math.imul(K,At)|0))<<13)|0;I=((g=g+Math.imul(K,zt)|0)+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(Tt,Pt),b=(b=Math.imul(Tt,Zt))+Math.imul(Rt,Pt)|0,g=Math.imul(Rt,Zt),p=p+Math.imul(bt,Bt)|0,b=(b=b+Math.imul(bt,ee)|0)+Math.imul(Et,Bt)|0,g=g+Math.imul(Et,ee)|0,p=p+Math.imul(ht,Ut)|0,b=(b=b+Math.imul(ht,tt)|0)+Math.imul(wt,Ut)|0,g=g+Math.imul(wt,tt)|0,p=p+Math.imul(st,ut)|0,b=(b=b+Math.imul(st,gt)|0)+Math.imul(at,ut)|0,g=g+Math.imul(at,gt)|0,p=p+Math.imul(G,yt)|0,b=(b=b+Math.imul(G,Dt)|0)+Math.imul(nt,yt)|0,g=g+Math.imul(nt,Dt)|0;var mt=(I+(p=p+Math.imul(et,At)|0)|0)+((8191&(b=(b=b+Math.imul(et,zt)|0)+Math.imul(X,At)|0))<<13)|0;I=((g=g+Math.imul(X,zt)|0)+(b>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(Tt,Bt),b=(b=Math.imul(Tt,ee))+Math.imul(Rt,Bt)|0,g=Math.imul(Rt,ee),p=p+Math.imul(bt,Ut)|0,b=(b=b+Math.imul(bt,tt)|0)+Math.imul(Et,Ut)|0,g=g+Math.imul(Et,tt)|0,p=p+Math.imul(ht,ut)|0,b=(b=b+Math.imul(ht,gt)|0)+Math.imul(wt,ut)|0,g=g+Math.imul(wt,gt)|0,p=p+Math.imul(st,yt)|0,b=(b=b+Math.imul(st,Dt)|0)+Math.imul(at,yt)|0,g=g+Math.imul(at,Dt)|0;var Xt=(I+(p=p+Math.imul(G,At)|0)|0)+((8191&(b=(b=b+Math.imul(G,zt)|0)+Math.imul(nt,At)|0))<<13)|0;I=((g=g+Math.imul(nt,zt)|0)+(b>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(Tt,Ut),b=(b=Math.imul(Tt,tt))+Math.imul(Rt,Ut)|0,g=Math.imul(Rt,tt),p=p+Math.imul(bt,ut)|0,b=(b=b+Math.imul(bt,gt)|0)+Math.imul(Et,ut)|0,g=g+Math.imul(Et,gt)|0,p=p+Math.imul(ht,yt)|0,b=(b=b+Math.imul(ht,Dt)|0)+Math.imul(wt,yt)|0,g=g+Math.imul(wt,Dt)|0;var $t=(I+(p=p+Math.imul(st,At)|0)|0)+((8191&(b=(b=b+Math.imul(st,zt)|0)+Math.imul(at,At)|0))<<13)|0;I=((g=g+Math.imul(at,zt)|0)+(b>>>13)|0)+($t>>>26)|0,$t&=67108863,p=Math.imul(Tt,ut),b=(b=Math.imul(Tt,gt))+Math.imul(Rt,ut)|0,g=Math.imul(Rt,gt),p=p+Math.imul(bt,yt)|0,b=(b=b+Math.imul(bt,Dt)|0)+Math.imul(Et,yt)|0,g=g+Math.imul(Et,Dt)|0;var Ht=(I+(p=p+Math.imul(ht,At)|0)|0)+((8191&(b=(b=b+Math.imul(ht,zt)|0)+Math.imul(wt,At)|0))<<13)|0;I=((g=g+Math.imul(wt,zt)|0)+(b>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,p=Math.imul(Tt,yt),b=(b=Math.imul(Tt,Dt))+Math.imul(Rt,yt)|0,g=Math.imul(Rt,Dt);var Nt=(I+(p=p+Math.imul(bt,At)|0)|0)+((8191&(b=(b=b+Math.imul(bt,zt)|0)+Math.imul(Et,At)|0))<<13)|0;I=((g=g+Math.imul(Et,zt)|0)+(b>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var se=(I+(p=Math.imul(Tt,At))|0)+((8191&(b=(b=Math.imul(Tt,zt))+Math.imul(Rt,At)|0))<<13)|0;return I=((g=Math.imul(Rt,zt))+(b>>>13)|0)+(se>>>26)|0,se&=67108863,R[0]=Ft,R[1]=qt,R[2]=de,R[3]=ce,R[4]=me,R[5]=be,R[6]=ve,R[7]=Z,R[8]=ot,R[9]=ct,R[10]=ft,R[11]=St,R[12]=pt,R[13]=mt,R[14]=Xt,R[15]=$t,R[16]=Ht,R[17]=Nt,R[18]=se,I!==0&&(R[19]=I,w.length++),w};function v(x,M,w){return new _().mulp(x,M,w)}function _(x,M){this.x=x,this.y=M}Math.imul||(h=d),t.prototype.mulTo=function(x,M){var w=this.length+x.length;return this.length===10&&x.length===10?h(this,x,M):w<63?d(this,x,M):w<1024?function(p,b,g){g.negative=b.negative^p.negative,g.length=p.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,x,M):v(this,x,M)},_.prototype.makeRBT=function(x){for(var M=new Array(x),w=t.prototype._countBits(x)-1,p=0;p>=1;return p},_.prototype.permute=function(x,M,w,p,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,w[2*g+1]=8191&b,b>>>=13;for(g=2*M;g>=26,M+=p/67108864|0,M+=b>>>26,this.words[w]=67108863&b}return M!==0&&(this.words[w]=M,this.length++),this},t.prototype.muln=function(x){return this.clone().imuln(x)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(x){var M=function(g){for(var y=new Array(g.bitLength()),k=0;k>>I}return y}(x);if(M.length===0)return new t(1);for(var w=this,p=0;p=0);var M,w=x%26,p=(x-w)/26,b=67108863>>>26-w<<26-w;if(w!==0){var g=0;for(M=0;M>>26-w}g&&(this.words[M]=g,this.length++)}if(p!==0){for(M=this.length-1;M>=0;M--)this.words[M+p]=this.words[M];for(M=0;M=0),p=M?(M-M%26)/26:0;var b=x%26,g=Math.min((x-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(I!==0||R>=p);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(x,M,w){return a(this.negative===0),this.iushrn(x,M,w)},t.prototype.shln=function(x){return this.clone().ishln(x)},t.prototype.ushln=function(x){return this.clone().iushln(x)},t.prototype.shrn=function(x){return this.clone().ishrn(x)},t.prototype.ushrn=function(x){return this.clone().iushrn(x)},t.prototype.testn=function(x){a(typeof x=="number"&&x>=0);var M=x%26,w=(x-M)/26,p=1<=0);var M=x%26,w=(x-M)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(M!==0&&w++,this.length=Math.min(w,this.length),M!==0){var p=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(x){if(a(typeof x=="number"),a(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,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[p+w]=67108863&b}for(;p>26,this.words[p+w]=67108863&b;if(y===0)return this.strip();for(a(y===-1),y=0,p=0;p>26,this.words[p]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(x,M){var w=(this.length,x.length),p=this.clone(),b=x,g=0|b.words[b.length-1];(w=26-this._countBits(g))!==0&&(b=b.ushln(w),p.iushln(w),g=0|b.words[b.length-1]);var y,k=p.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|p.words[b.length+z])+(0|p.words[b.length+z-1]);for(U=Math.min(U/g|0,67108863),p._ishlnsubmul(b,U,z);p.negative!==0;)U--,p.negative=0,p._ishlnsubmul(b,1,z),p.isZero()||(p.negative^=1);y&&(y.words[z]=U)}return y&&y.strip(),p.strip(),M!=="div"&&w!==0&&p.iushrn(w),{div:y||null,mod:p}},t.prototype.divmod=function(x,M,w){return a(!x.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&x.negative===0?(g=this.neg().divmod(x,M),M!=="mod"&&(p=g.div.neg()),M!=="div"&&(b=g.mod.neg(),w&&b.negative!==0&&b.iadd(x)),{div:p,mod:b}):this.negative===0&&x.negative!==0?(g=this.divmod(x.neg(),M),M!=="mod"&&(p=g.div.neg()),{div:p,mod:g.mod}):this.negative&x.negative?(g=this.neg().divmod(x.neg(),M),M!=="div"&&(b=g.mod.neg(),w&&b.negative!==0&&b.isub(x)),{div:g.div,mod:b}):x.length>this.length||this.cmp(x)<0?{div:new t(0),mod:this}:x.length===1?M==="div"?{div:this.divn(x.words[0]),mod:null}:M==="mod"?{div:null,mod:new t(this.modn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new t(this.modn(x.words[0]))}:this._wordDiv(x,M);var p,b,g},t.prototype.div=function(x){return this.divmod(x,"div",!1).div},t.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},t.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},t.prototype.divRound=function(x){var M=this.divmod(x);if(M.mod.isZero())return M.div;var w=M.div.negative!==0?M.mod.isub(x):M.mod,p=x.ushrn(1),b=x.andln(1),g=w.cmp(p);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(x){a(x<=67108863);for(var M=(1<<26)%x,w=0,p=this.length-1;p>=0;p--)w=(M*w+(0|this.words[p]))%x;return w},t.prototype.idivn=function(x){a(x<=67108863);for(var M=0,w=this.length-1;w>=0;w--){var p=(0|this.words[w])+67108864*M;this.words[w]=p/x|0,M=p%x}return this.strip()},t.prototype.divn=function(x){return this.clone().idivn(x)},t.prototype.egcd=function(x){a(x.negative===0),a(!x.isZero());var M=this,w=x.clone();M=M.negative!==0?M.umod(x):M.clone();for(var p=new t(1),b=new t(0),g=new t(0),y=new t(1),k=0;M.isEven()&&w.isEven();)M.iushrn(1),w.iushrn(1),++k;for(var R=w.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;)(p.isOdd()||b.isOdd())&&(p.iadd(R),b.isub(I)),p.iushrn(1),b.iushrn(1);for(var q=0,O=1;!(w.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(w.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(I)),g.iushrn(1),y.iushrn(1);M.cmp(w)>=0?(M.isub(w),p.isub(g),b.isub(y)):(w.isub(M),g.isub(p),y.isub(b))}return{a:g,b:y,gcd:w.iushln(k)}},t.prototype._invmp=function(x){a(x.negative===0),a(!x.isZero());var M=this,w=x.clone();M=M.negative!==0?M.umod(x):M.clone();for(var p,b=new t(1),g=new t(0),y=w.clone();M.cmpn(1)>0&&w.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;!(w.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(w.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);M.cmp(w)>=0?(M.isub(w),b.isub(g)):(w.isub(M),g.isub(b))}return(p=M.cmpn(1)===0?b:g).cmpn(0)<0&&p.iadd(x),p},t.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var M=this.clone(),w=x.clone();M.negative=0,w.negative=0;for(var p=0;M.isEven()&&w.isEven();p++)M.iushrn(1),w.iushrn(1);for(;;){for(;M.isEven();)M.iushrn(1);for(;w.isEven();)w.iushrn(1);var b=M.cmp(w);if(b<0){var g=M;M=w,w=g}else if(b===0||w.cmpn(1)===0)break;M.isub(w)}return w.iushln(p)},t.prototype.invm=function(x){return this.egcd(x).a.umod(x)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(x){return this.words[0]&x},t.prototype.bincn=function(x){a(typeof x=="number");var M=x%26,w=(x-M)/26,p=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(x){var M,w=x<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;if(this.strip(),this.length>1)M=1;else{w&&(x=-x),a(x<=67108863,"Number is too big");var p=0|this.words[0];M=p===x?0:px.length)return 1;if(this.length=0;w--){var p=0|this.words[w],b=0|x.words[w];if(p!==b){pb&&(M=1);break}}return M},t.prototype.gtn=function(x){return this.cmpn(x)===1},t.prototype.gt=function(x){return this.cmp(x)===1},t.prototype.gten=function(x){return this.cmpn(x)>=0},t.prototype.gte=function(x){return this.cmp(x)>=0},t.prototype.ltn=function(x){return this.cmpn(x)===-1},t.prototype.lt=function(x){return this.cmp(x)===-1},t.prototype.lten=function(x){return this.cmpn(x)<=0},t.prototype.lte=function(x){return this.cmp(x)<=0},t.prototype.eqn=function(x){return this.cmpn(x)===0},t.prototype.eq=function(x){return this.cmp(x)===0},t.red=function(x){return new H(x)},t.prototype.toRed=function(x){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(x){return this.red=x,this},t.prototype.forceRed=function(x){return a(!this.red,"Already a number in reduction context"),this._forceRed(x)},t.prototype.redAdd=function(x){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},t.prototype.redIAdd=function(x){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},t.prototype.redSub=function(x){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},t.prototype.redISub=function(x){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},t.prototype.redShl=function(x){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},t.prototype.redMul=function(x){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},t.prototype.redIMul=function(x){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(x){return a(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var A={k256:null,p224:null,p192:null,p25519:null};function N(x,M){this.name=x,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 D(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function H(x){if(typeof x=="string"){var M=t._prime(x);this.m=M.p,this.prime=M}else a(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}function B(x){H.call(this,x),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 x=new t(null);return x.words=new Array(Math.ceil(this.n/13)),x},N.prototype.ireduce=function(x){var M,w=x;do this.split(w,this.tmp),M=(w=(w=this.imulK(w)).iadd(this.tmp)).bitLength();while(M>this.n);var p=M0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},N.prototype.split=function(x,M){x.iushrn(this.n,0,M)},N.prototype.imulK=function(x){return x.imul(this.k)},n(L,N),L.prototype.split=function(x,M){for(var w=Math.min(x.length,9),p=0;p>>22,b=g}b>>>=22,x.words[p-10]=b,b===0&&x.length>10?x.length-=10:x.length-=9},L.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var M=0,w=0;w>>=26,x.words[w]=b,M=p}return M!==0&&(x.words[x.length++]=M),x},t._prime=function(x){if(A[x])return A[x];var M;if(x==="k256")M=new L;else if(x==="p224")M=new j;else if(x==="p192")M=new P;else{if(x!=="p25519")throw new Error("Unknown prime "+x);M=new D}return A[x]=M,M},H.prototype._verify1=function(x){a(x.negative===0,"red works only with positives"),a(x.red,"red works only with red numbers")},H.prototype._verify2=function(x,M){a((x.negative|M.negative)==0,"red works only with positives"),a(x.red&&x.red===M.red,"red works only with red numbers")},H.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):x.umod(this.m)._forceRed(this)},H.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},H.prototype.add=function(x,M){this._verify2(x,M);var w=x.add(M);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},H.prototype.iadd=function(x,M){this._verify2(x,M);var w=x.iadd(M);return w.cmp(this.m)>=0&&w.isub(this.m),w},H.prototype.sub=function(x,M){this._verify2(x,M);var w=x.sub(M);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},H.prototype.isub=function(x,M){this._verify2(x,M);var w=x.isub(M);return w.cmpn(0)<0&&w.iadd(this.m),w},H.prototype.shl=function(x,M){return this._verify1(x),this.imod(x.ushln(M))},H.prototype.imul=function(x,M){return this._verify2(x,M),this.imod(x.imul(M))},H.prototype.mul=function(x,M){return this._verify2(x,M),this.imod(x.mul(M))},H.prototype.isqr=function(x){return this.imul(x,x.clone())},H.prototype.sqr=function(x){return this.mul(x,x)},H.prototype.sqrt=function(x){if(x.isZero())return x.clone();var M=this.m.andln(3);if(a(M%2==1),M===3){var w=this.m.add(new t(1)).iushrn(2);return this.pow(x,w)}for(var p=this.m.subn(1),b=0;!p.isZero()&&p.andln(1)===0;)b++,p.iushrn(1);a(!p.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,p),z=this.pow(x,p.addn(1).iushrn(1)),U=this.pow(x,p),q=b;U.cmp(g)!==0;){for(var O=U,$=0;O.cmp(g)!==0;$++)O=O.redSqr();a($=0;p--){for(var R=M.words[p],I=k-1;I>=0;I--){var z=R>>I&1;b!==w[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||p===0&&I===0)&&(b=this.mul(b,w[g]),y=0,g=0)):y=0}k=26}return b},H.prototype.convertTo=function(x){var M=x.umod(this.m);return M===x?M.clone():M},H.prototype.convertFrom=function(x){var M=x.clone();return M.red=null,M},t.mont=function(x){return new B(x)},n(B,H),B.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},B.prototype.convertFrom=function(x){var M=this.imod(x.mul(this.rinv));return M.red=null,M},B.prototype.imul=function(x,M){if(x.isZero()||M.isZero())return x.words[0]=0,x.length=1,x;var w=x.imul(M),p=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=w.isub(p).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.mul=function(x,M){if(x.isZero()||M.isZero())return new t(0)._forceRed(this);var w=x.mul(M),p=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=w.isub(p).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.invm=function(x){return this.imod(x._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],185:[function(s,T,S){S.byteLength=function(i){var c=l(i),f=c[0],u=c[1];return 3*(f+u)/4-u},S.toByteArray=function(i){var c,f,u=l(i),d=u[0],h=u[1],v=new a(function(N,L,j){return 3*(L+j)/4-j}(0,d,h)),_=0,A=h>0?d-4:d;for(f=0;f>16&255,v[_++]=c>>8&255,v[_++]=255&c;return h===2&&(c=o[i.charCodeAt(f)]<<2|o[i.charCodeAt(f+1)]>>4,v[_++]=255&c),h===1&&(c=o[i.charCodeAt(f)]<<10|o[i.charCodeAt(f+1)]<<4|o[i.charCodeAt(f+2)]>>2,v[_++]=c>>8&255,v[_++]=255&c),v},S.fromByteArray=function(i){for(var c,f=i.length,u=f%3,d=[],h=0,v=f-u;hv?v:h+16383));return u===1?(c=i[f-1],d.push(m[c>>2]+m[c<<4&63]+"==")):u===2&&(c=(i[f-2]<<8)+i[f-1],d.push(m[c>>10]+m[c>>4&63]+m[c<<2&63]+"=")),d.join("")};for(var m=[],o=[],a=typeof Uint8Array!="undefined"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var f=i.indexOf("=");return f===-1&&(f=c),[f,f===c?0:4-f%4]}function r(i,c,f){for(var u,d,h=[],v=c;v>18&63]+m[d>>12&63]+m[d>>6&63]+m[63&d]);return h.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],186:[function(s,T,S){(function(m,o){function a(w,p){if(!w)throw new Error(p||"Assertion failed")}function n(w,p){w.super_=p;var b=function(){};b.prototype=p.prototype,w.prototype=new b,w.prototype.constructor=w}function t(w,p,b){if(t.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&(p!=="le"&&p!=="be"||(b=p,p=10),this._init(w||0,p||10,b||"be"))}var e;typeof m=="object"?m.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{e=typeof window!="undefined"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch(w){}function l(w,p){var b=w.charCodeAt(p);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void a(!1,"Invalid character in "+w)}function r(w,p,b){var g=l(w,b);return b-1>=p&&(g|=l(w,b-1)<<4),g}function i(w,p,b,g){for(var y=0,k=0,R=Math.min(w.length,b),I=p;I=49?z-49+10:z>=17?z-17+10:z,a(z>=0&&k0?w:p},t.min=function(w,p){return w.cmp(p)<0?w:p},t.prototype._init=function(w,p,b){if(typeof w=="number")return this._initNumber(w,p,b);if(typeof w=="object")return this._initArray(w,p,b);p==="hex"&&(p=16),a(p===(0|p)&&p>=2&&p<=36);var g=0;(w=w.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)k=w[g]|w[g-1]<<8|w[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(w,p,b){this.length=Math.ceil((w.length-p)/6),this.words=new Array(this.length);for(var g=0;g=p;g-=2)y=r(w,p,g)<=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;else for(g=(w.length-p)%2==0?p+1:p;g=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;this._strip()},t.prototype._parseBase=function(w,p,b){this.words=[0],this.length=1;for(var g=0,y=1;y<=67108863;y*=p)g++;g--,y=y/p|0;for(var k=w.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!="undefined"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(w){t.prototype.inspect=f}else t.prototype.inspect=f;function f(){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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(w,p){var b;if(p=0|p||1,(w=w||10)===16||w==="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%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(w===(0|w)&&w>=2&&w<=36){var z=d[w],U=h[w];b="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modrn(U).toString(w);b=(q=q.idivn(U)).isZero()?O+b:u[z-O.length]+O+b}for(this.isZero()&&(b="0"+b);b.length%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=67108864*this.words[1]:this.length===3&&this.words[2]===1?w+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(w,p){return this.toArrayLike(e,w,p)}),t.prototype.toArray=function(w,p){return this.toArrayLike(Array,w,p)};function v(w,p,b){b.negative=p.negative^w.negative;var g=w.length+p.length|0;b.length=g,g=g-1|0;var y=0|w.words[0],k=0|p.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,$=Math.min(U,p.length-1),E=Math.max(0,U-w.length+1);E<=$;E++){var C=U-E|0;q+=(R=(y=0|w.words[C])*(k=0|p.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(w,p,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);a(g<=y,"byte array longer than desired length"),a(y>0,"Requested array length <= 0");var k=function(R,I){return R.allocUnsafe?R.allocUnsafe(I):new R(I)}(w,y);return this["_toArrayLike"+(p==="le"?"LE":"BE")](k,g),k},t.prototype._toArrayLikeLE=function(w,p){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&&(w[b--]=R>>8&255),b>=0&&(w[b--]=R>>16&255),k===6?(b>=0&&(w[b--]=R>>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b>=0)for(w[b--]=g;b>=0;)w[b--]=0},Math.clz32?t.prototype._countBits=function(w){return 32-Math.clz32(w)}:t.prototype._countBits=function(w){var p=w,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},t.prototype._zeroBits=function(w){if(w===0)return 26;var p=w,b=0;return!(8191&p)&&(b+=13,p>>>=13),!(127&p)&&(b+=7,p>>>=7),!(15&p)&&(b+=4,p>>>=4),!(3&p)&&(b+=2,p>>>=2),!(1&p)&&b++,b},t.prototype.bitLength=function(){var w=this.words[this.length-1],p=this._countBits(w);return 26*(this.length-1)+p},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,p=0;pw.length?this.clone().ior(w):w.clone().ior(this)},t.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},t.prototype.iuand=function(w){var p;p=this.length>w.length?w:this;for(var b=0;bw.length?this.clone().iand(w):w.clone().iand(this)},t.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},t.prototype.iuxor=function(w){var p,b;this.length>w.length?(p=this,b=w):(p=w,b=this);for(var g=0;gw.length?this.clone().ixor(w):w.clone().ixor(this)},t.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},t.prototype.inotn=function(w){a(typeof w=="number"&&w>=0);var p=0|Math.ceil(w/26),b=w%26;this._expand(p),b>0&&p--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-b),this._strip()},t.prototype.notn=function(w){return this.clone().inotn(w)},t.prototype.setn=function(w,p){a(typeof w=="number"&&w>=0);var b=w/26|0,g=w%26;return this._expand(b+1),this.words[b]=p?this.words[b]|1<w.length?(b=this,g=w):(b=w,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(;kw.length?this.clone().iadd(w):w.clone().iadd(this)},t.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var p=this.iadd(w);return w.negative=1,p._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var b,g,y=this.cmp(w);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=w):(b=w,g=this);for(var k=0,R=0;R>26,this.words[R]=67108863&p;for(;k!==0&&R>26,this.words[R]=67108863&p;if(k===0&&R>>13,E=0|R[1],C=8191&E,F=E>>>13,V=0|R[2],Y=8191&V,W=V>>>13,K=0|R[3],Q=8191&K,et=K>>>13,X=0|R[4],J=8191&X,G=X>>>13,nt=0|R[5],rt=8191&nt,st=nt>>>13,at=0|R[6],lt=8191&at,ht=at>>>13,wt=0|R[7],vt=8191&wt,bt=wt>>>13,Et=0|R[8],Mt=8191&Et,Tt=Et>>>13,Rt=0|R[9],_t=8191&Rt,dt=Rt>>>13,xt=0|I[0],Ct=8191&xt,kt=xt>>>13,Yt=0|I[1],re=8191&Yt,Ot=Yt>>>13,Qt=0|I[2],Wt=8191&Qt,Lt=Qt>>>13,ue=0|I[3],te=8191&ue,Pt=ue>>>13,Zt=0|I[4],ae=8191&Zt,Bt=Zt>>>13,ee=0|I[5],le=8191&ee,Ut=ee>>>13,tt=0|I[6],it=8191&tt,ut=tt>>>13,gt=0|I[7],jt=8191>,yt=gt>>>13,Dt=0|I[8],It=8191&Dt,At=Dt>>>13,zt=0|I[9],Ft=8191&zt,qt=zt>>>13;b.negative=w.negative^p.negative,b.length=19;var de=(U+(g=Math.imul(O,Ct))|0)+((8191&(y=(y=Math.imul(O,kt))+Math.imul($,Ct)|0))<<13)|0;U=((k=Math.imul($,kt))+(y>>>13)|0)+(de>>>26)|0,de&=67108863,g=Math.imul(C,Ct),y=(y=Math.imul(C,kt))+Math.imul(F,Ct)|0,k=Math.imul(F,kt);var ce=(U+(g=g+Math.imul(O,re)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ot)|0)+Math.imul($,re)|0))<<13)|0;U=((k=k+Math.imul($,Ot)|0)+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863,g=Math.imul(Y,Ct),y=(y=Math.imul(Y,kt))+Math.imul(W,Ct)|0,k=Math.imul(W,kt),g=g+Math.imul(C,re)|0,y=(y=y+Math.imul(C,Ot)|0)+Math.imul(F,re)|0,k=k+Math.imul(F,Ot)|0;var me=(U+(g=g+Math.imul(O,Wt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Lt)|0)+Math.imul($,Wt)|0))<<13)|0;U=((k=k+Math.imul($,Lt)|0)+(y>>>13)|0)+(me>>>26)|0,me&=67108863,g=Math.imul(Q,Ct),y=(y=Math.imul(Q,kt))+Math.imul(et,Ct)|0,k=Math.imul(et,kt),g=g+Math.imul(Y,re)|0,y=(y=y+Math.imul(Y,Ot)|0)+Math.imul(W,re)|0,k=k+Math.imul(W,Ot)|0,g=g+Math.imul(C,Wt)|0,y=(y=y+Math.imul(C,Lt)|0)+Math.imul(F,Wt)|0,k=k+Math.imul(F,Lt)|0;var be=(U+(g=g+Math.imul(O,te)|0)|0)+((8191&(y=(y=y+Math.imul(O,Pt)|0)+Math.imul($,te)|0))<<13)|0;U=((k=k+Math.imul($,Pt)|0)+(y>>>13)|0)+(be>>>26)|0,be&=67108863,g=Math.imul(J,Ct),y=(y=Math.imul(J,kt))+Math.imul(G,Ct)|0,k=Math.imul(G,kt),g=g+Math.imul(Q,re)|0,y=(y=y+Math.imul(Q,Ot)|0)+Math.imul(et,re)|0,k=k+Math.imul(et,Ot)|0,g=g+Math.imul(Y,Wt)|0,y=(y=y+Math.imul(Y,Lt)|0)+Math.imul(W,Wt)|0,k=k+Math.imul(W,Lt)|0,g=g+Math.imul(C,te)|0,y=(y=y+Math.imul(C,Pt)|0)+Math.imul(F,te)|0,k=k+Math.imul(F,Pt)|0;var ve=(U+(g=g+Math.imul(O,ae)|0)|0)+((8191&(y=(y=y+Math.imul(O,Bt)|0)+Math.imul($,ae)|0))<<13)|0;U=((k=k+Math.imul($,Bt)|0)+(y>>>13)|0)+(ve>>>26)|0,ve&=67108863,g=Math.imul(rt,Ct),y=(y=Math.imul(rt,kt))+Math.imul(st,Ct)|0,k=Math.imul(st,kt),g=g+Math.imul(J,re)|0,y=(y=y+Math.imul(J,Ot)|0)+Math.imul(G,re)|0,k=k+Math.imul(G,Ot)|0,g=g+Math.imul(Q,Wt)|0,y=(y=y+Math.imul(Q,Lt)|0)+Math.imul(et,Wt)|0,k=k+Math.imul(et,Lt)|0,g=g+Math.imul(Y,te)|0,y=(y=y+Math.imul(Y,Pt)|0)+Math.imul(W,te)|0,k=k+Math.imul(W,Pt)|0,g=g+Math.imul(C,ae)|0,y=(y=y+Math.imul(C,Bt)|0)+Math.imul(F,ae)|0,k=k+Math.imul(F,Bt)|0;var Z=(U+(g=g+Math.imul(O,le)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ut)|0)+Math.imul($,le)|0))<<13)|0;U=((k=k+Math.imul($,Ut)|0)+(y>>>13)|0)+(Z>>>26)|0,Z&=67108863,g=Math.imul(lt,Ct),y=(y=Math.imul(lt,kt))+Math.imul(ht,Ct)|0,k=Math.imul(ht,kt),g=g+Math.imul(rt,re)|0,y=(y=y+Math.imul(rt,Ot)|0)+Math.imul(st,re)|0,k=k+Math.imul(st,Ot)|0,g=g+Math.imul(J,Wt)|0,y=(y=y+Math.imul(J,Lt)|0)+Math.imul(G,Wt)|0,k=k+Math.imul(G,Lt)|0,g=g+Math.imul(Q,te)|0,y=(y=y+Math.imul(Q,Pt)|0)+Math.imul(et,te)|0,k=k+Math.imul(et,Pt)|0,g=g+Math.imul(Y,ae)|0,y=(y=y+Math.imul(Y,Bt)|0)+Math.imul(W,ae)|0,k=k+Math.imul(W,Bt)|0,g=g+Math.imul(C,le)|0,y=(y=y+Math.imul(C,Ut)|0)+Math.imul(F,le)|0,k=k+Math.imul(F,Ut)|0;var ot=(U+(g=g+Math.imul(O,it)|0)|0)+((8191&(y=(y=y+Math.imul(O,ut)|0)+Math.imul($,it)|0))<<13)|0;U=((k=k+Math.imul($,ut)|0)+(y>>>13)|0)+(ot>>>26)|0,ot&=67108863,g=Math.imul(vt,Ct),y=(y=Math.imul(vt,kt))+Math.imul(bt,Ct)|0,k=Math.imul(bt,kt),g=g+Math.imul(lt,re)|0,y=(y=y+Math.imul(lt,Ot)|0)+Math.imul(ht,re)|0,k=k+Math.imul(ht,Ot)|0,g=g+Math.imul(rt,Wt)|0,y=(y=y+Math.imul(rt,Lt)|0)+Math.imul(st,Wt)|0,k=k+Math.imul(st,Lt)|0,g=g+Math.imul(J,te)|0,y=(y=y+Math.imul(J,Pt)|0)+Math.imul(G,te)|0,k=k+Math.imul(G,Pt)|0,g=g+Math.imul(Q,ae)|0,y=(y=y+Math.imul(Q,Bt)|0)+Math.imul(et,ae)|0,k=k+Math.imul(et,Bt)|0,g=g+Math.imul(Y,le)|0,y=(y=y+Math.imul(Y,Ut)|0)+Math.imul(W,le)|0,k=k+Math.imul(W,Ut)|0,g=g+Math.imul(C,it)|0,y=(y=y+Math.imul(C,ut)|0)+Math.imul(F,it)|0,k=k+Math.imul(F,ut)|0;var ct=(U+(g=g+Math.imul(O,jt)|0)|0)+((8191&(y=(y=y+Math.imul(O,yt)|0)+Math.imul($,jt)|0))<<13)|0;U=((k=k+Math.imul($,yt)|0)+(y>>>13)|0)+(ct>>>26)|0,ct&=67108863,g=Math.imul(Mt,Ct),y=(y=Math.imul(Mt,kt))+Math.imul(Tt,Ct)|0,k=Math.imul(Tt,kt),g=g+Math.imul(vt,re)|0,y=(y=y+Math.imul(vt,Ot)|0)+Math.imul(bt,re)|0,k=k+Math.imul(bt,Ot)|0,g=g+Math.imul(lt,Wt)|0,y=(y=y+Math.imul(lt,Lt)|0)+Math.imul(ht,Wt)|0,k=k+Math.imul(ht,Lt)|0,g=g+Math.imul(rt,te)|0,y=(y=y+Math.imul(rt,Pt)|0)+Math.imul(st,te)|0,k=k+Math.imul(st,Pt)|0,g=g+Math.imul(J,ae)|0,y=(y=y+Math.imul(J,Bt)|0)+Math.imul(G,ae)|0,k=k+Math.imul(G,Bt)|0,g=g+Math.imul(Q,le)|0,y=(y=y+Math.imul(Q,Ut)|0)+Math.imul(et,le)|0,k=k+Math.imul(et,Ut)|0,g=g+Math.imul(Y,it)|0,y=(y=y+Math.imul(Y,ut)|0)+Math.imul(W,it)|0,k=k+Math.imul(W,ut)|0,g=g+Math.imul(C,jt)|0,y=(y=y+Math.imul(C,yt)|0)+Math.imul(F,jt)|0,k=k+Math.imul(F,yt)|0;var ft=(U+(g=g+Math.imul(O,It)|0)|0)+((8191&(y=(y=y+Math.imul(O,At)|0)+Math.imul($,It)|0))<<13)|0;U=((k=k+Math.imul($,At)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,g=Math.imul(_t,Ct),y=(y=Math.imul(_t,kt))+Math.imul(dt,Ct)|0,k=Math.imul(dt,kt),g=g+Math.imul(Mt,re)|0,y=(y=y+Math.imul(Mt,Ot)|0)+Math.imul(Tt,re)|0,k=k+Math.imul(Tt,Ot)|0,g=g+Math.imul(vt,Wt)|0,y=(y=y+Math.imul(vt,Lt)|0)+Math.imul(bt,Wt)|0,k=k+Math.imul(bt,Lt)|0,g=g+Math.imul(lt,te)|0,y=(y=y+Math.imul(lt,Pt)|0)+Math.imul(ht,te)|0,k=k+Math.imul(ht,Pt)|0,g=g+Math.imul(rt,ae)|0,y=(y=y+Math.imul(rt,Bt)|0)+Math.imul(st,ae)|0,k=k+Math.imul(st,Bt)|0,g=g+Math.imul(J,le)|0,y=(y=y+Math.imul(J,Ut)|0)+Math.imul(G,le)|0,k=k+Math.imul(G,Ut)|0,g=g+Math.imul(Q,it)|0,y=(y=y+Math.imul(Q,ut)|0)+Math.imul(et,it)|0,k=k+Math.imul(et,ut)|0,g=g+Math.imul(Y,jt)|0,y=(y=y+Math.imul(Y,yt)|0)+Math.imul(W,jt)|0,k=k+Math.imul(W,yt)|0,g=g+Math.imul(C,It)|0,y=(y=y+Math.imul(C,At)|0)+Math.imul(F,It)|0,k=k+Math.imul(F,At)|0;var St=(U+(g=g+Math.imul(O,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(O,qt)|0)+Math.imul($,Ft)|0))<<13)|0;U=((k=k+Math.imul($,qt)|0)+(y>>>13)|0)+(St>>>26)|0,St&=67108863,g=Math.imul(_t,re),y=(y=Math.imul(_t,Ot))+Math.imul(dt,re)|0,k=Math.imul(dt,Ot),g=g+Math.imul(Mt,Wt)|0,y=(y=y+Math.imul(Mt,Lt)|0)+Math.imul(Tt,Wt)|0,k=k+Math.imul(Tt,Lt)|0,g=g+Math.imul(vt,te)|0,y=(y=y+Math.imul(vt,Pt)|0)+Math.imul(bt,te)|0,k=k+Math.imul(bt,Pt)|0,g=g+Math.imul(lt,ae)|0,y=(y=y+Math.imul(lt,Bt)|0)+Math.imul(ht,ae)|0,k=k+Math.imul(ht,Bt)|0,g=g+Math.imul(rt,le)|0,y=(y=y+Math.imul(rt,Ut)|0)+Math.imul(st,le)|0,k=k+Math.imul(st,Ut)|0,g=g+Math.imul(J,it)|0,y=(y=y+Math.imul(J,ut)|0)+Math.imul(G,it)|0,k=k+Math.imul(G,ut)|0,g=g+Math.imul(Q,jt)|0,y=(y=y+Math.imul(Q,yt)|0)+Math.imul(et,jt)|0,k=k+Math.imul(et,yt)|0,g=g+Math.imul(Y,It)|0,y=(y=y+Math.imul(Y,At)|0)+Math.imul(W,It)|0,k=k+Math.imul(W,At)|0;var pt=(U+(g=g+Math.imul(C,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(C,qt)|0)+Math.imul(F,Ft)|0))<<13)|0;U=((k=k+Math.imul(F,qt)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(_t,Wt),y=(y=Math.imul(_t,Lt))+Math.imul(dt,Wt)|0,k=Math.imul(dt,Lt),g=g+Math.imul(Mt,te)|0,y=(y=y+Math.imul(Mt,Pt)|0)+Math.imul(Tt,te)|0,k=k+Math.imul(Tt,Pt)|0,g=g+Math.imul(vt,ae)|0,y=(y=y+Math.imul(vt,Bt)|0)+Math.imul(bt,ae)|0,k=k+Math.imul(bt,Bt)|0,g=g+Math.imul(lt,le)|0,y=(y=y+Math.imul(lt,Ut)|0)+Math.imul(ht,le)|0,k=k+Math.imul(ht,Ut)|0,g=g+Math.imul(rt,it)|0,y=(y=y+Math.imul(rt,ut)|0)+Math.imul(st,it)|0,k=k+Math.imul(st,ut)|0,g=g+Math.imul(J,jt)|0,y=(y=y+Math.imul(J,yt)|0)+Math.imul(G,jt)|0,k=k+Math.imul(G,yt)|0,g=g+Math.imul(Q,It)|0,y=(y=y+Math.imul(Q,At)|0)+Math.imul(et,It)|0,k=k+Math.imul(et,At)|0;var mt=(U+(g=g+Math.imul(Y,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Y,qt)|0)+Math.imul(W,Ft)|0))<<13)|0;U=((k=k+Math.imul(W,qt)|0)+(y>>>13)|0)+(mt>>>26)|0,mt&=67108863,g=Math.imul(_t,te),y=(y=Math.imul(_t,Pt))+Math.imul(dt,te)|0,k=Math.imul(dt,Pt),g=g+Math.imul(Mt,ae)|0,y=(y=y+Math.imul(Mt,Bt)|0)+Math.imul(Tt,ae)|0,k=k+Math.imul(Tt,Bt)|0,g=g+Math.imul(vt,le)|0,y=(y=y+Math.imul(vt,Ut)|0)+Math.imul(bt,le)|0,k=k+Math.imul(bt,Ut)|0,g=g+Math.imul(lt,it)|0,y=(y=y+Math.imul(lt,ut)|0)+Math.imul(ht,it)|0,k=k+Math.imul(ht,ut)|0,g=g+Math.imul(rt,jt)|0,y=(y=y+Math.imul(rt,yt)|0)+Math.imul(st,jt)|0,k=k+Math.imul(st,yt)|0,g=g+Math.imul(J,It)|0,y=(y=y+Math.imul(J,At)|0)+Math.imul(G,It)|0,k=k+Math.imul(G,At)|0;var Xt=(U+(g=g+Math.imul(Q,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Q,qt)|0)+Math.imul(et,Ft)|0))<<13)|0;U=((k=k+Math.imul(et,qt)|0)+(y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,g=Math.imul(_t,ae),y=(y=Math.imul(_t,Bt))+Math.imul(dt,ae)|0,k=Math.imul(dt,Bt),g=g+Math.imul(Mt,le)|0,y=(y=y+Math.imul(Mt,Ut)|0)+Math.imul(Tt,le)|0,k=k+Math.imul(Tt,Ut)|0,g=g+Math.imul(vt,it)|0,y=(y=y+Math.imul(vt,ut)|0)+Math.imul(bt,it)|0,k=k+Math.imul(bt,ut)|0,g=g+Math.imul(lt,jt)|0,y=(y=y+Math.imul(lt,yt)|0)+Math.imul(ht,jt)|0,k=k+Math.imul(ht,yt)|0,g=g+Math.imul(rt,It)|0,y=(y=y+Math.imul(rt,At)|0)+Math.imul(st,It)|0,k=k+Math.imul(st,At)|0;var $t=(U+(g=g+Math.imul(J,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(J,qt)|0)+Math.imul(G,Ft)|0))<<13)|0;U=((k=k+Math.imul(G,qt)|0)+(y>>>13)|0)+($t>>>26)|0,$t&=67108863,g=Math.imul(_t,le),y=(y=Math.imul(_t,Ut))+Math.imul(dt,le)|0,k=Math.imul(dt,Ut),g=g+Math.imul(Mt,it)|0,y=(y=y+Math.imul(Mt,ut)|0)+Math.imul(Tt,it)|0,k=k+Math.imul(Tt,ut)|0,g=g+Math.imul(vt,jt)|0,y=(y=y+Math.imul(vt,yt)|0)+Math.imul(bt,jt)|0,k=k+Math.imul(bt,yt)|0,g=g+Math.imul(lt,It)|0,y=(y=y+Math.imul(lt,At)|0)+Math.imul(ht,It)|0,k=k+Math.imul(ht,At)|0;var Ht=(U+(g=g+Math.imul(rt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(rt,qt)|0)+Math.imul(st,Ft)|0))<<13)|0;U=((k=k+Math.imul(st,qt)|0)+(y>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,g=Math.imul(_t,it),y=(y=Math.imul(_t,ut))+Math.imul(dt,it)|0,k=Math.imul(dt,ut),g=g+Math.imul(Mt,jt)|0,y=(y=y+Math.imul(Mt,yt)|0)+Math.imul(Tt,jt)|0,k=k+Math.imul(Tt,yt)|0,g=g+Math.imul(vt,It)|0,y=(y=y+Math.imul(vt,At)|0)+Math.imul(bt,It)|0,k=k+Math.imul(bt,At)|0;var Nt=(U+(g=g+Math.imul(lt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(lt,qt)|0)+Math.imul(ht,Ft)|0))<<13)|0;U=((k=k+Math.imul(ht,qt)|0)+(y>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,g=Math.imul(_t,jt),y=(y=Math.imul(_t,yt))+Math.imul(dt,jt)|0,k=Math.imul(dt,yt),g=g+Math.imul(Mt,It)|0,y=(y=y+Math.imul(Mt,At)|0)+Math.imul(Tt,It)|0,k=k+Math.imul(Tt,At)|0;var se=(U+(g=g+Math.imul(vt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(vt,qt)|0)+Math.imul(bt,Ft)|0))<<13)|0;U=((k=k+Math.imul(bt,qt)|0)+(y>>>13)|0)+(se>>>26)|0,se&=67108863,g=Math.imul(_t,It),y=(y=Math.imul(_t,At))+Math.imul(dt,It)|0,k=Math.imul(dt,At);var he=(U+(g=g+Math.imul(Mt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Mt,qt)|0)+Math.imul(Tt,Ft)|0))<<13)|0;U=((k=k+Math.imul(Tt,qt)|0)+(y>>>13)|0)+(he>>>26)|0,he&=67108863;var Gt=(U+(g=Math.imul(_t,Ft))|0)+((8191&(y=(y=Math.imul(_t,qt))+Math.imul(dt,Ft)|0))<<13)|0;return U=((k=Math.imul(dt,qt))+(y>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,z[0]=de,z[1]=ce,z[2]=me,z[3]=be,z[4]=ve,z[5]=Z,z[6]=ot,z[7]=ct,z[8]=ft,z[9]=St,z[10]=pt,z[11]=mt,z[12]=Xt,z[13]=$t,z[14]=Ht,z[15]=Nt,z[16]=se,z[17]=he,z[18]=Gt,U!==0&&(z[19]=U,b.length++),b};function A(w,p,b){b.negative=p.negative^w.negative,b.length=w.length+p.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(w,p,b){return A(w,p,b)}Math.imul||(_=v),t.prototype.mulTo=function(w,p){var b=this.length+w.length;return this.length===10&&w.length===10?_(this,w,p):b<63?v(this,w,p):b<1024?A(this,w,p):N(this,w,p)},t.prototype.mul=function(w){var p=new t(null);return p.words=new Array(this.length+w.length),this.mulTo(w,p)},t.prototype.mulf=function(w){var p=new t(null);return p.words=new Array(this.length+w.length),N(this,w,p)},t.prototype.imul=function(w){return this.clone().mulTo(w,this)},t.prototype.imuln=function(w){var p=w<0;p&&(w=-w),a(typeof w=="number"),a(w<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++),p?this.ineg():this},t.prototype.muln=function(w){return this.clone().imuln(w)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(w){var p=function(k){for(var R=new Array(k.bitLength()),I=0;I>>U&1}return R}(w);if(p.length===0)return new t(1);for(var b=this,g=0;g=0);var p,b=w%26,g=(w-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var k=0;for(p=0;p>>26-b}k&&(this.words[p]=k,this.length++)}if(g!==0){for(p=this.length-1;p>=0;p--)this.words[p+g]=this.words[p];for(p=0;p=0),g=p?(p-p%26)/26:0;var y=w%26,k=Math.min((w-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(w,p,b){return a(this.negative===0),this.iushrn(w,p,b)},t.prototype.shln=function(w){return this.clone().ishln(w)},t.prototype.ushln=function(w){return this.clone().iushln(w)},t.prototype.shrn=function(w){return this.clone().ishrn(w)},t.prototype.ushrn=function(w){return this.clone().iushrn(w)},t.prototype.testn=function(w){a(typeof w=="number"&&w>=0);var p=w%26,b=(w-p)/26,g=1<=0);var p=w%26,b=(w-p)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var g=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},t.prototype.isubn=function(w){if(a(typeof w=="number"),a(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>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(a(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(w,p){var b=(this.length,w.length),g=this.clone(),y=w,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(p!=="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(),p!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(w,p,b){return a(!w.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&w.negative===0?(k=this.neg().divmod(w,p),p!=="mod"&&(g=k.div.neg()),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.iadd(w)),{div:g,mod:y}):this.negative===0&&w.negative!==0?(k=this.divmod(w.neg(),p),p!=="mod"&&(g=k.div.neg()),{div:g,mod:k.mod}):this.negative&w.negative?(k=this.neg().divmod(w.neg(),p),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.isub(w)),{div:k.div,mod:y}):w.length>this.length||this.cmp(w)<0?{div:new t(0),mod:this}:w.length===1?p==="div"?{div:this.divn(w.words[0]),mod:null}:p==="mod"?{div:null,mod:new t(this.modrn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new t(this.modrn(w.words[0]))}:this._wordDiv(w,p);var g,y,k},t.prototype.div=function(w){return this.divmod(w,"div",!1).div},t.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},t.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},t.prototype.divRound=function(w){var p=this.divmod(w);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(w):p.mod,g=w.ushrn(1),y=w.andln(1),k=b.cmp(g);return k<0||y===1&&k===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},t.prototype.modrn=function(w){var p=w<0;p&&(w=-w),a(w<=67108863);for(var b=(1<<26)%w,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%w;return p?-g:g},t.prototype.modn=function(w){return this.modrn(w)},t.prototype.idivn=function(w){var p=w<0;p&&(w=-w),a(w<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/w|0,b=y%w}return this._strip(),p?this.ineg():this},t.prototype.divn=function(w){return this.clone().idivn(w)},t.prototype.egcd=function(w){a(w.negative===0),a(!w.isZero());var p=this,b=w.clone();p=p.negative!==0?p.umod(w):p.clone();for(var g=new t(1),y=new t(0),k=new t(0),R=new t(1),I=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++I;for(var z=b.clone(),U=p.clone();!p.isZero();){for(var q=0,O=1;!(p.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(p.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub(U)),g.iushrn(1),y.iushrn(1);for(var $=0,E=1;!(b.words[0]&E)&&$<26;++$,E<<=1);if($>0)for(b.iushrn($);$-- >0;)(k.isOdd()||R.isOdd())&&(k.iadd(z),R.isub(U)),k.iushrn(1),R.iushrn(1);p.cmp(b)>=0?(p.isub(b),g.isub(k),y.isub(R)):(b.isub(p),k.isub(g),R.isub(y))}return{a:k,b:R,gcd:b.iushln(I)}},t.prototype._invmp=function(w){a(w.negative===0),a(!w.isZero());var p=this,b=w.clone();p=p.negative!==0?p.umod(w):p.clone();for(var g,y=new t(1),k=new t(0),R=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var I=0,z=1;!(p.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(p.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);p.cmp(b)>=0?(p.isub(b),y.isub(k)):(b.isub(p),k.isub(y))}return(g=p.cmpn(1)===0?y:k).cmpn(0)<0&&g.iadd(w),g},t.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var p=this.clone(),b=w.clone();p.negative=0,b.negative=0;for(var g=0;p.isEven()&&b.isEven();g++)p.iushrn(1),b.iushrn(1);for(;;){for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var y=p.cmp(b);if(y<0){var k=p;p=b,b=k}else if(y===0||b.cmpn(1)===0)break;p.isub(b)}return b.iushln(g)},t.prototype.invm=function(w){return this.egcd(w).a.umod(w)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(w){return this.words[0]&w},t.prototype.bincn=function(w){a(typeof w=="number");var p=w%26,b=(w-p)/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(w){var p,b=w<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;if(this._strip(),this.length>1)p=1;else{b&&(w=-w),a(w<=67108863,"Number is too big");var g=0|this.words[0];p=g===w?0:gw.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|w.words[b];if(g!==y){gy&&(p=1);break}}return p},t.prototype.gtn=function(w){return this.cmpn(w)===1},t.prototype.gt=function(w){return this.cmp(w)===1},t.prototype.gten=function(w){return this.cmpn(w)>=0},t.prototype.gte=function(w){return this.cmp(w)>=0},t.prototype.ltn=function(w){return this.cmpn(w)===-1},t.prototype.lt=function(w){return this.cmp(w)===-1},t.prototype.lten=function(w){return this.cmpn(w)<=0},t.prototype.lte=function(w){return this.cmp(w)<=0},t.prototype.eqn=function(w){return this.cmpn(w)===0},t.prototype.eq=function(w){return this.cmp(w)===0},t.red=function(w){return new x(w)},t.prototype.toRed=function(w){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(w){return this.red=w,this},t.prototype.forceRed=function(w){return a(!this.red,"Already a number in reduction context"),this._forceRed(w)},t.prototype.redAdd=function(w){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},t.prototype.redIAdd=function(w){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},t.prototype.redSub=function(w){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},t.prototype.redISub=function(w){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},t.prototype.redShl=function(w){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},t.prototype.redMul=function(w){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},t.prototype.redIMul=function(w){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(w){return a(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var L={k256:null,p224:null,p192:null,p25519:null};function j(w,p){this.name=w,this.p=new t(p,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function P(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function D(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function H(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(w){if(typeof w=="string"){var p=t._prime(w);this.m=p.p,this.prime=p}else a(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}function M(w){x.call(this,w),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}j.prototype._tmp=function(){var w=new t(null);return w.words=new Array(Math.ceil(this.n/13)),w},j.prototype.ireduce=function(w){var p,b=w;do this.split(b,this.tmp),p=(b=(b=this.imulK(b)).iadd(this.tmp)).bitLength();while(p>this.n);var g=p0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},j.prototype.split=function(w,p){w.iushrn(this.n,0,p)},j.prototype.imulK=function(w){return w.imul(this.k)},n(P,j),P.prototype.split=function(w,p){for(var b=Math.min(w.length,9),g=0;g>>22,y=k}y>>>=22,w.words[g-10]=y,y===0&&w.length>10?w.length-=10:w.length-=9},P.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var p=0,b=0;b>>=26,w.words[b]=y,p=g}return p!==0&&(w.words[w.length++]=p),w},t._prime=function(w){if(L[w])return L[w];var p;if(w==="k256")p=new P;else if(w==="p224")p=new D;else if(w==="p192")p=new H;else{if(w!=="p25519")throw new Error("Unknown prime "+w);p=new B}return L[w]=p,p},x.prototype._verify1=function(w){a(w.negative===0,"red works only with positives"),a(w.red,"red works only with red numbers")},x.prototype._verify2=function(w,p){a((w.negative|p.negative)==0,"red works only with positives"),a(w.red&&w.red===p.red,"red works only with red numbers")},x.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):(c(w,w.umod(this.m)._forceRed(this)),w)},x.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},x.prototype.add=function(w,p){this._verify2(w,p);var b=w.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},x.prototype.iadd=function(w,p){this._verify2(w,p);var b=w.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},x.prototype.sub=function(w,p){this._verify2(w,p);var b=w.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},x.prototype.isub=function(w,p){this._verify2(w,p);var b=w.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},x.prototype.shl=function(w,p){return this._verify1(w),this.imod(w.ushln(p))},x.prototype.imul=function(w,p){return this._verify2(w,p),this.imod(w.imul(p))},x.prototype.mul=function(w,p){return this._verify2(w,p),this.imod(w.mul(p))},x.prototype.isqr=function(w){return this.imul(w,w.clone())},x.prototype.sqr=function(w){return this.mul(w,w)},x.prototype.sqrt=function(w){if(w.isZero())return w.clone();var p=this.m.andln(3);if(a(p%2==1),p===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(w,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);a(!g.isZero());var 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(w,g.addn(1).iushrn(1)),O=this.pow(w,g),$=y;O.cmp(k)!==0;){for(var E=O,C=0;E.cmp(k)!==0;C++)E=E.redSqr();a(C<$);var F=this.pow(U,new t(1).iushln($-C-1));q=q.redMul(F),U=F.redSqr(),O=O.redMul(U),$=C}return q},x.prototype.invm=function(w){var p=w._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},x.prototype.pow=function(w,p){if(p.isZero())return new t(1).toRed(this);if(p.cmpn(1)===0)return w.clone();var b=new Array(16);b[0]=new t(1).toRed(this),b[1]=w;for(var g=2;g=0;g--){for(var z=p.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},x.prototype.convertTo=function(w){var p=w.umod(this.m);return p===w?p.clone():p},x.prototype.convertFrom=function(w){var p=w.clone();return p.red=null,p},t.mont=function(w){return new M(w)},n(M,x),M.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},M.prototype.convertFrom=function(w){var p=this.imod(w.mul(this.rinv));return p.red=null,p},M.prototype.imul=function(w,p){if(w.isZero()||p.isZero())return w.words[0]=0,w.length=1,w;var b=w.imul(p),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(w,p){if(w.isZero()||p.isZero())return new t(0)._forceRed(this);var b=w.mul(p),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(w){return this.imod(w._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],187:[function(s,T,S){var m;function o(n){this.rand=n}if(T.exports=function(n){return m||(m=new o(null)),m.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[D>>>16&255]^L[H>>>8&255]^j[255&B]^i[x++],h=A[D>>>24]^N[H>>>16&255]^L[B>>>8&255]^j[255&P]^i[x++],v=A[H>>>24]^N[B>>>16&255]^L[P>>>8&255]^j[255&D]^i[x++],_=A[B>>>24]^N[P>>>16&255]^L[D>>>8&255]^j[255&H]^i[x++],P=d,D=h,H=v,B=_;return d=(f[P>>>24]<<24|f[D>>>16&255]<<16|f[H>>>8&255]<<8|f[255&B])^i[x++],h=(f[D>>>24]<<24|f[H>>>16&255]<<16|f[B>>>8&255]<<8|f[255&P])^i[x++],v=(f[H>>>24]<<24|f[B>>>16&255]<<16|f[P>>>8&255]<<8|f[255&D])^i[x++],_=(f[B>>>24]<<24|f[P>>>16&255]<<16|f[D>>>8&255]<<8|f[255&H])^i[x++],[d>>>=0,h>>>=0,v>>>=0,_>>>=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=[],f=[],u=[[],[],[],[]],d=[[],[],[],[]],h=0,v=0,_=0;_<256;++_){var A=v^v<<1^v<<2^v<<3^v<<4;A=A>>>8^255&A^99,c[h]=A,f[A]=h;var N=r[h],L=r[N],j=r[L],P=257*r[A]^16843008*A;u[0][h]=P<<24|P>>>8,u[1][h]=P<<16|P>>>16,u[2][h]=P<<8|P>>>24,u[3][h]=P,P=16843009*j^65537*L^257*N^16843008*h,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,h===0?h=v=1:(h=N^r[r[r[j^N]]],v^=r[r[v]])}return{SBOX:c,INV_SBOX:f,SUB_MIX:u,INV_SUB_MIX:d}}();function l(r){this._key=o(r),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var r=this._key,i=r.length,c=i+6,f=4*(c+1),u=[],d=0;d>>24,h=e.SBOX[h>>>24]<<24|e.SBOX[h>>>16&255]<<16|e.SBOX[h>>>8&255]<<8|e.SBOX[255&h],h^=t[d/i|0]<<24):i>6&&d%i==4&&(h=e.SBOX[h>>>24]<<24|e.SBOX[h>>>16&255]<<16|e.SBOX[h>>>8&255]<<8|e.SBOX[255&h]),u[d]=u[d-i]^h}for(var v=[],_=0;_>>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=v},l.prototype.encryptBlockRaw=function(r){return n(r=o(r),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(r){var i=this.encryptBlockRaw(r),c=m.allocUnsafe(16);return c.writeUInt32BE(i[0],0),c.writeUInt32BE(i[1],4),c.writeUInt32BE(i[2],8),c.writeUInt32BE(i[3],12),c},l.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),f=m.allocUnsafe(16);return f.writeUInt32BE(c[0],0),f.writeUInt32BE(c[3],4),f.writeUInt32BE(c[2],8),f.writeUInt32BE(c[1],12),f},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},T.exports.AES=l},{"safe-buffer":494}],190:[function(s,T,S){var m=s("./aes"),o=s("safe-buffer").Buffer,a=s("cipher-base"),n=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function r(i,c,f,u){a.call(this);var d=o.alloc(4,0);this._cipher=new m.AES(c);var h=this._cipher.encryptBlock(d);this._ghash=new t(h),f=function(v,_,A){if(_.length===12)return v._finID=o.concat([_,o.from([0,0,0,1])]),o.concat([_,o.from([0,0,0,2])]);var N=new t(A),L=_.length,j=L%16;N.update(_),j&&(j=16-j,N.update(o.alloc(j,0))),N.update(o.alloc(8,0));var P=8*L,D=o.alloc(8);D.writeUIntBE(P,0,8),N.update(D),v._finID=N.state;var H=o.from(v._finID);return l(H),H}(this,f,h),this._prev=o.from(f),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,a),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 f=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(f),this._len+=i.length,f},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,f){var u=0;c.length!==f.length&&u++;for(var d=Math.min(c.length,f.length),h=0;h16)throw new Error("unable to decrypt data");for(var h=-1;++h16)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},S.createDecipher=function(f,u){var d=a[f.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var h=l(u,!1,d.key,d.iv);return c(f,h.key,h.iv)},S.createDecipheriv=c},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(s,T,S){var m=s("./modes"),o=s("./authCipher"),a=s("safe-buffer").Buffer,n=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function r(u,d,h){t.call(this),this._cache=new c,this._cipher=new e.AES(d),this._prev=a.from(h),this._mode=u,this._autopadding=!0}s("inherits")(r,t),r.prototype._update=function(u){var d,h;this._cache.add(u);for(var v=[];d=this._cache.get();)h=this._mode.encrypt(this,d),v.push(h);return a.concat(v)};var i=a.alloc(16,16);function c(){this.cache=a.allocUnsafe(0)}function f(u,d,h){var v=m[u.toLowerCase()];if(!v)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=a.from(d)),d.length!==v.key/8)throw new TypeError("invalid key length "+d.length);if(typeof h=="string"&&(h=a.from(h)),v.mode!=="GCM"&&h.length!==v.iv)throw new TypeError("invalid iv length "+h.length);return v.type==="stream"?new n(v.module,d,h):v.type==="auth"?new o(v.module,d,h):new r(v.module,d,h)}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=a.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=a.allocUnsafe(u),h=-1;++h>>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=m.alloc(16,0),this.cache=m.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,l&&(r[0]=r[0]^225<<24)}this.state=a(i)},n.prototype.update=function(t){var e;for(this.cache=m.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(m.concat([this.cache,o],16)),this.ghash(a([0,t,0,e])),this.state},T.exports=n},{"safe-buffer":494}],195:[function(s,T,S){T.exports=function(m){for(var o,a=m.length;a--;){if((o=m.readUInt8(a))!==255){o++,m.writeUInt8(o,a);break}m.writeUInt8(0,a)}}},{}],196:[function(s,T,S){var m=s("buffer-xor");S.encrypt=function(o,a){var n=m(a,o._prev);return o._prev=o._cipher.encryptBlock(n),o._prev},S.decrypt=function(o,a){var n=o._prev;o._prev=a;var t=o._cipher.decryptBlock(a);return m(t,n)}},{"buffer-xor":219}],197:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("buffer-xor");function a(n,t,e){var l=t.length,r=o(t,n._cache);return n._cache=n._cache.slice(l),n._prev=m.concat([n._prev,e?t:r]),r}S.encrypt=function(n,t,e){for(var l,r=m.allocUnsafe(0);t.length;){if(n._cache.length===0&&(n._cache=n._cipher.encryptBlock(n._prev),n._prev=m.allocUnsafe(0)),!(n._cache.length<=t.length)){r=m.concat([r,a(n,t,e)]);break}l=n._cache.length,r=m.concat([r,a(n,t.slice(0,l),e)]),t=t.slice(l)}return r}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,T,S){var m=s("safe-buffer").Buffer;function o(n,t,e){for(var l,r,i=-1,c=0;++i<8;)l=t&1<<7-i?128:0,c+=(128&(r=n._cipher.encryptBlock(n._prev)[0]^l))>>i%8,n._prev=a(n._prev,e?l:r);return c}function a(n,t){var e=n.length,l=-1,r=m.allocUnsafe(n.length);for(n=m.concat([n,m.from([t])]);++l>7;return r}S.encrypt=function(n,t,e){for(var l=t.length,r=m.allocUnsafe(l),i=-1;++i=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){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)}}(l),i=l.modulus.byteLength(),c=new o(e).mul(r.blinder).umod(l.modulus),f=c.toRed(o.mont(l.prime1)),u=c.toRed(o.mont(l.prime2)),d=l.coefficient,h=l.prime1,v=l.prime2,_=f.redPow(l.exponent1).fromRed(),A=u.redPow(l.exponent2).fromRed(),N=_.isub(A).imul(d).umod(h).imul(v);return A.iadd(N).imul(r.unblinder).umod(l.modulus).toArrayLike(m,"be",i)}t.getr=n,T.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,T,S){T.exports=s("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(s,T,S){T.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(s,T,S){T.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("create-hash"),a=s("readable-stream"),n=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function r(u){a.Writable.call(this);var d=l[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){a.Writable.call(this);var d=l[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 f(u){return new i(u)}Object.keys(l).forEach(function(u){l[u].id=m.from(l[u].id,"hex"),l[u.toLowerCase()]=l[u]}),n(r,a.Writable),r.prototype._write=function(u,d,h){this._hash.update(u),h()},r.prototype.update=function(u,d){return typeof u=="string"&&(u=m.from(u,d)),this._hash.update(u),this},r.prototype.sign=function(u,d){this.end();var h=this._hash.digest(),v=t(h,u,this._hashType,this._signType,this._tag);return d?v.toString(d):v},n(i,a.Writable),i.prototype._write=function(u,d,h){this._hash.update(u),h()},i.prototype.update=function(u,d){return typeof u=="string"&&(u=m.from(u,d)),this._hash.update(u),this},i.prototype.verify=function(u,d,h){typeof d=="string"&&(d=m.from(d,h)),this.end();var v=this._hash.digest();return e(d,v,u,this._signType,this._tag)},T.exports={Sign:c,Verify:f,createSign:c,createVerify:f}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("create-hmac"),a=s("browserify-rsa"),n=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function r(u,d,h,v){if((u=m.from(u.toArray())).length0&&h.ishrn(v),h}function c(u,d,h){var v,_;do{for(v=m.alloc(0);8*v.length=r)throw new Error("invalid sig")}T.exports=function(l,r,i,c,f){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 D=t[P.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var H=new a(D),B=P.data.subjectPrivateKey.data;return H.verify(j,L,B)}(l,r,u)}if(u.type==="dsa"){if(c!=="dsa")throw new Error("wrong public key type");return function(L,j,P){var D=P.data.p,H=P.data.q,B=P.data.g,x=P.data.pub_key,M=n.signature.decode(L,"der"),w=M.s,p=M.r;e(w,H),e(p,H);var b=o.mont(D),g=w.invm(H);return B.toRed(b).redPow(new o(j).mul(g).mod(H)).fromRed().mul(x.toRed(b).redPow(p.mul(g).mod(H)).fromRed()).mod(D).mod(H).cmp(p)===0}(l,r,u)}if(c!=="rsa"&&c!=="ecdsa/rsa")throw new Error("wrong public key type");r=m.concat([f,r]);for(var d=u.modulus.byteLength(),h=[1],v=0;r.length+h.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,h=function(v,_,A){if((192&_[0])!=128)return v.lastNeed=0,"�";if(v.lastNeed>1&&_.length>1){if((192&_[1])!=128)return v.lastNeed=1,"�";if(v.lastNeed>2&&_.length>2&&(192&_[2])!=128)return v.lastNeed=2,"�"}}(this,u);return h!==void 0?h: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 h=u.toString("utf16le",d);if(h){var v=h.charCodeAt(h.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",d,u.length-1)}function l(u){var d=u&&u.length?this.write(u):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,h)}return d}function r(u,d){var h=(u.length-d)%3;return h===0?u.toString("base64",d):(this.lastNeed=3-h,this.lastTotal=3,h===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-h))}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 f(u){return u&&u.length?this.write(u):""}S.StringDecoder=a,a.prototype.write=function(u){if(u.length===0)return"";var d,h;if(this.lastNeed){if((d=this.fillLast(u))===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h=0?(j>0&&(_.lastNeed=j-1),j):--L=0?(j>0&&(_.lastNeed=j-2),j):--L=0?(j>0&&(j===2?j=0:_.lastNeed=j-3),j):0}(this,u,d);if(!this.lastNeed)return u.toString("utf8",d);this.lastTotal=h;var v=u.length-(h-this.lastNeed);return u.copy(this.lastChar,0,v),u.toString("utf8",d,v)},a.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(s,T,S){(function(m){(function(){T.exports=function(o,a){for(var n=Math.min(o.length,a.length),t=new m(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,F){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,F)}function e(E,C,F){if(typeof E=="string")return function(W,K){if(typeof K=="string"&&K!==""||(K="utf8"),!t.isEncoding(K))throw new TypeError("Unknown encoding: "+K);var Q=0|f(W,K),et=n(Q),X=et.write(W,K);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,K,Q){if(K<0||W.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|E}function f(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 F=E.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&F===0)return 0;for(var Y=!1;;)switch(C){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return z(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return U(E).length;default:if(Y)return V?-1:z(E).length;C=(""+C).toLowerCase(),Y=!0}}function u(E,C,F){var V=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(C>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return M(this,C,F);case"utf8":case"utf-8":return H(this,C,F);case"ascii":return B(this,C,F);case"latin1":case"binary":return x(this,C,F);case"base64":return D(this,C,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,C,F);default:if(V)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),V=!0}}function d(E,C,F){var V=E[C];E[C]=E[F],E[F]=V}function h(E,C,F,V,Y){if(E.length===0)return-1;if(typeof F=="string"?(V=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),$(F=+F)&&(F=Y?0:E.length-1),F<0&&(F=E.length+F),F>=E.length){if(Y)return-1;F=E.length-1}else if(F<0){if(!Y)return-1;F=0}if(typeof C=="string"&&(C=t.from(C,V)),t.isBuffer(C))return C.length===0?-1:v(E,C,F,V,Y);if(typeof C=="number")return C&=255,typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(E,C,F):Uint8Array.prototype.lastIndexOf.call(E,C,F):v(E,[C],F,V,Y);throw new TypeError("val must be string, number or Buffer")}function v(E,C,F,V,Y){var W,K=1,Q=E.length,et=C.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(E.length<2||C.length<2)return-1;K=2,Q/=2,et/=2,F/=2}function X(rt,st){return K===1?rt[st]:rt.readUInt16BE(st*K)}if(Y){var J=-1;for(W=F;WQ&&(F=Q-et),W=F;W>=0;W--){for(var G=!0,nt=0;ntY&&(V=Y):V=Y;var W=C.length;V>W/2&&(V=W/2);for(var K=0;K>8,et=K%256,X.push(et),X.push(Q);return X}(C,E.length-F),E,F,V)}function D(E,C,F){return C===0&&F===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(C,F))}function H(E,C,F){F=Math.min(E.length,F);for(var V=[],Y=C;Y239?4:X>223?3:X>191?2:1;if(Y+G<=F)switch(G){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],K=E[Y+2],(192&W)==128&&(192&K)==128&&(et=(15&X)<<12|(63&W)<<6|63&K)>2047&&(et<55296||et>57343)&&(J=et);break;case 4:W=E[Y+1],K=E[Y+2],Q=E[Y+3],(192&W)==128&&(192&K)==128&&(192&Q)==128&&(et=(15&X)<<18|(63&W)<<12|(63&K)<<6|63&Q)>65535&&et<1114112&&(J=et)}J===null?(J=65533,G=1):J>65535&&(J-=65536,V.push(J>>>10&1023|55296),J=56320|1023&J),V.push(J),Y+=G}return function(nt){var rt=nt.length;if(rt<=4096)return String.fromCharCode.apply(String,nt);for(var st="",at=0;atC&&(E+=" ... "),""},t.prototype.compare=function(E,C,F,V,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),F===void 0&&(F=E?E.length:0),V===void 0&&(V=0),Y===void 0&&(Y=this.length),C<0||F>E.length||V<0||Y>this.length)throw new RangeError("out of range index");if(V>=Y&&C>=F)return 0;if(V>=Y)return-1;if(C>=F)return 1;if(this===E)return 0;for(var W=(Y>>>=0)-(V>>>=0),K=(F>>>=0)-(C>>>=0),Q=Math.min(W,K),et=this.slice(V,Y),X=E.slice(C,F),J=0;J>>=0,isFinite(F)?(F>>>=0,V===void 0&&(V="utf8")):(V=F,F=void 0)}var Y=this.length-C;if((F===void 0||F>Y)&&(F=Y),E.length>0&&(F<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var W=!1;;)switch(V){case"hex":return _(this,E,C,F);case"utf8":case"utf-8":return A(this,E,C,F);case"ascii":return N(this,E,C,F);case"latin1":case"binary":return L(this,E,C,F);case"base64":return j(this,E,C,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,C,F);default:if(W)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),W=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(E,C,F){var V="";F=Math.min(E.length,F);for(var Y=C;YV)&&(F=V);for(var Y="",W=C;WF)throw new RangeError("Trying to access beyond buffer length")}function b(E,C,F,V,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,F,V,Y,W){if(F+V>E.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function y(E,C,F,V,Y){return C=+C,F>>>=0,Y||g(E,0,F,4),a.write(E,C,F,V,23,4),F+4}function k(E,C,F,V,Y){return C=+C,F>>>=0,Y||g(E,0,F,8),a.write(E,C,F,V,52,8),F+8}t.prototype.slice=function(E,C){var F=this.length;(E=~~E)<0?(E+=F)<0&&(E=0):E>F&&(E=F),(C=C===void 0?F:~~C)<0?(C+=F)<0&&(C=0):C>F&&(C=F),C>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E],Y=1,W=0;++W>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E+--C],Y=1;C>0&&(Y*=256);)V+=this[E+--C]*Y;return V},t.prototype.readUInt8=function(E,C){return E>>>=0,C||p(E,1,this.length),this[E]},t.prototype.readUInt16LE=function(E,C){return E>>>=0,C||p(E,2,this.length),this[E]|this[E+1]<<8},t.prototype.readUInt16BE=function(E,C){return E>>>=0,C||p(E,2,this.length),this[E]<<8|this[E+1]},t.prototype.readUInt32LE=function(E,C){return E>>>=0,C||p(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||p(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},t.prototype.readIntLE=function(E,C,F){E>>>=0,C>>>=0,F||p(E,C,this.length);for(var V=this[E],Y=1,W=0;++W=(Y*=128)&&(V-=Math.pow(2,8*C)),V},t.prototype.readIntBE=function(E,C,F){E>>>=0,C>>>=0,F||p(E,C,this.length);for(var V=C,Y=1,W=this[E+--V];V>0&&(Y*=256);)W+=this[E+--V]*Y;return W>=(Y*=128)&&(W-=Math.pow(2,8*C)),W},t.prototype.readInt8=function(E,C){return E>>>=0,C||p(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},t.prototype.readInt16LE=function(E,C){E>>>=0,C||p(E,2,this.length);var F=this[E]|this[E+1]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt16BE=function(E,C){E>>>=0,C||p(E,2,this.length);var F=this[E+1]|this[E]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt32LE=function(E,C){return E>>>=0,C||p(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||p(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||p(E,4,this.length),a.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,C){return E>>>=0,C||p(E,4,this.length),a.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,C){return E>>>=0,C||p(E,8,this.length),a.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,C){return E>>>=0,C||p(E,8,this.length),a.read(this,E,!1,52,8)},t.prototype.writeUIntLE=function(E,C,F,V){E=+E,C>>>=0,F>>>=0,V||b(this,E,C,F,Math.pow(2,8*F)-1,0);var Y=1,W=0;for(this[C]=255&E;++W>>=0,F>>>=0,V||b(this,E,C,F,Math.pow(2,8*F)-1,0);var Y=F-1,W=1;for(this[C+Y]=255&E;--Y>=0&&(W*=256);)this[C+Y]=E/W&255;return C+F},t.prototype.writeUInt8=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,1,255,0),this[C]=255&E,C+1},t.prototype.writeUInt16LE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,65535,0),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeUInt16BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,65535,0),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeUInt32LE=function(E,C,F){return E=+E,C>>>=0,F||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,F){return E=+E,C>>>=0,F||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,F,V){if(E=+E,C>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,E,C,F,Y-1,-Y)}var W=0,K=1,Q=0;for(this[C]=255&E;++W>0)-Q&255;return C+F},t.prototype.writeIntBE=function(E,C,F,V){if(E=+E,C>>>=0,!V){var Y=Math.pow(2,8*F-1);b(this,E,C,F,Y-1,-Y)}var W=F-1,K=1,Q=0;for(this[C+W]=255&E;--W>=0&&(K*=256);)E<0&&Q===0&&this[C+W+1]!==0&&(Q=1),this[C+W]=(E/K>>0)-Q&255;return C+F},t.prototype.writeInt8=function(E,C,F){return E=+E,C>>>=0,F||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,F){return E=+E,C>>>=0,F||b(this,E,C,2,32767,-32768),this[C]=255&E,this[C+1]=E>>>8,C+2},t.prototype.writeInt16BE=function(E,C,F){return E=+E,C>>>=0,F||b(this,E,C,2,32767,-32768),this[C]=E>>>8,this[C+1]=255&E,C+2},t.prototype.writeInt32LE=function(E,C,F){return E=+E,C>>>=0,F||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,F){return E=+E,C>>>=0,F||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,F){return y(this,E,C,!0,F)},t.prototype.writeFloatBE=function(E,C,F){return y(this,E,C,!1,F)},t.prototype.writeDoubleLE=function(E,C,F){return k(this,E,C,!0,F)},t.prototype.writeDoubleBE=function(E,C,F){return k(this,E,C,!1,F)},t.prototype.copy=function(E,C,F,V){if(!t.isBuffer(E))throw new TypeError("argument should be a Buffer");if(F||(F=0),V||V===0||(V=this.length),C>=E.length&&(C=E.length),C||(C=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),E.length-C=0;--W)E[W+C]=this[W+F];else Uint8Array.prototype.set.call(E,this.subarray(F,V),C);return Y},t.prototype.fill=function(E,C,F,V){if(typeof E=="string"){if(typeof C=="string"?(V=C,C=0,F=this.length):typeof F=="string"&&(V=F,F=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!t.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(E.length===1){var Y=E.charCodeAt(0);(V==="utf8"&&Y<128||V==="latin1")&&(E=Y)}}else typeof E=="number"&&(E&=255);if(C<0||this.length>>=0,F=F===void 0?this.length:F>>>0,E||(E=0),typeof E=="number")for(W=C;W55295&&F<57344){if(!Y){if(F>56319){(C-=3)>-1&&W.push(239,191,189);continue}if(K+1===V){(C-=3)>-1&&W.push(239,191,189);continue}Y=F;continue}if(F<56320){(C-=3)>-1&&W.push(239,191,189),Y=F;continue}F=65536+(Y-55296<<10|F-56320)}else Y&&(C-=3)>-1&&W.push(239,191,189);if(Y=null,F<128){if((C-=1)<0)break;W.push(F)}else if(F<2048){if((C-=2)<0)break;W.push(F>>6|192,63&F|128)}else if(F<65536){if((C-=3)<0)break;W.push(F>>12|224,F>>6&63|128,63&F|128)}else{if(!(F<1114112))throw new Error("Invalid code point");if((C-=4)<0)break;W.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|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,F,V){for(var Y=0;Y=C.length||Y>=E.length);++Y)C[Y+F]=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 $(E){return E!=E}}).call(this)}).call(this,s("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(s,T,S){var m=s("safe-buffer").Buffer,o=s("stream").Transform,a=s("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}s("inherits")(n,o),n.prototype.update=function(t,e,l){typeof t=="string"&&(t=m.from(t,e));var r=this._update(t);return this.hashMode?this:(l&&(r=this._toString(r,l)),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,l){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){r=i}finally{l(r)}},n.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(l){e=l}t(e)},n.prototype._finalOrDigest=function(t){var e=this.__final()||m.alloc(0);return t&&(e=this._toString(e,t,!0)),e},n.prototype._toString=function(t,e,l){if(this._decoder||(this._decoder=new a(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return l&&(r+=this._decoder.end()),r},T.exports=n},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(s,T,S){var m=s("../internals/is-callable"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(n){if(m(n))return n;throw new a(o(n)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(s,T,S){var m=s("../internals/is-constructor"),o=s("../internals/try-to-string"),a=TypeError;T.exports=function(n){if(m(n))return n;throw new a(o(n)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(s,T,S){var m=s("../internals/is-callable"),o=String,a=TypeError;T.exports=function(n){if(typeof n=="object"||m(n))return n;throw new a("Can't set "+o(n)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(s,T,S){var m=s("../internals/well-known-symbol"),o=s("../internals/object-create"),a=s("../internals/object-define-property").f,n=m("unscopables"),t=Array.prototype;t[n]===void 0&&a(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(s,T,S){var m=s("../internals/object-is-prototype-of"),o=TypeError;T.exports=function(a,n){if(m(n,a))return a;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(s,T,S){var m=s("../internals/is-object"),o=String,a=TypeError;T.exports=function(n){if(m(n))return n;throw new a(o(n)+" is not an object")}},{"../internals/is-object":289}],228:[function(s,T,S){var m=s("../internals/to-indexed-object"),o=s("../internals/to-absolute-index"),a=s("../internals/length-of-array-like"),n=function(t){return function(e,l,r){var i,c=m(e),f=a(c),u=o(r,f);if(t&&l!=l){for(;f>u;)if((i=c[u++])!=i)return!0}else for(;f>u;u++)if((t||u in c)&&c[u]===l)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(s,T,S){var m=s("../internals/function-bind-context"),o=s("../internals/function-uncurry-this"),a=s("../internals/indexed-object"),n=s("../internals/to-object"),t=s("../internals/length-of-array-like"),e=s("../internals/array-species-create"),l=o([].push),r=function(i){var c=i===1,f=i===2,u=i===3,d=i===4,h=i===6,v=i===7,_=i===5||h;return function(A,N,L,j){for(var P,D,H=n(A),B=a(H),x=m(N,L),M=t(B),w=0,p=j||e,b=c?p(A,M):f||v?p(A,0):void 0;M>w;w++)if((_||w in B)&&(D=x(P=B[w],w,H),i))if(c)b[w]=D;else if(D)switch(i){case 3:return!0;case 5:return P;case 6:return w;case 2:l(b,P)}else switch(i){case 4:return!1;case 7:l(b,P)}return h?-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(s,T,S){var m=s("../internals/to-absolute-index"),o=s("../internals/length-of-array-like"),a=s("../internals/create-property"),n=Array,t=Math.max;T.exports=function(e,l,r){for(var i=o(e),c=m(l,i),f=m(r===void 0?i:r,i),u=n(t(f-c,0)),d=0;c0&&m[0]<4?1:+(m[0]+m[1])),!o&&n&&(!(m=n.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=n.match(/Chrome\/(\d+)/))&&(o=+m[1]),T.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(s,T,S){T.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(s,T,S){var m=s("../internals/global"),o=s("../internals/object-get-own-property-descriptor").f,a=s("../internals/create-non-enumerable-property"),n=s("../internals/define-built-in"),t=s("../internals/define-global-property"),e=s("../internals/copy-constructor-properties"),l=s("../internals/is-forced");T.exports=function(r,i){var c,f,u,d,h,v=r.target,_=r.global,A=r.stat;if(c=_?m:A?m[v]||t(v,{}):(m[v]||{}).prototype)for(f in i){if(d=i[f],u=r.dontCallGetSet?(h=o(c,f))&&h.value:c[f],!l(_?f:v+(A?".":"#")+f,r.forced)&&u!==void 0){if(typeof d==typeof u)continue;e(d,u)}(r.sham||u&&u.sham)&&a(d,"sham",!0),n(c,f,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(s,T,S){T.exports=function(m){try{return!!m()}catch(o){return!0}}},{}],261:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype,a=o.apply,n=o.call;T.exports=typeof Reflect=="object"&&Reflect.apply||(m?n.bind(a):function(){return n.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(s,T,S){var m=s("../internals/function-uncurry-this-clause"),o=s("../internals/a-callable"),a=s("../internals/function-bind-native"),n=m(m.bind);T.exports=function(t,e){return o(t),e===void 0?t:a?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(s,T,S){var m=s("../internals/fails");T.exports=!m(function(){var o=function(){}.bind();return typeof o!="function"||o.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype.call;T.exports=m?o.bind(o):function(){return o.apply(o,arguments)}},{"../internals/function-bind-native":263}],265:[function(s,T,S){var m=s("../internals/descriptors"),o=s("../internals/has-own-property"),a=Function.prototype,n=m&&Object.getOwnPropertyDescriptor,t=o(a,"name"),e=t&&function(){}.name==="something",l=t&&(!m||m&&n(a,"name").configurable);T.exports={EXISTS:t,PROPER:e,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/a-callable");T.exports=function(a,n,t){try{return m(o(Object.getOwnPropertyDescriptor(a,n)[t]))}catch(e){}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(s,T,S){var m=s("../internals/classof-raw"),o=s("../internals/function-uncurry-this");T.exports=function(a){if(m(a)==="Function")return o(a)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(s,T,S){var m=s("../internals/function-bind-native"),o=Function.prototype,a=o.call,n=m&&o.bind.bind(a,a);T.exports=m?n:function(t){return function(){return a.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(s,T,S){var m=s("../internals/global"),o=s("../internals/is-callable"),a=function(n){return o(n)?n:void 0};T.exports=function(n,t){return arguments.length<2?a(m[n]):m[n]&&m[n][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(s,T,S){var m=s("../internals/classof"),o=s("../internals/get-method"),a=s("../internals/is-null-or-undefined"),n=s("../internals/iterators"),t=s("../internals/well-known-symbol")("iterator");T.exports=function(e){if(!a(e))return o(e,t)||o(e,"@@iterator")||n[m(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(s,T,S){var m=s("../internals/function-call"),o=s("../internals/a-callable"),a=s("../internals/an-object"),n=s("../internals/try-to-string"),t=s("../internals/get-iterator-method"),e=TypeError;T.exports=function(l,r){var i=arguments.length<2?t(l):r;if(o(i))return a(m(i,l));throw new e(n(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/is-array"),a=s("../internals/is-callable"),n=s("../internals/classof-raw"),t=s("../internals/to-string"),e=m([].push);T.exports=function(l){if(a(l))return l;if(o(l)){for(var r=l.length,i=[],c=0;cL;L++)if((P=y(h[L]))&&l(d,P))return P;return new u(!1)}A=r(h,N)}for(D=M?h.next:A.next;!(H=o(D,A)).done;){try{P=y(H.value)}catch(k){c(A,"throw",k)}if(typeof P=="object"&&P&&l(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(s,T,S){var m=s("../internals/function-call"),o=s("../internals/an-object"),a=s("../internals/get-method");T.exports=function(n,t,e){var l,r;o(n);try{if(!(l=a(n,"return"))){if(t==="throw")throw e;return e}l=m(l,n)}catch(i){r=!0,l=i}if(t==="throw")throw e;if(r)throw l;return o(l),e}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(s,T,S){var m=s("../internals/iterators-core").IteratorPrototype,o=s("../internals/object-create"),a=s("../internals/create-property-descriptor"),n=s("../internals/set-to-string-tag"),t=s("../internals/iterators"),e=function(){return this};T.exports=function(l,r,i,c){var f=r+" Iterator";return l.prototype=o(m,{next:a(+!c,i)}),n(l,f,!1,!0),t[f]=e,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(s,T,S){var m=s("../internals/export"),o=s("../internals/function-call"),a=s("../internals/is-pure"),n=s("../internals/function-name"),t=s("../internals/is-callable"),e=s("../internals/iterator-create-constructor"),l=s("../internals/object-get-prototype-of"),r=s("../internals/object-set-prototype-of"),i=s("../internals/set-to-string-tag"),c=s("../internals/create-non-enumerable-property"),f=s("../internals/define-built-in"),u=s("../internals/well-known-symbol"),d=s("../internals/iterators"),h=s("../internals/iterators-core"),v=n.PROPER,_=n.CONFIGURABLE,A=h.IteratorPrototype,N=h.BUGGY_SAFARI_ITERATORS,L=u("iterator"),j=function(){return this};T.exports=function(P,D,H,B,x,M,w){e(H,D,B);var p,b,g,y=function(O){if(O===x&&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=D+" Iterator",R=!1,I=P.prototype,z=I[L]||I["@@iterator"]||x&&I[x],U=!N&&z||y(x),q=D==="Array"&&I.entries||z;if(q&&(p=l(q.call(new P)))!==Object.prototype&&p.next&&(a||l(p)===A||(r?r(p,A):t(p[L])||f(p,L,j)),i(p,k,!0,!0),a&&(d[k]=j)),v&&x==="values"&&z&&z.name!=="values"&&(!a&&_?c(I,"name","values"):(R=!0,U=function(){return o(z,this)})),x)if(b={values:y("values"),keys:M?U:y("keys"),entries:y("entries")},w)for(g in b)(N||R||!(g in I))&&f(I,g,b[g]);else m({target:D,proto:!0,forced:N||R},b);return a&&!w||I[L]===U||f(I,L,U,{name:x}),d[D]=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(s,T,S){var m,o,a,n=s("../internals/fails"),t=s("../internals/is-callable"),e=s("../internals/is-object"),l=s("../internals/object-create"),r=s("../internals/object-get-prototype-of"),i=s("../internals/define-built-in"),c=s("../internals/well-known-symbol"),f=s("../internals/is-pure"),u=c("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(o=r(r(a)))!==Object.prototype&&(m=o):d=!0),!e(m)||n(function(){var h={};return m[u].call(h)!==h})?m={}:f&&(m=l(m)),t(m[u])||i(m,u,function(){return this}),T.exports={IteratorPrototype:m,BUGGY_SAFARI_ITERATORS:d}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(s,T,S){arguments[4][276][0].apply(S,arguments)},{dup:276}],299:[function(s,T,S){var m=s("../internals/to-length");T.exports=function(o){return m(o.length)}},{"../internals/to-length":343}],300:[function(s,T,S){var m=s("../internals/function-uncurry-this"),o=s("../internals/fails"),a=s("../internals/is-callable"),n=s("../internals/has-own-property"),t=s("../internals/descriptors"),e=s("../internals/function-name").CONFIGURABLE,l=s("../internals/inspect-source"),r=s("../internals/internal-state"),i=r.enforce,c=r.get,f=String,u=Object.defineProperty,d=m("".slice),h=m("".replace),v=m([].join),_=t&&!o(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=T.exports=function(L,j,P){d(f(j),0,7)==="Symbol("&&(j="["+h(f(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),_&&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(H){}var D=i(L);return n(D,"source")||(D.source=v(A,typeof j=="string"?j:"")),L};Function.prototype.toString=N(function(){return a(this)&&c(this).source||l(this)},"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(s,T,S){var m=Math.ceil,o=Math.floor;T.exports=Math.trunc||function(a){var n=+a;return(n>0?o:m)(n)}},{}],302:[function(s,T,S){var m,o,a,n,t,e=s("../internals/global"),l=s("../internals/function-bind-context"),r=s("../internals/object-get-own-property-descriptor").f,i=s("../internals/task").set,c=s("../internals/queue"),f=s("../internals/engine-is-ios"),u=s("../internals/engine-is-ios-pebble"),d=s("../internals/engine-is-webos-webkit"),h=s("../internals/engine-is-node"),v=e.MutationObserver||e.WebKitMutationObserver,_=e.document,A=e.process,N=e.Promise,L=r(e,"queueMicrotask"),j=L&&L.value;if(!j){var P=new c,D=function(){var H,B;for(h&&(H=A.domain)&&H.exit();B=P.get();)try{B()}catch(x){throw P.head&&m(),x}H&&H.enter()};f||h||d||!v||!_?!u&&N&&N.resolve?((n=N.resolve(void 0)).constructor=N,t=l(n.then,n),m=function(){t(D)}):h?m=function(){A.nextTick(D)}:(i=l(i,e),m=function(){i(D)}):(o=!0,a=_.createTextNode(""),new v(D).observe(a,{characterData:!0}),m=function(){a.data=o=!o}),j=function(H){P.head||m(),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(s,T,S){var m=s("../internals/a-callable"),o=TypeError,a=function(n){var t,e;this.promise=new n(function(l,r){if(t!==void 0||e!==void 0)throw new o("Bad Promise constructor");t=l,e=r}),this.resolve=m(t),this.reject=m(e)};T.exports.f=function(n){return new a(n)}},{"../internals/a-callable":222}],304:[function(s,T,S){var m=s("../internals/is-regexp"),o=TypeError;T.exports=function(a){if(m(a))throw new o("The method doesn't accept regular expressions");return a}},{"../internals/is-regexp":291}],305:[function(s,T,S){var m=s("../internals/descriptors"),o=s("../internals/function-uncurry-this"),a=s("../internals/function-call"),n=s("../internals/fails"),t=s("../internals/object-keys"),e=s("../internals/object-get-own-property-symbols"),l=s("../internals/object-property-is-enumerable"),r=s("../internals/to-object"),i=s("../internals/indexed-object"),c=Object.assign,f=Object.defineProperty,u=o([].concat);T.exports=!c||n(function(){if(m&&c({b:1},c(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},h={},v=Symbol("assign detection");return d[v]=7,"abcdefghijklmnopqrst".split("").forEach(function(_){h[_]=_}),c({},d)[v]!==7||t(c({},h)).join("")!=="abcdefghijklmnopqrst"})?function(d,h){for(var v=r(d),_=arguments.length,A=1,N=e.f,L=l.f;_>A;)for(var j,P=i(arguments[A++]),D=N?u(t(P),N(P)):t(P),H=D.length,B=0;H>B;)j=D[B++],m&&!a(L,P,j)||(v[j]=P[j]);return v}: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(s,T,S){var m,o=s("../internals/an-object"),a=s("../internals/object-define-properties"),n=s("../internals/enum-bug-keys"),t=s("../internals/hidden-keys"),e=s("../internals/html"),l=s("../internals/document-create-element"),r=s("../internals/shared-key"),i=r("IE_PROTO"),c=function(){},f=function(h){return"