import{O as qt,P as Qe,ao as Ft}from"./index.2449c2f3.js";function Wt(Tt,Ut){return Ut.forEach(function(h){h&&typeof h!="string"&&!Array.isArray(h)&&Object.keys(h).forEach(function(I){if(I!=="default"&&!(I in Tt)){var T=Object.getOwnPropertyDescriptor(h,I);Object.defineProperty(Tt,I,T.get?T:{enumerable:!0,get:function(){return h[I]}})}})}),Object.freeze(Object.defineProperty(Tt,Symbol.toStringTag,{value:"Module"}))}var zt={exports:{}};/*! ExcelJS 21-08-2021 */(function(Tt,Ut){(function(h){Tt.exports=h()})(function(){return function h(I,T,b){function m(p,c){if(!T[p]){if(!I[p]){var l=typeof Ft=="function"&&Ft;if(!c&&l)return l(p,!0);if(v)return v(p,!0);var s=new Error("Cannot find module '"+p+"'");throw s.code="MODULE_NOT_FOUND",s}var i=T[p]={exports:{}};I[p][0].call(i.exports,function(e){return m(I[p][1][e]||e)},i,i.exports,h,I,T,b)}return T[p].exports}for(var v=typeof Ft=="function"&&Ft,d=0;d2&&arguments[2]!==void 0?arguments[2]:0;if(b(this,p),e)if(typeof e=="string"){var r=v.decodeAddress(e);this.nativeCol=r.col+t,this.nativeColOff=0,this.nativeRow=r.row+t,this.nativeRowOff=0}else e.nativeCol!==void 0?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):e.col!==void 0?(this.col=e.col+t,this.row=e.row+t):(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;this.worksheet=i}var c,l,s;return c=p,s=[{key:"asInstance",value:function(i){return i instanceof p||i==null?i:new p(i)}}],(l=[{key:"col",get:function(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth},set:function(i){this.nativeCol=Math.floor(i),this.nativeColOff=Math.floor((i-this.nativeCol)*this.colWidth)}},{key:"row",get:function(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight},set:function(i){this.nativeRow=Math.floor(i),this.nativeRowOff=Math.floor((i-this.nativeRow)*this.rowHeight)}},{key:"colWidth",get:function(){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}},{key:"rowHeight",get:function(){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}},{key:"model",get:function(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}},set:function(i){this.nativeCol=i.nativeCol,this.nativeColOff=i.nativeColOff,this.nativeRow=i.nativeRow,this.nativeRowOff=i.nativeRowOff}}])&&m(c.prototype,l),s&&m(c,s),p}();I.exports=d},{"../utils/col-cache":19}],3:[function(h,I,T){function b(O,P){if(!(O instanceof P))throw new TypeError("Cannot call a class as a function")}function m(O,P){for(var _=0;_0||this.type===O.Types.Merge}},{key:"master",get:function(){return this.type===O.Types.Merge?this._value.master:this}},{key:"isHyperlink",get:function(){return this._value.type===O.Types.Hyperlink}},{key:"hyperlink",get:function(){return this._value.hyperlink}},{key:"value",get:function(){return this._value.value},set:function(P){this.type!==O.Types.Merge?(this._value.release(),this._value=M.create(M.getType(P),this,P)):this._value.master.value=P}},{key:"note",get:function(){return this._comment&&this._comment.note},set:function(P){this._comment=new s(P)}},{key:"text",get:function(){return this._value.toString()}},{key:"html",get:function(){return p.escapeHtml(this.text)}},{key:"formula",get:function(){return this._value.formula}},{key:"result",get:function(){return this._value.result}},{key:"formulaType",get:function(){return this._value.formulaType}},{key:"fullAddress",get:function(){return{sheetName:this._row.worksheet.name,address:this.address,row:this.row,col:this.col}}},{key:"name",get:function(){return this.names[0]},set:function(P){this.names=[P]}},{key:"names",get:function(){return this.workbook.definedNames.getNamesEx(this.fullAddress)},set:function(P){var _=this,S=this.workbook.definedNames;S.removeAllNames(this.fullAddress),P.forEach(function(g){S.addEx(_.fullAddress,g)})}},{key:"_dataValidations",get:function(){return this.worksheet.dataValidations}},{key:"dataValidation",get:function(){return this._dataValidations.find(this.address)},set:function(P){this._dataValidations.add(this.address,P)}},{key:"model",get:function(){var P=this._value.model;return P.style=this.style,this._comment&&(P.comment=this._comment.model),P},set:function(P){if(this._value.release(),this._value=M.create(P.type,this),this._value.model=P,P.comment)switch(P.comment.type){case"note":this._comment=s.fromModel(P.comment)}P.style?this.style=P.style:this.style={}}}]),O}();i.Types=c.ValueType;var e=function(){function O(P){b(this,O),this.model={address:P.address,type:i.Types.Null}}return v(O,[{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){}},{key:"toString",value:function(){return""}},{key:"value",get:function(){return null},set:function(P){}},{key:"type",get:function(){return i.Types.Null}},{key:"effectiveType",get:function(){return i.Types.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),t=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Number,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Number}},{key:"effectiveType",get:function(){return i.Types.Number}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),r=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toCsvString",value:function(){return'"'.concat(this.model.value.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),o=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:_}}return v(O,[{key:"toString",value:function(){return this.model.value.richText.map(function(P){return P.text}).join("")}},{key:"toCsvString",value:function(){return'"'.concat(this.text.replace(/"/g,'""'),'"')}},{key:"release",value:function(){}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.RichText}},{key:"effectiveType",get:function(){return i.Types.RichText}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),n=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Date,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toISOString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Date}},{key:"effectiveType",get:function(){return i.Types.Date}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),a=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Hyperlink,text:_?_.text:void 0,hyperlink:_?_.hyperlink:void 0},_&&_.tooltip&&(this.model.tooltip=_.tooltip)}return v(O,[{key:"toCsvString",value:function(){return this.model.hyperlink}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.text}},{key:"value",get:function(){var P={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(P.tooltip=this.model.tooltip),P},set:function(P){this.model={text:P.text,hyperlink:P.hyperlink},P.tooltip&&(this.model.tooltip=P.tooltip)}},{key:"text",get:function(){return this.model.text},set:function(P){this.model.text=P}},{key:"hyperlink",get:function(){return this.model.hyperlink},set:function(P){this.model.hyperlink=P}},{key:"type",get:function(){return i.Types.Hyperlink}},{key:"effectiveType",get:function(){return i.Types.Hyperlink}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),u=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Merge,master:_?_.address:void 0},this._master=_,_&&_.addMergeRef()}return v(O,[{key:"isMergedTo",value:function(P){return P===this._master}},{key:"toCsvString",value:function(){return""}},{key:"release",value:function(){this._master.releaseMergeRef()}},{key:"toString",value:function(){return this.value.toString()}},{key:"value",get:function(){return this._master.value},set:function(P){P instanceof i?(this._master&&this._master.releaseMergeRef(),P.addMergeRef(),this._master=P):this._master.value=P}},{key:"master",get:function(){return this._master}},{key:"type",get:function(){return i.Types.Merge}},{key:"effectiveType",get:function(){return this._master.effectiveType}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),f=function(){function O(P,_){b(this,O),this.cell=P,this.model={address:P.address,type:i.Types.Formula,shareType:_?_.shareType:void 0,ref:_?_.ref:void 0,formula:_?_.formula:void 0,sharedFormula:_?_.sharedFormula:void 0,result:_?_.result:void 0}}return v(O,[{key:"_copyModel",value:function(P){var _={},S=function(g){var j=P[g];j&&(_[g]=j)};return S("formula"),S("result"),S("ref"),S("shareType"),S("sharedFormula"),_}},{key:"validate",value:function(P){switch(M.getType(P)){case i.Types.Null:case i.Types.String:case i.Types.Number:case i.Types.Date:break;case i.Types.Hyperlink:case i.Types.Formula:default:throw new Error("Cannot process that type of result value")}}},{key:"_getTranslatedFormula",value:function(){if(!this._translatedFormula&&this.model.sharedFormula){var P=this.cell.worksheet.findCell(this.model.sharedFormula);this._translatedFormula=P&&l(P.formula,P.address,this.model.address)}return this._translatedFormula}},{key:"toCsvString",value:function(){return"".concat(this.model.result||"")}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.result?this.model.result.toString():""}},{key:"value",get:function(){return this._copyModel(this.model)},set:function(P){this.model=this._copyModel(P)}},{key:"dependencies",get:function(){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)}}},{key:"formula",get:function(){return this.model.formula||this._getTranslatedFormula()},set:function(P){this.model.formula=P}},{key:"formulaType",get:function(){return this.model.formula?c.FormulaType.Master:this.model.sharedFormula?c.FormulaType.Shared:c.FormulaType.None}},{key:"result",get:function(){return this.model.result},set:function(P){this.model.result=P}},{key:"type",get:function(){return i.Types.Formula}},{key:"effectiveType",get:function(){var P=this.model.result;return P==null?c.ValueType.Null:P instanceof String||typeof P=="string"?c.ValueType.String:typeof P=="number"?c.ValueType.Number:P instanceof Date?c.ValueType.Date:P.text&&P.hyperlink?c.ValueType.Hyperlink:P.formula?c.ValueType.Formula:c.ValueType.Null}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),y=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.SharedString,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.SharedString}},{key:"effectiveType",get:function(){return i.Types.SharedString}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),w=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Boolean,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value?1:0}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Boolean}},{key:"effectiveType",get:function(){return i.Types.Boolean}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),R=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.Error,value:_}}return v(O,[{key:"toCsvString",value:function(){return this.toString()}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value.error.toString()}},{key:"value",get:function(){return this.model.value},set:function(P){this.model.value=P}},{key:"type",get:function(){return i.Types.Error}},{key:"effectiveType",get:function(){return i.Types.Error}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),E=function(){function O(P,_){b(this,O),this.model={address:P.address,type:i.Types.String,value:JSON.stringify(_),rawValue:_}}return v(O,[{key:"toCsvString",value:function(){return this.model.value}},{key:"release",value:function(){}},{key:"toString",value:function(){return this.model.value}},{key:"value",get:function(){return this.model.rawValue},set:function(P){this.model.rawValue=P,this.model.value=JSON.stringify(P)}},{key:"type",get:function(){return i.Types.String}},{key:"effectiveType",get:function(){return i.Types.String}},{key:"address",get:function(){return this.model.address},set:function(P){this.model.address=P}}]),O}(),M={getType:function(O){return O==null?i.Types.Null:O instanceof String||typeof O=="string"?i.Types.String:typeof O=="number"?i.Types.Number:typeof O=="boolean"?i.Types.Boolean:O instanceof Date?i.Types.Date:O.text&&O.hyperlink?i.Types.Hyperlink:O.formula||O.sharedFormula?i.Types.Formula:O.richText?i.Types.RichText:O.sharedString?i.Types.SharedString:O.error?i.Types.Error:i.Types.JSON},types:[{t:i.Types.Null,f:e},{t:i.Types.Number,f:t},{t:i.Types.String,f:r},{t:i.Types.Date,f:n},{t:i.Types.Hyperlink,f:a},{t:i.Types.Formula,f},{t:i.Types.Merge,f:u},{t:i.Types.JSON,f:E},{t:i.Types.SharedString,f:y},{t:i.Types.RichText,f:o},{t:i.Types.Boolean,f:w},{t:i.Types.Error,f:R}].reduce(function(O,P){return O[P.t]=P.f,O},[]),create:function(O,P,_){var S=this.types[O];if(!S)throw new Error("Could not create Value of type ".concat(O));return new S(P,_)}};I.exports=i},{"../utils/col-cache":19,"../utils/shared-formula":22,"../utils/under-dash":25,"./enums":7,"./note":9}],4:[function(h,I,T){function b(c,l){for(var s=0;s=this._worksheet.properties.outlineLevelCol)}},{key:"isDefault",get:function(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;var e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}},{key:"headerCount",get:function(){return this.headers.length}},{key:"values",get:function(){var e=[];return this.eachCell(function(t,r){t&&t.type!==v.ValueType.Null&&(e[r]=t.value)}),e},set:function(e){var t=this;if(e){var r=this.number,o=0;e.hasOwnProperty("0")&&(o=1),e.forEach(function(n,a){t._worksheet.getCell(a+o,r).value=n})}}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}}])&&b(l.prototype,s),i&&b(l,i),c}();I.exports=p},{"../utils/col-cache":19,"../utils/under-dash":25,"./enums":7}],5:[function(h,I,T){function b(v,d){for(var p=0;pthis.bottom)&&(this.bottom=e),(!this.model.right||t>this.right)&&(this.right=t)}},{key:"expandRow",value:function(s){if(s){var i=s.dimensions,e=s.number;i&&this.expand(e,i.min,e,i.max)}}},{key:"expandToAddress",value:function(s){var i=v.decodeEx(s);this.expand(i.row,i.col,i.row,i.col)}},{key:"toString",value:function(){return this.range}},{key:"intersects",value:function(s){return!(s.sheetName&&this.sheetName&&s.sheetName!==this.sheetName||s.bottomthis.bottom||s.rightthis.right)}},{key:"contains",value:function(s){var i=v.decodeEx(s);return this.containsEx(i)}},{key:"containsEx",value:function(s){return(!s.sheetName||!this.sheetName||s.sheetName===this.sheetName)&&s.row>=this.top&&s.row<=this.bottom&&s.col>=this.left&&s.col<=this.right}},{key:"forEachAddress",value:function(s){for(var i=this.left;i<=this.right;i++)for(var e=this.top;e<=this.bottom;e++)s(v.encodeAddress(e,i),e,i)}},{key:"top",get:function(){return this.model.top||1},set:function(s){this.model.top=s}},{key:"left",get:function(){return this.model.left||1},set:function(s){this.model.left=s}},{key:"bottom",get:function(){return this.model.bottom||1},set:function(s){this.model.bottom=s}},{key:"right",get:function(){return this.model.right||1},set:function(s){this.model.right=s}},{key:"sheetName",get:function(){return this.model.sheetName},set:function(s){this.model.sheetName=s}},{key:"_serialisedSheetName",get:function(){var s=this.model.sheetName;return s?/^[a-zA-Z0-9]*$/.test(s)?"".concat(s,"!"):"'".concat(s,"'!"):""}},{key:"tl",get:function(){return v.n2l(this.left)+this.top}},{key:"$t$l",get:function(){return"$".concat(v.n2l(this.left),"$").concat(this.top)}},{key:"br",get:function(){return v.n2l(this.right)+this.bottom}},{key:"$b$r",get:function(){return"$".concat(v.n2l(this.right),"$").concat(this.bottom)}},{key:"range",get:function(){return"".concat(this._serialisedSheetName+this.tl,":").concat(this.br)}},{key:"$range",get:function(){return"".concat(this._serialisedSheetName+this.$t$l,":").concat(this.$b$r)}},{key:"shortRange",get:function(){return this.count>1?this.range:this._serialisedSheetName+this.tl}},{key:"$shortRange",get:function(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}},{key:"count",get:function(){return(1+this.bottom-this.top)*(1+this.right-this.left)}}])&&m(c.prototype,l),p}();I.exports=d},{"../utils/col-cache":19}],11:[function(h,I,T){function b(l,s){for(var i=0;i2?o-2:0),a=2;a0)for(u=R;u>=r;u--)(f=this._cells[u-1])?((y=this.getCell(u+w)).value=f.value,y.style=f.style,y._comment=f._comment):this._cells[u+w-1]=void 0;for(u=0;ur.col)&&(e=r.col),t0?{min:e,max:t}:null}},{key:"numFmt",get:function(){return this.style.numFmt},set:function(e){this._applyStyle("numFmt",e)}},{key:"font",get:function(){return this.style.font},set:function(e){this._applyStyle("font",e)}},{key:"alignment",get:function(){return this.style.alignment},set:function(e){this._applyStyle("alignment",e)}},{key:"protection",get:function(){return this.style.protection},set:function(e){this._applyStyle("protection",e)}},{key:"border",get:function(){return this.style.border},set:function(e){this._applyStyle("border",e)}},{key:"fill",get:function(){return this.style.fill},set:function(e){this._applyStyle("fill",e)}},{key:"hidden",get:function(){return!!this._hidden},set:function(e){this._hidden=e}},{key:"outlineLevel",get:function(){return this._outlineLevel||0},set:function(e){this._outlineLevel=e}},{key:"collapsed",get:function(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}},{key:"model",get:function(){var e=[],t=0,r=0;return this._cells.forEach(function(o){if(o){var n=o.model;n&&((!t||t>o.col)&&(t=o.col),r0,"Table must be on valid row"),t(n>0,"Table must be on valid col");var a=this.width,u=this.filterHeight,f=this.tableHeight;i.autoFilterRef=d.encode(o,n,o+u-1,n+a-1),i.tableRef=d.encode(o,n,o+f-1,n+a-1),i.columns.forEach(function(y,w){t(y.name,"Column ".concat(w," must have a name")),w===0?e(y,"totalsRowLabel","Total"):(e(y,"totalsRowFunction","none"),y.totalsRowFormula=s.getFormula(y))})}},{key:"store",value:function(){var s=this,i=function(y,w){w&&Object.keys(w).forEach(function(R){y[R]=w[R]})},e=this.worksheet,t=this.table,r=t.tl,o=r.row,n=r.col,a=0;if(t.headerRow){var u=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=y.style,E=y.name,M=u.getCell(n+w);M.value=E,i(M,R)})}if(t.rows.forEach(function(y){var w=e.getRow(o+a++);y.forEach(function(R,E){var M=w.getCell(n+E);M.value=R,i(M,t.columns[E].style)})}),t.totalsRow){var f=e.getRow(o+a++);t.columns.forEach(function(y,w){var R=f.getCell(n+w);if(w===0)R.value=y.totalsRowLabel;else{var E=s.getFormula(y);R.value=E?{formula:y.totalsRowFormula,result:y.totalsRowResult}:null}i(R,y.style)})}}},{key:"load",value:function(s){var i=this,e=this.table,t=e.tl,r=t.row,o=t.col,n=0;if(e.headerRow){var a=s.getRow(r+n++);e.columns.forEach(function(f,y){a.getCell(o+y).value=f.name})}if(e.rows.forEach(function(f){var y=s.getRow(r+n++);f.forEach(function(w,R){y.getCell(o+R).value=w})}),e.totalsRow){var u=s.getRow(r+n++);e.columns.forEach(function(f,y){var w=u.getCell(o+y);y===0?w.value=f.totalsRowLabel:i.getFormula(f)&&(w.value={formula:f.totalsRowFormula,result:f.totalsRowResult})})}}},{key:"cacheState",value:function(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}},{key:"commit",value:function(){if(this._cache){this.validate();var s=d.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(s,i)}},{key:"getColumn",value:function(s){var i=this.table.columns[s];return new p(this,i,s)}},{key:"addColumn",value:function(s,i,e){this.cacheState(),e===void 0?(this.table.columns.push(s),this.table.rows.forEach(function(t,r){t.push(i[r])})):(this.table.columns.splice(e,0,s),this.table.rows.forEach(function(t,r){t.splice(e,0,i[r])}))}},{key:"removeColumns",value:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(s,i),this.table.rows.forEach(function(e){e.splice(s,i)})}},{key:"_assign",value:function(s,i,e){this.cacheState(),s[i]=e}},{key:"width",get:function(){return this.table.columns.length}},{key:"height",get:function(){return this.table.rows.length}},{key:"filterHeight",get:function(){return this.height+(this.table.headerRow?1:0)}},{key:"tableHeight",get:function(){return this.filterHeight+(this.table.totalsRow?1:0)}},{key:"model",get:function(){return this.table},set:function(s){this.table=s}},{key:"ref",get:function(){return this.table.ref},set:function(s){this._assign(this.table,"ref",s)}},{key:"name",get:function(){return this.table.name},set:function(s){this.table.name=s}},{key:"displayName",get:function(){return this.table.displyName||this.table.name}},{key:"displayNamename",set:function(s){this.table.displayName=s}},{key:"headerRow",get:function(){return this.table.headerRow},set:function(s){this._assign(this.table,"headerRow",s)}},{key:"totalsRow",get:function(){return this.table.totalsRow},set:function(s){this._assign(this.table,"totalsRow",s)}},{key:"theme",get:function(){return this.table.style.name},set:function(s){this.table.style.name=s}},{key:"showFirstColumn",get:function(){return this.table.style.showFirstColumn},set:function(s){this.table.style.showFirstColumn=s}},{key:"showLastColumn",get:function(){return this.table.style.showLastColumn},set:function(s){this.table.style.showLastColumn=s}},{key:"showRowStripes",get:function(){return this.table.style.showRowStripes},set:function(s){this.table.style.showRowStripes=s}},{key:"showColumnStripes",get:function(){return this.table.style.showColumnStripes},set:function(s){this.table.style.showColumnStripes=s}}]),l}();I.exports=c},{"../utils/col-cache":19}],13:[function(h,I,T){function b(l,s){for(var i=0;i31&&console.warn("Worksheet name ".concat(e," exceeds 31 chars. This will be truncated")),/[*?:/\\[\]]/.test(e))throw new Error("Worksheet name ".concat(e," cannot include any of the following characters: * ? : \\ / [ ]"));if(/(^')|('$)/.test(e))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: ".concat(e));if(e=(e||"sheet".concat(r)).substring(0,31),this._worksheets.find(function(u){return u&&u.name.toLowerCase()===e.toLowerCase()}))throw new Error("Worksheet name already exists: ".concat(e));t&&(typeof t=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),t={properties:{tabColor:{argb:t}}}):(t.argb||t.theme||t.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),t={properties:{tabColor:t}}));var o=this._worksheets.reduce(function(u,f){return(f&&f.orderNo)>u?f.orderNo:u},0),n=Object.assign({},t,{id:r,name:e,orderNo:o+1,workbook:this}),a=new m(n);return this._worksheets[r]=a,a}},{key:"removeWorksheetEx",value:function(e){delete this._worksheets[e.id]}},{key:"removeWorksheet",value:function(e){var t=this.getWorksheet(e);t&&t.destroy()}},{key:"getWorksheet",value:function(e){return e===void 0?this._worksheets.find(Boolean):typeof e=="number"?this._worksheets[e]:typeof e=="string"?this._worksheets.find(function(t){return t&&t.name===e}):void 0}},{key:"eachSheet",value:function(e){this.worksheets.forEach(function(t){e(t,t.id)})}},{key:"clearThemes",value:function(){this._themes=void 0}},{key:"addImage",value:function(e){var t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}},{key:"getImage",value:function(e){return this.media[e]}},{key:"xlsx",get:function(){return this._xlsx||(this._xlsx=new d(this)),this._xlsx}},{key:"csv",get:function(){return this._csv||(this._csv=new p(this)),this._csv}},{key:"nextId",get:function(){for(var e=1;ey.length)&&(w=y.length);for(var R=0,E=new Array(w);Rthis._columns.length)for(var O=this._columns.length+1;O<=E;)this._columns.push(new t(this,O++));return this._columns[E-1]}},{key:"spliceColumns",value:function(E,M){for(var O=this,P=this._rows,_=P.length,S=arguments.length,g=new Array(S>2?S-2:0),j=2;j0)for(var x=function(V){var q=[E,M];g.forEach(function(L){q.push(L[V]||null)});var $=O.getRow(V+1);$.splice.apply($,q)},k=0;k<_;k++)x(k);else this._rows.forEach(function(V){V&&V.splice(E,M)});var C=g.length-M,D=E+M,F=this._columns.length;if(C<0)for(var B=E+g.length;B<=F;B++)this.getColumn(B).defn=this.getColumn(B-C).defn;else if(C>0)for(var U=F;U>=D;U--)this.getColumn(U+C).defn=this.getColumn(U).defn;for(var H=E;H1&&arguments[1]!==void 0?arguments[1]:"n",O=this._nextRow,P=this.getRow(O);return P.values=E,this._setStyleOption(O,M[0]==="i"?M:"n"),P}},{key:"addRows",value:function(E){var M=this,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n",P=[];return E.forEach(function(_){P.push(M.addRow(_,O))}),P}},{key:"insertRow",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(E,0,M),this._setStyleOption(E,O),this.getRow(E)}},{key:"insertRows",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows.apply(this,[E,0].concat(d(M))),O!=="n")for(var P=0;P1&&arguments[1]!==void 0?arguments[1]:"n";M[0]==="o"&&this.findRow(E+1)!==void 0?this._copyStyle(E+1,E,M[1]==="+"):M[0]==="i"&&this.findRow(E-1)!==void 0&&this._copyStyle(E-1,E,M[1]==="+")}},{key:"_copyStyle",value:function(E,M){var O=arguments.length>2&&arguments[2]!==void 0&&arguments[2],P=this.getRow(E),_=this.getRow(M);_.style=Object.freeze(m({},P.style)),P.eachCell({includeEmpty:O},function(S,g){_.getCell(g).style=Object.freeze(m({},S.style))}),_.height=P.height}},{key:"duplicateRow",value:function(E,M){var O=this,P=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=this._rows[E-1],S=new Array(M).fill(_.values);this.spliceRows.apply(this,[E+1,P?0:M].concat(d(S)));for(var g=function(x){var k=O._rows[E+x];k.style=_.style,k.height=_.height,_.eachCell({includeEmpty:!0},function(C,D){k.getCell(D).style=C.style})},j=0;j2?_-2:0),g=2;g<_;g++)S[g-2]=arguments[g];var j,x,k=S.length,C=k-M,D=this._rows.length;if(C<0)for(j=P;j<=D;j++)(x=this._rows[j-1])?function(){var B=O.getRow(j+C);B.values=x.values,B.style=x.style,B.height=x.height,x.eachCell({includeEmpty:!0},function(U,H){B.getCell(H).style=U.style}),O._rows[j-1]=void 0}():this._rows[j+C-1]=void 0;else if(C>0)for(j=D;j>=P;j--)(x=this._rows[j-1])?function(){var B=O.getRow(j+C);B.values=x.values,B.style=x.style,B.height=x.height,x.eachCell({includeEmpty:!0},function(U,H){if(B.getCell(H).style=U.style,U._value.constructor.name==="MergeValue"){var V=O.getRow(U._row._number+k).getCell(H),q=U._value._master,$=O.getRow(q._row._number+k).getCell(q._column._number);V.merge($)}})}():this._rows[j+C-1]=void 0;for(j=0;jE.top||_>E.left)&&this.getCell(P,_).merge(O,M);this._merges[O.address]=E}},{key:"_unMergeMaster",value:function(E){var M=this._merges[E.address];if(M){for(var O=M.top;O<=M.bottom;O++)for(var P=M.left;P<=M.right;P++)this.getCell(O,P).unmerge();delete this._merges[E.address]}}},{key:"unMergeCells",value:function(){for(var E=arguments.length,M=new Array(E),O=0;O3&&arguments[3]!==void 0?arguments[3]:"shared",S=s.decode(E),g=S.top,j=S.left,x=S.bottom,k=S.right,C=k-j+1,D=s.encodeAddress(g,j),F=_==="shared";P=typeof O=="function"?O:Array.isArray(O)?Array.isArray(O[0])?function(V,q){return O[V-g][q-j]}:function(V,q){return O[(V-g)*C+(q-j)]}:function(){};for(var B=!0,U=g;U<=x;U++)for(var H=j;H<=k;H++)B?(this.getCell(U,H).value={shareType:_,formula:M,ref:E,result:P(U,H)},B=!1):this.getCell(U,H).value=F?{sharedFormula:D,result:P(U,H)}:P(U,H)}},{key:"addImage",value:function(E,M){var O={type:"image",imageId:E,range:M};this._media.push(new o(this,O))}},{key:"getImages",value:function(){return this._media.filter(function(E){return E.type==="image"})}},{key:"addBackgroundImage",value:function(E){var M={type:"background",imageId:E};this._media.push(new o(this,M))}},{key:"getBackgroundImageId",value:function(){var E=this._media.find(function(M){return M.type==="background"});return E&&E.imageId}},{key:"protect",value:function(E,M){var O=this;return new Promise(function(P){O.sheetProtection={sheet:!0},M&&"spinCount"in M&&(M.spinCount=Number.isFinite(M.spinCount)?Math.round(Math.max(0,M.spinCount)):1e5),E&&(O.sheetProtection.algorithmName="SHA-512",O.sheetProtection.saltValue=u.randomBytes(16).toString("base64"),O.sheetProtection.spinCount=M&&"spinCount"in M?M.spinCount:1e5,O.sheetProtection.hashValue=u.convertPasswordToHash(E,"SHA512",O.sheetProtection.saltValue,O.sheetProtection.spinCount)),M&&(O.sheetProtection=Object.assign(O.sheetProtection,M),!E&&"spinCount"in M&&delete O.sheetProtection.spinCount),P()})}},{key:"unprotect",value:function(){this.sheetProtection=null}},{key:"addTable",value:function(E){var M=new n(this,E);return this.tables[E.name]=M,M}},{key:"getTable",value:function(E){return this.tables[E]}},{key:"removeTable",value:function(E){delete this.tables[E]}},{key:"getTables",value:function(){return Object.values(this.tables)}},{key:"addConditionalFormatting",value:function(E){this.conditionalFormattings.push(E)}},{key:"removeConditionalFormatting",value:function(E){typeof E=="number"?this.conditionalFormattings.splice(E,1):this.conditionalFormattings=E instanceof Function?this.conditionalFormattings.filter(E):[]}},{key:"_parseRows",value:function(E){var M=this;this._rows=[],E.rows.forEach(function(O){var P=new e(M,O.number);M._rows[P.number-1]=P,P.model=O})}},{key:"_parseMergeCells",value:function(E){var M=this;l.each(E.mergeCells,function(O){M.mergeCellsWithoutStyle(O)})}},{key:"workbook",get:function(){return this._workbook}},{key:"dimensions",get:function(){var E=new i;return this._rows.forEach(function(M){if(M){var O=M.dimensions;O&&E.expand(M.number,O.min,M.number,O.max)}}),E}},{key:"columns",get:function(){return this._columns},set:function(E){var M=this;this._headerRowCount=E.reduce(function(_,S){var g=(S.header?1:S.headers&&S.headers.length)||0;return Math.max(_,g)},0);var O=1,P=this._columns=[];E.forEach(function(_){var S=new t(M,O++,!1);P.push(S),S.defn=_})}},{key:"lastColumn",get:function(){return this.getColumn(this.columnCount)}},{key:"columnCount",get:function(){var E=0;return this.eachRow(function(M){E=Math.max(E,M.cellCount)}),E}},{key:"actualColumnCount",get:function(){var E=[],M=0;return this.eachRow(function(O){O.eachCell(function(P){var _=P.col;E[_]||(E[_]=!0,M++)})}),M}},{key:"_lastRowNumber",get:function(){for(var E=this._rows,M=E.length;M>0&&E[M-1]===void 0;)M--;return M}},{key:"_nextRow",get:function(){return this._lastRowNumber+1}},{key:"lastRow",get:function(){if(this._rows.length)return this._rows[this._rows.length-1]}},{key:"rowCount",get:function(){return this._lastRowNumber}},{key:"actualRowCount",get:function(){var E=0;return this.eachRow(function(){E++}),E}},{key:"hasMerges",get:function(){return l.some(this._merges,Boolean)}},{key:"tabColor",get:function(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor},set:function(E){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=E}},{key:"model",get:function(){var E={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(function(P){return P.model}),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(function(P){return P.model}),conditionalFormattings:this.conditionalFormattings};E.cols=t.toModel(this.columns);var M=E.rows=[],O=E.dimensions=new i;return this._rows.forEach(function(P){var _=P&&P.model;_&&(O.expand(_.number,_.min,_.number,_.max),M.push(_))}),E.merges=[],l.each(this._merges,function(P){E.merges.push(P.range)}),E},set:function(E){var M=this;this.name=E.name,this._columns=t.fromModel(this,E.cols),this._parseRows(E),this._parseMergeCells(E),this.dataValidations=new a(E.dataValidations),this.properties=E.properties,this.pageSetup=E.pageSetup,this.headerFooter=E.headerFooter,this.views=E.views,this.autoFilter=E.autoFilter,this._media=E.media.map(function(O){return new o(M,O)}),this.sheetProtection=E.sheetProtection,this.tables=E.tables.reduce(function(O,P){var _=new n;return _.model=P,O[P.name]=_,O},{}),this.conditionalFormattings=E.conditionalFormattings}}])&&c(w.prototype,R),y}();I.exports=f},{"../utils/col-cache":19,"../utils/encryptor":20,"../utils/under-dash":25,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(h,I,T){h("core-js/modules/es.promise"),h("core-js/modules/es.object.assign"),h("core-js/modules/es.object.keys"),h("core-js/modules/es.object.values"),h("core-js/modules/es.symbol"),h("core-js/modules/es.symbol.async-iterator"),h("core-js/modules/es.array.iterator"),h("core-js/modules/es.array.includes"),h("core-js/modules/es.array.find-index"),h("core-js/modules/es.array.find"),h("core-js/modules/es.string.from-code-point"),h("core-js/modules/es.string.includes"),h("core-js/modules/es.number.is-nan"),h("regenerator-runtime/runtime");var b={Workbook:h("./doc/workbook")},m=h("./doc/enums");Object.keys(m).forEach(function(v){b[v]=m[v]}),I.exports=b},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":316,"core-js/modules/es.array.find-index":315,"core-js/modules/es.array.includes":317,"core-js/modules/es.array.iterator":318,"core-js/modules/es.number.is-nan":319,"core-js/modules/es.object.assign":320,"core-js/modules/es.object.keys":321,"core-js/modules/es.object.values":322,"core-js/modules/es.promise":323,"core-js/modules/es.string.from-code-point":324,"core-js/modules/es.string.includes":325,"core-js/modules/es.symbol":327,"core-js/modules/es.symbol.async-iterator":326,"regenerator-runtime/runtime":492}],16:[function(h,I,T){var b=typeof TextDecoder=="undefined"?null:new TextDecoder("utf-8");T.bufferToString=function(m){return typeof m=="string"?m:b?b.decode(m):m.toString()}},{}],17:[function(h,I,T){var b=typeof TextEncoder=="undefined"?null:new TextEncoder("utf-8"),m=h("buffer").Buffer;T.stringToBuffer=function(v){return typeof v!="string"?v:b?m.from(b.encode(v).buffer):m.from(v)}},{buffer:216}],18:[function(h,I,T){function b(p,c){for(var l=0;ll.length)&&(s=l.length);for(var i=0,e=new Array(s);i=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&l>=1){for(;o<=26;)s=this._dictionary[o-1],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&l>=2){for(o=27;o<=702;)e=(i=o-27)%26,t=Math.floor(i/26),s=this._dictionary[t]+this._dictionary[e],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&l>=3){for(o=703;o<=16384;)e=(i=o-703)%26,t=Math.floor(i/26)%26,r=Math.floor(i/676),s=this._dictionary[r]+this._dictionary[t]+this._dictionary[e],this._n2l[o]=s,this._l2n[s]=o,o++;this._l2nFill=3}},l2n:function(l){if(this._l2n[l]||this._fill(l.length),!this._l2n[l])throw new Error("Out of bounds. Invalid column letter: ".concat(l));return this._l2n[l]},n2l:function(l){if(l<1||l>16384)throw new Error("".concat(l," is out of bounds. Excel supports columns from 1 to 16384"));return this._n2l[l]||this._fill(this._level(l)),this._n2l[l]},_hash:{},validateAddress:function(l){if(!p.test(l))throw new Error("Invalid Address: ".concat(l));return!0},decodeAddress:function(l){var s=l.length<5&&this._hash[l];if(s)return s;for(var i,e=!1,t="",r=0,o=!1,n="",a=0,u=0;u=65&&i<=90)e=!0,t+=l[u],r=26*r+i-64;else if(i>=48&&i<=57)o=!0,n+=l[u],a=10*a+i-48;else if(o&&e&&i!==36)break;if(e){if(r>16384)throw new Error("Out of bounds. Invalid column letter: ".concat(t))}else r=void 0;o||(a=void 0);var f={address:l=t+n,col:r,row:a,$col$row:"$".concat(t,"$").concat(n)};return r<=100&&a<=100&&(this._hash[l]=f,this._hash[f.$col$row]=f),f},getAddress:function(l,s){if(s){var i=this.n2l(s)+l;return this.decodeAddress(i)}return this.decodeAddress(l)},decode:function(l){var s=l.split(":");if(s.length===2){var i=this.decodeAddress(s[0]),e=this.decodeAddress(s[1]),t={top:Math.min(i.row,e.row),left:Math.min(i.col,e.col),bottom:Math.max(i.row,e.row),right:Math.max(i.col,e.col)};return t.tl=this.n2l(t.left)+t.top,t.br=this.n2l(t.right)+t.bottom,t.dimensions="".concat(t.tl,":").concat(t.br),t}return this.decodeAddress(l)},decodeEx:function(l){var s=l.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),i=s[1]||s[2],e=s[3],t=e.split(":");if(t.length>1){var r=this.decodeAddress(t[0]),o=this.decodeAddress(t[1]),n=Math.min(r.row,o.row),a=Math.min(r.col,o.col),u=Math.max(r.row,o.row),f=Math.max(r.col,o.col);return r=this.n2l(a)+n,o=this.n2l(f)+u,{top:n,left:a,bottom:u,right:f,sheetName:i,tl:{address:r,col:a,row:n,$col$row:"$".concat(this.n2l(a),"$").concat(n),sheetName:i},br:{address:o,col:f,row:u,$col$row:"$".concat(this.n2l(f),"$").concat(u),sheetName:i},dimensions:"".concat(r,":").concat(o)}}if(e.startsWith("#"))return i?{sheetName:i,error:e}:{error:e};var y=this.decodeAddress(e);return i?function(w){for(var R=1;R=e&&a<=r&&u>=t&&u<=o}};I.exports=c},{}],20:[function(h,I,T){(function(b){var m=h("crypto"),v={hash:function(d){for(var p=m.createHash(d),c=arguments.length,l=new Array(c>1?c-1:0),s=1;s3||u.length===3&&u>"XFD")return i;var w=b.l2n(u),R=parseInt(y,10);return a||(w+=s.col-l.col),f||(R+=s.row-l.row),(e||"")+(a||"")+b.n2l(w)+(f||"")+R}return i})}}},{"./col-cache":19}],23:[function(h,I,T){(function(b,m){function v(u,f,y,w,R,E,M){try{var O=u[E](M),P=O.value}catch(_){return void y(_)}O.done?f(P):Promise.resolve(P).then(w,R)}function d(u){return function(){var f=this,y=arguments;return new Promise(function(w,R){var E=u.apply(f,y);function M(P){v(E,w,R,M,O,"next",P)}function O(P){v(E,w,R,M,O,"throw",P)}M(void 0)})}}function p(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function c(u,f){for(var y=0;y=this.length?(y=this.toBuffer(),this.iRead=this.iWrite,y):(y=m.alloc(f),this.buffer.copy(y,0,this.iRead,f),this.iRead+=f,y)}},{key:"write",value:function(f,y,w){var R=Math.min(w,this.size-this.iWrite);return f.copy(this.buffer,this.iWrite,y,y+R),this.iWrite+=R,R}},{key:"length",get:function(){return this.iWrite-this.iRead}},{key:"eod",get:function(){return this.iRead===this.iWrite}},{key:"full",get:function(){return this.iWrite===this.size}}]),u}(),a=function(u){u=u||{},this.bufSize=u.bufSize||1048576,this.buffers=[],this.batch=u.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};i.inherits(a,s.Duplex,{toBuffer:function(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return m.concat(this.buffers.map(function(u){return u.toBuffer()}))}},_getWritableBuffer:function(){if(this.buffers.length){var u=this.buffers[this.buffers.length-1];if(!u.full)return u}var f=new n(this.bufSize);return this.buffers.push(f),f},_pipe:function(u){var f=this;return d(regeneratorRuntime.mark(function y(){var w;return regeneratorRuntime.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=function(E){return new Promise(function(M){E.write(u.toBuffer(),function(){M()})})},R.next=3,Promise.all(f.pipes.map(w));case 3:case"end":return R.stop()}},y)}))()},_writeToBuffers:function(u){for(var f=0,y=u.length;f1;)w._pipe(w.buffers.shift());M.next=29;break;case 21:if(w.corked){M.next=27;break}return M.next=24,w._pipe(E);case 24:y(),M.next=29;break;case 27:w._writeToBuffers(E),b.nextTick(y);case 29:M.next=34;break;case 31:w.paused||w.emit("data",E.toBuffer()),w._writeToBuffers(E),w.emit("readable");case 34:return M.abrupt("return",!0);case 35:case"end":return M.stop()}},R)}))()},cork:function(){this.corked=!0},_flush:function(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork:function(){this.corked=!1,this._flush()},end:function(u,f,y){var w=this,R=function(E){E?y(E):(w._flush(),w.pipes.forEach(function(M){M.end()}),w.emit("finish"))};u?this.write(u,f,R):R()},read:function(u){var f;if(u){for(f=[];u&&this.buffers.length&&!this.buffers[0].eod;){var y=this.buffers[0],w=y.read(u);u-=w.length,f.push(w),y.eod&&y.full&&this.buffers.shift()}return m.concat(f)}return f=this.buffers.map(function(R){return R.toBuffer()}).filter(Boolean),this.buffers=[],m.concat(f)},setEncoding:function(u){this.encoding=u},pause:function(){this.paused=!0},resume:function(){this.paused=!1},isPaused:function(){return!!this.paused},pipe:function(u){this.pipes.push(u),!this.paused&&this.buffers.length&&this.end()},unpipe:function(u){this.pipes=this.pipes.filter(function(f){return f!==u})},unshift:function(){throw new Error("Not Implemented")},wrap:function(){throw new Error("Not Implemented")}}),I.exports=a}).call(this,h("_process"),h("buffer").Buffer)},{"./string-buf":24,"./utils":26,_process:467,buffer:216,"readable-stream":491}],24:[function(h,I,T){(function(b){function m(d,p){for(var c=0;c=this._buf.length-4;)this._grow(this._inPos+l.length),s=this._inPos+this._buf.write(l,this._inPos,this._encoding);this._inPos=s}},{key:"addStringBuf",value:function(l){l.length&&(this._buffer=void 0,this.length+l.length>this.capacity&&this._grow(this.length+l.length),l._buf.copy(this._buf,this._inPos,0,l.length),this._inPos+=l.length)}},{key:"length",get:function(){return this._inPos}},{key:"capacity",get:function(){return this._buf.length}},{key:"buffer",get:function(){return this._buf}}])&&m(p.prototype,c),d}();I.exports=v}).call(this,h("buffer").Buffer)},{buffer:216}],25:[function(h,I,T){function b(p){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(p)}var m=Object.prototype.toString,v=/["&<>]/,d={each:function(p,c){p&&(Array.isArray(p)?p.forEach(c):Object.keys(p).forEach(function(l){c(p[l],l)}))},some:function(p,c){return!!p&&(Array.isArray(p)?p.some(c):Object.keys(p).some(function(l){return c(p[l],l)}))},every:function(p,c){return!p||(Array.isArray(p)?p.every(c):Object.keys(p).every(function(l){return c(p[l],l)}))},map:function(p,c){return p?Array.isArray(p)?p.map(c):Object.keys(p).map(function(l){return c(p[l],l)}):[]},keyBy:function(p,c){return p.reduce(function(l,s){return l[s[c]]=s,l},{})},isEqual:function(p,c){var l=b(p),s=b(c),i=Array.isArray(p),e=Array.isArray(c);if(l!==s)return!1;switch(b(p)){case"object":return i||e?!(!i||!e)&&p.length===c.length&&p.every(function(t,r){var o=c[r];return d.isEqual(t,o)}):d.every(p,function(t,r){var o=c[r];return d.isEqual(t,o)});default:return p===c}},escapeHtml:function(p){var c=v.exec(p);if(!c)return p;for(var l="",s="",i=0,e=c.index;e":s=">";break;default:continue}i!==e&&(l+=p.substring(i,e)),i=e+1,l+=s}return i!==e?l+p.substring(i,e):l},strcmp:function(p,c){return pc?1:0},isUndefined:function(p){return m.call(p)==="[object Undefined]"},isObject:function(p){return m.call(p)==="[object Object]"},deepMerge:function(){var p,c,l,s=arguments[0]||{},i=arguments.length;function e(r,o){p=s[o],l=Array.isArray(r),d.isObject(r)||l?(l?(l=!1,c=p&&Array.isArray(p)?p:[]):c=p&&d.isObject(p)?p:{},s[o]=d.deepMerge(c,r)):d.isUndefined(r)||(s[o]=r)}for(var t=0;t&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,p={nop:function(){},promiseImmediate:function(c){return new Promise(function(l){b.setImmediate?m(function(){l(c)}):setTimeout(function(){l(c)},1)})},inherits:function(c,l,s,i){c.super_=l,i||(i=s,s=null),s&&Object.keys(s).forEach(function(t){Object.defineProperty(c,t,Object.getOwnPropertyDescriptor(s,t))});var e={constructor:{value:c,enumerable:!1,writable:!1,configurable:!0}};i&&Object.keys(i).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(i,t)}),c.prototype=Object.create(l.prototype,e)},dateToExcel:function(c,l){return 25569+c.getTime()/864e5-(l?1462:0)},excelToDate:function(c,l){var s=Math.round(24*(c-25569+(l?1462:0))*3600*1e3);return new Date(s)},parsePath:function(c){var l=c.lastIndexOf("/");return{path:c.substring(0,l),name:c.substring(l+1)}},getRelsPath:function(c){var l=p.parsePath(c);return"".concat(l.path,"/_rels/").concat(l.name,".rels")},xmlEncode:function(c){var l=d.exec(c);if(!l)return c;for(var s="",i="",e=0,t=l.index;t=11&&r!==13)){i="";break}continue}e!==t&&(s+=c.substring(e,t)),e=t+1,i&&(s+=i)}return e!==t?s+c.substring(e,t):s},xmlDecode:function(c){return c.replace(/&([a-z]*);/g,function(l){switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}})},validInt:function(c){var l=parseInt(c,10);return Number.isNaN(l)?0:l},isDateFmt:function(c){return!!c&&(c=(c=c.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null},fs:{exists:function(c){return new Promise(function(l){v.access(c,v.constants.F_OK,function(s){l(!s)})})}},toIsoDateString:function(c){return c.toIsoString().subsstr(0,10)}};I.exports=p}).call(this,typeof Qe!="undefined"?Qe:typeof self!="undefined"?self:typeof window!="undefined"?window:{},h("timers").setImmediate)},{fs:215,timers:521}],27:[function(h,I,T){function b(l,s){for(var i=0;i `)}},{key:"openNode",value:function(e,t){var r=this.tos,o=this._xml;r&&this.open&&o.push(">"),this._stack.push(e),o.push("<"),o.push(e),p(o,t),this.leaf=!0,this.open=!0}},{key:"addAttribute",value:function(e,t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");t!==void 0&&d(this._xml,e,t)}},{key:"addAttributes",value:function(e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");p(this._xml,e)}},{key:"writeText",value:function(e){var t=this._xml;this.open&&(t.push(">"),this.open=!1),this.leaf=!1,t.push(v.xmlEncode(e.toString()))}},{key:"writeXml",value:function(e){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(e)}},{key:"closeNode",value:function(){var e=this._stack.pop(),t=this._xml;this.leaf?t.push("/>"):(t.push("")),this.open=!1,this.leaf=!1}},{key:"leafNode",value:function(e,t,r){this.openNode(e,t),r!==void 0&&this.writeText(r),this.closeNode()}},{key:"closeAll",value:function(){for(;this._stack.length;)this.closeNode()}},{key:"addRollback",value:function(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}},{key:"commit",value:function(){this._rollbacks.pop()}},{key:"rollback",value:function(){var e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}},{key:"tos",get:function(){return this._stack.length?this._stack[this._stack.length-1]:void 0}},{key:"cursor",get:function(){return this._xml.length}},{key:"xml",get:function(){return this.closeAll(),this._xml.join("")}}])&&b(s.prototype,i),l}();c.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},I.exports=c},{"./under-dash":25,"./utils":26}],28:[function(h,I,T){(function(b){function m(n){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(n)}function v(n,a,u,f,y,w,R){try{var E=n[w](R),M=E.value}catch(O){return void u(O)}E.done?a(M):Promise.resolve(M).then(f,y)}function d(n,a){for(var u=0;u=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(y){throw y},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,u=!0,f=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var y=r.next();return u=y.done,y},e:function(y){f=!0,a=y},f:function(){try{u||r.return==null||r.return()}finally{if(f)throw a}}}}function m(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r2&&arguments[2]!==void 0&&arguments[2];if(u===void 0){if(y)return f}else if(y||u!==f)return u.toString()}},{key:"toStringAttribute",value:function(u,f){var y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return e.toAttribute(u,f,y)}},{key:"toStringValue",value:function(u,f){return u===void 0?f:u}},{key:"toBoolAttribute",value:function(u,f){var y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(u===void 0){if(y)return f}else if(y||u!==f)return u?"1":"0"}},{key:"toBoolValue",value:function(u,f){return u===void 0?f:u==="1"}},{key:"toIntAttribute",value:function(u,f){var y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return e.toAttribute(u,f,y)}},{key:"toIntValue",value:function(u,f){return u===void 0?f:parseInt(u,10)}},{key:"toFloatAttribute",value:function(u,f){var y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return e.toAttribute(u,f,y)}},{key:"toFloatValue",value:function(u,f){return u===void 0?f:parseFloat(u)}}],r&&p(t.prototype,r),o&&p(t,o),e}();I.exports=i},{"../../utils/parse-sax":21,"../../utils/xml-stream":27}],32:[function(h,I,T){function b(o){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(o)}function m(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function v(o,n){for(var a=0;athis.maxItems))throw new Error("Max ".concat(this.childXform.tag," count (").concat(this.maxItems,") exceeded"));return!0}return!1}},{key:"reconcile",value:function(o,n){if(o){var a=this.childXform;o.forEach(function(u){a.reconcile(u,n)})}}}])&&m(i.prototype,e),r}(h("./base-xform"));I.exports=l},{"./base-xform":31}],71:[function(h,I,T){function b(e){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;rn.length)&&(a=n.length);for(var u=0,f=new Array(a);un.length)&&(a=n.length);for(var u=0,f=new Array(a);u0");case"containsErrors":return"ISERROR(".concat(k,")");case"notContainsErrors":return"NOT(ISERROR(".concat(k,"))");default:return}}(g);j&&this.formulaXform.render(S,j),S.closeNode()}},{key:"renderTimePeriod",value:function(S,g){S.openNode(this.tag,{type:"timePeriod",dxfId:g.dxfId,priority:g.priority,timePeriod:g.timePeriod});var j=function(x){if(x.formulae&&x.formulae[0])return x.formulae[0];var k=new r(x.ref).tl;switch(x.timePeriod){case"thisWeek":return"AND(TODAY()-ROUNDDOWN(".concat(k,",0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(").concat(k,",0)-TODAY()<=7-WEEKDAY(TODAY()))");case"lastWeek":return"AND(TODAY()-ROUNDDOWN(".concat(k,",0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(").concat(k,",0)<(WEEKDAY(TODAY())+7))");case"nextWeek":return"AND(ROUNDDOWN(".concat(k,",0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(").concat(k,",0)-TODAY()<(15-WEEKDAY(TODAY())))");case"yesterday":return"FLOOR(".concat(k,",1)=TODAY()-1");case"today":return"FLOOR(".concat(k,",1)=TODAY()");case"tomorrow":return"FLOOR(".concat(k,",1)=TODAY()+1");case"last7Days":return"AND(TODAY()-FLOOR(".concat(k,",1)<=6,FLOOR(").concat(k,",1)<=TODAY())");case"lastMonth":return"AND(MONTH(".concat(k,")=MONTH(EDATE(TODAY(),0-1)),YEAR(").concat(k,")=YEAR(EDATE(TODAY(),0-1)))");case"thisMonth":return"AND(MONTH(".concat(k,")=MONTH(TODAY()),YEAR(").concat(k,")=YEAR(TODAY()))");case"nextMonth":return"AND(MONTH(".concat(k,")=MONTH(EDATE(TODAY(),0+1)),YEAR(").concat(k,")=YEAR(EDATE(TODAY(),0+1)))");default:return}}(g);j&&this.formulaXform.render(S,j),S.closeNode()}},{key:"createNewModel",value:function(S){var g=S.attributes;return v(v({},function(j){var x=j.type,k=j.operator;switch(x){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:x};default:return{type:x,operator:k}}}(g)),{},{dxfId:e.toIntValue(g.dxfId),priority:e.toIntValue(g.priority),timePeriod:g.timePeriod,percent:e.toBoolValue(g.percent),bottom:e.toBoolValue(g.bottom),rank:e.toIntValue(g.rank),aboveAverage:e.toBoolValue(g.aboveAverage)})}},{key:"onParserClose",value:function(S,g){switch(S){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,g.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(g.model)}}},{key:"tag",get:function(){return"cfRule"}}])&&p(E.prototype,M),O&&p(E,O),_}(t);I.exports=w},{"../../../../doc/range":10,"../../base-xform":31,"../../composite-xform":47,"./color-scale-xform":84,"./databar-xform":87,"./ext-lst-ref-xform":88,"./formula-xform":89,"./icon-set-xform":90}],83:[function(h,I,T){function b(e){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;rr.length)&&(o=r.length);for(var n=0,a=new Array(o);n1||U>1){var q=D.row+(F-1),$=D.col+(U-1);return i(i({},C.dataValidation),{},{sqref:"".concat(C.address,":").concat(o.encodeAddress(q,$))})}return i(i({},C.dataValidation),{},{sqref:C.address})}return null}).filter(Boolean)}(_);S.length&&(P.openNode("dataValidations",{count:S.length}),S.forEach(function(g){P.openNode("dataValidation"),g.type!=="any"&&(P.addAttribute("type",g.type),g.operator&&g.type!=="list"&&g.operator!=="between"&&P.addAttribute("operator",g.operator),g.allowBlank&&P.addAttribute("allowBlank","1")),g.showInputMessage&&P.addAttribute("showInputMessage","1"),g.promptTitle&&P.addAttribute("promptTitle",g.promptTitle),g.prompt&&P.addAttribute("prompt",g.prompt),g.showErrorMessage&&P.addAttribute("showErrorMessage","1"),g.errorStyle&&P.addAttribute("errorStyle",g.errorStyle),g.errorTitle&&P.addAttribute("errorTitle",g.errorTitle),g.error&&P.addAttribute("error",g.error),P.addAttribute("sqref",g.sqref),(g.formulae||[]).forEach(function(j,x){P.openNode("formula".concat(x+1)),g.type==="date"?P.writeText(r.dateToExcel(new Date(j))):P.writeText(j),P.closeNode()}),P.closeNode()}),P.closeNode())}},{key:"parseOpen",value:function(P){switch(P.name){case"dataValidations":return this.model={},!0;case"dataValidation":this._address=P.attributes.sqref;var _={type:P.attributes.type||"any",formulae:[]};switch(P.attributes.type&&f(_,P.attributes,"allowBlank"),f(_,P.attributes,"showInputMessage"),f(_,P.attributes,"showErrorMessage"),_.type){case"any":case"list":case"custom":break;default:u(_,P.attributes,"operator","between")}return u(_,P.attributes,"promptTitle"),u(_,P.attributes,"prompt"),u(_,P.attributes,"errorStyle"),u(_,P.attributes,"errorTitle"),u(_,P.attributes,"error"),this._dataValidation=_,!0;case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}},{key:"parseText",value:function(P){this._formula&&this._formula.push(P)}},{key:"parseClose",value:function(P){var _=this;switch(P){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(function(g){g.includes(":")?new a(g).forEachAddress(function(j){_.model[j]=_._dataValidation}):_.model[g]=_._dataValidation}),!0;case"formula1":case"formula2":var S=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":S=parseInt(S,10);break;case"decimal":S=parseFloat(S);break;case"date":S=r.excelToDate(parseFloat(S))}return this._dataValidation.formulae.push(S),this._formula=void 0,!0;default:return!0}}},{key:"tag",get:function(){return"dataValidations"}}])&&v(R.prototype,E),O}(n);I.exports=y},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":25,"../../../utils/utils":26,"../base-xform":31}],93:[function(h,I,T){function b(i){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(i)}function m(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function v(i,e){for(var t=0;t0&&u.max>0&&u.min<=u.max&&a.addAttribute("spans","".concat(u.min,":").concat(u.max)),u.styleId&&(a.addAttribute("s",u.styleId),a.addAttribute("customFormat","1")),a.addAttribute("x14ac:dyDescent","0.25"),u.outlineLevel&&a.addAttribute("outlineLevel",u.outlineLevel),u.collapsed&&a.addAttribute("collapsed","1");var y=this.map.c;u.cells.forEach(function(w){y.render(a,w,f)}),a.closeNode()}},{key:"parseOpen",value:function(a){if(this.parser)return this.parser.parseOpen(a),!0;if(a.name==="row"){this.numRowsSeen+=1;var u=a.attributes.spans?a.attributes.spans.split(":").map(function(y){return parseInt(y,10)}):[void 0,void 0],f=this.model={number:parseInt(a.attributes.r,10),min:u[0],max:u[1],cells:[]};return a.attributes.s&&(f.styleId=parseInt(a.attributes.s,10)),a.attributes.hidden!==!0&&a.attributes.hidden!=="true"&&a.attributes.hidden!==1&&a.attributes.hidden!=="1"||(f.hidden=!0),a.attributes.bestFit&&(f.bestFit=!0),a.attributes.ht&&(f.height=parseFloat(a.attributes.ht)),a.attributes.outlineLevel&&(f.outlineLevel=parseInt(a.attributes.outlineLevel,10)),a.attributes.collapsed&&(f.collapsed=!0),!0}return this.parser=this.map[a.name],!!this.parser&&(this.parser.parseOpen(a),!0)}},{key:"parseText",value:function(a){this.parser&&this.parser.parseText(a)}},{key:"parseClose",value:function(a){if(this.parser){if(!this.parser.parseClose(a)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error("Max column count (".concat(this.maxItems,") exceeded"));this.parser=void 0}return!0}return!1}},{key:"reconcile",value:function(a,u){a.style=a.styleId?u.styles.getStyleModel(a.styleId):{},a.styleId!==void 0&&(a.styleId=void 0);var f=this.map.c;a.cells.forEach(function(y){f.reconcile(y,u)})}},{key:"tag",get:function(){return"row"}}])&&m(t.prototype,r),n}(l);I.exports=i},{"../base-xform":31,"./cell-xform":72}],109:[function(h,I,T){function b(e){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r0){var ie={Id:K(X),Type:e.Comments,Target:"../comments".concat(N.id,".xml")};X.push(ie);var Q={Id:K(X),Type:e.VmlDrawing,Target:"../drawings/vmlDrawing".concat(N.id,".vml")};X.push(Q),N.comments.forEach(function(ce){ce.refAddress=s.decodeAddress(ce.ref)}),z.commentRefs.push({commentName:"comments".concat(N.id),vmlDrawing:"vmlDrawing".concat(N.id)})}var ue,de=[];N.media.forEach(function(ce){if(ce.type==="background"){var Ee=K(X);ue=z.media[ce.imageId],X.push({Id:Ee,Type:e.Image,Target:"../media/".concat(ue.name,".").concat(ue.extension)}),N.background={rId:Ee},N.image=z.media[ce.imageId]}else if(ce.type==="image"){var _e=N.drawing;ue=z.media[ce.imageId],_e||(_e=N.drawing={rId:K(X),name:"drawing".concat(++z.drawingsCount),anchors:[],rels:[]},z.drawings.push(_e),X.push({Id:_e.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:"../drawings/".concat(_e.name,".xml")}));var ve=W.preImageId===ce.imageId?de[ce.imageId]:de[_e.rels.length];ve||(ve=K(_e.rels),de[_e.rels.length]=ve,_e.rels.push({Id:ve,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:"../media/".concat(ue.name,".").concat(ue.extension)}));var xe={picture:{rId:ve},range:ce.range};if(ce.hyperlinks&&ce.hyperlinks.hyperlink){var Re=K(_e.rels);de[_e.rels.length]=Re,xe.picture.hyperlinks={tooltip:ce.hyperlinks.tooltip,rId:Re},_e.rels.push({Id:Re,Type:e.Hyperlink,Target:ce.hyperlinks.hyperlink,TargetMode:"External"})}W.preImageId=ce.imageId,_e.anchors.push(xe)}}),N.tables.forEach(function(ce){var Ee=K(X);ce.rId=Ee,X.push({Id:Ee,Type:e.Table,Target:"../tables/".concat(ce.target)}),ce.columns.forEach(function(_e){var ve=_e.style;ve&&(_e.dxfId=z.styles.addDxfStyle(ve))})}),this.map.extLst.prepare(N,z)}},{key:"render",value:function(N,z){N.openXml(i.StdDocAttributes),N.openNode("worksheet",A.WORKSHEET_ATTRIBUTES);var W=z.properties?{defaultRowHeight:z.properties.defaultRowHeight,dyDescent:z.properties.dyDescent,outlineLevelCol:z.properties.outlineLevelCol,outlineLevelRow:z.properties.outlineLevelRow}:void 0;z.properties&&z.properties.defaultColWidth&&(W.defaultColWidth=z.properties.defaultColWidth);var X={outlineProperties:z.properties&&z.properties.outlineProperties,tabColor:z.properties&&z.properties.tabColor,pageSetup:z.pageSetup&&z.pageSetup.fitToPage?{fitToPage:z.pageSetup.fitToPage}:void 0},K=z.pageSetup&&z.pageSetup.margins,ie={showRowColHeaders:z.pageSetup&&z.pageSetup.showRowColHeaders,showGridLines:z.pageSetup&&z.pageSetup.showGridLines,horizontalCentered:z.pageSetup&&z.pageSetup.horizontalCentered,verticalCentered:z.pageSetup&&z.pageSetup.verticalCentered},Q=z.sheetProtection;this.map.sheetPr.render(N,X),this.map.dimension.render(N,z.dimensions),this.map.sheetViews.render(N,z.views),this.map.sheetFormatPr.render(N,W),this.map.cols.render(N,z.cols),this.map.sheetData.render(N,z.rows),this.map.sheetProtection.render(N,Q),this.map.autoFilter.render(N,z.autoFilter),this.map.mergeCells.render(N,z.mergeCells),this.map.conditionalFormatting.render(N,z.conditionalFormattings),this.map.dataValidations.render(N,z.dataValidations),this.map.hyperlinks.render(N,z.hyperlinks),this.map.printOptions.render(N,ie),this.map.pageMargins.render(N,K),this.map.pageSetup.render(N,z.pageSetup),this.map.headerFooter.render(N,z.headerFooter),this.map.rowBreaks.render(N,z.rowBreaks),this.map.drawing.render(N,z.drawing),this.map.picture.render(N,z.background),this.map.tableParts.render(N,z.tables),this.map.extLst.render(N,z),z.rels&&z.rels.forEach(function(ue){ue.Type===e.VmlDrawing&&N.leafNode("legacyDrawing",{"r:id":ue.Id})}),N.closeNode()}},{key:"parseOpen",value:function(N){return this.parser?(this.parser.parseOpen(N),!0):N.name==="worksheet"?(l.each(this.map,function(z){z.reset()}),!0):(this.parser=this.map[N.name],this.parser&&this.parser.parseOpen(N),!0)}},{key:"parseText",value:function(N){this.parser&&this.parser.parseText(N)}},{key:"parseClose",value:function(N){if(this.parser)return this.parser.parseClose(N)||(this.parser=void 0),!0;switch(N){case"worksheet":var z=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(z.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(z.outlineProperties=this.map.sheetPr.model.outlineProperties);var W={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},X=Object.assign(W,this.map.pageSetup.model,this.map.printOptions.model),K=U(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:z,views:this.map.sheetViews.model,pageSetup:X,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:K},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}}},{key:"reconcile",value:function(N,z){var W=(N.relationships||[]).reduce(function(de,ce){if(de[ce.Id]=ce,ce.Type===e.Comments&&(N.comments=z.comments[ce.Target].comments),ce.Type===e.VmlDrawing&&N.comments&&N.comments.length){var Ee=z.vmlDrawings[ce.Target].comments;N.comments.forEach(function(_e,ve){_e.note=Object.assign({},_e.note,Ee[ve])})}return de},{});if(z.commentsMap=(N.comments||[]).reduce(function(de,ce){return ce.ref&&(de[ce.ref]=ce),de},{}),z.hyperlinkMap=(N.hyperlinks||[]).reduce(function(de,ce){return ce.rId&&(de[ce.address]=W[ce.rId].Target),de},{}),z.formulae={},N.rows=N.rows&&N.rows.filter(Boolean)||[],N.rows.forEach(function(de){de.cells=de.cells&&de.cells.filter(Boolean)||[]}),this.map.cols.reconcile(N.cols,z),this.map.sheetData.reconcile(N.rows,z),this.map.conditionalFormatting.reconcile(N.conditionalFormattings,z),N.media=[],N.drawing){var X=W[N.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(X){var K=X[1];z.drawings[K].anchors.forEach(function(de){if(de.medium){var ce={type:"image",imageId:de.medium.index,range:de.range,hyperlinks:de.picture.hyperlinks};N.media.push(ce)}})}}var ie=N.background&&W[N.background.rId];if(ie){var Q=ie.Target.split("/media/")[1],ue=z.mediaIndex&&z.mediaIndex[Q];ue!==void 0&&N.media.push({type:"background",imageId:ue})}N.tables=(N.tables||[]).map(function(de){var ce=W[de.rId];return z.tables[ce.Target]}),delete N.relationships,delete N.hyperlinks,delete N.comments}}])&&m(q.prototype,$),A}(r);H.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"},I.exports=H},{"../../../utils/col-cache":19,"../../../utils/under-dash":25,"../../../utils/xml-stream":27,"../../rel-type":30,"../base-xform":31,"../list-xform":70,"./auto-filter-xform":71,"./cf/conditional-formattings-xform":86,"./col-xform":91,"./data-validations-xform":92,"./dimension-xform":93,"./drawing-xform":94,"./ext-lst-xform":95,"./header-footer-xform":96,"./hyperlink-xform":97,"./merge-cell-xform":98,"./merges":99,"./page-margins-xform":102,"./page-setup-xform":104,"./picture-xform":105,"./print-options-xform":106,"./row-breaks-xform":107,"./row-xform":108,"./sheet-format-properties-xform":109,"./sheet-properties-xform":110,"./sheet-protection-xform":111,"./sheet-view-xform":112,"./table-part-xform":113}],115:[function(h,I,T){function b(s){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i})(s)}function m(s,i){for(var e=0;e=-90&&a<=90?a:void 0}},indent:function(a){return a=i.validInt(a),Math.max(0,a)},readingOrder:function(a){switch(a){case"ltr":return s.ReadingOrder.LeftToRight;case"rtl":return s.ReadingOrder.RightToLeft;default:return}}},r=function(a){if(a=t.textRotation(a)){if(a==="vertical")return 255;var u=Math.round(a);if(u>=0&&u<=90)return u;if(u<0&&u>=-90)return 90-u}},o=function(a){var u=i.validInt(a);if(u!==void 0){if(u===255)return"vertical";if(u>=0&&u<=90)return u;if(u>90&&u<=180)return 90-u}},n=function(a){(function(R,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");R.prototype=Object.create(E&&E.prototype,{constructor:{value:R,writable:!0,configurable:!0}}),E&&d(R,E)})(w,a);var u,f,y=p(w);function w(){return m(this,w),y.apply(this,arguments)}return u=w,(f=[{key:"render",value:function(R,E){R.addRollback(),R.openNode("alignment");var M=!1;function O(P,_){_&&(R.addAttribute(P,_),M=!0)}O("horizontal",t.horizontal(E.horizontal)),O("vertical",t.vertical(E.vertical)),O("wrapText",!!t.wrapText(E.wrapText)&&"1"),O("shrinkToFit",!!t.shrinkToFit(E.shrinkToFit)&&"1"),O("indent",t.indent(E.indent)),O("textRotation",r(E.textRotation)),O("readingOrder",t.readingOrder(E.readingOrder)),R.closeNode(),M?R.commit():R.rollback()}},{key:"parseOpen",value:function(R){var E={},M=!1;function O(P,_,S){P&&(E[_]=S,M=!0)}O(R.attributes.horizontal,"horizontal",R.attributes.horizontal),O(R.attributes.vertical,"vertical",R.attributes.vertical==="center"?"middle":R.attributes.vertical),O(R.attributes.wrapText,"wrapText",!!R.attributes.wrapText),O(R.attributes.shrinkToFit,"shrinkToFit",!!R.attributes.shrinkToFit),O(R.attributes.indent,"indent",parseInt(R.attributes.indent,10)),O(R.attributes.textRotation,"textRotation",o(R.attributes.textRotation)),O(R.attributes.readingOrder,"readingOrder",R.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=M?E:null}},{key:"parseText",value:function(){}},{key:"parseClose",value:function(){return!1}},{key:"tag",get:function(){return"alignment"}}])&&v(u.prototype,f),w}(e);I.exports=n},{"../../../doc/enums":7,"../../../utils/utils":26,"../base-xform":31}],126:[function(h,I,T){function b(f,y){var w=Object.keys(f);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(f);y&&(R=R.filter(function(E){return Object.getOwnPropertyDescriptor(f,E).enumerable})),w.push.apply(w,R)}return w}function m(f){for(var y=1;y=1)){he.next=6;break}return ae=oe.substr(ne+1),re=oe.substr(0,ne),he.next=6,new Promise(function(le,pe){var Se=new t;Se.on("finish",function(){J.mediaIndex[oe]=J.media.length,J.mediaIndex[re]=J.media.length;var ge={type:"image",name:re,extension:ae,buffer:Se.toBuffer()};J.media.push(ge),le()}),ee.on("error",function(ge){pe(ge)}),ee.pipe(Se)});case 6:case"end":return he.stop()}},Z)})),function(Z,ee,J){return Ee.apply(this,arguments)})},{key:"_processDrawingEntry",value:(ce=d(regeneratorRuntime.mark(function Z(ee,J,oe){var ne,ae;return regeneratorRuntime.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ne=new O,re.next=3,ne.parseStream(ee);case 3:ae=re.sent,J.drawings[oe]=ae;case 5:case"end":return re.stop()}},Z)})),function(Z,ee,J){return ce.apply(this,arguments)})},{key:"_processDrawingRelsEntry",value:(de=d(regeneratorRuntime.mark(function Z(ee,J,oe){var ne,ae;return regeneratorRuntime.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ne=new y,re.next=3,ne.parseStream(ee);case 3:ae=re.sent,J.drawingRels[oe]=ae;case 5:case"end":return re.stop()}},Z)})),function(Z,ee,J){return de.apply(this,arguments)})},{key:"_processVmlDrawingEntry",value:(ue=d(regeneratorRuntime.mark(function Z(ee,J,oe){var ne,ae;return regeneratorRuntime.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ne=new S,re.next=3,ne.parseStream(ee);case 3:ae=re.sent,J.vmlDrawings["../drawings/".concat(oe,".vml")]=ae;case 5:case"end":return re.stop()}},Z)})),function(Z,ee,J){return ue.apply(this,arguments)})},{key:"_processThemeEntry",value:(Q=d(regeneratorRuntime.mark(function Z(ee,J,oe){return regeneratorRuntime.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return ne.next=2,new Promise(function(ae,re){var he=new t;ee.on("error",re),he.on("error",re),he.on("finish",function(){J.themes[oe]=he.read().toString(),ae()}),ee.pipe(he)});case 2:case"end":return ne.stop()}},Z)})),function(Z,ee,J){return Q.apply(this,arguments)})},{key:"createInputStream",value:function(){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")}},{key:"read",value:(ie=d(regeneratorRuntime.mark(function Z(ee,J){var oe,ne,ae,re,he,le,pe,Se;return regeneratorRuntime.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:!ee[Symbol.asyncIterator]&&ee.pipe&&(ee=ee.pipe(new i)),oe=[],ne=!0,ae=!1,ge.prev=4,he=c(ee);case 6:return ge.next=8,he.next();case 8:return le=ge.sent,ne=le.done,ge.next=12,le.value;case 12:if(pe=ge.sent,ne){ge.next=19;break}Se=pe,oe.push(Se);case 16:ne=!0,ge.next=6;break;case 19:ge.next=25;break;case 21:ge.prev=21,ge.t0=ge.catch(4),ae=!0,re=ge.t0;case 25:if(ge.prev=25,ge.prev=26,ne||he.return==null){ge.next=30;break}return ge.next=30,he.return();case 30:if(ge.prev=30,!ae){ge.next=33;break}throw re;case 33:return ge.finish(30);case 34:return ge.finish(25);case 35:return ge.abrupt("return",this.load(m.concat(oe),J));case 36:case"end":return ge.stop()}},Z,this,[[4,21,25,35],[26,,30,34]])})),function(Z,ee){return ie.apply(this,arguments)})},{key:"load",value:(K=d(regeneratorRuntime.mark(function Z(ee,J){var oe,ne,ae,re,he,le,pe,Se,ge,De,Ae,Be,Ze,rt,Ie,ze;return regeneratorRuntime.wrap(function(me){for(;;)switch(me.prev=me.next){case 0:return oe=J&&J.base64?m.from(ee.toString(),"base64"):ee,ne={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},me.next=4,s.loadAsync(oe);case 4:ae=me.sent,re=0,he=Object.values(ae.files);case 6:if(!(re0&&(pe=new o,ae.render(pe,le),ee.append(pe.xml,{name:"xl/comments".concat(le.id,".xml")}),pe=new o,re.render(pe,le),ee.append(pe.xml,{name:"xl/drawings/vmlDrawing".concat(le.id,".vml")}))});case 5:case"end":return he.stop()}},Z)})),function(Z,ee){return U.apply(this,arguments)})},{key:"_finalize",value:function(Z){var ee=this;return new Promise(function(J,oe){Z.on("finish",function(){J(ee)}),Z.on("error",oe),Z.finalize()})}},{key:"prepareModel",value:function(Z,ee){Z.creator=Z.creator||"ExcelJS",Z.lastModifiedBy=Z.lastModifiedBy||"ExcelJS",Z.created=Z.created||new Date,Z.modified=Z.modified||new Date,Z.useSharedStrings=ee.useSharedStrings===void 0||ee.useSharedStrings,Z.useStyles=ee.useStyles===void 0||ee.useStyles,Z.sharedStrings=new f,Z.styles=Z.useStyles?new a(!0):new a.Mock;var J=new E,oe=new M;J.prepare(Z);var ne={sharedStrings:Z.sharedStrings,styles:Z.styles,date1904:Z.properties.date1904,drawingsCount:0,media:Z.media};ne.drawings=Z.drawings=[],ne.commentRefs=Z.commentRefs=[];var ae=0;Z.tables=[],Z.worksheets.forEach(function(re){re.tables.forEach(function(he){ae++,he.target="table".concat(ae,".xml"),he.id=ae,Z.tables.push(he)}),oe.prepare(re,ne)})}},{key:"write",value:(B=d(regeneratorRuntime.mark(function Z(ee,J){var oe,ne;return regeneratorRuntime.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return J=J||{},oe=this.workbook.model,(ne=new e.ZipWriter(J.zip)).pipe(ee),this.prepareModel(oe,J),ae.next=7,this.addContentTypes(ne,oe);case 7:return ae.next=9,this.addOfficeRels(ne,oe);case 9:return ae.next=11,this.addWorkbookRels(ne,oe);case 11:return ae.next=13,this.addWorksheets(ne,oe);case 13:return ae.next=15,this.addSharedStrings(ne,oe);case 15:return ae.next=17,this.addDrawings(ne,oe);case 17:return ae.next=19,this.addTables(ne,oe);case 19:return ae.next=21,Promise.all([this.addThemes(ne,oe),this.addStyles(ne,oe)]);case 21:return ae.next=23,this.addMedia(ne,oe);case 23:return ae.next=25,Promise.all([this.addApp(ne,oe),this.addCore(ne,oe)]);case 25:return ae.next=27,this.addWorkbook(ne,oe);case 27:return ae.abrupt("return",this._finalize(ne));case 28:case"end":return ae.stop()}},Z,this)})),function(Z,ee){return B.apply(this,arguments)})},{key:"writeFile",value:function(Z,ee){var J=this,oe=l.createWriteStream(Z);return new Promise(function(ne,ae){oe.on("finish",function(){ne()}),oe.on("error",function(re){ae(re)}),J.write(oe,ee).then(function(){oe.end()})})}},{key:"writeBuffer",value:(F=d(regeneratorRuntime.mark(function Z(ee){var J;return regeneratorRuntime.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return J=new t,oe.next=3,this.write(J,ee);case 3:return oe.abrupt("return",J.read());case 4:case"end":return oe.stop()}},Z,this)})),function(Z){return F.apply(this,arguments)})}])&&p(C.prototype,D),k}();x.RelType=h("./rel-type"),I.exports=x}).call(this,h("_process"),h("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":23,"../utils/utils":26,"../utils/xml-stream":27,"../utils/zip-stream":28,"./rel-type":30,"./xform/book/workbook-xform":37,"./xform/comment/comments-xform":39,"./xform/comment/vml-notes-xform":44,"./xform/core/app-xform":50,"./xform/core/content-types-xform":51,"./xform/core/core-xform":52,"./xform/core/relationships-xform":54,"./xform/drawing/drawing-xform":61,"./xform/sheet/worksheet-xform":114,"./xform/strings/shared-strings-xform":123,"./xform/style/styles-xform":134,"./xform/table/table-xform":140,"./xml/theme1.js":142,_process:467,buffer:216,fs:215,jszip:399,"readable-stream":491}],142:[function(h,I,T){I.exports=` `},{}],143:[function(h,I,T){(function(b){function m(t){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function v(t,r){for(var o=0;o0&&arguments[0]!==void 0?arguments[0]:{};b(this,m),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,d||{}),(d==null?void 0:d.quoteHeaders)===void 0&&(this.quoteHeaders=this.quoteColumns),(d==null?void 0:d.quote)===!0?this.quote='"':(d==null?void 0:d.quote)===!1&&(this.quote=""),typeof(d==null?void 0:d.escape)!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((v=d.writeHeaders)===null||v===void 0||v),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote="".concat(this.escape).concat(this.quote)}},{}],145:[function(h,I,T){function b(l,s){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:{},a=[],u=new l.Writable({write:function(f,y,w){a.push(f),w()}});return new Promise(function(f,y){u.on("error",y).on("finish",function(){return f(b.concat(a))}),T.write(o,n).pipe(u)})},T.writeToString=function(o,n){return T.writeToBuffer(o,n).then(function(a){return a.toString()})},T.writeToPath=function(o,n,a){var u=s.createWriteStream(o,{encoding:"utf8"});return T.write(n,a).pipe(u)}}).call(this,h("buffer").Buffer)},{"./CsvFormatterStream":143,"./FormatterOptions":144,"./types":149,buffer:216,fs:215,stream:506,util:525}],149:[function(h,I,T){Object.defineProperty(T,"__esModule",{value:!0}),T.isSyncTransform=void 0,T.isSyncTransform=function(b){return b.length===1}},{}],150:[function(h,I,T){(function(b){function m(n){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(n)}function v(n,a){for(var u=0;u1?E-1:0),O=1;O=M||E.hasHitRowLimit)return R();if(E.parsedLineCount+=1,E.shouldSkipLine)return _();var S=w[P];E.rowCount+=1,E.parsedRowCount+=1;var g=E.rowCount;return E.transformRow(S,function(j,x){if(j)return E.rowCount-=1,_(j);if(!x)return _(new Error("expected transform result"));if(x.isValid){if(x.row)return E.pushRow(x.row,_)}else E.emit("data-invalid",x.row,g,x.reason);return _()})})(0)}},{key:"transformRow",value:function(w,R){var E=this;try{this.headerTransformer.transform(w,function(M,O){return M?R(M):O?O.isValid?O.row?E.shouldEmitRows?E.rowTransformerValidator.transformAndValidate(O.row,R):E.skipRow(R):(E.rowCount-=1,E.parsedRowCount-=1,R(null,{row:null,isValid:!0})):E.shouldEmitRows?R(null,{isValid:!1,row:w}):E.skipRow(R):R(new Error("Expected result from header transform"))})}catch(M){R(M)}}},{key:"checkAndEmitHeaders",value:function(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}},{key:"skipRow",value:function(w){return this.rowCount-=1,w(null,{row:null,isValid:!0})}},{key:"pushRow",value:function(w,R){try{this.parserOptions.objectMode?this.push(w):this.push(JSON.stringify(w)),R()}catch(E){R(E)}}},{key:"hasHitRowLimit",get:function(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}},{key:"shouldEmitRows",get:function(){return this.parsedRowCount>this.parserOptions.skipRows}},{key:"shouldSkipLine",get:function(){return this.parsedLineCount<=this.parserOptions.skipLines}}])&&v(a.prototype,u),y}(e.Transform);T.CsvParserStream=o}).call(this,h("timers").setImmediate)},{"./parser":162,"./transforms":165,stream:506,string_decoder:520,timers:521}],151:[function(h,I,T){var b=function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(T,"__esModule",{value:!0}),T.ParserOptions=void 0;var m=b(h("lodash.escaperegexp")),v=b(h("lodash.isnil"));T.ParserOptions=function d(p){var c;if(function(l,s){if(!(l instanceof s))throw new TypeError("Cannot call a class as a function")}(this,d),this.objectMode=!0,this.delimiter=",",this.ignoreEmpty=!1,this.quote='"',this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn="\r",this.encoding="utf8",this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,p||{}),this.delimiter.length>1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=m.default(this.delimiter),this.escapeChar=(c=this.escape)!==null&&c!==void 0?c:this.quote,this.supportsComments=!v.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp("([^\\s]|\\r\\n|\\n|\\r|".concat(this.escapedDelimiter,")")),this.maxRows>0&&(this.limitRows=!0)}},{"lodash.escaperegexp":426,"lodash.isnil":431}],152:[function(h,I,T){var b=Object.create?function(t,r,o,n){n===void 0&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[o]}})}:function(t,r,o,n){n===void 0&&(n=o),t[n]=r[o]},m=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r},v=function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o in t)o!=="default"&&Object.hasOwnProperty.call(t,o)&&b(r,t,o);return m(r,t),r},d=function(t,r){for(var o in t)o==="default"||r.hasOwnProperty(o)||b(r,t,o)};Object.defineProperty(T,"__esModule",{value:!0}),T.parseString=T.parseFile=T.parseStream=T.parse=void 0;var p=v(h("fs")),c=h("stream"),l=h("./ParserOptions"),s=h("./CsvParserStream");d(h("./types"),T);var i=h("./CsvParserStream");Object.defineProperty(T,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}});var e=h("./ParserOptions");Object.defineProperty(T,"ParserOptions",{enumerable:!0,get:function(){return e.ParserOptions}}),T.parse=function(t){return new s.CsvParserStream(new l.ParserOptions(t))},T.parseStream=function(t,r){return t.pipe(new s.CsvParserStream(new l.ParserOptions(r)))},T.parseFile=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.createReadStream(t).pipe(new s.CsvParserStream(new l.ParserOptions(r)))},T.parseString=function(t,r){var o=new c.Readable;return o.push(t),o.push(null),o.pipe(new s.CsvParserStream(new l.ParserOptions(r)))}},{"./CsvParserStream":150,"./ParserOptions":151,"./types":166,fs:215,stream:506}],153:[function(h,I,T){function b(l,s){for(var i=0;ithis.cursor}},{key:"nextNonSpaceToken",get:function(){var s=this.lineFromCursor,i=this.parserOptions.NEXT_TOKEN_REGEXP;if(s.search(i)===-1)return null;var e=i.exec(s);if(e==null)return null;var t=e[1],r=this.cursor+(e.index||0);return new m.Token({token:t,startCursor:r,endCursor:r+t.length-1})}},{key:"nextCharacterToken",get:function(){var s=this.cursor;return this.lineLength<=s?null:new m.Token({token:this.line[s],startCursor:s,endCursor:s})}},{key:"lineFromCursor",get:function(){return this.line.substr(this.cursor)}}])&&b(c.prototype,l),p}();T.Scanner=d},{"./Token":156}],156:[function(h,I,T){function b(v,d){for(var p=0;pthis.headersLength){if(!r.strictColumnHandling)throw new Error("Unexpected Error: column header mismatch expected: ".concat(this.headersLength," columns got: ").concat(t.length));return{row:t,isValid:!1,reason:"Column header mismatch expected: ".concat(this.headersLength," columns got: ").concat(t.length)}}return r.strictColumnHandling&&t.length1});throw new Error("Duplicate headers found ".concat(JSON.stringify(a)))}this.headers=t,this.receivedHeaders=!0,this.headersLength=((r=this.headers)===null||r===void 0?void 0:r.length)||0}}])&&b(i.prototype,e),s}();T.HeaderTransformer=l},{"lodash.groupby":427,"lodash.isfunction":430,"lodash.isundefined":432,"lodash.uniq":433}],164:[function(h,I,T){function b(c,l){for(var s=0;s>6],n=(32&r)==0;if((31&r)==31){var a=r;for(r=0;(128&a)==128;){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:o,primitive:n,tag:r,tagStr:p.tag[r]}}function i(e,t,r){var o=e.readUInt8(r);if(e.isError(o))return o;if(!t&&o===128)return null;if((128&o)==0)return o;var n=127&o;if(n>4)return e.error("length octect is too long");o=0;for(var a=0;a=31?M.error("Multi-octet tag encoding unsupported"):(R||(O|=32),O|=d.tagClassByName[E||"universal"]<<6)}(s,i,e,this.reporter);if(t.length<128){var o=m.alloc(2);return o[0]=r,o[1]=t.length,this._createEncoderBuffer([o,t])}for(var n=1,a=t.length;a>=256;a>>=8)n++;var u=m.alloc(2+n);u[0]=r,u[1]=128|n;for(var f=1+n,y=t.length;y>0;f--,y>>=8)u[f]=255&y;return this._createEncoderBuffer([u,t])},c.prototype._encodeStr=function(s,i){if(i==="bitstr")return this._createEncoderBuffer([0|s.unused,s.data]);if(i==="bmpstr"){for(var e=m.alloc(2*s.length),t=0;t=40)return this.reporter.error("Second objid identifier OOB");s.splice(0,2,40*s[0]+s[1])}for(var o=0,n=0;n=128;a>>=7)o++}for(var u=m.alloc(o),f=u.length-1,y=s.length-1;y>=0;y--){var w=s[y];for(u[f--]=127&w;(w>>=7)>0;)u[f--]=128|127&w}return this._createEncoderBuffer(u)},c.prototype._encodeTime=function(s,i){var e,t=new Date(s);return i==="gentime"?e=[l(t.getUTCFullYear()),l(t.getUTCMonth()+1),l(t.getUTCDate()),l(t.getUTCHours()),l(t.getUTCMinutes()),l(t.getUTCSeconds()),"Z"].join(""):i==="utctime"?e=[l(t.getUTCFullYear()%100),l(t.getUTCMonth()+1),l(t.getUTCDate()),l(t.getUTCHours()),l(t.getUTCMinutes()),l(t.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+i+" time is not supported yet"),this._encodeStr(e,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(s,i){if(typeof s=="string"){if(!i)return this.reporter.error("String int or enum given, but no values map");if(!i.hasOwnProperty(s))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(s));s=i[s]}if(typeof s!="number"&&!m.isBuffer(s)){var e=s.toArray();!s.sign&&128&e[0]&&e.unshift(0),s=m.from(e)}if(m.isBuffer(s)){var t=s.length;s.length===0&&t++;var r=m.alloc(t);return s.copy(r),s.length===0&&(r[0]=0),this._createEncoderBuffer(r)}if(s<128)return this._createEncoderBuffer(s);if(s<256)return this._createEncoderBuffer([0,s]);for(var o=1,n=s;n>=256;n>>=8)o++;for(var a=new Array(o),u=a.length-1;u>=0;u--)a[u]=255&s,s>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(m.from(a))},c.prototype._encodeBool=function(s){return this._createEncoderBuffer(s?255:0)},c.prototype._use=function(s,i){return typeof s=="function"&&(s=s(i)),s._getEncoder("der").tree},c.prototype._skipDefault=function(s,i,e){var t,r=this._baseState;if(r.default===null)return!1;var o=s.join();if(r.defaultBuffer===void 0&&(r.defaultBuffer=this._encodeValue(r.default,i,e).join()),o.length!==r.defaultBuffer.length)return!1;for(t=0;t=49&&C<=54?C-49+10:C>=17&&C<=22?C-17+10:15&C}return j}function i(_,S,g,j){for(var x=0,k=Math.min(_.length,g),C=S;C=49?D-49+10:D>=17?D-17+10:D}return x}c.isBN=function(_){return _ instanceof c||_!==null&&b(_)==="object"&&_.constructor.wordSize===c.wordSize&&Array.isArray(_.words)},c.max=function(_,S){return _.cmp(S)>0?_:S},c.min=function(_,S){return _.cmp(S)<0?_:S},c.prototype._init=function(_,S,g){if(typeof _=="number")return this._initNumber(_,S,g);if(b(_)==="object")return this._initArray(_,S,g);S==="hex"&&(S=16),d(S===(0|S)&&S>=2&&S<=36);var j=0;(_=_.toString().replace(/\s+/g,""))[0]==="-"&&j++,S===16?this._parseHex(_,j):this._parseBase(_,S,j),_[0]==="-"&&(this.negative=1),this.strip(),g==="le"&&this._initArray(this.toArray(),S,g)},c.prototype._initNumber=function(_,S,g){_<0&&(this.negative=1,_=-_),_<67108864?(this.words=[67108863&_],this.length=1):_<4503599627370496?(this.words=[67108863&_,_/67108864&67108863],this.length=2):(d(_<9007199254740992),this.words=[67108863&_,_/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),S,g)},c.prototype._initArray=function(_,S,g){if(d(typeof _.length=="number"),_.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(_.length/3),this.words=new Array(this.length);for(var j=0;j=0;j-=3)k=_[j]|_[j-1]<<8|_[j-2]<<16,this.words[x]|=k<>>26-C&67108863,(C+=24)>=26&&(C-=26,x++);else if(g==="le")for(j=0,x=0;j<_.length;j+=3)k=_[j]|_[j+1]<<8|_[j+2]<<16,this.words[x]|=k<>>26-C&67108863,(C+=24)>=26&&(C-=26,x++);return this.strip()},c.prototype._parseHex=function(_,S){this.length=Math.ceil((_.length-S)/6),this.words=new Array(this.length);for(var g=0;g=S;g-=6)x=s(_,g,g+6),this.words[j]|=x<>>26-k&4194303,(k+=24)>=26&&(k-=26,j++);g+6!==S&&(x=s(_,S,g+6),this.words[j]|=x<>>26-k&4194303),this.strip()},c.prototype._parseBase=function(_,S,g){this.words=[0],this.length=1;for(var j=0,x=1;x<=67108863;x*=S)j++;j--,x=x/S|0;for(var k=_.length-g,C=k%j,D=Math.min(k,k-C)+g,F=0,B=g;B1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?""};var e=["","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"],t=[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],r=[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 o(_,S,g){g.negative=S.negative^_.negative;var j=_.length+S.length|0;g.length=j,j=j-1|0;var x=0|_.words[0],k=0|S.words[0],C=x*k,D=67108863&C,F=C/67108864|0;g.words[0]=D;for(var B=1;B>>26,H=67108863&F,V=Math.min(B,S.length-1),q=Math.max(0,B-_.length+1);q<=V;q++){var $=B-q|0;U+=(C=(x=0|_.words[$])*(k=0|S.words[q])+H)/67108864|0,H=67108863&C}g.words[B]=0|H,F=0|U}return F!==0?g.words[B]=0|F:g.length--,g.strip()}c.prototype.toString=function(_,S){var g;if(S=0|S||1,(_=_||10)===16||_==="hex"){g="";for(var j=0,x=0,k=0;k>>24-j&16777215)!==0||k!==this.length-1?e[6-D.length]+D+g:D+g,(j+=2)>=26&&(j-=26,k--)}for(x!==0&&(g=x.toString(16)+g);g.length%S!=0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(_===(0|_)&&_>=2&&_<=36){var F=t[_],B=r[_];g="";var U=this.clone();for(U.negative=0;!U.isZero();){var H=U.modn(B).toString(_);g=(U=U.idivn(B)).isZero()?H+g:e[F-H.length]+H+g}for(this.isZero()&&(g="0"+g);g.length%S!=0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}d(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var _=this.words[0];return this.length===2?_+=67108864*this.words[1]:this.length===3&&this.words[2]===1?_+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-_:_},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(_,S){return d(l!==void 0),this.toArrayLike(l,_,S)},c.prototype.toArray=function(_,S){return this.toArrayLike(Array,_,S)},c.prototype.toArrayLike=function(_,S,g){var j=this.byteLength(),x=g||Math.max(1,j);d(j<=x,"byte array longer than desired length"),d(x>0,"Requested array length <= 0"),this.strip();var k,C,D=S==="le",F=new _(x),B=this.clone();if(D){for(C=0;!B.isZero();C++)k=B.andln(255),B.iushrn(8),F[C]=k;for(;C=4096&&(g+=13,S>>>=13),S>=64&&(g+=7,S>>>=7),S>=8&&(g+=4,S>>>=4),S>=2&&(g+=2,S>>>=2),g+S},c.prototype._zeroBits=function(_){if(_===0)return 26;var S=_,g=0;return(8191&S)==0&&(g+=13,S>>>=13),(127&S)==0&&(g+=7,S>>>=7),(15&S)==0&&(g+=4,S>>>=4),(3&S)==0&&(g+=2,S>>>=2),(1&S)==0&&g++,g},c.prototype.bitLength=function(){var _=this.words[this.length-1],S=this._countBits(_);return 26*(this.length-1)+S},c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var _=0,S=0;S_.length?this.clone().ior(_):_.clone().ior(this)},c.prototype.uor=function(_){return this.length>_.length?this.clone().iuor(_):_.clone().iuor(this)},c.prototype.iuand=function(_){var S;S=this.length>_.length?_:this;for(var g=0;g_.length?this.clone().iand(_):_.clone().iand(this)},c.prototype.uand=function(_){return this.length>_.length?this.clone().iuand(_):_.clone().iuand(this)},c.prototype.iuxor=function(_){var S,g;this.length>_.length?(S=this,g=_):(S=_,g=this);for(var j=0;j_.length?this.clone().ixor(_):_.clone().ixor(this)},c.prototype.uxor=function(_){return this.length>_.length?this.clone().iuxor(_):_.clone().iuxor(this)},c.prototype.inotn=function(_){d(typeof _=="number"&&_>=0);var S=0|Math.ceil(_/26),g=_%26;this._expand(S),g>0&&S--;for(var j=0;j0&&(this.words[j]=~this.words[j]&67108863>>26-g),this.strip()},c.prototype.notn=function(_){return this.clone().inotn(_)},c.prototype.setn=function(_,S){d(typeof _=="number"&&_>=0);var g=_/26|0,j=_%26;return this._expand(g+1),this.words[g]=S?this.words[g]|1<_.length?(g=this,j=_):(g=_,j=this);for(var x=0,k=0;k>>26;for(;x!==0&&k>>26;if(this.length=g.length,x!==0)this.words[this.length]=x,this.length++;else if(g!==this)for(;k_.length?this.clone().iadd(_):_.clone().iadd(this)},c.prototype.isub=function(_){if(_.negative!==0){_.negative=0;var S=this.iadd(_);return _.negative=1,S._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(_),this.negative=1,this._normSign();var g,j,x=this.cmp(_);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;x>0?(g=this,j=_):(g=_,j=this);for(var k=0,C=0;C>26,this.words[C]=67108863&S;for(;k!==0&&C>26,this.words[C]=67108863&S;if(k===0&&C>>13,q=0|C[1],$=8191&q,L=q>>>13,A=0|C[2],N=8191&A,z=A>>>13,W=0|C[3],X=8191&W,K=W>>>13,ie=0|C[4],Q=8191&ie,ue=ie>>>13,de=0|C[5],ce=8191&de,Ee=de>>>13,_e=0|C[6],ve=8191&_e,xe=_e>>>13,Re=0|C[7],fe=8191&Re,Z=Re>>>13,ee=0|C[8],J=8191&ee,oe=ee>>>13,ne=0|C[9],ae=8191&ne,re=ne>>>13,he=0|D[0],le=8191&he,pe=he>>>13,Se=0|D[1],ge=8191&Se,De=Se>>>13,Ae=0|D[2],Be=8191&Ae,Ze=Ae>>>13,rt=0|D[3],Ie=8191&rt,ze=rt>>>13,me=0|D[4],Fe=8191&me,Ge=me>>>13,Ye=0|D[5],He=8191&Ye,tt=Ye>>>13,et=0|D[6],Ve=8191&et,ot=et>>>13,G=0|D[7],te=8191&G,be=G>>>13,je=0|D[8],Te=8191&je,Pe=je>>>13,Le=0|D[9],Ce=8191&Le,Ke=Le>>>13;g.negative=_.negative^S.negative,g.length=19;var qe=(B+(j=Math.imul(H,le))|0)+((8191&(x=(x=Math.imul(H,pe))+Math.imul(V,le)|0))<<13)|0;B=((k=Math.imul(V,pe))+(x>>>13)|0)+(qe>>>26)|0,qe&=67108863,j=Math.imul($,le),x=(x=Math.imul($,pe))+Math.imul(L,le)|0,k=Math.imul(L,pe);var Ue=(B+(j=j+Math.imul(H,ge)|0)|0)+((8191&(x=(x=x+Math.imul(H,De)|0)+Math.imul(V,ge)|0))<<13)|0;B=((k=k+Math.imul(V,De)|0)+(x>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,j=Math.imul(N,le),x=(x=Math.imul(N,pe))+Math.imul(z,le)|0,k=Math.imul(z,pe),j=j+Math.imul($,ge)|0,x=(x=x+Math.imul($,De)|0)+Math.imul(L,ge)|0,k=k+Math.imul(L,De)|0;var ft=(B+(j=j+Math.imul(H,Be)|0)|0)+((8191&(x=(x=x+Math.imul(H,Ze)|0)+Math.imul(V,Be)|0))<<13)|0;B=((k=k+Math.imul(V,Ze)|0)+(x>>>13)|0)+(ft>>>26)|0,ft&=67108863,j=Math.imul(X,le),x=(x=Math.imul(X,pe))+Math.imul(K,le)|0,k=Math.imul(K,pe),j=j+Math.imul(N,ge)|0,x=(x=x+Math.imul(N,De)|0)+Math.imul(z,ge)|0,k=k+Math.imul(z,De)|0,j=j+Math.imul($,Be)|0,x=(x=x+Math.imul($,Ze)|0)+Math.imul(L,Be)|0,k=k+Math.imul(L,Ze)|0;var lt=(B+(j=j+Math.imul(H,Ie)|0)|0)+((8191&(x=(x=x+Math.imul(H,ze)|0)+Math.imul(V,Ie)|0))<<13)|0;B=((k=k+Math.imul(V,ze)|0)+(x>>>13)|0)+(lt>>>26)|0,lt&=67108863,j=Math.imul(Q,le),x=(x=Math.imul(Q,pe))+Math.imul(ue,le)|0,k=Math.imul(ue,pe),j=j+Math.imul(X,ge)|0,x=(x=x+Math.imul(X,De)|0)+Math.imul(K,ge)|0,k=k+Math.imul(K,De)|0,j=j+Math.imul(N,Be)|0,x=(x=x+Math.imul(N,Ze)|0)+Math.imul(z,Be)|0,k=k+Math.imul(z,Ze)|0,j=j+Math.imul($,Ie)|0,x=(x=x+Math.imul($,ze)|0)+Math.imul(L,Ie)|0,k=k+Math.imul(L,ze)|0;var at=(B+(j=j+Math.imul(H,Fe)|0)|0)+((8191&(x=(x=x+Math.imul(H,Ge)|0)+Math.imul(V,Fe)|0))<<13)|0;B=((k=k+Math.imul(V,Ge)|0)+(x>>>13)|0)+(at>>>26)|0,at&=67108863,j=Math.imul(ce,le),x=(x=Math.imul(ce,pe))+Math.imul(Ee,le)|0,k=Math.imul(Ee,pe),j=j+Math.imul(Q,ge)|0,x=(x=x+Math.imul(Q,De)|0)+Math.imul(ue,ge)|0,k=k+Math.imul(ue,De)|0,j=j+Math.imul(X,Be)|0,x=(x=x+Math.imul(X,Ze)|0)+Math.imul(K,Be)|0,k=k+Math.imul(K,Ze)|0,j=j+Math.imul(N,Ie)|0,x=(x=x+Math.imul(N,ze)|0)+Math.imul(z,Ie)|0,k=k+Math.imul(z,ze)|0,j=j+Math.imul($,Fe)|0,x=(x=x+Math.imul($,Ge)|0)+Math.imul(L,Fe)|0,k=k+Math.imul(L,Ge)|0;var dt=(B+(j=j+Math.imul(H,He)|0)|0)+((8191&(x=(x=x+Math.imul(H,tt)|0)+Math.imul(V,He)|0))<<13)|0;B=((k=k+Math.imul(V,tt)|0)+(x>>>13)|0)+(dt>>>26)|0,dt&=67108863,j=Math.imul(ve,le),x=(x=Math.imul(ve,pe))+Math.imul(xe,le)|0,k=Math.imul(xe,pe),j=j+Math.imul(ce,ge)|0,x=(x=x+Math.imul(ce,De)|0)+Math.imul(Ee,ge)|0,k=k+Math.imul(Ee,De)|0,j=j+Math.imul(Q,Be)|0,x=(x=x+Math.imul(Q,Ze)|0)+Math.imul(ue,Be)|0,k=k+Math.imul(ue,Ze)|0,j=j+Math.imul(X,Ie)|0,x=(x=x+Math.imul(X,ze)|0)+Math.imul(K,Ie)|0,k=k+Math.imul(K,ze)|0,j=j+Math.imul(N,Fe)|0,x=(x=x+Math.imul(N,Ge)|0)+Math.imul(z,Fe)|0,k=k+Math.imul(z,Ge)|0,j=j+Math.imul($,He)|0,x=(x=x+Math.imul($,tt)|0)+Math.imul(L,He)|0,k=k+Math.imul(L,tt)|0;var pt=(B+(j=j+Math.imul(H,Ve)|0)|0)+((8191&(x=(x=x+Math.imul(H,ot)|0)+Math.imul(V,Ve)|0))<<13)|0;B=((k=k+Math.imul(V,ot)|0)+(x>>>13)|0)+(pt>>>26)|0,pt&=67108863,j=Math.imul(fe,le),x=(x=Math.imul(fe,pe))+Math.imul(Z,le)|0,k=Math.imul(Z,pe),j=j+Math.imul(ve,ge)|0,x=(x=x+Math.imul(ve,De)|0)+Math.imul(xe,ge)|0,k=k+Math.imul(xe,De)|0,j=j+Math.imul(ce,Be)|0,x=(x=x+Math.imul(ce,Ze)|0)+Math.imul(Ee,Be)|0,k=k+Math.imul(Ee,Ze)|0,j=j+Math.imul(Q,Ie)|0,x=(x=x+Math.imul(Q,ze)|0)+Math.imul(ue,Ie)|0,k=k+Math.imul(ue,ze)|0,j=j+Math.imul(X,Fe)|0,x=(x=x+Math.imul(X,Ge)|0)+Math.imul(K,Fe)|0,k=k+Math.imul(K,Ge)|0,j=j+Math.imul(N,He)|0,x=(x=x+Math.imul(N,tt)|0)+Math.imul(z,He)|0,k=k+Math.imul(z,tt)|0,j=j+Math.imul($,Ve)|0,x=(x=x+Math.imul($,ot)|0)+Math.imul(L,Ve)|0,k=k+Math.imul(L,ot)|0;var yt=(B+(j=j+Math.imul(H,te)|0)|0)+((8191&(x=(x=x+Math.imul(H,be)|0)+Math.imul(V,te)|0))<<13)|0;B=((k=k+Math.imul(V,be)|0)+(x>>>13)|0)+(yt>>>26)|0,yt&=67108863,j=Math.imul(J,le),x=(x=Math.imul(J,pe))+Math.imul(oe,le)|0,k=Math.imul(oe,pe),j=j+Math.imul(fe,ge)|0,x=(x=x+Math.imul(fe,De)|0)+Math.imul(Z,ge)|0,k=k+Math.imul(Z,De)|0,j=j+Math.imul(ve,Be)|0,x=(x=x+Math.imul(ve,Ze)|0)+Math.imul(xe,Be)|0,k=k+Math.imul(xe,Ze)|0,j=j+Math.imul(ce,Ie)|0,x=(x=x+Math.imul(ce,ze)|0)+Math.imul(Ee,Ie)|0,k=k+Math.imul(Ee,ze)|0,j=j+Math.imul(Q,Fe)|0,x=(x=x+Math.imul(Q,Ge)|0)+Math.imul(ue,Fe)|0,k=k+Math.imul(ue,Ge)|0,j=j+Math.imul(X,He)|0,x=(x=x+Math.imul(X,tt)|0)+Math.imul(K,He)|0,k=k+Math.imul(K,tt)|0,j=j+Math.imul(N,Ve)|0,x=(x=x+Math.imul(N,ot)|0)+Math.imul(z,Ve)|0,k=k+Math.imul(z,ot)|0,j=j+Math.imul($,te)|0,x=(x=x+Math.imul($,be)|0)+Math.imul(L,te)|0,k=k+Math.imul(L,be)|0;var Y=(B+(j=j+Math.imul(H,Te)|0)|0)+((8191&(x=(x=x+Math.imul(H,Pe)|0)+Math.imul(V,Te)|0))<<13)|0;B=((k=k+Math.imul(V,Pe)|0)+(x>>>13)|0)+(Y>>>26)|0,Y&=67108863,j=Math.imul(ae,le),x=(x=Math.imul(ae,pe))+Math.imul(re,le)|0,k=Math.imul(re,pe),j=j+Math.imul(J,ge)|0,x=(x=x+Math.imul(J,De)|0)+Math.imul(oe,ge)|0,k=k+Math.imul(oe,De)|0,j=j+Math.imul(fe,Be)|0,x=(x=x+Math.imul(fe,Ze)|0)+Math.imul(Z,Be)|0,k=k+Math.imul(Z,Ze)|0,j=j+Math.imul(ve,Ie)|0,x=(x=x+Math.imul(ve,ze)|0)+Math.imul(xe,Ie)|0,k=k+Math.imul(xe,ze)|0,j=j+Math.imul(ce,Fe)|0,x=(x=x+Math.imul(ce,Ge)|0)+Math.imul(Ee,Fe)|0,k=k+Math.imul(Ee,Ge)|0,j=j+Math.imul(Q,He)|0,x=(x=x+Math.imul(Q,tt)|0)+Math.imul(ue,He)|0,k=k+Math.imul(ue,tt)|0,j=j+Math.imul(X,Ve)|0,x=(x=x+Math.imul(X,ot)|0)+Math.imul(K,Ve)|0,k=k+Math.imul(K,ot)|0,j=j+Math.imul(N,te)|0,x=(x=x+Math.imul(N,be)|0)+Math.imul(z,te)|0,k=k+Math.imul(z,be)|0,j=j+Math.imul($,Te)|0,x=(x=x+Math.imul($,Pe)|0)+Math.imul(L,Te)|0,k=k+Math.imul(L,Pe)|0;var se=(B+(j=j+Math.imul(H,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(H,Ke)|0)+Math.imul(V,Ce)|0))<<13)|0;B=((k=k+Math.imul(V,Ke)|0)+(x>>>13)|0)+(se>>>26)|0,se&=67108863,j=Math.imul(ae,ge),x=(x=Math.imul(ae,De))+Math.imul(re,ge)|0,k=Math.imul(re,De),j=j+Math.imul(J,Be)|0,x=(x=x+Math.imul(J,Ze)|0)+Math.imul(oe,Be)|0,k=k+Math.imul(oe,Ze)|0,j=j+Math.imul(fe,Ie)|0,x=(x=x+Math.imul(fe,ze)|0)+Math.imul(Z,Ie)|0,k=k+Math.imul(Z,ze)|0,j=j+Math.imul(ve,Fe)|0,x=(x=x+Math.imul(ve,Ge)|0)+Math.imul(xe,Fe)|0,k=k+Math.imul(xe,Ge)|0,j=j+Math.imul(ce,He)|0,x=(x=x+Math.imul(ce,tt)|0)+Math.imul(Ee,He)|0,k=k+Math.imul(Ee,tt)|0,j=j+Math.imul(Q,Ve)|0,x=(x=x+Math.imul(Q,ot)|0)+Math.imul(ue,Ve)|0,k=k+Math.imul(ue,ot)|0,j=j+Math.imul(X,te)|0,x=(x=x+Math.imul(X,be)|0)+Math.imul(K,te)|0,k=k+Math.imul(K,be)|0,j=j+Math.imul(N,Te)|0,x=(x=x+Math.imul(N,Pe)|0)+Math.imul(z,Te)|0,k=k+Math.imul(z,Pe)|0;var ye=(B+(j=j+Math.imul($,Ce)|0)|0)+((8191&(x=(x=x+Math.imul($,Ke)|0)+Math.imul(L,Ce)|0))<<13)|0;B=((k=k+Math.imul(L,Ke)|0)+(x>>>13)|0)+(ye>>>26)|0,ye&=67108863,j=Math.imul(ae,Be),x=(x=Math.imul(ae,Ze))+Math.imul(re,Be)|0,k=Math.imul(re,Ze),j=j+Math.imul(J,Ie)|0,x=(x=x+Math.imul(J,ze)|0)+Math.imul(oe,Ie)|0,k=k+Math.imul(oe,ze)|0,j=j+Math.imul(fe,Fe)|0,x=(x=x+Math.imul(fe,Ge)|0)+Math.imul(Z,Fe)|0,k=k+Math.imul(Z,Ge)|0,j=j+Math.imul(ve,He)|0,x=(x=x+Math.imul(ve,tt)|0)+Math.imul(xe,He)|0,k=k+Math.imul(xe,tt)|0,j=j+Math.imul(ce,Ve)|0,x=(x=x+Math.imul(ce,ot)|0)+Math.imul(Ee,Ve)|0,k=k+Math.imul(Ee,ot)|0,j=j+Math.imul(Q,te)|0,x=(x=x+Math.imul(Q,be)|0)+Math.imul(ue,te)|0,k=k+Math.imul(ue,be)|0,j=j+Math.imul(X,Te)|0,x=(x=x+Math.imul(X,Pe)|0)+Math.imul(K,Te)|0,k=k+Math.imul(K,Pe)|0;var we=(B+(j=j+Math.imul(N,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(N,Ke)|0)+Math.imul(z,Ce)|0))<<13)|0;B=((k=k+Math.imul(z,Ke)|0)+(x>>>13)|0)+(we>>>26)|0,we&=67108863,j=Math.imul(ae,Ie),x=(x=Math.imul(ae,ze))+Math.imul(re,Ie)|0,k=Math.imul(re,ze),j=j+Math.imul(J,Fe)|0,x=(x=x+Math.imul(J,Ge)|0)+Math.imul(oe,Fe)|0,k=k+Math.imul(oe,Ge)|0,j=j+Math.imul(fe,He)|0,x=(x=x+Math.imul(fe,tt)|0)+Math.imul(Z,He)|0,k=k+Math.imul(Z,tt)|0,j=j+Math.imul(ve,Ve)|0,x=(x=x+Math.imul(ve,ot)|0)+Math.imul(xe,Ve)|0,k=k+Math.imul(xe,ot)|0,j=j+Math.imul(ce,te)|0,x=(x=x+Math.imul(ce,be)|0)+Math.imul(Ee,te)|0,k=k+Math.imul(Ee,be)|0,j=j+Math.imul(Q,Te)|0,x=(x=x+Math.imul(Q,Pe)|0)+Math.imul(ue,Te)|0,k=k+Math.imul(ue,Pe)|0;var Me=(B+(j=j+Math.imul(X,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(X,Ke)|0)+Math.imul(K,Ce)|0))<<13)|0;B=((k=k+Math.imul(K,Ke)|0)+(x>>>13)|0)+(Me>>>26)|0,Me&=67108863,j=Math.imul(ae,Fe),x=(x=Math.imul(ae,Ge))+Math.imul(re,Fe)|0,k=Math.imul(re,Ge),j=j+Math.imul(J,He)|0,x=(x=x+Math.imul(J,tt)|0)+Math.imul(oe,He)|0,k=k+Math.imul(oe,tt)|0,j=j+Math.imul(fe,Ve)|0,x=(x=x+Math.imul(fe,ot)|0)+Math.imul(Z,Ve)|0,k=k+Math.imul(Z,ot)|0,j=j+Math.imul(ve,te)|0,x=(x=x+Math.imul(ve,be)|0)+Math.imul(xe,te)|0,k=k+Math.imul(xe,be)|0,j=j+Math.imul(ce,Te)|0,x=(x=x+Math.imul(ce,Pe)|0)+Math.imul(Ee,Te)|0,k=k+Math.imul(Ee,Pe)|0;var ke=(B+(j=j+Math.imul(Q,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(Q,Ke)|0)+Math.imul(ue,Ce)|0))<<13)|0;B=((k=k+Math.imul(ue,Ke)|0)+(x>>>13)|0)+(ke>>>26)|0,ke&=67108863,j=Math.imul(ae,He),x=(x=Math.imul(ae,tt))+Math.imul(re,He)|0,k=Math.imul(re,tt),j=j+Math.imul(J,Ve)|0,x=(x=x+Math.imul(J,ot)|0)+Math.imul(oe,Ve)|0,k=k+Math.imul(oe,ot)|0,j=j+Math.imul(fe,te)|0,x=(x=x+Math.imul(fe,be)|0)+Math.imul(Z,te)|0,k=k+Math.imul(Z,be)|0,j=j+Math.imul(ve,Te)|0,x=(x=x+Math.imul(ve,Pe)|0)+Math.imul(xe,Te)|0,k=k+Math.imul(xe,Pe)|0;var Oe=(B+(j=j+Math.imul(ce,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(ce,Ke)|0)+Math.imul(Ee,Ce)|0))<<13)|0;B=((k=k+Math.imul(Ee,Ke)|0)+(x>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,j=Math.imul(ae,Ve),x=(x=Math.imul(ae,ot))+Math.imul(re,Ve)|0,k=Math.imul(re,ot),j=j+Math.imul(J,te)|0,x=(x=x+Math.imul(J,be)|0)+Math.imul(oe,te)|0,k=k+Math.imul(oe,be)|0,j=j+Math.imul(fe,Te)|0,x=(x=x+Math.imul(fe,Pe)|0)+Math.imul(Z,Te)|0,k=k+Math.imul(Z,Pe)|0;var Xe=(B+(j=j+Math.imul(ve,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(ve,Ke)|0)+Math.imul(xe,Ce)|0))<<13)|0;B=((k=k+Math.imul(xe,Ke)|0)+(x>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,j=Math.imul(ae,te),x=(x=Math.imul(ae,be))+Math.imul(re,te)|0,k=Math.imul(re,be),j=j+Math.imul(J,Te)|0,x=(x=x+Math.imul(J,Pe)|0)+Math.imul(oe,Te)|0,k=k+Math.imul(oe,Pe)|0;var $e=(B+(j=j+Math.imul(fe,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(fe,Ke)|0)+Math.imul(Z,Ce)|0))<<13)|0;B=((k=k+Math.imul(Z,Ke)|0)+(x>>>13)|0)+($e>>>26)|0,$e&=67108863,j=Math.imul(ae,Te),x=(x=Math.imul(ae,Pe))+Math.imul(re,Te)|0,k=Math.imul(re,Pe);var We=(B+(j=j+Math.imul(J,Ce)|0)|0)+((8191&(x=(x=x+Math.imul(J,Ke)|0)+Math.imul(oe,Ce)|0))<<13)|0;B=((k=k+Math.imul(oe,Ke)|0)+(x>>>13)|0)+(We>>>26)|0,We&=67108863;var Ne=(B+(j=Math.imul(ae,Ce))|0)+((8191&(x=(x=Math.imul(ae,Ke))+Math.imul(re,Ce)|0))<<13)|0;return B=((k=Math.imul(re,Ke))+(x>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,F[0]=qe,F[1]=Ue,F[2]=ft,F[3]=lt,F[4]=at,F[5]=dt,F[6]=pt,F[7]=yt,F[8]=Y,F[9]=se,F[10]=ye,F[11]=we,F[12]=Me,F[13]=ke,F[14]=Oe,F[15]=Xe,F[16]=$e,F[17]=We,F[18]=Ne,B!==0&&(F[19]=B,g.length++),g};function a(_,S,g){return new u().mulp(_,S,g)}function u(_,S){this.x=_,this.y=S}Math.imul||(n=o),c.prototype.mulTo=function(_,S){var g=this.length+_.length;return this.length===10&&_.length===10?n(this,_,S):g<63?o(this,_,S):g<1024?function(j,x,k){k.negative=x.negative^j.negative,k.length=j.length+x.length;for(var C=0,D=0,F=0;F>>26)|0)>>>26,B&=67108863}k.words[F]=U,C=B,B=D}return C!==0?k.words[F]=C:k.length--,k.strip()}(this,_,S):a(this,_,S)},u.prototype.makeRBT=function(_){for(var S=new Array(_),g=c.prototype._countBits(_)-1,j=0;j<_;j++)S[j]=this.revBin(j,g,_);return S},u.prototype.revBin=function(_,S,g){if(_===0||_===g-1)return _;for(var j=0,x=0;x>=1;return j},u.prototype.permute=function(_,S,g,j,x,k){for(var C=0;C>>=1)x++;return 1<>>=13,g[2*k+1]=8191&x,x>>>=13;for(k=2*S;k>=26,S+=j/67108864|0,S+=x>>>26,this.words[g]=67108863&x}return S!==0&&(this.words[g]=S,this.length++),this},c.prototype.muln=function(_){return this.clone().imuln(_)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(_){var S=function(k){for(var C=new Array(k.bitLength()),D=0;D>>B}return C}(_);if(S.length===0)return new c(1);for(var g=this,j=0;j=0);var S,g=_%26,j=(_-g)/26,x=67108863>>>26-g<<26-g;if(g!==0){var k=0;for(S=0;S>>26-g}k&&(this.words[S]=k,this.length++)}if(j!==0){for(S=this.length-1;S>=0;S--)this.words[S+j]=this.words[S];for(S=0;S=0),j=S?(S-S%26)/26:0;var x=_%26,k=Math.min((_-x)/26,this.length),C=67108863^67108863>>>x<k)for(this.length-=k,F=0;F=0&&(B!==0||F>=j);F--){var U=0|this.words[F];this.words[F]=B<<26-x|U>>>x,B=U&C}return D&&B!==0&&(D.words[D.length++]=B),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(_,S,g){return d(this.negative===0),this.iushrn(_,S,g)},c.prototype.shln=function(_){return this.clone().ishln(_)},c.prototype.ushln=function(_){return this.clone().iushln(_)},c.prototype.shrn=function(_){return this.clone().ishrn(_)},c.prototype.ushrn=function(_){return this.clone().iushrn(_)},c.prototype.testn=function(_){d(typeof _=="number"&&_>=0);var S=_%26,g=(_-S)/26,j=1<=0);var S=_%26,g=(_-S)/26;if(d(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(S!==0&&g++,this.length=Math.min(g,this.length),S!==0){var j=67108863^67108863>>>S<=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},c.prototype.isubn=function(_){if(d(typeof _=="number"),d(_<67108864),_<0)return this.iaddn(-_);if(this.negative!==0)return this.negative=0,this.iaddn(_),this.negative=1,this;if(this.words[0]-=_,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S>26)-(D/67108864|0),this.words[j+g]=67108863&x}for(;j>26,this.words[j+g]=67108863&x;if(C===0)return this.strip();for(d(C===-1),C=0,j=0;j>26,this.words[j]=67108863&x;return this.negative=1,this.strip()},c.prototype._wordDiv=function(_,S){var g=(this.length,_.length),j=this.clone(),x=_,k=0|x.words[x.length-1];(g=26-this._countBits(k))!==0&&(x=x.ushln(g),j.iushln(g),k=0|x.words[x.length-1]);var C,D=j.length-x.length;if(S!=="mod"){(C=new c(null)).length=D+1,C.words=new Array(C.length);for(var F=0;F=0;U--){var H=67108864*(0|j.words[x.length+U])+(0|j.words[x.length+U-1]);for(H=Math.min(H/k|0,67108863),j._ishlnsubmul(x,H,U);j.negative!==0;)H--,j.negative=0,j._ishlnsubmul(x,1,U),j.isZero()||(j.negative^=1);C&&(C.words[U]=H)}return C&&C.strip(),j.strip(),S!=="div"&&g!==0&&j.iushrn(g),{div:C||null,mod:j}},c.prototype.divmod=function(_,S,g){return d(!_.isZero()),this.isZero()?{div:new c(0),mod:new c(0)}:this.negative!==0&&_.negative===0?(k=this.neg().divmod(_,S),S!=="mod"&&(j=k.div.neg()),S!=="div"&&(x=k.mod.neg(),g&&x.negative!==0&&x.iadd(_)),{div:j,mod:x}):this.negative===0&&_.negative!==0?(k=this.divmod(_.neg(),S),S!=="mod"&&(j=k.div.neg()),{div:j,mod:k.mod}):(this.negative&_.negative)!=0?(k=this.neg().divmod(_.neg(),S),S!=="div"&&(x=k.mod.neg(),g&&x.negative!==0&&x.isub(_)),{div:k.div,mod:x}):_.length>this.length||this.cmp(_)<0?{div:new c(0),mod:this}:_.length===1?S==="div"?{div:this.divn(_.words[0]),mod:null}:S==="mod"?{div:null,mod:new c(this.modn(_.words[0]))}:{div:this.divn(_.words[0]),mod:new c(this.modn(_.words[0]))}:this._wordDiv(_,S);var j,x,k},c.prototype.div=function(_){return this.divmod(_,"div",!1).div},c.prototype.mod=function(_){return this.divmod(_,"mod",!1).mod},c.prototype.umod=function(_){return this.divmod(_,"mod",!0).mod},c.prototype.divRound=function(_){var S=this.divmod(_);if(S.mod.isZero())return S.div;var g=S.div.negative!==0?S.mod.isub(_):S.mod,j=_.ushrn(1),x=_.andln(1),k=g.cmp(j);return k<0||x===1&&k===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},c.prototype.modn=function(_){d(_<=67108863);for(var S=(1<<26)%_,g=0,j=this.length-1;j>=0;j--)g=(S*g+(0|this.words[j]))%_;return g},c.prototype.idivn=function(_){d(_<=67108863);for(var S=0,g=this.length-1;g>=0;g--){var j=(0|this.words[g])+67108864*S;this.words[g]=j/_|0,S=j%_}return this.strip()},c.prototype.divn=function(_){return this.clone().idivn(_)},c.prototype.egcd=function(_){d(_.negative===0),d(!_.isZero());var S=this,g=_.clone();S=S.negative!==0?S.umod(_):S.clone();for(var j=new c(1),x=new c(0),k=new c(0),C=new c(1),D=0;S.isEven()&&g.isEven();)S.iushrn(1),g.iushrn(1),++D;for(var F=g.clone(),B=S.clone();!S.isZero();){for(var U=0,H=1;(S.words[0]&H)==0&&U<26;++U,H<<=1);if(U>0)for(S.iushrn(U);U-- >0;)(j.isOdd()||x.isOdd())&&(j.iadd(F),x.isub(B)),j.iushrn(1),x.iushrn(1);for(var V=0,q=1;(g.words[0]&q)==0&&V<26;++V,q<<=1);if(V>0)for(g.iushrn(V);V-- >0;)(k.isOdd()||C.isOdd())&&(k.iadd(F),C.isub(B)),k.iushrn(1),C.iushrn(1);S.cmp(g)>=0?(S.isub(g),j.isub(k),x.isub(C)):(g.isub(S),k.isub(j),C.isub(x))}return{a:k,b:C,gcd:g.iushln(D)}},c.prototype._invmp=function(_){d(_.negative===0),d(!_.isZero());var S=this,g=_.clone();S=S.negative!==0?S.umod(_):S.clone();for(var j,x=new c(1),k=new c(0),C=g.clone();S.cmpn(1)>0&&g.cmpn(1)>0;){for(var D=0,F=1;(S.words[0]&F)==0&&D<26;++D,F<<=1);if(D>0)for(S.iushrn(D);D-- >0;)x.isOdd()&&x.iadd(C),x.iushrn(1);for(var B=0,U=1;(g.words[0]&U)==0&&B<26;++B,U<<=1);if(B>0)for(g.iushrn(B);B-- >0;)k.isOdd()&&k.iadd(C),k.iushrn(1);S.cmp(g)>=0?(S.isub(g),x.isub(k)):(g.isub(S),k.isub(x))}return(j=S.cmpn(1)===0?x:k).cmpn(0)<0&&j.iadd(_),j},c.prototype.gcd=function(_){if(this.isZero())return _.abs();if(_.isZero())return this.abs();var S=this.clone(),g=_.clone();S.negative=0,g.negative=0;for(var j=0;S.isEven()&&g.isEven();j++)S.iushrn(1),g.iushrn(1);for(;;){for(;S.isEven();)S.iushrn(1);for(;g.isEven();)g.iushrn(1);var x=S.cmp(g);if(x<0){var k=S;S=g,g=k}else if(x===0||g.cmpn(1)===0)break;S.isub(g)}return g.iushln(j)},c.prototype.invm=function(_){return this.egcd(_).a.umod(_)},c.prototype.isEven=function(){return(1&this.words[0])==0},c.prototype.isOdd=function(){return(1&this.words[0])==1},c.prototype.andln=function(_){return this.words[0]&_},c.prototype.bincn=function(_){d(typeof _=="number");var S=_%26,g=(_-S)/26,j=1<>>26,C&=67108863,this.words[k]=C}return x!==0&&(this.words[k]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(_){var S,g=_<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;if(this.strip(),this.length>1)S=1;else{g&&(_=-_),d(_<=67108863,"Number is too big");var j=0|this.words[0];S=j===_?0:j<_?-1:1}return this.negative!==0?0|-S:S},c.prototype.cmp=function(_){if(this.negative!==0&&_.negative===0)return-1;if(this.negative===0&&_.negative!==0)return 1;var S=this.ucmp(_);return this.negative!==0?0|-S:S},c.prototype.ucmp=function(_){if(this.length>_.length)return 1;if(this.length<_.length)return-1;for(var S=0,g=this.length-1;g>=0;g--){var j=0|this.words[g],x=0|_.words[g];if(j!==x){jx&&(S=1);break}}return S},c.prototype.gtn=function(_){return this.cmpn(_)===1},c.prototype.gt=function(_){return this.cmp(_)===1},c.prototype.gten=function(_){return this.cmpn(_)>=0},c.prototype.gte=function(_){return this.cmp(_)>=0},c.prototype.ltn=function(_){return this.cmpn(_)===-1},c.prototype.lt=function(_){return this.cmp(_)===-1},c.prototype.lten=function(_){return this.cmpn(_)<=0},c.prototype.lte=function(_){return this.cmp(_)<=0},c.prototype.eqn=function(_){return this.cmpn(_)===0},c.prototype.eq=function(_){return this.cmp(_)===0},c.red=function(_){return new O(_)},c.prototype.toRed=function(_){return d(!this.red,"Already a number in reduction context"),d(this.negative===0,"red works only with positives"),_.convertTo(this)._forceRed(_)},c.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(_){return this.red=_,this},c.prototype.forceRed=function(_){return d(!this.red,"Already a number in reduction context"),this._forceRed(_)},c.prototype.redAdd=function(_){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,_)},c.prototype.redIAdd=function(_){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,_)},c.prototype.redSub=function(_){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,_)},c.prototype.redISub=function(_){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,_)},c.prototype.redShl=function(_){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,_)},c.prototype.redMul=function(_){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.mul(this,_)},c.prototype.redIMul=function(_){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.imul(this,_)},c.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(_){return d(this.red&&!_.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,_)};var f={k256:null,p224:null,p192:null,p25519:null};function y(_,S){this.name=_,this.p=new c(S,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function R(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(_){if(typeof _=="string"){var S=c._prime(_);this.m=S.p,this.prime=S}else d(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}function P(_){O.call(this,_),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new c(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)}y.prototype._tmp=function(){var _=new c(null);return _.words=new Array(Math.ceil(this.n/13)),_},y.prototype.ireduce=function(_){var S,g=_;do this.split(g,this.tmp),S=(g=(g=this.imulK(g)).iadd(this.tmp)).bitLength();while(S>this.n);var j=S0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},y.prototype.split=function(_,S){_.iushrn(this.n,0,S)},y.prototype.imulK=function(_){return _.imul(this.k)},p(w,y),w.prototype.split=function(_,S){for(var g=Math.min(_.length,9),j=0;j>>22,x=k}x>>>=22,_.words[j-10]=x,x===0&&_.length>10?_.length-=10:_.length-=9},w.prototype.imulK=function(_){_.words[_.length]=0,_.words[_.length+1]=0,_.length+=2;for(var S=0,g=0;g<_.length;g++){var j=0|_.words[g];S+=977*j,_.words[g]=67108863&S,S=64*j+(S/67108864|0)}return _.words[_.length-1]===0&&(_.length--,_.words[_.length-1]===0&&_.length--),_},p(R,y),p(E,y),p(M,y),M.prototype.imulK=function(_){for(var S=0,g=0;g<_.length;g++){var j=19*(0|_.words[g])+S,x=67108863&j;j>>>=26,_.words[g]=x,S=j}return S!==0&&(_.words[_.length++]=S),_},c._prime=function(_){if(f[_])return f[_];var S;if(_==="k256")S=new w;else if(_==="p224")S=new R;else if(_==="p192")S=new E;else{if(_!=="p25519")throw new Error("Unknown prime "+_);S=new M}return f[_]=S,S},O.prototype._verify1=function(_){d(_.negative===0,"red works only with positives"),d(_.red,"red works only with red numbers")},O.prototype._verify2=function(_,S){d((_.negative|S.negative)==0,"red works only with positives"),d(_.red&&_.red===S.red,"red works only with red numbers")},O.prototype.imod=function(_){return this.prime?this.prime.ireduce(_)._forceRed(this):_.umod(this.m)._forceRed(this)},O.prototype.neg=function(_){return _.isZero()?_.clone():this.m.sub(_)._forceRed(this)},O.prototype.add=function(_,S){this._verify2(_,S);var g=_.add(S);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},O.prototype.iadd=function(_,S){this._verify2(_,S);var g=_.iadd(S);return g.cmp(this.m)>=0&&g.isub(this.m),g},O.prototype.sub=function(_,S){this._verify2(_,S);var g=_.sub(S);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},O.prototype.isub=function(_,S){this._verify2(_,S);var g=_.isub(S);return g.cmpn(0)<0&&g.iadd(this.m),g},O.prototype.shl=function(_,S){return this._verify1(_),this.imod(_.ushln(S))},O.prototype.imul=function(_,S){return this._verify2(_,S),this.imod(_.imul(S))},O.prototype.mul=function(_,S){return this._verify2(_,S),this.imod(_.mul(S))},O.prototype.isqr=function(_){return this.imul(_,_.clone())},O.prototype.sqr=function(_){return this.mul(_,_)},O.prototype.sqrt=function(_){if(_.isZero())return _.clone();var S=this.m.andln(3);if(d(S%2==1),S===3){var g=this.m.add(new c(1)).iushrn(2);return this.pow(_,g)}for(var j=this.m.subn(1),x=0;!j.isZero()&&j.andln(1)===0;)x++,j.iushrn(1);d(!j.isZero());var k=new c(1).toRed(this),C=k.redNeg(),D=this.m.subn(1).iushrn(1),F=this.m.bitLength();for(F=new c(2*F*F).toRed(this);this.pow(F,D).cmp(C)!==0;)F.redIAdd(C);for(var B=this.pow(F,j),U=this.pow(_,j.addn(1).iushrn(1)),H=this.pow(_,j),V=x;H.cmp(k)!==0;){for(var q=H,$=0;q.cmp(k)!==0;$++)q=q.redSqr();d($=0;j--){for(var F=S.words[j],B=D-1;B>=0;B--){var U=F>>B&1;x!==g[0]&&(x=this.sqr(x)),U!==0||k!==0?(k<<=1,k|=U,(++C===4||j===0&&B===0)&&(x=this.mul(x,g[k]),C=0,k=0)):C=0}D=26}return x},O.prototype.convertTo=function(_){var S=_.umod(this.m);return S===_?S.clone():S},O.prototype.convertFrom=function(_){var S=_.clone();return S.red=null,S},c.mont=function(_){return new P(_)},p(P,O),P.prototype.convertTo=function(_){return this.imod(_.ushln(this.shift))},P.prototype.convertFrom=function(_){var S=this.imod(_.mul(this.rinv));return S.red=null,S},P.prototype.imul=function(_,S){if(_.isZero()||S.isZero())return _.words[0]=0,_.length=1,_;var g=_.imul(S),j=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=g.isub(j).iushrn(this.shift),k=x;return x.cmp(this.m)>=0?k=x.isub(this.m):x.cmpn(0)<0&&(k=x.iadd(this.m)),k._forceRed(this)},P.prototype.mul=function(_,S){if(_.isZero()||S.isZero())return new c(0)._forceRed(this);var g=_.mul(S),j=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=g.isub(j).iushrn(this.shift),k=x;return x.cmp(this.m)>=0?k=x.isub(this.m):x.cmpn(0)<0&&(k=x.iadd(this.m)),k._forceRed(this)},P.prototype.invm=function(_){return this.imod(_._invmp(this.m).mul(this.r2))._forceRed(this)}})(I===void 0||I)},{buffer:185}],182:[function(h,I,T){T.byteLength=function(i){var e=l(i),t=e[0],r=e[1];return 3*(t+r)/4-r},T.toByteArray=function(i){var e,t,r=l(i),o=r[0],n=r[1],a=new v(function(y,w,R){return 3*(w+R)/4-R}(0,o,n)),u=0,f=n>0?o-4:o;for(t=0;t>16&255,a[u++]=e>>8&255,a[u++]=255&e;return n===2&&(e=m[i.charCodeAt(t)]<<2|m[i.charCodeAt(t+1)]>>4,a[u++]=255&e),n===1&&(e=m[i.charCodeAt(t)]<<10|m[i.charCodeAt(t+1)]<<4|m[i.charCodeAt(t+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e),a},T.fromByteArray=function(i){for(var e,t=i.length,r=t%3,o=[],n=0,a=t-r;na?a:n+16383));return r===1?(e=i[t-1],o.push(b[e>>2]+b[e<<4&63]+"==")):r===2&&(e=(i[t-2]<<8)+i[t-1],o.push(b[e>>10]+b[e>>4&63]+b[e<<2&63]+"=")),o.join("")};for(var b=[],m=[],v=typeof Uint8Array!="undefined"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,c=d.length;p0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");return t===-1&&(t=e),[t,t===e?0:4-t%4]}function s(i,e,t){for(var r,o,n=[],a=e;a>18&63]+b[o>>12&63]+b[o>>6&63]+b[63&o]);return n.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},{}],183:[function(h,I,T){function b(m){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v})(m)}(function(m,v){function d(g,j){if(!g)throw new Error(j||"Assertion failed")}function p(g,j){g.super_=j;var x=function(){};x.prototype=j.prototype,g.prototype=new x,g.prototype.constructor=g}function c(g,j,x){if(c.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&(j!=="le"&&j!=="be"||(x=j,j=10),this._init(g||0,j||10,x||"be"))}var l;b(m)==="object"?m.exports=c:(void 0).BN=c,c.BN=c,c.wordSize=26;try{l=h("buffer").Buffer}catch{}function s(g,j,x){for(var k=0,C=Math.min(g.length,x),D=0,F=j;F=49&&U<=54?U-49+10:U>=17&&U<=22?U-17+10:U,D|=B}return d(!(240&D),"Invalid character in "+g),k}function i(g,j,x,k){for(var C=0,D=0,F=Math.min(g.length,x),B=j;B=49?U-49+10:U>=17?U-17+10:U,d(U>=0&&D0?g:j},c.min=function(g,j){return g.cmp(j)<0?g:j},c.prototype._init=function(g,j,x){if(typeof g=="number")return this._initNumber(g,j,x);if(b(g)==="object")return this._initArray(g,j,x);j==="hex"&&(j=16),d(j===(0|j)&&j>=2&&j<=36);var k=0;(g=g.toString().replace(/\s+/g,""))[0]==="-"&&k++,j===16?this._parseHex(g,k):this._parseBase(g,j,k),g[0]==="-"&&(this.negative=1),this._strip(),x==="le"&&this._initArray(this.toArray(),j,x)},c.prototype._initNumber=function(g,j,x){g<0&&(this.negative=1,g=-g),g<67108864?(this.words=[67108863&g],this.length=1):g<4503599627370496?(this.words=[67108863&g,g/67108864&67108863],this.length=2):(d(g<9007199254740992),this.words=[67108863&g,g/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),j,x)},c.prototype._initArray=function(g,j,x){if(d(typeof g.length=="number"),g.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(g.length/3),this.words=new Array(this.length);for(var k=0;k=0;k-=3)D=g[k]|g[k-1]<<8|g[k-2]<<16,this.words[C]|=D<>>26-F&67108863,(F+=24)>=26&&(F-=26,C++);else if(x==="le")for(k=0,C=0;k>>26-F&67108863,(F+=24)>=26&&(F-=26,C++);return this._strip()},c.prototype._parseHex=function(g,j){this.length=Math.ceil((g.length-j)/6),this.words=new Array(this.length);for(var x=0;x=j;x-=6)C=s(g,x,x+6),this.words[k]|=C<>>26-D&4194303,(D+=24)>=26&&(D-=26,k++);x+6!==j&&(C=s(g,j,x+6),this.words[k]|=C<>>26-D&4194303),this._strip()},c.prototype._parseBase=function(g,j,x){this.words=[0],this.length=1;for(var k=0,C=1;C<=67108863;C*=j)k++;k--,C=C/j|0;for(var D=g.length-x,F=D%k,B=Math.min(D,D-F)+x,U=0,H=x;H1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=t}catch{c.prototype.inspect=t}else c.prototype.inspect=t;function t(){return(this.red?""}var r=["","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"],o=[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],n=[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];c.prototype.toString=function(g,j){var x;if(j=0|j||1,(g=g||10)===16||g==="hex"){x="";for(var k=0,C=0,D=0;D>>24-k&16777215)!==0||D!==this.length-1?r[6-B.length]+B+x:B+x,(k+=2)>=26&&(k-=26,D--)}for(C!==0&&(x=C.toString(16)+x);x.length%j!=0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(g===(0|g)&&g>=2&&g<=36){var U=o[g],H=n[g];x="";var V=this.clone();for(V.negative=0;!V.isZero();){var q=V.modrn(H).toString(g);x=(V=V.idivn(H)).isZero()?q+x:r[U-q.length]+q+x}for(this.isZero()&&(x="0"+x);x.length%j!=0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}d(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var g=this.words[0];return this.length===2?g+=67108864*this.words[1]:this.length===3&&this.words[2]===1?g+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-g:g},c.prototype.toJSON=function(){return this.toString(16,2)},l&&(c.prototype.toBuffer=function(g,j){return this.toArrayLike(l,g,j)}),c.prototype.toArray=function(g,j){return this.toArrayLike(Array,g,j)};function a(g,j,x){x.negative=j.negative^g.negative;var k=g.length+j.length|0;x.length=k,k=k-1|0;var C=0|g.words[0],D=0|j.words[0],F=C*D,B=67108863&F,U=F/67108864|0;x.words[0]=B;for(var H=1;H>>26,q=67108863&U,$=Math.min(H,j.length-1),L=Math.max(0,H-g.length+1);L<=$;L++){var A=H-L|0;V+=(F=(C=0|g.words[A])*(D=0|j.words[L])+q)/67108864|0,q=67108863&F}x.words[H]=0|q,U=0|V}return U!==0?x.words[H]=0|U:x.length--,x._strip()}c.prototype.toArrayLike=function(g,j,x){this._strip();var k=this.byteLength(),C=x||Math.max(1,k);d(k<=C,"byte array longer than desired length"),d(C>0,"Requested array length <= 0");var D=function(F,B){return F.allocUnsafe?F.allocUnsafe(B):new F(B)}(g,C);return this["_toArrayLike"+(j==="le"?"LE":"BE")](D,k),D},c.prototype._toArrayLikeLE=function(g,j){for(var x=0,k=0,C=0,D=0;C>8&255),x>16&255),D===6?(x>24&255),k=0,D=0):(k=F>>>24,D+=2)}if(x=0&&(g[x--]=F>>8&255),x>=0&&(g[x--]=F>>16&255),D===6?(x>=0&&(g[x--]=F>>24&255),k=0,D=0):(k=F>>>24,D+=2)}if(x>=0)for(g[x--]=k;x>=0;)g[x--]=0},Math.clz32?c.prototype._countBits=function(g){return 32-Math.clz32(g)}:c.prototype._countBits=function(g){var j=g,x=0;return j>=4096&&(x+=13,j>>>=13),j>=64&&(x+=7,j>>>=7),j>=8&&(x+=4,j>>>=4),j>=2&&(x+=2,j>>>=2),x+j},c.prototype._zeroBits=function(g){if(g===0)return 26;var j=g,x=0;return(8191&j)==0&&(x+=13,j>>>=13),(127&j)==0&&(x+=7,j>>>=7),(15&j)==0&&(x+=4,j>>>=4),(3&j)==0&&(x+=2,j>>>=2),(1&j)==0&&x++,x},c.prototype.bitLength=function(){var g=this.words[this.length-1],j=this._countBits(g);return 26*(this.length-1)+j},c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var g=0,j=0;jg.length?this.clone().ior(g):g.clone().ior(this)},c.prototype.uor=function(g){return this.length>g.length?this.clone().iuor(g):g.clone().iuor(this)},c.prototype.iuand=function(g){var j;j=this.length>g.length?g:this;for(var x=0;xg.length?this.clone().iand(g):g.clone().iand(this)},c.prototype.uand=function(g){return this.length>g.length?this.clone().iuand(g):g.clone().iuand(this)},c.prototype.iuxor=function(g){var j,x;this.length>g.length?(j=this,x=g):(j=g,x=this);for(var k=0;kg.length?this.clone().ixor(g):g.clone().ixor(this)},c.prototype.uxor=function(g){return this.length>g.length?this.clone().iuxor(g):g.clone().iuxor(this)},c.prototype.inotn=function(g){d(typeof g=="number"&&g>=0);var j=0|Math.ceil(g/26),x=g%26;this._expand(j),x>0&&j--;for(var k=0;k0&&(this.words[k]=~this.words[k]&67108863>>26-x),this._strip()},c.prototype.notn=function(g){return this.clone().inotn(g)},c.prototype.setn=function(g,j){d(typeof g=="number"&&g>=0);var x=g/26|0,k=g%26;return this._expand(x+1),this.words[x]=j?this.words[x]|1<g.length?(x=this,k=g):(x=g,k=this);for(var C=0,D=0;D>>26;for(;C!==0&&D>>26;if(this.length=x.length,C!==0)this.words[this.length]=C,this.length++;else if(x!==this)for(;Dg.length?this.clone().iadd(g):g.clone().iadd(this)},c.prototype.isub=function(g){if(g.negative!==0){g.negative=0;var j=this.iadd(g);return g.negative=1,j._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(g),this.negative=1,this._normSign();var x,k,C=this.cmp(g);if(C===0)return this.negative=0,this.length=1,this.words[0]=0,this;C>0?(x=this,k=g):(x=g,k=this);for(var D=0,F=0;F>26,this.words[F]=67108863&j;for(;D!==0&&F>26,this.words[F]=67108863&j;if(D===0&&F>>13,L=0|F[1],A=8191&L,N=L>>>13,z=0|F[2],W=8191&z,X=z>>>13,K=0|F[3],ie=8191&K,Q=K>>>13,ue=0|F[4],de=8191&ue,ce=ue>>>13,Ee=0|F[5],_e=8191&Ee,ve=Ee>>>13,xe=0|F[6],Re=8191&xe,fe=xe>>>13,Z=0|F[7],ee=8191&Z,J=Z>>>13,oe=0|F[8],ne=8191&oe,ae=oe>>>13,re=0|F[9],he=8191&re,le=re>>>13,pe=0|B[0],Se=8191&pe,ge=pe>>>13,De=0|B[1],Ae=8191&De,Be=De>>>13,Ze=0|B[2],rt=8191&Ze,Ie=Ze>>>13,ze=0|B[3],me=8191&ze,Fe=ze>>>13,Ge=0|B[4],Ye=8191&Ge,He=Ge>>>13,tt=0|B[5],et=8191&tt,Ve=tt>>>13,ot=0|B[6],G=8191&ot,te=ot>>>13,be=0|B[7],je=8191&be,Te=be>>>13,Pe=0|B[8],Le=8191&Pe,Ce=Pe>>>13,Ke=0|B[9],qe=8191&Ke,Ue=Ke>>>13;x.negative=g.negative^j.negative,x.length=19;var ft=(H+(k=Math.imul(q,Se))|0)+((8191&(C=(C=Math.imul(q,ge))+Math.imul($,Se)|0))<<13)|0;H=((D=Math.imul($,ge))+(C>>>13)|0)+(ft>>>26)|0,ft&=67108863,k=Math.imul(A,Se),C=(C=Math.imul(A,ge))+Math.imul(N,Se)|0,D=Math.imul(N,ge);var lt=(H+(k=k+Math.imul(q,Ae)|0)|0)+((8191&(C=(C=C+Math.imul(q,Be)|0)+Math.imul($,Ae)|0))<<13)|0;H=((D=D+Math.imul($,Be)|0)+(C>>>13)|0)+(lt>>>26)|0,lt&=67108863,k=Math.imul(W,Se),C=(C=Math.imul(W,ge))+Math.imul(X,Se)|0,D=Math.imul(X,ge),k=k+Math.imul(A,Ae)|0,C=(C=C+Math.imul(A,Be)|0)+Math.imul(N,Ae)|0,D=D+Math.imul(N,Be)|0;var at=(H+(k=k+Math.imul(q,rt)|0)|0)+((8191&(C=(C=C+Math.imul(q,Ie)|0)+Math.imul($,rt)|0))<<13)|0;H=((D=D+Math.imul($,Ie)|0)+(C>>>13)|0)+(at>>>26)|0,at&=67108863,k=Math.imul(ie,Se),C=(C=Math.imul(ie,ge))+Math.imul(Q,Se)|0,D=Math.imul(Q,ge),k=k+Math.imul(W,Ae)|0,C=(C=C+Math.imul(W,Be)|0)+Math.imul(X,Ae)|0,D=D+Math.imul(X,Be)|0,k=k+Math.imul(A,rt)|0,C=(C=C+Math.imul(A,Ie)|0)+Math.imul(N,rt)|0,D=D+Math.imul(N,Ie)|0;var dt=(H+(k=k+Math.imul(q,me)|0)|0)+((8191&(C=(C=C+Math.imul(q,Fe)|0)+Math.imul($,me)|0))<<13)|0;H=((D=D+Math.imul($,Fe)|0)+(C>>>13)|0)+(dt>>>26)|0,dt&=67108863,k=Math.imul(de,Se),C=(C=Math.imul(de,ge))+Math.imul(ce,Se)|0,D=Math.imul(ce,ge),k=k+Math.imul(ie,Ae)|0,C=(C=C+Math.imul(ie,Be)|0)+Math.imul(Q,Ae)|0,D=D+Math.imul(Q,Be)|0,k=k+Math.imul(W,rt)|0,C=(C=C+Math.imul(W,Ie)|0)+Math.imul(X,rt)|0,D=D+Math.imul(X,Ie)|0,k=k+Math.imul(A,me)|0,C=(C=C+Math.imul(A,Fe)|0)+Math.imul(N,me)|0,D=D+Math.imul(N,Fe)|0;var pt=(H+(k=k+Math.imul(q,Ye)|0)|0)+((8191&(C=(C=C+Math.imul(q,He)|0)+Math.imul($,Ye)|0))<<13)|0;H=((D=D+Math.imul($,He)|0)+(C>>>13)|0)+(pt>>>26)|0,pt&=67108863,k=Math.imul(_e,Se),C=(C=Math.imul(_e,ge))+Math.imul(ve,Se)|0,D=Math.imul(ve,ge),k=k+Math.imul(de,Ae)|0,C=(C=C+Math.imul(de,Be)|0)+Math.imul(ce,Ae)|0,D=D+Math.imul(ce,Be)|0,k=k+Math.imul(ie,rt)|0,C=(C=C+Math.imul(ie,Ie)|0)+Math.imul(Q,rt)|0,D=D+Math.imul(Q,Ie)|0,k=k+Math.imul(W,me)|0,C=(C=C+Math.imul(W,Fe)|0)+Math.imul(X,me)|0,D=D+Math.imul(X,Fe)|0,k=k+Math.imul(A,Ye)|0,C=(C=C+Math.imul(A,He)|0)+Math.imul(N,Ye)|0,D=D+Math.imul(N,He)|0;var yt=(H+(k=k+Math.imul(q,et)|0)|0)+((8191&(C=(C=C+Math.imul(q,Ve)|0)+Math.imul($,et)|0))<<13)|0;H=((D=D+Math.imul($,Ve)|0)+(C>>>13)|0)+(yt>>>26)|0,yt&=67108863,k=Math.imul(Re,Se),C=(C=Math.imul(Re,ge))+Math.imul(fe,Se)|0,D=Math.imul(fe,ge),k=k+Math.imul(_e,Ae)|0,C=(C=C+Math.imul(_e,Be)|0)+Math.imul(ve,Ae)|0,D=D+Math.imul(ve,Be)|0,k=k+Math.imul(de,rt)|0,C=(C=C+Math.imul(de,Ie)|0)+Math.imul(ce,rt)|0,D=D+Math.imul(ce,Ie)|0,k=k+Math.imul(ie,me)|0,C=(C=C+Math.imul(ie,Fe)|0)+Math.imul(Q,me)|0,D=D+Math.imul(Q,Fe)|0,k=k+Math.imul(W,Ye)|0,C=(C=C+Math.imul(W,He)|0)+Math.imul(X,Ye)|0,D=D+Math.imul(X,He)|0,k=k+Math.imul(A,et)|0,C=(C=C+Math.imul(A,Ve)|0)+Math.imul(N,et)|0,D=D+Math.imul(N,Ve)|0;var Y=(H+(k=k+Math.imul(q,G)|0)|0)+((8191&(C=(C=C+Math.imul(q,te)|0)+Math.imul($,G)|0))<<13)|0;H=((D=D+Math.imul($,te)|0)+(C>>>13)|0)+(Y>>>26)|0,Y&=67108863,k=Math.imul(ee,Se),C=(C=Math.imul(ee,ge))+Math.imul(J,Se)|0,D=Math.imul(J,ge),k=k+Math.imul(Re,Ae)|0,C=(C=C+Math.imul(Re,Be)|0)+Math.imul(fe,Ae)|0,D=D+Math.imul(fe,Be)|0,k=k+Math.imul(_e,rt)|0,C=(C=C+Math.imul(_e,Ie)|0)+Math.imul(ve,rt)|0,D=D+Math.imul(ve,Ie)|0,k=k+Math.imul(de,me)|0,C=(C=C+Math.imul(de,Fe)|0)+Math.imul(ce,me)|0,D=D+Math.imul(ce,Fe)|0,k=k+Math.imul(ie,Ye)|0,C=(C=C+Math.imul(ie,He)|0)+Math.imul(Q,Ye)|0,D=D+Math.imul(Q,He)|0,k=k+Math.imul(W,et)|0,C=(C=C+Math.imul(W,Ve)|0)+Math.imul(X,et)|0,D=D+Math.imul(X,Ve)|0,k=k+Math.imul(A,G)|0,C=(C=C+Math.imul(A,te)|0)+Math.imul(N,G)|0,D=D+Math.imul(N,te)|0;var se=(H+(k=k+Math.imul(q,je)|0)|0)+((8191&(C=(C=C+Math.imul(q,Te)|0)+Math.imul($,je)|0))<<13)|0;H=((D=D+Math.imul($,Te)|0)+(C>>>13)|0)+(se>>>26)|0,se&=67108863,k=Math.imul(ne,Se),C=(C=Math.imul(ne,ge))+Math.imul(ae,Se)|0,D=Math.imul(ae,ge),k=k+Math.imul(ee,Ae)|0,C=(C=C+Math.imul(ee,Be)|0)+Math.imul(J,Ae)|0,D=D+Math.imul(J,Be)|0,k=k+Math.imul(Re,rt)|0,C=(C=C+Math.imul(Re,Ie)|0)+Math.imul(fe,rt)|0,D=D+Math.imul(fe,Ie)|0,k=k+Math.imul(_e,me)|0,C=(C=C+Math.imul(_e,Fe)|0)+Math.imul(ve,me)|0,D=D+Math.imul(ve,Fe)|0,k=k+Math.imul(de,Ye)|0,C=(C=C+Math.imul(de,He)|0)+Math.imul(ce,Ye)|0,D=D+Math.imul(ce,He)|0,k=k+Math.imul(ie,et)|0,C=(C=C+Math.imul(ie,Ve)|0)+Math.imul(Q,et)|0,D=D+Math.imul(Q,Ve)|0,k=k+Math.imul(W,G)|0,C=(C=C+Math.imul(W,te)|0)+Math.imul(X,G)|0,D=D+Math.imul(X,te)|0,k=k+Math.imul(A,je)|0,C=(C=C+Math.imul(A,Te)|0)+Math.imul(N,je)|0,D=D+Math.imul(N,Te)|0;var ye=(H+(k=k+Math.imul(q,Le)|0)|0)+((8191&(C=(C=C+Math.imul(q,Ce)|0)+Math.imul($,Le)|0))<<13)|0;H=((D=D+Math.imul($,Ce)|0)+(C>>>13)|0)+(ye>>>26)|0,ye&=67108863,k=Math.imul(he,Se),C=(C=Math.imul(he,ge))+Math.imul(le,Se)|0,D=Math.imul(le,ge),k=k+Math.imul(ne,Ae)|0,C=(C=C+Math.imul(ne,Be)|0)+Math.imul(ae,Ae)|0,D=D+Math.imul(ae,Be)|0,k=k+Math.imul(ee,rt)|0,C=(C=C+Math.imul(ee,Ie)|0)+Math.imul(J,rt)|0,D=D+Math.imul(J,Ie)|0,k=k+Math.imul(Re,me)|0,C=(C=C+Math.imul(Re,Fe)|0)+Math.imul(fe,me)|0,D=D+Math.imul(fe,Fe)|0,k=k+Math.imul(_e,Ye)|0,C=(C=C+Math.imul(_e,He)|0)+Math.imul(ve,Ye)|0,D=D+Math.imul(ve,He)|0,k=k+Math.imul(de,et)|0,C=(C=C+Math.imul(de,Ve)|0)+Math.imul(ce,et)|0,D=D+Math.imul(ce,Ve)|0,k=k+Math.imul(ie,G)|0,C=(C=C+Math.imul(ie,te)|0)+Math.imul(Q,G)|0,D=D+Math.imul(Q,te)|0,k=k+Math.imul(W,je)|0,C=(C=C+Math.imul(W,Te)|0)+Math.imul(X,je)|0,D=D+Math.imul(X,Te)|0,k=k+Math.imul(A,Le)|0,C=(C=C+Math.imul(A,Ce)|0)+Math.imul(N,Le)|0,D=D+Math.imul(N,Ce)|0;var we=(H+(k=k+Math.imul(q,qe)|0)|0)+((8191&(C=(C=C+Math.imul(q,Ue)|0)+Math.imul($,qe)|0))<<13)|0;H=((D=D+Math.imul($,Ue)|0)+(C>>>13)|0)+(we>>>26)|0,we&=67108863,k=Math.imul(he,Ae),C=(C=Math.imul(he,Be))+Math.imul(le,Ae)|0,D=Math.imul(le,Be),k=k+Math.imul(ne,rt)|0,C=(C=C+Math.imul(ne,Ie)|0)+Math.imul(ae,rt)|0,D=D+Math.imul(ae,Ie)|0,k=k+Math.imul(ee,me)|0,C=(C=C+Math.imul(ee,Fe)|0)+Math.imul(J,me)|0,D=D+Math.imul(J,Fe)|0,k=k+Math.imul(Re,Ye)|0,C=(C=C+Math.imul(Re,He)|0)+Math.imul(fe,Ye)|0,D=D+Math.imul(fe,He)|0,k=k+Math.imul(_e,et)|0,C=(C=C+Math.imul(_e,Ve)|0)+Math.imul(ve,et)|0,D=D+Math.imul(ve,Ve)|0,k=k+Math.imul(de,G)|0,C=(C=C+Math.imul(de,te)|0)+Math.imul(ce,G)|0,D=D+Math.imul(ce,te)|0,k=k+Math.imul(ie,je)|0,C=(C=C+Math.imul(ie,Te)|0)+Math.imul(Q,je)|0,D=D+Math.imul(Q,Te)|0,k=k+Math.imul(W,Le)|0,C=(C=C+Math.imul(W,Ce)|0)+Math.imul(X,Le)|0,D=D+Math.imul(X,Ce)|0;var Me=(H+(k=k+Math.imul(A,qe)|0)|0)+((8191&(C=(C=C+Math.imul(A,Ue)|0)+Math.imul(N,qe)|0))<<13)|0;H=((D=D+Math.imul(N,Ue)|0)+(C>>>13)|0)+(Me>>>26)|0,Me&=67108863,k=Math.imul(he,rt),C=(C=Math.imul(he,Ie))+Math.imul(le,rt)|0,D=Math.imul(le,Ie),k=k+Math.imul(ne,me)|0,C=(C=C+Math.imul(ne,Fe)|0)+Math.imul(ae,me)|0,D=D+Math.imul(ae,Fe)|0,k=k+Math.imul(ee,Ye)|0,C=(C=C+Math.imul(ee,He)|0)+Math.imul(J,Ye)|0,D=D+Math.imul(J,He)|0,k=k+Math.imul(Re,et)|0,C=(C=C+Math.imul(Re,Ve)|0)+Math.imul(fe,et)|0,D=D+Math.imul(fe,Ve)|0,k=k+Math.imul(_e,G)|0,C=(C=C+Math.imul(_e,te)|0)+Math.imul(ve,G)|0,D=D+Math.imul(ve,te)|0,k=k+Math.imul(de,je)|0,C=(C=C+Math.imul(de,Te)|0)+Math.imul(ce,je)|0,D=D+Math.imul(ce,Te)|0,k=k+Math.imul(ie,Le)|0,C=(C=C+Math.imul(ie,Ce)|0)+Math.imul(Q,Le)|0,D=D+Math.imul(Q,Ce)|0;var ke=(H+(k=k+Math.imul(W,qe)|0)|0)+((8191&(C=(C=C+Math.imul(W,Ue)|0)+Math.imul(X,qe)|0))<<13)|0;H=((D=D+Math.imul(X,Ue)|0)+(C>>>13)|0)+(ke>>>26)|0,ke&=67108863,k=Math.imul(he,me),C=(C=Math.imul(he,Fe))+Math.imul(le,me)|0,D=Math.imul(le,Fe),k=k+Math.imul(ne,Ye)|0,C=(C=C+Math.imul(ne,He)|0)+Math.imul(ae,Ye)|0,D=D+Math.imul(ae,He)|0,k=k+Math.imul(ee,et)|0,C=(C=C+Math.imul(ee,Ve)|0)+Math.imul(J,et)|0,D=D+Math.imul(J,Ve)|0,k=k+Math.imul(Re,G)|0,C=(C=C+Math.imul(Re,te)|0)+Math.imul(fe,G)|0,D=D+Math.imul(fe,te)|0,k=k+Math.imul(_e,je)|0,C=(C=C+Math.imul(_e,Te)|0)+Math.imul(ve,je)|0,D=D+Math.imul(ve,Te)|0,k=k+Math.imul(de,Le)|0,C=(C=C+Math.imul(de,Ce)|0)+Math.imul(ce,Le)|0,D=D+Math.imul(ce,Ce)|0;var Oe=(H+(k=k+Math.imul(ie,qe)|0)|0)+((8191&(C=(C=C+Math.imul(ie,Ue)|0)+Math.imul(Q,qe)|0))<<13)|0;H=((D=D+Math.imul(Q,Ue)|0)+(C>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,k=Math.imul(he,Ye),C=(C=Math.imul(he,He))+Math.imul(le,Ye)|0,D=Math.imul(le,He),k=k+Math.imul(ne,et)|0,C=(C=C+Math.imul(ne,Ve)|0)+Math.imul(ae,et)|0,D=D+Math.imul(ae,Ve)|0,k=k+Math.imul(ee,G)|0,C=(C=C+Math.imul(ee,te)|0)+Math.imul(J,G)|0,D=D+Math.imul(J,te)|0,k=k+Math.imul(Re,je)|0,C=(C=C+Math.imul(Re,Te)|0)+Math.imul(fe,je)|0,D=D+Math.imul(fe,Te)|0,k=k+Math.imul(_e,Le)|0,C=(C=C+Math.imul(_e,Ce)|0)+Math.imul(ve,Le)|0,D=D+Math.imul(ve,Ce)|0;var Xe=(H+(k=k+Math.imul(de,qe)|0)|0)+((8191&(C=(C=C+Math.imul(de,Ue)|0)+Math.imul(ce,qe)|0))<<13)|0;H=((D=D+Math.imul(ce,Ue)|0)+(C>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,k=Math.imul(he,et),C=(C=Math.imul(he,Ve))+Math.imul(le,et)|0,D=Math.imul(le,Ve),k=k+Math.imul(ne,G)|0,C=(C=C+Math.imul(ne,te)|0)+Math.imul(ae,G)|0,D=D+Math.imul(ae,te)|0,k=k+Math.imul(ee,je)|0,C=(C=C+Math.imul(ee,Te)|0)+Math.imul(J,je)|0,D=D+Math.imul(J,Te)|0,k=k+Math.imul(Re,Le)|0,C=(C=C+Math.imul(Re,Ce)|0)+Math.imul(fe,Le)|0,D=D+Math.imul(fe,Ce)|0;var $e=(H+(k=k+Math.imul(_e,qe)|0)|0)+((8191&(C=(C=C+Math.imul(_e,Ue)|0)+Math.imul(ve,qe)|0))<<13)|0;H=((D=D+Math.imul(ve,Ue)|0)+(C>>>13)|0)+($e>>>26)|0,$e&=67108863,k=Math.imul(he,G),C=(C=Math.imul(he,te))+Math.imul(le,G)|0,D=Math.imul(le,te),k=k+Math.imul(ne,je)|0,C=(C=C+Math.imul(ne,Te)|0)+Math.imul(ae,je)|0,D=D+Math.imul(ae,Te)|0,k=k+Math.imul(ee,Le)|0,C=(C=C+Math.imul(ee,Ce)|0)+Math.imul(J,Le)|0,D=D+Math.imul(J,Ce)|0;var We=(H+(k=k+Math.imul(Re,qe)|0)|0)+((8191&(C=(C=C+Math.imul(Re,Ue)|0)+Math.imul(fe,qe)|0))<<13)|0;H=((D=D+Math.imul(fe,Ue)|0)+(C>>>13)|0)+(We>>>26)|0,We&=67108863,k=Math.imul(he,je),C=(C=Math.imul(he,Te))+Math.imul(le,je)|0,D=Math.imul(le,Te),k=k+Math.imul(ne,Le)|0,C=(C=C+Math.imul(ne,Ce)|0)+Math.imul(ae,Le)|0,D=D+Math.imul(ae,Ce)|0;var Ne=(H+(k=k+Math.imul(ee,qe)|0)|0)+((8191&(C=(C=C+Math.imul(ee,Ue)|0)+Math.imul(J,qe)|0))<<13)|0;H=((D=D+Math.imul(J,Ue)|0)+(C>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,k=Math.imul(he,Le),C=(C=Math.imul(he,Ce))+Math.imul(le,Le)|0,D=Math.imul(le,Ce);var st=(H+(k=k+Math.imul(ne,qe)|0)|0)+((8191&(C=(C=C+Math.imul(ne,Ue)|0)+Math.imul(ae,qe)|0))<<13)|0;H=((D=D+Math.imul(ae,Ue)|0)+(C>>>13)|0)+(st>>>26)|0,st&=67108863;var ut=(H+(k=Math.imul(he,qe))|0)+((8191&(C=(C=Math.imul(he,Ue))+Math.imul(le,qe)|0))<<13)|0;return H=((D=Math.imul(le,Ue))+(C>>>13)|0)+(ut>>>26)|0,ut&=67108863,U[0]=ft,U[1]=lt,U[2]=at,U[3]=dt,U[4]=pt,U[5]=yt,U[6]=Y,U[7]=se,U[8]=ye,U[9]=we,U[10]=Me,U[11]=ke,U[12]=Oe,U[13]=Xe,U[14]=$e,U[15]=We,U[16]=Ne,U[17]=st,U[18]=ut,H!==0&&(U[19]=H,x.length++),x};function f(g,j,x){x.negative=j.negative^g.negative,x.length=g.length+j.length;for(var k=0,C=0,D=0;D>>26)|0)>>>26,F&=67108863}x.words[D]=B,k=F,F=C}return k!==0?x.words[D]=k:x.length--,x._strip()}function y(g,j,x){return f(g,j,x)}Math.imul||(u=a),c.prototype.mulTo=function(g,j){var x=this.length+g.length;return this.length===10&&g.length===10?u(this,g,j):x<63?a(this,g,j):x<1024?f(this,g,j):y(this,g,j)},c.prototype.mul=function(g){var j=new c(null);return j.words=new Array(this.length+g.length),this.mulTo(g,j)},c.prototype.mulf=function(g){var j=new c(null);return j.words=new Array(this.length+g.length),y(this,g,j)},c.prototype.imul=function(g){return this.clone().mulTo(g,this)},c.prototype.imuln=function(g){var j=g<0;j&&(g=-g),d(typeof g=="number"),d(g<67108864);for(var x=0,k=0;k>=26,x+=C/67108864|0,x+=D>>>26,this.words[k]=67108863&D}return x!==0&&(this.words[k]=x,this.length++),j?this.ineg():this},c.prototype.muln=function(g){return this.clone().imuln(g)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(g){var j=function(D){for(var F=new Array(D.bitLength()),B=0;B>>H&1}return F}(g);if(j.length===0)return new c(1);for(var x=this,k=0;k=0);var j,x=g%26,k=(g-x)/26,C=67108863>>>26-x<<26-x;if(x!==0){var D=0;for(j=0;j>>26-x}D&&(this.words[j]=D,this.length++)}if(k!==0){for(j=this.length-1;j>=0;j--)this.words[j+k]=this.words[j];for(j=0;j=0),k=j?(j-j%26)/26:0;var C=g%26,D=Math.min((g-C)/26,this.length),F=67108863^67108863>>>C<D)for(this.length-=D,U=0;U=0&&(H!==0||U>=k);U--){var V=0|this.words[U];this.words[U]=H<<26-C|V>>>C,H=V&F}return B&&H!==0&&(B.words[B.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},c.prototype.ishrn=function(g,j,x){return d(this.negative===0),this.iushrn(g,j,x)},c.prototype.shln=function(g){return this.clone().ishln(g)},c.prototype.ushln=function(g){return this.clone().iushln(g)},c.prototype.shrn=function(g){return this.clone().ishrn(g)},c.prototype.ushrn=function(g){return this.clone().iushrn(g)},c.prototype.testn=function(g){d(typeof g=="number"&&g>=0);var j=g%26,x=(g-j)/26,k=1<=0);var j=g%26,x=(g-j)/26;if(d(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(j!==0&&x++,this.length=Math.min(x,this.length),j!==0){var k=67108863^67108863>>>j<=67108864;j++)this.words[j]-=67108864,j===this.length-1?this.words[j+1]=1:this.words[j+1]++;return this.length=Math.max(this.length,j+1),this},c.prototype.isubn=function(g){if(d(typeof g=="number"),d(g<67108864),g<0)return this.iaddn(-g);if(this.negative!==0)return this.negative=0,this.iaddn(g),this.negative=1,this;if(this.words[0]-=g,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var j=0;j>26)-(B/67108864|0),this.words[k+x]=67108863&C}for(;k>26,this.words[k+x]=67108863&C;if(F===0)return this._strip();for(d(F===-1),F=0,k=0;k>26,this.words[k]=67108863&C;return this.negative=1,this._strip()},c.prototype._wordDiv=function(g,j){var x=(this.length,g.length),k=this.clone(),C=g,D=0|C.words[C.length-1];(x=26-this._countBits(D))!==0&&(C=C.ushln(x),k.iushln(x),D=0|C.words[C.length-1]);var F,B=k.length-C.length;if(j!=="mod"){(F=new c(null)).length=B+1,F.words=new Array(F.length);for(var U=0;U=0;V--){var q=67108864*(0|k.words[C.length+V])+(0|k.words[C.length+V-1]);for(q=Math.min(q/D|0,67108863),k._ishlnsubmul(C,q,V);k.negative!==0;)q--,k.negative=0,k._ishlnsubmul(C,1,V),k.isZero()||(k.negative^=1);F&&(F.words[V]=q)}return F&&F._strip(),k._strip(),j!=="div"&&x!==0&&k.iushrn(x),{div:F||null,mod:k}},c.prototype.divmod=function(g,j,x){return d(!g.isZero()),this.isZero()?{div:new c(0),mod:new c(0)}:this.negative!==0&&g.negative===0?(D=this.neg().divmod(g,j),j!=="mod"&&(k=D.div.neg()),j!=="div"&&(C=D.mod.neg(),x&&C.negative!==0&&C.iadd(g)),{div:k,mod:C}):this.negative===0&&g.negative!==0?(D=this.divmod(g.neg(),j),j!=="mod"&&(k=D.div.neg()),{div:k,mod:D.mod}):(this.negative&g.negative)!=0?(D=this.neg().divmod(g.neg(),j),j!=="div"&&(C=D.mod.neg(),x&&C.negative!==0&&C.isub(g)),{div:D.div,mod:C}):g.length>this.length||this.cmp(g)<0?{div:new c(0),mod:this}:g.length===1?j==="div"?{div:this.divn(g.words[0]),mod:null}:j==="mod"?{div:null,mod:new c(this.modrn(g.words[0]))}:{div:this.divn(g.words[0]),mod:new c(this.modrn(g.words[0]))}:this._wordDiv(g,j);var k,C,D},c.prototype.div=function(g){return this.divmod(g,"div",!1).div},c.prototype.mod=function(g){return this.divmod(g,"mod",!1).mod},c.prototype.umod=function(g){return this.divmod(g,"mod",!0).mod},c.prototype.divRound=function(g){var j=this.divmod(g);if(j.mod.isZero())return j.div;var x=j.div.negative!==0?j.mod.isub(g):j.mod,k=g.ushrn(1),C=g.andln(1),D=x.cmp(k);return D<0||C===1&&D===0?j.div:j.div.negative!==0?j.div.isubn(1):j.div.iaddn(1)},c.prototype.modrn=function(g){var j=g<0;j&&(g=-g),d(g<=67108863);for(var x=(1<<26)%g,k=0,C=this.length-1;C>=0;C--)k=(x*k+(0|this.words[C]))%g;return j?-k:k},c.prototype.modn=function(g){return this.modrn(g)},c.prototype.idivn=function(g){var j=g<0;j&&(g=-g),d(g<=67108863);for(var x=0,k=this.length-1;k>=0;k--){var C=(0|this.words[k])+67108864*x;this.words[k]=C/g|0,x=C%g}return this._strip(),j?this.ineg():this},c.prototype.divn=function(g){return this.clone().idivn(g)},c.prototype.egcd=function(g){d(g.negative===0),d(!g.isZero());var j=this,x=g.clone();j=j.negative!==0?j.umod(g):j.clone();for(var k=new c(1),C=new c(0),D=new c(0),F=new c(1),B=0;j.isEven()&&x.isEven();)j.iushrn(1),x.iushrn(1),++B;for(var U=x.clone(),H=j.clone();!j.isZero();){for(var V=0,q=1;(j.words[0]&q)==0&&V<26;++V,q<<=1);if(V>0)for(j.iushrn(V);V-- >0;)(k.isOdd()||C.isOdd())&&(k.iadd(U),C.isub(H)),k.iushrn(1),C.iushrn(1);for(var $=0,L=1;(x.words[0]&L)==0&&$<26;++$,L<<=1);if($>0)for(x.iushrn($);$-- >0;)(D.isOdd()||F.isOdd())&&(D.iadd(U),F.isub(H)),D.iushrn(1),F.iushrn(1);j.cmp(x)>=0?(j.isub(x),k.isub(D),C.isub(F)):(x.isub(j),D.isub(k),F.isub(C))}return{a:D,b:F,gcd:x.iushln(B)}},c.prototype._invmp=function(g){d(g.negative===0),d(!g.isZero());var j=this,x=g.clone();j=j.negative!==0?j.umod(g):j.clone();for(var k,C=new c(1),D=new c(0),F=x.clone();j.cmpn(1)>0&&x.cmpn(1)>0;){for(var B=0,U=1;(j.words[0]&U)==0&&B<26;++B,U<<=1);if(B>0)for(j.iushrn(B);B-- >0;)C.isOdd()&&C.iadd(F),C.iushrn(1);for(var H=0,V=1;(x.words[0]&V)==0&&H<26;++H,V<<=1);if(H>0)for(x.iushrn(H);H-- >0;)D.isOdd()&&D.iadd(F),D.iushrn(1);j.cmp(x)>=0?(j.isub(x),C.isub(D)):(x.isub(j),D.isub(C))}return(k=j.cmpn(1)===0?C:D).cmpn(0)<0&&k.iadd(g),k},c.prototype.gcd=function(g){if(this.isZero())return g.abs();if(g.isZero())return this.abs();var j=this.clone(),x=g.clone();j.negative=0,x.negative=0;for(var k=0;j.isEven()&&x.isEven();k++)j.iushrn(1),x.iushrn(1);for(;;){for(;j.isEven();)j.iushrn(1);for(;x.isEven();)x.iushrn(1);var C=j.cmp(x);if(C<0){var D=j;j=x,x=D}else if(C===0||x.cmpn(1)===0)break;j.isub(x)}return x.iushln(k)},c.prototype.invm=function(g){return this.egcd(g).a.umod(g)},c.prototype.isEven=function(){return(1&this.words[0])==0},c.prototype.isOdd=function(){return(1&this.words[0])==1},c.prototype.andln=function(g){return this.words[0]&g},c.prototype.bincn=function(g){d(typeof g=="number");var j=g%26,x=(g-j)/26,k=1<>>26,F&=67108863,this.words[D]=F}return C!==0&&(this.words[D]=C,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(g){var j,x=g<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;if(this._strip(),this.length>1)j=1;else{x&&(g=-g),d(g<=67108863,"Number is too big");var k=0|this.words[0];j=k===g?0:kg.length)return 1;if(this.length=0;x--){var k=0|this.words[x],C=0|g.words[x];if(k!==C){kC&&(j=1);break}}return j},c.prototype.gtn=function(g){return this.cmpn(g)===1},c.prototype.gt=function(g){return this.cmp(g)===1},c.prototype.gten=function(g){return this.cmpn(g)>=0},c.prototype.gte=function(g){return this.cmp(g)>=0},c.prototype.ltn=function(g){return this.cmpn(g)===-1},c.prototype.lt=function(g){return this.cmp(g)===-1},c.prototype.lten=function(g){return this.cmpn(g)<=0},c.prototype.lte=function(g){return this.cmp(g)<=0},c.prototype.eqn=function(g){return this.cmpn(g)===0},c.prototype.eq=function(g){return this.cmp(g)===0},c.red=function(g){return new _(g)},c.prototype.toRed=function(g){return d(!this.red,"Already a number in reduction context"),d(this.negative===0,"red works only with positives"),g.convertTo(this)._forceRed(g)},c.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(g){return this.red=g,this},c.prototype.forceRed=function(g){return d(!this.red,"Already a number in reduction context"),this._forceRed(g)},c.prototype.redAdd=function(g){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,g)},c.prototype.redIAdd=function(g){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,g)},c.prototype.redSub=function(g){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,g)},c.prototype.redISub=function(g){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,g)},c.prototype.redShl=function(g){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,g)},c.prototype.redMul=function(g){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.mul(this,g)},c.prototype.redIMul=function(g){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.imul(this,g)},c.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(g){return d(this.red&&!g.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,g)};var w={k256:null,p224:null,p192:null,p25519:null};function R(g,j){this.name=g,this.p=new c(j,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){R.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){R.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){R.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P(){R.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(g){if(typeof g=="string"){var j=c._prime(g);this.m=j.p,this.prime=j}else d(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}function S(g){_.call(this,g),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new c(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)}R.prototype._tmp=function(){var g=new c(null);return g.words=new Array(Math.ceil(this.n/13)),g},R.prototype.ireduce=function(g){var j,x=g;do this.split(x,this.tmp),j=(x=(x=this.imulK(x)).iadd(this.tmp)).bitLength();while(j>this.n);var k=j0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},R.prototype.split=function(g,j){g.iushrn(this.n,0,j)},R.prototype.imulK=function(g){return g.imul(this.k)},p(E,R),E.prototype.split=function(g,j){for(var x=Math.min(g.length,9),k=0;k>>22,C=D}C>>>=22,g.words[k-10]=C,C===0&&g.length>10?g.length-=10:g.length-=9},E.prototype.imulK=function(g){g.words[g.length]=0,g.words[g.length+1]=0,g.length+=2;for(var j=0,x=0;x>>=26,g.words[x]=C,j=k}return j!==0&&(g.words[g.length++]=j),g},c._prime=function(g){if(w[g])return w[g];var j;if(g==="k256")j=new E;else if(g==="p224")j=new M;else if(g==="p192")j=new O;else{if(g!=="p25519")throw new Error("Unknown prime "+g);j=new P}return w[g]=j,j},_.prototype._verify1=function(g){d(g.negative===0,"red works only with positives"),d(g.red,"red works only with red numbers")},_.prototype._verify2=function(g,j){d((g.negative|j.negative)==0,"red works only with positives"),d(g.red&&g.red===j.red,"red works only with red numbers")},_.prototype.imod=function(g){return this.prime?this.prime.ireduce(g)._forceRed(this):(e(g,g.umod(this.m)._forceRed(this)),g)},_.prototype.neg=function(g){return g.isZero()?g.clone():this.m.sub(g)._forceRed(this)},_.prototype.add=function(g,j){this._verify2(g,j);var x=g.add(j);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},_.prototype.iadd=function(g,j){this._verify2(g,j);var x=g.iadd(j);return x.cmp(this.m)>=0&&x.isub(this.m),x},_.prototype.sub=function(g,j){this._verify2(g,j);var x=g.sub(j);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},_.prototype.isub=function(g,j){this._verify2(g,j);var x=g.isub(j);return x.cmpn(0)<0&&x.iadd(this.m),x},_.prototype.shl=function(g,j){return this._verify1(g),this.imod(g.ushln(j))},_.prototype.imul=function(g,j){return this._verify2(g,j),this.imod(g.imul(j))},_.prototype.mul=function(g,j){return this._verify2(g,j),this.imod(g.mul(j))},_.prototype.isqr=function(g){return this.imul(g,g.clone())},_.prototype.sqr=function(g){return this.mul(g,g)},_.prototype.sqrt=function(g){if(g.isZero())return g.clone();var j=this.m.andln(3);if(d(j%2==1),j===3){var x=this.m.add(new c(1)).iushrn(2);return this.pow(g,x)}for(var k=this.m.subn(1),C=0;!k.isZero()&&k.andln(1)===0;)C++,k.iushrn(1);d(!k.isZero());var D=new c(1).toRed(this),F=D.redNeg(),B=this.m.subn(1).iushrn(1),U=this.m.bitLength();for(U=new c(2*U*U).toRed(this);this.pow(U,B).cmp(F)!==0;)U.redIAdd(F);for(var H=this.pow(U,k),V=this.pow(g,k.addn(1).iushrn(1)),q=this.pow(g,k),$=C;q.cmp(D)!==0;){for(var L=q,A=0;L.cmp(D)!==0;A++)L=L.redSqr();d(A<$);var N=this.pow(H,new c(1).iushln($-A-1));V=V.redMul(N),H=N.redSqr(),q=q.redMul(H),$=A}return V},_.prototype.invm=function(g){var j=g._invmp(this.m);return j.negative!==0?(j.negative=0,this.imod(j).redNeg()):this.imod(j)},_.prototype.pow=function(g,j){if(j.isZero())return new c(1).toRed(this);if(j.cmpn(1)===0)return g.clone();var x=new Array(16);x[0]=new c(1).toRed(this),x[1]=g;for(var k=2;k=0;k--){for(var U=j.words[k],H=B-1;H>=0;H--){var V=U>>H&1;C!==x[0]&&(C=this.sqr(C)),V!==0||D!==0?(D<<=1,D|=V,(++F===4||k===0&&H===0)&&(C=this.mul(C,x[D]),F=0,D=0)):F=0}B=26}return C},_.prototype.convertTo=function(g){var j=g.umod(this.m);return j===g?j.clone():j},_.prototype.convertFrom=function(g){var j=g.clone();return j.red=null,j},c.mont=function(g){return new S(g)},p(S,_),S.prototype.convertTo=function(g){return this.imod(g.ushln(this.shift))},S.prototype.convertFrom=function(g){var j=this.imod(g.mul(this.rinv));return j.red=null,j},S.prototype.imul=function(g,j){if(g.isZero()||j.isZero())return g.words[0]=0,g.length=1,g;var x=g.imul(j),k=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=x.isub(k).iushrn(this.shift),D=C;return C.cmp(this.m)>=0?D=C.isub(this.m):C.cmpn(0)<0&&(D=C.iadd(this.m)),D._forceRed(this)},S.prototype.mul=function(g,j){if(g.isZero()||j.isZero())return new c(0)._forceRed(this);var x=g.mul(j),k=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=x.isub(k).iushrn(this.shift),D=C;return C.cmp(this.m)>=0?D=C.isub(this.m):C.cmpn(0)<0&&(D=C.iadd(this.m)),D._forceRed(this)},S.prototype.invm=function(g){return this.imod(g._invmp(this.m).mul(this.r2))._forceRed(this)}})(I===void 0||I)},{buffer:185}],184:[function(h,I,T){function b(p){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(p)}var m;function v(p){this.rand=p}if(I.exports=function(p){return m||(m=new v(null)),m.generate(p)},I.exports.Rand=v,v.prototype.generate=function(p){return this._rand(p)},v.prototype._rand=function(p){if(this.rand.getBytes)return this.rand.getBytes(p);for(var c=new Uint8Array(p),l=0;l>>24]^y[M>>>16&255]^w[O>>>8&255]^R[255&P]^i[_++],n=f[M>>>24]^y[O>>>16&255]^w[P>>>8&255]^R[255&E]^i[_++],a=f[O>>>24]^y[P>>>16&255]^w[E>>>8&255]^R[255&M]^i[_++],u=f[P>>>24]^y[E>>>16&255]^w[M>>>8&255]^R[255&O]^i[_++],E=o,M=n,O=a,P=u;return o=(t[E>>>24]<<24|t[M>>>16&255]<<16|t[O>>>8&255]<<8|t[255&P])^i[_++],n=(t[M>>>24]<<24|t[O>>>16&255]<<16|t[P>>>8&255]<<8|t[255&E])^i[_++],a=(t[O>>>24]<<24|t[P>>>16&255]<<16|t[E>>>8&255]<<8|t[255&M])^i[_++],u=(t[P>>>24]<<24|t[E>>>16&255]<<16|t[M>>>8&255]<<8|t[255&O])^i[_++],[o>>>=0,n>>>=0,a>>>=0,u>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var s=new Array(256),i=0;i<256;i++)s[i]=i<128?i<<1:i<<1^283;for(var e=[],t=[],r=[[],[],[],[]],o=[[],[],[],[]],n=0,a=0,u=0;u<256;++u){var f=a^a<<1^a<<2^a<<3^a<<4;f=f>>>8^255&f^99,e[n]=f,t[f]=n;var y=s[n],w=s[y],R=s[w],E=257*s[f]^16843008*f;r[0][n]=E<<24|E>>>8,r[1][n]=E<<16|E>>>16,r[2][n]=E<<8|E>>>24,r[3][n]=E,E=16843009*R^65537*w^257*y^16843008*n,o[0][f]=E<<24|E>>>8,o[1][f]=E<<16|E>>>16,o[2][f]=E<<8|E>>>24,o[3][f]=E,n===0?n=a=1:(n=y^s[s[s[R^y]]],a^=s[s[a]])}return{SBOX:e,INV_SBOX:t,SUB_MIX:r,INV_SUB_MIX:o}}();function l(s){this._key=m(s),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var s=this._key,i=s.length,e=i+6,t=4*(e+1),r=[],o=0;o>>24,n=c.SBOX[n>>>24]<<24|c.SBOX[n>>>16&255]<<16|c.SBOX[n>>>8&255]<<8|c.SBOX[255&n],n^=p[o/i|0]<<24):i>6&&o%i==4&&(n=c.SBOX[n>>>24]<<24|c.SBOX[n>>>16&255]<<16|c.SBOX[n>>>8&255]<<8|c.SBOX[255&n]),r[o]=r[o-i]^n}for(var a=[],u=0;u>>24]]^c.INV_SUB_MIX[1][c.SBOX[y>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[y>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&y]]}this._nRounds=e,this._keySchedule=r,this._invKeySchedule=a},l.prototype.encryptBlockRaw=function(s){return d(s=m(s),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},l.prototype.encryptBlock=function(s){var i=this.encryptBlockRaw(s),e=b.allocUnsafe(16);return e.writeUInt32BE(i[0],0),e.writeUInt32BE(i[1],4),e.writeUInt32BE(i[2],8),e.writeUInt32BE(i[3],12),e},l.prototype.decryptBlock=function(s){var i=(s=m(s))[1];s[1]=s[3],s[3]=i;var e=d(s,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),t=b.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[3],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[1],12),t},l.prototype.scrub=function(){v(this._keySchedule),v(this._invKeySchedule),v(this._key)},I.exports.AES=l},{"safe-buffer":494}],187:[function(h,I,T){var b=h("./aes"),m=h("safe-buffer").Buffer,v=h("cipher-base"),d=h("inherits"),p=h("./ghash"),c=h("buffer-xor"),l=h("./incr32");function s(i,e,t,r){v.call(this);var o=m.alloc(4,0);this._cipher=new b.AES(e);var n=this._cipher.encryptBlock(o);this._ghash=new p(n),t=function(a,u,f){if(u.length===12)return a._finID=m.concat([u,m.from([0,0,0,1])]),m.concat([u,m.from([0,0,0,2])]);var y=new p(f),w=u.length,R=w%16;y.update(u),R&&(R=16-R,y.update(m.alloc(R,0))),y.update(m.alloc(8,0));var E=8*w,M=m.alloc(8);M.writeUIntBE(E,0,8),y.update(M),a._finID=y.state;var O=m.from(a._finID);return l(O),O}(this,t,n),this._prev=m.from(t),this._cache=m.allocUnsafe(0),this._secCache=m.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}d(s,v),s.prototype._update=function(i){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=m.alloc(e,0),this._ghash.update(e))}this._called=!0;var t=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(t),this._len+=i.length,t},s.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var i=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var o=Math.min(e.length,t.length),n=0;n16)throw new Error("unable to decrypt data");for(var n=-1;++n16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r}else if(this.cache.length>=16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r;return null},i.prototype.flush=function(){if(this.cache.length)return this.cache},T.createDecipher=function(t,r){var o=v[t.toLowerCase()];if(!o)throw new TypeError("invalid suite type");var n=l(r,!1,o.key,o.iv);return e(t,n.key,n.iv)},T.createDecipheriv=e},{"./aes":186,"./authCipher":187,"./modes":199,"./streamCipher":202,"cipher-base":218,evp_bytestokey:368,inherits:387,"safe-buffer":494}],190:[function(h,I,T){var b=h("./modes"),m=h("./authCipher"),v=h("safe-buffer").Buffer,d=h("./streamCipher"),p=h("cipher-base"),c=h("./aes"),l=h("evp_bytestokey");function s(r,o,n){p.call(this),this._cache=new e,this._cipher=new c.AES(o),this._prev=v.from(n),this._mode=r,this._autopadding=!0}h("inherits")(s,p),s.prototype._update=function(r){var o,n;this._cache.add(r);for(var a=[];o=this._cache.get();)n=this._mode.encrypt(this,o),a.push(n);return v.concat(a)};var i=v.alloc(16,16);function e(){this.cache=v.allocUnsafe(0)}function t(r,o,n){var a=b[r.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if(typeof o=="string"&&(o=v.from(o)),o.length!==a.key/8)throw new TypeError("invalid key length "+o.length);if(typeof n=="string"&&(n=v.from(n)),a.mode!=="GCM"&&n.length!==a.iv)throw new TypeError("invalid iv length "+n.length);return a.type==="stream"?new d(a.module,o,n):a.type==="auth"?new m(a.module,o,n):new s(a.module,o,n)}s.prototype._final=function(){var r=this._cache.flush();if(this._autopadding)return r=this._mode.encrypt(this,r),this._cipher.scrub(),r;if(!r.equals(i))throw this._cipher.scrub(),new Error("data not multiple of block length")},s.prototype.setAutoPadding=function(r){return this._autopadding=!!r,this},e.prototype.add=function(r){this.cache=v.concat([this.cache,r])},e.prototype.get=function(){if(this.cache.length>15){var r=this.cache.slice(0,16);return this.cache=this.cache.slice(16),r}return null},e.prototype.flush=function(){for(var r=16-this.cache.length,o=v.allocUnsafe(r),n=-1;++n>>0,0),c.writeUInt32BE(p[1]>>>0,4),c.writeUInt32BE(p[2]>>>0,8),c.writeUInt32BE(p[3]>>>0,12),c}function d(p){this.h=p,this.state=b.alloc(16,0),this.cache=b.allocUnsafe(0)}d.prototype.ghash=function(p){for(var c=-1;++c0;c--)s[c]=s[c]>>>1|(1&s[c-1])<<31;s[0]=s[0]>>>1,l&&(s[0]=s[0]^225<<24)}this.state=v(i)},d.prototype.update=function(p){var c;for(this.cache=b.concat([this.cache,p]);this.cache.length>=16;)c=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(c)},d.prototype.final=function(p,c){return this.cache.length&&this.ghash(b.concat([this.cache,m],16)),this.ghash(v([0,p,0,c])),this.state},I.exports=d},{"safe-buffer":494}],192:[function(h,I,T){I.exports=function(b){for(var m,v=b.length;v--;){if((m=b.readUInt8(v))!==255){m++,b.writeUInt8(m,v);break}b.writeUInt8(0,v)}}},{}],193:[function(h,I,T){var b=h("buffer-xor");T.encrypt=function(m,v){var d=b(v,m._prev);return m._prev=m._cipher.encryptBlock(d),m._prev},T.decrypt=function(m,v){var d=m._prev;m._prev=v;var p=m._cipher.decryptBlock(v);return b(p,d)}},{"buffer-xor":217}],194:[function(h,I,T){var b=h("safe-buffer").Buffer,m=h("buffer-xor");function v(d,p,c){var l=p.length,s=m(p,d._cache);return d._cache=d._cache.slice(l),d._prev=b.concat([d._prev,c?p:s]),s}T.encrypt=function(d,p,c){for(var l,s=b.allocUnsafe(0);p.length;){if(d._cache.length===0&&(d._cache=d._cipher.encryptBlock(d._prev),d._prev=b.allocUnsafe(0)),!(d._cache.length<=p.length)){s=b.concat([s,v(d,p,c)]);break}l=d._cache.length,s=b.concat([s,v(d,p.slice(0,l),c)]),p=p.slice(l)}return s}},{"buffer-xor":217,"safe-buffer":494}],195:[function(h,I,T){var b=h("safe-buffer").Buffer;function m(d,p,c){for(var l,s,i=-1,e=0;++i<8;)l=p&1<<7-i?128:0,e+=(128&(s=d._cipher.encryptBlock(d._prev)[0]^l))>>i%8,d._prev=v(d._prev,c?l:s);return e}function v(d,p){var c=d.length,l=-1,s=b.allocUnsafe(d.length);for(d=b.concat([d,b.from([p])]);++l>7;return s}T.encrypt=function(d,p,c){for(var l=p.length,s=b.allocUnsafe(l),i=-1;++i=0||!s.umod(c.prime1)||!s.umod(c.prime2);)s=new m(v(l));return s}I.exports=d,d.getr=p}).call(this,h("buffer").Buffer)},{"bn.js":207,buffer:216,randombytes:475}],207:[function(h,I,T){arguments[4][181][0].apply(T,arguments)},{buffer:185,dup:181}],208:[function(h,I,T){I.exports=h("./browser/algorithms.json")},{"./browser/algorithms.json":209}],209:[function(h,I,T){I.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"}}},{}],210:[function(h,I,T){I.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"}},{}],211:[function(h,I,T){var b=h("safe-buffer").Buffer,m=h("create-hash"),v=h("readable-stream"),d=h("inherits"),p=h("./sign"),c=h("./verify"),l=h("./algorithms.json");function s(r){v.Writable.call(this);var o=l[r];if(!o)throw new Error("Unknown message digest");this._hashType=o.hash,this._hash=m(o.hash),this._tag=o.id,this._signType=o.sign}function i(r){v.Writable.call(this);var o=l[r];if(!o)throw new Error("Unknown message digest");this._hash=m(o.hash),this._tag=o.id,this._signType=o.sign}function e(r){return new s(r)}function t(r){return new i(r)}Object.keys(l).forEach(function(r){l[r].id=b.from(l[r].id,"hex"),l[r.toLowerCase()]=l[r]}),d(s,v.Writable),s.prototype._write=function(r,o,n){this._hash.update(r),n()},s.prototype.update=function(r,o){return typeof r=="string"&&(r=b.from(r,o)),this._hash.update(r),this},s.prototype.sign=function(r,o){this.end();var n=this._hash.digest(),a=p(n,r,this._hashType,this._signType,this._tag);return o?a.toString(o):a},d(i,v.Writable),i.prototype._write=function(r,o,n){this._hash.update(r),n()},i.prototype.update=function(r,o){return typeof r=="string"&&(r=b.from(r,o)),this._hash.update(r),this},i.prototype.verify=function(r,o,n){typeof o=="string"&&(o=b.from(o,n)),this.end();var a=this._hash.digest();return c(o,a,r,this._signType,this._tag)},I.exports={Sign:e,Verify:t,createSign:e,createVerify:t}},{"./algorithms.json":209,"./sign":212,"./verify":213,"create-hash":331,inherits:387,"readable-stream":491,"safe-buffer":214}],212:[function(h,I,T){var b=h("safe-buffer").Buffer,m=h("create-hmac"),v=h("browserify-rsa"),d=h("elliptic").ec,p=h("bn.js"),c=h("parse-asn1"),l=h("./curves.json");function s(r,o,n,a){if((r=b.from(r.toArray())).length0&&n.ishrn(a),n}function e(r,o,n){var a,u;do{for(a=b.alloc(0);8*a.length=s)throw new Error("invalid sig")}I.exports=function(l,s,i,e,t){var r=d(i);if(r.type==="ec"){if(e!=="ecdsa"&&e!=="ecdsa/rsa")throw new Error("wrong public key type");return function(w,R,E){var M=p[E.data.algorithm.curve.join(".")];if(!M)throw new Error("unknown curve "+E.data.algorithm.curve.join("."));var O=new v(M),P=E.data.subjectPrivateKey.data;return O.verify(R,w,P)}(l,s,r)}if(r.type==="dsa"){if(e!=="dsa")throw new Error("wrong public key type");return function(w,R,E){var M=E.data.p,O=E.data.q,P=E.data.g,_=E.data.pub_key,S=d.signature.decode(w,"der"),g=S.s,j=S.r;c(g,O),c(j,O);var x=m.mont(M),k=g.invm(O);return P.toRed(x).redPow(new m(R).mul(k).mod(O)).fromRed().mul(_.toRed(x).redPow(j.mul(k).mod(O)).fromRed()).mod(M).mod(O).cmp(j)===0}(l,s,r)}if(e!=="rsa"&&e!=="ecdsa/rsa")throw new Error("wrong public key type");s=b.concat([t,s]);for(var o=r.modulus.byteLength(),n=[1],a=0;s.length+n.length+2 */var b=h("buffer"),m=b.Buffer;function v(p,c){for(var l in p)c[l]=p[l]}function d(p,c,l){return m(p,c,l)}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?I.exports=b:(v(b,T),T.Buffer=d),d.prototype=Object.create(m.prototype),v(m,d),d.from=function(p,c,l){if(typeof p=="number")throw new TypeError("Argument must not be a number");return m(p,c,l)},d.alloc=function(p,c,l){if(typeof p!="number")throw new TypeError("Argument must be a number");var s=m(p);return c!==void 0?typeof l=="string"?s.fill(c,l):s.fill(c):s.fill(0),s},d.allocUnsafe=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return m(p)},d.allocUnsafeSlow=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return b.SlowBuffer(p)}},{buffer:216}],215:[function(h,I,T){arguments[4][185][0].apply(T,arguments)},{dup:185}],216:[function(h,I,T){(function(c){function m(A){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N})(A)}var v=h("base64-js"),d=h("ieee754");T.Buffer=c,T.SlowBuffer=function(A){return+A!=A&&(A=0),c.alloc(+A)},T.INSPECT_MAX_BYTES=50;function p(A){if(A>2147483647)throw new RangeError('The value "'+A+'" is invalid for option "size"');var N=new Uint8Array(A);return N.__proto__=c.prototype,N}function c(A,N,z){if(typeof A=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(A)}return l(A,N,z)}function l(A,N,z){if(typeof A=="string")return function(K,ie){if(typeof ie=="string"&&ie!==""||(ie="utf8"),!c.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);var Q=0|r(K,ie),ue=p(Q),de=ue.write(K,ie);return de!==Q&&(ue=ue.slice(0,de)),ue}(A,N);if(ArrayBuffer.isView(A))return e(A);if(A==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+m(A));if($(A,ArrayBuffer)||A&&$(A.buffer,ArrayBuffer))return function(K,ie,Q){if(ie<0||K.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|A}function r(A,N){if(c.isBuffer(A))return A.length;if(ArrayBuffer.isView(A)||$(A,ArrayBuffer))return A.byteLength;if(typeof A!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+m(A));var z=A.length,W=arguments.length>2&&arguments[2]===!0;if(!W&&z===0)return 0;for(var X=!1;;)switch(N){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return H(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*z;case"hex":return z>>>1;case"base64":return V(A).length;default:if(X)return W?-1:H(A).length;N=(""+N).toLowerCase(),X=!0}}function o(A,N,z){var W=!1;if((N===void 0||N<0)&&(N=0),N>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0)<=(N>>>=0))return"";for(A||(A="utf8");;)switch(A){case"hex":return g(this,N,z);case"utf8":case"utf-8":return P(this,N,z);case"ascii":return _(this,N,z);case"latin1":case"binary":return S(this,N,z);case"base64":return O(this,N,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,N,z);default:if(W)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),W=!0}}function n(A,N,z){var W=A[N];A[N]=A[z],A[z]=W}function a(A,N,z,W,X){if(A.length===0)return-1;if(typeof z=="string"?(W=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),L(z=+z)&&(z=X?0:A.length-1),z<0&&(z=A.length+z),z>=A.length){if(X)return-1;z=A.length-1}else if(z<0){if(!X)return-1;z=0}if(typeof N=="string"&&(N=c.from(N,W)),c.isBuffer(N))return N.length===0?-1:u(A,N,z,W,X);if(typeof N=="number")return N&=255,typeof Uint8Array.prototype.indexOf=="function"?X?Uint8Array.prototype.indexOf.call(A,N,z):Uint8Array.prototype.lastIndexOf.call(A,N,z):u(A,[N],z,W,X);throw new TypeError("val must be string, number or Buffer")}function u(A,N,z,W,X){var K,ie=1,Q=A.length,ue=N.length;if(W!==void 0&&((W=String(W).toLowerCase())==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le")){if(A.length<2||N.length<2)return-1;ie=2,Q/=2,ue/=2,z/=2}function de(ve,xe){return ie===1?ve[xe]:ve.readUInt16BE(xe*ie)}if(X){var ce=-1;for(K=z;KQ&&(z=Q-ue),K=z;K>=0;K--){for(var Ee=!0,_e=0;_eX&&(W=X):W=X;var K=N.length;W>K/2&&(W=K/2);for(var ie=0;ie>8,ue=ie%256,de.push(ue),de.push(Q);return de}(N,A.length-z),A,z,W)}function O(A,N,z){return N===0&&z===A.length?v.fromByteArray(A):v.fromByteArray(A.slice(N,z))}function P(A,N,z){z=Math.min(A.length,z);for(var W=[],X=N;X239?4:de>223?3:de>191?2:1;if(X+Ee<=z)switch(Ee){case 1:de<128&&(ce=de);break;case 2:(192&(K=A[X+1]))==128&&(ue=(31&de)<<6|63&K)>127&&(ce=ue);break;case 3:K=A[X+1],ie=A[X+2],(192&K)==128&&(192&ie)==128&&(ue=(15&de)<<12|(63&K)<<6|63&ie)>2047&&(ue<55296||ue>57343)&&(ce=ue);break;case 4:K=A[X+1],ie=A[X+2],Q=A[X+3],(192&K)==128&&(192&ie)==128&&(192&Q)==128&&(ue=(15&de)<<18|(63&K)<<12|(63&ie)<<6|63&Q)>65535&&ue<1114112&&(ce=ue)}ce===null?(ce=65533,Ee=1):ce>65535&&(ce-=65536,W.push(ce>>>10&1023|55296),ce=56320|1023&ce),W.push(ce),X+=Ee}return function(_e){var ve=_e.length;if(ve<=4096)return String.fromCharCode.apply(String,_e);for(var xe="",Re=0;ReN&&(A+=" ... "),""},c.prototype.compare=function(A,N,z,W,X){if($(A,Uint8Array)&&(A=c.from(A,A.offset,A.byteLength)),!c.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+m(A));if(N===void 0&&(N=0),z===void 0&&(z=A?A.length:0),W===void 0&&(W=0),X===void 0&&(X=this.length),N<0||z>A.length||W<0||X>this.length)throw new RangeError("out of range index");if(W>=X&&N>=z)return 0;if(W>=X)return-1;if(N>=z)return 1;if(this===A)return 0;for(var K=(X>>>=0)-(W>>>=0),ie=(z>>>=0)-(N>>>=0),Q=Math.min(K,ie),ue=this.slice(W,X),de=A.slice(N,z),ce=0;ce>>=0,isFinite(z)?(z>>>=0,W===void 0&&(W="utf8")):(W=z,z=void 0)}var X=this.length-N;if((z===void 0||z>X)&&(z=X),A.length>0&&(z<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");for(var K=!1;;)switch(W){case"hex":return f(this,A,N,z);case"utf8":case"utf-8":return y(this,A,N,z);case"ascii":return w(this,A,N,z);case"latin1":case"binary":return R(this,A,N,z);case"base64":return E(this,A,N,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,A,N,z);default:if(K)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),K=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(A,N,z){var W="";z=Math.min(A.length,z);for(var X=N;XW)&&(z=W);for(var X="",K=N;Kz)throw new RangeError("Trying to access beyond buffer length")}function k(A,N,z,W,X,K){if(!c.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>X||NA.length)throw new RangeError("Index out of range")}function C(A,N,z,W,X,K){if(z+W>A.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function D(A,N,z,W,X){return N=+N,z>>>=0,X||C(A,0,z,4),d.write(A,N,z,W,23,4),z+4}function F(A,N,z,W,X){return N=+N,z>>>=0,X||C(A,0,z,8),d.write(A,N,z,W,52,8),z+8}c.prototype.slice=function(A,N){var z=this.length;(A=~~A)<0?(A+=z)<0&&(A=0):A>z&&(A=z),(N=N===void 0?z:~~N)<0?(N+=z)<0&&(N=0):N>z&&(N=z),N>>=0,N>>>=0,z||x(A,N,this.length);for(var W=this[A],X=1,K=0;++K>>=0,N>>>=0,z||x(A,N,this.length);for(var W=this[A+--N],X=1;N>0&&(X*=256);)W+=this[A+--N]*X;return W},c.prototype.readUInt8=function(A,N){return A>>>=0,N||x(A,1,this.length),this[A]},c.prototype.readUInt16LE=function(A,N){return A>>>=0,N||x(A,2,this.length),this[A]|this[A+1]<<8},c.prototype.readUInt16BE=function(A,N){return A>>>=0,N||x(A,2,this.length),this[A]<<8|this[A+1]},c.prototype.readUInt32LE=function(A,N){return A>>>=0,N||x(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+16777216*this[A+3]},c.prototype.readUInt32BE=function(A,N){return A>>>=0,N||x(A,4,this.length),16777216*this[A]+(this[A+1]<<16|this[A+2]<<8|this[A+3])},c.prototype.readIntLE=function(A,N,z){A>>>=0,N>>>=0,z||x(A,N,this.length);for(var W=this[A],X=1,K=0;++K=(X*=128)&&(W-=Math.pow(2,8*N)),W},c.prototype.readIntBE=function(A,N,z){A>>>=0,N>>>=0,z||x(A,N,this.length);for(var W=N,X=1,K=this[A+--W];W>0&&(X*=256);)K+=this[A+--W]*X;return K>=(X*=128)&&(K-=Math.pow(2,8*N)),K},c.prototype.readInt8=function(A,N){return A>>>=0,N||x(A,1,this.length),128&this[A]?-1*(255-this[A]+1):this[A]},c.prototype.readInt16LE=function(A,N){A>>>=0,N||x(A,2,this.length);var z=this[A]|this[A+1]<<8;return 32768&z?4294901760|z:z},c.prototype.readInt16BE=function(A,N){A>>>=0,N||x(A,2,this.length);var z=this[A+1]|this[A]<<8;return 32768&z?4294901760|z:z},c.prototype.readInt32LE=function(A,N){return A>>>=0,N||x(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},c.prototype.readInt32BE=function(A,N){return A>>>=0,N||x(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},c.prototype.readFloatLE=function(A,N){return A>>>=0,N||x(A,4,this.length),d.read(this,A,!0,23,4)},c.prototype.readFloatBE=function(A,N){return A>>>=0,N||x(A,4,this.length),d.read(this,A,!1,23,4)},c.prototype.readDoubleLE=function(A,N){return A>>>=0,N||x(A,8,this.length),d.read(this,A,!0,52,8)},c.prototype.readDoubleBE=function(A,N){return A>>>=0,N||x(A,8,this.length),d.read(this,A,!1,52,8)},c.prototype.writeUIntLE=function(A,N,z,W){A=+A,N>>>=0,z>>>=0,W||k(this,A,N,z,Math.pow(2,8*z)-1,0);var X=1,K=0;for(this[N]=255&A;++K>>=0,z>>>=0,W||k(this,A,N,z,Math.pow(2,8*z)-1,0);var X=z-1,K=1;for(this[N+X]=255&A;--X>=0&&(K*=256);)this[N+X]=A/K&255;return N+z},c.prototype.writeUInt8=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,1,255,0),this[N]=255&A,N+1},c.prototype.writeUInt16LE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,2,65535,0),this[N]=255&A,this[N+1]=A>>>8,N+2},c.prototype.writeUInt16BE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,2,65535,0),this[N]=A>>>8,this[N+1]=255&A,N+2},c.prototype.writeUInt32LE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,4,4294967295,0),this[N+3]=A>>>24,this[N+2]=A>>>16,this[N+1]=A>>>8,this[N]=255&A,N+4},c.prototype.writeUInt32BE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,4,4294967295,0),this[N]=A>>>24,this[N+1]=A>>>16,this[N+2]=A>>>8,this[N+3]=255&A,N+4},c.prototype.writeIntLE=function(A,N,z,W){if(A=+A,N>>>=0,!W){var X=Math.pow(2,8*z-1);k(this,A,N,z,X-1,-X)}var K=0,ie=1,Q=0;for(this[N]=255&A;++K>0)-Q&255;return N+z},c.prototype.writeIntBE=function(A,N,z,W){if(A=+A,N>>>=0,!W){var X=Math.pow(2,8*z-1);k(this,A,N,z,X-1,-X)}var K=z-1,ie=1,Q=0;for(this[N+K]=255&A;--K>=0&&(ie*=256);)A<0&&Q===0&&this[N+K+1]!==0&&(Q=1),this[N+K]=(A/ie>>0)-Q&255;return N+z},c.prototype.writeInt8=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,1,127,-128),A<0&&(A=255+A+1),this[N]=255&A,N+1},c.prototype.writeInt16LE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,2,32767,-32768),this[N]=255&A,this[N+1]=A>>>8,N+2},c.prototype.writeInt16BE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,2,32767,-32768),this[N]=A>>>8,this[N+1]=255&A,N+2},c.prototype.writeInt32LE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,4,2147483647,-2147483648),this[N]=255&A,this[N+1]=A>>>8,this[N+2]=A>>>16,this[N+3]=A>>>24,N+4},c.prototype.writeInt32BE=function(A,N,z){return A=+A,N>>>=0,z||k(this,A,N,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[N]=A>>>24,this[N+1]=A>>>16,this[N+2]=A>>>8,this[N+3]=255&A,N+4},c.prototype.writeFloatLE=function(A,N,z){return D(this,A,N,!0,z)},c.prototype.writeFloatBE=function(A,N,z){return D(this,A,N,!1,z)},c.prototype.writeDoubleLE=function(A,N,z){return F(this,A,N,!0,z)},c.prototype.writeDoubleBE=function(A,N,z){return F(this,A,N,!1,z)},c.prototype.copy=function(A,N,z,W){if(!c.isBuffer(A))throw new TypeError("argument should be a Buffer");if(z||(z=0),W||W===0||(W=this.length),N>=A.length&&(N=A.length),N||(N=0),W>0&&W=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),A.length-N=0;--K)A[K+N]=this[K+z];else Uint8Array.prototype.set.call(A,this.subarray(z,W),N);return X},c.prototype.fill=function(A,N,z,W){if(typeof A=="string"){if(typeof N=="string"?(W=N,N=0,z=this.length):typeof z=="string"&&(W=z,z=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!c.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(A.length===1){var X=A.charCodeAt(0);(W==="utf8"&&X<128||W==="latin1")&&(A=X)}}else typeof A=="number"&&(A&=255);if(N<0||this.length>>=0,z=z===void 0?this.length:z>>>0,A||(A=0),typeof A=="number")for(K=N;K55295&&z<57344){if(!X){if(z>56319){(N-=3)>-1&&K.push(239,191,189);continue}if(ie+1===W){(N-=3)>-1&&K.push(239,191,189);continue}X=z;continue}if(z<56320){(N-=3)>-1&&K.push(239,191,189),X=z;continue}z=65536+(X-55296<<10|z-56320)}else X&&(N-=3)>-1&&K.push(239,191,189);if(X=null,z<128){if((N-=1)<0)break;K.push(z)}else if(z<2048){if((N-=2)<0)break;K.push(z>>6|192,63&z|128)}else if(z<65536){if((N-=3)<0)break;K.push(z>>12|224,z>>6&63|128,63&z|128)}else{if(!(z<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;K.push(z>>18|240,z>>12&63|128,z>>6&63|128,63&z|128)}}return K}function V(A){return v.toByteArray(function(N){if((N=(N=N.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;N.length%4!=0;)N+="=";return N}(A))}function q(A,N,z,W){for(var X=0;X=N.length||X>=A.length);++X)N[X+z]=A[X];return X}function $(A,N){return A instanceof N||A!=null&&A.constructor!=null&&A.constructor.name!=null&&A.constructor.name===N.name}function L(A){return A!=A}}).call(this,h("buffer").Buffer)},{"base64-js":182,buffer:216,ieee754:385}],217:[function(h,I,T){(function(b){I.exports=function(m,v){for(var d=Math.min(m.length,v.length),p=new b(d),c=0;cr;)if((i=e[r++])!=i)return!0}else for(;t>r;r++)if((p||r in e)&&e[r]===l)return p||r||0;return!p&&-1}};I.exports={includes:d(!0),indexOf:d(!1)}},{"../internals/to-absolute-index":304,"../internals/to-indexed-object":305,"../internals/to-length":307}],225:[function(h,I,T){var b=h("../internals/function-bind-context"),m=h("../internals/indexed-object"),v=h("../internals/to-object"),d=h("../internals/to-length"),p=h("../internals/array-species-create"),c=[].push,l=function(s){var i=s==1,e=s==2,t=s==3,r=s==4,o=s==6,n=s==5||o;return function(a,u,f,y){for(var w,R,E=v(a),M=m(E),O=b(u,f,3),P=d(M.length),_=0,S=y||p,g=i?S(a,P):e?S(a,0):void 0;P>_;_++)if((n||_ in M)&&(R=O(w=M[_],_,E),s)){if(i)g[_]=R;else if(R)switch(s){case 3:return!0;case 5:return w;case 6:return _;case 2:c.call(g,w)}else if(r)return!1}return o?-1:t||r?r:g}};I.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},{"../internals/array-species-create":227,"../internals/function-bind-context":248,"../internals/indexed-object":257,"../internals/to-length":307,"../internals/to-object":308}],226:[function(h,I,T){var b=h("../internals/descriptors"),m=h("../internals/fails"),v=h("../internals/has"),d=Object.defineProperty,p={},c=function(l){throw l};I.exports=function(l,s){if(v(p,l))return p[l];s||(s={});var i=[][l],e=!!v(s,"ACCESSORS")&&s.ACCESSORS,t=v(s,0)?s[0]:c,r=v(s,1)?s[1]:void 0;return p[l]=!!i&&!m(function(){if(e&&!b)return!0;var o={length:-1};e?d(o,1,{enumerable:!0,get:c}):o[1]=1,i.call(o,t,r)})}},{"../internals/descriptors":240,"../internals/fails":247,"../internals/has":252}],227:[function(h,I,T){var b=h("../internals/is-object"),m=h("../internals/is-array"),v=h("../internals/well-known-symbol")("species");I.exports=function(d,p){var c;return m(d)&&(typeof(c=d.constructor)!="function"||c!==Array&&!m(c.prototype)?b(c)&&(c=c[v])===null&&(c=void 0):c=void 0),new(c===void 0?Array:c)(p===0?0:p)}},{"../internals/is-array":261,"../internals/is-object":263,"../internals/well-known-symbol":314}],228:[function(h,I,T){var b=h("../internals/an-object");I.exports=function(m,v,d,p){try{return p?v(b(d)[0],d[1]):v(d)}catch(l){var c=m.return;throw c!==void 0&&b(c.call(m)),l}}},{"../internals/an-object":223}],229:[function(h,I,T){var b=h("../internals/well-known-symbol")("iterator"),m=!1;try{var v=0,d={next:function(){return{done:!!v++}},return:function(){m=!0}};d[b]=function(){return this},Array.from(d,function(){throw 2})}catch{}I.exports=function(p,c){if(!c&&!m)return!1;var l=!1;try{var s={};s[b]=function(){return{next:function(){return{done:l=!0}}}},p(s)}catch{}return l}},{"../internals/well-known-symbol":314}],230:[function(h,I,T){var b={}.toString;I.exports=function(m){return b.call(m).slice(8,-1)}},{}],231:[function(h,I,T){var b=h("../internals/to-string-tag-support"),m=h("../internals/classof-raw"),v=h("../internals/well-known-symbol")("toStringTag"),d=m(function(){return arguments}())=="Arguments";I.exports=b?m:function(p){var c,l,s;return p===void 0?"Undefined":p===null?"Null":typeof(l=function(i,e){try{return i[e]}catch{}}(c=Object(p),v))=="string"?l:d?m(c):(s=m(c))=="Object"&&typeof c.callee=="function"?"Arguments":s}},{"../internals/classof-raw":230,"../internals/to-string-tag-support":310,"../internals/well-known-symbol":314}],232:[function(h,I,T){var b=h("../internals/has"),m=h("../internals/own-keys"),v=h("../internals/object-get-own-property-descriptor"),d=h("../internals/object-define-property");I.exports=function(p,c){for(var l=m(c),s=d.f,i=v.f,e=0;e=74)&&(b=d.match(/Chrome\/(\d+)/))&&(m=b[1]),I.exports=m&&+m},{"../internals/engine-user-agent":243,"../internals/global":251}],245:[function(h,I,T){I.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],246:[function(h,I,T){var b=h("../internals/global"),m=h("../internals/object-get-own-property-descriptor").f,v=h("../internals/create-non-enumerable-property"),d=h("../internals/redefine"),p=h("../internals/set-global"),c=h("../internals/copy-constructor-properties"),l=h("../internals/is-forced");I.exports=function(s,i){var e,t,r,o,n,a=s.target,u=s.global,f=s.stat;if(e=u?b:f?b[a]||p(a,{}):(b[a]||{}).prototype)for(t in i){if(o=i[t],r=s.noTargetGet?(n=m(e,t))&&n.value:e[t],!l(u?t:a+(f?".":"#")+t,s.forced)&&r!==void 0){if(typeof o==typeof r)continue;c(o,r)}(s.sham||r&&r.sham)&&v(o,"sham",!0),d(e,t,o,s)}}},{"../internals/copy-constructor-properties":232,"../internals/create-non-enumerable-property":236,"../internals/global":251,"../internals/is-forced":262,"../internals/object-get-own-property-descriptor":279,"../internals/redefine":294,"../internals/set-global":296}],247:[function(h,I,T){I.exports=function(b){try{return!!b()}catch{return!0}}},{}],248:[function(h,I,T){var b=h("../internals/a-function");I.exports=function(m,v,d){if(b(m),v===void 0)return m;switch(d){case 0:return function(){return m.call(v)};case 1:return function(p){return m.call(v,p)};case 2:return function(p,c){return m.call(v,p,c)};case 3:return function(p,c,l){return m.call(v,p,c,l)}}return function(){return m.apply(v,arguments)}}},{"../internals/a-function":219}],249:[function(h,I,T){var b=h("../internals/path"),m=h("../internals/global"),v=function(d){return typeof d=="function"?d:void 0};I.exports=function(d,p){return arguments.length<2?v(b[d])||v(m[d]):b[d]&&b[d][p]||m[d]&&m[d][p]}},{"../internals/global":251,"../internals/path":290}],250:[function(h,I,T){var b=h("../internals/classof"),m=h("../internals/iterators"),v=h("../internals/well-known-symbol")("iterator");I.exports=function(d){if(d!=null)return d[v]||d["@@iterator"]||m[b(d)]}},{"../internals/classof":231,"../internals/iterators":268,"../internals/well-known-symbol":314}],251:[function(h,I,T){(function(b){var m=function(v){return v&&v.Math==Math&&v};I.exports=m(typeof globalThis=="object"&&globalThis)||m(typeof window=="object"&&window)||m(typeof self=="object"&&self)||m(typeof b=="object"&&b)||Function("return this")()}).call(this,typeof Qe!="undefined"?Qe:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],252:[function(h,I,T){var b={}.hasOwnProperty;I.exports=function(m,v){return b.call(m,v)}},{}],253:[function(h,I,T){I.exports={}},{}],254:[function(h,I,T){var b=h("../internals/global");I.exports=function(m,v){var d=b.console;d&&d.error&&(arguments.length===1?d.error(m):d.error(m,v))}},{"../internals/global":251}],255:[function(h,I,T){var b=h("../internals/get-built-in");I.exports=b("document","documentElement")},{"../internals/get-built-in":249}],256:[function(h,I,T){var b=h("../internals/descriptors"),m=h("../internals/fails"),v=h("../internals/document-create-element");I.exports=!b&&!m(function(){return Object.defineProperty(v("div"),"a",{get:function(){return 7}}).a!=7})},{"../internals/descriptors":240,"../internals/document-create-element":241,"../internals/fails":247}],257:[function(h,I,T){var b=h("../internals/fails"),m=h("../internals/classof-raw"),v="".split;I.exports=b(function(){return!Object("z").propertyIsEnumerable(0)})?function(d){return m(d)=="String"?v.call(d,""):Object(d)}:Object},{"../internals/classof-raw":230,"../internals/fails":247}],258:[function(h,I,T){var b=h("../internals/shared-store"),m=Function.toString;typeof b.inspectSource!="function"&&(b.inspectSource=function(v){return m.call(v)}),I.exports=b.inspectSource},{"../internals/shared-store":300}],259:[function(h,I,T){var b,m,v,d=h("../internals/native-weak-map"),p=h("../internals/global"),c=h("../internals/is-object"),l=h("../internals/create-non-enumerable-property"),s=h("../internals/has"),i=h("../internals/shared-key"),e=h("../internals/hidden-keys"),t=p.WeakMap;if(d){var r=new t,o=r.get,n=r.has,a=r.set;b=function(f,y){return a.call(r,f,y),y},m=function(f){return o.call(r,f)||{}},v=function(f){return n.call(r,f)}}else{var u=i("state");e[u]=!0,b=function(f,y){return l(f,u,y),y},m=function(f){return s(f,u)?f[u]:{}},v=function(f){return s(f,u)}}I.exports={set:b,get:m,has:v,enforce:function(f){return v(f)?m(f):b(f,{})},getterFor:function(f){return function(y){var w;if(!c(y)||(w=m(y)).type!==f)throw TypeError("Incompatible receiver, "+f+" required");return w}}}},{"../internals/create-non-enumerable-property":236,"../internals/global":251,"../internals/has":252,"../internals/hidden-keys":253,"../internals/is-object":263,"../internals/native-weak-map":272,"../internals/shared-key":299}],260:[function(h,I,T){var b=h("../internals/well-known-symbol"),m=h("../internals/iterators"),v=b("iterator"),d=Array.prototype;I.exports=function(p){return p!==void 0&&(m.Array===p||d[v]===p)}},{"../internals/iterators":268,"../internals/well-known-symbol":314}],261:[function(h,I,T){var b=h("../internals/classof-raw");I.exports=Array.isArray||function(m){return b(m)=="Array"}},{"../internals/classof-raw":230}],262:[function(h,I,T){var b=h("../internals/fails"),m=/#|\.prototype\./,v=function(s,i){var e=p[d(s)];return e==l||e!=c&&(typeof i=="function"?b(i):!!i)},d=v.normalize=function(s){return String(s).replace(m,".").toLowerCase()},p=v.data={},c=v.NATIVE="N",l=v.POLYFILL="P";I.exports=v},{"../internals/fails":247}],263:[function(h,I,T){I.exports=function(b){return typeof b=="object"?b!==null:typeof b=="function"}},{}],264:[function(h,I,T){I.exports=!1},{}],265:[function(h,I,T){var b=h("../internals/is-object"),m=h("../internals/classof-raw"),v=h("../internals/well-known-symbol")("match");I.exports=function(d){var p;return b(d)&&((p=d[v])!==void 0?!!p:m(d)=="RegExp")}},{"../internals/classof-raw":230,"../internals/is-object":263,"../internals/well-known-symbol":314}],266:[function(h,I,T){var b=h("../internals/an-object"),m=h("../internals/is-array-iterator-method"),v=h("../internals/to-length"),d=h("../internals/function-bind-context"),p=h("../internals/get-iterator-method"),c=h("../internals/call-with-safe-iteration-closing"),l=function(s,i){this.stopped=s,this.result=i};(I.exports=function(s,i,e,t,r){var o,n,a,u,f,y,w,R=d(i,e,t?2:1);if(r)o=s;else{if(typeof(n=p(s))!="function")throw TypeError("Target is not iterable");if(m(n)){for(a=0,u=v(s.length);u>a;a++)if((f=t?R(b(w=s[a])[0],w[1]):R(s[a]))&&f instanceof l)return f;return new l(!1)}o=n.call(s)}for(y=o.next;!(w=y.call(o)).done;)if(typeof(f=c(o,R,w.value,t))=="object"&&f&&f instanceof l)return f;return new l(!1)}).stop=function(s){return new l(!0,s)}},{"../internals/an-object":223,"../internals/call-with-safe-iteration-closing":228,"../internals/function-bind-context":248,"../internals/get-iterator-method":250,"../internals/is-array-iterator-method":260,"../internals/to-length":307}],267:[function(h,I,T){var b,m,v,d=h("../internals/object-get-prototype-of"),p=h("../internals/create-non-enumerable-property"),c=h("../internals/has"),l=h("../internals/well-known-symbol"),s=h("../internals/is-pure"),i=l("iterator"),e=!1;[].keys&&("next"in(v=[].keys())?(m=d(d(v)))!==Object.prototype&&(b=m):e=!0),b==null&&(b={}),s||c(b,i)||p(b,i,function(){return this}),I.exports={IteratorPrototype:b,BUGGY_SAFARI_ITERATORS:e}},{"../internals/create-non-enumerable-property":236,"../internals/has":252,"../internals/is-pure":264,"../internals/object-get-prototype-of":283,"../internals/well-known-symbol":314}],268:[function(h,I,T){arguments[4][253][0].apply(T,arguments)},{dup:253}],269:[function(h,I,T){var b,m,v,d,p,c,l,s,i=h("../internals/global"),e=h("../internals/object-get-own-property-descriptor").f,t=h("../internals/classof-raw"),r=h("../internals/task").set,o=h("../internals/engine-is-ios"),n=i.MutationObserver||i.WebKitMutationObserver,a=i.process,u=i.Promise,f=t(a)=="process",y=e(i,"queueMicrotask"),w=y&&y.value;w||(b=function(){var R,E;for(f&&(R=a.domain)&&R.exit();m;){E=m.fn,m=m.next;try{E()}catch(M){throw m?d():v=void 0,M}}v=void 0,R&&R.enter()},f?d=function(){a.nextTick(b)}:n&&!o?(p=!0,c=document.createTextNode(""),new n(b).observe(c,{characterData:!0}),d=function(){c.data=p=!p}):u&&u.resolve?(l=u.resolve(void 0),s=l.then,d=function(){s.call(l,b)}):d=function(){r.call(i,b)}),I.exports=w||function(R){var E={fn:R,next:void 0};v&&(v.next=E),m||(m=E,d()),v=E}},{"../internals/classof-raw":230,"../internals/engine-is-ios":242,"../internals/global":251,"../internals/object-get-own-property-descriptor":279,"../internals/task":303}],270:[function(h,I,T){var b=h("../internals/global");I.exports=b.Promise},{"../internals/global":251}],271:[function(h,I,T){var b=h("../internals/fails");I.exports=!!Object.getOwnPropertySymbols&&!b(function(){return!String(Symbol())})},{"../internals/fails":247}],272:[function(h,I,T){var b=h("../internals/global"),m=h("../internals/inspect-source"),v=b.WeakMap;I.exports=typeof v=="function"&&/native code/.test(m(v))},{"../internals/global":251,"../internals/inspect-source":258}],273:[function(h,I,T){var b=h("../internals/a-function"),m=function(v){var d,p;this.promise=new v(function(c,l){if(d!==void 0||p!==void 0)throw TypeError("Bad Promise constructor");d=c,p=l}),this.resolve=b(d),this.reject=b(p)};I.exports.f=function(v){return new m(v)}},{"../internals/a-function":219}],274:[function(h,I,T){var b=h("../internals/is-regexp");I.exports=function(m){if(b(m))throw TypeError("The method doesn't accept regular expressions");return m}},{"../internals/is-regexp":265}],275:[function(h,I,T){var b=h("../internals/descriptors"),m=h("../internals/fails"),v=h("../internals/object-keys"),d=h("../internals/object-get-own-property-symbols"),p=h("../internals/object-property-is-enumerable"),c=h("../internals/to-object"),l=h("../internals/indexed-object"),s=Object.assign,i=Object.defineProperty;I.exports=!s||m(function(){if(b&&s({b:1},s(i({},"a",{enumerable:!0,get:function(){i(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(o){t[o]=o}),s({},e)[r]!=7||v(s({},t)).join("")!="abcdefghijklmnopqrst"})?function(e,t){for(var r=c(e),o=arguments.length,n=1,a=d.f,u=p.f;o>n;)for(var f,y=l(arguments[n++]),w=a?v(y).concat(a(y)):v(y),R=w.length,E=0;R>E;)f=w[E++],b&&!u.call(y,f)||(r[f]=y[f]);return r}:s},{"../internals/descriptors":240,"../internals/fails":247,"../internals/indexed-object":257,"../internals/object-get-own-property-symbols":282,"../internals/object-keys":285,"../internals/object-property-is-enumerable":286,"../internals/to-object":308}],276:[function(h,I,T){var b,m=h("../internals/an-object"),v=h("../internals/object-define-properties"),d=h("../internals/enum-bug-keys"),p=h("../internals/hidden-keys"),c=h("../internals/html"),l=h("../internals/document-create-element"),s=h("../internals/shared-key"),i=s("IE_PROTO"),e=function(){},t=function(o){return"