commit dea87530ecd13f9f2f8ff288d3f19cb887dcce20 Author: bender Date: Mon Jun 30 13:31:43 2025 +0000 JIS Release diff --git a/.vite/manifest.json b/.vite/manifest.json new file mode 100644 index 0000000..4c9db91 --- /dev/null +++ b/.vite/manifest.json @@ -0,0 +1,69 @@ +{ + "_exceljs.min-BNb-FBo6.js": { + "file": "assets/exceljs.min-BNb-FBo6.js", + "name": "exceljs.min", + "isDynamicEntry": true, + "imports": [ + "index.html" + ] + }, + "_jspdf.es.min-DCw0FjSx.js": { + "file": "assets/jspdf.es.min-DCw0FjSx.js", + "name": "jspdf.es.min", + "isDynamicEntry": true, + "imports": [ + "index.html" + ], + "dynamicImports": [ + "node_modules/html2canvas/dist/html2canvas.esm.js", + "node_modules/dompurify/dist/purify.es.js", + "node_modules/canvg/lib/index.es.js" + ] + }, + "_jspdf.plugin.autotable-BNSPgntu.js": { + "file": "assets/jspdf.plugin.autotable-BNSPgntu.js", + "name": "jspdf.plugin.autotable", + "isDynamicEntry": true, + "imports": [ + "index.html", + "_jspdf.es.min-DCw0FjSx.js" + ] + }, + "index.html": { + "file": "assets/index-Cnr5LCrh.js", + "name": "index", + "src": "index.html", + "isEntry": true, + "dynamicImports": [ + "_jspdf.es.min-DCw0FjSx.js", + "_jspdf.plugin.autotable-BNSPgntu.js", + "_exceljs.min-BNb-FBo6.js", + "_exceljs.min-BNb-FBo6.js", + "_exceljs.min-BNb-FBo6.js" + ], + "css": [ + "assets/index-D63NlNN3.css" + ] + }, + "node_modules/canvg/lib/index.es.js": { + "file": "assets/index.es-B7n9GvR0.js", + "name": "index.es", + "src": "node_modules/canvg/lib/index.es.js", + "isDynamicEntry": true, + "imports": [ + "index.html" + ] + }, + "node_modules/dompurify/dist/purify.es.js": { + "file": "assets/purify.es-C_uT9hQ1.js", + "name": "purify.es", + "src": "node_modules/dompurify/dist/purify.es.js", + "isDynamicEntry": true + }, + "node_modules/html2canvas/dist/html2canvas.esm.js": { + "file": "assets/html2canvas.esm-CBrSDip1.js", + "name": "html2canvas.esm", + "src": "node_modules/html2canvas/dist/html2canvas.esm.js", + "isDynamicEntry": true + } +} \ No newline at end of file diff --git a/assets/exceljs.min-BNb-FBo6.js b/assets/exceljs.min-BNb-FBo6.js new file mode 100644 index 0000000..ebed6fe --- /dev/null +++ b/assets/exceljs.min-BNb-FBo6.js @@ -0,0 +1,57 @@ +import{c as De,a as Kt,g as qe}from"./index-Cnr5LCrh.js";function We(Ee,Fe){for(var s=0;sT[S]})}}}return Object.freeze(Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"}))}var ze={exports:{}};/*! ExcelJS 19-10-2023 */var He;function Xe(){return He||(He=1,function(Ee,Fe){(function(s){Ee.exports=s()})(function(){return function s(T,S,m){function a(t,e){if(!S[t]){if(!T[t]){var l=typeof De=="function"&&De;if(!e&&l)return l(t,!0);if(o)return o(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=S[t]={exports:{}};T[t][0].call(i.exports,function(f){return a(T[t][1][f]||f)},i,i.exports,s,T,S,m)}return S[t].exports}for(var o=typeof De=="function"&&De,r=0;r{const d=this.workbook.addWorksheet(f.sheetName),h=f.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=f.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 U=t(A,D,!0);return U.isValid()?U:null},null);if(L)return new Date(L.valueOf());const I=n[A];return I!==void 0?I:A},_=a.parse(f.parserOptions).on("data",A=>{d.addRow(A.map(w))}).on("end",()=>{_.emit("worksheet",d)});_.on("worksheet",c).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,f){return new Promise((c,u)=>{f=f||{};const d=this.workbook.getWorksheet(f.sheetName||f.sheetId),h=a.format(f.formatterOptions);i.on("finish",()=>{c()}),h.on("error",u),h.pipe(i);const{dateFormat:w,dateUTC:_}=f,A=f.map||(I=>{if(I){if(I.text||I.hyperlink)return I.hyperlink||I.text||"";if(I.formula||I.result)return I.result||"";if(I instanceof Date)return w?_?t.utc(I).format(w):t(I).format(w):_?t.utc(I).format():t(I).format();if(I.error)return I.error;if(typeof I=="object")return JSON.stringify(I)}return I}),N=f.includeEmptyRows===void 0||f.includeEmptyRows;let L=1;d&&d.eachRow((I,P)=>{if(N)for(;L++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,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(r){return r instanceof a||r==null?r:new a(r)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(r){this.nativeCol=Math.floor(r),this.nativeColOff=Math.floor((r-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(r){this.nativeRow=Math.floor(r),this.nativeRowOff=Math.floor((r-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(r){this.nativeCol=r.nativeCol,this.nativeColOff=r.nativeColOff,this.nativeRow=r.nativeRow,this.nativeRowOff=r.nativeRowOff}}T.exports=a},{"../utils/col-cache":19}],3:[function(s,T,S){const m=s("../utils/col-cache"),a=s("../utils/under-dash"),o=s("./enums"),{slideFormula:r}=s("../utils/shared-formula"),t=s("./note");class e{constructor(i,f,c){if(!i||!f)throw new Error("A Cell needs a Row");this._row=i,this._column=f,m.validateAddress(c),this._address=c,this._value=l.create(e.Types.Null,this),this.style=this._mergeStyle(i.style,f.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,f,c){const u=i&&i.numFmt||f&&f.numFmt;u&&(c.numFmt=u);const d=i&&i.font||f&&f.font;d&&(c.font=d);const h=i&&i.alignment||f&&f.alignment;h&&(c.alignment=h);const w=i&&i.border||f&&f.border;w&&(c.border=w);const _=i&&i.fill||f&&f.fill;_&&(c.fill=_);const A=i&&i.protection||f&&f.protection;return A&&(c.protection=A),c}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,f){this._value.release(),this._value=l.create(e.Types.Merge,this,i),f||(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 a.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:f}=this.workbook;f.removeAllNames(this.fullAddress),i.forEach(c=>{f.addEx(this.fullAddress,c)})}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=o.ValueType;const l={getType:n=>n==null?e.Types.Null:n instanceof String||typeof n=="string"?e.Types.String:typeof n=="number"?e.Types.Number:typeof n=="boolean"?e.Types.Boolean:n instanceof Date?e.Types.Date:n.text&&n.hyperlink?e.Types.Hyperlink:n.formula||n.sharedFormula?e.Types.Formula:n.richText?e.Types.RichText:n.sharedString?e.Types.SharedString:n.error?e.Types.Error:e.Types.JSON,types:[{t:e.Types.Null,f:class{constructor(n){this.model={address:n.address,type:e.Types.Null}}get value(){return null}set value(n){}get type(){return e.Types.Null}get effectiveType(){return e.Types.Null}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){}toString(){return""}}},{t:e.Types.Number,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Number,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Number}get effectiveType(){return e.Types.Number}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.String,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:e.Types.Date,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Date,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Date}get effectiveType(){return e.Types.Date}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Hyperlink,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Hyperlink,text:i?i.text:void 0,hyperlink:i?i.hyperlink:void 0},i&&i.tooltip&&(this.model.tooltip=i.tooltip)}get value(){const n={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(n.tooltip=this.model.tooltip),n}set value(n){this.model={text:n.text,hyperlink:n.hyperlink},n.tooltip&&(this.model.tooltip=n.tooltip)}get text(){return this.model.text}set text(n){this.model.text=n}get hyperlink(){return this.model.hyperlink}set hyperlink(n){this.model.hyperlink=n}get type(){return e.Types.Hyperlink}get effectiveType(){return e.Types.Hyperlink}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:e.Types.Formula,f:class{constructor(n,i){this.cell=n,this.model={address:n.address,type:e.Types.Formula,shareType:i?i.shareType:void 0,ref:i?i.ref:void 0,formula:i?i.formula:void 0,sharedFormula:i?i.sharedFormula:void 0,result:i?i.result:void 0}}_copyModel(n){const i={},f=c=>{const u=n[c];u&&(i[c]=u)};return f("formula"),f("result"),f("ref"),f("shareType"),f("sharedFormula"),i}get value(){return this._copyModel(this.model)}set value(n){this.model=this._copyModel(n)}validate(n){switch(l.getType(n)){case e.Types.Null:case e.Types.String:case e.Types.Number:case e.Types.Date:break;case e.Types.Hyperlink:case e.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(n){this.model.formula=n}get formulaType(){return this.model.formula?o.FormulaType.Master:this.model.sharedFormula?o.FormulaType.Shared:o.FormulaType.None}get result(){return this.model.result}set result(n){this.model.result=n}get type(){return e.Types.Formula}get effectiveType(){const n=this.model.result;return n==null?o.ValueType.Null:n instanceof String||typeof n=="string"?o.ValueType.String:typeof n=="number"?o.ValueType.Number:n instanceof Date?o.ValueType.Date:n.text&&n.hyperlink?o.ValueType.Hyperlink:n.formula?o.ValueType.Formula:o.ValueType.Null}get address(){return this.model.address}set address(n){this.model.address=n}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:n}=this.cell,i=n.findCell(this.model.sharedFormula);this._translatedFormula=i&&r(i.formula,i.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:e.Types.Merge,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Merge,master:i?i.address:void 0},this._master=i,i&&i.addMergeRef()}get value(){return this._master.value}set value(n){n instanceof e?(this._master&&this._master.releaseMergeRef(),n.addMergeRef(),this._master=n):this._master.value=n}isMergedTo(n){return n===this._master}get master(){return this._master}get type(){return e.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:e.Types.JSON,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:JSON.stringify(i),rawValue:i}}get value(){return this.model.rawValue}set value(n){this.model.rawValue=n,this.model.value=JSON.stringify(n)}get type(){return e.Types.String}get effectiveType(){return e.Types.String}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:e.Types.SharedString,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.SharedString,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.SharedString}get effectiveType(){return e.Types.SharedString}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.RichText,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.String,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}toString(){return this.model.value.richText.map(n=>n.text).join("")}get type(){return e.Types.RichText}get effectiveType(){return e.Types.RichText}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:e.Types.Boolean,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Boolean,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Boolean}get effectiveType(){return e.Types.Boolean}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:e.Types.Error,f:class{constructor(n,i){this.model={address:n.address,type:e.Types.Error,value:i}}get value(){return this.model.value}set value(n){this.model.value=n}get type(){return e.Types.Error}get effectiveType(){return e.Types.Error}get address(){return this.model.address}set address(n){this.model.address=n}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((n,i)=>(n[i.t]=i.f,n),[]),create(n,i,f){const c=this.types[n];if(!c)throw new Error("Could not create Value of type "+n);return new c(i,f)}};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"),a=s("./enums"),o=s("../utils/col-cache");class r{constructor(e,l,n){this._worksheet=e,this._number=l,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return o.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=e.width!==void 0?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){e!==void 0?(this._header=e,this.headers.forEach((l,n)=>{this._worksheet.getCell(n+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&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 n=this.number;l||(l=e,e=null),this._worksheet.eachRow(e,(i,f)=>{l(i.getCell(n),f)})}get values(){const e=[];return this.eachCell((l,n)=>{l&&l.type!==a.ValueType.Null&&(e[n]=l.value)}),e}set values(e){if(!e)return;const l=this.number;let n=0;e.hasOwnProperty("0")&&(n=1),e.forEach((i,f)=>{this._worksheet.getCell(f+n,l).value=i})}_applyStyle(e,l){return this.style[e]=l,this.eachCell(n=>{n[e]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const l=[];let n=null;return e&&e.forEach((i,f)=>{i.isDefault?n&&(n=null):n&&i.equivalentTo(n)?n.max=f+1:(n={min:f+1,max:f+1,width:i.width!==void 0?i.width:9,style:i.style,isCustomWidth:i.isCustomWidth,hidden:i.hidden,outlineLevel:i.outlineLevel,collapsed:i.collapsed},l.push(n))}),l.length?l:void 0}static fromModel(e,l){const n=[];let i=1,f=0;for(l=(l=l||[]).sort(function(c,u){return c.min-u.min});f{l.removeCellEx(e)})}forEach(e){m.each(this.matrixMap,(l,n)=>{l.forEach(i=>{e(n,i)})})}getNames(e){return this.getNamesEx(a.decodeEx(e))}getNamesEx(e){return m.map(this.matrixMap,(l,n)=>l.findCellEx(e)&&n).filter(Boolean)}_explore(e,l){l.mark=!1;const{sheetName:n}=l,i=new r(l.row,l.col,l.row,l.col,n);let f,c;function u(h,w){const _=e.findCellAt(n,h,l.col);return!(!_||!_.mark)&&(i[w]=h,_.mark=!1,!0)}for(c=l.row-1;u(c,"top");c--);for(c=l.row+1;u(c,"bottom");c++);function d(h,w){const _=[];for(c=i.top;c<=i.bottom;c++){const A=e.findCellAt(n,c,h);if(!A||!A.mark)return!1;_.push(A)}i[w]=h;for(let A=0;A<_.length;A++)_[A].mark=!1;return!0}for(f=l.col-1;d(f,"left");f--);for(f=l.col+1;d(f,"right");f++);return i}getRanges(e,l){return(l=l||this.matrixMap[e])?(l.forEach(n=>{n.mark=!0}),{name:e,ranges:l.map(n=>n.mark&&this._explore(l,n)).filter(Boolean).map(n=>n.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,l){e.forEachInSheet(l,(n,i,f)=>{n&&(n.row===i&&n.col===f||(n.row=i,n.col=f,n.address=a.n2l(f)+i))})}spliceRows(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceRows(e,l,n,i),this.normaliseMatrix(f,e)})}spliceColumns(e,l,n,i){m.each(this.matrixMap,f=>{f.spliceColumns(e,l,n,i),this.normaliseMatrix(f,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(n=>{const i=l[n.name]=new o;n.ranges.forEach(f=>{t.test(f.split("!").pop()||"")&&i.addCell(f)})})}}},{"../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"),a=s("./anchor");T.exports=class{constructor(o,r){this.worksheet=o,this.model=r}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(o){let{type:r,imageId:t,range:e,hyperlinks:l}=o;if(this.type=r,this.imageId=t,r==="image")if(typeof e=="string"){const n=m.decode(e);this.range={tl:new a(this.worksheet,{col:n.left,row:n.top},-1),br:new a(this.worksheet,{col:n.right,row:n.bottom},0),editAs:"oneCell"}}else this.range={tl:new a(this.worksheet,e.tl,0),br:e.br&&new a(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 a{constructor(r){this.note=r}get model(){let r=null;switch(typeof this.note){case"string":r={type:"note",note:{texts:[{text:this.note}]}};break;default:r={type:"note",note:this.note}}return m.deepMerge({},a.DEFAULT_CONFIGS,r)}set model(r){const{note:t}=r,{texts:e}=t;e.length===1&&Object.keys(e[0]).length===1?this.note=e[0].text:this.note=t}static fromModel(r){const t=new a;return t.model=r,t}}a.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},T.exports=a},{"../utils/under-dash":26}],10:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(){this.decode(arguments)}setTLBR(r,t,e,l,n){if(arguments.length<4){const i=m.decodeAddress(r),f=m.decodeAddress(t);this.model={top:Math.min(i.row,f.row),left:Math.min(i.col,f.col),bottom:Math.max(i.row,f.row),right:Math.max(i.col,f.col),sheetName:e},this.setTLBR(i.row,i.col,f.row,f.col,n)}else this.model={top:Math.min(r,e),left:Math.min(t,l),bottom:Math.max(r,e),right:Math.max(t,l),sheetName:n}}decode(r){switch(r.length){case 5:this.setTLBR(r[0],r[1],r[2],r[3],r[4]);break;case 4:this.setTLBR(r[0],r[1],r[2],r[3]);break;case 3:this.setTLBR(r[0],r[1],r[2]);break;case 2:this.setTLBR(r[0],r[1]);break;case 1:{const t=r[0];if(t instanceof a)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() - "+r.length)}}get top(){return this.model.top||1}set top(r){this.model.top=r}get left(){return this.model.left||1}set left(r){this.model.left=r}get bottom(){return this.model.bottom||1}set bottom(r){this.model.bottom=r}get right(){return this.model.right||1}set right(r){this.model.right=r}get sheetName(){return this.model.sheetName}set sheetName(r){this.model.sheetName=r}get _serialisedSheetName(){const{sheetName:r}=this.model;return r?/^[a-zA-Z0-9]*$/.test(r)?r+"!":`'${r}'!`:""}expand(r,t,e,l){(!this.model.top||rthis.bottom)&&(this.bottom=e),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){const{dimensions:t,number:e}=r;t&&this.expand(e,t.min,e,t.max)}}expandToAddress(r){const t=m.decodeEx(r);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(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&!(r.bottomthis.bottom)&&!(r.rightthis.right)}contains(r){const t=m.decodeEx(r);return this.containsEx(t)}containsEx(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&r.row>=this.top&&r.row<=this.bottom&&r.col>=this.left&&r.col<=this.right}forEachAddress(r){for(let t=this.left;t<=this.right;t++)for(let e=this.top;e<=this.bottom;e++)r(m.encodeAddress(e,t),e,t)}}T.exports=a},{"../utils/col-cache":19}],11:[function(s,T,S){const m=s("../utils/under-dash"),a=s("./enums"),o=s("../utils/col-cache"),r=s("./cell");T.exports=class{constructor(t,e){this._worksheet=t,this._number=e,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const l=this._worksheet.getColumn(t.col);e=new r(this,l,t.address),this._cells[t.col-1]=e}return e}getCell(t){if(typeof t=="string"){const e=this._worksheet.getColumnKey(t);t=e?e.number:o.l2n(t)}return this._cells[t-1]||this.getCellEx({address:o.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const l=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),f=2;f0)for(d=u;d>=l;d--)h=this._cells[d-1],h?(w=this.getCell(d+c),w.value=h.value,w.style=h.style,w._comment=h._comment):this._cells[d+c-1]=void 0;for(d=0;d{l&&l.type!==a.ValueType.Null&&e(l,n+1)})}addPageBreak(t,e){const l=this._worksheet,n=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,f={id:this._number,max:i,man:1};n&&(f.min=n),l.rowBreaks.push(f)}get values(){const t=[];return this._cells.forEach(e=>{e&&e.type!==a.ValueType.Null&&(t[e.col]=e.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let e=0;t.hasOwnProperty("0")&&(e=1),t.forEach((l,n)=>{l!==void 0&&(this.getCellEx({address:o.encodeAddress(this._number,n+e),row:this._number,col:n+e}).value=l)})}else this._worksheet.eachColumnKey((e,l)=>{t[l]!==void 0&&(this.getCellEx({address:o.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!==a.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!==a.ValueType.Null&&((!t||t>l.col)&&(t=l.col),e0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach(l=>{l&&(l[t]=e)}),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,l=0;return this._cells.forEach(n=>{if(n){const i=n.model;i&&((!e||e>n.col)&&(e=n.col),l{switch(l.type){case r.Types.Merge:break;default:{let n;if(l.address)n=o.decodeAddress(l.address);else if(e){const{row:i}=e,f=e.col+1;n={row:i,col:f,address:o.encodeAddress(i,f),$col$row:`$${o.n2l(f)}$${i}`}}e=n,this.getCellEx(n).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(s,T,S){const m=s("../utils/col-cache");class a{constructor(r,t,e){this.table=r,this.column=t,this.index=e}_set(r,t){this.table.cacheState(),this.column[r]=t}get name(){return this.column.name}set name(r){this._set("name",r)}get filterButton(){return this.column.filterButton}set filterButton(r){this.column.filterButton=r}get style(){return this.column.style}set style(r){this.column.style=r}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(r){this._set("totalsRowLabel",r)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(r){this._set("totalsRowFunction",r)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(r){this._set("totalsRowResult",r)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(r){this._set("totalsRowFormula",r)}}T.exports=class{constructor(o,r){this.worksheet=o,r&&(this.table=r,this.validate(),this.store())}getFormula(o){switch(o.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${o.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${o.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${o.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${o.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${o.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${o.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${o.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${o.name}])`;case"custom":return o.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+o.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:o}=this,r=(c,u,d)=>{c[u]===void 0&&(c[u]=d)};r(o,"headerRow",!0),r(o,"totalsRow",!1),r(o,"style",{}),r(o.style,"theme","TableStyleMedium2"),r(o.style,"showFirstColumn",!1),r(o.style,"showLastColumn",!1),r(o.style,"showRowStripes",!1),r(o.style,"showColumnStripes",!1);const t=(c,u)=>{if(!c)throw new Error(u)};t(o.ref,"Table must have ref"),t(o.columns,"Table must have column definitions"),t(o.rows,"Table must have row definitions"),o.tl=m.decodeAddress(o.ref);const{row:e,col:l}=o.tl;t(e>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:n,filterHeight:i,tableHeight:f}=this;o.autoFilterRef=m.encode(e,l,e+i-1,l+n-1),o.tableRef=m.encode(e,l,e+f-1,l+n-1),o.columns.forEach((c,u)=>{t(c.name,`Column ${u} must have a name`),u===0?r(c,"totalsRowLabel","Total"):(r(c,"totalsRowFunction","none"),c.totalsRowFormula=this.getFormula(c))})}store(){const o=(i,f)=>{f&&Object.keys(f).forEach(c=>{i[c]=f[c]})},{worksheet:r,table:t}=this,{row:e,col:l}=t.tl;let n=0;if(t.headerRow){const i=r.getRow(e+n++);t.columns.forEach((f,c)=>{const{style:u,name:d}=f,h=i.getCell(l+c);h.value=d,o(h,u)})}if(t.rows.forEach(i=>{const f=r.getRow(e+n++);i.forEach((c,u)=>{const d=f.getCell(l+u);d.value=c,o(d,t.columns[u].style)})}),t.totalsRow){const i=r.getRow(e+n++);t.columns.forEach((f,c)=>{const u=i.getCell(l+c);if(c===0)u.value=f.totalsRowLabel;else{const d=this.getFormula(f);u.value=d?{formula:f.totalsRowFormula,result:f.totalsRowResult}:null}o(u,f.style)})}}load(o){const{table:r}=this,{row:t,col:e}=r.tl;let l=0;if(r.headerRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{n.getCell(e+f).value=i.name})}if(r.rows.forEach(n=>{const i=o.getRow(t+l++);n.forEach((f,c)=>{i.getCell(e+c).value=f})}),r.totalsRow){const n=o.getRow(t+l++);r.columns.forEach((i,f)=>{const c=n.getCell(e+f);f===0?c.value=i.totalsRowLabel:this.getFormula(i)&&(c.value={formula:i.totalsRowFormula,result:i.totalsRowResult})})}}get model(){return this.table}set model(o){this.table=o}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const o=m.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(o,r)}getColumn(o){const r=this.table.columns[o];return new a(this,r,o)}addColumn(o,r,t){this.cacheState(),t===void 0?(this.table.columns.push(o),this.table.rows.forEach((e,l)=>{e.push(r[l])})):(this.table.columns.splice(t,0,o),this.table.rows.forEach((e,l)=>{e.splice(t,0,r[l])}))}removeColumns(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(o,r),this.table.rows.forEach(t=>{t.splice(o,r)})}_assign(o,r,t){this.cacheState(),o[r]=t}get ref(){return this.table.ref}set ref(o){this._assign(this.table,"ref",o)}get name(){return this.table.name}set name(o){this.table.name=o}get displayName(){return this.table.displyName||this.table.name}set displayNamename(o){this.table.displayName=o}get headerRow(){return this.table.headerRow}set headerRow(o){this._assign(this.table,"headerRow",o)}get totalsRow(){return this.table.totalsRow}set totalsRow(o){this._assign(this.table,"totalsRow",o)}get theme(){return this.table.style.name}set theme(o){this.table.style.name=o}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(o){this.table.style.showFirstColumn=o}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(o){this.table.style.showLastColumn=o}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(o){this.table.style.showRowStripes=o}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(o){this.table.style.showColumnStripes=o}}},{"../utils/col-cache":19}],13:[function(s,T,S){const m=s("./worksheet"),a=s("./defined-names"),o=s("../xlsx/xlsx"),r=s("../csv/csv");T.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new a}get xlsx(){return this._xlsx||(this._xlsx=new o(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>c?u.orderNo:c,0),i=Object.assign({},e,{id:l,name:t,orderNo:n+1,workbook:this}),f=new m(i);return this._worksheets[l]=f,f}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(e=>e&&e.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,e)=>t.orderNo-e.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(e=>{t(e,e.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(t=>t.model),sheets:this.worksheets.map(t=>t.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(e=>{const{id:l,name:n,state:i}=e,f=t.sheets&&t.sheets.findIndex(c=>c.id===l);(this._worksheets[l]=new m({id:l,name:n,orderNo:f,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"),a=s("../utils/col-cache"),o=s("./range"),r=s("./row"),t=s("./column"),e=s("./enums"),l=s("./image"),n=s("./table"),i=s("./data-validations"),f=s("../utils/encryptor"),{copyStyle:c}=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&&(console.warn(`Worksheet name ${u} exceeds 31 chars. This will be truncated`),u=u.substring(0,31)),this._workbook._worksheets.find(d=>d&&d.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const u=new o;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((w,_)=>{const A=(_.header?1:_.headers&&_.headers.length)||0;return Math.max(w,A)},0);let d=1;const h=this._columns=[];u.forEach(w=>{const _=new t(this,d++,!1);h.push(_),_.defn=w})}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=a.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 w=arguments.length,_=new Array(w>2?w-2:0),A=2;A0)for(let P=0;P{D.push(B[P]||null)});const U=this.getRow(P+1);U.splice.apply(U,D)}else this._rows.forEach(P=>{P&&P.splice(u,d)});const N=_.length-d,L=u+d,I=this._columns.length;if(N<0)for(let P=u+_.length;P<=I;P++)this.getColumn(P).defn=this.getColumn(P-N).defn;else if(N>0)for(let P=I;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(w=>{let{col:_}=w;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 r(this,u)),d}getRows(u,d){if(d<1)return;const h=[];for(let w=u;w1&&arguments[1]!==void 0?arguments[1]:"n";const h=this._nextRow,w=this.getRow(h);return w.values=u,this._setStyleOption(h,d[0]==="i"?d:"n"),w}addRows(u){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const h=[];return u.forEach(w=>{h.push(this.addRow(w,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 w=0;w1&&arguments[1]!==void 0?arguments[1]:"n";d[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,d[1]==="+"):d[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,d[1]==="+")}_copyStyle(u,d){let h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),_=this.getRow(d);_.style=c(w.style),w.eachCell({includeEmpty:h},(A,N)=>{_.getCell(N).style=c(A.style)}),_.height=w.height}duplicateRow(u,d){let h=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this._rows[u-1],_=new Array(d).fill(w.values);this.spliceRows(u+1,h?0:d,..._);for(let A=0;A{N.getCell(I).style=L.style})}}spliceRows(u,d){const h=u+d;for(var w=arguments.length,_=new Array(w>2?w-2:0),A=2;A{U.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=I;P>=h;P--)if(D=this._rows[P-1],D){const U=this.getRow(P+L);U.values=D.values,U.style=D.style,U.height=D.height,D.eachCell({includeEmpty:!0},(B,x)=>{if(U.getCell(x).style=B.style,B._value.constructor.name==="MergeValue"){const M=this.getRow(B._row._number+N).getCell(x),v=B._value._master,p=this.getRow(v._row._number+N).getCell(v._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=a.getAddress(u,d),w=this._rows[h.row-1];return w?w.findCell(h.col):void 0}getCell(u,d){const h=a.getAddress(u,d);return this.getRow(h.row).getCellEx(h)}mergeCells(){for(var u=arguments.length,d=new Array(u),h=0;h{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const h=this.getCell(u.top,u.left);for(let w=u.top;w<=u.bottom;w++)for(let _=u.left;_<=u.right;_++)(w>u.top||_>u.left)&&this.getCell(w,_).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 w=d.left;w<=d.right;w++)this.getCell(h,w).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 _=a.decode(u),{top:A,left:N,bottom:L,right:I}=_,P=I-N+1,D=a.encodeAddress(A,N),U=w==="shared";let B;B=typeof h=="function"?h:Array.isArray(h)?Array.isArray(h[0])?(M,v)=>h[M-A][v-N]:(M,v)=>h[(M-A)*P+(v-N)]:()=>{};let x=!0;for(let M=A;M<=L;M++)for(let v=N;v<=I;v++)x?(this.getCell(M,v).value={shareType:w,formula:d,ref:u,result:B(M,v)},x=!1):this.getCell(M,v).value=U?{sharedFormula:D,result:B(M,v)}:B(M,v)}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=f.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=d&&"spinCount"in d?d.spinCount:1e5,this.sheetProtection.hashValue=f.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 n(this,u);return this.tables[u.name]=d,d}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(u){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=u}get model(){const u={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(w=>w.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(w=>w.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const d=u.rows=[],h=u.dimensions=new o;return this._rows.forEach(w=>{const _=w&&w.model;_&&(h.expand(_.number,_.min,_.number,_.max),d.push(_))}),u.merges=[],m.each(this._merges,w=>{u.merges.push(w.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(d=>{const h=new r(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 w=new n;return w.model=h,d[h.name]=w,d},{}),this.conditionalFormattings=u.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(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")},a=s("./doc/enums");Object.keys(a).forEach(o=>{m[o]=a[o]}),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>"u"?null:new TextDecoder("utf-8");S.bufferToString=function(a){return typeof a=="string"?a:m?m.decode(a):a.toString()}},{}],17:[function(s,T,S){const m=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:a}=s("buffer");S.stringToBuffer=function(o){return typeof o!="string"?o:m?a.from(m.encode(o).buffer):a.from(o)}},{buffer:220}],18:[function(s,T,S){const m=s("./under-dash"),a=s("./col-cache");T.exports=class{constructor(o){this.template=o,this.sheets={}}addCell(o){this.addCellEx(a.decodeEx(o))}getCell(o){return this.findCellEx(a.decodeEx(o),!0)}findCell(o){return this.findCellEx(a.decodeEx(o),!1)}findCellAt(o,r,t){const e=this.sheets[o],l=e&&e[r];return l&&l[t]}addCellEx(o){if(o.top)for(let r=o.top;r<=o.bottom;r++)for(let t=o.left;t<=o.right;t++)this.getCellAt(o.sheetName,r,t);else this.findCellEx(o,!0)}getCellEx(o){return this.findCellEx(o,!0)}findCellEx(o,r){const t=this.findSheet(o,r),e=this.findSheetRow(t,o,r);return this.findRowCell(e,o,r)}getCellAt(o,r,t){const e=this.sheets[o]||(this.sheets[o]=[]),l=e[r]||(e[r]=[]);return l[t]||(l[t]={sheetName:o,address:a.n2l(t)+r,row:r,col:t})}removeCellEx(o){const r=this.findSheet(o);if(!r)return;const t=this.findSheetRow(r,o);t&&delete t[o.col]}forEachInSheet(o,r){const t=this.sheets[o];t&&t.forEach((e,l)=>{e&&e.forEach((n,i)=>{n&&r(n,l,i)})})}forEach(o){m.each(this.sheets,(r,t)=>{this.forEachInSheet(t,o)})}map(o){const r=[];return this.forEach(t=>{r.push(o(t))}),r}findSheet(o,r){const t=o.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(o,r,t){const{row:e}=r;return o&&o[e]?o[e]:t?o[e]=[]:void 0}findRowCell(o,r,t){const{col:e}=r;return o&&o[e]?o[e]:t?o[e]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(o,r,t,e){const l=this.sheets[o];if(l){const n=[];for(let i=0;i{i.splice(r,t,...n)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(s,T,S){const m=/^[A-Z]+\d+$/,a={_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:o=>o<=26?1:o<=676?2:3,_fill(o){let r,t,e,l,n,i=1;if(o>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&o>=1){for(;i<=26;)r=this._dictionary[i-1],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=1}if(this._l2nFill<2&&o>=2){for(i=27;i<=702;)t=i-27,e=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=2}if(this._l2nFill<3&&o>=3){for(i=703;i<=16384;)t=i-703,e=t%26,l=Math.floor(t/26)%26,n=Math.floor(t/676),r=this._dictionary[n]+this._dictionary[l]+this._dictionary[e],this._n2l[i]=r,this._l2n[r]=i,i++;this._l2nFill=3}},l2n(o){if(this._l2n[o]||this._fill(o.length),!this._l2n[o])throw new Error("Out of bounds. Invalid column letter: "+o);return this._l2n[o]},n2l(o){if(o<1||o>16384)throw new Error(o+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[o]||this._fill(this._level(o)),this._n2l[o]},_hash:{},validateAddress(o){if(!m.test(o))throw new Error("Invalid Address: "+o);return!0},decodeAddress(o){const r=o.length<5&&this._hash[o];if(r)return r;let t=!1,e="",l=0,n=!1,i="",f=0;for(let u,d=0;d=65&&u<=90)t=!0,e+=o[d],l=26*l+u-64;else if(u>=48&&u<=57)n=!0,i+=o[d],f=10*f+u-48;else if(n&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+e)}else l=void 0;n||(f=void 0);const c={address:o=e+i,col:l,row:f,$col$row:`$${e}$${i}`};return l<=100&&f<=100&&(this._hash[o]=c,this._hash[c.$col$row]=c),c},getAddress(o,r){if(r){const t=this.n2l(r)+o;return this.decodeAddress(t)}return this.decodeAddress(o)},decode(o){const r=o.split(":");if(r.length===2){const t=this.decodeAddress(r[0]),e=this.decodeAddress(r[1]),l={top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(o)},decodeEx(o){const r=o.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],e=r[3],l=e.split(":");if(l.length>1){let i=this.decodeAddress(l[0]),f=this.decodeAddress(l[1]);const c=Math.min(i.row,f.row),u=Math.min(i.col,f.col),d=Math.max(i.row,f.row),h=Math.max(i.col,f.col);return i=this.n2l(u)+c,f=this.n2l(h)+d,{top:c,left:u,bottom:d,right:h,sheetName:t,tl:{address:i,col:u,row:c,$col$row:`$${this.n2l(u)}$${c}`,sheetName:t},br:{address:f,col:h,row:d,$col$row:`$${this.n2l(h)}$${d}`,sheetName:t},dimensions:`${i}:${f}`}}if(e.startsWith("#"))return t?{sheetName:t,error:e}:{error:e};const n=this.decodeAddress(e);return t?{sheetName:t,...n}:n},encodeAddress:(o,r)=>a.n2l(r)+o,encode(){switch(arguments.length){case 2:return a.encodeAddress(arguments[0],arguments[1]);case 4:return`${a.encodeAddress(arguments[0],arguments[1])}:${a.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(o,r){const[t,e,,l,n]=o,[i,f]=r;return i>=t&&i<=l&&f>=e&&f<=n}};T.exports=a},{}],20:[function(s,T,S){const m=(o,r)=>({...o,...r.reduce((t,e)=>(o[e]&&(t[e]={...o[e]}),t),{})}),a=function(o,r,t){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];o[t]&&(r[t]=m(o[t],e))};S.copyStyle=o=>{if(!o)return o;if(r=o,Object.keys(r).length===0)return{};var r;const t={...o};return a(o,t,"font",["color"]),a(o,t,"alignment"),a(o,t,"protection"),o.border&&(a(o,t,"border"),a(o.border,t.border,"top",["color"]),a(o.border,t.border,"left",["color"]),a(o.border,t.border,"bottom",["color"]),a(o.border,t.border,"right",["color"]),a(o.border,t.border,"diagonal",["color"])),o.fill&&(a(o,t,"fill",["fgColor","bgColor","center"]),o.fill.stops&&(t.fill.stops=o.fill.stops.map(e=>m(e,["color"])))),t}},{}],21:[function(s,T,S){(function(m){(function(){const a=s("crypto"),o={hash(r){const t=a.createHash(r);for(var e=arguments.length,l=new Array(e>1?e-1:0),n=1;na.randomBytes(r)};T.exports=o}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(s,T,S){const{SaxesParser:m}=s("saxes"),{PassThrough:a}=s("readable-stream"),{bufferToString:o}=s("./browser-buffer-decode");T.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new a));const t=new m;let e;t.on("error",n=>{e=n});let l=[];t.on("opentag",n=>l.push({eventType:"opentag",value:n})),t.on("text",n=>l.push({eventType:"text",value:n})),t.on("closetag",n=>l.push({eventType:"closetag",value:n}));for await(const n of r){if(t.write(o(n)),e)throw e;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(s,T,S){const m=s("./col-cache"),a=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,o=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;T.exports={slideFormula:function(r,t,e){const l=m.decode(t),n=m.decode(e);return r.replace(a,(i,f,c,u,d)=>{if(d)return i;const h=o.exec(u);if(h){const w=h[1],_=h[2].toUpperCase(),A=h[3],N=h[4];if(_.length>3||_.length===3&&_>"XFD")return i;let L=m.l2n(_),I=parseInt(N,10);return w||(L+=n.col-l.col),A||(I+=n.row-l.row),(f||"")+(w||"")+m.n2l(L)+(A||"")+I}return i})}}},{"./col-cache":19}],24:[function(s,T,S){(function(m,a){(function(){const o=s("readable-stream"),r=s("./utils"),t=s("./string-buf");class e{constructor(u,d){this._data=u,this._encoding=d}get length(){return this.toBuffer().length}copy(u,d,h,w){return this.toBuffer().copy(u,d,h,w)}toBuffer(){return this._buffer||(this._buffer=a.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){return this._data._buf.copy(u,d,h,w)}toBuffer(){return this._data.toBuffer()}}class n{constructor(u){this._data=u}get length(){return this._data.length}copy(u,d,h,w){this._data.copy(u,d,h,w)}toBuffer(){return this._data}}class i{constructor(u){this.size=u,this.buffer=a.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=a.alloc(this.iWrite-this.iRead);return this.buffer.copy(u,0,this.iRead,this.iWrite),u}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(u){let d;return u===0?null:u===void 0||u>=this.length?(d=this.toBuffer(),this.iRead=this.iWrite,d):(d=a.alloc(u),this.buffer.copy(d,0,this.iRead,u),this.iRead+=u,d)}write(u,d,h){const w=Math.min(h,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,d,d+w),this.iWrite+=w,w}}const f=function(c){c=c||{},this.bufSize=c.bufSize||1048576,this.buffers=[],this.batch=c.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(f,o.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return a.concat(this.buffers.map(c=>c.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const u=this.buffers[this.buffers.length-1];if(!u.full)return u}const c=new i(this.bufSize);return this.buffers.push(c),c},async _pipe(c){await Promise.all(this.pipes.map(function(u){return new Promise(d=>{u.write(c.toBuffer(),()=>{d()})})}))},_writeToBuffers(c){let u=0;const d=c.length;for(;u1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(h),m.nextTick(d)):(await this._pipe(h),d());else this.paused||this.emit("data",h.toBuffer()),this._writeToBuffers(h),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(c,u,d){const h=w=>{w?d(w):(this._flush(),this.pipes.forEach(_=>{_.end()}),this.emit("finish"))};c?this.write(c,u,h):h()},read(c){let u;if(c){for(u=[];c&&this.buffers.length&&!this.buffers[0].eod;){const d=this.buffers[0],h=d.read(c);c-=h.length,u.push(h),d.eod&&d.full&&this.buffers.shift()}return a.concat(u)}return u=this.buffers.map(d=>d.toBuffer()).filter(Boolean),this.buffers=[],a.concat(u)},setEncoding(c){this.encoding=c},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(c){this.pipes.push(c),!this.paused&&this.buffers.length&&this.end()},unpipe(c){this.pipes=this.pipes.filter(u=>u!==c)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),T.exports=f}).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(a){this._buf=m.alloc(a&&a.size||16384),this._encoding=a&&a.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(a){a=a||0,this._buffer=void 0,this._inPos=a}_grow(a){let o=2*this._buf.length;for(;o=this._buf.length-4;)this._grow(this._inPos+a.length),o=this._inPos+this._buf.write(a,this._inPos,this._encoding);this._inPos=o}addStringBuf(a){a.length&&(this._buffer=void 0,this.length+a.length>this.capacity&&this._grow(this.length+a.length),a._buf.copy(this._buf,this._inPos,0,a.length),this._inPos+=a.length)}}}).call(this)}).call(this,s("buffer").Buffer)},{buffer:220}],26:[function(s,T,S){const{toString:m}=Object.prototype,a=/["&<>]/,o={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(e=>{t(r[e],e)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(e=>t(r[e],e)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(e=>t(r[e],e)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(e=>t(r[e],e)):[]},keyBy:(r,t)=>r.reduce((e,l)=>(e[l[t]]=l,e),{}),isEqual:function(r,t){const e=typeof r,l=typeof t,n=Array.isArray(r),i=Array.isArray(t);let f;if(e!==l)return!1;switch(typeof r){case"object":if(n||i)return!(!n||!i)&&r.length===t.length&&r.every((c,u)=>{const d=t[u];return o.isEqual(c,d)});if(r===null||t===null)return r===t;if(f=Object.keys(r),Object.keys(t).length!==f.length)return!1;for(const c of f)if(!t.hasOwnProperty(c))return!1;return o.every(r,(c,u)=>{const d=t[u];return o.isEqual(c,d)});default:return r===t}},escapeHtml(r){const t=a.exec(r);if(!t)return r;let e="",l="",n=0,i=t.index;for(;i":l=">";break;default:continue}n!==i&&(e+=r.substring(n,i)),n=i+1,e+=l}return n!==i?e+r.substring(n,i):e},strcmp:(r,t)=>rt?1:0,isUndefined:r=>m.call(r)==="[object Undefined]",isObject:r=>m.call(r)==="[object Object]",deepMerge(){const r=arguments[0]||{},{length:t}=arguments;let e,l,n;function i(f,c){e=r[c],n=Array.isArray(f),o.isObject(f)||n?(n?(n=!1,l=e&&Array.isArray(e)?e:[]):l=e&&o.isObject(e)?e:{},r[c]=o.deepMerge(l,f)):o.isUndefined(f)||(r[c]=f)}for(let f=0;f&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:e=>new Promise(l=>{m.setImmediate?a(()=>{l(e)}):setTimeout(()=>{l(e)},1)}),inherits:function(e,l,n,i){e.super_=l,i||(i=n,n=null),n&&Object.keys(n).forEach(c=>{Object.defineProperty(e,c,Object.getOwnPropertyDescriptor(n,c))});const f={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(c=>{f[c]=Object.getOwnPropertyDescriptor(i,c)}),e.prototype=Object.create(l.prototype,f)},dateToExcel:(e,l)=>25569+e.getTime()/864e5-(l?1462:0),excelToDate(e,l){const n=Math.round(24*(e-25569+(l?1462:0))*3600*1e3);return new Date(n)},parsePath(e){const l=e.lastIndexOf("/");return{path:e.substring(0,l),name:e.substring(l+1)}},getRelsPath(e){const l=t.parsePath(e);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(e){const l=r.exec(e);if(!l)return e;let n="",i="",f=0,c=l.index;for(;c=11&&u!==13)){i="";break}continue}f!==c&&(n+=e.substring(f,c)),f=c+1,i&&(n+=i)}return f!==c?n+e.substring(f,c):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(e){const l=parseInt(e,10);return Number.isNaN(l)?0:l},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(l=>{o.access(e,o.constants.F_OK,n=>{l(!n)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>e===!0||e==="true"||e===1||e==="1"};T.exports=t}).call(this)}).call(this,typeof Kt<"u"?Kt:typeof self<"u"?self:typeof window<"u"?window:{},s("timers").setImmediate)},{fs:216,timers:523}],28:[function(s,T,S){const m=s("./under-dash"),a=s("./utils");function o(e,l,n){e.push(` ${l}="${a.xmlEncode(n.toString())}"`)}function r(e,l){if(l){const n=[];m.each(l,(i,f)=>{i!==void 0&&o(n,f,i)}),e.push(n.join(""))}}class t{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(l){const n=this._xml;n.push(" +`)}openNode(l,n){const i=this.tos,f=this._xml;i&&this.open&&f.push(">"),this._stack.push(l),f.push("<"),f.push(l),r(f,n),this.leaf=!0,this.open=!0}addAttribute(l,n){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n!==void 0&&o(this._xml,l,n)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){const n=this._xml;this.open&&(n.push(">"),this.open=!1),this.leaf=!1,n.push(a.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),n=this._xml;this.leaf?n.push("/>"):(n.push("")),this.open=!1,this.leaf=!1}leafNode(l,n,i){this.openNode(l,n),i!==void 0&&this.writeText(i),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},T.exports=t},{"./under-dash":26,"./utils":27}],29:[function(s,T,S){(function(m){(function(){const a=s("events"),o=s("jszip"),r=s("./stream-buf"),{stringToBuffer:t}=s("./browser-buffer-encode");class e extends a.EventEmitter{constructor(n){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},n),this.zip=new o,this.stream=new r}append(n,i){i.hasOwnProperty("base64")&&i.base64?this.zip.file(i.name,n,{base64:!0}):(m.browser&&typeof n=="string"&&(n=t(n)),this.zip.file(i.name,n))}async finalize(){const n=await this.zip.generateAsync(this.options);this.stream.end(n),this.emit("finish")}read(n){return this.stream.read(n)}setEncoding(n){return this.stream.setEncoding(n)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(n,i){return this.stream.pipe(n,i)}unpipe(n){return this.stream.unpipe(n)}unshift(n){return this.stream.unshift(n)}wrap(n){return this.stream.wrap(n)}}T.exports={ZipWriter:e}}).call(this)}).call(this,s("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(s,T,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"),a=s("../../utils/xml-stream");class o{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 o?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const e of t)for(const{eventType:l,value:n}of e)if(l==="opentag")this.parseOpen(n);else if(l==="text")this.parseText(n);else if(l==="closetag"&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(t){return this.parse(m(t))}get xml(){return this.toXml(this.model)}toXml(t){const e=new a;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 o.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 o.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 o.toAttribute(t,e,l)}static toFloatValue(t,e){return t===void 0?e:parseFloat(t)}}T.exports=o},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(s,T,S){const m=s("../base-xform"),a=s("../../../utils/col-cache");function o(t){try{return a.decodeEx(t),!0}catch{return!1}}function r(t){const e=[];let l=!1,n="";return t.split(",").forEach(i=>{if(!i)return;const f=(i.match(/'/g)||[]).length;if(!f)return void(l?n+=i+",":o(i)&&e.push(i));const c=f%2==0;!l&&c&&o(i)?e.push(i):l&&!c?(l=!1,o(n+i)&&e.push(n+i),n=""):(l=!0,n+=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:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(s,T,S){const m=s("../../../utils/utils"),a=s("../base-xform");T.exports=class extends a{render(o,r){o.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(o){return o.name==="sheet"&&(this.model={name:m.xmlDecode(o.attributes.name),id:parseInt(o.attributes.sheetId,10),state:o.attributes.state,rId:o.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(a,o){a.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:o.fullCalcOnLoad?1:void 0})}parseOpen(a){return a.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(a,o){a.leafNode("workbookPr",{date1904:o.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(a){return a.name==="workbookPr"&&(this.model={date1904:a.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(a,o){const r={xWindow:o.x||0,yWindow:o.y||0,windowWidth:o.width||12e3,windowHeight:o.height||24e3,firstSheet:o.firstSheet,activeTab:o.activeTab};o.visibility&&o.visibility!=="visible"&&(r.visibility=o.visibility),a.leafNode("workbookView",r)}parseOpen(a){if(a.name==="workbookView"){const o=this.model={},r=function(e,l,n){const i=l!==void 0?o[e]=l:n;i!==void 0&&(o[e]=i)},t=function(e,l,n){const i=l!==void 0?o[e]=parseInt(l,10):n;i!==void 0&&(o[e]=i)};return t("x",a.attributes.xWindow,0),t("y",a.attributes.yWindow,0),t("width",a.attributes.windowWidth,25e3),t("height",a.attributes.windowHeight,1e4),r("visibility",a.attributes.visibility,"visible"),t("activeTab",a.attributes.activeTab,void 0),t("firstSheet",a.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"),a=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),r=s("../base-xform"),t=s("../static-xform"),e=s("../list-xform"),l=s("./defined-name-xform"),n=s("./sheet-xform"),i=s("./workbook-view-xform"),f=s("./workbook-properties-xform"),c=s("./workbook-calc-properties-xform");class u extends r{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new f,bookViews:new e({tag:"bookViews",count:!1,childXform:new i}),sheets:new e({tag:"sheets",count:!1,childXform:new n}),definedNames:new e({tag:"definedNames",count:!1,childXform:new l}),calcPr:new c}}prepare(h){h.sheets=h.worksheets;const w=[];let _=0;h.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(N=>{const L=N.split(":"),I={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${L[0]}:$${L[1]}`],localSheetId:_};w.push(I)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const N=[];if(A.pageSetup.printTitlesColumn){const I=A.pageSetup.printTitlesColumn.split(":");N.push(`'${A.name}'!$${I[0]}:$${I[1]}`)}if(A.pageSetup.printTitlesRow){const I=A.pageSetup.printTitlesRow.split(":");N.push(`'${A.name}'!$${I[0]}:$${I[1]}`)}const L={name:"_xlnm.Print_Titles",ranges:N,localSheetId:_};w.push(L)}_++}),w.length&&(h.definedNames=h.definedNames.concat(w)),(h.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(h,w){h.openXml(o.StdDocAttributes),h.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(h),this.map.workbookPr.render(h,w.properties),this.map.bookViews.render(h,w.views),this.map.sheets.render(h,w.sheets),this.map.definedNames.render(h,w.definedNames),this.map.calcPr.render(h,w.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 w=(h.workbookRels||[]).reduce((I,P)=>(I[P.Id]=P,I),{}),_=[];let A,N=0;(h.sheets||[]).forEach(I=>{const P=w[I.rId];P&&(A=h.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=I.name,A.id=I.id,A.state=I.state,_[N++]=A))});const L=[];m.each(h.definedNames,I=>{if(I.name==="_xlnm.Print_Area"){if(A=_[I.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=a.decodeEx(I.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(I.name==="_xlnm.Print_Titles"){if(A=_[I.localSheetId],A){A.pageSetup||(A.pageSetup={});const P=I.ranges.join(","),D=/\$/g,U=/\$\d+:\$\d+/,B=P.match(U);if(B&&B.length){const v=B[0];A.pageSetup.printTitlesRow=v.replace(D,"")}const x=/\$[A-Z]+:\$[A-Z]+/,M=P.match(x);if(M&&M.length){const v=M[0];A.pageSetup.printTitlesColumn=v.replace(D,"")}}}else L.push(I)}),h.definedNames=L,h.media.forEach((I,P)=>{I.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"),a=s("../../../utils/utils"),o=s("../base-xform"),r=T.exports=function(t){this.model=t};a.inherits(r,o,{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={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"),a=s("../../../utils/utils"),o=s("../base-xform"),r=s("./comment-xform"),t=T.exports=function(){this.map={comment:new r}};a.inherits(t,o,{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(n=>{this.map.comment.render(e,n)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{constructor(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o,r){(o===r[2]||this.tag==="x:SizeWithCells"&&o===r[1])&&a.leafNode(this.tag)}parseOpen(a){switch(a.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(a){super(),this._model=a}get tag(){return this._model&&this._model.tag}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(a){switch(a.name){case this.tag:return this.text="",!0;default:return!1}}parseText(a){this.text=a}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(a){const o=Math.floor(a.left),r=Math.floor(68*(a.left-o)),t=Math.floor(a.top),e=Math.floor(18*(a.top-t)),l=Math.floor(a.right),n=Math.floor(68*(a.right-l)),i=Math.floor(a.bottom);return[o,r,t,e,l,n,i,Math.floor(18*(a.bottom-i))]}getDefaultRect(a){const o=a.col,r=Math.max(a.row-2,0);return[o,6,r,14,o+2,2,r+4,16]}render(a,o){const r=o.anchor?this.getAnchorRect(o.anchor):this.getDefaultRect(o.refAddress);a.leafNode("x:Anchor",null,r.join(", "))}parseOpen(a){switch(a.name){case this.tag:return this.text="",!0;default:return!1}}parseText(a){this.text=a}parseClose(){return!1}}},{"../base-xform":32}],44:[function(s,T,S){const m=s("../base-xform"),a=s("./vml-anchor-xform"),o=s("./style/vml-protection-xform"),r=s("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];T.exports=class extends m{constructor(){super(),this.map={"x:Anchor":new a,"x:Locked":new o({tag:"x:Locked"}),"x:LockText":new o({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,l){const{protection:n,editAs:i}=l.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,i,t),this.map["x:SizeWithCells"].render(e,i,t),this.map["x:Anchor"].render(e,l),this.map["x:Locked"].render(e,n.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,n.lockText),e.leafNode("x:Row",null,l.refAddress.row-1),e.leafNode("x:Column",null,l.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(e).length;this.model.editAs=t[l],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./vml-shape-xform");class r extends a{constructor(){super(),this.map={"v:shape":new o}}get tag(){return"xml"}render(e,l){e.openXml(m.StdDocAttributes),e.openNode(this.tag,r.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),l.comments.forEach((n,i)=>{this.map["v:shape"].render(e,n,i)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,l){e.anchors.forEach(n=>{n.br?this.map["xdr:twoCellAnchor"].reconcile(n,l):this.map["xdr:oneCellAnchor"].reconcile(n,l)})}}r.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(s,T,S){const m=s("../base-xform"),a=s("./vml-textbox-xform"),o=s("./vml-client-data-xform");class r extends m{constructor(){super(),this.map={"v:textbox":new a,"x:ClientData":new o}}get tag(){return"v:shape"}render(e,l,n){e.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,n)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,l),this.map["x:ClientData"].render(e,l),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}r.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":t.note.margins&&t.note.margins.insetmode}),T.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"v:textbox"}conversionUnit(a,o,r){return`${parseFloat(a)*o.toFixed(2)}${r}`}reverseConversionUnit(a){return(a||"").split(",").map(o=>Number(parseFloat(this.conversionUnit(parseFloat(o),.1,"")).toFixed(2)))}render(a,o){const r={style:"mso-direction-alt:auto"};if(o&&o.note){let{inset:t}=o.note&&o.note.margins;Array.isArray(t)&&(t=t.map(e=>this.conversionUnit(e,10,"mm")).join(",")),t&&(r.inset=t)}a.openNode("v:textbox",r),a.leafNode("div",{style:"text-align:left"}),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:return this.model={inset:this.reverseConversionUnit(a.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(a){switch(a){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(a){return{}}parseOpen(a){return this.parser=this.parser||this.map[a.name],this.parser?(this.parser.parseOpen(a),!0):a.name===this.tag&&(this.model=this.createNewModel(a),!0)}parseText(a){this.parser&&this.parser.parseText(a)}onParserClose(a,o){this.model[a]=o.model}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.onParserClose(a,this.parser),this.parser=void 0),!0):a!==this.tag}}},{"./base-xform":32}],49:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(a,o){a.openNode("HeadingPairs"),a.openNode("vt:vector",{size:2,baseType:"variant"}),a.openNode("vt:variant"),a.leafNode("vt:lpstr",void 0,"Worksheets"),a.closeNode(),a.openNode("vt:variant"),a.leafNode("vt:i4",void 0,o.length),a.closeNode(),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="HeadingPairs"}parseText(){}parseClose(a){return a!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(a,o){a.openNode("TitlesOfParts"),a.openNode("vt:vector",{size:o.length,baseType:"lpstr"}),o.forEach(r=>{a.leafNode("vt:lpstr",void 0,r.name)}),a.closeNode(),a.closeNode()}parseOpen(a){return a.name==="TitlesOfParts"}parseText(){}parseClose(a){return a!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/string-xform"),r=s("./app-heading-pairs-xform"),t=s("./app-titles-of-parts-xform");class e extends a{constructor(){super(),this.map={Company:new o({tag:"Company"}),Manager:new o({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(n,i){n.openXml(m.StdDocAttributes),n.openNode("Properties",e.PROPERTY_ATTRIBUTES),n.leafNode("Application",void 0,"Microsoft Excel"),n.leafNode("DocSecurity",void 0,"0"),n.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(n,i.worksheets),this.map.TitleOfParts.render(n,i.worksheets),this.map.Company.render(n,i.company||""),this.map.Manager.render(n,i.manager),n.leafNode("LinksUpToDate",void 0,"false"),n.leafNode("SharedDoc",void 0,"false"),n.leafNode("HyperlinksChanged",void 0,"false"),n.leafNode("AppVersion",void 0,"16.0300"),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"Properties":return!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform");class o extends a{render(t,e){t.openXml(m.StdDocAttributes),t.openNode("Types",o.PROPERTY_ATTRIBUTES);const l={};(e.media||[]).forEach(n=>{if(n.type==="image"){const i=n.extension;l[i]||(l[i]=!0,t.leafNode("Default",{Extension:i,ContentType:"image/"+i}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach(n=>{const i=`/xl/worksheets/sheet${n.id}.xml`;t.leafNode("Override",{PartName:i,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach(n=>{t.leafNode("Override",{PartName:"/xl/tables/"+n.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),e.drawings&&e.drawings.forEach(n=>{t.leafNode("Override",{PartName:`/xl/drawings/${n.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach(n=>{let{commentName:i}=n;t.leafNode("Override",{PartName:`/xl/${i}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}o.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},T.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../simple/date-xform"),r=s("../simple/string-xform"),t=s("../simple/integer-xform");class e extends a{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new o({tag:"cp:lastPrinted",format:e.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new o({tag:"dcterms:created",attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new o({tag:"dcterms:modified",attrs:e.DateAttrs,format:e.DateFormat})}}render(n,i){n.openXml(m.StdDocAttributes),n.openNode("cp:coreProperties",e.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(n,i.creator),this.map["dc:title"].render(n,i.title),this.map["dc:subject"].render(n,i.subject),this.map["dc:description"].render(n,i.description),this.map["dc:identifier"].render(n,i.identifier),this.map["dc:language"].render(n,i.language),this.map["cp:keywords"].render(n,i.keywords),this.map["cp:category"].render(n,i.category),this.map["cp:lastModifiedBy"].render(n,i.lastModifiedBy),this.map["cp:lastPrinted"].render(n,i.lastPrinted),this.map["cp:revision"].render(n,i.revision),this.map["cp:version"].render(n,i.version),this.map["cp:contentStatus"].render(n,i.contentStatus),this.map["cp:contentType"].render(n,i.contentType),this.map["dcterms:created"].render(n,i.created),this.map["dcterms:modified"].render(n,i.modified),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[n.name],this.parser)return this.parser.parseOpen(n),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+n)}}}e.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},e.DateAttrs={"xsi:type":"dcterms:W3CDTF"},e.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},T.exports=e},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{render(a,o){a.leafNode("Relationship",o)}parseOpen(a){switch(a.name){case"Relationship":return this.model=a.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("./relationship-xform");class r extends a{constructor(){super(),this.map={Relationship:new o}}render(e,l){l=l||this._values,e.openXml(m.StdDocAttributes),e.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(n=>{this.map.Relationship.render(e,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},T.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset(),this.model={range:{editAs:a.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}reconcilePicture(a,o){if(a&&a.rId){const r=o.rels[a.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],e=o.mediaIndex[t];return o.media[e]}}}}},{"../base-xform":32}],57:[function(s,T,S){const m=s("../base-xform"),a=s("./blip-xform");T.exports=class extends m{constructor(){super(),this.map={"a:blip":new a}}get tag(){return"xdr:blipFill"}render(o,r){o.openNode(this.tag),this.map["a:blip"].render(o,r),o.openNode("a:stretch"),o.leafNode("a:fillRect"),o.closeNode(),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset();break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(){}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.parser=void 0),!0;switch(o){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(a,o){a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":o.rId,cstate:"print"})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(a){switch(a){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(a){a.openNode(this.tag),a.leafNode("a:picLocks",{noChangeAspect:"1"}),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){switch(a){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(s,T,S){const m=s("../base-xform"),a=s("./hlink-click-xform"),o=s("./ext-lst-xform");T.exports=class extends m{constructor(){super(),this.map={"a:hlinkClick":new a,"a:extLst":new o}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(s,T,S){const m=s("../base-xform"),a=s("../simple/integer-xform");T.exports=class extends m{constructor(o){super(),this.tag=o.tag,this.map={"xdr:col":new a({tag:"xdr:col",zero:!0}),"xdr:colOff":new a({tag:"xdr:colOff",zero:!0}),"xdr:row":new a({tag:"xdr:row",zero:!0}),"xdr:rowOff":new a({tag:"xdr:rowOff",zero:!0})}}render(o,r){o.openNode(this.tag),this.map["xdr:col"].render(o,r.nativeCol),this.map["xdr:colOff"].render(o,r.nativeColOff),this.map["xdr:row"].render(o,r.nativeRow),this.map["xdr:rowOff"].render(o,r.nativeRowOff),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset();break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.parser=void 0),!0;switch(o){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"),a=s("../../../utils/xml-stream"),o=s("../base-xform"),r=s("./two-cell-anchor-xform"),t=s("./one-cell-anchor-xform");class e extends o{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(n){n.anchors.forEach((i,f)=>{i.anchorType=function(c){return(typeof c.range=="string"?m.decode(c.range):c.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(i),this.map[i.anchorType].prepare(i,{index:f})})}get tag(){return"xdr:wsDr"}render(n,i){n.openXml(a.StdDocAttributes),n.openNode(this.tag,e.DRAWING_ATTRIBUTES),i.anchors.forEach(f=>{this.map[f.anchorType].render(n,f)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(n){case this.tag:return!1;default:return!0}}reconcile(n,i){n.anchors.forEach(f=>{f.br?this.map["xdr:twoCellAnchor"].reconcile(f,i):this.map["xdr:oneCellAnchor"].reconcile(f,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(a){a.openNode(this.tag),a.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),a.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),a.closeNode(),a.closeNode()}parseOpen(a){switch(a.name){case this.tag:default:return!0}}parseText(){}parseClose(a){switch(a){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(a){super(),this.tag=a.tag,this.map={}}render(a,o){a.openNode(this.tag);const r=Math.floor(9525*o.width),t=Math.floor(9525*o.height);a.addAttribute("cx",r),a.addAttribute("cy",t),a.closeNode()}parseOpen(a){return a.name===this.tag&&(this.model={width:parseInt(a.attributes.cx||"0",10)/9525,height:parseInt(a.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(a,o){o.hyperlinks&&o.hyperlinks.rId&&a.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":o.hyperlinks.rId,tooltip:o.hyperlinks.tooltip})}parseOpen(a){switch(a.name){case this.tag:return this.model={hyperlinks:{rId:a.attributes["r:id"],tooltip:a.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(s,T,S){const m=s("../base-xform"),a=s("./c-nv-pr-xform"),o=s("./c-nv-pic-pr-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:cNvPr":new a,"xdr:cNvPicPr":new o}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(s,T,S){const m=s("./base-cell-anchor-xform"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./ext-xform"),t=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new a({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"),a=s("../static-xform"),o=s("./blip-fill-xform"),r=s("./nv-pic-pr-xform"),t=s("./sp-pr");T.exports=class extends m{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new o,"xdr:spPr":new a(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"),a=s("../static-xform"),o=s("./cell-position-xform"),r=s("./pic-xform");T.exports=class extends m{constructor(){super(),this.map={"xdr:from":new o({tag:"xdr:from"}),"xdr:to":new o({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new a({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(a){super(),this.tag=a.tag,this.always=!!a.always,this.count=a.count,this.empty=a.empty,this.$count=a.$count||"count",this.$=a.$,this.childXform=a.childXform,this.maxItems=a.maxItems}prepare(a,o){const{childXform:r}=this;a&&a.forEach((t,e)=>{o.index=e,r.prepare(t,o)})}render(a,o){if(this.always||o&&o.length){a.openNode(this.tag,this.$),this.count&&a.addAttribute(this.$count,o&&o.length||0);const{childXform:r}=this;(o||[]).forEach((t,e)=>{r.render(a,t,e)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(a)&&(this.parser=this.childXform,!0)}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser){if(!this.parser.parseClose(a)&&(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(a,o){if(a){const{childXform:r}=this;a.forEach(t=>{r.reconcile(t,o)})}}}},{"./base-xform":32}],72:[function(s,T,S){const m=s("../../../utils/col-cache"),a=s("../base-xform");T.exports=class extends a{get tag(){return"autoFilter"}render(o,r){if(r)if(typeof r=="string")o.leafNode("autoFilter",{ref:r});else{const t=function(n){return typeof n=="string"?n:m.getAddress(n.row,n.column).address},e=t(r.from),l=t(r.to);e&&l&&o.leafNode("autoFilter",{ref:`${e}:${l}`})}}parseOpen(o){o.name==="autoFilter"&&(this.model=o.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(s,T,S){const m=s("../../../utils/utils"),a=s("../base-xform"),o=s("../../../doc/range"),r=s("../../../doc/enums"),t=s("../strings/rich-text-xform");function e(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}T.exports=class extends a{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,n){const i=n.styles.addStyleModel(l.style||{},function(f){switch(f.type){case r.ValueType.Formula:return e(f.result);default:return f.type}}(l));switch(i&&(l.styleId=i),l.comment&&n.comments.push({...l.comment,ref:l.address}),l.type){case r.ValueType.String:case r.ValueType.RichText:n.sharedStrings&&(l.ssId=n.sharedStrings.add(l.value));break;case r.ValueType.Date:n.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:n.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=n.sharedStrings.add(l.text)),n.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:n.merges.add(l);break;case r.ValueType.Formula:if(n.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=n.siFormulae++),l.formula)n.formulae[l.address]=l;else if(l.sharedFormula){const f=n.formulae[l.sharedFormula];if(!f)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);f.si===void 0?(f.shareType="shared",f.si=n.siFormulae++,f.range=new o(f.address,l.address)):f.range&&f.range.expandToAddress(l.address),l.si=f.si}}}renderFormula(l,n){let i=null;switch(n.shareType){case"shared":i={t:"shared",ref:n.ref||n.range.range,si:n.si};break;case"array":i={t:"array",ref:n.ref};break;default:n.si!==void 0&&(i={t:"shared",si:n.si})}switch(e(n.result)){case r.ValueType.Null:l.leafNode("f",i,n.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Number:l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",i,n.formula),l.leafNode("v",null,n.result.error);break;case r.ValueType.Date:l.leafNode("f",i,n.formula),l.leafNode("v",null,m.dateToExcel(n.result,n.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,n){if(n.type!==r.ValueType.Null||n.styleId){switch(l.openNode("c"),l.addAttribute("r",n.address),n.styleId&&l.addAttribute("s",n.styleId),n.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,n.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,n.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,n.value.error);break;case r.ValueType.String:case r.ValueType.RichText:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):n.value&&n.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),n.value.richText.forEach(i=>{this.richTextXForm.render(l,i)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,n.value));break;case r.ValueType.Date:l.leafNode("v",null,m.dateToExcel(n.value,n.date1904));break;case r.ValueType.Hyperlink:n.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,n.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,n.text));break;case r.ValueType.Formula:this.renderFormula(l,n);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:n}=this;if(n.formula||n.shareType)n.type=r.ValueType.Formula,n.value&&(this.t==="str"?n.result=m.xmlDecode(n.value):this.t==="b"?n.result=parseInt(n.value,10)!==0:this.t==="e"?n.result={error:n.value}:n.result=parseFloat(n.value),n.value=void 0);else if(n.value!==void 0)switch(this.t){case"s":n.type=r.ValueType.String,n.value=parseInt(n.value,10);break;case"str":n.type=r.ValueType.String,n.value=m.xmlDecode(n.value);break;case"inlineStr":n.type=r.ValueType.String;break;case"b":n.type=r.ValueType.Boolean,n.value=parseInt(n.value,10)!==0;break;case"e":n.type=r.ValueType.Error,n.value={error:n.value};break;default:n.type=r.ValueType.Number,n.value=parseFloat(n.value)}else n.styleId?n.type=r.ValueType.Null:n.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(l),!0)}}reconcile(l,n){const i=l.styleId&&n.styles&&n.styles.getStyleModel(l.styleId);switch(i&&(l.style=i),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&n.sharedStrings&&(l.value=n.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:i&&m.isDateFmt(i.numFmt)&&(l.type=r.ValueType.Date,l.value=m.excelToDate(l.value,n.date1904));break;case r.ValueType.Formula:l.result!==void 0&&i&&m.isDateFmt(i.numFmt)&&(l.result=m.excelToDate(l.result,n.date1904)),l.shareType==="shared"&&(l.ref?n.formulae[l.si]=l.address:(l.sharedFormula=n.formulae[l.si],delete l.shareType),delete l.si)}const f=n.hyperlinkMap[l.address];f&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=f);const c=n.commentsMap&&n.commentsMap[l.address];c&&(l.comment=c)}}},{"../../../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(a,o){a.leafNode(this.tag,{iconSet:o.iconSet,iconId:o.iconId})}parseOpen(a){let{attributes:o}=a;this.model={iconSet:o.iconSet,iconId:m.toIntValue(o.iconId)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],75:[function(s,T,S){const{v4:m}=s("uuid"),a=s("../../base-xform"),o=s("../../composite-xform"),r=s("./databar-ext-xform"),t=s("./icon-set-ext-xform"),e={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends o{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(i){return i.type==="dataBar"?r.isExt(i):!(i.type!=="iconSet"||!i.custom&&!e[i.iconSet])}prepare(i){l.isExt(i)&&(i.x14Id=`{${m()}}`.toUpperCase())}render(i,f){if(l.isExt(f))switch(f.type){case"dataBar":this.renderDataBar(i,f);break;case"iconSet":this.renderIconSet(i,f)}}renderDataBar(i,f){i.openNode(this.tag,{type:"dataBar",id:f.x14Id}),this.databarXform.render(i,f),i.closeNode()}renderIconSet(i,f){i.openNode(this.tag,{type:"iconSet",priority:f.priority,id:f.x14Id||`{${m()}}`}),this.iconSetXform.render(i,f),i.closeNode()}createNewModel(i){let{attributes:f}=i;return{type:f.type,x14Id:f.id,priority:a.toIntValue(f.priority)}}onParserClose(i,f){Object.assign(this.model,f.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"),a=s("./f-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:f":this.fExtXform=new a}}get tag(){return"x14:cfvo"}render(o,r){o.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(o,r.value),o.closeNode()}createNewModel(o){return{type:o.attributes.type}}onParserClose(o,r){switch(o){case"xm:f":this.model.value=r.model?parseFloat(r.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(s,T,S){const m=s("../../composite-xform"),a=s("./sqref-ext-xform"),o=s("./cf-rule-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"xm:sqref":this.sqRef=new a,"x14:cfRule":this.cfRule=new o}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(r,t){t.rules.some(o.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(o.isExt).forEach(e=>this.cfRule.render(r,e)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(s,T,S){const m=s("../../composite-xform"),a=s("./cf-rule-ext-xform"),o=s("./conditional-formatting-ext-xform");T.exports=class extends m{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new o}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(a.isExt))),r.hasExtContent}prepare(r,t){r.forEach(e=>{this.cfXform.prepare(e,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(e=>this.cfXform.render(r,e)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("../../style/color-xform"),r=s("./cfvo-ext-xform");T.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new o("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new o("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new o("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new o("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(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],81:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-ext-xform"),r=s("./cf-icon-ext-xform");T.exports=class extends a{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"x14:cfIcon":this.cfIconXform=new r}}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,n)=>{l.iconId=n,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(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],83:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("../../../../doc/range"),r=s("./databar-xform"),t=s("./ext-lst-ref-xform"),e=s("./formula-xform"),l=s("./color-scale-xform"),n=s("./icon-set-xform"),i={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},f=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 c extends a{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new e,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new n}}get tag(){return"cfRule"}static isPrimitive(d){return d.type!=="iconSet"||!d.custom&&!i[d.iconSet]}render(d,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(w=>{this.formulaXform.render(d,w)}),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){c.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 w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new o(_.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);w&&this.formulaXform.render(d,w),d.closeNode()}renderTimePeriod(d,h){d.openNode(this.tag,{type:"timePeriod",dxfId:h.dxfId,priority:h.priority,timePeriod:h.timePeriod});const w=(_=>{if(_.formulae&&_.formulae[0])return _.formulae[0];const A=new o(_.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);w&&this.formulaXform.render(d,w),d.closeNode()}createNewModel(d){let{attributes:h}=d;return{...f(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=c},{"../../../../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(a,o){a.leafNode(this.tag,{type:o.type,val:o.value})}parseOpen(a){this.model={type:a.attributes.type,value:m.toFloatValue(a.attributes.val)}}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],85:[function(s,T,S){const m=s("../../composite-xform"),a=s("../../style/color-xform"),o=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),t.color.forEach(e=>{this.colorXform.render(r,e)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(s,T,S){const m=s("../../composite-xform"),a=s("./cf-rule-xform");T.exports=class extends m{constructor(){super(),this.map={cfRule:new a}}get tag(){return"conditionalFormatting"}render(o,r){r.rules.some(a.isPrimitive)&&(o.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{a.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(o,t))}),o.closeNode())}createNewModel(o){let{attributes:r}=o;return{ref:r.sqref,rules:[]}}onParserClose(o,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(s,T,S){const m=s("../../base-xform"),a=s("./conditional-formatting-xform");T.exports=class extends m{constructor(){super(),this.cfXform=new a}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(o,r){let t=o.reduce((e,l)=>Math.max(e,...l.rules.map(n=>n.priority||0)),1);o.forEach(e=>{e.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(o,r){r.forEach(t=>{this.cfXform.render(o,t)})}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(o),!0;default:return!1}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(!!this.parser.parseClose(o)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(o,r){o.forEach(t=>{t.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=r.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(s,T,S){const m=s("../../composite-xform"),a=s("../../style/color-xform"),o=s("./cfvo-xform");T.exports=class extends m{constructor(){super(),this.map={cfvo:this.cfvoXform=new o,color:this.colorXform=new a}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(e=>{this.cfvoXform.render(r,e)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform");class o 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 r extends a{constructor(){super(),this.map={"x14:id":this.idXform=new o}}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 a{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(s,T,S){const m=s("../../base-xform");T.exports=class extends m{get tag(){return"formula"}render(a,o){a.leafNode(this.tag,null,o)}parseOpen(){this.model=""}parseText(a){this.model+=a}parseClose(a){return a!==this.tag}}},{"../../base-xform":32}],91:[function(s,T,S){const m=s("../../base-xform"),a=s("../../composite-xform"),o=s("./cfvo-xform");T.exports=class extends a{constructor(){super(),this.map={cfvo:this.cfvoXform=new o}}get tag(){return"iconSet"}render(r,t){r.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(r,e)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:m.toStringValue(t.iconSet,"3TrafficLights"),reverse:m.toBoolValue(t.reverse),showValue:m.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(s,T,S){const m=s("../../../utils/utils"),a=s("../base-xform");T.exports=class extends a{get tag(){return"col"}prepare(o,r){const t=r.styles.addStyleModel(o.style||{});t&&(o.styleId=t)}render(o,r){o.openNode("col"),o.addAttribute("min",r.min),o.addAttribute("max",r.max),r.width&&o.addAttribute("width",r.width),r.styleId&&o.addAttribute("style",r.styleId),r.hidden&&o.addAttribute("hidden","1"),r.bestFit&&o.addAttribute("bestFit","1"),r.outlineLevel&&o.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&o.addAttribute("collapsed","1"),o.addAttribute("customWidth","1"),o.closeNode()}parseOpen(o){if(o.name==="col"){const r=this.model={min:parseInt(o.attributes.min||"0",10),max:parseInt(o.attributes.max||"0",10),width:o.attributes.width===void 0?void 0:parseFloat(o.attributes.width||"0")};return o.attributes.style&&(r.styleId=parseInt(o.attributes.style,10)),m.parseBoolean(o.attributes.hidden)&&(r.hidden=!0),m.parseBoolean(o.attributes.bestFit)&&(r.bestFit=!0),o.attributes.outlineLevel&&(r.outlineLevel=parseInt(o.attributes.outlineLevel,10)),m.parseBoolean(o.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(o,r){o.styleId&&(o.style=r.styles.getStyleModel(o.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../../utils/utils"),o=s("../../../utils/col-cache"),r=s("../base-xform"),t=s("../../../doc/range");function e(n,i,f,c){const u=i[f];u!==void 0?n[f]=u:c!==void 0&&(n[f]=c)}function l(n,i,f,c){const u=i[f];u!==void 0&&(n[f]=a.parseBoolean(u))}T.exports=class extends r{get tag(){return"dataValidations"}render(n,i){const f=function(c){const u=m.map(c,(w,_)=>({address:_,dataValidation:w,marked:!1})).sort((w,_)=>m.strcmp(w.address,_.address)),d=m.keyBy(u,"address"),h=(w,_,A)=>{for(let N=0;N<_;N++){const L=o.encodeAddress(w.row+N,A);if(!c[L]||!m.isEqual(c[w.address],c[L]))return!1}return!0};return u.map(w=>{if(!w.marked){const _=o.decodeEx(w.address);if(_.dimensions)return d[_.dimensions].marked=!0,{...w.dataValidation,sqref:w.address};let A=1,N=o.encodeAddress(_.row+A,_.col);for(;c[N]&&m.isEqual(w.dataValidation,c[N]);)A++,N=o.encodeAddress(_.row+A,_.col);let L=1;for(;h(_,A,_.col+L);)L++;for(let I=0;I1||L>1){const I=_.row+(A-1),P=_.col+(L-1);return{...w.dataValidation,sqref:`${w.address}:${o.encodeAddress(I,P)}`}}return{...w.dataValidation,sqref:w.address}}return null}).filter(Boolean)}(i);f.length&&(n.openNode("dataValidations",{count:f.length}),f.forEach(c=>{n.openNode("dataValidation"),c.type!=="any"&&(n.addAttribute("type",c.type),c.operator&&c.type!=="list"&&c.operator!=="between"&&n.addAttribute("operator",c.operator),c.allowBlank&&n.addAttribute("allowBlank","1")),c.showInputMessage&&n.addAttribute("showInputMessage","1"),c.promptTitle&&n.addAttribute("promptTitle",c.promptTitle),c.prompt&&n.addAttribute("prompt",c.prompt),c.showErrorMessage&&n.addAttribute("showErrorMessage","1"),c.errorStyle&&n.addAttribute("errorStyle",c.errorStyle),c.errorTitle&&n.addAttribute("errorTitle",c.errorTitle),c.error&&n.addAttribute("error",c.error),n.addAttribute("sqref",c.sqref),(c.formulae||[]).forEach((u,d)=>{n.openNode("formula"+(d+1)),c.type==="date"?n.writeText(a.dateToExcel(new Date(u))):n.writeText(u),n.closeNode()}),n.closeNode()}),n.closeNode())}parseOpen(n){switch(n.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=n.attributes.sqref;const i={type:n.attributes.type||"any",formulae:[]};switch(n.attributes.type&&l(i,n.attributes,"allowBlank"),l(i,n.attributes,"showInputMessage"),l(i,n.attributes,"showErrorMessage"),i.type){case"any":case"list":case"custom":break;default:e(i,n.attributes,"operator","between")}return e(i,n.attributes,"promptTitle"),e(i,n.attributes,"prompt"),e(i,n.attributes,"errorStyle"),e(i,n.attributes,"errorTitle"),e(i,n.attributes,"error"),this._dataValidation=i,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(n){this._formula&&this._formula.push(n)}parseClose(n){switch(n){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(i=>{i.includes(":")?new t(i).forEachAddress(f=>{this.model[f]=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=a.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(a,o){o&&a.leafNode("dimension",{ref:o})}parseOpen(a){return a.name==="dimension"&&(this.model=a.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(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(s,T,S){const m=s("../composite-xform"),a=s("./cf-ext/conditional-formattings-ext-xform");class o extends m{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new a}}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 o}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"headerFooter"}render(a,o){if(o){a.addRollback();let r=!1;a.openNode("headerFooter"),o.differentFirst&&(a.addAttribute("differentFirst","1"),r=!0),o.differentOddEven&&(a.addAttribute("differentOddEven","1"),r=!0),o.oddHeader&&typeof o.oddHeader=="string"&&(a.leafNode("oddHeader",null,o.oddHeader),r=!0),o.oddFooter&&typeof o.oddFooter=="string"&&(a.leafNode("oddFooter",null,o.oddFooter),r=!0),o.evenHeader&&typeof o.evenHeader=="string"&&(a.leafNode("evenHeader",null,o.evenHeader),r=!0),o.evenFooter&&typeof o.evenFooter=="string"&&(a.leafNode("evenFooter",null,o.evenFooter),r=!0),o.firstHeader&&typeof o.firstHeader=="string"&&(a.leafNode("firstHeader",null,o.firstHeader),r=!0),o.firstFooter&&typeof o.firstFooter=="string"&&(a.leafNode("firstFooter",null,o.firstFooter),r=!0),r?(a.closeNode(),a.commit()):a.rollback()}}parseOpen(a){switch(a.name){case"headerFooter":return this.model={},a.attributes.differentFirst&&(this.model.differentFirst=parseInt(a.attributes.differentFirst,0)===1),a.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(a.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(a){switch(this.currentNode){case"oddHeader":this.model.oddHeader=a;break;case"oddFooter":this.model.oddFooter=a;break;case"evenHeader":this.model.evenHeader=a;break;case"evenFooter":this.model.evenFooter=a;break;case"firstHeader":this.model.firstHeader=a;break;case"firstFooter":this.model.firstFooter=a}}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(a,o){this.isInternalLink(o)?a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip,location:o.target}):a.leafNode("hyperlink",{ref:o.address,"r:id":o.rId,tooltip:o.tooltip})}parseOpen(a){return a.name==="hyperlink"&&(this.model={address:a.attributes.ref,rId:a.attributes["r:id"],tooltip:a.attributes.tooltip},a.attributes.location&&(this.model.target=a.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(a){return a.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(a.target)}}},{"../base-xform":32}],99:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"mergeCell"}render(a,o){a.leafNode("mergeCell",{ref:o})}parseOpen(a){return a.name==="mergeCell"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../../doc/range"),o=s("../../../utils/col-cache"),r=s("../../../doc/enums");T.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new a(e)}}get mergeCells(){return m.map(this.merges,t=>t.range)}reconcile(t,e){m.each(t,l=>{const n=o.decode(l);for(let i=n.top;i<=n.bottom;i++){const f=e[i-1];for(let c=n.left;c<=n.right;c++){const u=f.cells[c-1];u?u.type===r.ValueType.Merge&&(u.master=n.tl):f.cells[c]={type:r.ValueType.Null,address:o.encodeAddress(i,c)}}}})}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"),a=o=>o!==void 0;T.exports=class extends m{get tag(){return"outlinePr"}render(o,r){return!(!r||!a(r.summaryBelow)&&!a(r.summaryRight))&&(o.leafNode(this.tag,{summaryBelow:a(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:a(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={summaryBelow:a(o.attributes.summaryBelow)?!!Number(o.attributes.summaryBelow):void 0,summaryRight:a(o.attributes.summaryRight)?!!Number(o.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(a,o){a.leafNode("brk",o)}parseOpen(a){return a.name==="brk"&&(this.model=a.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");T.exports=class extends a{get tag(){return"pageMargins"}render(o,r){if(r){const t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};m.some(t,e=>e!==void 0)&&o.leafNode(this.tag,t)}}parseOpen(o){switch(o.name){case this.tag:return this.model={left:parseFloat(o.attributes.left||.7),right:parseFloat(o.attributes.right||.7),top:parseFloat(o.attributes.top||.75),bottom:parseFloat(o.attributes.bottom||.75),header:parseFloat(o.attributes.header||.3),footer:parseFloat(o.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(a,o){return!(!o||!o.fitToPage)&&(a.leafNode(this.tag,{fitToPage:o.fitToPage?"1":void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={fitToPage:a.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");function o(l){return l?"1":void 0}function r(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function e(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}T.exports=class extends a{get tag(){return"pageSetup"}render(l,n){if(n){const i={paperSize:n.paperSize,orientation:n.orientation,horizontalDpi:n.horizontalDpi,verticalDpi:n.verticalDpi,pageOrder:r(n.pageOrder),blackAndWhite:o(n.blackAndWhite),draft:o(n.draft),cellComments:t(n.cellComments),errors:e(n.errors),scale:n.scale,fitToWidth:n.fitToWidth,fitToHeight:n.fitToHeight,firstPageNumber:n.firstPageNumber,useFirstPageNumber:o(n.firstPageNumber),usePrinterDefaults:o(n.usePrinterDefaults),copies:n.copies};m.some(i,f=>f!==void 0)&&l.leafNode(this.tag,i)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(n=l.attributes.paperSize,n!==void 0?parseInt(n,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var n}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"picture"}render(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.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"),a=s("../base-xform");function o(r){return r?"1":void 0}T.exports=class extends a{get tag(){return"printOptions"}render(r,t){if(t){const e={headings:o(t.showRowColHeaders),gridLines:o(t.showGridLines),horizontalCentered:o(t.horizontalCentered),verticalCentered:o(t.verticalCentered)};m.some(e,l=>l!==void 0)&&r.leafNode(this.tag,e)}}parseOpen(r){switch(r.name){case this.tag:return this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(s,T,S){const m=s("./page-breaks-xform"),a=s("../list-xform");T.exports=class extends a{constructor(){super({tag:"rowBreaks",count:!0,childXform:new m})}render(o,r){if(r&&r.length){o.openNode(this.tag,this.$),this.count&&(o.addAttribute(this.$count,r.length),o.addAttribute("manualBreakCount",r.length));const{childXform:t}=this;r.forEach(e=>{t.render(o,e)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(s,T,S){const m=s("../base-xform"),a=s("../../../utils/utils"),o=s("./cell-xform");T.exports=class extends m{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new o}}get tag(){return"row"}prepare(r,t){const e=t.styles.addStyleModel(r.style);e&&(r.styleId=e);const l=this.map.c;r.cells.forEach(n=>{l.prepare(n,t)})}render(r,t,e){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(n=>{l.render(r,n,e)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;const t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],e=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(e.styleId=parseInt(r.attributes.s,10)),a.parseBoolean(r.attributes.hidden)&&(e.hidden=!0),a.parseBoolean(r.attributes.bestFit)&&(e.bestFit=!0),r.attributes.ht&&(e.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(e.outlineLevel=parseInt(r.attributes.outlineLevel,10)),a.parseBoolean(r.attributes.collapsed)&&(e.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);const e=this.map.c;r.cells.forEach(l=>{e.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");T.exports=class extends a{get tag(){return"sheetFormatPr"}render(o,r){if(r){const t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),m.some(t,e=>e!==void 0)&&o.leafNode("sheetFormatPr",t)}}parseOpen(o){return o.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(o.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(o.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(o.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(o.attributes.outlineLevelCol||"0",10)},o.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(o.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(s,T,S){const m=s("../base-xform"),a=s("../style/color-xform"),o=s("./page-setup-properties-xform"),r=s("./outline-properties-xform");T.exports=class extends m{constructor(){super(),this.map={tabColor:new a("tabColor"),pageSetUpPr:new o,outlinePr:new r}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,e.tabColor)||l,l=this.map.pageSetUpPr.render(t,e.pageSetup)||l,l=this.map.outlinePr.render(t,e.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../base-xform");function o(t,e){return t?e:void 0}function r(t,e){return t===e||void 0}T.exports=class extends a{get tag(){return"sheetProtection"}render(t,e){if(e){const l={sheet:o(e.sheet,"1"),selectLockedCells:e.selectLockedCells===!1?"1":void 0,selectUnlockedCells:e.selectUnlockedCells===!1?"1":void 0,formatCells:o(e.formatCells,"0"),formatColumns:o(e.formatColumns,"0"),formatRows:o(e.formatRows,"0"),insertColumns:o(e.insertColumns,"0"),insertRows:o(e.insertRows,"0"),insertHyperlinks:o(e.insertHyperlinks,"0"),deleteColumns:o(e.deleteColumns,"0"),deleteRows:o(e.deleteRows,"0"),sort:o(e.sort,"0"),autoFilter:o(e.autoFilter,"0"),pivotTables:o(e.pivotTables,"0")};e.sheet&&(l.algorithmName=e.algorithmName,l.hashValue=e.hashValue,l.saltValue=e.saltValue,l.spinCount=e.spinCount,l.objects=o(e.objects===!1,"1"),l.scenarios=o(e.scenarios===!1,"1")),m.some(l,n=>n!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(s,T,S){const m=s("../../../utils/col-cache"),a=s("../base-xform"),o={frozen:"frozen",frozenSplit:"frozen",split:"split"};T.exports=class extends a{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const e=function(c,u,d){d&&r.addAttribute(c,u)};let l,n,i,f;switch(e("rightToLeft","1",t.rightToLeft===!0),e("tabSelected","1",t.tabSelected),e("showRuler","0",t.showRuler===!1),e("showRowColHeaders","0",t.showRowColHeaders===!1),e("showGridLines","0",t.showGridLines===!1),e("zoomScale",t.zoomScale,t.zoomScale),e("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),e("view",t.style,t.style),t.state){case"frozen":n=t.xSplit||0,i=t.ySplit||0,l=t.topLeftCell||m.getAddress(i+1,n+1).address,f=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:f,state:"frozen"}),r.leafNode("selection",{pane:f,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{const t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,e;switch(r){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:o[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(a,o){o&&a.leafNode(this.tag,{"r:id":o.rId})}parseOpen(a){switch(a.name){case this.tag:return this.model={rId:a.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"),a=s("../../../utils/col-cache"),o=s("../../../utils/xml-stream"),r=s("../../rel-type"),t=s("./merges"),e=s("../base-xform"),l=s("../list-xform"),n=s("./row-xform"),i=s("./col-xform"),f=s("./dimension-xform"),c=s("./hyperlink-xform"),u=s("./merge-cell-xform"),d=s("./data-validations-xform"),h=s("./sheet-properties-xform"),w=s("./sheet-format-properties-xform"),_=s("./sheet-view-xform"),A=s("./sheet-protection-xform"),N=s("./page-margins-xform"),L=s("./page-setup-xform"),I=s("./print-options-xform"),P=s("./auto-filter-xform"),D=s("./picture-xform"),U=s("./drawing-xform"),B=s("./table-part-xform"),x=s("./row-breaks-xform"),M=s("./header-footer-xform"),v=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={},O={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach($=>{const{x14Id:W}=$;W&&(O[W]=$)})}),k.forEach(z=>{z.rules.forEach($=>{const W=O[$.x14Id];W?((j,H)=>{Object.keys(H).forEach(E=>{const C=j[E],F=H[E];C===void 0&&F!==void 0&&(j[E]=F)})})(W,$):R[z.ref]?R[z.ref].rules.push($):y.push({ref:z.ref,rules:[$]})})}),y};class g extends e{constructor(k){super();const{maxRows:R,maxCols:O,ignoreNodes:z}=k||{};this.ignoreNodes=z||[],this.map={sheetPr:new h,dimension:new f,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new _}),sheetFormatPr:new w,cols:new l({tag:"cols",count:!1,childXform:new i}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new n({maxItems:O}),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 c}),pageMargins:new N,dataValidations:new d,pageSetup:new L,headerFooter:new M,printOptions:new I,picture:new D,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new v,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 O=k.rels=[];function z(j){return"rId"+(j.length+1)}if(k.hyperlinks.forEach(j=>{const H=z(O);j.rId=H,O.push({Id:H,Type:r.Hyperlink,Target:j.target,TargetMode:"External"})}),k.comments.length>0){const j={Id:z(O),Type:r.Comments,Target:`../comments${k.id}.xml`};O.push(j);const H={Id:z(O),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${k.id}.vml`};O.push(H),k.comments.forEach(E=>{E.refAddress=a.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+k.id,vmlDrawing:"vmlDrawing"+k.id})}const $=[];let W;k.media.forEach(j=>{if(j.type==="background"){const H=z(O);W=R.media[j.imageId],O.push({Id:H,Type:r.Image,Target:`../media/${W.name}.${W.extension}`}),k.background={rId:H},k.image=R.media[j.imageId]}else if(j.type==="image"){let{drawing:H}=k;W=R.media[j.imageId],H||(H=k.drawing={rId:z(O),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push(H),O.push({Id:H.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${H.name}.xml`}));let E=this.preImageId===j.imageId?$[j.imageId]:$[H.rels.length];E||(E=z(H.rels),$[H.rels.length]=E,H.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${W.name}.${W.extension}`}));const C={picture:{rId:E},range:j.range};if(j.hyperlinks&&j.hyperlinks.hyperlink){const F=z(H.rels);$[H.rels.length]=F,C.picture.hyperlinks={tooltip:j.hyperlinks.tooltip,rId:F},H.rels.push({Id:F,Type:r.Hyperlink,Target:j.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=j.imageId,H.anchors.push(C)}}),k.tables.forEach(j=>{const H=z(O);j.rId=H,O.push({Id:H,Type:r.Table,Target:"../tables/"+j.target}),j.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(o.StdDocAttributes),k.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const O=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&&(O.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},$=R.pageSetup&&R.pageSetup.margins,W={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},j=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,O),this.map.cols.render(k,R.cols),this.map.sheetData.render(k,R.rows),this.map.sheetProtection.render(k,j),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,W),this.map.pageMargins.render(k,$),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(H=>{H.Type===r.VmlDrawing&&k.leafNode("legacyDrawing",{"r:id":H.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 O={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(O,this.map.pageSetup.model,this.map.printOptions.model),$=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:$},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 O=(k.relationships||[]).reduce(($,W)=>{if($[W.Id]=W,W.Type===r.Comments&&(k.comments=R.comments[W.Target].comments),W.Type===r.VmlDrawing&&k.comments&&k.comments.length){const j=R.vmlDrawings[W.Target].comments;k.comments.forEach((H,E)=>{H.note=Object.assign({},H.note,j[E])})}return $},{});if(R.commentsMap=(k.comments||[]).reduce(($,W)=>(W.ref&&($[W.ref]=W),$),{}),R.hyperlinkMap=(k.hyperlinks||[]).reduce(($,W)=>(W.rId&&($[W.address]=O[W.rId].Target),$),{}),R.formulae={},k.rows=k.rows&&k.rows.filter(Boolean)||[],k.rows.forEach($=>{$.cells=$.cells&&$.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 $=O[k.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if($){const W=$[1];R.drawings[W].anchors.forEach(j=>{if(j.medium){const H={type:"image",imageId:j.medium.index,range:j.range,hyperlinks:j.picture.hyperlinks};k.media.push(H)}})}}const z=k.background&&O[k.background.rId];if(z){const $=z.Target.split("/media/")[1],W=R.mediaIndex&&R.mediaIndex[$];W!==void 0&&k.media.push({type:"background",imageId:W})}k.tables=(k.tables||[]).map($=>{const W=O[$.rId];return R.tables[W.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(a){super(),this.tag=a.tag,this.attr=a.attr}render(a,o){o&&(a.openNode(this.tag),a.closeNode())}parseOpen(a){a.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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this._format=a.format||function(o){try{return Number.isNaN(o.getTime())?"":o.toISOString()}catch{return""}},this._parse=a.parse||function(o){return new Date(o)}}render(a,o){o&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,this._format(o)):a.writeText(this._format(o)),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=this._parse(a.attributes[this.attr]):this.text=[])}parseText(a){this.attr||this.text.push(a)}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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs,this.zero=a.zero}render(a,o){(o||this.zero)&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){return a.name===this.tag&&(this.attr?this.model=parseInt(a.attributes[this.attr],10):this.text=[],!0)}parseText(a){this.attr||this.text.push(a)}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(a){super(),this.tag=a.tag,this.attr=a.attr,this.attrs=a.attrs}render(a,o){o!==void 0&&(a.openNode(this.tag),this.attrs&&a.addAttributes(this.attrs),this.attr?a.addAttribute(this.attr,o):a.writeText(o),a.closeNode())}parseOpen(a){a.name===this.tag&&(this.attr?this.model=a.attributes[this.attr]:this.text=[])}parseText(a){this.attr||this.text.push(a)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(s,T,S){const m=s("./base-xform"),a=s("../../utils/xml-stream");T.exports=class extends m{constructor(o){super(),this._model=o}render(o){if(!this._xml){const r=new a;(function t(e,l){e.openNode(l.tag,l.$),l.c&&l.c.forEach(n=>{t(e,n)}),l.t&&e.writeText(l.t),e.closeNode()})(r,this._model),this._xml=r.xml}o.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(o){switch(o){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"),a=s("./rich-text-xform"),o=s("../base-xform");T.exports=class extends o{constructor(){super(),this.map={r:new a,t:new m}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:e}=this.map;t.richText.forEach(l=>{e.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){const{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(s,T,S){const m=s("./text-xform"),a=s("../style/font-xform"),o=s("../base-xform");class r extends o{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 a(r.FONT_OPTIONS))}render(e,l){l=l||this.model,e.openNode("r"),l.font&&this.fontXform.render(e,l.font),this.textXform.render(e,l.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},T.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(s,T,S){const m=s("./text-xform"),a=s("./rich-text-xform"),o=s("./phonetic-text-xform"),r=s("../base-xform");T.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new a,t:new m,rPh:new o}}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"),a=s("../base-xform"),o=s("./shared-string-xform");T.exports=class extends a{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new o)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){const t=this.sharedStringXform.toXml(r);let e=this.rich[t];return e===void 0&&(e=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,e}render(r,t){t=t||this._values,r.openXml(m.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const e=this.sharedStringXform;t.values.forEach(l=>{e.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(r){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"t"}render(a,o){a.openNode("t"),/^\s|\n|\s$/.test(o)&&a.addAttribute("xml:space","preserve"),a.writeText(o),a.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(a,o)=>String.fromCharCode(parseInt(o,16)))}parseOpen(a){switch(a.name){case"t":return this._text=[],!0;default:return!1}}parseText(a){this._text.push(a)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(s,T,S){const m=s("../../../doc/enums"),a=s("../../../utils/utils"),o=s("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,l)=>(e[l]=!0,e),{}),vertical(e){return e==="middle"?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case"vertical":return e;default:return(e=a.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=a.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=r.textRotation(e)){if(e==="vertical")return 255;const l=Math.round(e);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(e){const l=a.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 o{get tag(){return"alignment"}render(e,l){e.addRollback(),e.openNode("alignment");let n=!1;function i(f,c){c&&(e.addAttribute(f,c),n=!0)}i("horizontal",r.horizontal(l.horizontal)),i("vertical",r.vertical(l.vertical)),i("wrapText",!!r.wrapText(l.wrapText)&&"1"),i("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),i("indent",r.indent(l.indent)),i("textRotation",t.toXml(l.textRotation)),i("readingOrder",r.readingOrder(l.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const l={};let n=!1;function i(f,c,u){f&&(l[c]=u,n=!0)}i(e.attributes.horizontal,"horizontal",e.attributes.horizontal),i(e.attributes.vertical,"vertical",e.attributes.vertical==="center"?"middle":e.attributes.vertical),i(e.attributes.wrapText,"wrapText",a.parseBoolean(e.attributes.wrapText)),i(e.attributes.shrinkToFit,"shrinkToFit",a.parseBoolean(e.attributes.shrinkToFit)),i(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),i(e.attributes.textRotation,"textRotation",t.toModel(e.attributes.textRotation)),i(e.attributes.readingOrder,"readingOrder",e.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=n?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(s,T,S){const m=s("../base-xform"),a=s("../../../utils/utils"),o=s("./color-xform");class r extends m{constructor(e){super(),this.name=e,this.map={color:new o}}get tag(){return this.name}render(e,l,n){const i=l&&l.color||n||this.defaultColor;e.openNode(this.name),l&&l.style&&(e.addAttribute("style",l.style),i&&this.map.color.render(e,i)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:l}=e.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return r.validStyleValues[e]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,e)=>(t[e]=!0,t),{}),T.exports=class extends m{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,e){const{color:l}=e;function n(i,f){i&&!i.color&&e.color&&(i={...i,color:e.color}),f.render(t,i,l)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),n(e.left,this.map.left),n(e.right,this.map.right),n(e.top,this.map.top),n(e.bottom,this.map.bottom),n(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=a.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=a.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0)}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if(t==="border"){const e=this.model={},l=function(n,i,f){i&&(f&&Object.assign(i,f),e[n]=i)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{constructor(a){super(),this.name=a||"color"}get tag(){return this.name}render(a,o){return!!o&&(a.openNode(this.name),o.argb?a.addAttribute("rgb",o.argb):o.theme!==void 0?(a.addAttribute("theme",o.theme),o.tint!==void 0&&a.addAttribute("tint",o.tint)):o.indexed!==void 0?a.addAttribute("indexed",o.indexed):a.addAttribute("auto","1"),a.closeNode(),!0)}parseOpen(a){return a.name===this.name&&(a.attributes.rgb?this.model={argb:a.attributes.rgb}:a.attributes.theme?(this.model={theme:parseInt(a.attributes.theme,10)},a.attributes.tint&&(this.model.tint=parseFloat(a.attributes.tint))):a.attributes.indexed?this.model={indexed:parseInt(a.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"),a=s("./alignment-xform"),o=s("./border-xform"),r=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 a,border:new o,fill:new r,font:new t,numFmt:new e,protection:new l}}get tag(){return"dxf"}render(n,i){if(n.openNode(this.tag),i.font&&this.map.font.render(n,i.font),i.numFmt&&i.numFmtId){const f={id:i.numFmtId,formatCode:i.numFmt};this.map.numFmt.render(n,f)}i.fill&&this.map.fill.render(n,i.fill),i.alignment&&this.map.alignment.render(n,i.alignment),i.border&&this.map.border.render(n,i.border),i.protection&&this.map.protection.render(n,i.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n),!0}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(s,T,S){const m=s("../base-xform"),a=s("./color-xform");class o extends m{constructor(){super(),this.map={color:new a}}get tag(){return"stop"}render(n,i){n.openNode("stop"),n.addAttribute("position",i.position),this.map.color.render(n,i.color),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"stop":return this.model={position:parseFloat(n.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(n),!0;default:return!1}}parseText(){}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends m{constructor(){super(),this.map={fgColor:new a("fgColor"),bgColor:new a("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(n,i){n.openNode("patternFill"),n.addAttribute("patternType",i.pattern),i.fgColor&&this.map.fgColor.render(n,i.fgColor),i.bgColor&&this.map.bgColor.render(n,i.bgColor),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"patternFill":return this.model={type:"pattern",pattern:n.attributes.patternType},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.parser.model&&(this.model[n]=this.parser.model),this.parser=void 0),!0)}}class t extends m{constructor(){super(),this.map={stop:new o}}get name(){return"gradient"}get tag(){return"gradientFill"}render(n,i){switch(n.openNode("gradientFill"),i.gradient){case"angle":n.addAttribute("degree",i.degree);break;case"path":n.addAttribute("type","path"),i.center.left&&(n.addAttribute("left",i.center.left),i.center.right===void 0&&n.addAttribute("right",i.center.left)),i.center.right&&n.addAttribute("right",i.center.right),i.center.top&&(n.addAttribute("top",i.center.top),i.center.bottom===void 0&&n.addAttribute("bottom",i.center.top)),i.center.bottom&&n.addAttribute("bottom",i.center.bottom)}const f=this.map.stop;i.stops.forEach(c=>{f.render(n,c)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"gradientFill":{const i=this.model={stops:[]};return n.attributes.degree?(i.gradient="angle",i.degree=parseInt(n.attributes.degree,10)):n.attributes.type==="path"&&(i.gradient="path",i.center={left:n.attributes.left?parseFloat(n.attributes.left):0,top:n.attributes.top?parseFloat(n.attributes.top):0},n.attributes.right!==n.attributes.left&&(i.center.right=n.attributes.right?parseFloat(n.attributes.right):0),n.attributes.bottom!==n.attributes.top&&(i.center.bottom=n.attributes.bottom?parseFloat(n.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class e extends m{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(n,i){switch(n.addRollback(),n.openNode("fill"),i.type){case"pattern":this.map.patternFill.render(n,i);break;case"gradient":this.map.gradientFill.render(n,i);break;default:return void n.rollback()}n.closeNode(),n.commit()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"fill":return this.model={},!0;default:return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return!!this.parser&&(this.parser.parseClose(n)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(n){return e.validPatternValues[n]}}e.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,n)=>(l[n]=!0,l),{}),e.StopXform=o,e.PatternFillXform=r,e.GradientFillXform=t,T.exports=e},{"../base-xform":32,"./color-xform":128}],131:[function(s,T,S){const m=s("./color-xform"),a=s("../simple/boolean-xform"),o=s("../simple/integer-xform"),r=s("../simple/string-xform"),t=s("./underline-xform"),e=s("../../../utils/under-dash"),l=s("../base-xform");class n extends l{constructor(f){super(),this.options=f||n.OPTIONS,this.map={b:{prop:"bold",xform:new a({tag:"b",attr:"val"})},i:{prop:"italic",xform:new a({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new o({tag:"charset",attr:"val"})},color:{prop:"color",xform:new m},condense:{prop:"condense",xform:new a({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new a({tag:"extend",attr:"val"})},family:{prop:"family",xform:new o({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new a({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new a({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new a({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new o({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(f,c){const{map:u}=this;f.openNode(this.options.tagName),e.each(this.map,(d,h)=>{u[h].xform.render(f,c[d.prop])}),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;if(this.map[f.name])return this.parser=this.map[f.name].xform,this.parser.parseOpen(f);switch(f.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser&&!this.parser.parseClose(f)){const c=this.map[f];return this.parser.model&&(this.model[c.prop]=this.parser.model),this.parser=void 0,!0}switch(f){case this.options.tagName:return!1;default:return!0}}}n.OPTIONS={tagName:"font",fontNameTag:"name"},T.exports=n},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(s,T,S){const m=s("../../../utils/under-dash"),a=s("../../defaultnumformats"),o=s("../base-xform"),r=function(){const e={};return m.each(a,(l,n)=>{l.f&&(e[l.f]=parseInt(n,10))}),e}();class t extends o{constructor(l,n){super(),this.id=l,this.formatCode=n}get tag(){return"numFmt"}render(l,n){l.leafNode("numFmt",{numFmtId:n.id,formatCode:n.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(e){return r[e]},t.getDefaultFmtCode=function(e){return a[e]&&a[e].f},T.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(s,T,S){const m=s("../base-xform"),a={boolean:(o,r)=>o===void 0?r:o};T.exports=class extends m{get tag(){return"protection"}render(o,r){o.addRollback(),o.openNode("protection");let t=!1;function e(l,n){n!==void 0&&(o.addAttribute(l,n),t=!0)}e("locked",a.boolean(r.locked,!0)?void 0:"0"),e("hidden",a.boolean(r.hidden,!1)?"1":void 0),o.closeNode(),t?o.commit():o.rollback()}parseOpen(o){const r={locked:o.attributes.locked!=="0",hidden:o.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(s,T,S){const m=s("../base-xform"),a=s("./alignment-xform"),o=s("./protection-xform");T.exports=class extends m{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new a,protection:new o}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(s,T,S){const m=s("../../../doc/enums"),a=s("../../../utils/xml-stream"),o=s("../base-xform"),r=s("../static-xform"),t=s("../list-xform"),e=s("./font-xform"),l=s("./fill-xform"),n=s("./border-xform"),i=s("./numfmt-xform"),f=s("./style-xform"),c=s("./dxf-xform");class u extends o{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 n}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new f}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new f({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new c}),numFmt:new i,font:new e,fill:new l,border:new n,style:new f({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,w){w=w||this.model,h.openXml(a.StdDocAttributes),h.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(h.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(_=>{h.writeXml(_)}),h.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),h.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("fills",{count:w.fills.length}),w.fills.forEach(_=>{h.writeXml(_)}),h.closeNode(),h.openNode("borders",{count:w.borders.length}),w.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:w.styles.length}),w.styles.forEach(_=>{h.writeXml(_)}),h.closeNode()):(this.map.numFmts.render(h,w.numFmts),this.map.fonts.render(h,w.fonts),this.map.fills.render(h,w.fills),this.map.borders.render(h,w.borders),this.map.cellStyleXfs.render(h,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(h,w.styles)),u.STATIC_XFORMS.cellStyles.render(h),this.map.dxfs.render(h,w.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 w=(_,A)=>{A.model&&A.model.length&&(this.model[_]=A.model)};if(w("numFmts",this.map.numFmts),w("fonts",this.map.fonts),w("fills",this.map.fills),w("borders",this.map.borders),w("styles",this.map.cellXfs),w("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const _=this.index.numFmt;this.model.numFmts.forEach(A=>{_[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(h,w){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(w=w||m.ValueType.Number,h.numFmt)_.numFmtId=this._addNumFmtStr(h.numFmt);else switch(w){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 w=this.model.styles[h];if(!w)return null;let _=this.index.model[h];if(_)return _;if(_=this.index.model[h]={},w.numFmtId){const N=this.index.numFmt[w.numFmtId]||i.getDefaultFmtCode(w.numFmtId);N&&(_.numFmt=N)}function A(N,L,I){if(I||I===0){const P=L[I];P&&(_[N]=P)}}return A("font",this.model.fonts,w.fontId),A("border",this.model.borders,w.borderId),A("fill",this.model.fills,w.fillId),w.alignment&&(_.alignment=w.alignment),w.protection&&(_.protection=w.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 w=this.map.style.toXml(h);let _=this.index.style[w];return _===void 0&&(_=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),_}_addNumFmtStr(h){let w=i.getDefaultFmtId(h);if(w!==void 0||(w=this.index.numFmt[h],w!==void 0))return w;w=this.index.numFmt[h]=164+this.model.numFmts.length;const _=this.map.numFmt.toXml({id:w,formatCode:h});return this.model.numFmts.push(_),w}_addFont(h){const w=this.map.font.toXml(h);let _=this.index.font[w];return _===void 0&&(_=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),_}_addBorder(h){const w=this.map.border.toXml(h);let _=this.index.border[w];return _===void 0&&(_=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),_}_addFill(h){const w=this.map.fill.toXml(h);let _=this.index.fill[w];return _===void 0&&(_=this.index.fill[w]=this.model.fills.length,this.model.fills.push(w)),_}}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 r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},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 a extends m{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{const e=a.Attributes[t];e&&r.leafNode("u",e)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}a.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},T.exports=a},{"../base-xform":32}],137:[function(s,T,S){const m=s("../base-xform"),a=s("./filter-column-xform");T.exports=class extends m{constructor(){super(),this.map={filterColumn:new a}}get tag(){return"autoFilter"}prepare(o){o.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(o,r){return o.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(o,t)}),o.closeNode(),!0}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model={autoFilterRef:o.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[o.name],this.parser)return this.parseOpen(o),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(o))}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(o){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+o)}}}},{"../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(a,o){a.leafNode(this.tag,{val:o.val,operator:o.operator})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.attributes.val,operator:a.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(s,T,S){const m=s("../base-xform"),a=s("../list-xform"),o=s("./custom-filter-xform"),r=s("./filter-xform");T.exports=class extends m{constructor(){super(),this.map={customFilters:new a({tag:"customFilters",count:!1,empty:!0,childXform:new o}),filters:new a({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;switch(t.name){case this.tag:return this.model={filterButton:e.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(s,T,S){const m=s("../base-xform");T.exports=class extends m{get tag(){return"filter"}render(a,o){a.leafNode(this.tag,{val:o.val})}parseOpen(a){return a.name===this.tag&&(this.model={val:a.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(a,o){a.id=o.index+1}render(a,o){return a.leafNode(this.tag,{id:o.id.toString(),name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.dxfId}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={name:o.name,totalsRowLabel:o.totalsRowLabel,totalsRowFunction:o.totalsRowFunction,dxfId:o.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(a,o){return a.leafNode(this.tag,{name:o.theme?o.theme:void 0,showFirstColumn:o.showFirstColumn?"1":"0",showLastColumn:o.showLastColumn?"1":"0",showRowStripes:o.showRowStripes?"1":"0",showColumnStripes:o.showColumnStripes?"1":"0"}),!0}parseOpen(a){if(a.name===this.tag){const{attributes:o}=a;return this.model={theme:o.name?o.name:null,showFirstColumn:o.showFirstColumn==="1",showLastColumn:o.showLastColumn==="1",showRowStripes:o.showRowStripes==="1",showColumnStripes:o.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(s,T,S){const m=s("../../../utils/xml-stream"),a=s("../base-xform"),o=s("../list-xform"),r=s("./auto-filter-xform"),t=s("./table-column-xform"),e=s("./table-style-info-xform");class l extends a{constructor(){super(),this.map={autoFilter:new r,tableColumns:new o({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new e}}prepare(i,f){this.map.autoFilter.prepare(i),this.map.tableColumns.prepare(i.columns,f)}get tag(){return"table"}render(i,f){i.openXml(m.StdDocAttributes),i.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:f.id,name:f.name,displayName:f.displayName||f.name,ref:f.tableRef,totalsRowCount:f.totalsRow?"1":void 0,totalsRowShown:f.totalsRow?void 0:"1",headerRowCount:f.headerRow?"1":"0"}),this.map.autoFilter.render(i,f),this.map.tableColumns.render(i,f.columns),this.map.tableStyleInfo.render(i,f.style),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;const{name:f,attributes:c}=i;switch(f){case this.tag:this.reset(),this.model={name:c.name,displayName:c.displayName||c.name,tableRef:c.ref,totalsRow:c.totalsRowCount==="1",headerRow:c.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((f,c)=>{this.model.columns[c].filterButton=f.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(i,f){i.columns.forEach(c=>{c.dxfId!==void 0&&(c.style=f.styles.getDxfStyle(c.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,a){(function(){const o=s("fs"),r=s("jszip"),{PassThrough:t}=s("readable-stream"),e=s("../utils/zip-stream"),l=s("../utils/stream-buf"),n=s("../utils/utils"),i=s("../utils/xml-stream"),{bufferToString:f}=s("../utils/browser-buffer-decode"),c=s("./xform/style/styles-xform"),u=s("./xform/core/core-xform"),d=s("./xform/strings/shared-strings-xform"),h=s("./xform/core/relationships-xform"),w=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"),I=s("./xform/table/table-xform"),P=s("./xform/comment/comments-xform"),D=s("./xform/comment/vml-notes-xform"),U=s("./xml/theme1");class B{constructor(M){this.workbook=M}async readFile(M,v){if(!await n.fs.exists(M))throw new Error("File not found: "+M);const p=o.createReadStream(M);try{const b=await this.read(p,v);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,v){const p=new A,b=new N(v),g=new L,y=new I;p.reconcile(M);const k={media:M.media,mediaIndex:M.mediaIndex};Object.keys(M.drawings).forEach(z=>{const $=M.drawings[z],W=M.drawingRels[z];W&&(k.rels=W.reduce((j,H)=>(j[H.Id]=H,j),{}),($.anchors||[]).forEach(j=>{const H=j.picture&&j.picture.hyperlinks;H&&k.rels[H.rId]&&(H.hyperlink=k.rels[H.rId].Target,delete H.rId)}),g.reconcile($,k))});const R={styles:M.styles};Object.values(M.tables).forEach(z=>{y.reconcile(z,R)});const O={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,O)}),delete M.worksheetHash,delete M.worksheetRels,delete M.globalRels,delete M.sharedStrings,delete M.workbookRels,delete M.sheetDefs,delete M.styles,delete M.mediaIndex,delete M.drawings,delete M.drawingRels,delete M.vmlDrawings}async _processWorksheetEntry(M,v,p,b,g){const y=new N(b),k=await y.parseStream(M);k.sheetNo=p,v.worksheetHash[g]=k,v.worksheets.push(k)}async _processCommentEntry(M,v,p){const b=new P,g=await b.parseStream(M);v.comments[`../${p}.xml`]=g}async _processTableEntry(M,v,p){const b=new I,g=await b.parseStream(M);v.tables[`../tables/${p}.xml`]=g}async _processWorksheetRelsEntry(M,v,p){const b=new h,g=await b.parseStream(M);v.worksheetRels[p]=g}async _processMediaEntry(M,v,p){const b=p.lastIndexOf(".");if(b>=1){const g=p.substr(b+1),y=p.substr(0,b);await new Promise((k,R)=>{const O=new l;O.on("finish",()=>{v.mediaIndex[p]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:O.toBuffer()};v.media.push(z),k()}),M.on("error",z=>{R(z)}),M.pipe(O)})}}async _processDrawingEntry(M,v,p){const b=new L,g=await b.parseStream(M);v.drawings[p]=g}async _processDrawingRelsEntry(M,v,p){const b=new h,g=await b.parseStream(M);v.drawingRels[p]=g}async _processVmlDrawingEntry(M,v,p){const b=new D,g=await b.parseStream(M);v.vmlDrawings[`../drawings/${p}.vml`]=g}async _processThemeEntry(M,v,p){await new Promise((b,g)=>{const y=new l;M.on("error",g),y.on("error",g),y.on("finish",()=>{v.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")}async read(M,v){!M[Symbol.asyncIterator]&&M.pipe&&(M=M.pipe(new t));const p=[];for await(const b of M)p.push(b);return this.load(a.concat(p),v)}async load(M,v){let p;p=v&&v.base64?a.from(M.toString(),"base64"):M;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await r.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(await y.async("nodebuffer"));else{let O;k=new t({writableObjectMode:!0,readableObjectMode:!0}),O=m.browser?f(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let $=0;${if(p.type==="image"){const b=`xl/media/${p.name}.${p.extension}`;if(p.filename){const g=await function(y,k){return new Promise((R,O)=>{o.readFile(y,k,(z,$)=>{z?O(z):R($)})})}(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,v){const p=new L,b=new h;v.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,v){const p=new I;v.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})})})}async addContentTypes(M,v){const p=new w().toXml(v);M.append(p,{name:"[Content_Types].xml"})}async addApp(M,v){const p=new _().toXml(v);M.append(p,{name:"docProps/app.xml"})}async addCore(M,v){const p=new u;M.append(p.toXml(v),{name:"docProps/core.xml"})}async addThemes(M,v){const p=v.themes||{theme1:U};Object.keys(p).forEach(b=>{const g=p[b],y=`xl/theme/${b}.xml`;M.append(g,{name:y})})}async addOfficeRels(M){const v=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(v,{name:"_rels/.rels"})}async addWorkbookRels(M,v){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"}];v.sharedStrings.count&&b.push({Id:"rId"+p++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),v.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"})}async addSharedStrings(M,v){v.sharedStrings&&v.sharedStrings.count&&M.append(v.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(M,v){const{xml:p}=v.styles;p&&M.append(p,{name:"xl/styles.xml"})}async addWorkbook(M,v){const p=new A;M.append(p.toXml(v),{name:"xl/workbook.xml"})}async addWorksheets(M,v){const p=new N,b=new h,g=new P,y=new D;v.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((v,p)=>{M.on("finish",()=>{v(this)}),M.on("error",p),M.finalize()})}prepareModel(M,v){M.creator=M.creator||"ExcelJS",M.lastModifiedBy=M.lastModifiedBy||"ExcelJS",M.created=M.created||new Date,M.modified=M.modified||new Date,M.useSharedStrings=v.useSharedStrings===void 0||v.useSharedStrings,M.useStyles=v.useStyles===void 0||v.useStyles,M.sharedStrings=new d,M.styles=M.useStyles?new c(!0):new c.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)})}async write(M,v){v=v||{};const{model:p}=this.workbook,b=new e.ZipWriter(v.zip);return b.pipe(M),this.prepareModel(p,v),await this.addContentTypes(b,p),await this.addOfficeRels(b,p),await this.addWorkbookRels(b,p),await this.addWorksheets(b,p),await this.addSharedStrings(b,p),await this.addDrawings(b,p),await this.addTables(b,p),await Promise.all([this.addThemes(b,p),this.addStyles(b,p)]),await this.addMedia(b,p),await Promise.all([this.addApp(b,p),this.addCore(b,p)]),await this.addWorkbook(b,p),this._finalize(b)}writeFile(M,v){const p=o.createWriteStream(M);return new Promise((b,g)=>{p.on("finish",()=>{b()}),p.on("error",y=>{g(y)}),this.write(p,v).then(()=>{p.end()}).catch(y=>{g(y)})})}async writeBuffer(M){const v=new l;return await this.write(v,M),v.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 a=s("stream"),o=s("./formatter");class r extends a.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new o.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,l,n){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(f,c)=>f?(i=!0,n(f)):(c&&c.forEach(u=>{this.push(m.from(u,"utf8"))}),i=!0,n()))}catch(f){if(i)throw f;n(f)}}_flush(e){this.rowFormatter.finish((l,n)=>l?e(l):(n&&n.forEach(i=>{this.push(m.from(i,"utf8"))}),e()))}}S.CsvFormatterStream=r}).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 a;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&&((a=m.writeHeaders)===null||a===void 0||a),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 a=m(s("lodash.isboolean")),o=m(s("lodash.isnil")),r=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}${r.default(t.rowDelimiter)}|\r| +]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const l=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return a.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,e,l){const n=(""+(o.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:i}=this;return i.quote!==""&&n.indexOf(i.quote)!==-1?this.quoteField(n.replace(this.REPLACE_REGEXP,i.escapedQuote)):n.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(e,l)?this.quoteField(n):n}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(s,T,S){var m=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(S,"__esModule",{value:!0}),S.RowFormatter=void 0;const a=m(s("lodash.isfunction")),o=m(s("lodash.isequal")),r=s("./FieldFormatter"),t=s("../types");class e{constructor(n){this.rowCount=0,this.formatterOptions=n,this.fieldFormatter=new r.FieldFormatter(n),this.headers=n.headers,this.shouldWriteHeaders=n.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),n.transform&&(this.rowTransform=n.transform)}static isRowHashArray(n){return!!Array.isArray(n)&&Array.isArray(n[0])&&n[0].length===2}static isRowArray(n){return Array.isArray(n)&&!this.isRowHashArray(n)}static gatherHeaders(n){return e.isRowHashArray(n)?n.map(i=>i[0]):Array.isArray(n)?n:Object.keys(n)}static createTransform(n){return t.isSyncTransform(n)?(i,f)=>{let c=null;try{c=n(i)}catch(u){return f(u)}return f(null,c)}:(i,f)=>{n(i,f)}}set rowTransform(n){if(!a.default(n))throw new TypeError("The transform should be a function");this._rowTransform=e.createTransform(n)}format(n,i){this.callTransformer(n,(f,c)=>{if(f)return i(f);if(!n)return i(null);const u=[];if(c){const{shouldFormatColumns:d,headers:h}=this.checkHeaders(c);if(this.shouldWriteHeaders&&h&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(h,!0)),this.hasWrittenHeaders=!0),d){const w=this.gatherColumns(c);u.push(this.formatColumns(w,!1))}}return i(null,u)})}finish(n){const i=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return n(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));i.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&i.push(this.formatterOptions.rowDelimiter),n(null,i)}checkHeaders(n){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const i=e.gatherHeaders(n);return this.headers=i,this.fieldFormatter.headers=i,this.shouldWriteHeaders?{shouldFormatColumns:!o.default(i,n),headers:i}:{shouldFormatColumns:!0,headers:null}}gatherColumns(n){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(n)?e.isRowHashArray(n)?this.headers.map((i,f)=>{const c=n[f];return c?c[1]:""}):e.isRowArray(n)&&!this.shouldWriteHeaders?n:this.headers.map((i,f)=>n[f]):this.headers.map(i=>n[i])}callTransformer(n,i){return this._rowTransform?this._rowTransform(n,i):i(null,n)}formatColumns(n,i){const f=n.map((u,d)=>this.fieldFormatter.format(u,d,i)).join(this.formatterOptions.delimiter),{rowCount:c}=this;return this.rowCount+=1,c?[this.formatterOptions.rowDelimiter,f].join(""):f}}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 a=s("./FieldFormatter");Object.defineProperty(S,"FieldFormatter",{enumerable:!0,get:function(){return a.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(s,T,S){(function(m){(function(){var a=Object.create?function(d,h,w,_){_===void 0&&(_=w),Object.defineProperty(d,_,{enumerable:!0,get:function(){return h[w]}})}:function(d,h,w,_){_===void 0&&(_=w),d[_]=h[w]},o=Object.create?function(d,h){Object.defineProperty(d,"default",{enumerable:!0,value:h})}:function(d,h){d.default=h},r=function(d){if(d&&d.__esModule)return d;var h={};if(d!=null)for(var w in d)w!=="default"&&Object.prototype.hasOwnProperty.call(d,w)&&a(h,d,w);return o(h,d),h},t=function(d,h){for(var w in d)w==="default"||Object.prototype.hasOwnProperty.call(h,w)||a(h,d,w)};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"),n=r(s("fs")),i=s("./FormatterOptions"),f=s("./CsvFormatterStream");t(s("./types"),S);var c=s("./CsvFormatterStream");Object.defineProperty(S,"CsvFormatterStream",{enumerable:!0,get:function(){return c.CsvFormatterStream}});var u=s("./FormatterOptions");Object.defineProperty(S,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),S.format=d=>new f.CsvFormatterStream(new i.FormatterOptions(d)),S.write=(d,h)=>{const w=S.format(h),_=e.promisify((A,N)=>{w.write(A,void 0,N)});return d.reduce((A,N)=>A.then(()=>_(N)),Promise.resolve()).then(()=>w.end()).catch(A=>{w.emit("error",A)}),w},S.writeToStream=(d,h,w)=>S.write(h,w).pipe(d),S.writeToBuffer=function(d){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=[],_=new l.Writable({write(A,N,L){w.push(A),L()}});return new Promise((A,N)=>{_.on("error",N).on("finish",()=>A(m.concat(w))),S.write(d,h).pipe(_)})},S.writeToString=(d,h)=>S.writeToBuffer(d,h).then(w=>w.toString()),S.writeToPath=(d,h,w)=>{const _=n.createWriteStream(d,{encoding:"utf8"});return S.write(h,w).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 a=s("string_decoder"),o=s("stream"),r=s("./transforms"),t=s("./parser");class e extends o.Transform{constructor(n){super({objectMode:n.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=n,this.parser=new t.Parser(n),this.headerTransformer=new r.HeaderTransformer(n),this.decoder=new a.StringDecoder(n.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(n){return this.rowTransformerValidator.rowTransform=n,this}validate(n){return this.rowTransformerValidator.rowValidator=n,this}emit(n){if(n==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var i=arguments.length,f=new Array(i>1?i-1:0),c=1;c{const d=_=>_?i(_):u%100!=0?c(u+1):void m(()=>c(u+1));if(this.checkAndEmitHeaders(),u>=f||this.hasHitRowLimit)return i();if(this.parsedLineCount+=1,this.shouldSkipLine)return d();const h=n[u];this.rowCount+=1,this.parsedRowCount+=1;const w=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,w,A.reason);return d()})};c(0)}transformRow(n,i){try{this.headerTransformer.transform(n,(f,c)=>f?i(f):c?c.isValid?c.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(c.row,i):this.skipRow(i):(this.rowCount-=1,this.parsedRowCount-=1,i(null,{row:null,isValid:!0})):this.shouldEmitRows?i(null,{isValid:!1,row:n}):this.skipRow(i):i(new Error("Expected result from header transform")))}catch(f){i(f)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(n){return this.rowCount-=1,n(null,{row:null,isValid:!0})}pushRow(n,i){try{this.parserOptions.objectMode?this.push(n):this.push(JSON.stringify(n)),i()}catch(f){i(f)}}static wrapDoneCallback(n){let i=!1;return function(f){if(f){if(i)throw f;return i=!0,void n(f)}for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=a.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!o.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(c,u,d,h){h===void 0&&(h=d),Object.defineProperty(c,h,{enumerable:!0,get:function(){return u[d]}})}:function(c,u,d,h){h===void 0&&(h=d),c[h]=u[d]},a=Object.create?function(c,u){Object.defineProperty(c,"default",{enumerable:!0,value:u})}:function(c,u){c.default=u},o=function(c){if(c&&c.__esModule)return c;var u={};if(c!=null)for(var d in c)d!=="default"&&Object.prototype.hasOwnProperty.call(c,d)&&m(u,c,d);return a(u,c),u},r=function(c,u){for(var d in c)d==="default"||Object.prototype.hasOwnProperty.call(u,d)||m(u,c,d)};Object.defineProperty(S,"__esModule",{value:!0}),S.parseString=S.parseFile=S.parseStream=S.parse=S.ParserOptions=S.CsvParserStream=void 0;const t=o(s("fs")),e=s("stream"),l=s("./ParserOptions"),n=s("./CsvParserStream");r(s("./types"),S);var i=s("./CsvParserStream");Object.defineProperty(S,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var f=s("./ParserOptions");Object.defineProperty(S,"ParserOptions",{enumerable:!0,get:function(){return f.ParserOptions}}),S.parse=c=>new n.CsvParserStream(new l.ParserOptions(c)),S.parseStream=(c,u)=>c.pipe(new n.CsvParserStream(new l.ParserOptions(u))),S.parseFile=function(c){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(c).pipe(new n.CsvParserStream(new l.ParserOptions(u)))},S.parseString=(c,u)=>{const d=new e.Readable;return d.push(c),d.push(null),d.pipe(new n.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"),a=s("./RowParser"),o=s("./Token");class r{constructor(e){this.parserOptions=e,this.rowParser=new a.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,l){const n=new m.Scanner({line:r.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){const l=[];let n=!0;for(;n;)n=this.parseRow(e,l);return{line:e.line,rows:l}}parseWithComments(e){const{parserOptions:l}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(o.Token.isTokenComment(i,l)){if(e.advancePastLine()===null)return{line:e.lineFromCursor,rows:n};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,l){if(!e.nextNonSpaceToken)return!1;const n=this.rowParser.parse(e);return n!==null&&(this.parserOptions.ignoreEmpty&&a.RowParser.isEmptyRow(n)||l.push(n),!0)}}S.Parser=r},{"./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"),a=s("./Token");S.RowParser=class{constructor(o){this.parserOptions=o,this.columnParser=new m.ColumnParser(o)}static isEmptyRow(o){return o.join("").replace(/\s+/g,"")===""}parse(o){const{parserOptions:r}=this,{hasMoreData:t}=o,e=o,l=[];let n=this.getStartToken(e,l);for(;n;){if(a.Token.isTokenRowDelimiter(n))return e.advancePastToken(n),!e.hasMoreCharacters&&a.Token.isTokenCarriageReturn(n,r)&&t?null:(e.truncateToCursor(),l);if(!this.shouldSkipColumnParse(e,n,l)){const i=this.columnParser.parse(e);if(i===null)return null;l.push(i)}n=e.nextNonSpaceToken}return t?null:(e.truncateToCursor(),l)}getStartToken(o,r){const t=o.nextNonSpaceToken;return t!==null&&a.Token.isTokenDelimiter(t,this.parserOptions)?(r.push(""),o.nextNonSpaceToken):t}shouldSkipColumnParse(o,r,t){const{parserOptions:e}=this;if(a.Token.isTokenDelimiter(r,e)){o.advancePastToken(r);const l=o.nextCharacterToken;if(!o.hasMoreCharacters||l!==null&&a.Token.isTokenRowDelimiter(l)||l!==null&&a.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"),a=/((?:\r\n)|\n|\r)/;S.Scanner=class{constructor(o){this.cursor=0,this.line=o.line,this.lineLength=this.line.length,this.parserOptions=o.parserOptions,this.hasMoreData=o.hasMoreData,this.cursor=o.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:o}=this,r=this.parserOptions.NEXT_TOKEN_REGEXP;if(o.search(r)===-1)return null;const t=r.exec(o);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:o,lineLength:r}=this;return r<=o?null:new m.Token({token:this.line[o],startCursor:o,endCursor:o})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const o=a.exec(this.lineFromCursor);return o?(this.cursor+=(o.index||0)+o[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(o){return this.cursor=o,this}advanceToToken(o){return this.cursor=o.startCursor,this}advancePastToken(o){return this.cursor=o.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 a=m.token;return a==="\r"||a===` +`||a===`\r +`}static isTokenCarriageReturn(m,a){return m.token===a.carriageReturn}static isTokenComment(m,a){return a.supportsComments&&!!m&&m.token===a.comment}static isTokenEscapeCharacter(m,a){return m.token===a.escapeChar}static isTokenQuote(m,a){return m.token===a.quote}static isTokenDelimiter(m,a){return m.token===a.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=a=>a.trim():m.ltrim?this.format=a=>a.trimLeft():m.rtrim?this.format=a=>a.trimRight():this.format=a=>a}}},{}],161:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.ColumnParser=void 0;const m=s("./NonQuotedColumnParser"),a=s("./QuotedColumnParser"),o=s("../Token");S.ColumnParser=class{constructor(r){this.parserOptions=r,this.quotedColumnParser=new a.QuotedColumnParser(r),this.nonQuotedColumnParser=new m.NonQuotedColumnParser(r)}parse(r){const{nextNonSpaceToken:t}=r;return t!==null&&o.Token.isTokenQuote(t,this.parserOptions)?(r.advanceToToken(t),this.quotedColumnParser.parse(r)):this.nonQuotedColumnParser.parse(r)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(s,T,S){Object.defineProperty(S,"__esModule",{value:!0}),S.NonQuotedColumnParser=void 0;const m=s("./ColumnFormatter"),a=s("../Token");S.NonQuotedColumnParser=class{constructor(o){this.parserOptions=o,this.columnFormatter=new m.ColumnFormatter(o)}parse(o){if(!o.hasMoreCharacters)return null;const{parserOptions:r}=this,t=[];let e=o.nextCharacterToken;for(;e&&!a.Token.isTokenDelimiter(e,r)&&!a.Token.isTokenRowDelimiter(e);e=o.nextCharacterToken)t.push(e.token),o.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"),a=s("../Token");S.QuotedColumnParser=class{constructor(o){this.parserOptions=o,this.columnFormatter=new m.ColumnFormatter(o)}parse(o){if(!o.hasMoreCharacters)return null;const r=o.cursor,{foundClosingQuote:t,col:e}=this.gatherDataBetweenQuotes(o);if(!t){if(o.advanceTo(r),!o.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${o.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(o),e}gatherDataBetweenQuotes(o){const{parserOptions:r}=this;let t=!1,e=!1;const l=[];let n=o.nextCharacterToken;for(;!e&&n!==null;n=o.nextCharacterToken){const i=a.Token.isTokenQuote(n,r);if(!t&&i)t=!0;else if(t)if(a.Token.isTokenEscapeCharacter(n,r)){o.advancePastToken(n);const f=o.nextCharacterToken;f!==null&&(a.Token.isTokenQuote(f,r)||a.Token.isTokenEscapeCharacter(f,r))?(l.push(f.token),n=f):i?e=!0:l.push(n.token)}else i?e=!0:l.push(n.token);o.advancePastToken(n)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:e}}checkForMalformedColumn(o){const{parserOptions:r}=this,{nextNonSpaceToken:t}=o;if(t){const e=a.Token.isTokenDelimiter(t,r),l=a.Token.isTokenRowDelimiter(t);if(!e&&!l){const n=o.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${r.escapedDelimiter}' OR new line got: '${t.token}'. at '${n}`)}o.advanceToToken(t)}else o.hasMoreData||o.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 a=s("./NonQuotedColumnParser");Object.defineProperty(S,"NonQuotedColumnParser",{enumerable:!0,get:function(){return a.NonQuotedColumnParser}});var o=s("./QuotedColumnParser");Object.defineProperty(S,"QuotedColumnParser",{enumerable:!0,get:function(){return o.QuotedColumnParser}});var r=s("./ColumnFormatter");Object.defineProperty(S,"ColumnFormatter",{enumerable:!0,get:function(){return r.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 a=s("./RowParser");Object.defineProperty(S,"RowParser",{enumerable:!0,get:function(){return a.RowParser}});var o=s("./Scanner");Object.defineProperty(S,"Scanner",{enumerable:!0,get:function(){return o.Scanner}});var r=s("./Token");Object.defineProperty(S,"Token",{enumerable:!0,get:function(){return r.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 a=m(s("lodash.isundefined")),o=m(s("lodash.isfunction")),r=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):o.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,l){return this.shouldMapRow(e)?l(null,this.processRow(e)):l(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&e.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return l.strictColumnHandling&&e.length!!i);if(r.default(n).length!==n.length){const i=t.default(n),f=Object.keys(i).filter(c=>i[c].length>1);throw new Error("Duplicate headers found "+JSON.stringify(f))}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 a=m(s("lodash.isfunction")),o=s("../types");class r{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return o.isSyncTransform(e)?(l,n)=>{let i=null;try{i=e(l)}catch(f){return n(f)}return n(null,i)}:e}static createValidator(e){return o.isSyncValidate(e)?(l,n)=>{n(null,{row:l,isValid:e(l)})}:(l,n)=>{e(l,(i,f,c)=>i?n(i):n(null,f?{row:l,isValid:f,reason:c}:{row:l,isValid:!1,reason:c}))}}set rowTransform(e){if(!a.default(e))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(e)}set rowValidator(e){if(!a.default(e))throw new TypeError("The validate should be a function");this._rowValidator=r.createValidator(e)}transformAndValidate(e,l){return this.callTransformer(e,(n,i)=>n?l(n):i?this.callValidator(i,(f,c)=>f?l(f):c&&!c.isValid?l(null,{row:i,isValid:!1,reason:c.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=r},{"../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 a=s("./HeaderTransformer");Object.defineProperty(S,"HeaderTransformer",{enumerable:!0,get:function(){return a.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"),a=s("./decoders"),o=s("inherits");function r(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}S.define=function(t,e){return new r(t,e)},r.prototype._createNamed=function(t){const e=this.name;function l(n){this._initNamed(n,e)}return o(l,t),l.prototype._initNamed=function(n,i){t.call(this,n,i)},new l(this)},r.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(a[t])),this.decoders[t]},r.prototype.decode=function(t,e,l){return this._getDecoder(e).decode(t,l)},r.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(m[t])),this.encoders[t]},r.prototype.encode=function(t,e,l){return this._getEncoder(e).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(s,T,S){const m=s("inherits"),a=s("../base/reporter").Reporter,o=s("safer-buffer").Buffer;function r(e,l){a.call(this,l),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function t(e,l){if(Array.isArray(e))this.length=0,this.value=e.map(function(n){return t.isEncoderBuffer(n)||(n=new t(n,l)),this.length+=n.length,n},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return l.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return l.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}m(r,a),S.DecoderBuffer=r,r.isDecoderBuffer=function(e){return e instanceof r?!0:typeof e=="object"&&o.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"},r.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},r.prototype.restore=function(e){const l=new r(this.base);return l.offset=e.offset,l.length=this.offset,this.offset=e.offset,a.prototype.restore.call(this,e.reporter),l},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,l){if(!(this.offset+e<=this.length))return this.error(l||"DecoderBuffer overrun");const n=new r(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},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=o.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,l),l+=n.length}):(typeof this.value=="number"?e[l]=this.value:typeof this.value=="string"?e.write(this.value,l):o.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,a=s("../base/buffer").EncoderBuffer,o=s("../base/buffer").DecoderBuffer,r=s("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],e=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(i,f,c){const u={};this._baseState=u,u.name=c,u.enc=i,u.parent=f||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 n=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const i=this._baseState,f={};n.forEach(function(u){f[u]=i[u]});const c=new this.constructor(f.parent);return c._baseState=f,c},l.prototype._wrap=function(){const i=this._baseState;e.forEach(function(f){this[f]=function(){const c=new this.constructor(this);return i.children.push(c),c[f].apply(c,arguments)}},this)},l.prototype._init=function(i){const f=this._baseState;r(f.parent===null),i.call(this),f.children=f.children.filter(function(c){return c._baseState.parent===this},this),r.equal(f.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(i){const f=this._baseState,c=i.filter(function(u){return u instanceof this.constructor},this);i=i.filter(function(u){return!(u instanceof this.constructor)},this),c.length!==0&&(r(f.children===null),f.children=c,c.forEach(function(u){u._baseState.parent=this},this)),i.length!==0&&(r(f.args===null),f.args=i,f.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 w=u[h];d[w]=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 f=this._baseState;throw new Error(i+" not implemented for encoding: "+f.enc)}}),t.forEach(function(i){l.prototype[i]=function(){const f=this._baseState,c=Array.prototype.slice.call(arguments);return r(f.tag===null),f.tag=i,this._useArgs(c),this}}),l.prototype.use=function(i){r(i);const f=this._baseState;return r(f.use===null),f.use=i,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(i){const f=this._baseState;return r(f.default===null),f.default=i,f.optional=!0,this},l.prototype.explicit=function(i){const f=this._baseState;return r(f.explicit===null&&f.implicit===null),f.explicit=i,this},l.prototype.implicit=function(i){const f=this._baseState;return r(f.explicit===null&&f.implicit===null),f.implicit=i,this},l.prototype.obj=function(){const i=this._baseState,f=Array.prototype.slice.call(arguments);return i.obj=!0,f.length!==0&&this._useArgs(f),this},l.prototype.key=function(i){const f=this._baseState;return r(f.key===null),f.key=i,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(i){const f=this._baseState;return r(f.choice===null),f.choice=i,this._useArgs(Object.keys(i).map(function(c){return i[c]})),this},l.prototype.contains=function(i){const f=this._baseState;return r(f.use===null),f.contains=i,this},l.prototype._decode=function(i,f){const c=this._baseState;if(c.parent===null)return i.wrapResult(c.children[0]._decode(i,f));let u,d=c.default,h=!0,w=null;if(c.key!==null&&(w=i.enterKey(c.key)),c.optional){let _=null;if(c.explicit!==null?_=c.explicit:c.implicit!==null?_=c.implicit:c.tag!==null&&(_=c.tag),_!==null||c.any){if(h=this._peekTag(i,_,c.any),i.isError(h))return h}else{const A=i.save();try{c.choice===null?this._decodeGeneric(c.tag,i,f):this._decodeChoice(i,f),h=!0}catch{h=!1}i.restore(A)}}if(c.obj&&h&&(u=i.enterObject()),h){if(c.explicit!==null){const A=this._decodeTag(i,c.explicit);if(i.isError(A))return A;i=A}const _=i.offset;if(c.use===null&&c.choice===null){let A;c.any&&(A=i.save());const N=this._decodeTag(i,c.implicit!==null?c.implicit:c.tag,c.any);if(i.isError(N))return N;c.any?d=i.raw(A):i=N}if(f&&f.track&&c.tag!==null&&f.track(i.path(),_,i.length,"tagged"),f&&f.track&&c.tag!==null&&f.track(i.path(),i.offset,i.length,"content"),c.any||(d=c.choice===null?this._decodeGeneric(c.tag,i,f):this._decodeChoice(i,f)),i.isError(d))return d;if(c.any||c.choice!==null||c.children===null||c.children.forEach(function(A){A._decode(i,f)}),c.contains&&(c.tag==="octstr"||c.tag==="bitstr")){const A=new o(d);d=this._getUse(c.contains,i._reporterState.obj)._decode(A,f)}}return c.obj&&h&&(d=i.leaveObject(u)),c.key===null||d===null&&h!==!0?w!==null&&i.exitKey(w):i.leaveKey(w,c.key,d),d},l.prototype._decodeGeneric=function(i,f,c){const u=this._baseState;return i==="seq"||i==="set"?null:i==="seqof"||i==="setof"?this._decodeList(f,i,u.args[0],c):/str$/.test(i)?this._decodeStr(f,i,c):i==="objid"&&u.args?this._decodeObjid(f,u.args[0],u.args[1],c):i==="objid"?this._decodeObjid(f,null,null,c):i==="gentime"||i==="utctime"?this._decodeTime(f,i,c):i==="null_"?this._decodeNull(f,c):i==="bool"?this._decodeBool(f,c):i==="objDesc"?this._decodeStr(f,i,c):i==="int"||i==="enum"?this._decodeInt(f,u.args&&u.args[0],c):u.use!==null?this._getUse(u.use,f._reporterState.obj)._decode(f,c):f.error("unknown tag: "+i)},l.prototype._getUse=function(i,f){const c=this._baseState;return c.useDecoder=this._use(i,f),r(c.useDecoder._baseState.parent===null),c.useDecoder=c.useDecoder._baseState.children[0],c.implicit!==c.useDecoder._baseState.implicit&&(c.useDecoder=c.useDecoder.clone(),c.useDecoder._baseState.implicit=c.implicit),c.useDecoder},l.prototype._decodeChoice=function(i,f){const c=this._baseState;let u=null,d=!1;return Object.keys(c.choice).some(function(h){const w=i.save(),_=c.choice[h];try{const A=_._decode(i,f);if(i.isError(A))return!1;u={type:h,value:A},d=!0}catch{return i.restore(w),!1}return!0},this),d?u:i.error("Choice not matched")},l.prototype._createEncoderBuffer=function(i){return new a(i,this.reporter)},l.prototype._encode=function(i,f,c){const u=this._baseState;if(u.default!==null&&u.default===i)return;const d=this._encodeValue(i,f,c);return d===void 0||this._skipDefault(d,f,c)?void 0:d},l.prototype._encodeValue=function(i,f,c){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(i,f||new m);let d=null;if(this.reporter=f,u.optional&&i===void 0){if(u.default===null)return;i=u.default}let h=null,w=!1;if(u.any)d=this._createEncoderBuffer(i);else if(u.choice)d=this._encodeChoice(i,f);else if(u.contains)h=this._getUse(u.contains,c)._encode(i,f),w=!0;else if(u.children)h=u.children.map(function(_){if(_._baseState.tag==="null_")return _._encode(null,f,i);if(_._baseState.key===null)return f.error("Child should have a key");const A=f.enterKey(_._baseState.key);if(typeof i!="object")return f.error("Child expected, but input is not object");const N=_._encode(i[_._baseState.key],f,i);return f.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 f.error("Too many args for : "+u.tag);if(!Array.isArray(i))return f.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,f)},_))}else u.use!==null?d=this._getUse(u.use,c)._encode(i,f):(h=this._encodePrimitive(u.tag,i),w=!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&&f.error("Tag could be omitted only for .use()"):u.use===null&&(d=this._encodeComposite(_,w,A,h))}return u.explicit!==null&&(d=this._encodeComposite(u.explicit,!1,"context",d)),d},l.prototype._encodeChoice=function(i,f){const c=this._baseState,u=c.choice[i.type];return u||r(!1,i.type+" not found in "+JSON.stringify(Object.keys(c.choice))),u._encode(i.value,f)},l.prototype._encodePrimitive=function(i,f){const c=this._baseState;if(/str$/.test(i))return this._encodeStr(f,i);if(i==="objid"&&c.args)return this._encodeObjid(f,c.reverseArgs[0],c.args[1]);if(i==="objid")return this._encodeObjid(f,null,null);if(i==="gentime"||i==="utctime")return this._encodeTime(f,i);if(i==="null_")return this._encodeNull();if(i==="int"||i==="enum")return this._encodeInt(f,c.args&&c.reverseArgs[0]);if(i==="bool")return this._encodeBool(f);if(i==="objDesc")return this._encodeStr(f,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 a(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function o(r,t){this.path=r,this.rethrow(t)}S.Reporter=a,a.prototype.isError=function(r){return r instanceof o},a.prototype.save=function(){const r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},a.prototype.restore=function(r){const t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},a.prototype.enterKey=function(r){return this._reporterState.path.push(r)},a.prototype.exitKey=function(r){const t=this._reporterState;t.path=t.path.slice(0,r-1)},a.prototype.leaveKey=function(r,t,e){const l=this._reporterState;this.exitKey(r),l.obj!==null&&(l.obj[t]=e)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){const r=this._reporterState,t=r.obj;return r.obj={},t},a.prototype.leaveObject=function(r){const t=this._reporterState,e=t.obj;return t.obj=r,e},a.prototype.error=function(r){let t;const e=this._reporterState,l=r instanceof o;if(t=l?r:new o(e.path.map(function(n){return"["+JSON.stringify(n)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return l||e.errors.push(t),t},a.prototype.wrapResult=function(r){const t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},m(o,Error),o.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!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(a){const o={};return Object.keys(a).forEach(function(r){(0|r)==r&&(r|=0);const t=a[r];o[t]=r}),o}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(a){const o={};return Object.keys(a).forEach(function(r){(0|r)==r&&(r|=0);const t=a[r];o[t]=r}),o},m.der=s("./der")},{"./der":176}],178:[function(s,T,S){const m=s("inherits"),a=s("bn.js"),o=s("../base/buffer").DecoderBuffer,r=s("../base/node"),t=s("../constants/der");function e(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new l,this.tree._init(f.body)}function l(f){r.call(this,"der",f)}function n(f,c){let u=f.readUInt8(c);if(f.isError(u))return u;const d=t.tagClass[u>>6],h=(32&u)==0;if((31&u)==31){let w=u;for(u=0;(128&w)==128;){if(w=f.readUInt8(c),f.isError(w))return w;u<<=7,u|=127&w}}else u&=31;return{cls:d,primitive:h,tag:u,tagStr:t.tag[u]}}function i(f,c,u){let d=f.readUInt8(u);if(f.isError(d))return d;if(!c&&d===128)return null;if((128&d)==0)return d;const h=127&d;if(h>4)return f.error("length octect is too long");d=0;for(let w=0;w=31?N.error("Multi-octet tag encoding unsupported"):(_||(L|=32),L|=r.tagClassByName[A||"universal"]<<6,L)}(n,i,f,this.reporter);if(c.length<128){const w=a.alloc(2);return w[0]=u,w[1]=c.length,this._createEncoderBuffer([w,c])}let d=1;for(let w=c.length;w>=256;w>>=8)d++;const h=a.alloc(2+d);h[0]=u,h[1]=128|d;for(let w=1+d,_=c.length;_>0;w--,_>>=8)h[w]=255&_;return this._createEncoderBuffer([h,c])},e.prototype._encodeStr=function(n,i){if(i==="bitstr")return this._createEncoderBuffer([0|n.unused,n.data]);if(i==="bmpstr"){const f=a.alloc(2*n.length);for(let c=0;c=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,40*n[0]+n[1])}let c=0;for(let h=0;h=128;w>>=7)c++}const u=a.alloc(c);let d=u.length-1;for(let h=n.length-1;h>=0;h--){let w=n[h];for(u[d--]=127&w;(w>>=7)>0;)u[d--]=128|127&w}return this._createEncoderBuffer(u)},e.prototype._encodeTime=function(n,i){let f;const c=new Date(n);return i==="gentime"?f=[l(c.getUTCFullYear()),l(c.getUTCMonth()+1),l(c.getUTCDate()),l(c.getUTCHours()),l(c.getUTCMinutes()),l(c.getUTCSeconds()),"Z"].join(""):i==="utctime"?f=[l(c.getUTCFullYear()%100),l(c.getUTCMonth()+1),l(c.getUTCDate()),l(c.getUTCHours()),l(c.getUTCMinutes()),l(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+i+" time is not supported yet"),this._encodeStr(f,"octstr")},e.prototype._encodeNull=function(){return this._createEncoderBuffer("")},e.prototype._encodeInt=function(n,i){if(typeof n=="string"){if(!i)return this.reporter.error("String int or enum given, but no values map");if(!i.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=i[n]}if(typeof n!="number"&&!a.isBuffer(n)){const u=n.toArray();!n.sign&&128&u[0]&&u.unshift(0),n=a.from(u)}if(a.isBuffer(n)){let u=n.length;n.length===0&&u++;const d=a.alloc(u);return n.copy(d),n.length===0&&(d[0]=0),this._createEncoderBuffer(d)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);let f=1;for(let u=n;u>=256;u>>=8)f++;const c=new Array(f);for(let u=c.length-1;u>=0;u--)c[u]=255&n,n>>=8;return 128&c[0]&&c.unshift(0),this._createEncoderBuffer(a.from(c))},e.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},e.prototype._use=function(n,i){return typeof n=="function"&&(n=n(i)),n._getEncoder("der").tree},e.prototype._skipDefault=function(n,i,f){const c=this._baseState;let u;if(c.default===null)return!1;const d=n.join();if(c.defaultBuffer===void 0&&(c.defaultBuffer=this._encodeValue(c.default,i,f).join()),d.length!==c.defaultBuffer.length)return!1;for(u=0;u=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function n(x,M,v){var p=l(x,v);return v-1>=M&&(p|=l(x,v-1)<<4),p}function i(x,M,v,p){for(var b=0,g=Math.min(x.length,v),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,v){if(typeof x=="number")return this._initNumber(x,M,v);if(typeof x=="object")return this._initArray(x,M,v);M==="hex"&&(M=16),o(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(v==="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,v){this.length=Math.ceil((x.length-M)/6),this.words=new Array(this.length);for(var p=0;p=M;p-=2)b=n(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,v){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-v,y=g%p,k=Math.min(g,g-y)+v,R=0,O=v;O1&&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 f=["","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"],c=[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,v){v.negative=M.negative^x.negative;var p=x.length+M.length|0;v.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;v.words[0]=k;for(var O=1;O>>26,$=67108863&R,W=Math.min(O,M.length-1),j=Math.max(0,O-x.length+1);j<=W;j++){var H=O-j|0;z+=(y=(b=0|x.words[H])*(g=0|M.words[j])+$)/67108864|0,$=67108863&y}v.words[O]=0|$,R=0|z}return R!==0?v.words[O]=0|R:v.length--,v.strip()}t.prototype.toString=function(x,M){var v;if(M=0|M||1,(x=x||10)===16||x==="hex"){v="";for(var p=0,b=0,g=0;g>>24-p&16777215)!==0||g!==this.length-1?f[6-k.length]+k+v:k+v,(p+=2)>=26&&(p-=26,g--)}for(b!==0&&(v=b.toString(16)+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(x===(0|x)&&x>=2&&x<=36){var R=c[x],O=u[x];v="";var z=this.clone();for(z.negative=0;!z.isZero();){var $=z.modn(O).toString(x);v=(z=z.idivn(O)).isZero()?$+v:f[R-$.length]+$+v}for(this.isZero()&&(v="0"+v);v.length%M!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}o(!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&&o(!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 o(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,v){var p=this.byteLength(),b=v||Math.max(1,p);o(p<=b,"byte array longer than desired length"),o(b>0,"Requested array length <= 0"),this.strip();var g,y,k=M==="le",R=new x(b),O=this.clone();if(k){for(y=0;!O.isZero();y++)g=O.andln(255),O.iushrn(8),R[y]=g;for(;y=4096&&(v+=13,M>>>=13),M>=64&&(v+=7,M>>>=7),M>=8&&(v+=4,M>>>=4),M>=2&&(v+=2,M>>>=2),v+M},t.prototype._zeroBits=function(x){if(x===0)return 26;var M=x,v=0;return(8191&M)==0&&(v+=13,M>>>=13),(127&M)==0&&(v+=7,M>>>=7),(15&M)==0&&(v+=4,M>>>=4),(3&M)==0&&(v+=2,M>>>=2),(1&M)==0&&v++,v},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 v=0;vx.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,v;this.length>x.length?(M=this,v=x):(M=x,v=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){o(typeof x=="number"&&x>=0);var M=0|Math.ceil(x/26),v=x%26;this._expand(M),v>0&&M--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-v),this.strip()},t.prototype.notn=function(x){return this.clone().inotn(x)},t.prototype.setn=function(x,M){o(typeof x=="number"&&x>=0);var v=x/26|0,p=x%26;return this._expand(v+1),this.words[v]=M?this.words[v]|1<x.length?(v=this,p=x):(v=x,p=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=v.length,b!==0)this.words[this.length]=b,this.length++;else if(v!==this)for(;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 v,p,b=this.cmp(x);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(v=this,p=x):(v=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,j=0|y[1],H=8191&j,E=j>>>13,C=0|y[2],F=8191&C,V=C>>>13,Y=0|y[3],q=8191&Y,K=Y>>>13,et=0|y[4],tt=8191&et,X=et>>>13,J=0|y[5],G=8191&J,nt=J>>>13,rt=0|y[6],st=8191&rt,ot=rt>>>13,lt=0|y[7],ct=8191<,wt=lt>>>13,vt=0|y[8],mt=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,Wt=Ct>>>13,te=0|k[2],Ot=8191&te,Gt=te>>>13,qt=0|k[3],Lt=8191&qt,oe=qt>>>13,Jt=0|k[4],Pt=8191&Jt,Yt=Jt>>>13,ie=0|k[5],Bt=8191&ie,Qt=ie>>>13,se=0|k[6],Ut=8191&se,Q=se>>>13,it=0|k[7],ut=8191&it,bt=it>>>13,jt=0|k[8],yt=8191&jt,Dt=jt>>>13,It=0|k[9],At=8191&It,zt=It>>>13;v.negative=x.negative^M.negative,v.length=19;var Ft=(O+(p=Math.imul($,dt))|0)+((8191&(b=(b=Math.imul($,xt))+Math.imul(W,dt)|0))<<13)|0;O=((g=Math.imul(W,xt))+(b>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,p=Math.imul(H,dt),b=(b=Math.imul(H,xt))+Math.imul(E,dt)|0,g=Math.imul(E,xt);var Ht=(O+(p=p+Math.imul($,kt)|0)|0)+((8191&(b=(b=b+Math.imul($,Wt)|0)+Math.imul(W,kt)|0))<<13)|0;O=((g=g+Math.imul(W,Wt)|0)+(b>>>13)|0)+(Ht>>>26)|0,Ht&=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(H,kt)|0,b=(b=b+Math.imul(H,Wt)|0)+Math.imul(E,kt)|0,g=g+Math.imul(E,Wt)|0;var fe=(O+(p=p+Math.imul($,Ot)|0)|0)+((8191&(b=(b=b+Math.imul($,Gt)|0)+Math.imul(W,Ot)|0))<<13)|0;O=((g=g+Math.imul(W,Gt)|0)+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,p=Math.imul(q,dt),b=(b=Math.imul(q,xt))+Math.imul(K,dt)|0,g=Math.imul(K,xt),p=p+Math.imul(F,kt)|0,b=(b=b+Math.imul(F,Wt)|0)+Math.imul(V,kt)|0,g=g+Math.imul(V,Wt)|0,p=p+Math.imul(H,Ot)|0,b=(b=b+Math.imul(H,Gt)|0)+Math.imul(E,Ot)|0,g=g+Math.imul(E,Gt)|0;var le=(O+(p=p+Math.imul($,Lt)|0)|0)+((8191&(b=(b=b+Math.imul($,oe)|0)+Math.imul(W,Lt)|0))<<13)|0;O=((g=g+Math.imul(W,oe)|0)+(b>>>13)|0)+(le>>>26)|0,le&=67108863,p=Math.imul(tt,dt),b=(b=Math.imul(tt,xt))+Math.imul(X,dt)|0,g=Math.imul(X,xt),p=p+Math.imul(q,kt)|0,b=(b=b+Math.imul(q,Wt)|0)+Math.imul(K,kt)|0,g=g+Math.imul(K,Wt)|0,p=p+Math.imul(F,Ot)|0,b=(b=b+Math.imul(F,Gt)|0)+Math.imul(V,Ot)|0,g=g+Math.imul(V,Gt)|0,p=p+Math.imul(H,Lt)|0,b=(b=b+Math.imul(H,oe)|0)+Math.imul(E,Lt)|0,g=g+Math.imul(E,oe)|0;var ce=(O+(p=p+Math.imul($,Pt)|0)|0)+((8191&(b=(b=b+Math.imul($,Yt)|0)+Math.imul(W,Pt)|0))<<13)|0;O=((g=g+Math.imul(W,Yt)|0)+(b>>>13)|0)+(ce>>>26)|0,ce&=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(tt,kt)|0,b=(b=b+Math.imul(tt,Wt)|0)+Math.imul(X,kt)|0,g=g+Math.imul(X,Wt)|0,p=p+Math.imul(q,Ot)|0,b=(b=b+Math.imul(q,Gt)|0)+Math.imul(K,Ot)|0,g=g+Math.imul(K,Gt)|0,p=p+Math.imul(F,Lt)|0,b=(b=b+Math.imul(F,oe)|0)+Math.imul(V,Lt)|0,g=g+Math.imul(V,oe)|0,p=p+Math.imul(H,Pt)|0,b=(b=b+Math.imul(H,Yt)|0)+Math.imul(E,Pt)|0,g=g+Math.imul(E,Yt)|0;var he=(O+(p=p+Math.imul($,Bt)|0)|0)+((8191&(b=(b=b+Math.imul($,Qt)|0)+Math.imul(W,Bt)|0))<<13)|0;O=((g=g+Math.imul(W,Qt)|0)+(b>>>13)|0)+(he>>>26)|0,he&=67108863,p=Math.imul(st,dt),b=(b=Math.imul(st,xt))+Math.imul(ot,dt)|0,g=Math.imul(ot,xt),p=p+Math.imul(G,kt)|0,b=(b=b+Math.imul(G,Wt)|0)+Math.imul(nt,kt)|0,g=g+Math.imul(nt,Wt)|0,p=p+Math.imul(tt,Ot)|0,b=(b=b+Math.imul(tt,Gt)|0)+Math.imul(X,Ot)|0,g=g+Math.imul(X,Gt)|0,p=p+Math.imul(q,Lt)|0,b=(b=b+Math.imul(q,oe)|0)+Math.imul(K,Lt)|0,g=g+Math.imul(K,oe)|0,p=p+Math.imul(F,Pt)|0,b=(b=b+Math.imul(F,Yt)|0)+Math.imul(V,Pt)|0,g=g+Math.imul(V,Yt)|0,p=p+Math.imul(H,Bt)|0,b=(b=b+Math.imul(H,Qt)|0)+Math.imul(E,Bt)|0,g=g+Math.imul(E,Qt)|0;var me=(O+(p=p+Math.imul($,Ut)|0)|0)+((8191&(b=(b=b+Math.imul($,Q)|0)+Math.imul(W,Ut)|0))<<13)|0;O=((g=g+Math.imul(W,Q)|0)+(b>>>13)|0)+(me>>>26)|0,me&=67108863,p=Math.imul(ct,dt),b=(b=Math.imul(ct,xt))+Math.imul(wt,dt)|0,g=Math.imul(wt,xt),p=p+Math.imul(st,kt)|0,b=(b=b+Math.imul(st,Wt)|0)+Math.imul(ot,kt)|0,g=g+Math.imul(ot,Wt)|0,p=p+Math.imul(G,Ot)|0,b=(b=b+Math.imul(G,Gt)|0)+Math.imul(nt,Ot)|0,g=g+Math.imul(nt,Gt)|0,p=p+Math.imul(tt,Lt)|0,b=(b=b+Math.imul(tt,oe)|0)+Math.imul(X,Lt)|0,g=g+Math.imul(X,oe)|0,p=p+Math.imul(q,Pt)|0,b=(b=b+Math.imul(q,Yt)|0)+Math.imul(K,Pt)|0,g=g+Math.imul(K,Yt)|0,p=p+Math.imul(F,Bt)|0,b=(b=b+Math.imul(F,Qt)|0)+Math.imul(V,Bt)|0,g=g+Math.imul(V,Qt)|0,p=p+Math.imul(H,Ut)|0,b=(b=b+Math.imul(H,Q)|0)+Math.imul(E,Ut)|0,g=g+Math.imul(E,Q)|0;var Z=(O+(p=p+Math.imul($,ut)|0)|0)+((8191&(b=(b=b+Math.imul($,bt)|0)+Math.imul(W,ut)|0))<<13)|0;O=((g=g+Math.imul(W,bt)|0)+(b>>>13)|0)+(Z>>>26)|0,Z&=67108863,p=Math.imul(mt,dt),b=(b=Math.imul(mt,xt))+Math.imul(Et,dt)|0,g=Math.imul(Et,xt),p=p+Math.imul(ct,kt)|0,b=(b=b+Math.imul(ct,Wt)|0)+Math.imul(wt,kt)|0,g=g+Math.imul(wt,Wt)|0,p=p+Math.imul(st,Ot)|0,b=(b=b+Math.imul(st,Gt)|0)+Math.imul(ot,Ot)|0,g=g+Math.imul(ot,Gt)|0,p=p+Math.imul(G,Lt)|0,b=(b=b+Math.imul(G,oe)|0)+Math.imul(nt,Lt)|0,g=g+Math.imul(nt,oe)|0,p=p+Math.imul(tt,Pt)|0,b=(b=b+Math.imul(tt,Yt)|0)+Math.imul(X,Pt)|0,g=g+Math.imul(X,Yt)|0,p=p+Math.imul(q,Bt)|0,b=(b=b+Math.imul(q,Qt)|0)+Math.imul(K,Bt)|0,g=g+Math.imul(K,Qt)|0,p=p+Math.imul(F,Ut)|0,b=(b=b+Math.imul(F,Q)|0)+Math.imul(V,Ut)|0,g=g+Math.imul(V,Q)|0,p=p+Math.imul(H,ut)|0,b=(b=b+Math.imul(H,bt)|0)+Math.imul(E,ut)|0,g=g+Math.imul(E,bt)|0;var at=(O+(p=p+Math.imul($,yt)|0)|0)+((8191&(b=(b=b+Math.imul($,Dt)|0)+Math.imul(W,yt)|0))<<13)|0;O=((g=g+Math.imul(W,Dt)|0)+(b>>>13)|0)+(at>>>26)|0,at&=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(mt,kt)|0,b=(b=b+Math.imul(mt,Wt)|0)+Math.imul(Et,kt)|0,g=g+Math.imul(Et,Wt)|0,p=p+Math.imul(ct,Ot)|0,b=(b=b+Math.imul(ct,Gt)|0)+Math.imul(wt,Ot)|0,g=g+Math.imul(wt,Gt)|0,p=p+Math.imul(st,Lt)|0,b=(b=b+Math.imul(st,oe)|0)+Math.imul(ot,Lt)|0,g=g+Math.imul(ot,oe)|0,p=p+Math.imul(G,Pt)|0,b=(b=b+Math.imul(G,Yt)|0)+Math.imul(nt,Pt)|0,g=g+Math.imul(nt,Yt)|0,p=p+Math.imul(tt,Bt)|0,b=(b=b+Math.imul(tt,Qt)|0)+Math.imul(X,Bt)|0,g=g+Math.imul(X,Qt)|0,p=p+Math.imul(q,Ut)|0,b=(b=b+Math.imul(q,Q)|0)+Math.imul(K,Ut)|0,g=g+Math.imul(K,Q)|0,p=p+Math.imul(F,ut)|0,b=(b=b+Math.imul(F,bt)|0)+Math.imul(V,ut)|0,g=g+Math.imul(V,bt)|0,p=p+Math.imul(H,yt)|0,b=(b=b+Math.imul(H,Dt)|0)+Math.imul(E,yt)|0,g=g+Math.imul(E,Dt)|0;var ft=(O+(p=p+Math.imul($,At)|0)|0)+((8191&(b=(b=b+Math.imul($,zt)|0)+Math.imul(W,At)|0))<<13)|0;O=((g=g+Math.imul(W,zt)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(Tt,kt),b=(b=Math.imul(Tt,Wt))+Math.imul(Rt,kt)|0,g=Math.imul(Rt,Wt),p=p+Math.imul(mt,Ot)|0,b=(b=b+Math.imul(mt,Gt)|0)+Math.imul(Et,Ot)|0,g=g+Math.imul(Et,Gt)|0,p=p+Math.imul(ct,Lt)|0,b=(b=b+Math.imul(ct,oe)|0)+Math.imul(wt,Lt)|0,g=g+Math.imul(wt,oe)|0,p=p+Math.imul(st,Pt)|0,b=(b=b+Math.imul(st,Yt)|0)+Math.imul(ot,Pt)|0,g=g+Math.imul(ot,Yt)|0,p=p+Math.imul(G,Bt)|0,b=(b=b+Math.imul(G,Qt)|0)+Math.imul(nt,Bt)|0,g=g+Math.imul(nt,Qt)|0,p=p+Math.imul(tt,Ut)|0,b=(b=b+Math.imul(tt,Q)|0)+Math.imul(X,Ut)|0,g=g+Math.imul(X,Q)|0,p=p+Math.imul(q,ut)|0,b=(b=b+Math.imul(q,bt)|0)+Math.imul(K,ut)|0,g=g+Math.imul(K,bt)|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 ht=(O+(p=p+Math.imul(H,At)|0)|0)+((8191&(b=(b=b+Math.imul(H,zt)|0)+Math.imul(E,At)|0))<<13)|0;O=((g=g+Math.imul(E,zt)|0)+(b>>>13)|0)+(ht>>>26)|0,ht&=67108863,p=Math.imul(Tt,Ot),b=(b=Math.imul(Tt,Gt))+Math.imul(Rt,Ot)|0,g=Math.imul(Rt,Gt),p=p+Math.imul(mt,Lt)|0,b=(b=b+Math.imul(mt,oe)|0)+Math.imul(Et,Lt)|0,g=g+Math.imul(Et,oe)|0,p=p+Math.imul(ct,Pt)|0,b=(b=b+Math.imul(ct,Yt)|0)+Math.imul(wt,Pt)|0,g=g+Math.imul(wt,Yt)|0,p=p+Math.imul(st,Bt)|0,b=(b=b+Math.imul(st,Qt)|0)+Math.imul(ot,Bt)|0,g=g+Math.imul(ot,Qt)|0,p=p+Math.imul(G,Ut)|0,b=(b=b+Math.imul(G,Q)|0)+Math.imul(nt,Ut)|0,g=g+Math.imul(nt,Q)|0,p=p+Math.imul(tt,ut)|0,b=(b=b+Math.imul(tt,bt)|0)+Math.imul(X,ut)|0,g=g+Math.imul(X,bt)|0,p=p+Math.imul(q,yt)|0,b=(b=b+Math.imul(q,Dt)|0)+Math.imul(K,yt)|0,g=g+Math.imul(K,Dt)|0;var St=(O+(p=p+Math.imul(F,At)|0)|0)+((8191&(b=(b=b+Math.imul(F,zt)|0)+Math.imul(V,At)|0))<<13)|0;O=((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,oe))+Math.imul(Rt,Lt)|0,g=Math.imul(Rt,oe),p=p+Math.imul(mt,Pt)|0,b=(b=b+Math.imul(mt,Yt)|0)+Math.imul(Et,Pt)|0,g=g+Math.imul(Et,Yt)|0,p=p+Math.imul(ct,Bt)|0,b=(b=b+Math.imul(ct,Qt)|0)+Math.imul(wt,Bt)|0,g=g+Math.imul(wt,Qt)|0,p=p+Math.imul(st,Ut)|0,b=(b=b+Math.imul(st,Q)|0)+Math.imul(ot,Ut)|0,g=g+Math.imul(ot,Q)|0,p=p+Math.imul(G,ut)|0,b=(b=b+Math.imul(G,bt)|0)+Math.imul(nt,ut)|0,g=g+Math.imul(nt,bt)|0,p=p+Math.imul(tt,yt)|0,b=(b=b+Math.imul(tt,Dt)|0)+Math.imul(X,yt)|0,g=g+Math.imul(X,Dt)|0;var pt=(O+(p=p+Math.imul(q,At)|0)|0)+((8191&(b=(b=b+Math.imul(q,zt)|0)+Math.imul(K,At)|0))<<13)|0;O=((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,Yt))+Math.imul(Rt,Pt)|0,g=Math.imul(Rt,Yt),p=p+Math.imul(mt,Bt)|0,b=(b=b+Math.imul(mt,Qt)|0)+Math.imul(Et,Bt)|0,g=g+Math.imul(Et,Qt)|0,p=p+Math.imul(ct,Ut)|0,b=(b=b+Math.imul(ct,Q)|0)+Math.imul(wt,Ut)|0,g=g+Math.imul(wt,Q)|0,p=p+Math.imul(st,ut)|0,b=(b=b+Math.imul(st,bt)|0)+Math.imul(ot,ut)|0,g=g+Math.imul(ot,bt)|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 gt=(O+(p=p+Math.imul(tt,At)|0)|0)+((8191&(b=(b=b+Math.imul(tt,zt)|0)+Math.imul(X,At)|0))<<13)|0;O=((g=g+Math.imul(X,zt)|0)+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,p=Math.imul(Tt,Bt),b=(b=Math.imul(Tt,Qt))+Math.imul(Rt,Bt)|0,g=Math.imul(Rt,Qt),p=p+Math.imul(mt,Ut)|0,b=(b=b+Math.imul(mt,Q)|0)+Math.imul(Et,Ut)|0,g=g+Math.imul(Et,Q)|0,p=p+Math.imul(ct,ut)|0,b=(b=b+Math.imul(ct,bt)|0)+Math.imul(wt,ut)|0,g=g+Math.imul(wt,bt)|0,p=p+Math.imul(st,yt)|0,b=(b=b+Math.imul(st,Dt)|0)+Math.imul(ot,yt)|0,g=g+Math.imul(ot,Dt)|0;var Xt=(O+(p=p+Math.imul(G,At)|0)|0)+((8191&(b=(b=b+Math.imul(G,zt)|0)+Math.imul(nt,At)|0))<<13)|0;O=((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,Q))+Math.imul(Rt,Ut)|0,g=Math.imul(Rt,Q),p=p+Math.imul(mt,ut)|0,b=(b=b+Math.imul(mt,bt)|0)+Math.imul(Et,ut)|0,g=g+Math.imul(Et,bt)|0,p=p+Math.imul(ct,yt)|0,b=(b=b+Math.imul(ct,Dt)|0)+Math.imul(wt,yt)|0,g=g+Math.imul(wt,Dt)|0;var $t=(O+(p=p+Math.imul(st,At)|0)|0)+((8191&(b=(b=b+Math.imul(st,zt)|0)+Math.imul(ot,At)|0))<<13)|0;O=((g=g+Math.imul(ot,zt)|0)+(b>>>13)|0)+($t>>>26)|0,$t&=67108863,p=Math.imul(Tt,ut),b=(b=Math.imul(Tt,bt))+Math.imul(Rt,ut)|0,g=Math.imul(Rt,bt),p=p+Math.imul(mt,yt)|0,b=(b=b+Math.imul(mt,Dt)|0)+Math.imul(Et,yt)|0,g=g+Math.imul(Et,Dt)|0;var Vt=(O+(p=p+Math.imul(ct,At)|0)|0)+((8191&(b=(b=b+Math.imul(ct,zt)|0)+Math.imul(wt,At)|0))<<13)|0;O=((g=g+Math.imul(wt,zt)|0)+(b>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,p=Math.imul(Tt,yt),b=(b=Math.imul(Tt,Dt))+Math.imul(Rt,yt)|0,g=Math.imul(Rt,Dt);var Nt=(O+(p=p+Math.imul(mt,At)|0)|0)+((8191&(b=(b=b+Math.imul(mt,zt)|0)+Math.imul(Et,At)|0))<<13)|0;O=((g=g+Math.imul(Et,zt)|0)+(b>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var ee=(O+(p=Math.imul(Tt,At))|0)+((8191&(b=(b=Math.imul(Tt,zt))+Math.imul(Rt,At)|0))<<13)|0;return O=((g=Math.imul(Rt,zt))+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,R[0]=Ft,R[1]=Ht,R[2]=fe,R[3]=le,R[4]=ce,R[5]=he,R[6]=me,R[7]=Z,R[8]=at,R[9]=ft,R[10]=ht,R[11]=St,R[12]=pt,R[13]=gt,R[14]=Xt,R[15]=$t,R[16]=Vt,R[17]=Nt,R[18]=ee,O!==0&&(R[19]=O,v.length++),v};function w(x,M,v){return new _().mulp(x,M,v)}function _(x,M){this.x=x,this.y=M}Math.imul||(h=d),t.prototype.mulTo=function(x,M){var v=this.length+x.length;return this.length===10&&x.length===10?h(this,x,M):v<63?d(this,x,M):v<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,O&=67108863}g.words[R]=z,y=O,O=k}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,x,M):w(this,x,M)},_.prototype.makeRBT=function(x){for(var M=new Array(x),v=t.prototype._countBits(x)-1,p=0;p>=1;return p},_.prototype.permute=function(x,M,v,p,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,v[2*g+1]=8191&b,b>>>=13;for(g=2*M;g>=26,M+=p/67108864|0,M+=b>>>26,this.words[v]=67108863&b}return M!==0&&(this.words[v]=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>>O}return y}(x);if(M.length===0)return new t(1);for(var v=this,p=0;p=0);var M,v=x%26,p=(x-v)/26,b=67108863>>>26-v<<26-v;if(v!==0){var g=0;for(M=0;M>>26-v}g&&(this.words[M]=g,this.length++)}if(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&&(O!==0||R>=p);R--){var z=0|this.words[R];this.words[R]=O<<26-b|z>>>b,O=z&y}return k&&O!==0&&(k.words[k.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(x,M,v){return o(this.negative===0),this.iushrn(x,M,v)},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){o(typeof x=="number"&&x>=0);var M=x%26,v=(x-M)/26,p=1<=0);var M=x%26,v=(x-M)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(M!==0&&v++,this.length=Math.min(v,this.length),M!==0){var 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(o(typeof x=="number"),o(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+v]=67108863&b}for(;p>26,this.words[p+v]=67108863&b;if(y===0)return this.strip();for(o(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 v=(this.length,x.length),p=this.clone(),b=x,g=0|b.words[b.length-1];(v=26-this._countBits(g))!==0&&(b=b.ushln(v),p.iushln(v),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 $=67108864*(0|p.words[b.length+z])+(0|p.words[b.length+z-1]);for($=Math.min($/g|0,67108863),p._ishlnsubmul(b,$,z);p.negative!==0;)$--,p.negative=0,p._ishlnsubmul(b,1,z),p.isZero()||(p.negative^=1);y&&(y.words[z]=$)}return y&&y.strip(),p.strip(),M!=="div"&&v!==0&&p.iushrn(v),{div:y||null,mod:p}},t.prototype.divmod=function(x,M,v){return o(!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(),v&&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)!=0?(g=this.neg().divmod(x.neg(),M),M!=="div"&&(b=g.mod.neg(),v&&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 v=M.div.negative!==0?M.mod.isub(x):M.mod,p=x.ushrn(1),b=x.andln(1),g=v.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){o(x<=67108863);for(var M=(1<<26)%x,v=0,p=this.length-1;p>=0;p--)v=(M*v+(0|this.words[p]))%x;return v},t.prototype.idivn=function(x){o(x<=67108863);for(var M=0,v=this.length-1;v>=0;v--){var p=(0|this.words[v])+67108864*M;this.words[v]=p/x|0,M=p%x}return this.strip()},t.prototype.divn=function(x){return this.clone().idivn(x)},t.prototype.egcd=function(x){o(x.negative===0),o(!x.isZero());var M=this,v=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()&&v.isEven();)M.iushrn(1),v.iushrn(1),++k;for(var R=v.clone(),O=M.clone();!M.isZero();){for(var z=0,$=1;(M.words[0]&$)==0&&z<26;++z,$<<=1);if(z>0)for(M.iushrn(z);z-- >0;)(p.isOdd()||b.isOdd())&&(p.iadd(R),b.isub(O)),p.iushrn(1),b.iushrn(1);for(var W=0,j=1;(v.words[0]&j)==0&&W<26;++W,j<<=1);if(W>0)for(v.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(O)),g.iushrn(1),y.iushrn(1);M.cmp(v)>=0?(M.isub(v),p.isub(g),b.isub(y)):(v.isub(M),g.isub(p),y.isub(b))}return{a:g,b:y,gcd:v.iushln(k)}},t.prototype._invmp=function(x){o(x.negative===0),o(!x.isZero());var M=this,v=x.clone();M=M.negative!==0?M.umod(x):M.clone();for(var p,b=new t(1),g=new t(0),y=v.clone();M.cmpn(1)>0&&v.cmpn(1)>0;){for(var k=0,R=1;(M.words[0]&R)==0&&k<26;++k,R<<=1);if(k>0)for(M.iushrn(k);k-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var O=0,z=1;(v.words[0]&z)==0&&O<26;++O,z<<=1);if(O>0)for(v.iushrn(O);O-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);M.cmp(v)>=0?(M.isub(v),b.isub(g)):(v.isub(M),g.isub(b))}return(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(),v=x.clone();M.negative=0,v.negative=0;for(var p=0;M.isEven()&&v.isEven();p++)M.iushrn(1),v.iushrn(1);for(;;){for(;M.isEven();)M.iushrn(1);for(;v.isEven();)v.iushrn(1);var b=M.cmp(v);if(b<0){var g=M;M=v,v=g}else if(b===0||v.cmpn(1)===0)break;M.isub(v)}return v.iushln(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){o(typeof x=="number");var M=x%26,v=(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,v=x<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;if(this.strip(),this.length>1)M=1;else{v&&(x=-x),o(x<=67108863,"Number is too big");var p=0|this.words[0];M=p===x?0:px.length)return 1;if(this.length=0;v--){var p=0|this.words[v],b=0|x.words[v];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 U(x)},t.prototype.toRed=function(x){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},t.prototype.fromRed=function(){return o(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 o(!this.red,"Already a number in reduction context"),this._forceRed(x)},t.prototype.redAdd=function(x){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},t.prototype.redIAdd=function(x){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},t.prototype.redSub=function(x){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},t.prototype.redISub=function(x){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},t.prototype.redShl=function(x){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},t.prototype.redMul=function(x){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},t.prototype.redIMul=function(x){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},t.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(x){return o(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 I(){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 U(x){if(typeof x=="string"){var M=t._prime(x);this.m=M.p,this.prime=M}else o(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}function B(x){U.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,v=x;do this.split(v,this.tmp),M=(v=(v=this.imulK(v)).iadd(this.tmp)).bitLength();while(M>this.n);var p=M0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},N.prototype.split=function(x,M){x.iushrn(this.n,0,M)},N.prototype.imulK=function(x){return x.imul(this.k)},r(L,N),L.prototype.split=function(x,M){for(var v=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,v=0;v>>=26,x.words[v]=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 I;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},U.prototype._verify1=function(x){o(x.negative===0,"red works only with positives"),o(x.red,"red works only with red numbers")},U.prototype._verify2=function(x,M){o((x.negative|M.negative)==0,"red works only with positives"),o(x.red&&x.red===M.red,"red works only with red numbers")},U.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):x.umod(this.m)._forceRed(this)},U.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},U.prototype.add=function(x,M){this._verify2(x,M);var v=x.add(M);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},U.prototype.iadd=function(x,M){this._verify2(x,M);var v=x.iadd(M);return v.cmp(this.m)>=0&&v.isub(this.m),v},U.prototype.sub=function(x,M){this._verify2(x,M);var v=x.sub(M);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},U.prototype.isub=function(x,M){this._verify2(x,M);var v=x.isub(M);return v.cmpn(0)<0&&v.iadd(this.m),v},U.prototype.shl=function(x,M){return this._verify1(x),this.imod(x.ushln(M))},U.prototype.imul=function(x,M){return this._verify2(x,M),this.imod(x.imul(M))},U.prototype.mul=function(x,M){return this._verify2(x,M),this.imod(x.mul(M))},U.prototype.isqr=function(x){return this.imul(x,x.clone())},U.prototype.sqr=function(x){return this.mul(x,x)},U.prototype.sqrt=function(x){if(x.isZero())return x.clone();var M=this.m.andln(3);if(o(M%2==1),M===3){var v=this.m.add(new t(1)).iushrn(2);return this.pow(x,v)}for(var p=this.m.subn(1),b=0;!p.isZero()&&p.andln(1)===0;)b++,p.iushrn(1);o(!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 O=this.pow(R,p),z=this.pow(x,p.addn(1).iushrn(1)),$=this.pow(x,p),W=b;$.cmp(g)!==0;){for(var j=$,H=0;j.cmp(g)!==0;H++)j=j.redSqr();o(H=0;p--){for(var R=M.words[p],O=k-1;O>=0;O--){var z=R>>O&1;b!==v[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||p===0&&O===0)&&(b=this.mul(b,v[g]),y=0,g=0)):y=0}k=26}return b},U.prototype.convertTo=function(x){var M=x.umod(this.m);return M===x?M.clone():M},U.prototype.convertFrom=function(x){var M=x.clone();return M.red=null,M},t.mont=function(x){return new B(x)},r(B,U),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 v=x.imul(M),p=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.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 v=x.mul(M),p=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.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 f=l(i),c=f[0],u=f[1];return 3*(c+u)/4-u},S.toByteArray=function(i){var f,c,u=l(i),d=u[0],h=u[1],w=new o(function(N,L,I){return 3*(L+I)/4-I}(0,d,h)),_=0,A=h>0?d-4:d;for(c=0;c>16&255,w[_++]=f>>8&255,w[_++]=255&f;return h===2&&(f=a[i.charCodeAt(c)]<<2|a[i.charCodeAt(c+1)]>>4,w[_++]=255&f),h===1&&(f=a[i.charCodeAt(c)]<<10|a[i.charCodeAt(c+1)]<<4|a[i.charCodeAt(c+2)]>>2,w[_++]=f>>8&255,w[_++]=255&f),w},S.fromByteArray=function(i){for(var f,c=i.length,u=c%3,d=[],h=0,w=c-u;hw?w:h+16383));return u===1?(f=i[c-1],d.push(m[f>>2]+m[f<<4&63]+"==")):u===2&&(f=(i[c-2]<<8)+i[c-1],d.push(m[f>>10]+m[f>>4&63]+m[f<<2&63]+"=")),d.join("")};for(var m=[],a=[],o=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var c=i.indexOf("=");return c===-1&&(c=f),[c,c===f?0:4-c%4]}function n(i,f,c){for(var u,d,h=[],w=f;w>18&63]+m[d>>12&63]+m[d>>6&63]+m[63&d]);return h.join("")}a[45]=62,a[95]=63},{}],186:[function(s,T,S){(function(m,a){function o(v,p){if(!v)throw new Error(p||"Assertion failed")}function r(v,p){v.super_=p;var b=function(){};b.prototype=p.prototype,v.prototype=new b,v.prototype.constructor=v}function t(v,p,b){if(t.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&(p!=="le"&&p!=="be"||(b=p,p=10),this._init(v||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<"u"&&window.Buffer!==void 0?window.Buffer:s("buffer").Buffer}catch{}function l(v,p){var b=v.charCodeAt(p);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void o(!1,"Invalid character in "+v)}function n(v,p,b){var g=l(v,b);return b-1>=p&&(g|=l(v,b-1)<<4),g}function i(v,p,b,g){for(var y=0,k=0,R=Math.min(v.length,b),O=p;O=49?z-49+10:z>=17?z-17+10:z,o(z>=0&&k0?v:p},t.min=function(v,p){return v.cmp(p)<0?v:p},t.prototype._init=function(v,p,b){if(typeof v=="number")return this._initNumber(v,p,b);if(typeof v=="object")return this._initArray(v,p,b);p==="hex"&&(p=16),o(p===(0|p)&&p>=2&&p<=36);var g=0;(v=v.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)k=v[g]|v[g-1]<<8|v[g-2]<<16,this.words[y]|=k<>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);else if(b==="le")for(g=0,y=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);return this._strip()},t.prototype._parseHex=function(v,p,b){this.length=Math.ceil((v.length-p)/6),this.words=new Array(this.length);for(var g=0;g=p;g-=2)y=n(v,p,g)<=18?(k-=18,R+=1,this.words[R]|=y>>>26):k+=8;else for(g=(v.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(v,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=v.length-b,R=k%g,O=Math.min(k,k-R)+b,z=0,$=b;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{t.prototype.inspect=c}else t.prototype.inspect=c;function c(){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(v,p){var b;if(p=0|p||1,(v=v||10)===16||v==="hex"){b="";for(var g=0,y=0,k=0;k>>24-g&16777215,(g+=2)>=26&&(g-=26,k--),b=y!==0||k!==this.length-1?u[6-O.length]+O+b:O+b}for(y!==0&&(b=y.toString(16)+b);b.length%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(v===(0|v)&&v>=2&&v<=36){var z=d[v],$=h[v];b="";var W=this.clone();for(W.negative=0;!W.isZero();){var j=W.modrn($).toString(v);b=(W=W.idivn($)).isZero()?j+b:u[z-j.length]+j+b}for(this.isZero()&&(b="0"+b);b.length%p!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}o(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=67108864*this.words[1]:this.length===3&&this.words[2]===1?v+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},t.prototype.toJSON=function(){return this.toString(16,2)},e&&(t.prototype.toBuffer=function(v,p){return this.toArrayLike(e,v,p)}),t.prototype.toArray=function(v,p){return this.toArrayLike(Array,v,p)};function w(v,p,b){b.negative=p.negative^v.negative;var g=v.length+p.length|0;b.length=g,g=g-1|0;var y=0|v.words[0],k=0|p.words[0],R=y*k,O=67108863&R,z=R/67108864|0;b.words[0]=O;for(var $=1;$>>26,j=67108863&z,H=Math.min($,p.length-1),E=Math.max(0,$-v.length+1);E<=H;E++){var C=$-E|0;W+=(R=(y=0|v.words[C])*(k=0|p.words[E])+j)/67108864|0,j=67108863&R}b.words[$]=0|j,z=0|W}return z!==0?b.words[$]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(v,p,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);o(g<=y,"byte array longer than desired length"),o(y>0,"Requested array length <= 0");var k=function(R,O){return R.allocUnsafe?R.allocUnsafe(O):new R(O)}(v,y);return this["_toArrayLike"+(p==="le"?"LE":"BE")](k,g),k},t.prototype._toArrayLikeLE=function(v,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&&(v[b--]=R>>8&255),b>=0&&(v[b--]=R>>16&255),k===6?(b>=0&&(v[b--]=R>>24&255),g=0,k=0):(g=R>>>24,k+=2)}if(b>=0)for(v[b--]=g;b>=0;)v[b--]=0},Math.clz32?t.prototype._countBits=function(v){return 32-Math.clz32(v)}:t.prototype._countBits=function(v){var p=v,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(v){if(v===0)return 26;var p=v,b=0;return(8191&p)==0&&(b+=13,p>>>=13),(127&p)==0&&(b+=7,p>>>=7),(15&p)==0&&(b+=4,p>>>=4),(3&p)==0&&(b+=2,p>>>=2),(1&p)==0&&b++,b},t.prototype.bitLength=function(){var v=this.words[this.length-1],p=this._countBits(v);return 26*(this.length-1)+p},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,p=0;pv.length?this.clone().ior(v):v.clone().ior(this)},t.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},t.prototype.iuand=function(v){var p;p=this.length>v.length?v:this;for(var b=0;bv.length?this.clone().iand(v):v.clone().iand(this)},t.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},t.prototype.iuxor=function(v){var p,b;this.length>v.length?(p=this,b=v):(p=v,b=this);for(var g=0;gv.length?this.clone().ixor(v):v.clone().ixor(this)},t.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},t.prototype.inotn=function(v){o(typeof v=="number"&&v>=0);var p=0|Math.ceil(v/26),b=v%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(v){return this.clone().inotn(v)},t.prototype.setn=function(v,p){o(typeof v=="number"&&v>=0);var b=v/26|0,g=v%26;return this._expand(b+1),this.words[b]=p?this.words[b]|1<v.length?(b=this,g=v):(b=v,g=this);for(var y=0,k=0;k>>26;for(;y!==0&&k>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;kv.length?this.clone().iadd(v):v.clone().iadd(this)},t.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var p=this.iadd(v);return v.negative=1,p._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var b,g,y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=v):(b=v,g=this);for(var k=0,R=0;R>26,this.words[R]=67108863&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,q=V>>>13,K=0|R[3],et=8191&K,tt=K>>>13,X=0|R[4],J=8191&X,G=X>>>13,nt=0|R[5],rt=8191&nt,st=nt>>>13,ot=0|R[6],lt=8191&ot,ct=ot>>>13,wt=0|R[7],vt=8191&wt,mt=wt>>>13,Et=0|R[8],Mt=8191&Et,Tt=Et>>>13,Rt=0|R[9],_t=8191&Rt,dt=Rt>>>13,xt=0|O[0],Ct=8191&xt,kt=xt>>>13,Wt=0|O[1],te=8191&Wt,Ot=Wt>>>13,Gt=0|O[2],qt=8191&Gt,Lt=Gt>>>13,oe=0|O[3],Jt=8191&oe,Pt=oe>>>13,Yt=0|O[4],ie=8191&Yt,Bt=Yt>>>13,Qt=0|O[5],se=8191&Qt,Ut=Qt>>>13,Q=0|O[6],it=8191&Q,ut=Q>>>13,bt=0|O[7],jt=8191&bt,yt=bt>>>13,Dt=0|O[8],It=8191&Dt,At=Dt>>>13,zt=0|O[9],Ft=8191&zt,Ht=zt>>>13;b.negative=v.negative^p.negative,b.length=19;var fe=($+(g=Math.imul(j,Ct))|0)+((8191&(y=(y=Math.imul(j,kt))+Math.imul(H,Ct)|0))<<13)|0;$=((k=Math.imul(H,kt))+(y>>>13)|0)+(fe>>>26)|0,fe&=67108863,g=Math.imul(C,Ct),y=(y=Math.imul(C,kt))+Math.imul(F,Ct)|0,k=Math.imul(F,kt);var le=($+(g=g+Math.imul(j,te)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ot)|0)+Math.imul(H,te)|0))<<13)|0;$=((k=k+Math.imul(H,Ot)|0)+(y>>>13)|0)+(le>>>26)|0,le&=67108863,g=Math.imul(Y,Ct),y=(y=Math.imul(Y,kt))+Math.imul(q,Ct)|0,k=Math.imul(q,kt),g=g+Math.imul(C,te)|0,y=(y=y+Math.imul(C,Ot)|0)+Math.imul(F,te)|0,k=k+Math.imul(F,Ot)|0;var ce=($+(g=g+Math.imul(j,qt)|0)|0)+((8191&(y=(y=y+Math.imul(j,Lt)|0)+Math.imul(H,qt)|0))<<13)|0;$=((k=k+Math.imul(H,Lt)|0)+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863,g=Math.imul(et,Ct),y=(y=Math.imul(et,kt))+Math.imul(tt,Ct)|0,k=Math.imul(tt,kt),g=g+Math.imul(Y,te)|0,y=(y=y+Math.imul(Y,Ot)|0)+Math.imul(q,te)|0,k=k+Math.imul(q,Ot)|0,g=g+Math.imul(C,qt)|0,y=(y=y+Math.imul(C,Lt)|0)+Math.imul(F,qt)|0,k=k+Math.imul(F,Lt)|0;var he=($+(g=g+Math.imul(j,Jt)|0)|0)+((8191&(y=(y=y+Math.imul(j,Pt)|0)+Math.imul(H,Jt)|0))<<13)|0;$=((k=k+Math.imul(H,Pt)|0)+(y>>>13)|0)+(he>>>26)|0,he&=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(et,te)|0,y=(y=y+Math.imul(et,Ot)|0)+Math.imul(tt,te)|0,k=k+Math.imul(tt,Ot)|0,g=g+Math.imul(Y,qt)|0,y=(y=y+Math.imul(Y,Lt)|0)+Math.imul(q,qt)|0,k=k+Math.imul(q,Lt)|0,g=g+Math.imul(C,Jt)|0,y=(y=y+Math.imul(C,Pt)|0)+Math.imul(F,Jt)|0,k=k+Math.imul(F,Pt)|0;var me=($+(g=g+Math.imul(j,ie)|0)|0)+((8191&(y=(y=y+Math.imul(j,Bt)|0)+Math.imul(H,ie)|0))<<13)|0;$=((k=k+Math.imul(H,Bt)|0)+(y>>>13)|0)+(me>>>26)|0,me&=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,te)|0,y=(y=y+Math.imul(J,Ot)|0)+Math.imul(G,te)|0,k=k+Math.imul(G,Ot)|0,g=g+Math.imul(et,qt)|0,y=(y=y+Math.imul(et,Lt)|0)+Math.imul(tt,qt)|0,k=k+Math.imul(tt,Lt)|0,g=g+Math.imul(Y,Jt)|0,y=(y=y+Math.imul(Y,Pt)|0)+Math.imul(q,Jt)|0,k=k+Math.imul(q,Pt)|0,g=g+Math.imul(C,ie)|0,y=(y=y+Math.imul(C,Bt)|0)+Math.imul(F,ie)|0,k=k+Math.imul(F,Bt)|0;var Z=($+(g=g+Math.imul(j,se)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ut)|0)+Math.imul(H,se)|0))<<13)|0;$=((k=k+Math.imul(H,Ut)|0)+(y>>>13)|0)+(Z>>>26)|0,Z&=67108863,g=Math.imul(lt,Ct),y=(y=Math.imul(lt,kt))+Math.imul(ct,Ct)|0,k=Math.imul(ct,kt),g=g+Math.imul(rt,te)|0,y=(y=y+Math.imul(rt,Ot)|0)+Math.imul(st,te)|0,k=k+Math.imul(st,Ot)|0,g=g+Math.imul(J,qt)|0,y=(y=y+Math.imul(J,Lt)|0)+Math.imul(G,qt)|0,k=k+Math.imul(G,Lt)|0,g=g+Math.imul(et,Jt)|0,y=(y=y+Math.imul(et,Pt)|0)+Math.imul(tt,Jt)|0,k=k+Math.imul(tt,Pt)|0,g=g+Math.imul(Y,ie)|0,y=(y=y+Math.imul(Y,Bt)|0)+Math.imul(q,ie)|0,k=k+Math.imul(q,Bt)|0,g=g+Math.imul(C,se)|0,y=(y=y+Math.imul(C,Ut)|0)+Math.imul(F,se)|0,k=k+Math.imul(F,Ut)|0;var at=($+(g=g+Math.imul(j,it)|0)|0)+((8191&(y=(y=y+Math.imul(j,ut)|0)+Math.imul(H,it)|0))<<13)|0;$=((k=k+Math.imul(H,ut)|0)+(y>>>13)|0)+(at>>>26)|0,at&=67108863,g=Math.imul(vt,Ct),y=(y=Math.imul(vt,kt))+Math.imul(mt,Ct)|0,k=Math.imul(mt,kt),g=g+Math.imul(lt,te)|0,y=(y=y+Math.imul(lt,Ot)|0)+Math.imul(ct,te)|0,k=k+Math.imul(ct,Ot)|0,g=g+Math.imul(rt,qt)|0,y=(y=y+Math.imul(rt,Lt)|0)+Math.imul(st,qt)|0,k=k+Math.imul(st,Lt)|0,g=g+Math.imul(J,Jt)|0,y=(y=y+Math.imul(J,Pt)|0)+Math.imul(G,Jt)|0,k=k+Math.imul(G,Pt)|0,g=g+Math.imul(et,ie)|0,y=(y=y+Math.imul(et,Bt)|0)+Math.imul(tt,ie)|0,k=k+Math.imul(tt,Bt)|0,g=g+Math.imul(Y,se)|0,y=(y=y+Math.imul(Y,Ut)|0)+Math.imul(q,se)|0,k=k+Math.imul(q,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 ft=($+(g=g+Math.imul(j,jt)|0)|0)+((8191&(y=(y=y+Math.imul(j,yt)|0)+Math.imul(H,jt)|0))<<13)|0;$=((k=k+Math.imul(H,yt)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=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,te)|0,y=(y=y+Math.imul(vt,Ot)|0)+Math.imul(mt,te)|0,k=k+Math.imul(mt,Ot)|0,g=g+Math.imul(lt,qt)|0,y=(y=y+Math.imul(lt,Lt)|0)+Math.imul(ct,qt)|0,k=k+Math.imul(ct,Lt)|0,g=g+Math.imul(rt,Jt)|0,y=(y=y+Math.imul(rt,Pt)|0)+Math.imul(st,Jt)|0,k=k+Math.imul(st,Pt)|0,g=g+Math.imul(J,ie)|0,y=(y=y+Math.imul(J,Bt)|0)+Math.imul(G,ie)|0,k=k+Math.imul(G,Bt)|0,g=g+Math.imul(et,se)|0,y=(y=y+Math.imul(et,Ut)|0)+Math.imul(tt,se)|0,k=k+Math.imul(tt,Ut)|0,g=g+Math.imul(Y,it)|0,y=(y=y+Math.imul(Y,ut)|0)+Math.imul(q,it)|0,k=k+Math.imul(q,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 ht=($+(g=g+Math.imul(j,It)|0)|0)+((8191&(y=(y=y+Math.imul(j,At)|0)+Math.imul(H,It)|0))<<13)|0;$=((k=k+Math.imul(H,At)|0)+(y>>>13)|0)+(ht>>>26)|0,ht&=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,te)|0,y=(y=y+Math.imul(Mt,Ot)|0)+Math.imul(Tt,te)|0,k=k+Math.imul(Tt,Ot)|0,g=g+Math.imul(vt,qt)|0,y=(y=y+Math.imul(vt,Lt)|0)+Math.imul(mt,qt)|0,k=k+Math.imul(mt,Lt)|0,g=g+Math.imul(lt,Jt)|0,y=(y=y+Math.imul(lt,Pt)|0)+Math.imul(ct,Jt)|0,k=k+Math.imul(ct,Pt)|0,g=g+Math.imul(rt,ie)|0,y=(y=y+Math.imul(rt,Bt)|0)+Math.imul(st,ie)|0,k=k+Math.imul(st,Bt)|0,g=g+Math.imul(J,se)|0,y=(y=y+Math.imul(J,Ut)|0)+Math.imul(G,se)|0,k=k+Math.imul(G,Ut)|0,g=g+Math.imul(et,it)|0,y=(y=y+Math.imul(et,ut)|0)+Math.imul(tt,it)|0,k=k+Math.imul(tt,ut)|0,g=g+Math.imul(Y,jt)|0,y=(y=y+Math.imul(Y,yt)|0)+Math.imul(q,jt)|0,k=k+Math.imul(q,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=($+(g=g+Math.imul(j,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(j,Ht)|0)+Math.imul(H,Ft)|0))<<13)|0;$=((k=k+Math.imul(H,Ht)|0)+(y>>>13)|0)+(St>>>26)|0,St&=67108863,g=Math.imul(_t,te),y=(y=Math.imul(_t,Ot))+Math.imul(dt,te)|0,k=Math.imul(dt,Ot),g=g+Math.imul(Mt,qt)|0,y=(y=y+Math.imul(Mt,Lt)|0)+Math.imul(Tt,qt)|0,k=k+Math.imul(Tt,Lt)|0,g=g+Math.imul(vt,Jt)|0,y=(y=y+Math.imul(vt,Pt)|0)+Math.imul(mt,Jt)|0,k=k+Math.imul(mt,Pt)|0,g=g+Math.imul(lt,ie)|0,y=(y=y+Math.imul(lt,Bt)|0)+Math.imul(ct,ie)|0,k=k+Math.imul(ct,Bt)|0,g=g+Math.imul(rt,se)|0,y=(y=y+Math.imul(rt,Ut)|0)+Math.imul(st,se)|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(et,jt)|0,y=(y=y+Math.imul(et,yt)|0)+Math.imul(tt,jt)|0,k=k+Math.imul(tt,yt)|0,g=g+Math.imul(Y,It)|0,y=(y=y+Math.imul(Y,At)|0)+Math.imul(q,It)|0,k=k+Math.imul(q,At)|0;var pt=($+(g=g+Math.imul(C,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(C,Ht)|0)+Math.imul(F,Ft)|0))<<13)|0;$=((k=k+Math.imul(F,Ht)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(_t,qt),y=(y=Math.imul(_t,Lt))+Math.imul(dt,qt)|0,k=Math.imul(dt,Lt),g=g+Math.imul(Mt,Jt)|0,y=(y=y+Math.imul(Mt,Pt)|0)+Math.imul(Tt,Jt)|0,k=k+Math.imul(Tt,Pt)|0,g=g+Math.imul(vt,ie)|0,y=(y=y+Math.imul(vt,Bt)|0)+Math.imul(mt,ie)|0,k=k+Math.imul(mt,Bt)|0,g=g+Math.imul(lt,se)|0,y=(y=y+Math.imul(lt,Ut)|0)+Math.imul(ct,se)|0,k=k+Math.imul(ct,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(et,It)|0,y=(y=y+Math.imul(et,At)|0)+Math.imul(tt,It)|0,k=k+Math.imul(tt,At)|0;var gt=($+(g=g+Math.imul(Y,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Y,Ht)|0)+Math.imul(q,Ft)|0))<<13)|0;$=((k=k+Math.imul(q,Ht)|0)+(y>>>13)|0)+(gt>>>26)|0,gt&=67108863,g=Math.imul(_t,Jt),y=(y=Math.imul(_t,Pt))+Math.imul(dt,Jt)|0,k=Math.imul(dt,Pt),g=g+Math.imul(Mt,ie)|0,y=(y=y+Math.imul(Mt,Bt)|0)+Math.imul(Tt,ie)|0,k=k+Math.imul(Tt,Bt)|0,g=g+Math.imul(vt,se)|0,y=(y=y+Math.imul(vt,Ut)|0)+Math.imul(mt,se)|0,k=k+Math.imul(mt,Ut)|0,g=g+Math.imul(lt,it)|0,y=(y=y+Math.imul(lt,ut)|0)+Math.imul(ct,it)|0,k=k+Math.imul(ct,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=($+(g=g+Math.imul(et,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(et,Ht)|0)+Math.imul(tt,Ft)|0))<<13)|0;$=((k=k+Math.imul(tt,Ht)|0)+(y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,g=Math.imul(_t,ie),y=(y=Math.imul(_t,Bt))+Math.imul(dt,ie)|0,k=Math.imul(dt,Bt),g=g+Math.imul(Mt,se)|0,y=(y=y+Math.imul(Mt,Ut)|0)+Math.imul(Tt,se)|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(mt,it)|0,k=k+Math.imul(mt,ut)|0,g=g+Math.imul(lt,jt)|0,y=(y=y+Math.imul(lt,yt)|0)+Math.imul(ct,jt)|0,k=k+Math.imul(ct,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=($+(g=g+Math.imul(J,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(J,Ht)|0)+Math.imul(G,Ft)|0))<<13)|0;$=((k=k+Math.imul(G,Ht)|0)+(y>>>13)|0)+($t>>>26)|0,$t&=67108863,g=Math.imul(_t,se),y=(y=Math.imul(_t,Ut))+Math.imul(dt,se)|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(mt,jt)|0,k=k+Math.imul(mt,yt)|0,g=g+Math.imul(lt,It)|0,y=(y=y+Math.imul(lt,At)|0)+Math.imul(ct,It)|0,k=k+Math.imul(ct,At)|0;var Vt=($+(g=g+Math.imul(rt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(rt,Ht)|0)+Math.imul(st,Ft)|0))<<13)|0;$=((k=k+Math.imul(st,Ht)|0)+(y>>>13)|0)+(Vt>>>26)|0,Vt&=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(mt,It)|0,k=k+Math.imul(mt,At)|0;var Nt=($+(g=g+Math.imul(lt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(lt,Ht)|0)+Math.imul(ct,Ft)|0))<<13)|0;$=((k=k+Math.imul(ct,Ht)|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 ee=($+(g=g+Math.imul(vt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(vt,Ht)|0)+Math.imul(mt,Ft)|0))<<13)|0;$=((k=k+Math.imul(mt,Ht)|0)+(y>>>13)|0)+(ee>>>26)|0,ee&=67108863,g=Math.imul(_t,It),y=(y=Math.imul(_t,At))+Math.imul(dt,It)|0,k=Math.imul(dt,At);var re=($+(g=g+Math.imul(Mt,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(Mt,Ht)|0)+Math.imul(Tt,Ft)|0))<<13)|0;$=((k=k+Math.imul(Tt,Ht)|0)+(y>>>13)|0)+(re>>>26)|0,re&=67108863;var ae=($+(g=Math.imul(_t,Ft))|0)+((8191&(y=(y=Math.imul(_t,Ht))+Math.imul(dt,Ft)|0))<<13)|0;return $=((k=Math.imul(dt,Ht))+(y>>>13)|0)+(ae>>>26)|0,ae&=67108863,z[0]=fe,z[1]=le,z[2]=ce,z[3]=he,z[4]=me,z[5]=Z,z[6]=at,z[7]=ft,z[8]=ht,z[9]=St,z[10]=pt,z[11]=gt,z[12]=Xt,z[13]=$t,z[14]=Vt,z[15]=Nt,z[16]=ee,z[17]=re,z[18]=ae,$!==0&&(z[19]=$,b.length++),b};function A(v,p,b){b.negative=p.negative^v.negative,b.length=v.length+p.length;for(var g=0,y=0,k=0;k>>26)|0)>>>26,R&=67108863}b.words[k]=O,g=R,R=y}return g!==0?b.words[k]=g:b.length--,b._strip()}function N(v,p,b){return A(v,p,b)}Math.imul||(_=w),t.prototype.mulTo=function(v,p){var b=this.length+v.length;return this.length===10&&v.length===10?_(this,v,p):b<63?w(this,v,p):b<1024?A(this,v,p):N(this,v,p)},t.prototype.mul=function(v){var p=new t(null);return p.words=new Array(this.length+v.length),this.mulTo(v,p)},t.prototype.mulf=function(v){var p=new t(null);return p.words=new Array(this.length+v.length),N(this,v,p)},t.prototype.imul=function(v){return this.clone().mulTo(v,this)},t.prototype.imuln=function(v){var p=v<0;p&&(v=-v),o(typeof v=="number"),o(v<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=k>>>26,this.words[g]=67108863&k}return b!==0&&(this.words[g]=b,this.length++),p?this.ineg():this},t.prototype.muln=function(v){return this.clone().imuln(v)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(v){var p=function(k){for(var R=new Array(k.bitLength()),O=0;O>>$&1}return R}(v);if(p.length===0)return new t(1);for(var b=this,g=0;g=0);var p,b=v%26,g=(v-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=v%26,k=Math.min((v-y)/26,this.length),R=67108863^67108863>>>y<k)for(this.length-=k,z=0;z=0&&($!==0||z>=g);z--){var W=0|this.words[z];this.words[z]=$<<26-y|W>>>y,$=W&R}return O&&$!==0&&(O.words[O.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(v,p,b){return o(this.negative===0),this.iushrn(v,p,b)},t.prototype.shln=function(v){return this.clone().ishln(v)},t.prototype.ushln=function(v){return this.clone().iushln(v)},t.prototype.shrn=function(v){return this.clone().ishrn(v)},t.prototype.ushrn=function(v){return this.clone().iushrn(v)},t.prototype.testn=function(v){o(typeof v=="number"&&v>=0);var p=v%26,b=(v-p)/26,g=1<=0);var p=v%26,b=(v-p)/26;if(o(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(v){if(o(typeof v=="number"),o(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(O/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(o(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(v,p){var b=(this.length,v.length),g=this.clone(),y=v,k=0|y.words[y.length-1];(b=26-this._countBits(k))!==0&&(y=y.ushln(b),g.iushln(b),k=0|y.words[y.length-1]);var R,O=g.length-y.length;if(p!=="mod"){(R=new t(null)).length=O+1,R.words=new Array(R.length);for(var z=0;z=0;W--){var j=67108864*(0|g.words[y.length+W])+(0|g.words[y.length+W-1]);for(j=Math.min(j/k|0,67108863),g._ishlnsubmul(y,j,W);g.negative!==0;)j--,g.negative=0,g._ishlnsubmul(y,1,W),g.isZero()||(g.negative^=1);R&&(R.words[W]=j)}return R&&R._strip(),g._strip(),p!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(v,p,b){return o(!v.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&v.negative===0?(k=this.neg().divmod(v,p),p!=="mod"&&(g=k.div.neg()),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.iadd(v)),{div:g,mod:y}):this.negative===0&&v.negative!==0?(k=this.divmod(v.neg(),p),p!=="mod"&&(g=k.div.neg()),{div:g,mod:k.mod}):(this.negative&v.negative)!=0?(k=this.neg().divmod(v.neg(),p),p!=="div"&&(y=k.mod.neg(),b&&y.negative!==0&&y.isub(v)),{div:k.div,mod:y}):v.length>this.length||this.cmp(v)<0?{div:new t(0),mod:this}:v.length===1?p==="div"?{div:this.divn(v.words[0]),mod:null}:p==="mod"?{div:null,mod:new t(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new t(this.modrn(v.words[0]))}:this._wordDiv(v,p);var g,y,k},t.prototype.div=function(v){return this.divmod(v,"div",!1).div},t.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},t.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},t.prototype.divRound=function(v){var p=this.divmod(v);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(v):p.mod,g=v.ushrn(1),y=v.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(v){var p=v<0;p&&(v=-v),o(v<=67108863);for(var b=(1<<26)%v,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%v;return p?-g:g},t.prototype.modn=function(v){return this.modrn(v)},t.prototype.idivn=function(v){var p=v<0;p&&(v=-v),o(v<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/v|0,b=y%v}return this._strip(),p?this.ineg():this},t.prototype.divn=function(v){return this.clone().idivn(v)},t.prototype.egcd=function(v){o(v.negative===0),o(!v.isZero());var p=this,b=v.clone();p=p.negative!==0?p.umod(v):p.clone();for(var g=new t(1),y=new t(0),k=new t(0),R=new t(1),O=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++O;for(var z=b.clone(),$=p.clone();!p.isZero();){for(var W=0,j=1;(p.words[0]&j)==0&&W<26;++W,j<<=1);if(W>0)for(p.iushrn(W);W-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub($)),g.iushrn(1),y.iushrn(1);for(var H=0,E=1;(b.words[0]&E)==0&&H<26;++H,E<<=1);if(H>0)for(b.iushrn(H);H-- >0;)(k.isOdd()||R.isOdd())&&(k.iadd(z),R.isub($)),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(O)}},t.prototype._invmp=function(v){o(v.negative===0),o(!v.isZero());var p=this,b=v.clone();p=p.negative!==0?p.umod(v):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 O=0,z=1;(p.words[0]&z)==0&&O<26;++O,z<<=1);if(O>0)for(p.iushrn(O);O-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var $=0,W=1;(b.words[0]&W)==0&&$<26;++$,W<<=1);if($>0)for(b.iushrn($);$-- >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(v),g},t.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var p=this.clone(),b=v.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(v){return this.egcd(v).a.umod(v)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(v){return this.words[0]&v},t.prototype.bincn=function(v){o(typeof v=="number");var p=v%26,b=(v-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(v){var p,b=v<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&&(v=-v),o(v<=67108863,"Number is too big");var g=0|this.words[0];p=g===v?0:gv.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|v.words[b];if(g!==y){gy&&(p=1);break}}return p},t.prototype.gtn=function(v){return this.cmpn(v)===1},t.prototype.gt=function(v){return this.cmp(v)===1},t.prototype.gten=function(v){return this.cmpn(v)>=0},t.prototype.gte=function(v){return this.cmp(v)>=0},t.prototype.ltn=function(v){return this.cmpn(v)===-1},t.prototype.lt=function(v){return this.cmp(v)===-1},t.prototype.lten=function(v){return this.cmpn(v)<=0},t.prototype.lte=function(v){return this.cmp(v)<=0},t.prototype.eqn=function(v){return this.cmpn(v)===0},t.prototype.eq=function(v){return this.cmp(v)===0},t.red=function(v){return new x(v)},t.prototype.toRed=function(v){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},t.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(v){return this.red=v,this},t.prototype.forceRed=function(v){return o(!this.red,"Already a number in reduction context"),this._forceRed(v)},t.prototype.redAdd=function(v){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},t.prototype.redIAdd=function(v){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},t.prototype.redSub=function(v){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},t.prototype.redISub=function(v){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},t.prototype.redShl=function(v){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},t.prototype.redMul=function(v){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},t.prototype.redIMul=function(v){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},t.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(v){return o(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var L={k256:null,p224:null,p192:null,p25519:null};function I(v,p){this.name=v,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(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function D(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function U(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(v){if(typeof v=="string"){var p=t._prime(v);this.m=p.p,this.prime=p}else o(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}function M(v){x.call(this,v),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var v=new t(null);return v.words=new Array(Math.ceil(this.n/13)),v},I.prototype.ireduce=function(v){var p,b=v;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},I.prototype.split=function(v,p){v.iushrn(this.n,0,p)},I.prototype.imulK=function(v){return v.imul(this.k)},r(P,I),P.prototype.split=function(v,p){for(var b=Math.min(v.length,9),g=0;g>>22,y=k}y>>>=22,v.words[g-10]=y,y===0&&v.length>10?v.length-=10:v.length-=9},P.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var p=0,b=0;b>>=26,v.words[b]=y,p=g}return p!==0&&(v.words[v.length++]=p),v},t._prime=function(v){if(L[v])return L[v];var p;if(v==="k256")p=new P;else if(v==="p224")p=new D;else if(v==="p192")p=new U;else{if(v!=="p25519")throw new Error("Unknown prime "+v);p=new B}return L[v]=p,p},x.prototype._verify1=function(v){o(v.negative===0,"red works only with positives"),o(v.red,"red works only with red numbers")},x.prototype._verify2=function(v,p){o((v.negative|p.negative)==0,"red works only with positives"),o(v.red&&v.red===p.red,"red works only with red numbers")},x.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(f(v,v.umod(this.m)._forceRed(this)),v)},x.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},x.prototype.add=function(v,p){this._verify2(v,p);var b=v.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},x.prototype.iadd=function(v,p){this._verify2(v,p);var b=v.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},x.prototype.sub=function(v,p){this._verify2(v,p);var b=v.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},x.prototype.isub=function(v,p){this._verify2(v,p);var b=v.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},x.prototype.shl=function(v,p){return this._verify1(v),this.imod(v.ushln(p))},x.prototype.imul=function(v,p){return this._verify2(v,p),this.imod(v.imul(p))},x.prototype.mul=function(v,p){return this._verify2(v,p),this.imod(v.mul(p))},x.prototype.isqr=function(v){return this.imul(v,v.clone())},x.prototype.sqr=function(v){return this.mul(v,v)},x.prototype.sqrt=function(v){if(v.isZero())return v.clone();var p=this.m.andln(3);if(o(p%2==1),p===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(v,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);o(!g.isZero());var k=new t(1).toRed(this),R=k.redNeg(),O=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,O).cmp(R)!==0;)z.redIAdd(R);for(var $=this.pow(z,g),W=this.pow(v,g.addn(1).iushrn(1)),j=this.pow(v,g),H=y;j.cmp(k)!==0;){for(var E=j,C=0;E.cmp(k)!==0;C++)E=E.redSqr();o(C=0;g--){for(var z=p.words[g],$=O-1;$>=0;$--){var W=z>>$&1;y!==b[0]&&(y=this.sqr(y)),W!==0||k!==0?(k<<=1,k|=W,(++R===4||g===0&&$===0)&&(y=this.mul(y,b[k]),R=0,k=0)):R=0}O=26}return y},x.prototype.convertTo=function(v){var p=v.umod(this.m);return p===v?p.clone():p},x.prototype.convertFrom=function(v){var p=v.clone();return p.red=null,p},t.mont=function(v){return new M(v)},r(M,x),M.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},M.prototype.convertFrom=function(v){var p=this.imod(v.mul(this.rinv));return p.red=null,p},M.prototype.imul=function(v,p){if(v.isZero()||p.isZero())return v.words[0]=0,v.length=1,v;var b=v.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(v,p){if(v.isZero()||p.isZero())return new t(0)._forceRed(this);var b=v.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(v){return this.imod(v._invmp(this.m).mul(this.r2))._forceRed(this)}})(T===void 0||T)},{buffer:188}],187:[function(s,T,S){var m;function a(r){this.rand=r}if(T.exports=function(r){return m||(m=new a(null)),m.generate(r)},T.exports.Rand=a,a.prototype.generate=function(r){return this._rand(r)},a.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e>>24]^N[D>>>16&255]^L[U>>>8&255]^I[255&B]^i[x++],h=A[D>>>24]^N[U>>>16&255]^L[B>>>8&255]^I[255&P]^i[x++],w=A[U>>>24]^N[B>>>16&255]^L[P>>>8&255]^I[255&D]^i[x++],_=A[B>>>24]^N[P>>>16&255]^L[D>>>8&255]^I[255&U]^i[x++],P=d,D=h,U=w,B=_;return d=(c[P>>>24]<<24|c[D>>>16&255]<<16|c[U>>>8&255]<<8|c[255&B])^i[x++],h=(c[D>>>24]<<24|c[U>>>16&255]<<16|c[B>>>8&255]<<8|c[255&P])^i[x++],w=(c[U>>>24]<<24|c[B>>>16&255]<<16|c[P>>>8&255]<<8|c[255&D])^i[x++],_=(c[B>>>24]<<24|c[P>>>16&255]<<16|c[D>>>8&255]<<8|c[255&U])^i[x++],[d>>>=0,h>>>=0,w>>>=0,_>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],e=function(){for(var n=new Array(256),i=0;i<256;i++)n[i]=i<128?i<<1:i<<1^283;for(var f=[],c=[],u=[[],[],[],[]],d=[[],[],[],[]],h=0,w=0,_=0;_<256;++_){var A=w^w<<1^w<<2^w<<3^w<<4;A=A>>>8^255&A^99,f[h]=A,c[A]=h;var N=n[h],L=n[N],I=n[L],P=257*n[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*I^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=w=1:(h=N^n[n[n[I^N]]],w^=n[n[w]])}return{SBOX:f,INV_SBOX:c,SUB_MIX:u,INV_SUB_MIX:d}}();function l(n){this._key=a(n),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var n=this._key,i=n.length,f=i+6,c=4*(f+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 w=[],_=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=f,this._keySchedule=u,this._invKeySchedule=w},l.prototype.encryptBlockRaw=function(n){return r(n=a(n),this._keySchedule,e.SUB_MIX,e.SBOX,this._nRounds)},l.prototype.encryptBlock=function(n){var i=this.encryptBlockRaw(n),f=m.allocUnsafe(16);return f.writeUInt32BE(i[0],0),f.writeUInt32BE(i[1],4),f.writeUInt32BE(i[2],8),f.writeUInt32BE(i[3],12),f},l.prototype.decryptBlock=function(n){var i=(n=a(n))[1];n[1]=n[3],n[3]=i;var f=r(n,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX,this._nRounds),c=m.allocUnsafe(16);return c.writeUInt32BE(f[0],0),c.writeUInt32BE(f[3],4),c.writeUInt32BE(f[2],8),c.writeUInt32BE(f[1],12),c},l.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},T.exports.AES=l},{"safe-buffer":494}],190:[function(s,T,S){var m=s("./aes"),a=s("safe-buffer").Buffer,o=s("cipher-base"),r=s("inherits"),t=s("./ghash"),e=s("buffer-xor"),l=s("./incr32");function n(i,f,c,u){o.call(this);var d=a.alloc(4,0);this._cipher=new m.AES(f);var h=this._cipher.encryptBlock(d);this._ghash=new t(h),c=function(w,_,A){if(_.length===12)return w._finID=a.concat([_,a.from([0,0,0,1])]),a.concat([_,a.from([0,0,0,2])]);var N=new t(A),L=_.length,I=L%16;N.update(_),I&&(I=16-I,N.update(a.alloc(I,0))),N.update(a.alloc(8,0));var P=8*L,D=a.alloc(8);D.writeUIntBE(P,0,8),N.update(D),w._finID=N.state;var U=a.from(w._finID);return l(U),U}(this,c,h),this._prev=a.from(c),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}r(n,o),n.prototype._update=function(i){if(!this._called&&this._alen){var f=16-this._alen%16;f<16&&(f=a.alloc(f,0),this._ghash.update(f))}this._called=!0;var c=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(c),this._len+=i.length,c},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var i=e(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(f,c){var u=0;f.length!==c.length&&u++;for(var d=Math.min(f.length,c.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(c,u){var d=o[c.toLowerCase()];if(!d)throw new TypeError("invalid suite type");var h=l(u,!1,d.key,d.iv);return f(c,h.key,h.iv)},S.createDecipheriv=f},{"./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"),a=s("./authCipher"),o=s("safe-buffer").Buffer,r=s("./streamCipher"),t=s("cipher-base"),e=s("./aes"),l=s("evp_bytestokey");function n(u,d,h){t.call(this),this._cache=new f,this._cipher=new e.AES(d),this._prev=o.from(h),this._mode=u,this._autopadding=!0}s("inherits")(n,t),n.prototype._update=function(u){var d,h;this._cache.add(u);for(var w=[];d=this._cache.get();)h=this._mode.encrypt(this,d),w.push(h);return o.concat(w)};var i=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function c(u,d,h){var w=m[u.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof d=="string"&&(d=o.from(d)),d.length!==w.key/8)throw new TypeError("invalid key length "+d.length);if(typeof h=="string"&&(h=o.from(h)),w.mode!=="GCM"&&h.length!==w.iv)throw new TypeError("invalid iv length "+h.length);return w.type==="stream"?new r(w.module,d,h):w.type==="auth"?new a(w.module,d,h):new n(w.module,d,h)}n.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")},n.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},f.prototype.add=function(u){this.cache=o.concat([this.cache,u])},f.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},f.prototype.flush=function(){for(var u=16-this.cache.length,d=o.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 r(t){this.h=t,this.state=m.alloc(16,0),this.cache=m.allocUnsafe(0)}r.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,l&&(n[0]=n[0]^225<<24)}this.state=o(i)},r.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)},r.prototype.final=function(t,e){return this.cache.length&&this.ghash(m.concat([this.cache,a],16)),this.ghash(o([0,t,0,e])),this.state},T.exports=r},{"safe-buffer":494}],195:[function(s,T,S){T.exports=function(m){for(var a,o=m.length;o--;){if((a=m.readUInt8(o))!==255){a++,m.writeUInt8(a,o);break}m.writeUInt8(0,o)}}},{}],196:[function(s,T,S){var m=s("buffer-xor");S.encrypt=function(a,o){var r=m(o,a._prev);return a._prev=a._cipher.encryptBlock(r),a._prev},S.decrypt=function(a,o){var r=a._prev;a._prev=o;var t=a._cipher.decryptBlock(o);return m(t,r)}},{"buffer-xor":219}],197:[function(s,T,S){var m=s("safe-buffer").Buffer,a=s("buffer-xor");function o(r,t,e){var l=t.length,n=a(t,r._cache);return r._cache=r._cache.slice(l),r._prev=m.concat([r._prev,e?t:n]),n}S.encrypt=function(r,t,e){for(var l,n=m.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=m.allocUnsafe(0)),!(r._cache.length<=t.length)){n=m.concat([n,o(r,t,e)]);break}l=r._cache.length,n=m.concat([n,o(r,t.slice(0,l),e)]),t=t.slice(l)}return n}},{"buffer-xor":219,"safe-buffer":494}],198:[function(s,T,S){var m=s("safe-buffer").Buffer;function a(r,t,e){for(var l,n,i=-1,f=0;++i<8;)l=t&1<<7-i?128:0,f+=(128&(n=r._cipher.encryptBlock(r._prev)[0]^l))>>i%8,r._prev=o(r._prev,e?l:n);return f}function o(r,t){var e=r.length,l=-1,n=m.allocUnsafe(r.length);for(r=m.concat([r,m.from([t])]);++l>7;return n}S.encrypt=function(r,t,e){for(var l=t.length,n=m.allocUnsafe(l),i=-1;++i=0||!l.umod(e.prime1)||!l.umod(e.prime2));return l}function t(e,l){var n=function(L){var I=r(L);return{blinder:I.toRed(a.mont(L.modulus)).redPow(new a(L.publicExponent)).fromRed(),unblinder:I.invm(L.modulus)}}(l),i=l.modulus.byteLength(),f=new a(e).mul(n.blinder).umod(l.modulus),c=f.toRed(a.mont(l.prime1)),u=f.toRed(a.mont(l.prime2)),d=l.coefficient,h=l.prime1,w=l.prime2,_=c.redPow(l.exponent1).fromRed(),A=u.redPow(l.exponent2).fromRed(),N=_.isub(A).imul(d).umod(h).imul(w);return A.iadd(N).imul(n.unblinder).umod(l.modulus).toArrayLike(m,"be",i)}t.getr=r,T.exports=t}).call(this)}).call(this,s("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(s,T,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,a=s("create-hash"),o=s("readable-stream"),r=s("inherits"),t=s("./sign"),e=s("./verify"),l=s("./algorithms.json");function n(u){o.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hashType=d.hash,this._hash=a(d.hash),this._tag=d.id,this._signType=d.sign}function i(u){o.Writable.call(this);var d=l[u];if(!d)throw new Error("Unknown message digest");this._hash=a(d.hash),this._tag=d.id,this._signType=d.sign}function f(u){return new n(u)}function c(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]}),r(n,o.Writable),n.prototype._write=function(u,d,h){this._hash.update(u),h()},n.prototype.update=function(u,d){return typeof u=="string"&&(u=m.from(u,d)),this._hash.update(u),this},n.prototype.sign=function(u,d){this.end();var h=this._hash.digest(),w=t(h,u,this._hashType,this._signType,this._tag);return d?w.toString(d):w},r(i,o.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 w=this._hash.digest();return e(d,w,u,this._signType,this._tag)},T.exports={Sign:f,Verify:c,createSign:f,createVerify:c}},{"./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,a=s("create-hmac"),o=s("browserify-rsa"),r=s("elliptic").ec,t=s("bn.js"),e=s("parse-asn1"),l=s("./curves.json");function n(u,d,h,w){if((u=m.from(u.toArray())).length0&&h.ishrn(w),h}function f(u,d,h){var w,_;do{for(w=m.alloc(0);8*w.length=n)throw new Error("invalid sig")}T.exports=function(l,n,i,f,c){var u=r(i);if(u.type==="ec"){if(f!=="ecdsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,I,P){var D=t[P.data.algorithm.curve.join(".")];if(!D)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var U=new o(D),B=P.data.subjectPrivateKey.data;return U.verify(I,L,B)}(l,n,u)}if(u.type==="dsa"){if(f!=="dsa")throw new Error("wrong public key type");return function(L,I,P){var D=P.data.p,U=P.data.q,B=P.data.g,x=P.data.pub_key,M=r.signature.decode(L,"der"),v=M.s,p=M.r;e(v,U),e(p,U);var b=a.mont(D),g=v.invm(U);return B.toRed(b).redPow(new a(I).mul(g).mod(U)).fromRed().mul(x.toRed(b).redPow(p.mul(g).mod(U)).fromRed()).mod(D).mod(U).cmp(p)===0}(l,n,u)}if(f!=="rsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");n=m.concat([c,n]);for(var d=u.modulus.byteLength(),h=[1],w=0;n.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(w,_,A){if((192&_[0])!=128)return w.lastNeed=0,"�";if(w.lastNeed>1&&_.length>1){if((192&_[1])!=128)return w.lastNeed=1,"�";if(w.lastNeed>2&&_.length>2&&(192&_[2])!=128)return w.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 w=h.charCodeAt(h.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],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 n(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 f(u){return u.toString(this.encoding)}function c(u){return u&&u.length?this.write(u):""}S.StringDecoder=o,o.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?(I>0&&(_.lastNeed=I-1),I):--L=0?(I>0&&(_.lastNeed=I-2),I):--L=0?(I>0&&(I===2?I=0:_.lastNeed=I-3),I):0}(this,u,d);if(!this.lastNeed)return u.toString("utf8",d);this.lastTotal=h;var w=u.length-(h-this.lastNeed);return u.copy(this.lastChar,0,w),u.toString("utf8",d,w)},o.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(a,o){for(var r=Math.min(a.length,o.length),t=new m(r),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 n(E)}return e(E,C,F)}function e(E,C,F){if(typeof E=="string")return function(q,K){if(typeof K=="string"&&K!==""||(K="utf8"),!t.isEncoding(K))throw new TypeError("Unknown encoding: "+K);var et=0|c(q,K),tt=r(et),X=tt.write(q,K);return X!==et&&(tt=tt.slice(0,X)),tt}(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(j(E,ArrayBuffer)||E&&j(E.buffer,ArrayBuffer))return function(q,K,et){if(K<0||q.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|E}function c(E,C){if(t.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||j(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 $(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 U(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 v(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),H(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:w(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):w(E,[C],F,V,Y);throw new TypeError("val must be string, number or Buffer")}function w(E,C,F,V,Y){var q,K=1,et=E.length,tt=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,et/=2,tt/=2,F/=2}function X(rt,st){return K===1?rt[st]:rt.readUInt16BE(st*K)}if(Y){var J=-1;for(q=F;qet&&(F=et-tt),q=F;q>=0;q--){for(var G=!0,nt=0;ntY&&(V=Y):V=Y;var q=C.length;V>q/2&&(V=q/2);for(var K=0;K>8,tt=K%256,X.push(tt),X.push(et);return X}(C,E.length-F),E,F,V)}function D(E,C,F){return C===0&&F===E.length?a.fromByteArray(E):a.fromByteArray(E.slice(C,F))}function U(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&(q=E[Y+1]))==128&&(tt=(31&X)<<6|63&q)>127&&(J=tt);break;case 3:q=E[Y+1],K=E[Y+2],(192&q)==128&&(192&K)==128&&(tt=(15&X)<<12|(63&q)<<6|63&K)>2047&&(tt<55296||tt>57343)&&(J=tt);break;case 4:q=E[Y+1],K=E[Y+2],et=E[Y+3],(192&q)==128&&(192&K)==128&&(192&et)==128&&(tt=(15&X)<<18|(63&q)<<12|(63&K)<<6|63&et)>65535&&tt<1114112&&(J=tt)}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="",ot=0;ot"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(E,C,F){return e(E,C,F)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(E,C,F){return function(V,Y,q){return l(V),V<=0?r(V):Y!==void 0?typeof q=="string"?r(V).fill(Y,q):r(V).fill(Y):r(V)}(E,C,F)},t.allocUnsafe=function(E){return n(E)},t.allocUnsafeSlow=function(E){return n(E)},t.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==t.prototype},t.compare=function(E,C){if(j(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),j(C,Uint8Array)&&(C=t.from(C,C.offset,C.byteLength)),!t.isBuffer(E)||!t.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===C)return 0;for(var F=E.length,V=C.length,Y=0,q=Math.min(F,V);YC&&(E+=" ... "),""},t.prototype.compare=function(E,C,F,V,Y){if(j(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 q=(Y>>>=0)-(V>>>=0),K=(F>>>=0)-(C>>>=0),et=Math.min(q,K),tt=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 q=!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 I(this,E,C,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,E,C,F);default:if(q)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),q=!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="",q=C;qF)throw new RangeError("Trying to access beyond buffer length")}function b(E,C,F,V,Y,q){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,q){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),o.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),o.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,q=0;++q>>=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,q=0;++q=(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,q=this[E+--V];V>0&&(Y*=256);)q+=this[E+--V]*Y;return q>=(Y*=128)&&(q-=Math.pow(2,8*C)),q},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),o.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,C){return E>>>=0,C||p(E,4,this.length),o.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,C){return E>>>=0,C||p(E,8,this.length),o.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,C){return E>>>=0,C||p(E,8,this.length),o.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,q=0;for(this[C]=255&E;++q>>=0,F>>>=0,V||b(this,E,C,F,Math.pow(2,8*F)-1,0);var Y=F-1,q=1;for(this[C+Y]=255&E;--Y>=0&&(q*=256);)this[C+Y]=E/q&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 q=0,K=1,et=0;for(this[C]=255&E;++q>0)-et&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 q=F-1,K=1,et=0;for(this[C+q]=255&E;--q>=0&&(K*=256);)E<0&&et===0&&this[C+q+1]!==0&&(et=1),this[C+q]=(E/K>>0)-et&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;--q)E[q+C]=this[q+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(q=C;q55295&&F<57344){if(!Y){if(F>56319){(C-=3)>-1&&q.push(239,191,189);continue}if(K+1===V){(C-=3)>-1&&q.push(239,191,189);continue}Y=F;continue}if(F<56320){(C-=3)>-1&&q.push(239,191,189),Y=F;continue}F=65536+(Y-55296<<10|F-56320)}else Y&&(C-=3)>-1&&q.push(239,191,189);if(Y=null,F<128){if((C-=1)<0)break;q.push(F)}else if(F<2048){if((C-=2)<0)break;q.push(F>>6|192,63&F|128)}else if(F<65536){if((C-=3)<0)break;q.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;q.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|128)}}return q}function $(E){return a.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 W(E,C,F,V){for(var Y=0;Y=C.length||Y>=E.length);++Y)C[Y+F]=E[Y];return Y}function j(E,C){return E instanceof C||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===C.name}function H(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,a=s("stream").Transform,o=s("string_decoder").StringDecoder;function r(t){a.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}s("inherits")(r,a),r.prototype.update=function(t,e,l){typeof t=="string"&&(t=m.from(t,e));var n=this._update(t);return this.hashMode?this:(l&&(n=this._toString(n,l)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,e,l){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{l(n)}},r.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(l){e=l}t(e)},r.prototype._finalOrDigest=function(t){var e=this.__final()||m.alloc(0);return t&&(e=this._toString(e,t,!0)),e},r.prototype._toString=function(t,e,l){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return l&&(n+=this._decoder.end()),n},T.exports=r},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(s,T,S){var m=s("../internals/is-callable"),a=s("../internals/try-to-string"),o=TypeError;T.exports=function(r){if(m(r))return r;throw new o(a(r)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(s,T,S){var m=s("../internals/is-constructor"),a=s("../internals/try-to-string"),o=TypeError;T.exports=function(r){if(m(r))return r;throw new o(a(r)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(s,T,S){var m=s("../internals/is-callable"),a=String,o=TypeError;T.exports=function(r){if(typeof r=="object"||m(r))return r;throw new o("Can't set "+a(r)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(s,T,S){var m=s("../internals/well-known-symbol"),a=s("../internals/object-create"),o=s("../internals/object-define-property").f,r=m("unscopables"),t=Array.prototype;t[r]===void 0&&o(t,r,{configurable:!0,value:a(null)}),T.exports=function(e){t[r][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(s,T,S){var m=s("../internals/object-is-prototype-of"),a=TypeError;T.exports=function(o,r){if(m(r,o))return o;throw new a("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(s,T,S){var m=s("../internals/is-object"),a=String,o=TypeError;T.exports=function(r){if(m(r))return r;throw new o(a(r)+" is not an object")}},{"../internals/is-object":289}],228:[function(s,T,S){var m=s("../internals/to-indexed-object"),a=s("../internals/to-absolute-index"),o=s("../internals/length-of-array-like"),r=function(t){return function(e,l,n){var i,f=m(e),c=o(f),u=a(n,c);if(t&&l!=l){for(;c>u;)if((i=f[u++])!=i)return!0}else for(;c>u;u++)if((t||u in f)&&f[u]===l)return t||u||0;return!t&&-1}};T.exports={includes:r(!0),indexOf:r(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(s,T,S){var m=s("../internals/function-bind-context"),a=s("../internals/function-uncurry-this"),o=s("../internals/indexed-object"),r=s("../internals/to-object"),t=s("../internals/length-of-array-like"),e=s("../internals/array-species-create"),l=a([].push),n=function(i){var f=i===1,c=i===2,u=i===3,d=i===4,h=i===6,w=i===7,_=i===5||h;return function(A,N,L,I){for(var P,D,U=r(A),B=o(U),x=m(N,L),M=t(B),v=0,p=I||e,b=f?p(A,M):c||w?p(A,0):void 0;M>v;v++)if((_||v in B)&&(D=x(P=B[v],v,U),i))if(f)b[v]=D;else if(D)switch(i){case 3:return!0;case 5:return P;case 6:return v;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:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6),filterReject:n(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(s,T,S){var m=s("../internals/to-absolute-index"),a=s("../internals/length-of-array-like"),o=s("../internals/create-property"),r=Array,t=Math.max;T.exports=function(e,l,n){for(var i=a(e),f=m(l,i),c=m(n===void 0?i:n,i),u=r(t(c-f,0)),d=0;f0&&m[0]<4?1:+(m[0]+m[1])),!a&&r&&(!(m=r.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=r.match(/Chrome\/(\d+)/))&&(a=+m[1]),T.exports=a},{"../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"),a=s("../internals/object-get-own-property-descriptor").f,o=s("../internals/create-non-enumerable-property"),r=s("../internals/define-built-in"),t=s("../internals/define-global-property"),e=s("../internals/copy-constructor-properties"),l=s("../internals/is-forced");T.exports=function(n,i){var f,c,u,d,h,w=n.target,_=n.global,A=n.stat;if(f=_?m:A?m[w]||t(w,{}):(m[w]||{}).prototype)for(c in i){if(d=i[c],u=n.dontCallGetSet?(h=a(f,c))&&h.value:f[c],!l(_?c:w+(A?".":"#")+c,n.forced)&&u!==void 0){if(typeof d==typeof u)continue;e(d,u)}(n.sham||u&&u.sham)&&o(d,"sham",!0),r(f,c,d,n)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(s,T,S){T.exports=function(m){try{return!!m()}catch{return!0}}},{}],261:[function(s,T,S){var m=s("../internals/function-bind-native"),a=Function.prototype,o=a.apply,r=a.call;T.exports=typeof Reflect=="object"&&Reflect.apply||(m?r.bind(o):function(){return r.apply(o,arguments)})},{"../internals/function-bind-native":263}],262:[function(s,T,S){var m=s("../internals/function-uncurry-this-clause"),a=s("../internals/a-callable"),o=s("../internals/function-bind-native"),r=m(m.bind);T.exports=function(t,e){return a(t),e===void 0?t:o?r(t,e):function(){return t.apply(e,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(s,T,S){var m=s("../internals/fails");T.exports=!m(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(s,T,S){var m=s("../internals/function-bind-native"),a=Function.prototype.call;T.exports=m?a.bind(a):function(){return a.apply(a,arguments)}},{"../internals/function-bind-native":263}],265:[function(s,T,S){var m=s("../internals/descriptors"),a=s("../internals/has-own-property"),o=Function.prototype,r=m&&Object.getOwnPropertyDescriptor,t=a(o,"name"),e=t&&(function(){}).name==="something",l=t&&(!m||m&&r(o,"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"),a=s("../internals/a-callable");T.exports=function(o,r,t){try{return m(a(Object.getOwnPropertyDescriptor(o,r)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(s,T,S){var m=s("../internals/classof-raw"),a=s("../internals/function-uncurry-this");T.exports=function(o){if(m(o)==="Function")return a(o)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(s,T,S){var m=s("../internals/function-bind-native"),a=Function.prototype,o=a.call,r=m&&a.bind.bind(o,o);T.exports=m?r:function(t){return function(){return o.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(s,T,S){var m=s("../internals/global"),a=s("../internals/is-callable"),o=function(r){return a(r)?r:void 0};T.exports=function(r,t){return arguments.length<2?o(m[r]):m[r]&&m[r][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(s,T,S){var m=s("../internals/classof"),a=s("../internals/get-method"),o=s("../internals/is-null-or-undefined"),r=s("../internals/iterators"),t=s("../internals/well-known-symbol")("iterator");T.exports=function(e){if(!o(e))return a(e,t)||a(e,"@@iterator")||r[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"),a=s("../internals/a-callable"),o=s("../internals/an-object"),r=s("../internals/try-to-string"),t=s("../internals/get-iterator-method"),e=TypeError;T.exports=function(l,n){var i=arguments.length<2?t(l):n;if(a(i))return o(m(i,l));throw new e(r(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(s,T,S){var m=s("../internals/function-uncurry-this"),a=s("../internals/is-array"),o=s("../internals/is-callable"),r=s("../internals/classof-raw"),t=s("../internals/to-string"),e=m([].push);T.exports=function(l){if(o(l))return l;if(a(l)){for(var n=l.length,i=[],f=0;fL;L++)if((P=y(h[L]))&&l(d,P))return P;return new u(!1)}A=n(h,N)}for(D=M?h.next:A.next;!(U=a(D,A)).done;){try{P=y(U.value)}catch(k){f(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"),a=s("../internals/an-object"),o=s("../internals/get-method");T.exports=function(r,t,e){var l,n;a(r);try{if(!(l=o(r,"return"))){if(t==="throw")throw e;return e}l=m(l,r)}catch(i){n=!0,l=i}if(t==="throw")throw e;if(n)throw l;return a(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,a=s("../internals/object-create"),o=s("../internals/create-property-descriptor"),r=s("../internals/set-to-string-tag"),t=s("../internals/iterators"),e=function(){return this};T.exports=function(l,n,i,f){var c=n+" Iterator";return l.prototype=a(m,{next:o(+!f,i)}),r(l,c,!1,!0),t[c]=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"),a=s("../internals/function-call"),o=s("../internals/is-pure"),r=s("../internals/function-name"),t=s("../internals/is-callable"),e=s("../internals/iterator-create-constructor"),l=s("../internals/object-get-prototype-of"),n=s("../internals/object-set-prototype-of"),i=s("../internals/set-to-string-tag"),f=s("../internals/create-non-enumerable-property"),c=s("../internals/define-built-in"),u=s("../internals/well-known-symbol"),d=s("../internals/iterators"),h=s("../internals/iterators-core"),w=r.PROPER,_=r.CONFIGURABLE,A=h.IteratorPrototype,N=h.BUGGY_SAFARI_ITERATORS,L=u("iterator"),I=function(){return this};T.exports=function(P,D,U,B,x,M,v){e(U,D,B);var p,b,g,y=function(j){if(j===x&&$)return $;if(!N&&j&&j in O)return O[j];switch(j){case"keys":case"values":case"entries":return function(){return new U(this,j)}}return function(){return new U(this)}},k=D+" Iterator",R=!1,O=P.prototype,z=O[L]||O["@@iterator"]||x&&O[x],$=!N&&z||y(x),W=D==="Array"&&O.entries||z;if(W&&(p=l(W.call(new P)))!==Object.prototype&&p.next&&(o||l(p)===A||(n?n(p,A):t(p[L])||c(p,L,I)),i(p,k,!0,!0),o&&(d[k]=I)),w&&x==="values"&&z&&z.name!=="values"&&(!o&&_?f(O,"name","values"):(R=!0,$=function(){return a(z,this)})),x)if(b={values:y("values"),keys:M?$:y("keys"),entries:y("entries")},v)for(g in b)(N||R||!(g in O))&&c(O,g,b[g]);else m({target:D,proto:!0,forced:N||R},b);return o&&!v||O[L]===$||c(O,L,$,{name:x}),d[D]=$,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,a,o,r=s("../internals/fails"),t=s("../internals/is-callable"),e=s("../internals/is-object"),l=s("../internals/object-create"),n=s("../internals/object-get-prototype-of"),i=s("../internals/define-built-in"),f=s("../internals/well-known-symbol"),c=s("../internals/is-pure"),u=f("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(a=n(n(o)))!==Object.prototype&&(m=a):d=!0),!e(m)||r(function(){var h={};return m[u].call(h)!==h})?m={}:c&&(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(a){return m(a.length)}},{"../internals/to-length":343}],300:[function(s,T,S){var m=s("../internals/function-uncurry-this"),a=s("../internals/fails"),o=s("../internals/is-callable"),r=s("../internals/has-own-property"),t=s("../internals/descriptors"),e=s("../internals/function-name").CONFIGURABLE,l=s("../internals/inspect-source"),n=s("../internals/internal-state"),i=n.enforce,f=n.get,c=String,u=Object.defineProperty,d=m("".slice),h=m("".replace),w=m([].join),_=t&&!a(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=T.exports=function(L,I,P){d(c(I),0,7)==="Symbol("&&(I="["+h(c(I),/^Symbol\(([^)]*)\)/,"$1")+"]"),P&&P.getter&&(I="get "+I),P&&P.setter&&(I="set "+I),(!r(L,"name")||e&&L.name!==I)&&(t?u(L,"name",{value:I,configurable:!0}):L.name=I),_&&P&&r(P,"arity")&&L.length!==P.arity&&u(L,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch{}var D=i(L);return r(D,"source")||(D.source=w(A,typeof I=="string"?I:"")),L};Function.prototype.toString=N(function(){return o(this)&&f(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,a=Math.floor;T.exports=Math.trunc||function(o){var r=+o;return(r>0?a:m)(r)}},{}],302:[function(s,T,S){var m,a,o,r,t,e=s("../internals/global"),l=s("../internals/function-bind-context"),n=s("../internals/object-get-own-property-descriptor").f,i=s("../internals/task").set,f=s("../internals/queue"),c=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"),w=e.MutationObserver||e.WebKitMutationObserver,_=e.document,A=e.process,N=e.Promise,L=n(e,"queueMicrotask"),I=L&&L.value;if(!I){var P=new f,D=function(){var U,B;for(h&&(U=A.domain)&&U.exit();B=P.get();)try{B()}catch(x){throw P.head&&m(),x}U&&U.enter()};c||h||d||!w||!_?!u&&N&&N.resolve?((r=N.resolve(void 0)).constructor=N,t=l(r.then,r),m=function(){t(D)}):h?m=function(){A.nextTick(D)}:(i=l(i,e),m=function(){i(D)}):(a=!0,o=_.createTextNode(""),new w(D).observe(o,{characterData:!0}),m=function(){o.data=a=!a}),I=function(U){P.head||m(),P.add(U)}}T.exports=I},{"../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"),a=TypeError,o=function(r){var t,e;this.promise=new r(function(l,n){if(t!==void 0||e!==void 0)throw new a("Bad Promise constructor");t=l,e=n}),this.resolve=m(t),this.reject=m(e)};T.exports.f=function(r){return new o(r)}},{"../internals/a-callable":222}],304:[function(s,T,S){var m=s("../internals/is-regexp"),a=TypeError;T.exports=function(o){if(m(o))throw new a("The method doesn't accept regular expressions");return o}},{"../internals/is-regexp":291}],305:[function(s,T,S){var m=s("../internals/descriptors"),a=s("../internals/function-uncurry-this"),o=s("../internals/function-call"),r=s("../internals/fails"),t=s("../internals/object-keys"),e=s("../internals/object-get-own-property-symbols"),l=s("../internals/object-property-is-enumerable"),n=s("../internals/to-object"),i=s("../internals/indexed-object"),f=Object.assign,c=Object.defineProperty,u=a([].concat);T.exports=!f||r(function(){if(m&&f({b:1},f(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},h={},w=Symbol("assign detection");return d[w]=7,"abcdefghijklmnopqrst".split("").forEach(function(_){h[_]=_}),f({},d)[w]!==7||t(f({},h)).join("")!=="abcdefghijklmnopqrst"})?function(d,h){for(var w=n(d),_=arguments.length,A=1,N=e.f,L=l.f;_>A;)for(var I,P=i(arguments[A++]),D=N?u(t(P),N(P)):t(P),U=D.length,B=0;U>B;)I=D[B++],m&&!o(L,P,I)||(w[I]=P[I]);return w}:f},{"../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,a=s("../internals/an-object"),o=s("../internals/object-define-properties"),r=s("../internals/enum-bug-keys"),t=s("../internals/hidden-keys"),e=s("../internals/html"),l=s("../internals/document-create-element"),n=s("../internals/shared-key"),i=n("IE_PROTO"),f=function(){},c=function(h){return" + + + + + + + + + +
+ + diff --git a/manifest.json b/manifest.json new file mode 100755 index 0000000..3b84c2d --- /dev/null +++ b/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "iCTI", + "name": "CTI Santé - iCTI", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/meta.json b/meta.json new file mode 100755 index 0000000..b6ebd7e --- /dev/null +++ b/meta.json @@ -0,0 +1 @@ +{"version":"24.6.13"} \ No newline at end of file diff --git a/pyramide.svg b/pyramide.svg new file mode 100755 index 0000000..5e7dc0b --- /dev/null +++ b/pyramide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100755 index 0000000..01b0f9a --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * diff --git a/svg/icons/Information.svg b/svg/icons/Information.svg new file mode 100644 index 0000000..d181bc8 --- /dev/null +++ b/svg/icons/Information.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/icons/filter.svg b/svg/icons/filter.svg new file mode 100644 index 0000000..aa74bc0 --- /dev/null +++ b/svg/icons/filter.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/icons/filterOutline.svg b/svg/icons/filterOutline.svg new file mode 100644 index 0000000..6ca57e1 --- /dev/null +++ b/svg/icons/filterOutline.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/icons/home-outline.svg b/svg/icons/home-outline.svg new file mode 100644 index 0000000..0336012 --- /dev/null +++ b/svg/icons/home-outline.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/svg/icons/home.svg b/svg/icons/home.svg new file mode 100644 index 0000000..7c8fe87 --- /dev/null +++ b/svg/icons/home.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/icons/hospital.svg b/svg/icons/hospital.svg new file mode 100644 index 0000000..96c1196 --- /dev/null +++ b/svg/icons/hospital.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/svg/icons/notificationsOutline.svg b/svg/icons/notificationsOutline.svg new file mode 100644 index 0000000..f16eb06 --- /dev/null +++ b/svg/icons/notificationsOutline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/icons/peopleOutline.svg b/svg/icons/peopleOutline.svg new file mode 100644 index 0000000..04d79fa --- /dev/null +++ b/svg/icons/peopleOutline.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/icons/person-circle-outline.svg b/svg/icons/person-circle-outline.svg new file mode 100644 index 0000000..dc0bbbc --- /dev/null +++ b/svg/icons/person-circle-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/icons/synthesis-outline.svg b/svg/icons/synthesis-outline.svg new file mode 100644 index 0000000..e0909ad --- /dev/null +++ b/svg/icons/synthesis-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/logo/cti-logo-long_white.svg b/svg/logo/cti-logo-long_white.svg new file mode 100644 index 0000000..b8c7e86 --- /dev/null +++ b/svg/logo/cti-logo-long_white.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/svg/logo/cti-logo_long_dark.svg b/svg/logo/cti-logo_long_dark.svg new file mode 100755 index 0000000..40d35a5 --- /dev/null +++ b/svg/logo/cti-logo_long_dark.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/svg/logo/cti-logo_long_grey_with_pyramide.svg b/svg/logo/cti-logo_long_grey_with_pyramide.svg new file mode 100755 index 0000000..7e7035b --- /dev/null +++ b/svg/logo/cti-logo_long_grey_with_pyramide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svg/module/activite-logo-outline.svg b/svg/module/activite-logo-outline.svg new file mode 100644 index 0000000..cd0f424 --- /dev/null +++ b/svg/module/activite-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/activite-logo.svg b/svg/module/activite-logo.svg new file mode 100644 index 0000000..523fe8d --- /dev/null +++ b/svg/module/activite-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/compta-logo-outline.svg b/svg/module/compta-logo-outline.svg new file mode 100644 index 0000000..8cfe432 --- /dev/null +++ b/svg/module/compta-logo-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/svg/module/compta-logo.svg b/svg/module/compta-logo.svg new file mode 100644 index 0000000..1d4ee22 --- /dev/null +++ b/svg/module/compta-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/default-module-logo-outline.svg b/svg/module/default-module-logo-outline.svg new file mode 100644 index 0000000..db8d2d2 --- /dev/null +++ b/svg/module/default-module-logo-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/svg/module/default-module-logo.svg b/svg/module/default-module-logo.svg new file mode 100644 index 0000000..3e41f32 --- /dev/null +++ b/svg/module/default-module-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/dpi-logo-outline.svg b/svg/module/dpi-logo-outline.svg new file mode 100644 index 0000000..48d6b05 --- /dev/null +++ b/svg/module/dpi-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/dpi-logo.svg b/svg/module/dpi-logo.svg new file mode 100644 index 0000000..4cb918d --- /dev/null +++ b/svg/module/dpi-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/eco-logo-outline.svg b/svg/module/eco-logo-outline.svg new file mode 100644 index 0000000..b534a84 --- /dev/null +++ b/svg/module/eco-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/eco-logo.svg b/svg/module/eco-logo.svg new file mode 100644 index 0000000..87d52b7 --- /dev/null +++ b/svg/module/eco-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/eis-logo-outline.svg b/svg/module/eis-logo-outline.svg new file mode 100644 index 0000000..28b91a9 --- /dev/null +++ b/svg/module/eis-logo-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/svg/module/eis-logo.svg b/svg/module/eis-logo.svg new file mode 100644 index 0000000..927991c --- /dev/null +++ b/svg/module/eis-logo.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/svg/module/favorite-logo-outline.svg b/svg/module/favorite-logo-outline.svg new file mode 100644 index 0000000..6cce898 --- /dev/null +++ b/svg/module/favorite-logo-outline.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/favorite-logo.svg b/svg/module/favorite-logo.svg new file mode 100644 index 0000000..7108bba --- /dev/null +++ b/svg/module/favorite-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/had-logo-outline.svg b/svg/module/had-logo-outline.svg new file mode 100644 index 0000000..d10469d --- /dev/null +++ b/svg/module/had-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/had-logo.svg b/svg/module/had-logo.svg new file mode 100644 index 0000000..a723217 --- /dev/null +++ b/svg/module/had-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/mco-logo-outline.svg b/svg/module/mco-logo-outline.svg new file mode 100644 index 0000000..e951338 --- /dev/null +++ b/svg/module/mco-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/mco-logo.svg b/svg/module/mco-logo.svg new file mode 100644 index 0000000..4275002 --- /dev/null +++ b/svg/module/mco-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/psy-logo-outline.svg b/svg/module/psy-logo-outline.svg new file mode 100644 index 0000000..d6f725a --- /dev/null +++ b/svg/module/psy-logo-outline.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/svg/module/psy-logo.svg b/svg/module/psy-logo.svg new file mode 100644 index 0000000..d7c7168 --- /dev/null +++ b/svg/module/psy-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/qualite-logo-outline.svg b/svg/module/qualite-logo-outline.svg new file mode 100644 index 0000000..26a0247 --- /dev/null +++ b/svg/module/qualite-logo-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/svg/module/qualite-logo.svg b/svg/module/qualite-logo.svg new file mode 100644 index 0000000..f01a05d --- /dev/null +++ b/svg/module/qualite-logo.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/svg/module/rh-logo-outline.svg b/svg/module/rh-logo-outline.svg new file mode 100644 index 0000000..d04e51c --- /dev/null +++ b/svg/module/rh-logo-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/svg/module/rh-logo.svg b/svg/module/rh-logo.svg new file mode 100644 index 0000000..fa4773f --- /dev/null +++ b/svg/module/rh-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/ssae-logo-outline.svg b/svg/module/ssae-logo-outline.svg new file mode 100644 index 0000000..9cf4098 --- /dev/null +++ b/svg/module/ssae-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/ssae-logo.svg b/svg/module/ssae-logo.svg new file mode 100644 index 0000000..e023248 --- /dev/null +++ b/svg/module/ssae-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/ssr-logo-outline.svg b/svg/module/ssr-logo-outline.svg new file mode 100644 index 0000000..758d838 --- /dev/null +++ b/svg/module/ssr-logo-outline.svg @@ -0,0 +1,3 @@ + + + diff --git a/svg/module/ssr-logo.svg b/svg/module/ssr-logo.svg new file mode 100644 index 0000000..5d628d8 --- /dev/null +++ b/svg/module/ssr-logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/tools-logo-outline.svg b/svg/module/tools-logo-outline.svg new file mode 100644 index 0000000..587e6b3 --- /dev/null +++ b/svg/module/tools-logo-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/svg/module/tools-logo.svg b/svg/module/tools-logo.svg new file mode 100644 index 0000000..b23f06f --- /dev/null +++ b/svg/module/tools-logo.svg @@ -0,0 +1,3 @@ + + +