var bn=Object.defineProperty;var gn=(Pe,Ce,Te)=>Ce in Pe?bn(Pe,Ce,{enumerable:!0,configurable:!0,writable:!0,value:Te}):Pe[Ce]=Te;var Oe=(Pe,Ce,Te)=>(gn(Pe,typeof Ce!="symbol"?Ce+"":Ce,Te),Te);(function(){"use strict";function Pe(W,Z){"txml";Z=Z||{};var e=Z.pos||0,S=!!Z.keepComments,_=!!Z.keepWhitespace,d="<",o="<".charCodeAt(0),a=">",n=">".charCodeAt(0),t="-".charCodeAt(0),r="/".charCodeAt(0),l="!".charCodeAt(0),i="'".charCodeAt(0),s='"'.charCodeAt(0),h="[".charCodeAt(0),c="]".charCodeAt(0);function u(F){for(var P=[];W[e];)if(W.charCodeAt(e)==o){if(W.charCodeAt(e+1)===r){var U=e+2;e=W.indexOf(a,e);var B=W.substring(U,e);if(B.indexOf(F)==-1){var k=W.substring(0,e).split(` `);throw new Error(`Unexpected close tag Line: `+(k.length-1)+` Column: `+(k[k.length-1].length+1)+` Char: `+W[e])}return e+1&&(e+=1),P}else if(W.charCodeAt(e+1)===l){if(W.charCodeAt(e+2)==t){const y=e;for(;e!==-1&&!(W.charCodeAt(e)===n&&W.charCodeAt(e-1)==t&&W.charCodeAt(e-2)==t&&e!=-1);)e=W.indexOf(a,e+1);e===-1&&(e=W.length),S&&P.push(W.substring(y,e+1))}else if(W.charCodeAt(e+2)===h&&W.charCodeAt(e+8)===h&&W.substr(e+3,5).toLowerCase()==="cdata"){var T=W.indexOf("]]>",e);T==-1?(P.push(W.substr(e+9)),e=W.length):(P.push(W.substring(e+9,T)),e=T+3);continue}else{const y=e+1;e+=2;for(var v=!1;(W.charCodeAt(e)!==n||v===!0)&&W[e];)W.charCodeAt(e)===h?v=!0:v===!0&&W.charCodeAt(e)===c&&(v=!1),e++;P.push(W.substring(y,e))}e++;continue}var m=A();P.push(m),m.tagName[0]==="?"&&(P.push(...m.children),m.children=[])}else{var b=p();if(_)b.length>0&&P.push(b);else{var g=b.trim();g.length>0&&P.push(g)}e++}return P}function p(){var F=e;return e=W.indexOf(d,e)-1,e===-2&&(e=W.length),W.slice(F,e+1)}var f=`\r >/= `;function w(){for(var F=e;f.indexOf(W[e])===-1&&W[e];)e++;return W.slice(F,e)}var x=Z.noChildNodes||["img","br","input","meta","link","hr"];function A(){e++;const F=w(),P={};let U=[];for(;W.charCodeAt(e)!==n&&W[e];){var B=W.charCodeAt(e);if(B>64&&B<91||B>96&&B<123){for(var k=w(),T=W.charCodeAt(e);T&&T!==i&&T!==s&&!(T>64&&T<91||T>96&&T<123)&&T!==n;)e++,T=W.charCodeAt(e);if(T===i||T===s){var v=N();if(e===-1)return{tagName:F,attributes:P,children:U}}else v=null,e--;P[k]=v}e++}if(W.charCodeAt(e-1)!==r)if(F=="script"){var m=e+1;e=W.indexOf("<\/script>",e),U=[W.slice(m,e)],e+=9}else if(F=="style"){var m=e+1;e=W.indexOf("",e),U=[W.slice(m,e)],e+=8}else x.indexOf(F)===-1?(e++,U=u(F)):e++;else e++;return{tagName:F,attributes:P,children:U}}function N(){var F=W[e],P=e+1;return e=W.indexOf(F,P),W.slice(P,e)}function L(){var F=new RegExp("\\s"+Z.attrName+`\\s*=['"]`+Z.attrValue+`['"]`).exec(W);return F?F.index:-1}var j=null;if(Z.attrValue!==void 0){Z.attrName=Z.attrName||"id";for(var j=[];(e=L())!==-1;)e=W.lastIndexOf("<",e),e!==-1&&j.push(A()),W=W.substr(e),e=0}else Z.parseNode?j=A():j=u("");return Z.filter&&(j=Te(j,Z.filter)),Z.simplify?Ce(Array.isArray(j)?j:[j]):(Z.setPos&&(j.pos=e),j)}function Ce(W){var Z={};if(!W.length)return"";if(W.length===1&&typeof W[0]=="string")return W[0];W.forEach(function(S){if(typeof S=="object"){Z[S.tagName]||(Z[S.tagName]=[]);var _=Ce(S.children);Z[S.tagName].push(_),Object.keys(S.attributes).length&&typeof _!="string"&&(_._attributes=S.attributes)}});for(var e in Z)Z[e].length==1&&(Z[e]=Z[e][0]);return Z}function Te(W,Z,e=0,S=""){var _=[];return W.forEach(function(d,o){if(typeof d=="object"&&Z(d,o,e,S)&&_.push(d),d.children){var a=Te(d.children,Z,e+1,(S?S+".":"")+o+"."+d.tagName);_=_.concat(a)}}),_}function Ve(W){"@babel/helpers - typeof";return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Ve(W)}var Sr=/^\s+/,Cr=/\s+$/;function Rt(W,Z){if(W=W||"",Z=Z||{},W instanceof Rt)return W;if(!(this instanceof Rt))return new Rt(W,Z);var e=Mr(W);this._originalInput=W,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=Z.format||e.format,this._gradientType=Z.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}Rt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Z=this.toRgb();return(Z.r*299+Z.g*587+Z.b*114)/1e3},getLuminance:function(){var Z=this.toRgb(),e,S,_,d,o,a;return e=Z.r/255,S=Z.g/255,_=Z.b/255,e<=.03928?d=e/12.92:d=Math.pow((e+.055)/1.055,2.4),S<=.03928?o=S/12.92:o=Math.pow((S+.055)/1.055,2.4),_<=.03928?a=_/12.92:a=Math.pow((_+.055)/1.055,2.4),.2126*d+.7152*o+.0722*a},setAlpha:function(Z){return this._a=cr(Z),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var Z=ar(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,v:Z.v,a:this._a}},toHsvString:function(){var Z=ar(this._r,this._g,this._b),e=Math.round(Z.h*360),S=Math.round(Z.s*100),_=Math.round(Z.v*100);return this._a==1?"hsv("+e+", "+S+"%, "+_+"%)":"hsva("+e+", "+S+"%, "+_+"%, "+this._roundA+")"},toHsl:function(){var Z=or(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,l:Z.l,a:this._a}},toHslString:function(){var Z=or(this._r,this._g,this._b),e=Math.round(Z.h*360),S=Math.round(Z.s*100),_=Math.round(Z.l*100);return this._a==1?"hsl("+e+", "+S+"%, "+_+"%)":"hsla("+e+", "+S+"%, "+_+"%, "+this._roundA+")"},toHex:function(Z){return lr(this._r,this._g,this._b,Z)},toHexString:function(Z){return"#"+this.toHex(Z)},toHex8:function(Z){return Rr(this._r,this._g,this._b,this._a,Z)},toHex8String:function(Z){return"#"+this.toHex8(Z)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(fe(this._r,255)*100)+"%",g:Math.round(fe(this._g,255)*100)+"%",b:Math.round(fe(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(fe(this._r,255)*100)+"%, "+Math.round(fe(this._g,255)*100)+"%, "+Math.round(fe(this._b,255)*100)+"%)":"rgba("+Math.round(fe(this._r,255)*100)+"%, "+Math.round(fe(this._g,255)*100)+"%, "+Math.round(fe(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Hr[lr(this._r,this._g,this._b,!0)]||!1},toFilter:function(Z){var e="#"+ur(this._r,this._g,this._b,this._a),S=e,_=this._gradientType?"GradientType = 1, ":"";if(Z){var d=Rt(Z);S="#"+ur(d._r,d._g,d._b,d._a)}return"progid:DXImageTransform.Microsoft.gradient("+_+"startColorstr="+e+",endColorstr="+S+")"},toString:function(Z){var e=!!Z;Z=Z||this._format;var S=!1,_=this._a<1&&this._a>=0,d=!e&&_&&(Z==="hex"||Z==="hex6"||Z==="hex3"||Z==="hex4"||Z==="hex8"||Z==="name");return d?Z==="name"&&this._a===0?this.toName():this.toRgbString():(Z==="rgb"&&(S=this.toRgbString()),Z==="prgb"&&(S=this.toPercentageRgbString()),(Z==="hex"||Z==="hex6")&&(S=this.toHexString()),Z==="hex3"&&(S=this.toHexString(!0)),Z==="hex4"&&(S=this.toHex8String(!0)),Z==="hex8"&&(S=this.toHex8String()),Z==="name"&&(S=this.toName()),Z==="hsl"&&(S=this.toHslString()),Z==="hsv"&&(S=this.toHsvString()),S||this.toHexString())},clone:function(){return Rt(this.toString())},_applyModification:function(Z,e){var S=Z.apply(null,[this].concat([].slice.call(e)));return this._r=S._r,this._g=S._g,this._b=S._b,this.setAlpha(S._a),this},lighten:function(){return this._applyModification(Nr,arguments)},brighten:function(){return this._applyModification(Fr,arguments)},darken:function(){return this._applyModification(Pr,arguments)},desaturate:function(){return this._applyModification(Or,arguments)},saturate:function(){return this._applyModification(jr,arguments)},greyscale:function(){return this._applyModification(Ir,arguments)},spin:function(){return this._applyModification(Br,arguments)},_applyCombination:function(Z,e){return Z.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(zr,arguments)},complement:function(){return this._applyCombination(Dr,arguments)},monochromatic:function(){return this._applyCombination(Ur,arguments)},splitcomplement:function(){return this._applyCombination(Lr,arguments)},triad:function(){return this._applyCombination(hr,[3])},tetrad:function(){return this._applyCombination(hr,[4])}},Rt.fromRatio=function(W,Z){if(Ve(W)=="object"){var e={};for(var S in W)W.hasOwnProperty(S)&&(S==="a"?e[S]=W[S]:e[S]=He(W[S]));W=e}return Rt(W,Z)};function Mr(W){var Z={r:0,g:0,b:0},e=1,S=null,_=null,d=null,o=!1,a=!1;return typeof W=="string"&&(W=qr(W)),Ve(W)=="object"&&(Ee(W.r)&&Ee(W.g)&&Ee(W.b)?(Z=Tr(W.r,W.g,W.b),o=!0,a=String(W.r).substr(-1)==="%"?"prgb":"rgb"):Ee(W.h)&&Ee(W.s)&&Ee(W.v)?(S=He(W.s),_=He(W.v),Z=Ar(W.h,S,_),o=!0,a="hsv"):Ee(W.h)&&Ee(W.s)&&Ee(W.l)&&(S=He(W.s),d=He(W.l),Z=Er(W.h,S,d),o=!0,a="hsl"),W.hasOwnProperty("a")&&(e=W.a)),e=cr(e),{ok:o,format:W.format||a,r:Math.min(255,Math.max(Z.r,0)),g:Math.min(255,Math.max(Z.g,0)),b:Math.min(255,Math.max(Z.b,0)),a:e}}function Tr(W,Z,e){return{r:fe(W,255)*255,g:fe(Z,255)*255,b:fe(e,255)*255}}function or(W,Z,e){W=fe(W,255),Z=fe(Z,255),e=fe(e,255);var S=Math.max(W,Z,e),_=Math.min(W,Z,e),d,o,a=(S+_)/2;if(S==_)d=o=0;else{var n=S-_;switch(o=a>.5?n/(2-S-_):n/(S+_),S){case W:d=(Z-e)/n+(Z1&&(l-=1),l<1/6?t+(r-t)*6*l:l<1/2?r:l<2/3?t+(r-t)*(2/3-l)*6:t}if(Z===0)S=_=d=e;else{var a=e<.5?e*(1+Z):e+Z-e*Z,n=2*e-a;S=o(n,a,W+1/3),_=o(n,a,W),d=o(n,a,W-1/3)}return{r:S*255,g:_*255,b:d*255}}function ar(W,Z,e){W=fe(W,255),Z=fe(Z,255),e=fe(e,255);var S=Math.max(W,Z,e),_=Math.min(W,Z,e),d,o,a=S,n=S-_;if(o=S===0?0:n/S,S==_)d=0;else{switch(S){case W:d=(Z-e)/n+(Z>1)+720)%360;--Z;)S.h=(S.h+_)%360,d.push(Rt(S));return d}function Ur(W,Z){Z=Z||6;for(var e=Rt(W).toHsv(),S=e.h,_=e.s,d=e.v,o=[],a=1/Z;Z--;)o.push(Rt({h:S,s:_,v:d})),d=(d+a)%1;return o}Rt.mix=function(W,Z,e){e=e===0?0:e||50;var S=Rt(W).toRgb(),_=Rt(Z).toRgb(),d=e/100,o={r:(_.r-S.r)*d+S.r,g:(_.g-S.g)*d+S.g,b:(_.b-S.b)*d+S.b,a:(_.a-S.a)*d+S.a};return Rt(o)},Rt.readability=function(W,Z){var e=Rt(W),S=Rt(Z);return(Math.max(e.getLuminance(),S.getLuminance())+.05)/(Math.min(e.getLuminance(),S.getLuminance())+.05)},Rt.isReadable=function(W,Z,e){var S=Rt.readability(W,Z),_,d;switch(d=!1,_=Xr(e),_.level+_.size){case"AAsmall":case"AAAlarge":d=S>=4.5;break;case"AAlarge":d=S>=3;break;case"AAAsmall":d=S>=7;break}return d},Rt.mostReadable=function(W,Z,e){var S=null,_=0,d,o,a,n;e=e||{},o=e.includeFallbackColors,a=e.level,n=e.size;for(var t=0;t_&&(_=d,S=Rt(Z[t]));return Rt.isReadable(W,S,{level:a,size:n})||!o?S:(e.includeFallbackColors=!1,Rt.mostReadable(W,["#fff","#000"],e))};var er=Rt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Hr=Rt.hexNames=$r(er);function $r(W){var Z={};for(var e in W)W.hasOwnProperty(e)&&(Z[W[e]]=e);return Z}function cr(W){return W=parseFloat(W),(isNaN(W)||W<0||W>1)&&(W=1),W}function fe(W,Z){Vr(W)&&(W="100%");var e=Wr(W);return W=Math.min(Z,Math.max(0,parseFloat(W))),e&&(W=parseInt(W*Z,10)/100),Math.abs(W-Z)<1e-6?1:W%Z/parseFloat(Z)}function We(W){return Math.min(1,Math.max(0,W))}function we(W){return parseInt(W,16)}function Vr(W){return typeof W=="string"&&W.indexOf(".")!=-1&&parseFloat(W)===1}function Wr(W){return typeof W=="string"&&W.indexOf("%")!=-1}function xe(W){return W.length==1?"0"+W:""+W}function He(W){return W<=1&&(W=W*100+"%"),W}function fr(W){return Math.round(parseFloat(W)*255).toString(16)}function dr(W){return we(W)/255}var ke=function(){var W="[-\\+]?\\d+%?",Z="[-\\+]?\\d*\\.\\d+%?",e="(?:"+Z+")|(?:"+W+")",S="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",_="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+S),rgba:new RegExp("rgba"+_),hsl:new RegExp("hsl"+S),hsla:new RegExp("hsla"+_),hsv:new RegExp("hsv"+S),hsva:new RegExp("hsva"+_),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ee(W){return!!ke.CSS_UNIT.exec(W)}function qr(W){W=W.replace(Sr,"").replace(Cr,"").toLowerCase();var Z=!1;if(er[W])W=er[W],Z=!0;else if(W=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=ke.rgb.exec(W))?{r:e[1],g:e[2],b:e[3]}:(e=ke.rgba.exec(W))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=ke.hsl.exec(W))?{h:e[1],s:e[2],l:e[3]}:(e=ke.hsla.exec(W))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=ke.hsv.exec(W))?{h:e[1],s:e[2],v:e[3]}:(e=ke.hsva.exec(W))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=ke.hex8.exec(W))?{r:we(e[1]),g:we(e[2]),b:we(e[3]),a:dr(e[4]),format:Z?"name":"hex8"}:(e=ke.hex6.exec(W))?{r:we(e[1]),g:we(e[2]),b:we(e[3]),format:Z?"name":"hex"}:(e=ke.hex4.exec(W))?{r:we(e[1]+""+e[1]),g:we(e[2]+""+e[2]),b:we(e[3]+""+e[3]),a:dr(e[4]+""+e[4]),format:Z?"name":"hex8"}:(e=ke.hex3.exec(W))?{r:we(e[1]+""+e[1]),g:we(e[2]+""+e[2]),b:we(e[3]+""+e[3]),format:Z?"name":"hex"}:!1}function Xr(W){var Z,e;return W=W||{level:"AA",size:"small"},Z=(W.level||"AA").toUpperCase(),e=(W.size||"small").toLowerCase(),Z!=="AA"&&Z!=="AAA"&&(Z="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:Z,size:e}}const Kr=["FF000000","FFFFFFFF","FFFF0000","FF00FF00","FF0000FF","FFFFFF00","FFFF00FF","FF00FFFF","FF000000","FFFFFFFF","FFFF0000","FF00FF00","FF0000FF","FFFFFF00","FFFF00FF","FF00FFFF","FF800000","FF008000","FF000080","FF808000","FF800080","FF008080","FFC0C0C0","FF808080","FF9999FF","FF993366","FFFFFFCC","FFCCFFFF","FF660066","FFFF8080","FF0066CC","FFCCCCFF","FF000080","FFFF00FF","FFFFFF00","FF00FFFF","FF800080","FF800000","FF008080","FF0000FF","FF00CCFF","FFCCFFFF","FFCCFFCC","FFFFFF99","FF99CCFF","FFFF99CC","FFCC99FF","FFFFCC99","FF3366FF","FF33CCCC","FF99CC00","FFFFCC00","FFFF9900","FFFF6600","FF666699","FF969696","FF003366","FF339966","FF003300","FF333300","FF993300","FF993366","FF333399","FF333333"],je=240,rr=255;function Zr(W,Z,e){const S=Math.max(W,Z,e),_=Math.min(W,Z,e),d=S+_,o=S-_,a=d/2;let n,t;if(_==S)return[0,a,0];a<=.5?t=o/d:t=o/(2-d);const r=(S-W)/o,l=(S-Z)/o,i=(S-e)/o;return W==S?n=i-l:Z===S?n=2+r-i:n=4+l-r,n=n/6%1,[n,a,t]}function Yr(W){W.length>6&&(W=W.substring(2));const Z=parseInt(W.slice(0,2),16)/rr,e=parseInt(W.slice(2,4),16)/rr,S=parseInt(W.slice(4,6),16)/rr,[_,d,o]=Zr(Z,e,S);return[Math.round(_*je),Math.round(d*je),Math.round(o*je)]}function Gr(W,Z,e){return Rt({h:W/je*360,s:e/je,l:Z/je}).toHex().toUpperCase()}function Jr(W,Z){return W<=0?Math.round(Z*(1+W)):Math.round(Z*(1-W)+(je-je*(1-W)))}function Qr(W,Z){if(!W)return W;const[e,S,_]=Yr(W);return`FF${Gr(e,Jr(Z,S),_)}`}function tn(W){const Z=W.values;return Array.isArray(Z)?(Z.shift(),Z):Object.keys(Z).map(e=>Z[e])}function pr(W){if(W){if(W instanceof Date)return W.toLocaleDateString();if(typeof W=="object"){if("text"in W)return W.text;if("richText"in W)return W.richText.map(Z=>Z.text).join("");if("formula"in W||"sharedFormula"in W)return pr(W.result);if("error"in W)return""}return String(W)}return""}function nr(W,Z){if(W){const{theme:e,argb:S,indexed:_,tint:d}=W;let o;if(typeof e<"u"?(o=Z[e],d&&(o=Qr(o,d))):S?o=S:_&&(o=_&&Kr[_]),o)return o.length>6?`#${en(o)}`:`#${o}`}}function en(W){return W.substring(2)+W.substring(0,2)}function mr({horizontal:W,vertical:Z}){return[W,Z].filter(e=>e).map(e=>{const S=e??"";return`ht${S.charAt(0).toUpperCase()}${S.slice(1)}`}).join(" ")}function rn(W,Z){for(const e of W)for(let S=0;Se!==0?br(Z):Z).join("")}const sn=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];let gr=[],yr,vr=[];const Ae={set themeColors(W){gr=sn.map(Z=>W[Z])},get themeColors(){return gr},get workbook(){return yr},set workbook(W){yr=W},get sheets(){return vr},set sheets(W){vr=W}},on=["left","right","top","bottom"],an=(W,Z)=>`${W}-${Z}`,ln=W=>{const{style:{border:Z,fill:e,font:S}}=W,_={},d=Ae.themeColors;if(S&&(S.bold&&(_.fontWeight="bold"),S.size&&(_.fontSize=`${S.size}px`),S.color&&(_.color=nr(S.color,d))),e&&("bgColor"in e&&e.bgColor&&(_.backgroundColor=nr(e.bgColor,d)),"fgColor"in e&&!_.backgroundColor&&(_.backgroundColor=nr(e.fgColor,d))),Z&&on.map(o=>({key:o,value:Z[o]})).filter(o=>o.value).forEach(o=>{const{key:a,value:n}=o,t=`border${br(a)}`;(n==null?void 0:n.style)==="thin"?_[`${t}Width`]="0.5px":_[`${t}Width`]="1px",_[`${t}Style`]="solid",_[`${t}Color`]="#000"}),"css"in W){const{css:o}=W;Object.keys(o).forEach(a=>{const n=nn(a);_[n]=o[a]})}return _};class ir{constructor(Z){Oe(this,"_ws");Oe(this,"_defaults");Oe(this,"_data");Oe(this,"_cell");Oe(this,"_merge");Oe(this,"_rowHeights");Oe(this,"_colWidths");Oe(this,"_columns");this._ws=Z}static create(Z){return new ir(Z)}get ws(){return this._ws}get defaults(){return this._defaults??(this._defaults=this.getDefaults())}get data(){return this._data??(this._data=this.getData())}get cell(){return this._cell??(this._cell=this.getCell())}get merge(){return this._merge??(this._merge=this.getMerge())}get rowHeights(){return this._rowHeights??(this._rowHeights=this.getRowHeights())}get colWidths(){return this._colWidths??(this._colWidths=this.getColWidths())}get columns(){return this._columns??(this._columns=this.getColumns())}getDefaults(){const Z=this.ws.properties;return{rowHeight:(Z==null?void 0:Z.defaultRowHeight)||20,colWidth:((Z==null?void 0:Z.defaultColWidth)||10)*7}}getData(){var S;const Z=this.ws,e=((S=Z.getRows(1,Z.actualRowCount))==null?void 0:S.map(_=>{var d;return(d=tn(_))==null?void 0:d.map(pr)}))||[[]];return rn(e,this.columns.length||0)}getCell(){var e;const Z=this.ws;return(e=Z.getRows(1,Z.actualRowCount))==null?void 0:e.reduce((S,_,d)=>{var a;return(a=(_.model||{cells:[]}).cells)==null||a.filter(n=>n&&n.style).forEach((n,t)=>{const{alignment:r}=n.style;S[an(d,t)]={...r?{className:mr(r)}:{},style:ln(n)}}),S},{})}getMerge(){const Z=this.ws,{_merges:e}=Z;return Object.values(e).map(S=>{const{top:_,left:d,bottom:o,right:a}=S;return{row:_-1,col:d-1,rowspan:o-_+1,colspan:a-d+1}})}getRowHeights(){const{rowHeight:Z}=this.defaults,e=this.ws,S=e.getRows(1,e.actualRowCount),_=(S==null?void 0:S.map(d=>d.height||Z))||[];return _.length===1?_[0]:_.length?_:Z}getColWidths(){const{colWidth:Z}=this.defaults,e=this.ws.columns.map(S=>S.width?S.width*7:Z);return e.length===1?e[0]:e.length?e:Z}getColumns(){return this.ws.columns.map(Z=>({key:Z.number??0,title:Z.letter??"",editor:!1,className:mr(Z.alignment||{}),renderer:"styleRender"}))}toObject(){const{defaults:Z,data:e,cell:S,merge:_,rowHeights:d,colWidths:o,columns:a}=this;return{defaults:Z,data:e,cell:S,merge:_,rowHeights:d,colWidths:o,columns:a}}}var Gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}function qe(W){throw new Error('Could not dynamically require "'+W+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var wr={exports:{}};/*! ExcelJS 19-10-2023 */(function(W,Z){(function(e){W.exports=e()})(function(){return function e(S,_,d){function o(t,r){if(!_[t]){if(!S[t]){var l=typeof qe=="function"&&qe;if(!r&&l)return l(t,!0);if(a)return a(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var s=_[t]={exports:{}};S[t][0].call(s.exports,function(h){return o(S[t][1][h]||h)},s,s.exports,e,S,_,d)}return _[t].exports}for(var a=typeof qe=="function"&&qe,n=0;n{const p=this.workbook.addWorksheet(h.sheetName),f=h.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],w=h.map||function(A){if(A==="")return null;const N=Number(A);if(!Number.isNaN(N)&&N!==1/0)return N;const L=f.reduce((F,P)=>{if(F)return F;const U=t(A,P,!0);return U.isValid()?U:null},null);if(L)return new Date(L.valueOf());const j=i[A];return j!==void 0?j:A},x=o.parse(h.parserOptions).on("data",A=>{p.addRow(A.map(w))}).on("end",()=>{x.emit("worksheet",p)});x.on("worksheet",c).on("error",u),s.pipe(x)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(s,h){return new Promise((c,u)=>{h=h||{};const p=this.workbook.getWorksheet(h.sheetName||h.sheetId),f=o.format(h.formatterOptions);s.on("finish",()=>{c()}),f.on("error",u),f.pipe(s);const{dateFormat:w,dateUTC:x}=h,A=h.map||(j=>{if(j){if(j.text||j.hyperlink)return j.hyperlink||j.text||"";if(j.formula||j.result)return j.result||"";if(j instanceof Date)return w?x?t.utc(j).format(w):t(j).format(w):x?t.utc(j).format():t(j).format();if(j.error)return j.error;if(typeof j=="object")return JSON.stringify(j)}return j}),N=h.includeEmptyRows===void 0||h.includeEmptyRows;let L=1;p&&p.eachRow((j,F)=>{if(N)for(;L++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=n,t)if(typeof t=="string"){const l=d.decodeAddress(t);this.nativeCol=l.col+r,this.nativeColOff=0,this.nativeRow=l.row+r,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+r,this.row=t.row+r):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(n){return n instanceof o||n==null?n:new o(n)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(n){this.nativeCol=Math.floor(n),this.nativeColOff=Math.floor((n-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(n){this.nativeRow=Math.floor(n),this.nativeRowOff=Math.floor((n-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(n){this.nativeCol=n.nativeCol,this.nativeColOff=n.nativeColOff,this.nativeRow=n.nativeRow,this.nativeRowOff=n.nativeRowOff}}S.exports=o},{"../utils/col-cache":19}],3:[function(e,S,_){const d=e("../utils/col-cache"),o=e("../utils/under-dash"),a=e("./enums"),{slideFormula:n}=e("../utils/shared-formula"),t=e("./note");class r{constructor(s,h,c){if(!s||!h)throw new Error("A Cell needs a Row");this._row=s,this._column=h,d.validateAddress(c),this._address=c,this._value=l.create(r.Types.Null,this),this.style=this._mergeStyle(s.style,h.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(s){this.style.numFmt=s}get font(){return this.style.font}set font(s){this.style.font=s}get alignment(){return this.style.alignment}set alignment(s){this.style.alignment=s}get border(){return this.style.border}set border(s){this.style.border=s}get fill(){return this.style.fill}set fill(s){this.style.fill=s}get protection(){return this.style.protection}set protection(s){this.style.protection=s}_mergeStyle(s,h,c){const u=s&&s.numFmt||h&&h.numFmt;u&&(c.numFmt=u);const p=s&&s.font||h&&h.font;p&&(c.font=p);const f=s&&s.alignment||h&&h.alignment;f&&(c.alignment=f);const w=s&&s.border||h&&h.border;w&&(c.border=w);const x=s&&s.fill||h&&h.fill;x&&(c.fill=x);const A=s&&s.protection||h&&h.protection;return A&&(c.protection=A),c}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===r.Types.Merge}merge(s,h){this._value.release(),this._value=l.create(r.Types.Merge,this,s),h||(this.style=s.style)}unmerge(){this.type===r.Types.Merge&&(this._value.release(),this._value=l.create(r.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(s){return this._value.type===r.Types.Merge&&this._value.isMergedTo(s)}get master(){return this.type===r.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===r.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(s){this.type!==r.Types.Merge?(this._value.release(),this._value=l.create(l.getType(s),this,s)):this._value.master.value=s}get note(){return this._comment&&this._comment.note}set note(s){this._comment=new t(s)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(s){this.type===r.Types.String&&(this._value=l.create(r.Types.Hyperlink,this,{text:this._value.value,hyperlink:s}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:s}=this._row;return{sheetName:s.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(s){this.names=[s]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(s){const{definedNames:h}=this.workbook;h.removeAllNames(this.fullAddress),s.forEach(c=>{h.addEx(this.fullAddress,c)})}addName(s){this.workbook.definedNames.addEx(this.fullAddress,s)}removeName(s){this.workbook.definedNames.removeEx(this.fullAddress,s)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(s){this._dataValidations.add(this.address,s)}get model(){const{model:s}=this._value;return s.style=this.style,this._comment&&(s.comment=this._comment.model),s}set model(s){if(this._value.release(),this._value=l.create(s.type,this),this._value.model=s,s.comment)switch(s.comment.type){case"note":this._comment=t.fromModel(s.comment)}s.style?this.style=s.style:this.style={}}}r.Types=a.ValueType;const l={getType:i=>i==null?r.Types.Null:i instanceof String||typeof i=="string"?r.Types.String:typeof i=="number"?r.Types.Number:typeof i=="boolean"?r.Types.Boolean:i instanceof Date?r.Types.Date:i.text&&i.hyperlink?r.Types.Hyperlink:i.formula||i.sharedFormula?r.Types.Formula:i.richText?r.Types.RichText:i.sharedString?r.Types.SharedString:i.error?r.Types.Error:r.Types.JSON,types:[{t:r.Types.Null,f:class{constructor(i){this.model={address:i.address,type:r.Types.Null}}get value(){return null}set value(i){}get type(){return r.Types.Null}get effectiveType(){return r.Types.Null}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){}toString(){return""}}},{t:r.Types.Number,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Number,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.Number}get effectiveType(){return r.Types.Number}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:r.Types.String,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.String,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.String}get effectiveType(){return r.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:r.Types.Date,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Date,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.Date}get effectiveType(){return r.Types.Date}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:r.Types.Hyperlink,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Hyperlink,text:s?s.text:void 0,hyperlink:s?s.hyperlink:void 0},s&&s.tooltip&&(this.model.tooltip=s.tooltip)}get value(){const i={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(i.tooltip=this.model.tooltip),i}set value(i){this.model={text:i.text,hyperlink:i.hyperlink},i.tooltip&&(this.model.tooltip=i.tooltip)}get text(){return this.model.text}set text(i){this.model.text=i}get hyperlink(){return this.model.hyperlink}set hyperlink(i){this.model.hyperlink=i}get type(){return r.Types.Hyperlink}get effectiveType(){return r.Types.Hyperlink}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:r.Types.Formula,f:class{constructor(i,s){this.cell=i,this.model={address:i.address,type:r.Types.Formula,shareType:s?s.shareType:void 0,ref:s?s.ref:void 0,formula:s?s.formula:void 0,sharedFormula:s?s.sharedFormula:void 0,result:s?s.result:void 0}}_copyModel(i){const s={},h=c=>{const u=i[c];u&&(s[c]=u)};return h("formula"),h("result"),h("ref"),h("shareType"),h("sharedFormula"),s}get value(){return this._copyModel(this.model)}set value(i){this.model=this._copyModel(i)}validate(i){switch(l.getType(i)){case r.Types.Null:case r.Types.String:case r.Types.Number:case r.Types.Date:break;case r.Types.Hyperlink:case r.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(i){this.model.formula=i}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(i){this.model.result=i}get type(){return r.Types.Formula}get effectiveType(){const i=this.model.result;return i==null?a.ValueType.Null:i instanceof String||typeof i=="string"?a.ValueType.String:typeof i=="number"?a.ValueType.Number:i instanceof Date?a.ValueType.Date:i.text&&i.hyperlink?a.ValueType.Hyperlink:i.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(i){this.model.address=i}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:i}=this.cell,s=i.findCell(this.model.sharedFormula);this._translatedFormula=s&&n(s.formula,s.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:r.Types.Merge,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Merge,master:s?s.address:void 0},this._master=s,s&&s.addMergeRef()}get value(){return this._master.value}set value(i){i instanceof r?(this._master&&this._master.releaseMergeRef(),i.addMergeRef(),this._master=i):this._master.value=i}isMergedTo(i){return i===this._master}get master(){return this._master}get type(){return r.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:r.Types.JSON,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.String,value:JSON.stringify(s),rawValue:s}}get value(){return this.model.rawValue}set value(i){this.model.rawValue=i,this.model.value=JSON.stringify(i)}get type(){return r.Types.String}get effectiveType(){return r.Types.String}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:r.Types.SharedString,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.SharedString,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.SharedString}get effectiveType(){return r.Types.SharedString}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:r.Types.RichText,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.String,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}toString(){return this.model.value.richText.map(i=>i.text).join("")}get type(){return r.Types.RichText}get effectiveType(){return r.Types.RichText}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:r.Types.Boolean,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Boolean,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.Boolean}get effectiveType(){return r.Types.Boolean}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:r.Types.Error,f:class{constructor(i,s){this.model={address:i.address,type:r.Types.Error,value:s}}get value(){return this.model.value}set value(i){this.model.value=i}get type(){return r.Types.Error}get effectiveType(){return r.Types.Error}get address(){return this.model.address}set address(i){this.model.address=i}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((i,s)=>(i[s.t]=s.f,i),[]),create(i,s,h){const c=this.types[i];if(!c)throw new Error("Could not create Value of type "+i);return new c(s,h)}};S.exports=r},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,S,_){const d=e("../utils/under-dash"),o=e("./enums"),a=e("../utils/col-cache");class n{constructor(r,l,i){this._worksheet=r,this._number=l,i!==!1&&(this.defn=i)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(r){r?(this.key=r.key,this.width=r.width!==void 0?r.width:9,this.outlineLevel=r.outlineLevel,r.style?this.style=r.style:this.style={},this.header=r.header,this._hidden=!!r.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(r){r!==void 0?(this._header=r,this.headers.forEach((l,i)=>{this._worksheet.getCell(i+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(r){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=r,r&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(r){this._hidden=r}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(r){this._outlineLevel=r}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(r){return this.width===r.width&&this.hidden===r.hidden&&this.outlineLevel===r.outlineLevel&&d.isEqual(this.style,r.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const r=this.style;return!r||!(r.font||r.numFmt||r.alignment||r.border||r.fill||r.protection)}get headerCount(){return this.headers.length}eachCell(r,l){const i=this.number;l||(l=r,r=null),this._worksheet.eachRow(r,(s,h)=>{l(s.getCell(i),h)})}get values(){const r=[];return this.eachCell((l,i)=>{l&&l.type!==o.ValueType.Null&&(r[i]=l.value)}),r}set values(r){if(!r)return;const l=this.number;let i=0;r.hasOwnProperty("0")&&(i=1),r.forEach((s,h)=>{this._worksheet.getCell(h+i,l).value=s})}_applyStyle(r,l){return this.style[r]=l,this.eachCell(i=>{i[r]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(r){this._applyStyle("numFmt",r)}get font(){return this.style.font}set font(r){this._applyStyle("font",r)}get alignment(){return this.style.alignment}set alignment(r){this._applyStyle("alignment",r)}get protection(){return this.style.protection}set protection(r){this._applyStyle("protection",r)}get border(){return this.style.border}set border(r){this._applyStyle("border",r)}get fill(){return this.style.fill}set fill(r){this._applyStyle("fill",r)}static toModel(r){const l=[];let i=null;return r&&r.forEach((s,h)=>{s.isDefault?i&&(i=null):i&&s.equivalentTo(i)?i.max=h+1:(i={min:h+1,max:h+1,width:s.width!==void 0?s.width:9,style:s.style,isCustomWidth:s.isCustomWidth,hidden:s.hidden,outlineLevel:s.outlineLevel,collapsed:s.collapsed},l.push(i))}),l.length?l:void 0}static fromModel(r,l){const i=[];let s=1,h=0;for(l=(l=l||[]).sort(function(c,u){return c.min-u.min});h{l.removeCellEx(r)})}forEach(r){d.each(this.matrixMap,(l,i)=>{l.forEach(s=>{r(i,s)})})}getNames(r){return this.getNamesEx(o.decodeEx(r))}getNamesEx(r){return d.map(this.matrixMap,(l,i)=>l.findCellEx(r)&&i).filter(Boolean)}_explore(r,l){l.mark=!1;const{sheetName:i}=l,s=new n(l.row,l.col,l.row,l.col,i);let h,c;function u(f,w){const x=r.findCellAt(i,f,l.col);return!(!x||!x.mark)&&(s[w]=f,x.mark=!1,!0)}for(c=l.row-1;u(c,"top");c--);for(c=l.row+1;u(c,"bottom");c++);function p(f,w){const x=[];for(c=s.top;c<=s.bottom;c++){const A=r.findCellAt(i,c,f);if(!A||!A.mark)return!1;x.push(A)}s[w]=f;for(let A=0;A{i.mark=!0}),{name:r,ranges:l.map(i=>i.mark&&this._explore(l,i)).filter(Boolean).map(i=>i.$shortRange)}):{name:r,ranges:[]}}normaliseMatrix(r,l){r.forEachInSheet(l,(i,s,h)=>{i&&(i.row===s&&i.col===h||(i.row=s,i.col=h,i.address=o.n2l(h)+s))})}spliceRows(r,l,i,s){d.each(this.matrixMap,h=>{h.spliceRows(r,l,i,s),this.normaliseMatrix(h,r)})}spliceColumns(r,l,i,s){d.each(this.matrixMap,h=>{h.spliceColumns(r,l,i,s),this.normaliseMatrix(h,r)})}get model(){return d.map(this.matrixMap,(r,l)=>this.getRanges(l,r)).filter(r=>r.ranges.length)}set model(r){const l=this.matrixMap={};r.forEach(i=>{const s=l[i.name]=new a;i.ranges.forEach(h=>{t.test(h.split("!").pop()||"")&&s.addCell(h)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,S,_){S.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(e,S,_){const d=e("../utils/col-cache"),o=e("./anchor");S.exports=class{constructor(a,n){this.worksheet=a,this.model=n}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(a){let{type:n,imageId:t,range:r,hyperlinks:l}=a;if(this.type=n,this.imageId=t,n==="image")if(typeof r=="string"){const i=d.decode(r);this.range={tl:new o(this.worksheet,{col:i.left,row:i.top},-1),br:new o(this.worksheet,{col:i.right,row:i.bottom},0),editAs:"oneCell"}}else this.range={tl:new o(this.worksheet,r.tl,0),br:r.br&&new o(this.worksheet,r.br,0),ext:r.ext,editAs:r.editAs,hyperlinks:l||r.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,S,_){const d=e("../utils/under-dash");class o{constructor(n){this.note=n}get model(){let n=null;switch(typeof this.note){case"string":n={type:"note",note:{texts:[{text:this.note}]}};break;default:n={type:"note",note:this.note}}return d.deepMerge({},o.DEFAULT_CONFIGS,n)}set model(n){const{note:t}=n,{texts:r}=t;r.length===1&&Object.keys(r[0]).length===1?this.note=r[0].text:this.note=t}static fromModel(n){const t=new o;return t.model=n,t}}o.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},S.exports=o},{"../utils/under-dash":26}],10:[function(e,S,_){const d=e("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(n,t,r,l,i){if(arguments.length<4){const s=d.decodeAddress(n),h=d.decodeAddress(t);this.model={top:Math.min(s.row,h.row),left:Math.min(s.col,h.col),bottom:Math.max(s.row,h.row),right:Math.max(s.col,h.col),sheetName:r},this.setTLBR(s.row,s.col,h.row,h.col,i)}else this.model={top:Math.min(n,r),left:Math.min(t,l),bottom:Math.max(n,r),right:Math.max(t,l),sheetName:i}}decode(n){switch(n.length){case 5:this.setTLBR(n[0],n[1],n[2],n[3],n[4]);break;case 4:this.setTLBR(n[0],n[1],n[2],n[3]);break;case 3:this.setTLBR(n[0],n[1],n[2]);break;case 2:this.setTLBR(n[0],n[1]);break;case 1:{const t=n[0];if(t instanceof o)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{const r=d.decodeEx(t);r.top?this.model={top:r.top,left:r.left,bottom:r.bottom,right:r.right,sheetName:r.sheetName}:this.model={top:r.row,left:r.col,bottom:r.row,right:r.col,sheetName:r.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+n.length)}}get top(){return this.model.top||1}set top(n){this.model.top=n}get left(){return this.model.left||1}set left(n){this.model.left=n}get bottom(){return this.model.bottom||1}set bottom(n){this.model.bottom=n}get right(){return this.model.right||1}set right(n){this.model.right=n}get sheetName(){return this.model.sheetName}set sheetName(n){this.model.sheetName=n}get _serialisedSheetName(){const{sheetName:n}=this.model;return n?/^[a-zA-Z0-9]*$/.test(n)?n+"!":`'${n}'!`:""}expand(n,t,r,l){(!this.model.top||nthis.bottom)&&(this.bottom=r),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(n){if(n){const{dimensions:t,number:r}=n;t&&this.expand(r,t.min,r,t.max)}}expandToAddress(n){const t=d.decodeEx(n);this.expand(t.row,t.col,t.row,t.col)}get tl(){return d.n2l(this.left)+this.top}get $t$l(){return`$${d.n2l(this.left)}$${this.top}`}get br(){return d.n2l(this.right)+this.bottom}get $b$r(){return`$${d.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(n){return(!n.sheetName||!this.sheetName||n.sheetName===this.sheetName)&&!(n.bottomthis.bottom)&&!(n.rightthis.right)}contains(n){const t=d.decodeEx(n);return this.containsEx(t)}containsEx(n){return(!n.sheetName||!this.sheetName||n.sheetName===this.sheetName)&&n.row>=this.top&&n.row<=this.bottom&&n.col>=this.left&&n.col<=this.right}forEachAddress(n){for(let t=this.left;t<=this.right;t++)for(let r=this.top;r<=this.bottom;r++)n(d.encodeAddress(r,t),r,t)}}S.exports=o},{"../utils/col-cache":19}],11:[function(e,S,_){const d=e("../utils/under-dash"),o=e("./enums"),a=e("../utils/col-cache"),n=e("./cell");S.exports=class{constructor(t,r){this._worksheet=t,this._number=r,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let r=this._cells[t.col-1];if(!r){const l=this._worksheet.getColumn(t.col);r=new n(this,l,t.address),this._cells[t.col-1]=r}return r}getCell(t){if(typeof t=="string"){const r=this._worksheet.getColumnKey(t);t=r?r.number:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,r){const l=t+r;for(var i=arguments.length,s=new Array(i>2?i-2:0),h=2;h0)for(p=u;p>=l;p--)f=this._cells[p-1],f?(w=this.getCell(p+c),w.value=f.value,w.style=f.style,w._comment=f._comment):this._cells[p+c-1]=void 0;for(p=0;p{l&&l.type!==o.ValueType.Null&&r(l,i+1)})}addPageBreak(t,r){const l=this._worksheet,i=Math.max(0,t-1)||0,s=Math.max(0,r-1)||16838,h={id:this._number,max:s,man:1};i&&(h.min=i),l.rowBreaks.push(h)}get values(){const t=[];return this._cells.forEach(r=>{r&&r.type!==o.ValueType.Null&&(t[r.col]=r.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let r=0;t.hasOwnProperty("0")&&(r=1),t.forEach((l,i)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,i+r),row:this._number,col:i+r}).value=l)})}else this._worksheet.eachColumnKey((r,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,r.number),row:this._number,col:r.number}).value=t[l])})}get hasValues(){return d.some(this._cells,t=>t&&t.type!==o.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,r=0;return this._cells.forEach(l=>{l&&l.type!==o.ValueType.Null&&((!t||t>l.col)&&(t=l.col),r0?{min:t,max:r}:null}_applyStyle(t,r){return this.style[t]=r,this._cells.forEach(l=>{l&&(l[t]=r)}),r}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let r=0,l=0;return this._cells.forEach(i=>{if(i){const s=i.model;s&&((!r||r>i.col)&&(r=i.col),l{switch(l.type){case n.Types.Merge:break;default:{let i;if(l.address)i=a.decodeAddress(l.address);else if(r){const{row:s}=r,h=r.col+1;i={row:s,col:h,address:a.encodeAddress(s,h),$col$row:`$${a.n2l(h)}$${s}`}}r=i,this.getCellEx(i).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,S,_){const d=e("../utils/col-cache");class o{constructor(n,t,r){this.table=n,this.column=t,this.index=r}_set(n,t){this.table.cacheState(),this.column[n]=t}get name(){return this.column.name}set name(n){this._set("name",n)}get filterButton(){return this.column.filterButton}set filterButton(n){this.column.filterButton=n}get style(){return this.column.style}set style(n){this.column.style=n}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(n){this._set("totalsRowLabel",n)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(n){this._set("totalsRowFunction",n)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(n){this._set("totalsRowResult",n)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(n){this._set("totalsRowFormula",n)}}S.exports=class{constructor(a,n){this.worksheet=a,n&&(this.table=n,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:a}=this,n=(c,u,p)=>{c[u]===void 0&&(c[u]=p)};n(a,"headerRow",!0),n(a,"totalsRow",!1),n(a,"style",{}),n(a.style,"theme","TableStyleMedium2"),n(a.style,"showFirstColumn",!1),n(a.style,"showLastColumn",!1),n(a.style,"showRowStripes",!1),n(a.style,"showColumnStripes",!1);const t=(c,u)=>{if(!c)throw new Error(u)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=d.decodeAddress(a.ref);const{row:r,col:l}=a.tl;t(r>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");const{width:i,filterHeight:s,tableHeight:h}=this;a.autoFilterRef=d.encode(r,l,r+s-1,l+i-1),a.tableRef=d.encode(r,l,r+h-1,l+i-1),a.columns.forEach((c,u)=>{t(c.name,`Column ${u} must have a name`),u===0?n(c,"totalsRowLabel","Total"):(n(c,"totalsRowFunction","none"),c.totalsRowFormula=this.getFormula(c))})}store(){const a=(s,h)=>{h&&Object.keys(h).forEach(c=>{s[c]=h[c]})},{worksheet:n,table:t}=this,{row:r,col:l}=t.tl;let i=0;if(t.headerRow){const s=n.getRow(r+i++);t.columns.forEach((h,c)=>{const{style:u,name:p}=h,f=s.getCell(l+c);f.value=p,a(f,u)})}if(t.rows.forEach(s=>{const h=n.getRow(r+i++);s.forEach((c,u)=>{const p=h.getCell(l+u);p.value=c,a(p,t.columns[u].style)})}),t.totalsRow){const s=n.getRow(r+i++);t.columns.forEach((h,c)=>{const u=s.getCell(l+c);if(c===0)u.value=h.totalsRowLabel;else{const p=this.getFormula(h);u.value=p?{formula:h.totalsRowFormula,result:h.totalsRowResult}:null}a(u,h.style)})}}load(a){const{table:n}=this,{row:t,col:r}=n.tl;let l=0;if(n.headerRow){const i=a.getRow(t+l++);n.columns.forEach((s,h)=>{i.getCell(r+h).value=s.name})}if(n.rows.forEach(i=>{const s=a.getRow(t+l++);i.forEach((h,c)=>{s.getCell(r+c).value=h})}),n.totalsRow){const i=a.getRow(t+l++);n.columns.forEach((s,h)=>{const c=i.getCell(r+h);h===0?c.value=s.totalsRowLabel:this.getFormula(s)&&(c.value={formula:s.totalsRowFormula,result:s.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const a=d.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(a,n)}getColumn(a){const n=this.table.columns[a];return new o(this,n,a)}addColumn(a,n,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((r,l)=>{r.push(n[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((r,l)=>{r.splice(t,0,n[l])}))}removeColumns(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,n),this.table.rows.forEach(t=>{t.splice(a,n)})}_assign(a,n,t){this.cacheState(),a[n]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(e,S,_){const d=e("./worksheet"),o=e("./defined-names"),a=e("../xlsx/xlsx"),n=e("../csv/csv");S.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new o}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new n(this)),this._csv}get nextId(){for(let t=1;t(u&&u.orderNo)>c?u.orderNo:c,0),s=Object.assign({},r,{id:l,name:t,orderNo:i+1,workbook:this}),h=new d(s);return this._worksheets[l]=h,h}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const r=this.getWorksheet(t);r&&r.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(r=>r&&r.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,r)=>t.orderNo-r.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(r=>{t(r,r.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const r=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),r}getImage(t){return this.media[t]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(t=>t.model),sheets:this.worksheets.map(t=>t.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(r=>{const{id:l,name:i,state:s}=r,h=t.sheets&&t.sheets.findIndex(c=>c.id===l);(this._worksheets[l]=new d({id:l,name:i,orderNo:h,state:s,workbook:this})).model=r}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,S,_){const d=e("../utils/under-dash"),o=e("../utils/col-cache"),a=e("./range"),n=e("./row"),t=e("./column"),r=e("./enums"),l=e("./image"),i=e("./table"),s=e("./data-validations"),h=e("../utils/encryptor"),{copyStyle:c}=e("../utils/copy-style");S.exports=class{constructor(u){u=u||{},this._workbook=u.workbook,this.id=u.id,this.orderNo=u.orderNo,this.name=u.name,this.state=u.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},u.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!u.pageSetup||!u.pageSetup.fitToWidth&&!u.pageSetup.fitToHeight||u.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},u.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},u.headerFooter),this.dataValidations=new s,this.views=u.views||[],this.autoFilter=u.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(u){if(u===void 0&&(u="sheet"+this.id),this._name!==u){if(typeof u!="string")throw new Error("The name has to be a string.");if(u==="")throw new Error("The name can't be empty.");if(u==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(u))throw new Error(`Worksheet name ${u} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(u))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+u);if(u&&u.length>31&&(console.warn(`Worksheet name ${u} exceeds 31 chars. This will be truncated`),u=u.substring(0,31)),this._workbook._worksheets.find(p=>p&&p.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const u=new a;return this._rows.forEach(p=>{if(p){const f=p.dimensions;f&&u.expand(p.number,f.min,p.number,f.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((w,x)=>{const A=(x.header?1:x.headers&&x.headers.length)||0;return Math.max(w,A)},0);let p=1;const f=this._columns=[];u.forEach(w=>{const x=new t(this,p++,!1);f.push(x),x.defn=w})}getColumnKey(u){return this._keys[u]}setColumnKey(u,p){this._keys[u]=p}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){d.each(this._keys,u)}getColumn(u){if(typeof u=="string"){const p=this._keys[u];if(p)return p;u=o.l2n(u)}if(this._columns||(this._columns=[]),u>this._columns.length){let p=this._columns.length+1;for(;p<=u;)this._columns.push(new t(this,p++))}return this._columns[u-1]}spliceColumns(u,p){const f=this._rows.length;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A0)for(let F=0;F{P.push(B[F]||null)});const U=this.getRow(F+1);U.splice.apply(U,P)}else this._rows.forEach(F=>{F&&F.splice(u,p)});const N=x.length-p,L=u+p,j=this._columns.length;if(N<0)for(let F=u+x.length;F<=j;F++)this.getColumn(F).defn=this.getColumn(F-N).defn;else if(N>0)for(let F=j;F>=L;F--)this.getColumn(F+N).defn=this.getColumn(F).defn;for(let F=u;F{u=Math.max(u,p.cellCount)}),u}get actualColumnCount(){const u=[];let p=0;return this.eachRow(f=>{f.eachCell(w=>{let{col:x}=w;u[x]||(u[x]=!0,p++)})}),p}_commitRow(){}get _lastRowNumber(){const u=this._rows;let p=u.length;for(;p>0&&u[p-1]===void 0;)p--;return p}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(u){return this._rows[u-1]}findRows(u,p){return this._rows.slice(u-1,u-1+p)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let u=0;return this.eachRow(()=>{u++}),u}getRow(u){let p=this._rows[u-1];return p||(p=this._rows[u-1]=new n(this,u)),p}getRows(u,p){if(p<1)return;const f=[];for(let w=u;w1&&arguments[1]!==void 0?arguments[1]:"n";const f=this._nextRow,w=this.getRow(f);return w.values=u,this._setStyleOption(f,p[0]==="i"?p:"n"),w}addRows(u){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const f=[];return u.forEach(w=>{f.push(this.addRow(w,p))}),f}insertRow(u,p){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,p),this._setStyleOption(u,f),this.getRow(u)}insertRows(u,p){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...p),f!=="n")for(let w=0;w1&&arguments[1]!==void 0?arguments[1]:"n";p[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,p[1]==="+"):p[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,p[1]==="+")}_copyStyle(u,p){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this.getRow(u),x=this.getRow(p);x.style=c(w.style),w.eachCell({includeEmpty:f},(A,N)=>{x.getCell(N).style=c(A.style)}),x.height=w.height}duplicateRow(u,p){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const w=this._rows[u-1],x=new Array(p).fill(w.values);this.spliceRows(u+1,f?0:p,...x);for(let A=0;A{N.getCell(j).style=L.style})}}spliceRows(u,p){const f=u+p;for(var w=arguments.length,x=new Array(w>2?w-2:0),A=2;A{U.getCell(k).style=B.style}),this._rows[F-1]=void 0}else this._rows[F+L-1]=void 0;else if(L>0)for(F=j;F>=f;F--)if(P=this._rows[F-1],P){const U=this.getRow(F+L);U.values=P.values,U.style=P.style,U.height=P.height,P.eachCell({includeEmpty:!0},(B,k)=>{if(U.getCell(k).style=B.style,B._value.constructor.name==="MergeValue"){const T=this.getRow(B._row._number+N).getCell(k),v=B._value._master,m=this.getRow(v._row._number+N).getCell(v._column._number);T.merge(m)}})}else this._rows[F+L-1]=void 0;for(F=0;F{f&&f.hasValues&&p(f,f.number)})}getSheetValues(){const u=[];return this._rows.forEach(p=>{p&&(u[p.number]=p.values)}),u}findCell(u,p){const f=o.getAddress(u,p),w=this._rows[f.row-1];return w?w.findCell(f.col):void 0}getCell(u,p){const f=o.getAddress(u,p);return this.getRow(f.row).getCellEx(f)}mergeCells(){for(var u=arguments.length,p=new Array(u),f=0;f{if(w.intersects(u))throw new Error("Cannot merge already merged cells")});const f=this.getCell(u.top,u.left);for(let w=u.top;w<=u.bottom;w++)for(let x=u.left;x<=u.right;x++)(w>u.top||x>u.left)&&this.getCell(w,x).merge(f,p);this._merges[f.address]=u}_unMergeMaster(u){const p=this._merges[u.address];if(p){for(let f=p.top;f<=p.bottom;f++)for(let w=p.left;w<=p.right;w++)this.getCell(f,w).unmerge();delete this._merges[u.address]}}get hasMerges(){return d.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,p=new Array(u),f=0;f3&&arguments[3]!==void 0?arguments[3]:"shared";const x=o.decode(u),{top:A,left:N,bottom:L,right:j}=x,F=j-N+1,P=o.encodeAddress(A,N),U=w==="shared";let B;B=typeof f=="function"?f:Array.isArray(f)?Array.isArray(f[0])?(T,v)=>f[T-A][v-N]:(T,v)=>f[(T-A)*F+(v-N)]:()=>{};let k=!0;for(let T=A;T<=L;T++)for(let v=N;v<=j;v++)k?(this.getCell(T,v).value={shareType:w,formula:p,ref:u,result:B(T,v)},k=!1):this.getCell(T,v).value=U?{sharedFormula:P,result:B(T,v)}:B(T,v)}addImage(u,p){const f={type:"image",imageId:u,range:p};this._media.push(new l(this,f))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){const p={type:"background",imageId:u};this._media.push(new l(this,p))}getBackgroundImageId(){const u=this._media.find(p=>p.type==="background");return u&&u.imageId}protect(u,p){return new Promise(f=>{this.sheetProtection={sheet:!0},p&&"spinCount"in p&&(p.spinCount=Number.isFinite(p.spinCount)?Math.round(Math.max(0,p.spinCount)):1e5),u&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=h.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=p&&"spinCount"in p?p.spinCount:1e5,this.sheetProtection.hashValue=h.convertPasswordToHash(u,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),p&&(this.sheetProtection=Object.assign(this.sheetProtection,p),!u&&"spinCount"in p&&delete this.sheetProtection.spinCount),f()})}unprotect(){this.sheetProtection=null}addTable(u){const p=new i(this,u);return this.tables[u.name]=p,p}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(u){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=u}get model(){const u={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(w=>w.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(w=>w.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);const p=u.rows=[],f=u.dimensions=new a;return this._rows.forEach(w=>{const x=w&&w.model;x&&(f.expand(x.number,x.min,x.number,x.max),p.push(x))}),u.merges=[],d.each(this._merges,w=>{u.merges.push(w.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(p=>{const f=new n(this,p.number);this._rows[f.number-1]=f,f.model=p})}_parseMergeCells(u){d.each(u.mergeCells,p=>{this.mergeCellsWithoutStyle(p)})}set model(u){this.name=u.name,this._columns=t.fromModel(this,u.cols),this._parseRows(u),this._parseMergeCells(u),this.dataValidations=new s(u.dataValidations),this.properties=u.properties,this.pageSetup=u.pageSetup,this.headerFooter=u.headerFooter,this.views=u.views,this.autoFilter=u.autoFilter,this._media=u.media.map(p=>new l(this,p)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((p,f)=>{const w=new i;return w.model=f,p[f.name]=w,p},{}),this.conditionalFormattings=u.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,S,_){e("core-js/modules/es.promise"),e("core-js/modules/es.promise.finally"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.values"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.async-iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.find"),e("core-js/modules/es.string.from-code-point"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.number.is-nan"),e("regenerator-runtime/runtime");const d={Workbook:e("./doc/workbook")},o=e("./doc/enums");Object.keys(o).forEach(a=>{d[a]=o[a]}),S.exports=d},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,S,_){const d=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");_.bufferToString=function(o){return typeof o=="string"?o:d?d.decode(o):o.toString()}},{}],17:[function(e,S,_){const d=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=e("buffer");_.stringToBuffer=function(a){return typeof a!="string"?a:d?o.from(d.encode(a).buffer):o.from(a)}},{buffer:220}],18:[function(e,S,_){const d=e("./under-dash"),o=e("./col-cache");S.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(o.decodeEx(a))}getCell(a){return this.findCellEx(o.decodeEx(a),!0)}findCell(a){return this.findCellEx(o.decodeEx(a),!1)}findCellAt(a,n,t){const r=this.sheets[a],l=r&&r[n];return l&&l[t]}addCellEx(a){if(a.top)for(let n=a.top;n<=a.bottom;n++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,n,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,n){const t=this.findSheet(a,n),r=this.findSheetRow(t,a,n);return this.findRowCell(r,a,n)}getCellAt(a,n,t){const r=this.sheets[a]||(this.sheets[a]=[]),l=r[n]||(r[n]=[]);return l[t]||(l[t]={sheetName:a,address:o.n2l(t)+n,row:n,col:t})}removeCellEx(a){const n=this.findSheet(a);if(!n)return;const t=this.findSheetRow(n,a);t&&delete t[a.col]}forEachInSheet(a,n){const t=this.sheets[a];t&&t.forEach((r,l)=>{r&&r.forEach((i,s)=>{i&&n(i,l,s)})})}forEach(a){d.each(this.sheets,(n,t)=>{this.forEachInSheet(t,a)})}map(a){const n=[];return this.forEach(t=>{n.push(a(t))}),n}findSheet(a,n){const t=a.sheetName;return this.sheets[t]?this.sheets[t]:n?this.sheets[t]=[]:void 0}findSheetRow(a,n,t){const{row:r}=n;return a&&a[r]?a[r]:t?a[r]=[]:void 0}findRowCell(a,n,t){const{col:r}=n;return a&&a[r]?a[r]:t?a[r]=this.template?Object.assign(n,JSON.parse(JSON.stringify(this.template))):n:void 0}spliceRows(a,n,t,r){const l=this.sheets[a];if(l){const i=[];for(let s=0;s{s.splice(n,t,...i)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,S,_){const d=/^[A-Z]+\d+$/,o={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:a=>a<=26?1:a<=676?2:3,_fill(a){let n,t,r,l,i,s=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;s<=26;)n=this._dictionary[s-1],this._n2l[s]=n,this._l2n[n]=s,s++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(s=27;s<=702;)t=s-27,r=t%26,l=Math.floor(t/26),n=this._dictionary[l]+this._dictionary[r],this._n2l[s]=n,this._l2n[n]=s,s++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(s=703;s<=16384;)t=s-703,r=t%26,l=Math.floor(t/26)%26,i=Math.floor(t/676),n=this._dictionary[i]+this._dictionary[l]+this._dictionary[r],this._n2l[s]=n,this._l2n[n]=s,s++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!d.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){const n=a.length<5&&this._hash[a];if(n)return n;let t=!1,r="",l=0,i=!1,s="",h=0;for(let u,p=0;p=65&&u<=90)t=!0,r+=a[p],l=26*l+u-64;else if(u>=48&&u<=57)i=!0,s+=a[p],h=10*h+u-48;else if(i&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+r)}else l=void 0;i||(h=void 0);const c={address:a=r+s,col:l,row:h,$col$row:`$${r}$${s}`};return l<=100&&h<=100&&(this._hash[a]=c,this._hash[c.$col$row]=c),c},getAddress(a,n){if(n){const t=this.n2l(n)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){const n=a.split(":");if(n.length===2){const t=this.decodeAddress(n[0]),r=this.decodeAddress(n[1]),l={top:Math.min(t.row,r.row),left:Math.min(t.col,r.col),bottom:Math.max(t.row,r.row),right:Math.max(t.col,r.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){const n=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=n[1]||n[2],r=n[3],l=r.split(":");if(l.length>1){let s=this.decodeAddress(l[0]),h=this.decodeAddress(l[1]);const c=Math.min(s.row,h.row),u=Math.min(s.col,h.col),p=Math.max(s.row,h.row),f=Math.max(s.col,h.col);return s=this.n2l(u)+c,h=this.n2l(f)+p,{top:c,left:u,bottom:p,right:f,sheetName:t,tl:{address:s,col:u,row:c,$col$row:`$${this.n2l(u)}$${c}`,sheetName:t},br:{address:h,col:f,row:p,$col$row:`$${this.n2l(f)}$${p}`,sheetName:t},dimensions:`${s}:${h}`}}if(r.startsWith("#"))return t?{sheetName:t,error:r}:{error:r};const i=this.decodeAddress(r);return t?{sheetName:t,...i}:i},encodeAddress:(a,n)=>o.n2l(n)+a,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,n){const[t,r,,l,i]=a,[s,h]=n;return s>=t&&s<=l&&h>=r&&h<=i}};S.exports=o},{}],20:[function(e,S,_){const d=(a,n)=>({...a,...n.reduce((t,r)=>(a[r]&&(t[r]={...a[r]}),t),{})}),o=function(a,n,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(n[t]=d(a[t],r))};_.copyStyle=a=>{if(!a)return a;if(n=a,Object.keys(n).length===0)return{};var n;const t={...a};return o(a,t,"font",["color"]),o(a,t,"alignment"),o(a,t,"protection"),a.border&&(o(a,t,"border"),o(a.border,t.border,"top",["color"]),o(a.border,t.border,"left",["color"]),o(a.border,t.border,"bottom",["color"]),o(a.border,t.border,"right",["color"]),o(a.border,t.border,"diagonal",["color"])),a.fill&&(o(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(r=>d(r,["color"])))),t}},{}],21:[function(e,S,_){(function(d){(function(){const o=e("crypto"),a={hash(n){const t=o.createHash(n);for(var r=arguments.length,l=new Array(r>1?r-1:0),i=1;io.randomBytes(n)};S.exports=a}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(e,S,_){const{SaxesParser:d}=e("saxes"),{PassThrough:o}=e("readable-stream"),{bufferToString:a}=e("./browser-buffer-decode");S.exports=async function*(n){n.pipe&&!n[Symbol.asyncIterator]&&(n=n.pipe(new o));const t=new d;let r;t.on("error",i=>{r=i});let l=[];t.on("opentag",i=>l.push({eventType:"opentag",value:i})),t.on("text",i=>l.push({eventType:"text",value:i})),t.on("closetag",i=>l.push({eventType:"closetag",value:i}));for await(const i of n){if(t.write(a(i)),r)throw r;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,S,_){const d=e("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;S.exports={slideFormula:function(n,t,r){const l=d.decode(t),i=d.decode(r);return n.replace(o,(s,h,c,u,p)=>{if(p)return s;const f=a.exec(u);if(f){const w=f[1],x=f[2].toUpperCase(),A=f[3],N=f[4];if(x.length>3||x.length===3&&x>"XFD")return s;let L=d.l2n(x),j=parseInt(N,10);return w||(L+=i.col-l.col),A||(j+=i.row-l.row),(h||"")+(w||"")+d.n2l(L)+(A||"")+j}return s})}}},{"./col-cache":19}],24:[function(e,S,_){(function(d,o){(function(){const a=e("readable-stream"),n=e("./utils"),t=e("./string-buf");class r{constructor(u,p){this._data=u,this._encoding=p}get length(){return this.toBuffer().length}copy(u,p,f,w){return this.toBuffer().copy(u,p,f,w)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,p,f,w){return this._data._buf.copy(u,p,f,w)}toBuffer(){return this._data.toBuffer()}}class i{constructor(u){this._data=u}get length(){return this._data.length}copy(u,p,f,w){this._data.copy(u,p,f,w)}toBuffer(){return this._data}}class s{constructor(u){this.size=u,this.buffer=o.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const u=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(u,0,this.iRead,this.iWrite),u}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(u){let p;return u===0?null:u===void 0||u>=this.length?(p=this.toBuffer(),this.iRead=this.iWrite,p):(p=o.alloc(u),this.buffer.copy(p,0,this.iRead,u),this.iRead+=u,p)}write(u,p,f){const w=Math.min(f,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,p,p+w),this.iWrite+=w,w}}const h=function(c){c=c||{},this.bufSize=c.bufSize||1048576,this.buffers=[],this.batch=c.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};n.inherits(h,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(c=>c.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const u=this.buffers[this.buffers.length-1];if(!u.full)return u}const c=new s(this.bufSize);return this.buffers.push(c),c},async _pipe(c){await Promise.all(this.pipes.map(function(u){return new Promise(p=>{u.write(c.toBuffer(),()=>{p()})})}))},_writeToBuffers(c){let u=0;const p=c.length;for(;u1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(f),d.nextTick(p)):(await this._pipe(f),p());else this.paused||this.emit("data",f.toBuffer()),this._writeToBuffers(f),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(c,u,p){const f=w=>{w?p(w):(this._flush(),this.pipes.forEach(x=>{x.end()}),this.emit("finish"))};c?this.write(c,u,f):f()},read(c){let u;if(c){for(u=[];c&&this.buffers.length&&!this.buffers[0].eod;){const p=this.buffers[0],f=p.read(c);c-=f.length,u.push(f),p.eod&&p.full&&this.buffers.shift()}return o.concat(u)}return u=this.buffers.map(p=>p.toBuffer()).filter(Boolean),this.buffers=[],o.concat(u)},setEncoding(c){this.encoding=c},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(c){this.pipes.push(c),!this.paused&&this.buffers.length&&this.end()},unpipe(c){this.pipes=this.pipes.filter(u=>u!==c)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),S.exports=h}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,S,_){(function(d){(function(){S.exports=class{constructor(o){this._buf=d.alloc(o&&o.size||16384),this._encoding=o&&o.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=d.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let a=2*this._buf.length;for(;a=this._buf.length-4;)this._grow(this._inPos+o.length),a=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=a}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],26:[function(e,S,_){const{toString:d}=Object.prototype,o=/["&<>]/,a={each:function(n,t){n&&(Array.isArray(n)?n.forEach(t):Object.keys(n).forEach(r=>{t(n[r],r)}))},some:function(n,t){return!!n&&(Array.isArray(n)?n.some(t):Object.keys(n).some(r=>t(n[r],r)))},every:function(n,t){return!n||(Array.isArray(n)?n.every(t):Object.keys(n).every(r=>t(n[r],r)))},map:function(n,t){return n?Array.isArray(n)?n.map(t):Object.keys(n).map(r=>t(n[r],r)):[]},keyBy:(n,t)=>n.reduce((r,l)=>(r[l[t]]=l,r),{}),isEqual:function(n,t){const r=typeof n,l=typeof t,i=Array.isArray(n),s=Array.isArray(t);let h;if(r!==l)return!1;switch(typeof n){case"object":if(i||s)return!(!i||!s)&&n.length===t.length&&n.every((c,u)=>{const p=t[u];return a.isEqual(c,p)});if(n===null||t===null)return n===t;if(h=Object.keys(n),Object.keys(t).length!==h.length)return!1;for(const c of h)if(!t.hasOwnProperty(c))return!1;return a.every(n,(c,u)=>{const p=t[u];return a.isEqual(c,p)});default:return n===t}},escapeHtml(n){const t=o.exec(n);if(!t)return n;let r="",l="",i=0,s=t.index;for(;s":l=">";break;default:continue}i!==s&&(r+=n.substring(i,s)),i=s+1,r+=l}return i!==s?r+n.substring(i,s):r},strcmp:(n,t)=>nt?1:0,isUndefined:n=>d.call(n)==="[object Undefined]",isObject:n=>d.call(n)==="[object Object]",deepMerge(){const n=arguments[0]||{},{length:t}=arguments;let r,l,i;function s(h,c){r=n[c],i=Array.isArray(h),a.isObject(h)||i?(i?(i=!1,l=r&&Array.isArray(r)?r:[]):l=r&&a.isObject(r)?r:{},n[c]=a.deepMerge(l,h)):a.isUndefined(h)||(n[c]=h)}for(let h=0;h&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:r=>new Promise(l=>{d.setImmediate?o(()=>{l(r)}):setTimeout(()=>{l(r)},1)}),inherits:function(r,l,i,s){r.super_=l,s||(s=i,i=null),i&&Object.keys(i).forEach(c=>{Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(i,c))});const h={constructor:{value:r,enumerable:!1,writable:!1,configurable:!0}};s&&Object.keys(s).forEach(c=>{h[c]=Object.getOwnPropertyDescriptor(s,c)}),r.prototype=Object.create(l.prototype,h)},dateToExcel:(r,l)=>25569+r.getTime()/864e5-(l?1462:0),excelToDate(r,l){const i=Math.round(24*(r-25569+(l?1462:0))*3600*1e3);return new Date(i)},parsePath(r){const l=r.lastIndexOf("/");return{path:r.substring(0,l),name:r.substring(l+1)}},getRelsPath(r){const l=t.parsePath(r);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(r){const l=n.exec(r);if(!l)return r;let i="",s="",h=0,c=l.index;for(;c=11&&u!==13)){s="";break}continue}h!==c&&(i+=r.substring(h,c)),h=c+1,s&&(i+=s)}return h!==c?i+r.substring(h,c):i},xmlDecode:r=>r.replace(/&([a-z]*);/g,l=>{switch(l){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return l}}),validInt(r){const l=parseInt(r,10);return Number.isNaN(l)?0:l},isDateFmt(r){return r?(r=(r=r.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:r=>new Promise(l=>{a.access(r,a.constants.F_OK,i=>{l(!i)})})},toIsoDateString:r=>r.toIsoString().subsstr(0,10),parseBoolean:r=>r===!0||r==="true"||r===1||r==="1"};S.exports=t}).call(this)}).call(this,typeof Gt<"u"?Gt:typeof self<"u"?self:typeof window<"u"?window:{},e("timers").setImmediate)},{fs:216,timers:523}],28:[function(e,S,_){const d=e("./under-dash"),o=e("./utils");function a(r,l,i){r.push(` ${l}="${o.xmlEncode(i.toString())}"`)}function n(r,l){if(l){const i=[];d.each(l,(s,h)=>{s!==void 0&&a(i,h,s)}),r.push(i.join(""))}}class t{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(l){const i=this._xml;i.push(" `)}openNode(l,i){const s=this.tos,h=this._xml;s&&this.open&&h.push(">"),this._stack.push(l),h.push("<"),h.push(l),n(h,i),this.leaf=!0,this.open=!0}addAttribute(l,i){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");i!==void 0&&a(this._xml,l,i)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");n(this._xml,l)}writeText(l){const i=this._xml;this.open&&(i.push(">"),this.open=!1),this.leaf=!1,i.push(o.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){const l=this._stack.pop(),i=this._xml;this.leaf?i.push("/>"):(i.push("")),this.open=!1,this.leaf=!1}leafNode(l,i,s){this.openNode(l,i),s!==void 0&&this.writeText(s),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},S.exports=t},{"./under-dash":26,"./utils":27}],29:[function(e,S,_){(function(d){(function(){const o=e("events"),a=e("jszip"),n=e("./stream-buf"),{stringToBuffer:t}=e("./browser-buffer-encode");class r extends o.EventEmitter{constructor(i){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},i),this.zip=new a,this.stream=new n}append(i,s){s.hasOwnProperty("base64")&&s.base64?this.zip.file(s.name,i,{base64:!0}):(d.browser&&typeof i=="string"&&(i=t(i)),this.zip.file(s.name,i))}async finalize(){const i=await this.zip.generateAsync(this.options);this.stream.end(i),this.emit("finish")}read(i){return this.stream.read(i)}setEncoding(i){return this.stream.setEncoding(i)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(i,s){return this.stream.pipe(i,s)}unpipe(i){return this.stream.unpipe(i)}unshift(i){return this.stream.unshift(i)}wrap(i){return this.stream.wrap(i)}}S.exports={ZipWriter:r}}).call(this)}).call(this,e("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,S,_){S.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(e,S,_){S.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(e,S,_){const d=e("../../utils/parse-sax"),o=e("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,r){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const r of t)for(const{eventType:l,value:i}of r)if(l==="opentag")this.parseOpen(i);else if(l==="text")this.parseText(i);else if(l==="closetag"&&!this.parseClose(i.name))return this.model;return this.model}async parseStream(t){return this.parse(d(t))}get xml(){return this.toXml(this.model)}toXml(t){const r=new o;return this.render(r,t),r.xml}static toAttribute(t,r){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return r}else if(l||t!==r)return t.toString()}static toStringAttribute(t,r){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,r,l)}static toStringValue(t,r){return t===void 0?r:t}static toBoolAttribute(t,r){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return r}else if(l||t!==r)return t?"1":"0"}static toBoolValue(t,r){return t===void 0?r:t==="1"}static toIntAttribute(t,r){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,r,l)}static toIntValue(t,r){return t===void 0?r:parseInt(t,10)}static toFloatAttribute(t,r){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,r,l)}static toFloatValue(t,r){return t===void 0?r:parseFloat(t)}}S.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,S,_){const d=e("../base-xform"),o=e("../../../utils/col-cache");function a(t){try{return o.decodeEx(t),!0}catch{return!1}}function n(t){const r=[];let l=!1,i="";return t.split(",").forEach(s=>{if(!s)return;const h=(s.match(/'/g)||[]).length;if(!h)return void(l?i+=s+",":a(s)&&r.push(s));const c=h%2==0;!l&&c&&a(s)?r.push(s):l&&!c?(l=!1,a(i+s)&&r.push(i+s),i=""):(l=!0,i+=s+",")}),r}S.exports=class extends d{render(t,r){t.openNode("definedName",{name:r.name,localSheetId:r.localSheetId}),t.writeText(r.ranges.join(",")),t.closeNode()}parseOpen(t){switch(t.name){case"definedName":return this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:n(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,S,_){const d=e("../../../utils/utils"),o=e("../base-xform");S.exports=class extends o{render(a,n){a.leafNode("sheet",{sheetId:n.id,name:n.name,state:n.state,"r:id":n.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:d.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){o.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){const n={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(n.visibility=a.visibility),o.leafNode("workbookView",n)}parseOpen(o){if(o.name==="workbookView"){const a=this.model={},n=function(r,l,i){const s=l!==void 0?a[r]=l:i;s!==void 0&&(a[r]=s)},t=function(r,l,i){const s=l!==void 0?a[r]=parseInt(l,10):i;s!==void 0&&(a[r]=s)};return t("x",o.attributes.xWindow,0),t("y",o.attributes.yWindow,0),t("width",o.attributes.windowWidth,25e3),t("height",o.attributes.windowHeight,1e4),n("visibility",o.attributes.visibility,"visible"),t("activeTab",o.attributes.activeTab,void 0),t("firstSheet",o.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),n=e("../base-xform"),t=e("../static-xform"),r=e("../list-xform"),l=e("./defined-name-xform"),i=e("./sheet-xform"),s=e("./workbook-view-xform"),h=e("./workbook-properties-xform"),c=e("./workbook-calc-properties-xform");class u extends n{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new h,bookViews:new r({tag:"bookViews",count:!1,childXform:new s}),sheets:new r({tag:"sheets",count:!1,childXform:new i}),definedNames:new r({tag:"definedNames",count:!1,childXform:new l}),calcPr:new c}}prepare(f){f.sheets=f.worksheets;const w=[];let x=0;f.sheets.forEach(A=>{if(A.pageSetup&&A.pageSetup.printArea&&A.pageSetup.printArea.split("&&").forEach(N=>{const L=N.split(":"),j={name:"_xlnm.Print_Area",ranges:[`'${A.name}'!$${L[0]}:$${L[1]}`],localSheetId:x};w.push(j)}),A.pageSetup&&(A.pageSetup.printTitlesRow||A.pageSetup.printTitlesColumn)){const N=[];if(A.pageSetup.printTitlesColumn){const j=A.pageSetup.printTitlesColumn.split(":");N.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}if(A.pageSetup.printTitlesRow){const j=A.pageSetup.printTitlesRow.split(":");N.push(`'${A.name}'!$${j[0]}:$${j[1]}`)}const L={name:"_xlnm.Print_Titles",ranges:N,localSheetId:x};w.push(L)}x++}),w.length&&(f.definedNames=f.definedNames.concat(w)),(f.media||[]).forEach((A,N)=>{A.name=A.type+(N+1)})}render(f,w){f.openXml(a.StdDocAttributes),f.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(f),this.map.workbookPr.render(f,w.properties),this.map.bookViews.render(f,w.views),this.map.sheets.render(f,w.sheets),this.map.definedNames.render(f,w.definedNames),this.map.calcPr.render(f,w.calcProperties),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"workbook":return!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"workbook":return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(f){const w=(f.workbookRels||[]).reduce((j,F)=>(j[F.Id]=F,j),{}),x=[];let A,N=0;(f.sheets||[]).forEach(j=>{const F=w[j.rId];F&&(A=f.worksheetHash["xl/"+F.Target.replace(/^(\s|\/xl\/)+/,"")],A&&(A.name=j.name,A.id=j.id,A.state=j.state,x[N++]=A))});const L=[];d.each(f.definedNames,j=>{if(j.name==="_xlnm.Print_Area"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const F=o.decodeEx(j.ranges[0]);A.pageSetup.printArea=A.pageSetup.printArea?`${A.pageSetup.printArea}&&${F.dimensions}`:F.dimensions}}else if(j.name==="_xlnm.Print_Titles"){if(A=x[j.localSheetId],A){A.pageSetup||(A.pageSetup={});const F=j.ranges.join(","),P=/\$/g,U=/\$\d+:\$\d+/,B=F.match(U);if(B&&B.length){const v=B[0];A.pageSetup.printTitlesRow=v.replace(P,"")}const k=/\$[A-Z]+:\$[A-Z]+/,T=F.match(k);if(T&&T.length){const v=T[0];A.pageSetup.printTitlesColumn=v.replace(P,"")}}}else L.push(j)}),f.definedNames=L,f.media.forEach((j,F)=>{j.index=F})}}u.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},u.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},S.exports=u},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,S,_){const d=e("../strings/rich-text-xform"),o=e("../../../utils/utils"),a=e("../base-xform"),n=S.exports=function(t){this.model=t};o.inherits(n,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new d),this._richTextXform},render(t,r){r=r||this.model,t.openNode("comment",{ref:r.ref,authorId:0}),t.openNode("text"),r&&r.note&&r.note.texts&&r.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../../../utils/utils"),a=e("../base-xform"),n=e("./comment-xform"),t=S.exports=function(){this.map={comment:new n}};o.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(r,l){l=l||this.model,r.openXml(d.StdDocAttributes),r.openNode("comments",t.COMMENTS_ATTRIBUTES),r.openNode("authors"),r.leafNode("author",null,"Author"),r.closeNode(),r.openNode("commentList"),l.comments.forEach(i=>{this.map.comment.render(r,i)}),r.closeNode(),r.closeNode()},parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(r),!0;default:return!1}},parseText(r){this.parser&&this.parser.parseText(r)},parseClose(r){switch(r){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(r),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a,n){(a===n[2]||this.tag==="x:SizeWithCells"&&a===n[1])&&o.leafNode(this.tag)}parseOpen(o){switch(o.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"x:Anchor"}getAnchorRect(o){const a=Math.floor(o.left),n=Math.floor(68*(o.left-a)),t=Math.floor(o.top),r=Math.floor(18*(o.top-t)),l=Math.floor(o.right),i=Math.floor(68*(o.right-l)),s=Math.floor(o.bottom);return[a,n,t,r,l,i,s,Math.floor(18*(o.bottom-s))]}getDefaultRect(o){const a=o.col,n=Math.max(o.row-2,0);return[a,6,n,14,a+2,2,n+4,16]}render(o,a){const n=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.refAddress);o.leafNode("x:Anchor",null,n.join(", "))}parseOpen(o){switch(o.name){case this.tag:return this.text="",!0;default:return!1}}parseText(o){this.text=o}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,S,_){const d=e("../base-xform"),o=e("./vml-anchor-xform"),a=e("./style/vml-protection-xform"),n=e("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];S.exports=class extends d{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new n({tag:"x:SizeWithCells"}),"x:MoveWithCells":new n({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(r,l){const{protection:i,editAs:s}=l.note;r.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(r,s,t),this.map["x:SizeWithCells"].render(r,s,t),this.map["x:Anchor"].render(r,l),this.map["x:Locked"].render(r,i.locked),r.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(r,i.lockText),r.leafNode("x:Row",null,l.refAddress.row-1),r.leafNode("x:Column",null,l.refAddress.col-1),r.closeNode()}parseOpen(r){switch(r.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:""};break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){const r=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(r).length;this.model.editAs=t[l],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("./vml-shape-xform");class n extends o{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(r,l){r.openXml(d.StdDocAttributes),r.openNode(this.tag,n.DRAWING_ATTRIBUTES),r.openNode("o:shapelayout",{"v:ext":"edit"}),r.leafNode("o:idmap",{"v:ext":"edit",data:1}),r.closeNode(),r.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),r.leafNode("v:stroke",{joinstyle:"miter"}),r.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),r.closeNode(),l.comments.forEach((i,s)=>{this.map["v:shape"].render(r,i,s)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(r){case this.tag:return!1;default:return!0}}reconcile(r,l){r.anchors.forEach(i=>{i.br?this.map["xdr:twoCellAnchor"].reconcile(i,l):this.map["xdr:oneCellAnchor"].reconcile(i,l)})}}n.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},S.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,S,_){const d=e("../base-xform"),o=e("./vml-textbox-xform"),a=e("./vml-client-data-xform");class n extends d{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new a}}get tag(){return"v:shape"}render(r,l,i){r.openNode("v:shape",n.V_SHAPE_ATTRIBUTES(l,i)),r.leafNode("v:fill",{color2:"infoBackground [80]"}),r.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),r.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(r,l),this.map["x:ClientData"].render(r,l),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset(),this.model={margins:{insetmode:r.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}};break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1;default:return!0}}}n.V_SHAPE_ATTRIBUTES=(t,r)=>({id:"_x0000_s"+(1025+r),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":t.note.margins&&t.note.margins.insetmode}),S.exports=n},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"v:textbox"}conversionUnit(o,a,n){return`${parseFloat(o)*a.toFixed(2)}${n}`}reverseConversionUnit(o){return(o||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(o,a){const n={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(r=>this.conversionUnit(r,10,"mm")).join(",")),t&&(n.inset=t)}o.openNode("v:textbox",n),o.leafNode("div",{style:"text-align:left"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:return this.model={inset:this.reverseConversionUnit(o.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(e,S,_){const d=e("./base-xform");S.exports=class extends d{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,a){this.model[o]=a.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,a.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.forEach(n=>{o.leafNode("vt:lpstr",void 0,n.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("../simple/string-xform"),n=e("./app-heading-pairs-xform"),t=e("./app-titles-of-parts-xform");class r extends o{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new n,TitleOfParts:new t}}render(i,s){i.openXml(d.StdDocAttributes),i.openNode("Properties",r.PROPERTY_ATTRIBUTES),i.leafNode("Application",void 0,"Microsoft Excel"),i.leafNode("DocSecurity",void 0,"0"),i.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(i,s.worksheets),this.map.TitleOfParts.render(i,s.worksheets),this.map.Company.render(i,s.company||""),this.map.Manager.render(i,s.manager),i.leafNode("LinksUpToDate",void 0,"false"),i.leafNode("SharedDoc",void 0,"false"),i.leafNode("HyperlinksChanged",void 0,"false"),i.leafNode("AppVersion",void 0,"16.0300"),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"Properties":return!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case"Properties":return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}r.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},r.DateAttrs={"xsi:type":"dcterms:W3CDTF"},r.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},S.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform");class a extends o{render(t,r){t.openXml(d.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);const l={};(r.media||[]).forEach(i=>{if(i.type==="image"){const s=i.extension;l[s]||(l[s]=!0,t.leafNode("Default",{Extension:s,ContentType:"image/"+s}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),r.worksheets.forEach(i=>{const s=`/xl/worksheets/sheet${i.id}.xml`;t.leafNode("Override",{PartName:s,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),r.sharedStrings&&r.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),r.tables&&r.tables.forEach(i=>{t.leafNode("Override",{PartName:"/xl/tables/"+i.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),r.drawings&&r.drawings.forEach(i=>{t.leafNode("Override",{PartName:`/xl/drawings/${i.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),r.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),r.commentRefs.forEach(i=>{let{commentName:s}=i;t.leafNode("Override",{PartName:`/xl/${s}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},S.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("../simple/date-xform"),n=e("../simple/string-xform"),t=e("../simple/integer-xform");class r extends o{constructor(){super(),this.map={"dc:creator":new n({tag:"dc:creator"}),"dc:title":new n({tag:"dc:title"}),"dc:subject":new n({tag:"dc:subject"}),"dc:description":new n({tag:"dc:description"}),"dc:identifier":new n({tag:"dc:identifier"}),"dc:language":new n({tag:"dc:language"}),"cp:keywords":new n({tag:"cp:keywords"}),"cp:category":new n({tag:"cp:category"}),"cp:lastModifiedBy":new n({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:r.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new n({tag:"cp:version"}),"cp:contentStatus":new n({tag:"cp:contentStatus"}),"cp:contentType":new n({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:r.DateAttrs,format:r.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:r.DateAttrs,format:r.DateFormat})}}render(i,s){i.openXml(d.StdDocAttributes),i.openNode("cp:coreProperties",r.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(i,s.creator),this.map["dc:title"].render(i,s.title),this.map["dc:subject"].render(i,s.subject),this.map["dc:description"].render(i,s.description),this.map["dc:identifier"].render(i,s.identifier),this.map["dc:language"].render(i,s.language),this.map["cp:keywords"].render(i,s.keywords),this.map["cp:category"].render(i,s.category),this.map["cp:lastModifiedBy"].render(i,s.lastModifiedBy),this.map["cp:lastPrinted"].render(i,s.lastPrinted),this.map["cp:revision"].render(i,s.revision),this.map["cp:version"].render(i,s.version),this.map["cp:contentStatus"].render(i,s.contentStatus),this.map["cp:contentType"].render(i,s.contentType),this.map["dcterms:created"].render(i,s.created),this.map["dcterms:modified"].render(i,s.modified),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[i.name],this.parser)return this.parser.parseOpen(i),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(i))}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.parser=void 0),!0;switch(i){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+i)}}}r.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},r.DateAttrs={"xsi:type":"dcterms:W3CDTF"},r.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},S.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{render(o,a){o.leafNode("Relationship",a)}parseOpen(o){switch(o.name){case"Relationship":return this.model=o.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("./relationship-xform");class n extends o{constructor(){super(),this.map={Relationship:new a}}render(r,l){l=l||this._values,r.openXml(d.StdDocAttributes),r.openNode("Relationships",n.RELATIONSHIPS_ATTRIBUTES),l.forEach(i=>{this.map.Relationship.render(r,i)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[r.name],this.parser)return this.parser.parseOpen(r),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(r){case"Relationships":return!1;default:throw new Error("Unexpected xml node in parseClose: "+r)}}}n.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},S.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}};break;default:this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)}return!0}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,a){if(o&&o.rId){const n=a.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){const t=n[1],r=a.mediaIndex[t];return a.media[r]}}}}},{"../base-xform":32}],57:[function(e,S,_){const d=e("../base-xform"),o=e("./blip-xform");S.exports=class extends d{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(a,n){a.openNode(this.tag),this.map["a:blip"].render(a,n),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(){}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model=this.map["a:blip"].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"a:blip"}render(o,a){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:embed"]},!0;default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(e,S,_){const d=e("../base-xform"),o=e("./hlink-click-xform"),a=e("./ext-lst-xform");S.exports=class extends d{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(n,t){n.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(n,t),this.map["a:extLst"].render(n,t),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(){}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model=this.map["a:hlinkClick"].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,S,_){const d=e("../base-xform"),o=e("../simple/integer-xform");S.exports=class extends d{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(a,n){a.openNode(this.tag),this.map["xdr:col"].render(a,n.nativeCol),this.map["xdr:colOff"].render(a,n.nativeColOff),this.map["xdr:row"].render(a,n.nativeRow),this.map["xdr:rowOff"].render(a,n.nativeRowOff),a.closeNode()}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:this.reset();break;default:this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)}return!0}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.parser=void 0),!0;switch(a){case this.tag:return this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,S,_){const d=e("../../../utils/col-cache"),o=e("../../../utils/xml-stream"),a=e("../base-xform"),n=e("./two-cell-anchor-xform"),t=e("./one-cell-anchor-xform");class r extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new n,"xdr:oneCellAnchor":new t}}prepare(i){i.anchors.forEach((s,h)=>{s.anchorType=function(c){return(typeof c.range=="string"?d.decode(c.range):c.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(s),this.map[s.anchorType].prepare(s,{index:h})})}get tag(){return"xdr:wsDr"}render(i,s){i.openXml(o.StdDocAttributes),i.openNode(this.tag,r.DRAWING_ATTRIBUTES),s.anchors.forEach(h=>{this.map[h.anchorType].render(i,h)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)}return!0}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser)return this.parser.parseClose(i)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(i){case this.tag:return!1;default:return!0}}reconcile(i,s){i.anchors.forEach(h=>{h.br?this.map["xdr:twoCellAnchor"].reconcile(h,s):this.map["xdr:oneCellAnchor"].reconcile(h,s)})}}r.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},S.exports=r},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){switch(o){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,a){o.openNode(this.tag);const n=Math.floor(9525*a.width),t=Math.floor(9525*a.height);o.addAttribute("cx",n),o.addAttribute("cy",t),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={width:parseInt(o.attributes.cx||"0",10)/9525,height:parseInt(o.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"a:hlinkClick"}render(o,a){a.hyperlinks&&a.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(o){switch(o.name){case this.tag:return this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,S,_){const d=e("../base-xform"),o=e("./c-nv-pr-xform"),a=e("./c-nv-pic-pr-xform");S.exports=class extends d{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(n,t){n.openNode(this.tag),this.map["xdr:cNvPr"].render(n,t),this.map["xdr:cNvPicPr"].render(n,t),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.tag:this.reset();break;default:this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)}return!0}parseText(){}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.parser=void 0),!0;switch(n){case this.tag:return this.model=this.map["xdr:cNvPr"].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,S,_){const d=e("./base-cell-anchor-xform"),o=e("../static-xform"),a=e("./cell-position-xform"),n=e("./ext-xform"),t=e("./pic-xform");S.exports=class extends d{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new n({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(r,l){this.map["xdr:pic"].prepare(r.picture,l)}render(r,l){r.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(r,l.range.tl),this.map["xdr:ext"].render(r,l.range.ext),this.map["xdr:pic"].render(r,l.picture),this.map["xdr:clientData"].render(r,{}),r.closeNode()}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.parser=void 0),!0;switch(r){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(r,l){r.medium=this.reconcilePicture(r.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,S,_){const d=e("../base-xform"),o=e("../static-xform"),a=e("./blip-fill-xform"),n=e("./nv-pic-pr-xform"),t=e("./sp-pr");S.exports=class extends d{constructor(){super(),this.map={"xdr:nvPicPr":new n,"xdr:blipFill":new a,"xdr:spPr":new o(t)}}get tag(){return"xdr:pic"}prepare(r,l){r.index=l.index+1}render(r,l){r.openNode(this.tag),this.map["xdr:nvPicPr"].render(r,l),this.map["xdr:blipFill"].render(r,l),this.map["xdr:spPr"].render(r,l),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.tag:this.reset();break;default:this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)}return!0}parseText(){}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(r){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,S,_){S.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(e,S,_){const d=e("./base-cell-anchor-xform"),o=e("../static-xform"),a=e("./cell-position-xform"),n=e("./pic-xform");S.exports=class extends d{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new n,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,r){this.map["xdr:pic"].prepare(t.picture,r)}render(t,r){t.openNode(this.tag,{editAs:r.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,r.range.tl),this.map["xdr:to"].render(t,r.range.br),this.map["xdr:pic"].render(t,r.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case this.tag:return this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1;default:return!0}}reconcile(t,r){t.medium=this.reconcilePicture(t.picture,r)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,S,_){const d=e("./base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,a){const{childXform:n}=this;o&&o.forEach((t,r)=>{a.index=r,n.prepare(t,a)})}render(o,a){if(this.always||a&&a.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,a&&a.length||0);const{childXform:n}=this;(a||[]).forEach((t,r)=>{n.render(o,t,r)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(o)&&(this.parser=this.childXform,!0)}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser){if(!this.parser.parseClose(o)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(o,a){if(o){const{childXform:n}=this;o.forEach(t=>{n.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(e,S,_){const d=e("../../../utils/col-cache"),o=e("../base-xform");S.exports=class extends o{get tag(){return"autoFilter"}render(a,n){if(n)if(typeof n=="string")a.leafNode("autoFilter",{ref:n});else{const t=function(i){return typeof i=="string"?i:d.getAddress(i.row,i.column).address},r=t(n.from),l=t(n.to);r&&l&&a.leafNode("autoFilter",{ref:`${r}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,S,_){const d=e("../../../utils/utils"),o=e("../base-xform"),a=e("../../../doc/range"),n=e("../../../doc/enums"),t=e("../strings/rich-text-xform");function r(l){if(l==null)return n.ValueType.Null;if(l instanceof String||typeof l=="string")return n.ValueType.String;if(typeof l=="number")return n.ValueType.Number;if(typeof l=="boolean")return n.ValueType.Boolean;if(l instanceof Date)return n.ValueType.Date;if(l.text&&l.hyperlink)return n.ValueType.Hyperlink;if(l.formula)return n.ValueType.Formula;if(l.error)return n.ValueType.Error;throw new Error("I could not understand type of value")}S.exports=class extends o{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,i){const s=i.styles.addStyleModel(l.style||{},function(h){switch(h.type){case n.ValueType.Formula:return r(h.result);default:return h.type}}(l));switch(s&&(l.styleId=s),l.comment&&i.comments.push({...l.comment,ref:l.address}),l.type){case n.ValueType.String:case n.ValueType.RichText:i.sharedStrings&&(l.ssId=i.sharedStrings.add(l.value));break;case n.ValueType.Date:i.date1904&&(l.date1904=!0);break;case n.ValueType.Hyperlink:i.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=i.sharedStrings.add(l.text)),i.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case n.ValueType.Merge:i.merges.add(l);break;case n.ValueType.Formula:if(i.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=i.siFormulae++),l.formula)i.formulae[l.address]=l;else if(l.sharedFormula){const h=i.formulae[l.sharedFormula];if(!h)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);h.si===void 0?(h.shareType="shared",h.si=i.siFormulae++,h.range=new a(h.address,l.address)):h.range&&h.range.expandToAddress(l.address),l.si=h.si}}}renderFormula(l,i){let s=null;switch(i.shareType){case"shared":s={t:"shared",ref:i.ref||i.range.range,si:i.si};break;case"array":s={t:"array",ref:i.ref};break;default:i.si!==void 0&&(s={t:"shared",si:i.si})}switch(r(i.result)){case n.ValueType.Null:l.leafNode("f",s,i.formula);break;case n.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",s,i.formula),l.leafNode("v",null,i.result);break;case n.ValueType.Number:l.leafNode("f",s,i.formula),l.leafNode("v",null,i.result);break;case n.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",s,i.formula),l.leafNode("v",null,i.result?1:0);break;case n.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",s,i.formula),l.leafNode("v",null,i.result.error);break;case n.ValueType.Date:l.leafNode("f",s,i.formula),l.leafNode("v",null,d.dateToExcel(i.result,i.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,i){if(i.type!==n.ValueType.Null||i.styleId){switch(l.openNode("c"),l.addAttribute("r",i.address),i.styleId&&l.addAttribute("s",i.styleId),i.type){case n.ValueType.Null:break;case n.ValueType.Number:l.leafNode("v",null,i.value);break;case n.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,i.value?"1":"0");break;case n.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,i.value.error);break;case n.ValueType.String:case n.ValueType.RichText:i.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,i.ssId)):i.value&&i.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),i.value.richText.forEach(s=>{this.richTextXForm.render(l,s)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,i.value));break;case n.ValueType.Date:l.leafNode("v",null,d.dateToExcel(i.value,i.date1904));break;case n.ValueType.Hyperlink:i.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,i.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,i.text));break;case n.ValueType.Formula:this.renderFormula(l,i);break;case n.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{const{model:i}=this;if(i.formula||i.shareType)i.type=n.ValueType.Formula,i.value&&(this.t==="str"?i.result=d.xmlDecode(i.value):this.t==="b"?i.result=parseInt(i.value,10)!==0:this.t==="e"?i.result={error:i.value}:i.result=parseFloat(i.value),i.value=void 0);else if(i.value!==void 0)switch(this.t){case"s":i.type=n.ValueType.String,i.value=parseInt(i.value,10);break;case"str":i.type=n.ValueType.String,i.value=d.xmlDecode(i.value);break;case"inlineStr":i.type=n.ValueType.String;break;case"b":i.type=n.ValueType.Boolean,i.value=parseInt(i.value,10)!==0;break;case"e":i.type=n.ValueType.Error,i.value={error:i.value};break;default:i.type=n.ValueType.Number,i.value=parseFloat(i.value)}else i.styleId?i.type=n.ValueType.Null:i.type=n.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(l),!0)}}reconcile(l,i){const s=l.styleId&&i.styles&&i.styles.getStyleModel(l.styleId);switch(s&&(l.style=s),l.styleId!==void 0&&(l.styleId=void 0),l.type){case n.ValueType.String:typeof l.value=="number"&&i.sharedStrings&&(l.value=i.sharedStrings.getString(l.value)),l.value.richText&&(l.type=n.ValueType.RichText);break;case n.ValueType.Number:s&&d.isDateFmt(s.numFmt)&&(l.type=n.ValueType.Date,l.value=d.excelToDate(l.value,i.date1904));break;case n.ValueType.Formula:l.result!==void 0&&s&&d.isDateFmt(s.numFmt)&&(l.result=d.excelToDate(l.result,i.date1904)),l.shareType==="shared"&&(l.ref?i.formulae[l.si]=l.address:(l.sharedFormula=i.formulae[l.si],delete l.shareType),delete l.si)}const h=i.hyperlinkMap[l.address];h&&(l.type===n.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=n.ValueType.Hyperlink,l.hyperlink=h);const c=i.commentsMap&&i.commentsMap[l.address];c&&(l.comment=c)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{get tag(){return"x14:cfIcon"}render(o,a){o.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(o){let{attributes:a}=o;this.model={iconSet:a.iconSet,iconId:d.toIntValue(a.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(e,S,_){const{v4:d}=e("uuid"),o=e("../../base-xform"),a=e("../../composite-xform"),n=e("./databar-ext-xform"),t=e("./icon-set-ext-xform"),r={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new n,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(s){return s.type==="dataBar"?n.isExt(s):!(s.type!=="iconSet"||!s.custom&&!r[s.iconSet])}prepare(s){l.isExt(s)&&(s.x14Id=`{${d()}}`.toUpperCase())}render(s,h){if(l.isExt(h))switch(h.type){case"dataBar":this.renderDataBar(s,h);break;case"iconSet":this.renderIconSet(s,h)}}renderDataBar(s,h){s.openNode(this.tag,{type:"dataBar",id:h.x14Id}),this.databarXform.render(s,h),s.closeNode()}renderIconSet(s,h){s.openNode(this.tag,{type:"iconSet",priority:h.priority,id:h.x14Id||`{${d()}}`}),this.iconSetXform.render(s,h),s.closeNode()}createNewModel(s){let{attributes:h}=s;return{type:h.type,x14Id:h.id,priority:o.toIntValue(h.priority)}}onParserClose(s,h){Object.assign(this.model,h.model)}}S.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,S,_){const d=e("../../composite-xform"),o=e("./f-ext-xform");S.exports=class extends d{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(a,n){a.openNode(this.tag,{type:n.type}),n.value!==void 0&&this.fExtXform.render(a,n.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,n){switch(a){case"xm:f":this.model.value=n.model?parseFloat(n.model):0}}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,S,_){const d=e("../../composite-xform"),o=e("./sqref-ext-xform"),a=e("./cf-rule-ext-xform");S.exports=class extends d{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(n,t){n.rules.forEach(r=>{this.cfRule.prepare(r,t)})}render(n,t){t.rules.some(a.isExt)&&(n.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach(r=>this.cfRule.render(n,r)),this.sqRef.render(n,t.ref),n.closeNode())}createNewModel(){return{rules:[]}}onParserClose(n,t){switch(n){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,S,_){const d=e("../../composite-xform"),o=e("./cf-rule-ext-xform"),a=e("./conditional-formatting-ext-xform");S.exports=class extends d{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(n){return n.hasExtContent===void 0&&(n.hasExtContent=n.some(t=>t.rules.some(o.isExt))),n.hasExtContent}prepare(n,t){n.forEach(r=>{this.cfXform.prepare(r,t)})}render(n,t){this.hasContent(t)&&(n.openNode(this.tag),t.forEach(r=>this.cfXform.render(n,r)),n.closeNode())}createNewModel(){return[]}onParserClose(n,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,S,_){const d=e("../../base-xform"),o=e("../../composite-xform"),a=e("../../style/color-xform"),n=e("./cfvo-ext-xform");S.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new n,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,r){t.openNode(this.tag,{minLength:d.toIntAttribute(r.minLength,0,!0),maxLength:d.toIntAttribute(r.maxLength,100,!0),border:d.toBoolAttribute(r.border,!1),gradient:d.toBoolAttribute(r.gradient,!0),negativeBarColorSameAsPositive:d.toBoolAttribute(r.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:d.toBoolAttribute(r.negativeBarBorderColorSameAsPositive,!0),axisPosition:d.toAttribute(r.axisPosition,"auto"),direction:d.toAttribute(r.direction,"leftToRight")}),r.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,r.borderColor),this.negativeBorderColorXform.render(t,r.negativeBorderColor),this.negativeFillColorXform.render(t,r.negativeFillColor),this.axisColorXform.render(t,r.axisColor),t.closeNode()}createNewModel(t){let{attributes:r}=t;return{cfvo:[],minLength:d.toIntValue(r.minLength,0),maxLength:d.toIntValue(r.maxLength,100),border:d.toBoolValue(r.border,!1),gradient:d.toBoolValue(r.gradient,!0),negativeBarColorSameAsPositive:d.toBoolValue(r.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:d.toBoolValue(r.negativeBarBorderColorSameAsPositive,!0),axisPosition:d.toStringValue(r.axisPosition,"auto"),direction:d.toStringValue(r.direction,"leftToRight")}}onParserClose(t,r){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(r.model);break;default:this.model[l]=r.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{get tag(){return"xm:f"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(e,S,_){const d=e("../../base-xform"),o=e("../../composite-xform"),a=e("./cfvo-ext-xform"),n=e("./cf-icon-ext-xform");S.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new n}}get tag(){return"x14:iconSet"}render(t,r){t.openNode(this.tag,{iconSet:d.toStringAttribute(r.iconSet),reverse:d.toBoolAttribute(r.reverse,!1),showValue:d.toBoolAttribute(r.showValue,!0),custom:d.toBoolAttribute(r.icons,!1)}),r.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),r.icons&&r.icons.forEach((l,i)=>{l.iconId=i,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:r}=t;return{cfvo:[],iconSet:d.toStringValue(r.iconSet,"3TrafficLights"),reverse:d.toBoolValue(r.reverse,!1),showValue:d.toBoolValue(r.showValue,!0)}}onParserClose(t,r){const[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(r.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(r.model);break;default:this.model[l]=r.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{get tag(){return"xm:sqref"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(e,S,_){const d=e("../../base-xform"),o=e("../../composite-xform"),a=e("../../../../doc/range"),n=e("./databar-xform"),t=e("./ext-lst-ref-xform"),r=e("./formula-xform"),l=e("./color-scale-xform"),i=e("./icon-set-xform"),s={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},h=u=>{const{type:p,operator:f}=u;switch(p){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:p};default:return{type:p,operator:f}}};class c extends o{constructor(){super(),this.map={dataBar:this.databarXform=new n,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new r,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new i}}get tag(){return"cfRule"}static isPrimitive(p){return p.type!=="iconSet"||!p.custom&&!s[p.iconSet]}render(p,f){switch(f.type){case"expression":this.renderExpression(p,f);break;case"cellIs":this.renderCellIs(p,f);break;case"top10":this.renderTop10(p,f);break;case"aboveAverage":this.renderAboveAverage(p,f);break;case"dataBar":this.renderDataBar(p,f);break;case"colorScale":this.renderColorScale(p,f);break;case"iconSet":this.renderIconSet(p,f);break;case"containsText":this.renderText(p,f);break;case"timePeriod":this.renderTimePeriod(p,f)}}renderExpression(p,f){p.openNode(this.tag,{type:"expression",dxfId:f.dxfId,priority:f.priority}),this.formulaXform.render(p,f.formulae[0]),p.closeNode()}renderCellIs(p,f){p.openNode(this.tag,{type:"cellIs",dxfId:f.dxfId,priority:f.priority,operator:f.operator}),f.formulae.forEach(w=>{this.formulaXform.render(p,w)}),p.closeNode()}renderTop10(p,f){p.leafNode(this.tag,{type:"top10",dxfId:f.dxfId,priority:f.priority,percent:d.toBoolAttribute(f.percent,!1),bottom:d.toBoolAttribute(f.bottom,!1),rank:d.toIntValue(f.rank,10,!0)})}renderAboveAverage(p,f){p.leafNode(this.tag,{type:"aboveAverage",dxfId:f.dxfId,priority:f.priority,aboveAverage:d.toBoolAttribute(f.aboveAverage,!0)})}renderDataBar(p,f){p.openNode(this.tag,{type:"dataBar",priority:f.priority}),this.databarXform.render(p,f),this.extLstRefXform.render(p,f),p.closeNode()}renderColorScale(p,f){p.openNode(this.tag,{type:"colorScale",priority:f.priority}),this.colorScaleXform.render(p,f),p.closeNode()}renderIconSet(p,f){c.isPrimitive(f)&&(p.openNode(this.tag,{type:"iconSet",priority:f.priority}),this.iconSetXform.render(p,f),p.closeNode())}renderText(p,f){p.openNode(this.tag,{type:f.operator,dxfId:f.dxfId,priority:f.priority,operator:d.toStringAttribute(f.operator,"containsText")});const w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:N}=A;switch(x.operator){case"containsText":return`NOT(ISERROR(SEARCH("${x.text}",${N})))`;case"containsBlanks":return`LEN(TRIM(${N}))=0`;case"notContainsBlanks":return`LEN(TRIM(${N}))>0`;case"containsErrors":return`ISERROR(${N})`;case"notContainsErrors":return`NOT(ISERROR(${N}))`;default:return}})(f);w&&this.formulaXform.render(p,w),p.closeNode()}renderTimePeriod(p,f){p.openNode(this.tag,{type:"timePeriod",dxfId:f.dxfId,priority:f.priority,timePeriod:f.timePeriod});const w=(x=>{if(x.formulae&&x.formulae[0])return x.formulae[0];const A=new a(x.ref),{tl:N}=A;switch(x.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${N},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${N},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${N},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${N},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${N},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${N},1)=TODAY()-1`;case"today":return`FLOOR(${N},1)=TODAY()`;case"tomorrow":return`FLOOR(${N},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${N},1)<=6,FLOOR(${N},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0-1)),YEAR(${N})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${N})=MONTH(TODAY()),YEAR(${N})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${N})=MONTH(EDATE(TODAY(),0+1)),YEAR(${N})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(f);w&&this.formulaXform.render(p,w),p.closeNode()}createNewModel(p){let{attributes:f}=p;return{...h(f),dxfId:d.toIntValue(f.dxfId),priority:d.toIntValue(f.priority),timePeriod:f.timePeriod,percent:d.toBoolValue(f.percent),bottom:d.toBoolValue(f.bottom),rank:d.toIntValue(f.rank),aboveAverage:d.toBoolValue(f.aboveAverage)}}onParserClose(p,f){switch(p){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,f.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(f.model)}}}S.exports=c},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{get tag(){return"cfvo"}render(o,a){o.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(o){this.model={type:o.attributes.type,value:d.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(e,S,_){const d=e("../../composite-xform"),o=e("../../style/color-xform"),a=e("./cfvo-xform");S.exports=class extends d{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"colorScale"}render(n,t){n.openNode(this.tag),t.cfvo.forEach(r=>{this.cfvoXform.render(n,r)}),t.color.forEach(r=>{this.colorXform.render(n,r)}),n.closeNode()}createNewModel(n){return{cfvo:[],color:[]}}onParserClose(n,t){this.model[n].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,S,_){const d=e("../../composite-xform"),o=e("./cf-rule-xform");S.exports=class extends d{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(a,n){n.rules.some(o.isPrimitive)&&(a.openNode(this.tag,{sqref:n.ref}),n.rules.forEach(t=>{o.isPrimitive(t)&&(t.ref=n.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:n}=a;return{ref:n.sqref,rules:[]}}onParserClose(a,n){this.model.rules.push(n.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,S,_){const d=e("../../base-xform"),o=e("./conditional-formatting-xform");S.exports=class extends d{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,n){let t=a.reduce((r,l)=>Math.max(r,...l.rules.map(i=>i.priority||0)),1);a.forEach(r=>{r.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=n.styles.addDxfStyle(l.style))})})}render(a,n){n.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case"conditionalFormatting":return this.parser=this.cfXform,this.parser.parseOpen(a),!0;default:return!1}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(!!this.parser.parseClose(a)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,n){a.forEach(t=>{t.rules.forEach(r=>{r.dxfId!==void 0&&(r.style=n.styles.getDxfStyle(r.dxfId),delete r.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,S,_){const d=e("../../composite-xform"),o=e("../../style/color-xform"),a=e("./cfvo-xform");S.exports=class extends d{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new o}}get tag(){return"dataBar"}render(n,t){n.openNode(this.tag),t.cfvo.forEach(r=>{this.cfvoXform.render(n,r)}),this.colorXform.render(n,t.color),n.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(n,t){switch(n){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,S,_){const d=e("../../base-xform"),o=e("../../composite-xform");class a extends d{get tag(){return"x14:id"}render(r,l){r.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(r){this.model+=r}parseClose(r){return r!==this.tag}}class n extends o{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(r,l){r.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(r,l.x14Id),r.closeNode()}createNewModel(){return{}}onParserClose(r,l){this.model.x14Id=l.model}}S.exports=class extends o{constructor(){super(),this.map={ext:new n}}get tag(){return"extLst"}render(t,r){t.openNode(this.tag),this.map.ext.render(t,r),t.closeNode()}createNewModel(){return{}}onParserClose(t,r){Object.assign(this.model,r.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,S,_){const d=e("../../base-xform");S.exports=class extends d{get tag(){return"formula"}render(o,a){o.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(e,S,_){const d=e("../../base-xform"),o=e("../../composite-xform"),a=e("./cfvo-xform");S.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(n,t){n.openNode(this.tag,{iconSet:d.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:d.toBoolAttribute(t.reverse,!1),showValue:d.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(r=>{this.cfvoXform.render(n,r)}),n.closeNode()}createNewModel(n){let{attributes:t}=n;return{iconSet:d.toStringValue(t.iconSet,"3TrafficLights"),reverse:d.toBoolValue(t.reverse),showValue:d.toBoolValue(t.showValue),cfvo:[]}}onParserClose(n,t){this.model[n].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,S,_){const d=e("../../../utils/utils"),o=e("../base-xform");S.exports=class extends o{get tag(){return"col"}prepare(a,n){const t=n.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,n){a.openNode("col"),a.addAttribute("min",n.min),a.addAttribute("max",n.max),n.width&&a.addAttribute("width",n.width),n.styleId&&a.addAttribute("style",n.styleId),n.hidden&&a.addAttribute("hidden","1"),n.bestFit&&a.addAttribute("bestFit","1"),n.outlineLevel&&a.addAttribute("outlineLevel",n.outlineLevel),n.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){const n=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(n.styleId=parseInt(a.attributes.style,10)),d.parseBoolean(a.attributes.hidden)&&(n.hidden=!0),d.parseBoolean(a.attributes.bestFit)&&(n.bestFit=!0),a.attributes.outlineLevel&&(n.outlineLevel=parseInt(a.attributes.outlineLevel,10)),d.parseBoolean(a.attributes.collapsed)&&(n.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,n){a.styleId&&(a.style=n.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../../../utils/utils"),a=e("../../../utils/col-cache"),n=e("../base-xform"),t=e("../../../doc/range");function r(i,s,h,c){const u=s[h];u!==void 0?i[h]=u:c!==void 0&&(i[h]=c)}function l(i,s,h,c){const u=s[h];u!==void 0?i[h]=o.parseBoolean(u):c!==void 0&&(i[h]=c)}S.exports=class extends n{get tag(){return"dataValidations"}render(i,s){const h=function(c){const u=d.map(c,(w,x)=>({address:x,dataValidation:w,marked:!1})).sort((w,x)=>d.strcmp(w.address,x.address)),p=d.keyBy(u,"address"),f=(w,x,A)=>{for(let N=0;N{if(!w.marked){const x=a.decodeEx(w.address);if(x.dimensions)return p[x.dimensions].marked=!0,{...w.dataValidation,sqref:w.address};let A=1,N=a.encodeAddress(x.row+A,x.col);for(;c[N]&&d.isEqual(w.dataValidation,c[N]);)A++,N=a.encodeAddress(x.row+A,x.col);let L=1;for(;f(x,A,x.col+L);)L++;for(let j=0;j1||L>1){const j=x.row+(A-1),F=x.col+(L-1);return{...w.dataValidation,sqref:`${w.address}:${a.encodeAddress(j,F)}`}}return{...w.dataValidation,sqref:w.address}}return null}).filter(Boolean)}(s);h.length&&(i.openNode("dataValidations",{count:h.length}),h.forEach(c=>{i.openNode("dataValidation"),c.type!=="any"&&(i.addAttribute("type",c.type),c.operator&&c.type!=="list"&&c.operator!=="between"&&i.addAttribute("operator",c.operator),c.allowBlank&&i.addAttribute("allowBlank","1")),c.showInputMessage&&i.addAttribute("showInputMessage","1"),c.promptTitle&&i.addAttribute("promptTitle",c.promptTitle),c.prompt&&i.addAttribute("prompt",c.prompt),c.showErrorMessage&&i.addAttribute("showErrorMessage","1"),c.errorStyle&&i.addAttribute("errorStyle",c.errorStyle),c.errorTitle&&i.addAttribute("errorTitle",c.errorTitle),c.error&&i.addAttribute("error",c.error),i.addAttribute("sqref",c.sqref),(c.formulae||[]).forEach((u,p)=>{i.openNode("formula"+(p+1)),c.type==="date"?i.writeText(o.dateToExcel(new Date(u))):i.writeText(u),i.closeNode()}),i.closeNode()}),i.closeNode())}parseOpen(i){switch(i.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=i.attributes.sqref;const s={type:i.attributes.type||"any",formulae:[]};switch(i.attributes.type&&l(s,i.attributes,"allowBlank"),l(s,i.attributes,"showInputMessage"),l(s,i.attributes,"showErrorMessage"),s.type){case"any":case"list":case"custom":break;default:r(s,i.attributes,"operator","between")}return r(s,i.attributes,"promptTitle"),r(s,i.attributes,"prompt"),r(s,i.attributes,"errorStyle"),r(s,i.attributes,"errorTitle"),r(s,i.attributes,"error"),this._dataValidation=s,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(i){this._formula&&this._formula.push(i)}parseClose(i){switch(i){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(s=>{s.includes(":")?new t(s).forEachAddress(h=>{this.model[h]=this._dataValidation}):this.model[s]=this._dataValidation}),!0;case"formula1":case"formula2":{let 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=o.excelToDate(parseFloat(s))}return this._dataValidation.formulae.push(s),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"dimension"}render(o,a){a&&o.leafNode("dimension",{ref:a})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"drawing"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,S,_){const d=e("../composite-xform"),o=e("./cf-ext/conditional-formattings-ext-xform");class a extends d{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new o}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,r){this.conditionalFormattings.prepare(t.conditionalFormattings,r)}render(t,r){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,r.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,r){this.model[t]=r.model}}S.exports=class extends d{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(n,t){this.ext.prepare(n,t)}hasContent(n){return this.ext.hasContent(n)}render(n,t){this.hasContent(t)&&(n.openNode("extLst"),this.ext.render(n,t),n.closeNode())}createNewModel(){return{}}onParserClose(n,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"headerFooter"}render(o,a){if(a){o.addRollback();let n=!1;o.openNode("headerFooter"),a.differentFirst&&(o.addAttribute("differentFirst","1"),n=!0),a.differentOddEven&&(o.addAttribute("differentOddEven","1"),n=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(o.leafNode("oddHeader",null,a.oddHeader),n=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(o.leafNode("oddFooter",null,a.oddFooter),n=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(o.leafNode("evenHeader",null,a.evenHeader),n=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(o.leafNode("evenFooter",null,a.evenFooter),n=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(o.leafNode("firstHeader",null,a.firstHeader),n=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(o.leafNode("firstFooter",null,a.firstFooter),n=!0),n?(o.closeNode(),o.commit()):o.rollback()}}parseOpen(o){switch(o.name){case"headerFooter":return this.model={},o.attributes.differentFirst&&(this.model.differentFirst=parseInt(o.attributes.differentFirst,0)===1),o.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(o.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(o){switch(this.currentNode){case"oddHeader":this.model.oddHeader=o;break;case"oddFooter":this.model.oddFooter=o;break;case"evenHeader":this.model.evenHeader=o;break;case"evenFooter":this.model.evenFooter=o;break;case"firstHeader":this.model.firstHeader=o;break;case"firstFooter":this.model.firstFooter=o}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"hyperlink"}render(o,a){this.isInternalLink(a)?o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):o.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"mergeCell"}render(o,a){o.leafNode("mergeCell",{ref:a})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../../../doc/range"),a=e("../../../utils/col-cache"),n=e("../../../doc/enums");S.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const r=`${t.master}:${t.address}`;this.merges[t.master]=new o(r)}}get mergeCells(){return d.map(this.merges,t=>t.range)}reconcile(t,r){d.each(t,l=>{const i=a.decode(l);for(let s=i.top;s<=i.bottom;s++){const h=r[s-1];for(let c=i.left;c<=i.right;c++){const u=h.cells[c-1];u?u.type===n.ValueType.Merge&&(u.master=i.tl):h.cells[c]={type:n.ValueType.Null,address:a.encodeAddress(s,c)}}}})}getMasterAddress(t){const r=this.hash[t];return r&&r.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,S,_){const d=e("../base-xform"),o=a=>a!==void 0;S.exports=class extends d{get tag(){return"outlinePr"}render(a,n){return!(!n||!o(n.summaryBelow)&&!o(n.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:o(n.summaryBelow)?Number(n.summaryBelow):void 0,summaryRight:o(n.summaryRight)?Number(n.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:o(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:o(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"brk"}render(o,a){o.leafNode("brk",a)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../base-xform");S.exports=class extends o{get tag(){return"pageMargins"}render(a,n){if(n){const t={left:n.left,right:n.right,top:n.top,bottom:n.bottom,header:n.header,footer:n.footer};d.some(t,r=>r!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){switch(a.name){case this.tag:return this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"pageSetUpPr"}render(o,a){return!(!a||!a.fitToPage)&&(o.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../base-xform");function a(l){return l?"1":void 0}function n(l){switch(l){case"overThenDown":return l;default:return}}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function r(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}S.exports=class extends o{get tag(){return"pageSetup"}render(l,i){if(i){const s={paperSize:i.paperSize,orientation:i.orientation,horizontalDpi:i.horizontalDpi,verticalDpi:i.verticalDpi,pageOrder:n(i.pageOrder),blackAndWhite:a(i.blackAndWhite),draft:a(i.draft),cellComments:t(i.cellComments),errors:r(i.errors),scale:i.scale,fitToWidth:i.fitToWidth,fitToHeight:i.fitToHeight,firstPageNumber:i.firstPageNumber,useFirstPageNumber:a(i.firstPageNumber),usePrinterDefaults:a(i.usePrinterDefaults),copies:i.copies};d.some(s,h=>h!==void 0)&&l.leafNode(this.tag,s)}}parseOpen(l){switch(l.name){case this.tag:return this.model={paperSize:(i=l.attributes.paperSize,i!==void 0?parseInt(i,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;default:return!1}var i}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"picture"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../base-xform");function a(n){return n?"1":void 0}S.exports=class extends o{get tag(){return"printOptions"}render(n,t){if(t){const r={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};d.some(r,l=>l!==void 0)&&n.leafNode(this.tag,r)}}parseOpen(n){switch(n.name){case this.tag:return this.model={showRowColHeaders:n.attributes.headings==="1",showGridLines:n.attributes.gridLines==="1",horizontalCentered:n.attributes.horizontalCentered==="1",verticalCentered:n.attributes.verticalCentered==="1"},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,S,_){const d=e("./page-breaks-xform"),o=e("../list-xform");S.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new d})}render(a,n){if(n&&n.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,n.length),a.addAttribute("manualBreakCount",n.length));const{childXform:t}=this;n.forEach(r=>{t.render(a,r)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,S,_){const d=e("../base-xform"),o=e("../../../utils/utils"),a=e("./cell-xform");S.exports=class extends d{constructor(n){super(),this.maxItems=n&&n.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(n,t){const r=t.styles.addStyleModel(n.style);r&&(n.styleId=r);const l=this.map.c;n.cells.forEach(i=>{l.prepare(i,t)})}render(n,t,r){n.openNode("row"),n.addAttribute("r",t.number),t.height&&(n.addAttribute("ht",t.height),n.addAttribute("customHeight","1")),t.hidden&&n.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&n.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(n.addAttribute("s",t.styleId),n.addAttribute("customFormat","1")),n.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&n.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&n.addAttribute("collapsed","1");const l=this.map.c;t.cells.forEach(i=>{l.render(n,i,r)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;if(n.name==="row"){this.numRowsSeen+=1;const t=n.attributes.spans?n.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],r=this.model={number:parseInt(n.attributes.r,10),min:t[0],max:t[1],cells:[]};return n.attributes.s&&(r.styleId=parseInt(n.attributes.s,10)),o.parseBoolean(n.attributes.hidden)&&(r.hidden=!0),o.parseBoolean(n.attributes.bestFit)&&(r.bestFit=!0),n.attributes.ht&&(r.height=parseFloat(n.attributes.ht)),n.attributes.outlineLevel&&(r.outlineLevel=parseInt(n.attributes.outlineLevel,10)),o.parseBoolean(n.attributes.collapsed)&&(r.collapsed=!0),!0}return this.parser=this.map[n.name],!!this.parser&&(this.parser.parseOpen(n),!0)}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser){if(!this.parser.parseClose(n)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(n,t){n.style=n.styleId?t.styles.getStyleModel(n.styleId):{},n.styleId!==void 0&&(n.styleId=void 0);const r=this.map.c;n.cells.forEach(l=>{r.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../base-xform");S.exports=class extends o{get tag(){return"sheetFormatPr"}render(a,n){if(n){const t={defaultRowHeight:n.defaultRowHeight,outlineLevelRow:n.outlineLevelRow,outlineLevelCol:n.outlineLevelCol,"x14ac:dyDescent":n.dyDescent};n.defaultColWidth&&(t.defaultColWidth=n.defaultColWidth),n.defaultRowHeight&&n.defaultRowHeight===15||(t.customHeight="1"),d.some(t,r=>r!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,S,_){const d=e("../base-xform"),o=e("../style/color-xform"),a=e("./page-setup-properties-xform"),n=e("./outline-properties-xform");S.exports=class extends d{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new a,outlinePr:new n}}get tag(){return"sheetPr"}render(t,r){if(r){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,r.tabColor)||l,l=this.map.pageSetUpPr.render(t,r.pageSetup)||l,l=this.map.outlinePr.render(t,r.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../base-xform");function a(t,r){return t?r:void 0}function n(t,r){return t===r||void 0}S.exports=class extends o{get tag(){return"sheetProtection"}render(t,r){if(r){const l={sheet:a(r.sheet,"1"),selectLockedCells:r.selectLockedCells===!1?"1":void 0,selectUnlockedCells:r.selectUnlockedCells===!1?"1":void 0,formatCells:a(r.formatCells,"0"),formatColumns:a(r.formatColumns,"0"),formatRows:a(r.formatRows,"0"),insertColumns:a(r.insertColumns,"0"),insertRows:a(r.insertRows,"0"),insertHyperlinks:a(r.insertHyperlinks,"0"),deleteColumns:a(r.deleteColumns,"0"),deleteRows:a(r.deleteRows,"0"),sort:a(r.sort,"0"),autoFilter:a(r.autoFilter,"0"),pivotTables:a(r.pivotTables,"0")};r.sheet&&(l.algorithmName=r.algorithmName,l.hashValue=r.hashValue,l.saltValue=r.saltValue,l.spinCount=r.spinCount,l.objects=a(r.objects===!1,"1"),l.scenarios=a(r.scenarios===!1,"1")),d.some(l,i=>i!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){switch(t.name){case this.tag:return this.model={sheet:n(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:n(t.attributes.formatCells,"0"),formatColumns:n(t.attributes.formatColumns,"0"),formatRows:n(t.attributes.formatRows,"0"),insertColumns:n(t.attributes.insertColumns,"0"),insertRows:n(t.attributes.insertRows,"0"),insertHyperlinks:n(t.attributes.insertHyperlinks,"0"),deleteColumns:n(t.attributes.deleteColumns,"0"),deleteRows:n(t.attributes.deleteRows,"0"),sort:n(t.attributes.sort,"0"),autoFilter:n(t.attributes.autoFilter,"0"),pivotTables:n(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,S,_){const d=e("../../../utils/col-cache"),o=e("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};S.exports=class extends o{get tag(){return"sheetView"}prepare(n){switch(n.state){case"frozen":case"split":break;default:n.state="normal"}}render(n,t){n.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const r=function(c,u,p){p&&n.addAttribute(c,u)};let l,i,s,h;switch(r("rightToLeft","1",t.rightToLeft===!0),r("tabSelected","1",t.tabSelected),r("showRuler","0",t.showRuler===!1),r("showRowColHeaders","0",t.showRowColHeaders===!1),r("showGridLines","0",t.showGridLines===!1),r("zoomScale",t.zoomScale,t.zoomScale),r("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),r("view",t.style,t.style),t.state){case"frozen":i=t.xSplit||0,s=t.ySplit||0,l=t.topLeftCell||d.getAddress(s+1,i+1).address,h=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",n.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:h,state:"frozen"}),n.leafNode("selection",{pane:h,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),n.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),n.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&n.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}n.closeNode()}parseOpen(n){switch(n.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(n.attributes.workbookViewId,10),rightToLeft:n.attributes.rightToLeft==="1",tabSelected:n.attributes.tabSelected==="1",showRuler:n.attributes.showRuler!=="0",showRowColHeaders:n.attributes.showRowColHeaders!=="0",showGridLines:n.attributes.showGridLines!=="0",zoomScale:parseInt(n.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(n.attributes.zoomScaleNormal||"100",10),style:n.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(n.attributes.xSplit||"0",10),ySplit:parseInt(n.attributes.ySplit||"0",10),topLeftCell:n.attributes.topLeftCell,activePane:n.attributes.activePane||"topLeft",state:n.attributes.state},!0;case"selection":{const t=n.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:n.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(n){let t,r;switch(n){case"sheetView":return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(t.activePane=this.pane.activePane),r=this.selections[this.pane.activePane],r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},r=this.selections.topLeft,r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"tablePart"}render(o,a){a&&o.leafNode(this.tag,{"r:id":a.rId})}parseOpen(o){switch(o.name){case this.tag:return this.model={rId:o.attributes["r:id"]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),n=e("../../rel-type"),t=e("./merges"),r=e("../base-xform"),l=e("../list-xform"),i=e("./row-xform"),s=e("./col-xform"),h=e("./dimension-xform"),c=e("./hyperlink-xform"),u=e("./merge-cell-xform"),p=e("./data-validations-xform"),f=e("./sheet-properties-xform"),w=e("./sheet-format-properties-xform"),x=e("./sheet-view-xform"),A=e("./sheet-protection-xform"),N=e("./page-margins-xform"),L=e("./page-setup-xform"),j=e("./print-options-xform"),F=e("./auto-filter-xform"),P=e("./picture-xform"),U=e("./drawing-xform"),B=e("./table-part-xform"),k=e("./row-breaks-xform"),T=e("./header-footer-xform"),v=e("./cf/conditional-formattings-xform"),m=e("./ext-lst-xform"),b=(y,C)=>{if(!C||!C.length)return y;if(!y||!y.length)return C;const R={},I={};return y.forEach(z=>{R[z.ref]=z,z.rules.forEach(H=>{const{x14Id:q}=H;q&&(I[q]=H)})}),C.forEach(z=>{z.rules.forEach(H=>{const q=I[H.x14Id];q?((O,$)=>{Object.keys($).forEach(E=>{const M=O[E],D=$[E];M===void 0&&D!==void 0&&(O[E]=D)})})(q,H):R[z.ref]?R[z.ref].rules.push(H):y.push({ref:z.ref,rules:[H]})})}),y};class g extends r{constructor(C){super();const{maxRows:R,maxCols:I,ignoreNodes:z}=C||{};this.ignoreNodes=z||[],this.map={sheetPr:new f,dimension:new h,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new x}),sheetFormatPr:new w,cols:new l({tag:"cols",count:!1,childXform:new s}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new i({maxItems:I}),maxItems:R}),autoFilter:new F,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new k,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new c}),pageMargins:new N,dataValidations:new p,pageSetup:new L,headerFooter:new T,printOptions:new j,picture:new P,drawing:new U,sheetProtection:new A,tableParts:new l({tag:"tableParts",count:!0,childXform:new B}),conditionalFormatting:new v,extLst:new m}}prepare(C,R){R.merges=new t,C.hyperlinks=R.hyperlinks=[],C.comments=R.comments=[],R.formulae={},R.siFormulae=0,this.map.cols.prepare(C.cols,R),this.map.sheetData.prepare(C.rows,R),this.map.conditionalFormatting.prepare(C.conditionalFormattings,R),C.mergeCells=R.merges.mergeCells;const I=C.rels=[];function z(O){return"rId"+(O.length+1)}if(C.hyperlinks.forEach(O=>{const $=z(I);O.rId=$,I.push({Id:$,Type:n.Hyperlink,Target:O.target,TargetMode:"External"})}),C.comments.length>0){const O={Id:z(I),Type:n.Comments,Target:`../comments${C.id}.xml`};I.push(O);const $={Id:z(I),Type:n.VmlDrawing,Target:`../drawings/vmlDrawing${C.id}.vml`};I.push($),C.comments.forEach(E=>{E.refAddress=o.decodeAddress(E.ref)}),R.commentRefs.push({commentName:"comments"+C.id,vmlDrawing:"vmlDrawing"+C.id})}const H=[];let q;C.media.forEach(O=>{if(O.type==="background"){const $=z(I);q=R.media[O.imageId],I.push({Id:$,Type:n.Image,Target:`../media/${q.name}.${q.extension}`}),C.background={rId:$},C.image=R.media[O.imageId]}else if(O.type==="image"){let{drawing:$}=C;q=R.media[O.imageId],$||($=C.drawing={rId:z(I),name:"drawing"+ ++R.drawingsCount,anchors:[],rels:[]},R.drawings.push($),I.push({Id:$.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${$.name}.xml`}));let E=this.preImageId===O.imageId?H[O.imageId]:H[$.rels.length];E||(E=z($.rels),H[$.rels.length]=E,$.rels.push({Id:E,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${q.name}.${q.extension}`}));const M={picture:{rId:E},range:O.range};if(O.hyperlinks&&O.hyperlinks.hyperlink){const D=z($.rels);H[$.rels.length]=D,M.picture.hyperlinks={tooltip:O.hyperlinks.tooltip,rId:D},$.rels.push({Id:D,Type:n.Hyperlink,Target:O.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=O.imageId,$.anchors.push(M)}}),C.tables.forEach(O=>{const $=z(I);O.rId=$,I.push({Id:$,Type:n.Table,Target:"../tables/"+O.target}),O.columns.forEach(E=>{const{style:M}=E;M&&(E.dxfId=R.styles.addDxfStyle(M))})}),this.map.extLst.prepare(C,R)}render(C,R){C.openXml(a.StdDocAttributes),C.openNode("worksheet",g.WORKSHEET_ATTRIBUTES);const I=R.properties?{defaultRowHeight:R.properties.defaultRowHeight,dyDescent:R.properties.dyDescent,outlineLevelCol:R.properties.outlineLevelCol,outlineLevelRow:R.properties.outlineLevelRow}:void 0;R.properties&&R.properties.defaultColWidth&&(I.defaultColWidth=R.properties.defaultColWidth);const z={outlineProperties:R.properties&&R.properties.outlineProperties,tabColor:R.properties&&R.properties.tabColor,pageSetup:R.pageSetup&&R.pageSetup.fitToPage?{fitToPage:R.pageSetup.fitToPage}:void 0},H=R.pageSetup&&R.pageSetup.margins,q={showRowColHeaders:R.pageSetup&&R.pageSetup.showRowColHeaders,showGridLines:R.pageSetup&&R.pageSetup.showGridLines,horizontalCentered:R.pageSetup&&R.pageSetup.horizontalCentered,verticalCentered:R.pageSetup&&R.pageSetup.verticalCentered},O=R.sheetProtection;this.map.sheetPr.render(C,z),this.map.dimension.render(C,R.dimensions),this.map.sheetViews.render(C,R.views),this.map.sheetFormatPr.render(C,I),this.map.cols.render(C,R.cols),this.map.sheetData.render(C,R.rows),this.map.sheetProtection.render(C,O),this.map.autoFilter.render(C,R.autoFilter),this.map.mergeCells.render(C,R.mergeCells),this.map.conditionalFormatting.render(C,R.conditionalFormattings),this.map.dataValidations.render(C,R.dataValidations),this.map.hyperlinks.render(C,R.hyperlinks),this.map.printOptions.render(C,q),this.map.pageMargins.render(C,H),this.map.pageSetup.render(C,R.pageSetup),this.map.headerFooter.render(C,R.headerFooter),this.map.rowBreaks.render(C,R.rowBreaks),this.map.drawing.render(C,R.drawing),this.map.picture.render(C,R.background),this.map.tableParts.render(C,R.tables),this.map.extLst.render(C,R),R.rels&&R.rels.forEach($=>{$.Type===n.VmlDrawing&&C.leafNode("legacyDrawing",{"r:id":$.Id})}),C.closeNode()}parseOpen(C){return this.parser?(this.parser.parseOpen(C),!0):C.name==="worksheet"?(d.each(this.map,R=>{R.reset()}),!0):(this.map[C.name]&&!this.ignoreNodes.includes(C.name)&&(this.parser=this.map[C.name],this.parser.parseOpen(C)),!0)}parseText(C){this.parser&&this.parser.parseText(C)}parseClose(C){if(this.parser)return this.parser.parseClose(C)||(this.parser=void 0),!0;switch(C){case"worksheet":{const R=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(R.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(R.outlineProperties=this.map.sheetPr.model.outlineProperties);const I={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},z=Object.assign(I,this.map.pageSetup.model,this.map.printOptions.model),H=b(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:R,views:this.map.sheetViews.model,pageSetup:z,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:H},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(C,R){const I=(C.relationships||[]).reduce((H,q)=>{if(H[q.Id]=q,q.Type===n.Comments&&(C.comments=R.comments[q.Target].comments),q.Type===n.VmlDrawing&&C.comments&&C.comments.length){const O=R.vmlDrawings[q.Target].comments;C.comments.forEach(($,E)=>{$.note=Object.assign({},$.note,O[E])})}return H},{});if(R.commentsMap=(C.comments||[]).reduce((H,q)=>(q.ref&&(H[q.ref]=q),H),{}),R.hyperlinkMap=(C.hyperlinks||[]).reduce((H,q)=>(q.rId&&(H[q.address]=I[q.rId].Target),H),{}),R.formulae={},C.rows=C.rows&&C.rows.filter(Boolean)||[],C.rows.forEach(H=>{H.cells=H.cells&&H.cells.filter(Boolean)||[]}),this.map.cols.reconcile(C.cols,R),this.map.sheetData.reconcile(C.rows,R),this.map.conditionalFormatting.reconcile(C.conditionalFormattings,R),C.media=[],C.drawing){const H=I[C.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(H){const q=H[1];R.drawings[q].anchors.forEach(O=>{if(O.medium){const $={type:"image",imageId:O.medium.index,range:O.range,hyperlinks:O.picture.hyperlinks};C.media.push($)}})}}const z=C.background&&I[C.background.rId];if(z){const H=z.Target.split("/media/")[1],q=R.mediaIndex&&R.mediaIndex[H];q!==void 0&&C.media.push({type:"background",imageId:q})}C.tables=(C.tables||[]).map(H=>{const q=I[H.rId];return R.tables[q.Target]}),delete C.relationships,delete C.hyperlinks,delete C.comments}}g.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},S.exports=g},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,a){a&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch{return""}},this._parse=o.parse||function(a){return new Date(a)}}render(o,a){a&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(a)):o.writeText(this._format(a)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,a){(a||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,a){a!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,a):o.writeText(a),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(e,S,_){const d=e("./base-xform"),o=e("../../utils/xml-stream");S.exports=class extends d{constructor(a){super(),this._model=a}render(a){if(!this._xml){const n=new o;(function t(r,l){r.openNode(l.tag,l.$),l.c&&l.c.forEach(i=>{t(r,i)}),l.t&&r.writeText(l.t),r.closeNode()})(n,this._model),this._xml=n.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){switch(a){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,S,_){const d=e("./text-xform"),o=e("./rich-text-xform"),a=e("../base-xform");S.exports=class extends a{constructor(){super(),this.map={r:new o,t:new d}}get tag(){return"rPh"}render(n,t){if(n.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r}=this.map;t.richText.forEach(l=>{r.render(n,l)})}else t&&this.map.t.render(n,t.text);n.closeNode()}parseOpen(n){const{name:t}=n;return this.parser?(this.parser.parseOpen(n),!0):t===this.tag?(this.model={sb:parseInt(n.attributes.sb,10),eb:parseInt(n.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(n),!0))}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser){if(!this.parser.parseClose(n)){switch(n){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}switch(n){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,S,_){const d=e("./text-xform"),o=e("../style/font-xform"),a=e("../base-xform");class n extends a{constructor(r){super(),this.model=r}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new d)}get fontXform(){return this._fontXform||(this._fontXform=new o(n.FONT_OPTIONS))}render(r,l){l=l||this.model,r.openNode("r"),l.font&&this.fontXform.render(r,l.font),this.textXform.render(r,l.text),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(r),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){switch(r){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(r),!0}}}n.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},S.exports=n},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,S,_){const d=e("./text-xform"),o=e("./rich-text-xform"),a=e("./phonetic-text-xform"),n=e("../base-xform");S.exports=class extends n{constructor(t){super(),this.model=t,this.map={r:new o,t:new d,rPh:new a}}get tag(){return"si"}render(t,r){t.openNode(this.tag),r&&r.hasOwnProperty("richText")&&r.richText?r.richText.length?r.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):r!=null&&this.map.t.render(t,r),t.closeNode()}parseOpen(t){const{name:r}=t;return this.parser?(this.parser.parseOpen(t),!0):r===this.tag?(this.model={},!0):(this.parser=this.map[r],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let r=this.model.richText;r||(r=this.model.richText=[]),r.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}switch(t){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("./shared-string-xform");S.exports=class extends o{constructor(n){super(),this.model=n||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(n){return this.model.values[n]}add(n){return n.richText?this.addRichText(n):this.addText(n)}addText(n){let t=this.hash[n];return t===void 0&&(t=this.hash[n]=this.model.values.length,this.model.values.push(n)),this.model.count++,t}addRichText(n){const t=this.sharedStringXform.toXml(n);let r=this.rich[t];return r===void 0&&(r=this.rich[t]=this.model.values.length,this.model.values.push(n)),this.model.count++,r}render(n,t){t=t||this._values,n.openXml(d.StdDocAttributes),n.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const r=this.sharedStringXform;t.values.forEach(l=>{r.render(n,l)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(n),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(n){case"sst":return!1;default:throw new Error("Unexpected xml node in parseClose: "+n)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"t"}render(o,a){o.openNode("t"),/^\s|\n|\s$/.test(a)&&o.addAttribute("xml:space","preserve"),o.writeText(a),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(o){switch(o.name){case"t":return this._text=[],!0;default:return!1}}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,S,_){const d=e("../../../doc/enums"),o=e("../../../utils/utils"),a=e("../base-xform"),n={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((r,l)=>(r[l]=!0,r),{}),horizontal(r){return this.horizontalValues[r]?r:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((r,l)=>(r[l]=!0,r),{}),vertical(r){return r==="middle"?"center":this.verticalValues[r]?r:void 0},wrapText:r=>!!r||void 0,shrinkToFit:r=>!!r||void 0,textRotation(r){switch(r){case"vertical":return r;default:return(r=o.validInt(r))>=-90&&r<=90?r:void 0}},indent:r=>(r=o.validInt(r),Math.max(0,r)),readingOrder(r){switch(r){case"ltr":return d.ReadingOrder.LeftToRight;case"rtl":return d.ReadingOrder.RightToLeft;default:return}}},t={toXml(r){if(r=n.textRotation(r)){if(r==="vertical")return 255;const l=Math.round(r);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(r){const l=o.validInt(r);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};S.exports=class extends a{get tag(){return"alignment"}render(r,l){r.addRollback(),r.openNode("alignment");let i=!1;function s(h,c){c&&(r.addAttribute(h,c),i=!0)}s("horizontal",n.horizontal(l.horizontal)),s("vertical",n.vertical(l.vertical)),s("wrapText",!!n.wrapText(l.wrapText)&&"1"),s("shrinkToFit",!!n.shrinkToFit(l.shrinkToFit)&&"1"),s("indent",n.indent(l.indent)),s("textRotation",t.toXml(l.textRotation)),s("readingOrder",n.readingOrder(l.readingOrder)),r.closeNode(),i?r.commit():r.rollback()}parseOpen(r){const l={};let i=!1;function s(h,c,u){h&&(l[c]=u,i=!0)}s(r.attributes.horizontal,"horizontal",r.attributes.horizontal),s(r.attributes.vertical,"vertical",r.attributes.vertical==="center"?"middle":r.attributes.vertical),s(r.attributes.wrapText,"wrapText",o.parseBoolean(r.attributes.wrapText)),s(r.attributes.shrinkToFit,"shrinkToFit",o.parseBoolean(r.attributes.shrinkToFit)),s(r.attributes.indent,"indent",parseInt(r.attributes.indent,10)),s(r.attributes.textRotation,"textRotation",t.toModel(r.attributes.textRotation)),s(r.attributes.readingOrder,"readingOrder",r.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=i?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,S,_){const d=e("../base-xform"),o=e("../../../utils/utils"),a=e("./color-xform");class n extends d{constructor(r){super(),this.name=r,this.map={color:new a}}get tag(){return this.name}render(r,l,i){const s=l&&l.color||i||this.defaultColor;r.openNode(this.name),l&&l.style&&(r.addAttribute("style",l.style),s&&this.map.color.render(r,s)),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case this.name:{const{style:l}=r.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):(r===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(r){return n.validStyleValues[r]}}n.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,r)=>(t[r]=!0,t),{}),S.exports=class extends d{constructor(){super(),this.map={top:new n("top"),left:new n("left"),bottom:new n("bottom"),right:new n("right"),diagonal:new n("diagonal")}}render(t,r){const{color:l}=r;function i(s,h){s&&!s.color&&r.color&&(s={...s,color:r.color}),h.render(t,s,l)}t.openNode("border"),r.diagonal&&r.diagonal.style&&(r.diagonal.up&&t.addAttribute("diagonalUp","1"),r.diagonal.down&&t.addAttribute("diagonalDown","1")),i(r.left,this.map.left),i(r.right,this.map.right),i(r.top,this.map.top),i(r.bottom,this.map.bottom),i(r.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"border":return this.reset(),this.diagonalUp=o.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=o.parseBoolean(t.attributes.diagonalDown),!0;default:return this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0)}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if(t==="border"){const r=this.model={},l=function(i,s,h){s&&(h&&Object.assign(s,h),r[i]=s)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,a){return!!a&&(o.openNode(this.name),a.argb?o.addAttribute("rgb",a.argb):a.theme!==void 0?(o.addAttribute("theme",a.theme),a.tint!==void 0&&o.addAttribute("tint",a.tint)):a.indexed!==void 0?o.addAttribute("indexed",a.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,S,_){const d=e("../base-xform"),o=e("./alignment-xform"),a=e("./border-xform"),n=e("./fill-xform"),t=e("./font-xform"),r=e("./numfmt-xform"),l=e("./protection-xform");S.exports=class extends d{constructor(){super(),this.map={alignment:new o,border:new a,fill:new n,font:new t,numFmt:new r,protection:new l}}get tag(){return"dxf"}render(i,s){if(i.openNode(this.tag),s.font&&this.map.font.render(i,s.font),s.numFmt&&s.numFmtId){const h={id:s.numFmtId,formatCode:s.numFmt};this.map.numFmt.render(i,h)}s.fill&&this.map.fill.render(i,s.fill),s.alignment&&this.map.alignment.render(i,s.alignment),s.border&&this.map.border.render(i,s.border),s.protection&&this.map.protection.render(i,s.protection),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i),!0}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return this.parser?(this.parser.parseClose(i)||(this.parser=void 0),!0):i!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,S,_){const d=e("../base-xform"),o=e("./color-xform");class a extends d{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(i,s){i.openNode("stop"),i.addAttribute("position",s.position),this.map.color.render(i,s.color),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"stop":return this.model={position:parseFloat(i.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(i),!0;default:return!1}}parseText(){}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class n extends d{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(i,s){i.openNode("patternFill"),i.addAttribute("patternType",s.pattern),s.fgColor&&this.map.fgColor.render(i,s.fgColor),s.bgColor&&this.map.bgColor.render(i,s.bgColor),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"patternFill":return this.model={type:"pattern",pattern:i.attributes.patternType},!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.parser.model&&(this.model[i]=this.parser.model),this.parser=void 0),!0)}}class t extends d{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(i,s){switch(i.openNode("gradientFill"),s.gradient){case"angle":i.addAttribute("degree",s.degree);break;case"path":i.addAttribute("type","path"),s.center.left&&(i.addAttribute("left",s.center.left),s.center.right===void 0&&i.addAttribute("right",s.center.left)),s.center.right&&i.addAttribute("right",s.center.right),s.center.top&&(i.addAttribute("top",s.center.top),s.center.bottom===void 0&&i.addAttribute("bottom",s.center.top)),s.center.bottom&&i.addAttribute("bottom",s.center.bottom)}const h=this.map.stop;s.stops.forEach(c=>{h.render(i,c)}),i.closeNode()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"gradientFill":{const s=this.model={stops:[]};return i.attributes.degree?(s.gradient="angle",s.degree=parseInt(i.attributes.degree,10)):i.attributes.type==="path"&&(s.gradient="path",s.center={left:i.attributes.left?parseFloat(i.attributes.left):0,top:i.attributes.top?parseFloat(i.attributes.top):0},i.attributes.right!==i.attributes.left&&(s.center.right=i.attributes.right?parseFloat(i.attributes.right):0),i.attributes.bottom!==i.attributes.top&&(s.center.bottom=i.attributes.bottom?parseFloat(i.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(i),!0;default:return!1}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class r extends d{constructor(){super(),this.map={patternFill:new n,gradientFill:new t}}get tag(){return"fill"}render(i,s){switch(i.addRollback(),i.openNode("fill"),s.type){case"pattern":this.map.patternFill.render(i,s);break;case"gradient":this.map.gradientFill.render(i,s);break;default:return void i.rollback()}i.closeNode(),i.commit()}parseOpen(i){if(this.parser)return this.parser.parseOpen(i),!0;switch(i.name){case"fill":return this.model={},!0;default:return this.parser=this.map[i.name],!!this.parser&&(this.parser.parseOpen(i),!0)}}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){return!!this.parser&&(this.parser.parseClose(i)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(i){return r.validPatternValues[i]}}r.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,i)=>(l[i]=!0,l),{}),r.StopXform=a,r.PatternFillXform=n,r.GradientFillXform=t,S.exports=r},{"../base-xform":32,"./color-xform":128}],131:[function(e,S,_){const d=e("./color-xform"),o=e("../simple/boolean-xform"),a=e("../simple/integer-xform"),n=e("../simple/string-xform"),t=e("./underline-xform"),r=e("../../../utils/under-dash"),l=e("../base-xform");class i extends l{constructor(h){super(),this.options=h||i.OPTIONS,this.map={b:{prop:"bold",xform:new o({tag:"b",attr:"val"})},i:{prop:"italic",xform:new o({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new d},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new n({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new n({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new o({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new o({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new n({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(h,c){const{map:u}=this;h.openNode(this.options.tagName),r.each(this.map,(p,f)=>{u[f].xform.render(h,c[p.prop])}),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;if(this.map[h.name])return this.parser=this.map[h.name].xform,this.parser.parseOpen(h);switch(h.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser&&!this.parser.parseClose(h)){const c=this.map[h];return this.parser.model&&(this.model[c.prop]=this.parser.model),this.parser=void 0,!0}switch(h){case this.options.tagName:return!1;default:return!0}}}i.OPTIONS={tagName:"font",fontNameTag:"name"},S.exports=i},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,S,_){const d=e("../../../utils/under-dash"),o=e("../../defaultnumformats"),a=e("../base-xform"),n=function(){const r={};return d.each(o,(l,i)=>{l.f&&(r[l.f]=parseInt(i,10))}),r}();class t extends a{constructor(l,i){super(),this.id=l,this.formatCode=i}get tag(){return"numFmt"}render(l,i){l.leafNode("numFmt",{numFmtId:i.id,formatCode:i.formatCode})}parseOpen(l){switch(l.name){case"numFmt":return this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0;default:return!1}}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(r){return n[r]},t.getDefaultFmtCode=function(r){return o[r]&&o[r].f},S.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,S,_){const d=e("../base-xform"),o={boolean:(a,n)=>a===void 0?n:a};S.exports=class extends d{get tag(){return"protection"}render(a,n){a.addRollback(),a.openNode("protection");let t=!1;function r(l,i){i!==void 0&&(a.addAttribute(l,i),t=!0)}r("locked",o.boolean(n.locked,!0)?void 0:"0"),r("hidden",o.boolean(n.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){const n={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!n.locked||n.hidden;this.model=t?n:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,S,_){const d=e("../base-xform"),o=e("./alignment-xform"),a=e("./protection-xform");S.exports=class extends d{constructor(n){super(),this.xfId=!(!n||!n.xfId),this.map={alignment:new o,protection:new a}}get tag(){return"xf"}render(n,t){n.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&n.addAttribute("xfId",t.xfId||0),t.numFmtId&&n.addAttribute("applyNumberFormat","1"),t.fontId&&n.addAttribute("applyFont","1"),t.fillId&&n.addAttribute("applyFill","1"),t.borderId&&n.addAttribute("applyBorder","1"),t.alignment&&n.addAttribute("applyAlignment","1"),t.protection&&n.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(n,t.alignment),t.protection&&this.map.protection.render(n,t.protection),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"xf":return this.model={numFmtId:parseInt(n.attributes.numFmtId,10),fontId:parseInt(n.attributes.fontId,10),fillId:parseInt(n.attributes.fillId,10),borderId:parseInt(n.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(n.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(n),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):n!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,S,_){const d=e("../../../doc/enums"),o=e("../../../utils/xml-stream"),a=e("../base-xform"),n=e("../static-xform"),t=e("../list-xform"),r=e("./font-xform"),l=e("./fill-xform"),i=e("./border-xform"),s=e("./numfmt-xform"),h=e("./style-xform"),c=e("./dxf-xform");class u extends a{constructor(f){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new s}),fonts:new t({tag:"fonts",count:!0,childXform:new r,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new i}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new h}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new h({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new c}),numFmt:new s,font:new r,fill:new l,border:new i,style:new h({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},f&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(f,w){w=w||this.model,f.openXml(o.StdDocAttributes),f.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(w.numFmts&&w.numFmts.length&&(f.openNode("numFmts",{count:w.numFmts.length}),w.numFmts.forEach(x=>{f.writeXml(x)}),f.closeNode()),w.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),f.openNode("fonts",{count:w.fonts.length,"x14ac:knownFonts":1}),w.fonts.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("fills",{count:w.fills.length}),w.fills.forEach(x=>{f.writeXml(x)}),f.closeNode(),f.openNode("borders",{count:w.borders.length}),w.borders.forEach(x=>{f.writeXml(x)}),f.closeNode(),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),f.openNode("cellXfs",{count:w.styles.length}),w.styles.forEach(x=>{f.writeXml(x)}),f.closeNode()):(this.map.numFmts.render(f,w.numFmts),this.map.fonts.render(f,w.fonts),this.map.fills.render(f,w.fills),this.map.borders.render(f,w.borders),this.map.cellStyleXfs.render(f,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(f,w.styles)),u.STATIC_XFORMS.cellStyles.render(f),this.map.dxfs.render(f,w.dxfs),u.STATIC_XFORMS.tableStyles.render(f),u.STATIC_XFORMS.extLst.render(f),f.closeNode()}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"styleSheet":return this.initIndex(),!0;default:return this.parser=this.map[f.name],this.parser&&this.parser.parseOpen(f),!0}}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser)return this.parser.parseClose(f)||(this.parser=void 0),!0;switch(f){case"styleSheet":{this.model={};const w=(x,A)=>{A.model&&A.model.length&&(this.model[x]=A.model)};if(w("numFmts",this.map.numFmts),w("fonts",this.map.fonts),w("fills",this.map.fills),w("borders",this.map.borders),w("styles",this.map.cellXfs),w("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const x=this.index.numFmt;this.model.numFmts.forEach(A=>{x[A.id]=A.formatCode})}return!1}default:return!0}}addStyleModel(f,w){if(!f)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(f))return this.weakMap.get(f);const x={};if(w=w||d.ValueType.Number,f.numFmt)x.numFmtId=this._addNumFmtStr(f.numFmt);else switch(w){case d.ValueType.Number:x.numFmtId=this._addNumFmtStr("General");break;case d.ValueType.Date:x.numFmtId=this._addNumFmtStr("mm-dd-yy")}f.font&&(x.fontId=this._addFont(f.font)),f.border&&(x.borderId=this._addBorder(f.border)),f.fill&&(x.fillId=this._addFill(f.fill)),f.alignment&&(x.alignment=f.alignment),f.protection&&(x.protection=f.protection);const A=this._addStyle(x);return this.weakMap&&this.weakMap.set(f,A),A}getStyleModel(f){const w=this.model.styles[f];if(!w)return null;let x=this.index.model[f];if(x)return x;if(x=this.index.model[f]={},w.numFmtId){const N=this.index.numFmt[w.numFmtId]||s.getDefaultFmtCode(w.numFmtId);N&&(x.numFmt=N)}function A(N,L,j){if(j||j===0){const F=L[j];F&&(x[N]=F)}}return A("font",this.model.fonts,w.fontId),A("border",this.model.borders,w.borderId),A("fill",this.model.fills,w.fillId),w.alignment&&(x.alignment=w.alignment),w.protection&&(x.protection=w.protection),x}addDxfStyle(f){return f.numFmt&&(f.numFmtId=this._addNumFmtStr(f.numFmt)),this.model.dxfs.push(f),this.model.dxfs.length-1}getDxfStyle(f){return this.model.dxfs[f]}_addStyle(f){const w=this.map.style.toXml(f);let x=this.index.style[w];return x===void 0&&(x=this.index.style[w]=this.model.styles.length,this.model.styles.push(w)),x}_addNumFmtStr(f){let w=s.getDefaultFmtId(f);if(w!==void 0||(w=this.index.numFmt[f],w!==void 0))return w;w=this.index.numFmt[f]=164+this.model.numFmts.length;const x=this.map.numFmt.toXml({id:w,formatCode:f});return this.model.numFmts.push(x),w}_addFont(f){const w=this.map.font.toXml(f);let x=this.index.font[w];return x===void 0&&(x=this.index.font[w]=this.model.fonts.length,this.model.fonts.push(w)),x}_addBorder(f){const w=this.map.border.toXml(f);let x=this.index.border[w];return x===void 0&&(x=this.index.border[w]=this.model.borders.length,this.model.borders.push(w)),x}_addFill(f){const w=this.map.fill.toXml(f);let x=this.index.fill[w];return x===void 0&&(x=this.index.fill[w]=this.model.fills.length,this.model.fills.push(w)),x}}u.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},u.STATIC_XFORMS={cellStyles:new n({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new n({tag:"dxfs",$:{count:0}}),tableStyles:new n({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new n({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},u.Mock=class extends u{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(p){return p.autodrain(),Promise.resolve()}addStyleModel(p,f){switch(f){case d.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){const p={numFmtId:s.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(p)}return this._dateStyleId}getStyleModel(){return{}}},S.exports=u},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,S,_){const d=e("../base-xform");class o extends d{constructor(n){super(),this.model=n}get tag(){return"u"}render(n,t){if((t=t||this.model)===!0)n.leafNode("u");else{const r=o.Attributes[t];r&&n.leafNode("u",r)}}parseOpen(n){n.name==="u"&&(this.model=n.attributes.val||!0)}parseText(){}parseClose(){return!1}}o.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},S.exports=o},{"../base-xform":32}],137:[function(e,S,_){const d=e("../base-xform"),o=e("./filter-column-xform");S.exports=class extends d{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((n,t)=>{this.map.filterColumn.prepare(n,{index:t})})}render(a,n){return a.openNode(this.tag,{ref:n.autoFilterRef}),n.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.parseOpen(a),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(a))}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(a){case this.tag:return!1;default:throw new Error("Unexpected xml node in parseClose: "+a)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"customFilter"}render(o,a){o.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,S,_){const d=e("../base-xform"),o=e("../list-xform"),a=e("./custom-filter-xform"),n=e("./filter-xform");S.exports=class extends d{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new n})}}get tag(){return"filterColumn"}prepare(t,r){t.colId=r.index.toString()}render(t,r){return r.customFilters?(t.openNode(this.tag,{colId:r.colId,hiddenButton:r.filterButton?"0":"1"}),this.map.customFilters.render(t,r.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:r.colId,hiddenButton:r.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:r}=t;switch(t.name){case this.tag:return this.model={filterButton:r.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"filter"}render(o,a){o.leafNode(this.tag,{val:a.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"tableColumn"}prepare(o,a){o.id=a.index+1}render(o,a){return o.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,S,_){const d=e("../base-xform");S.exports=class extends d{get tag(){return"tableStyleInfo"}render(o,a){return o.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:a}=o;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,S,_){const d=e("../../../utils/xml-stream"),o=e("../base-xform"),a=e("../list-xform"),n=e("./auto-filter-xform"),t=e("./table-column-xform"),r=e("./table-style-info-xform");class l extends o{constructor(){super(),this.map={autoFilter:new n,tableColumns:new a({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new r}}prepare(s,h){this.map.autoFilter.prepare(s),this.map.tableColumns.prepare(s.columns,h)}get tag(){return"table"}render(s,h){s.openXml(d.StdDocAttributes),s.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:h.id,name:h.name,displayName:h.displayName||h.name,ref:h.tableRef,totalsRowCount:h.totalsRow?"1":void 0,totalsRowShown:h.totalsRow?void 0:"1",headerRowCount:h.headerRow?"1":"0"}),this.map.autoFilter.render(s,h),this.map.tableColumns.render(s,h.columns),this.map.tableStyleInfo.render(s,h.style),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;const{name:h,attributes:c}=s;switch(h){case this.tag:this.reset(),this.model={name:c.name,displayName:c.displayName||c.name,tableRef:c.ref,totalsRow:c.totalsRowCount==="1",headerRow:c.headerRowCount==="1"};break;default:this.parser=this.map[s.name],this.parser&&this.parser.parseOpen(s)}return!0}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser)return this.parser.parseClose(s)||(this.parser=void 0),!0;switch(s){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((h,c)=>{this.model.columns[c].filterButton=h.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(s,h){s.columns.forEach(c=>{c.dxfId!==void 0&&(c.style=h.styles.getDxfStyle(c.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},S.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,S,_){(function(d,o){(function(){const a=e("fs"),n=e("jszip"),{PassThrough:t}=e("readable-stream"),r=e("../utils/zip-stream"),l=e("../utils/stream-buf"),i=e("../utils/utils"),s=e("../utils/xml-stream"),{bufferToString:h}=e("../utils/browser-buffer-decode"),c=e("./xform/style/styles-xform"),u=e("./xform/core/core-xform"),p=e("./xform/strings/shared-strings-xform"),f=e("./xform/core/relationships-xform"),w=e("./xform/core/content-types-xform"),x=e("./xform/core/app-xform"),A=e("./xform/book/workbook-xform"),N=e("./xform/sheet/worksheet-xform"),L=e("./xform/drawing/drawing-xform"),j=e("./xform/table/table-xform"),F=e("./xform/comment/comments-xform"),P=e("./xform/comment/vml-notes-xform"),U=e("./xml/theme1");class B{constructor(T){this.workbook=T}async readFile(T,v){if(!await i.fs.exists(T))throw new Error("File not found: "+T);const m=a.createReadStream(T);try{const b=await this.read(m,v);return m.close(),b}catch(b){throw m.close(),b}}parseRels(T){return new f().parseStream(T)}parseWorkbook(T){return new A().parseStream(T)}parseSharedStrings(T){return new p().parseStream(T)}reconcile(T,v){const m=new A,b=new N(v),g=new L,y=new j;m.reconcile(T);const C={media:T.media,mediaIndex:T.mediaIndex};Object.keys(T.drawings).forEach(z=>{const H=T.drawings[z],q=T.drawingRels[z];q&&(C.rels=q.reduce((O,$)=>(O[$.Id]=$,O),{}),(H.anchors||[]).forEach(O=>{const $=O.picture&&O.picture.hyperlinks;$&&C.rels[$.rId]&&($.hyperlink=C.rels[$.rId].Target,delete $.rId)}),g.reconcile(H,C))});const R={styles:T.styles};Object.values(T.tables).forEach(z=>{y.reconcile(z,R)});const I={styles:T.styles,sharedStrings:T.sharedStrings,media:T.media,mediaIndex:T.mediaIndex,date1904:T.properties&&T.properties.date1904,drawings:T.drawings,comments:T.comments,tables:T.tables,vmlDrawings:T.vmlDrawings};T.worksheets.forEach(z=>{z.relationships=T.worksheetRels[z.sheetNo],b.reconcile(z,I)}),delete T.worksheetHash,delete T.worksheetRels,delete T.globalRels,delete T.sharedStrings,delete T.workbookRels,delete T.sheetDefs,delete T.styles,delete T.mediaIndex,delete T.drawings,delete T.drawingRels,delete T.vmlDrawings}async _processWorksheetEntry(T,v,m,b,g){const y=new N(b),C=await y.parseStream(T);C.sheetNo=m,v.worksheetHash[g]=C,v.worksheets.push(C)}async _processCommentEntry(T,v,m){const b=new F,g=await b.parseStream(T);v.comments[`../${m}.xml`]=g}async _processTableEntry(T,v,m){const b=new j,g=await b.parseStream(T);v.tables[`../tables/${m}.xml`]=g}async _processWorksheetRelsEntry(T,v,m){const b=new f,g=await b.parseStream(T);v.worksheetRels[m]=g}async _processMediaEntry(T,v,m){const b=m.lastIndexOf(".");if(b>=1){const g=m.substr(b+1),y=m.substr(0,b);await new Promise((C,R)=>{const I=new l;I.on("finish",()=>{v.mediaIndex[m]=v.media.length,v.mediaIndex[y]=v.media.length;const z={type:"image",name:y,extension:g,buffer:I.toBuffer()};v.media.push(z),C()}),T.on("error",z=>{R(z)}),T.pipe(I)})}}async _processDrawingEntry(T,v,m){const b=new L,g=await b.parseStream(T);v.drawings[m]=g}async _processDrawingRelsEntry(T,v,m){const b=new f,g=await b.parseStream(T);v.drawingRels[m]=g}async _processVmlDrawingEntry(T,v,m){const b=new P,g=await b.parseStream(T);v.vmlDrawings[`../drawings/${m}.vml`]=g}async _processThemeEntry(T,v,m){await new Promise((b,g)=>{const y=new l;T.on("error",g),y.on("error",g),y.on("finish",()=>{v.themes[m]=y.read().toString(),b()}),T.pipe(y)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(T,v){!T[Symbol.asyncIterator]&&T.pipe&&(T=T.pipe(new t));const m=[];for await(const b of T)m.push(b);return this.load(o.concat(m),v)}async load(T,v){let m;m=v&&v.base64?o.from(T.toString(),"base64"):T;const b={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},g=await n.loadAsync(m);for(const y of Object.values(g.files))if(!y.dir){let C,R=y.name;if(R[0]==="/"&&(R=R.substr(1)),R.match(/xl\/media\//)||R.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))C=new t,C.write(await y.async("nodebuffer"));else{let I;C=new t({writableObjectMode:!0,readableObjectMode:!0}),I=d.browser?h(await y.async("nodebuffer")):await y.async("string");const z=16384;for(let H=0;H{if(m.type==="image"){const b=`xl/media/${m.name}.${m.extension}`;if(m.filename){const g=await function(y,C){return new Promise((R,I)=>{a.readFile(y,C,(z,H)=>{z?I(z):R(H)})})}(m.filename);return T.append(g,{name:b})}if(m.buffer)return T.append(m.buffer,{name:b});if(m.base64){const g=m.base64,y=g.substring(g.indexOf(",")+1);return T.append(y,{name:b,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(T,v){const m=new L,b=new f;v.worksheets.forEach(g=>{const{drawing:y}=g;if(y){m.prepare(y,{});let C=m.toXml(y);T.append(C,{name:`xl/drawings/${y.name}.xml`}),C=b.toXml(y.rels),T.append(C,{name:`xl/drawings/_rels/${y.name}.xml.rels`})}})}addTables(T,v){const m=new j;v.worksheets.forEach(b=>{const{tables:g}=b;g.forEach(y=>{m.prepare(y,{});const C=m.toXml(y);T.append(C,{name:"xl/tables/"+y.target})})})}async addContentTypes(T,v){const m=new w().toXml(v);T.append(m,{name:"[Content_Types].xml"})}async addApp(T,v){const m=new x().toXml(v);T.append(m,{name:"docProps/app.xml"})}async addCore(T,v){const m=new u;T.append(m.toXml(v),{name:"docProps/core.xml"})}async addThemes(T,v){const m=v.themes||{theme1:U};Object.keys(m).forEach(b=>{const g=m[b],y=`xl/theme/${b}.xml`;T.append(g,{name:y})})}async addOfficeRels(T){const v=new f().toXml([{Id:"rId1",Type:B.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:B.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:B.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);T.append(v,{name:"_rels/.rels"})}async addWorkbookRels(T,v){let m=1;const b=[{Id:"rId"+m++,Type:B.RelType.Styles,Target:"styles.xml"},{Id:"rId"+m++,Type:B.RelType.Theme,Target:"theme/theme1.xml"}];v.sharedStrings.count&&b.push({Id:"rId"+m++,Type:B.RelType.SharedStrings,Target:"sharedStrings.xml"}),v.worksheets.forEach(y=>{y.rId="rId"+m++,b.push({Id:y.rId,Type:B.RelType.Worksheet,Target:`worksheets/sheet${y.id}.xml`})});const g=new f().toXml(b);T.append(g,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(T,v){v.sharedStrings&&v.sharedStrings.count&&T.append(v.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(T,v){const{xml:m}=v.styles;m&&T.append(m,{name:"xl/styles.xml"})}async addWorkbook(T,v){const m=new A;T.append(m.toXml(v),{name:"xl/workbook.xml"})}async addWorksheets(T,v){const m=new N,b=new f,g=new F,y=new P;v.worksheets.forEach(C=>{let R=new s;m.render(R,C),T.append(R.xml,{name:`xl/worksheets/sheet${C.id}.xml`}),C.rels&&C.rels.length&&(R=new s,b.render(R,C.rels),T.append(R.xml,{name:`xl/worksheets/_rels/sheet${C.id}.xml.rels`})),C.comments.length>0&&(R=new s,g.render(R,C),T.append(R.xml,{name:`xl/comments${C.id}.xml`}),R=new s,y.render(R,C),T.append(R.xml,{name:`xl/drawings/vmlDrawing${C.id}.vml`}))})}_finalize(T){return new Promise((v,m)=>{T.on("finish",()=>{v(this)}),T.on("error",m),T.finalize()})}prepareModel(T,v){T.creator=T.creator||"ExcelJS",T.lastModifiedBy=T.lastModifiedBy||"ExcelJS",T.created=T.created||new Date,T.modified=T.modified||new Date,T.useSharedStrings=v.useSharedStrings===void 0||v.useSharedStrings,T.useStyles=v.useStyles===void 0||v.useStyles,T.sharedStrings=new p,T.styles=T.useStyles?new c(!0):new c.Mock;const m=new A,b=new N;m.prepare(T);const g={sharedStrings:T.sharedStrings,styles:T.styles,date1904:T.properties.date1904,drawingsCount:0,media:T.media};g.drawings=T.drawings=[],g.commentRefs=T.commentRefs=[];let y=0;T.tables=[],T.worksheets.forEach(C=>{C.tables.forEach(R=>{y++,R.target=`table${y}.xml`,R.id=y,T.tables.push(R)}),b.prepare(C,g)})}async write(T,v){v=v||{};const{model:m}=this.workbook,b=new r.ZipWriter(v.zip);return b.pipe(T),this.prepareModel(m,v),await this.addContentTypes(b,m),await this.addOfficeRels(b,m),await this.addWorkbookRels(b,m),await this.addWorksheets(b,m),await this.addSharedStrings(b,m),await this.addDrawings(b,m),await this.addTables(b,m),await Promise.all([this.addThemes(b,m),this.addStyles(b,m)]),await this.addMedia(b,m),await Promise.all([this.addApp(b,m),this.addCore(b,m)]),await this.addWorkbook(b,m),this._finalize(b)}writeFile(T,v){const m=a.createWriteStream(T);return new Promise((b,g)=>{m.on("finish",()=>{b()}),m.on("error",y=>{g(y)}),this.write(m,v).then(()=>{m.end()}).catch(y=>{g(y)})})}async writeBuffer(T){const v=new l;return await this.write(v,T),v.read()}}B.RelType=e("./rel-type"),S.exports=B}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,S,_){S.exports=` `},{}],146:[function(e,S,_){(function(d){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvFormatterStream=void 0;const o=e("stream"),a=e("./formatter");class n extends o.Transform{constructor(r){super({writableObjectMode:r.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=r,this.rowFormatter=new a.RowFormatter(r),this.hasWrittenBOM=!r.writeBOM}transform(r){return this.rowFormatter.rowTransform=r,this}_transform(r,l,i){let s=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(r,(h,c)=>h?(s=!0,i(h)):(c&&c.forEach(u=>{this.push(d.from(u,"utf8"))}),s=!0,i()))}catch(h){if(s)throw h;i(h)}}_flush(r){this.rowFormatter.finish((l,i)=>l?r(l):(i&&i.forEach(s=>{this.push(d.from(s,"utf8"))}),r()))}}_.CsvFormatterStream=n}).call(this)}).call(this,e("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FormatterOptions=void 0,_.FormatterOptions=class{constructor(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var o;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=` `,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,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&&((o=d.writeHeaders)===null||o===void 0||o),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(e,S,_){var d=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=void 0;const o=d(e("lodash.isboolean")),a=d(e("lodash.isnil")),n=d(e("lodash.escaperegexp"));_.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,t.headers!==null&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");const r=`[${t.delimiter}${n.default(t.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(r)}set headers(t){this._headers=t}shouldQuote(t,r){const l=r?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,r,l){const i=(""+(a.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:s}=this;return s.quote!==""&&i.indexOf(s.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,s.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(r,l)?this.quoteField(i):i}quoteField(t){const{quote:r}=this.formatterOptions;return`${r}${t}${r}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,S,_){var d=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowFormatter=void 0;const o=d(e("lodash.isfunction")),a=d(e("lodash.isequal")),n=e("./FieldFormatter"),t=e("../types");class r{constructor(i){this.rowCount=0,this.formatterOptions=i,this.fieldFormatter=new n.FieldFormatter(i),this.headers=i.headers,this.shouldWriteHeaders=i.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),i.transform&&(this.rowTransform=i.transform)}static isRowHashArray(i){return!!Array.isArray(i)&&Array.isArray(i[0])&&i[0].length===2}static isRowArray(i){return Array.isArray(i)&&!this.isRowHashArray(i)}static gatherHeaders(i){return r.isRowHashArray(i)?i.map(s=>s[0]):Array.isArray(i)?i:Object.keys(i)}static createTransform(i){return t.isSyncTransform(i)?(s,h)=>{let c=null;try{c=i(s)}catch(u){return h(u)}return h(null,c)}:(s,h)=>{i(s,h)}}set rowTransform(i){if(!o.default(i))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(i)}format(i,s){this.callTransformer(i,(h,c)=>{if(h)return s(h);if(!i)return s(null);const u=[];if(c){const{shouldFormatColumns:p,headers:f}=this.checkHeaders(c);if(this.shouldWriteHeaders&&f&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(f,!0)),this.hasWrittenHeaders=!0),p){const w=this.gatherColumns(c);u.push(this.formatColumns(w,!1))}}return s(null,u)})}finish(i){const s=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return i(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));s.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&s.push(this.formatterOptions.rowDelimiter),i(null,s)}checkHeaders(i){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const s=r.gatherHeaders(i);return this.headers=s,this.fieldFormatter.headers=s,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(s,i),headers:s}:{shouldFormatColumns:!0,headers:null}}gatherColumns(i){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(i)?r.isRowHashArray(i)?this.headers.map((s,h)=>{const c=i[h];return c?c[1]:""}):r.isRowArray(i)&&!this.shouldWriteHeaders?i:this.headers.map((s,h)=>i[h]):this.headers.map(s=>i[s])}callTransformer(i,s){return this._rowTransform?this._rowTransform(i,s):s(null,i)}formatColumns(i,s){const h=i.map((u,p)=>this.fieldFormatter.format(u,p,s)).join(this.formatterOptions.delimiter),{rowCount:c}=this;return this.rowCount+=1,c?[this.formatterOptions.rowDelimiter,h].join(""):h}}_.RowFormatter=r},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.FieldFormatter=_.RowFormatter=void 0;var d=e("./RowFormatter");Object.defineProperty(_,"RowFormatter",{enumerable:!0,get:function(){return d.RowFormatter}});var o=e("./FieldFormatter");Object.defineProperty(_,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,S,_){(function(d){(function(){var o=Object.create?function(p,f,w,x){x===void 0&&(x=w),Object.defineProperty(p,x,{enumerable:!0,get:function(){return f[w]}})}:function(p,f,w,x){x===void 0&&(x=w),p[x]=f[w]},a=Object.create?function(p,f){Object.defineProperty(p,"default",{enumerable:!0,value:f})}:function(p,f){p.default=f},n=function(p){if(p&&p.__esModule)return p;var f={};if(p!=null)for(var w in p)w!=="default"&&Object.prototype.hasOwnProperty.call(p,w)&&o(f,p,w);return a(f,p),f},t=function(p,f){for(var w in p)w==="default"||Object.prototype.hasOwnProperty.call(f,w)||o(f,p,w)};Object.defineProperty(_,"__esModule",{value:!0}),_.writeToPath=_.writeToString=_.writeToBuffer=_.writeToStream=_.write=_.format=_.FormatterOptions=_.CsvFormatterStream=void 0;const r=e("util"),l=e("stream"),i=n(e("fs")),s=e("./FormatterOptions"),h=e("./CsvFormatterStream");t(e("./types"),_);var c=e("./CsvFormatterStream");Object.defineProperty(_,"CsvFormatterStream",{enumerable:!0,get:function(){return c.CsvFormatterStream}});var u=e("./FormatterOptions");Object.defineProperty(_,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),_.format=p=>new h.CsvFormatterStream(new s.FormatterOptions(p)),_.write=(p,f)=>{const w=_.format(f),x=r.promisify((A,N)=>{w.write(A,void 0,N)});return p.reduce((A,N)=>A.then(()=>x(N)),Promise.resolve()).then(()=>w.end()).catch(A=>{w.emit("error",A)}),w},_.writeToStream=(p,f,w)=>_.write(f,w).pipe(p),_.writeToBuffer=function(p){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=[],x=new l.Writable({write(A,N,L){w.push(A),L()}});return new Promise((A,N)=>{x.on("error",N).on("finish",()=>A(d.concat(w))),_.write(p,f).pipe(x)})},_.writeToString=(p,f)=>_.writeToBuffer(p,f).then(w=>w.toString()),_.writeToPath=(p,f,w)=>{const x=i.createWriteStream(p,{encoding:"utf8"});return _.write(f,w).pipe(x)}}).call(this)}).call(this,e("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncTransform=void 0,_.isSyncTransform=d=>d.length===1},{}],153:[function(e,S,_){(function(d){(function(){Object.defineProperty(_,"__esModule",{value:!0}),_.CsvParserStream=void 0;const o=e("string_decoder"),a=e("stream"),n=e("./transforms"),t=e("./parser");class r extends a.Transform{constructor(i){super({objectMode:i.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=i,this.parser=new t.Parser(i),this.headerTransformer=new n.HeaderTransformer(i),this.decoder=new o.StringDecoder(i.encoding),this.rowTransformerValidator=new n.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(i){return this.rowTransformerValidator.rowTransform=i,this}validate(i){return this.rowTransformerValidator.rowValidator=i,this}emit(i){if(i==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var s=arguments.length,h=new Array(s>1?s-1:0),c=1;c{const p=x=>x?s(x):u%100!=0?c(u+1):void d(()=>c(u+1));if(this.checkAndEmitHeaders(),u>=h||this.hasHitRowLimit)return s();if(this.parsedLineCount+=1,this.shouldSkipLine)return p();const f=i[u];this.rowCount+=1,this.parsedRowCount+=1;const w=this.rowCount;return this.transformRow(f,(x,A)=>{if(x)return this.rowCount-=1,p(x);if(!A)return p(new Error("expected transform result"));if(A.isValid){if(A.row)return this.pushRow(A.row,p)}else this.emit("data-invalid",A.row,w,A.reason);return p()})};c(0)}transformRow(i,s){try{this.headerTransformer.transform(i,(h,c)=>h?s(h):c?c.isValid?c.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(c.row,s):this.skipRow(s):(this.rowCount-=1,this.parsedRowCount-=1,s(null,{row:null,isValid:!0})):this.shouldEmitRows?s(null,{isValid:!1,row:i}):this.skipRow(s):s(new Error("Expected result from header transform")))}catch(h){s(h)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(i){return this.rowCount-=1,i(null,{row:null,isValid:!0})}pushRow(i,s){try{this.parserOptions.objectMode?this.push(i):this.push(JSON.stringify(i)),s()}catch(h){s(h)}}static wrapDoneCallback(i){let s=!1;return function(h){if(h){if(s)throw h;return s=!0,void i(h)}for(var c=arguments.length,u=new Array(c>1?c-1:0),p=1;p1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=o.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,S,_){var d=Object.create?function(c,u,p,f){f===void 0&&(f=p),Object.defineProperty(c,f,{enumerable:!0,get:function(){return u[p]}})}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]},o=Object.create?function(c,u){Object.defineProperty(c,"default",{enumerable:!0,value:u})}:function(c,u){c.default=u},a=function(c){if(c&&c.__esModule)return c;var u={};if(c!=null)for(var p in c)p!=="default"&&Object.prototype.hasOwnProperty.call(c,p)&&d(u,c,p);return o(u,c),u},n=function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||d(u,c,p)};Object.defineProperty(_,"__esModule",{value:!0}),_.parseString=_.parseFile=_.parseStream=_.parse=_.ParserOptions=_.CsvParserStream=void 0;const t=a(e("fs")),r=e("stream"),l=e("./ParserOptions"),i=e("./CsvParserStream");n(e("./types"),_);var s=e("./CsvParserStream");Object.defineProperty(_,"CsvParserStream",{enumerable:!0,get:function(){return s.CsvParserStream}});var h=e("./ParserOptions");Object.defineProperty(_,"ParserOptions",{enumerable:!0,get:function(){return h.ParserOptions}}),_.parse=c=>new i.CsvParserStream(new l.ParserOptions(c)),_.parseStream=(c,u)=>c.pipe(new i.CsvParserStream(new l.ParserOptions(u))),_.parseFile=function(c){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(c).pipe(new i.CsvParserStream(new l.ParserOptions(u)))},_.parseString=(c,u)=>{const p=new r.Readable;return p.push(c),p.push(null),p.pipe(new i.CsvParserStream(new l.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Parser=void 0;const d=e("./Scanner"),o=e("./RowParser"),a=e("./Token");class n{constructor(r){this.parserOptions=r,this.rowParser=new o.RowParser(this.parserOptions)}static removeBOM(r){return r&&r.charCodeAt(0)===65279?r.slice(1):r}parse(r,l){const i=new d.Scanner({line:n.removeBOM(r),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(r){const l=[];let i=!0;for(;i;)i=this.parseRow(r,l);return{line:r.line,rows:l}}parseWithComments(r){const{parserOptions:l}=this,i=[];for(let s=r.nextCharacterToken;s!==null;s=r.nextCharacterToken)if(a.Token.isTokenComment(s,l)){if(r.advancePastLine()===null)return{line:r.lineFromCursor,rows:i};if(!r.hasMoreCharacters)return{line:r.lineFromCursor,rows:i};r.truncateToCursor()}else if(!this.parseRow(r,i))break;return{line:r.line,rows:i}}parseRow(r,l){if(!r.nextNonSpaceToken)return!1;const i=this.rowParser.parse(r);return i!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(i)||l.push(i),!0)}}_.Parser=n},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.RowParser=void 0;const d=e("./column"),o=e("./Token");_.RowParser=class{constructor(a){this.parserOptions=a,this.columnParser=new d.ColumnParser(a)}static isEmptyRow(a){return a.join("").replace(/\s+/g,"")===""}parse(a){const{parserOptions:n}=this,{hasMoreData:t}=a,r=a,l=[];let i=this.getStartToken(r,l);for(;i;){if(o.Token.isTokenRowDelimiter(i))return r.advancePastToken(i),!r.hasMoreCharacters&&o.Token.isTokenCarriageReturn(i,n)&&t?null:(r.truncateToCursor(),l);if(!this.shouldSkipColumnParse(r,i,l)){const s=this.columnParser.parse(r);if(s===null)return null;l.push(s)}i=r.nextNonSpaceToken}return t?null:(r.truncateToCursor(),l)}getStartToken(a,n){const t=a.nextNonSpaceToken;return t!==null&&o.Token.isTokenDelimiter(t,this.parserOptions)?(n.push(""),a.nextNonSpaceToken):t}shouldSkipColumnParse(a,n,t){const{parserOptions:r}=this;if(o.Token.isTokenDelimiter(n,r)){a.advancePastToken(n);const l=a.nextCharacterToken;if(!a.hasMoreCharacters||l!==null&&o.Token.isTokenRowDelimiter(l)||l!==null&&o.Token.isTokenDelimiter(l,r))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Scanner=void 0;const d=e("./Token"),o=/((?:\r\n)|\n|\r)/;_.Scanner=class{constructor(a){this.cursor=0,this.line=a.line,this.lineLength=this.line.length,this.parserOptions=a.parserOptions,this.hasMoreData=a.hasMoreData,this.cursor=a.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:a}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(a.search(n)===-1)return null;const t=n.exec(a);if(t==null)return null;const r=t[1],l=this.cursor+(t.index||0);return new d.Token({token:r,startCursor:l,endCursor:l+r.length-1})}get nextCharacterToken(){const{cursor:a,lineLength:n}=this;return n<=a?null:new d.Token({token:this.line[a],startCursor:a,endCursor:a})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const a=o.exec(this.lineFromCursor);return a?(this.cursor+=(a.index||0)+a[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(a){return this.cursor=a,this}advanceToToken(a){return this.cursor=a.startCursor,this}advancePastToken(a){return this.cursor=a.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.Token=void 0,_.Token=class{constructor(d){this.token=d.token,this.startCursor=d.startCursor,this.endCursor=d.endCursor}static isTokenRowDelimiter(d){const o=d.token;return o==="\r"||o===` `||o===`\r `}static isTokenCarriageReturn(d,o){return d.token===o.carriageReturn}static isTokenComment(d,o){return o.supportsComments&&!!d&&d.token===o.comment}static isTokenEscapeCharacter(d,o){return d.token===o.escapeChar}static isTokenQuote(d,o){return d.token===o.quote}static isTokenDelimiter(d,o){return d.token===o.delimiter}}},{}],160:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=void 0,_.ColumnFormatter=class{constructor(d){d.trim?this.format=o=>o.trim():d.ltrim?this.format=o=>o.trimLeft():d.rtrim?this.format=o=>o.trimRight():this.format=o=>o}}},{}],161:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnParser=void 0;const d=e("./NonQuotedColumnParser"),o=e("./QuotedColumnParser"),a=e("../Token");_.ColumnParser=class{constructor(n){this.parserOptions=n,this.quotedColumnParser=new o.QuotedColumnParser(n),this.nonQuotedColumnParser=new d.NonQuotedColumnParser(n)}parse(n){const{nextNonSpaceToken:t}=n;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(n.advanceToToken(t),this.quotedColumnParser.parse(n)):this.nonQuotedColumnParser.parse(n)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.NonQuotedColumnParser=void 0;const d=e("./ColumnFormatter"),o=e("../Token");_.NonQuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new d.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const{parserOptions:n}=this,t=[];let r=a.nextCharacterToken;for(;r&&!o.Token.isTokenDelimiter(r,n)&&!o.Token.isTokenRowDelimiter(r);r=a.nextCharacterToken)t.push(r.token),a.advancePastToken(r);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=void 0;const d=e("./ColumnFormatter"),o=e("../Token");_.QuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new d.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;const n=a.cursor,{foundClosingQuote:t,col:r}=this.gatherDataBetweenQuotes(a);if(!t){if(a.advanceTo(n),!a.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${a.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(a),r}gatherDataBetweenQuotes(a){const{parserOptions:n}=this;let t=!1,r=!1;const l=[];let i=a.nextCharacterToken;for(;!r&&i!==null;i=a.nextCharacterToken){const s=o.Token.isTokenQuote(i,n);if(!t&&s)t=!0;else if(t)if(o.Token.isTokenEscapeCharacter(i,n)){a.advancePastToken(i);const h=a.nextCharacterToken;h!==null&&(o.Token.isTokenQuote(h,n)||o.Token.isTokenEscapeCharacter(h,n))?(l.push(h.token),i=h):s?r=!0:l.push(i.token)}else s?r=!0:l.push(i.token);a.advancePastToken(i)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:r}}checkForMalformedColumn(a){const{parserOptions:n}=this,{nextNonSpaceToken:t}=a;if(t){const r=o.Token.isTokenDelimiter(t,n),l=o.Token.isTokenRowDelimiter(t);if(!r&&!l){const i=a.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${n.escapedDelimiter}' OR new line got: '${t.token}'. at '${i}`)}a.advanceToToken(t)}else a.hasMoreData||a.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.ColumnFormatter=_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=void 0;var d=e("./ColumnParser");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return d.ColumnParser}});var o=e("./NonQuotedColumnParser");Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var a=e("./QuotedColumnParser");Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var n=e("./ColumnFormatter");Object.defineProperty(_,"ColumnFormatter",{enumerable:!0,get:function(){return n.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.QuotedColumnParser=_.NonQuotedColumnParser=_.ColumnParser=_.Token=_.Scanner=_.RowParser=_.Parser=void 0;var d=e("./Parser");Object.defineProperty(_,"Parser",{enumerable:!0,get:function(){return d.Parser}});var o=e("./RowParser");Object.defineProperty(_,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var a=e("./Scanner");Object.defineProperty(_,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var n=e("./Token");Object.defineProperty(_,"Token",{enumerable:!0,get:function(){return n.Token}});var t=e("./column");Object.defineProperty(_,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(_,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(_,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,S,_){var d=function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=void 0;const o=d(e("lodash.isundefined")),a=d(e("lodash.isfunction")),n=d(e("lodash.uniq")),t=d(e("lodash.groupby"));_.HeaderTransformer=class{constructor(r){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=r,r.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(r.headers)?this.setHeaders(r.headers):a.default(r.headers)&&(this.headersTransform=r.headers)}transform(r,l){return this.shouldMapRow(r)?l(null,this.processRow(r)):l(null,{row:null,isValid:!0})}shouldMapRow(r){const{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(r)){if(this.headersTransform)this.setHeaders(this.headersTransform(r));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(r)}return!1}return!0}processRow(r){if(!this.headers)return{row:r,isValid:!0};const{parserOptions:l}=this;if(!l.discardUnmappedColumns&&r.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${r.length}`);return{row:r,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${r.length}`}}return l.strictColumnHandling&&r.length!!s);if(n.default(i).length!==i.length){const s=t.default(i),h=Object.keys(s).filter(c=>s[c].length>1);throw new Error("Duplicate headers found "+JSON.stringify(h))}this.headers=r,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,S,_){var d=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_,"__esModule",{value:!0}),_.RowTransformerValidator=void 0;const o=d(e("lodash.isfunction")),a=e("../types");class n{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(r){return a.isSyncTransform(r)?(l,i)=>{let s=null;try{s=r(l)}catch(h){return i(h)}return i(null,s)}:r}static createValidator(r){return a.isSyncValidate(r)?(l,i)=>{i(null,{row:l,isValid:r(l)})}:(l,i)=>{r(l,(s,h,c)=>s?i(s):i(null,h?{row:l,isValid:h,reason:c}:{row:l,isValid:!1,reason:c}))}}set rowTransform(r){if(!o.default(r))throw new TypeError("The transform should be a function");this._rowTransform=n.createTransform(r)}set rowValidator(r){if(!o.default(r))throw new TypeError("The validate should be a function");this._rowValidator=n.createValidator(r)}transformAndValidate(r,l){return this.callTransformer(r,(i,s)=>i?l(i):s?this.callValidator(s,(h,c)=>h?l(h):c&&!c.isValid?l(null,{row:s,isValid:!1,reason:c.reason}):l(null,{row:s,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(r,l){return this._rowTransform?this._rowTransform(r,l):l(null,r)}callValidator(r,l){return this._rowValidator?this._rowValidator(r,l):l(null,{row:r,isValid:!0})}}_.RowTransformerValidator=n},{"../types":169,"lodash.isfunction":446}],168:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.HeaderTransformer=_.RowTransformerValidator=void 0;var d=e("./RowTransformerValidator");Object.defineProperty(_,"RowTransformerValidator",{enumerable:!0,get:function(){return d.RowTransformerValidator}});var o=e("./HeaderTransformer");Object.defineProperty(_,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,S,_){Object.defineProperty(_,"__esModule",{value:!0}),_.isSyncValidate=_.isSyncTransform=void 0,_.isSyncTransform=d=>d.length===1,_.isSyncValidate=d=>d.length===1},{}],170:[function(e,S,_){const d=_;d.bignum=e("bn.js"),d.define=e("./asn1/api").define,d.base=e("./asn1/base"),d.constants=e("./asn1/constants"),d.decoders=e("./asn1/decoders"),d.encoders=e("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,S,_){const d=e("./encoders"),o=e("./decoders"),a=e("inherits");function n(t,r){this.name=t,this.body=r,this.decoders={},this.encoders={}}_.define=function(t,r){return new n(t,r)},n.prototype._createNamed=function(t){const r=this.name;function l(i){this._initNamed(i,r)}return a(l,t),l.prototype._initNamed=function(i,s){t.call(this,i,s)},new l(this)},n.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(o[t])),this.decoders[t]},n.prototype.decode=function(t,r,l){return this._getDecoder(r).decode(t,l)},n.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(d[t])),this.encoders[t]},n.prototype.encode=function(t,r,l){return this._getEncoder(r).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,S,_){const d=e("inherits"),o=e("../base/reporter").Reporter,a=e("safer-buffer").Buffer;function n(r,l){o.call(this,l),a.isBuffer(r)?(this.base=r,this.offset=0,this.length=r.length):this.error("Input not Buffer")}function t(r,l){if(Array.isArray(r))this.length=0,this.value=r.map(function(i){return t.isEncoderBuffer(i)||(i=new t(i,l)),this.length+=i.length,i},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return l.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=a.byteLength(r);else{if(!a.isBuffer(r))return l.error("Unsupported type: "+typeof r);this.value=r,this.length=r.length}}d(n,o),_.DecoderBuffer=n,n.isDecoderBuffer=function(r){return r instanceof n?!0:typeof r=="object"&&a.isBuffer(r.base)&&r.constructor.name==="DecoderBuffer"&&typeof r.offset=="number"&&typeof r.length=="number"&&typeof r.save=="function"&&typeof r.restore=="function"&&typeof r.isEmpty=="function"&&typeof r.readUInt8=="function"&&typeof r.skip=="function"&&typeof r.raw=="function"},n.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},n.prototype.restore=function(r){const l=new n(this.base);return l.offset=r.offset,l.length=this.offset,this.offset=r.offset,o.prototype.restore.call(this,r.reporter),l},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(r){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(r||"DecoderBuffer overrun")},n.prototype.skip=function(r,l){if(!(this.offset+r<=this.length))return this.error(l||"DecoderBuffer overrun");const i=new n(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+r,this.offset+=r,i},n.prototype.raw=function(r){return this.base.slice(r?r.offset:this.offset,this.length)},_.EncoderBuffer=t,t.isEncoderBuffer=function(r){return r instanceof t?!0:typeof r=="object"&&r.constructor.name==="EncoderBuffer"&&typeof r.length=="number"&&typeof r.join=="function"},t.prototype.join=function(r,l){return r||(r=a.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(r,l),l+=i.length}):(typeof this.value=="number"?r[l]=this.value:typeof this.value=="string"?r.write(this.value,l):a.isBuffer(this.value)&&this.value.copy(r,l),l+=this.length)),r}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,S,_){const d=_;d.Reporter=e("./reporter").Reporter,d.DecoderBuffer=e("./buffer").DecoderBuffer,d.EncoderBuffer=e("./buffer").EncoderBuffer,d.Node=e("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,S,_){const d=e("../base/reporter").Reporter,o=e("../base/buffer").EncoderBuffer,a=e("../base/buffer").DecoderBuffer,n=e("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(s,h,c){const u={};this._baseState=u,u.name=c,u.enc=s,u.parent=h||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}S.exports=l;const i=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const s=this._baseState,h={};i.forEach(function(u){h[u]=s[u]});const c=new this.constructor(h.parent);return c._baseState=h,c},l.prototype._wrap=function(){const s=this._baseState;r.forEach(function(h){this[h]=function(){const c=new this.constructor(this);return s.children.push(c),c[h].apply(c,arguments)}},this)},l.prototype._init=function(s){const h=this._baseState;n(h.parent===null),s.call(this),h.children=h.children.filter(function(c){return c._baseState.parent===this},this),n.equal(h.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(s){const h=this._baseState,c=s.filter(function(u){return u instanceof this.constructor},this);s=s.filter(function(u){return!(u instanceof this.constructor)},this),c.length!==0&&(n(h.children===null),h.children=c,c.forEach(function(u){u._baseState.parent=this},this)),s.length!==0&&(n(h.args===null),h.args=s,h.reverseArgs=s.map(function(u){if(typeof u!="object"||u.constructor!==Object)return u;const p={};return Object.keys(u).forEach(function(f){f==(0|f)&&(f|=0);const w=u[f];p[w]=f}),p}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(s){l.prototype[s]=function(){const h=this._baseState;throw new Error(s+" not implemented for encoding: "+h.enc)}}),t.forEach(function(s){l.prototype[s]=function(){const h=this._baseState,c=Array.prototype.slice.call(arguments);return n(h.tag===null),h.tag=s,this._useArgs(c),this}}),l.prototype.use=function(s){n(s);const h=this._baseState;return n(h.use===null),h.use=s,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(s){const h=this._baseState;return n(h.default===null),h.default=s,h.optional=!0,this},l.prototype.explicit=function(s){const h=this._baseState;return n(h.explicit===null&&h.implicit===null),h.explicit=s,this},l.prototype.implicit=function(s){const h=this._baseState;return n(h.explicit===null&&h.implicit===null),h.implicit=s,this},l.prototype.obj=function(){const s=this._baseState,h=Array.prototype.slice.call(arguments);return s.obj=!0,h.length!==0&&this._useArgs(h),this},l.prototype.key=function(s){const h=this._baseState;return n(h.key===null),h.key=s,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(s){const h=this._baseState;return n(h.choice===null),h.choice=s,this._useArgs(Object.keys(s).map(function(c){return s[c]})),this},l.prototype.contains=function(s){const h=this._baseState;return n(h.use===null),h.contains=s,this},l.prototype._decode=function(s,h){const c=this._baseState;if(c.parent===null)return s.wrapResult(c.children[0]._decode(s,h));let u,p=c.default,f=!0,w=null;if(c.key!==null&&(w=s.enterKey(c.key)),c.optional){let x=null;if(c.explicit!==null?x=c.explicit:c.implicit!==null?x=c.implicit:c.tag!==null&&(x=c.tag),x!==null||c.any){if(f=this._peekTag(s,x,c.any),s.isError(f))return f}else{const A=s.save();try{c.choice===null?this._decodeGeneric(c.tag,s,h):this._decodeChoice(s,h),f=!0}catch{f=!1}s.restore(A)}}if(c.obj&&f&&(u=s.enterObject()),f){if(c.explicit!==null){const A=this._decodeTag(s,c.explicit);if(s.isError(A))return A;s=A}const x=s.offset;if(c.use===null&&c.choice===null){let A;c.any&&(A=s.save());const N=this._decodeTag(s,c.implicit!==null?c.implicit:c.tag,c.any);if(s.isError(N))return N;c.any?p=s.raw(A):s=N}if(h&&h.track&&c.tag!==null&&h.track(s.path(),x,s.length,"tagged"),h&&h.track&&c.tag!==null&&h.track(s.path(),s.offset,s.length,"content"),c.any||(p=c.choice===null?this._decodeGeneric(c.tag,s,h):this._decodeChoice(s,h)),s.isError(p))return p;if(c.any||c.choice!==null||c.children===null||c.children.forEach(function(A){A._decode(s,h)}),c.contains&&(c.tag==="octstr"||c.tag==="bitstr")){const A=new a(p);p=this._getUse(c.contains,s._reporterState.obj)._decode(A,h)}}return c.obj&&f&&(p=s.leaveObject(u)),c.key===null||p===null&&f!==!0?w!==null&&s.exitKey(w):s.leaveKey(w,c.key,p),p},l.prototype._decodeGeneric=function(s,h,c){const u=this._baseState;return s==="seq"||s==="set"?null:s==="seqof"||s==="setof"?this._decodeList(h,s,u.args[0],c):/str$/.test(s)?this._decodeStr(h,s,c):s==="objid"&&u.args?this._decodeObjid(h,u.args[0],u.args[1],c):s==="objid"?this._decodeObjid(h,null,null,c):s==="gentime"||s==="utctime"?this._decodeTime(h,s,c):s==="null_"?this._decodeNull(h,c):s==="bool"?this._decodeBool(h,c):s==="objDesc"?this._decodeStr(h,s,c):s==="int"||s==="enum"?this._decodeInt(h,u.args&&u.args[0],c):u.use!==null?this._getUse(u.use,h._reporterState.obj)._decode(h,c):h.error("unknown tag: "+s)},l.prototype._getUse=function(s,h){const c=this._baseState;return c.useDecoder=this._use(s,h),n(c.useDecoder._baseState.parent===null),c.useDecoder=c.useDecoder._baseState.children[0],c.implicit!==c.useDecoder._baseState.implicit&&(c.useDecoder=c.useDecoder.clone(),c.useDecoder._baseState.implicit=c.implicit),c.useDecoder},l.prototype._decodeChoice=function(s,h){const c=this._baseState;let u=null,p=!1;return Object.keys(c.choice).some(function(f){const w=s.save(),x=c.choice[f];try{const A=x._decode(s,h);if(s.isError(A))return!1;u={type:f,value:A},p=!0}catch{return s.restore(w),!1}return!0},this),p?u:s.error("Choice not matched")},l.prototype._createEncoderBuffer=function(s){return new o(s,this.reporter)},l.prototype._encode=function(s,h,c){const u=this._baseState;if(u.default!==null&&u.default===s)return;const p=this._encodeValue(s,h,c);return p===void 0||this._skipDefault(p,h,c)?void 0:p},l.prototype._encodeValue=function(s,h,c){const u=this._baseState;if(u.parent===null)return u.children[0]._encode(s,h||new d);let p=null;if(this.reporter=h,u.optional&&s===void 0){if(u.default===null)return;s=u.default}let f=null,w=!1;if(u.any)p=this._createEncoderBuffer(s);else if(u.choice)p=this._encodeChoice(s,h);else if(u.contains)f=this._getUse(u.contains,c)._encode(s,h),w=!0;else if(u.children)f=u.children.map(function(x){if(x._baseState.tag==="null_")return x._encode(null,h,s);if(x._baseState.key===null)return h.error("Child should have a key");const A=h.enterKey(x._baseState.key);if(typeof s!="object")return h.error("Child expected, but input is not object");const N=x._encode(s[x._baseState.key],h,s);return h.leaveKey(A),N},this).filter(function(x){return x}),f=this._createEncoderBuffer(f);else if(u.tag==="seqof"||u.tag==="setof"){if(!u.args||u.args.length!==1)return h.error("Too many args for : "+u.tag);if(!Array.isArray(s))return h.error("seqof/setof, but data is not Array");const x=this.clone();x._baseState.implicit=null,f=this._createEncoderBuffer(s.map(function(A){const N=this._baseState;return this._getUse(N.args[0],s)._encode(A,h)},x))}else u.use!==null?p=this._getUse(u.use,c)._encode(s,h):(f=this._encodePrimitive(u.tag,s),w=!0);if(!u.any&&u.choice===null){const x=u.implicit!==null?u.implicit:u.tag,A=u.implicit===null?"universal":"context";x===null?u.use===null&&h.error("Tag could be omitted only for .use()"):u.use===null&&(p=this._encodeComposite(x,w,A,f))}return u.explicit!==null&&(p=this._encodeComposite(u.explicit,!1,"context",p)),p},l.prototype._encodeChoice=function(s,h){const c=this._baseState,u=c.choice[s.type];return u||n(!1,s.type+" not found in "+JSON.stringify(Object.keys(c.choice))),u._encode(s.value,h)},l.prototype._encodePrimitive=function(s,h){const c=this._baseState;if(/str$/.test(s))return this._encodeStr(h,s);if(s==="objid"&&c.args)return this._encodeObjid(h,c.reverseArgs[0],c.args[1]);if(s==="objid")return this._encodeObjid(h,null,null);if(s==="gentime"||s==="utctime")return this._encodeTime(h,s);if(s==="null_")return this._encodeNull();if(s==="int"||s==="enum")return this._encodeInt(h,c.args&&c.reverseArgs[0]);if(s==="bool")return this._encodeBool(h);if(s==="objDesc")return this._encodeStr(h,s);throw new Error("Unsupported tag: "+s)},l.prototype._isNumstr=function(s){return/^[0-9 ]*$/.test(s)},l.prototype._isPrintstr=function(s){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(s)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,S,_){const d=e("inherits");function o(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}function a(n,t){this.path=n,this.rethrow(t)}_.Reporter=o,o.prototype.isError=function(n){return n instanceof a},o.prototype.save=function(){const n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},o.prototype.restore=function(n){const t=this._reporterState;t.obj=n.obj,t.path=t.path.slice(0,n.pathLen)},o.prototype.enterKey=function(n){return this._reporterState.path.push(n)},o.prototype.exitKey=function(n){const t=this._reporterState;t.path=t.path.slice(0,n-1)},o.prototype.leaveKey=function(n,t,r){const l=this._reporterState;this.exitKey(n),l.obj!==null&&(l.obj[t]=r)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const n=this._reporterState,t=n.obj;return n.obj={},t},o.prototype.leaveObject=function(n){const t=this._reporterState,r=t.obj;return t.obj=n,r},o.prototype.error=function(n){let t;const r=this._reporterState,l=n instanceof a;if(t=l?n:new a(r.path.map(function(i){return"["+JSON.stringify(i)+"]"}).join(""),n.message||n,n.stack),!r.options.partial)throw t;return l||r.errors.push(t),t},o.prototype.wrapResult=function(n){const t=this._reporterState;return t.options.partial?{result:this.isError(n)?null:n,errors:t.errors}:n},d(a,Error),a.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(e,S,_){function d(o){const a={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];a[t]=n}),a}_.tagClass={0:"universal",1:"application",2:"context",3:"private"},_.tagClassByName=d(_.tagClass),_.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},_.tagByName=d(_.tag)},{}],177:[function(e,S,_){const d=_;d._reverse=function(o){const a={};return Object.keys(o).forEach(function(n){(0|n)==n&&(n|=0);const t=o[n];a[t]=n}),a},d.der=e("./der")},{"./der":176}],178:[function(e,S,_){const d=e("inherits"),o=e("bn.js"),a=e("../base/buffer").DecoderBuffer,n=e("../base/node"),t=e("../constants/der");function r(h){this.enc="der",this.name=h.name,this.entity=h,this.tree=new l,this.tree._init(h.body)}function l(h){n.call(this,"der",h)}function i(h,c){let u=h.readUInt8(c);if(h.isError(u))return u;const p=t.tagClass[u>>6],f=(32&u)==0;if((31&u)==31){let w=u;for(u=0;(128&w)==128;){if(w=h.readUInt8(c),h.isError(w))return w;u<<=7,u|=127&w}}else u&=31;return{cls:p,primitive:f,tag:u,tagStr:t.tag[u]}}function s(h,c,u){let p=h.readUInt8(u);if(h.isError(p))return p;if(!c&&p===128)return null;if(!(128&p))return p;const f=127&p;if(f>4)return h.error("length octect is too long");p=0;for(let w=0;w=31?N.error("Multi-octet tag encoding unsupported"):(x||(L|=32),L|=n.tagClassByName[A||"universal"]<<6,L)}(i,s,h,this.reporter);if(c.length<128){const w=o.alloc(2);return w[0]=u,w[1]=c.length,this._createEncoderBuffer([w,c])}let p=1;for(let w=c.length;w>=256;w>>=8)p++;const f=o.alloc(2+p);f[0]=u,f[1]=128|p;for(let w=1+p,x=c.length;x>0;w--,x>>=8)f[w]=255&x;return this._createEncoderBuffer([f,c])},r.prototype._encodeStr=function(i,s){if(s==="bitstr")return this._createEncoderBuffer([0|i.unused,i.data]);if(s==="bmpstr"){const h=o.alloc(2*i.length);for(let c=0;c=40)return this.reporter.error("Second objid identifier OOB");i.splice(0,2,40*i[0]+i[1])}let c=0;for(let f=0;f=128;w>>=7)c++}const u=o.alloc(c);let p=u.length-1;for(let f=i.length-1;f>=0;f--){let w=i[f];for(u[p--]=127&w;(w>>=7)>0;)u[p--]=128|127&w}return this._createEncoderBuffer(u)},r.prototype._encodeTime=function(i,s){let h;const c=new Date(i);return s==="gentime"?h=[l(c.getUTCFullYear()),l(c.getUTCMonth()+1),l(c.getUTCDate()),l(c.getUTCHours()),l(c.getUTCMinutes()),l(c.getUTCSeconds()),"Z"].join(""):s==="utctime"?h=[l(c.getUTCFullYear()%100),l(c.getUTCMonth()+1),l(c.getUTCDate()),l(c.getUTCHours()),l(c.getUTCMinutes()),l(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+s+" time is not supported yet"),this._encodeStr(h,"octstr")},r.prototype._encodeNull=function(){return this._createEncoderBuffer("")},r.prototype._encodeInt=function(i,s){if(typeof i=="string"){if(!s)return this.reporter.error("String int or enum given, but no values map");if(!s.hasOwnProperty(i))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(i));i=s[i]}if(typeof i!="number"&&!o.isBuffer(i)){const u=i.toArray();!i.sign&&128&u[0]&&u.unshift(0),i=o.from(u)}if(o.isBuffer(i)){let u=i.length;i.length===0&&u++;const p=o.alloc(u);return i.copy(p),i.length===0&&(p[0]=0),this._createEncoderBuffer(p)}if(i<128)return this._createEncoderBuffer(i);if(i<256)return this._createEncoderBuffer([0,i]);let h=1;for(let u=i;u>=256;u>>=8)h++;const c=new Array(h);for(let u=c.length-1;u>=0;u--)c[u]=255&i,i>>=8;return 128&c[0]&&c.unshift(0),this._createEncoderBuffer(o.from(c))},r.prototype._encodeBool=function(i){return this._createEncoderBuffer(i?255:0)},r.prototype._use=function(i,s){return typeof i=="function"&&(i=i(s)),i._getEncoder("der").tree},r.prototype._skipDefault=function(i,s,h){const c=this._baseState;let u;if(c.default===null)return!1;const p=i.join();if(c.defaultBuffer===void 0&&(c.defaultBuffer=this._encodeValue(c.default,s,h).join()),p.length!==c.defaultBuffer.length)return!1;for(u=0;u=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function i(k,T,v){var m=l(k,v);return v-1>=T&&(m|=l(k,v-1)<<4),m}function s(k,T,v,m){for(var b=0,g=Math.min(k.length,v),y=T;y=49?C-49+10:C>=17?C-17+10:C}return b}t.isBN=function(k){return k instanceof t||k!==null&&typeof k=="object"&&k.constructor.wordSize===t.wordSize&&Array.isArray(k.words)},t.max=function(k,T){return k.cmp(T)>0?k:T},t.min=function(k,T){return k.cmp(T)<0?k:T},t.prototype._init=function(k,T,v){if(typeof k=="number")return this._initNumber(k,T,v);if(typeof k=="object")return this._initArray(k,T,v);T==="hex"&&(T=16),a(T===(0|T)&&T>=2&&T<=36);var m=0;(k=k.toString().replace(/\s+/g,""))[0]==="-"&&(m++,this.negative=1),m=0;m-=3)g=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[b]|=g<>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);else if(v==="le")for(m=0,b=0;m>>26-y&67108863,(y+=24)>=26&&(y-=26,b++);return this.strip()},t.prototype._parseHex=function(k,T,v){this.length=Math.ceil((k.length-T)/6),this.words=new Array(this.length);for(var m=0;m=T;m-=2)b=i(k,T,m)<=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;else for(m=(k.length-T)%2==0?T+1:T;m=18?(g-=18,y+=1,this.words[y]|=b>>>26):g+=8;this.strip()},t.prototype._parseBase=function(k,T,v){this.words=[0],this.length=1;for(var m=0,b=1;b<=67108863;b*=T)m++;m--,b=b/T|0;for(var g=k.length-v,y=g%m,C=Math.min(g,g-y)+v,R=0,I=v;I1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(k,T,v){v.negative=T.negative^k.negative;var m=k.length+T.length|0;v.length=m,m=m-1|0;var b=0|k.words[0],g=0|T.words[0],y=b*g,C=67108863&y,R=y/67108864|0;v.words[0]=C;for(var I=1;I>>26,H=67108863&R,q=Math.min(I,T.length-1),O=Math.max(0,I-k.length+1);O<=q;O++){var $=I-O|0;z+=(y=(b=0|k.words[$])*(g=0|T.words[O])+H)/67108864|0,H=67108863&y}v.words[I]=0|H,R=0|z}return R!==0?v.words[I]=0|R:v.length--,v.strip()}t.prototype.toString=function(k,T){var v;if(T=0|T||1,(k=k||10)===16||k==="hex"){v="";for(var m=0,b=0,g=0;g>>24-m&16777215)!==0||g!==this.length-1?h[6-C.length]+C+v:C+v,(m+=2)>=26&&(m-=26,g--)}for(b!==0&&(v=b.toString(16)+v);v.length%T!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(0|k)&&k>=2&&k<=36){var R=c[k],I=u[k];v="";var z=this.clone();for(z.negative=0;!z.isZero();){var H=z.modn(I).toString(k);v=(z=z.idivn(I)).isZero()?H+v:h[R-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%T!=0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=67108864*this.words[1]:this.length===3&&this.words[2]===1?k+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(k,T){return a(r!==void 0),this.toArrayLike(r,k,T)},t.prototype.toArray=function(k,T){return this.toArrayLike(Array,k,T)},t.prototype.toArrayLike=function(k,T,v){var m=this.byteLength(),b=v||Math.max(1,m);a(m<=b,"byte array longer than desired length"),a(b>0,"Requested array length <= 0"),this.strip();var g,y,C=T==="le",R=new k(b),I=this.clone();if(C){for(y=0;!I.isZero();y++)g=I.andln(255),I.iushrn(8),R[y]=g;for(;y=4096&&(v+=13,T>>>=13),T>=64&&(v+=7,T>>>=7),T>=8&&(v+=4,T>>>=4),T>=2&&(v+=2,T>>>=2),v+T},t.prototype._zeroBits=function(k){if(k===0)return 26;var T=k,v=0;return!(8191&T)&&(v+=13,T>>>=13),!(127&T)&&(v+=7,T>>>=7),!(15&T)&&(v+=4,T>>>=4),!(3&T)&&(v+=2,T>>>=2),!(1&T)&&v++,v},t.prototype.bitLength=function(){var k=this.words[this.length-1],T=this._countBits(k);return 26*(this.length-1)+T},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,T=0;Tk.length?this.clone().ior(k):k.clone().ior(this)},t.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},t.prototype.iuand=function(k){var T;T=this.length>k.length?k:this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},t.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},t.prototype.iuxor=function(k){var T,v;this.length>k.length?(T=this,v=k):(T=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},t.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},t.prototype.inotn=function(k){a(typeof k=="number"&&k>=0);var T=0|Math.ceil(k/26),v=k%26;this._expand(T),v>0&&T--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},t.prototype.notn=function(k){return this.clone().inotn(k)},t.prototype.setn=function(k,T){a(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),this.words[v]=T?this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var b=0,g=0;g>>26;for(;b!==0&&g>>26;if(this.length=v.length,b!==0)this.words[this.length]=b,this.length++;else if(v!==this)for(;gk.length?this.clone().iadd(k):k.clone().iadd(this)},t.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var T=this.iadd(k);return k.negative=1,T._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v,m,b=this.cmp(k);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;b>0?(v=this,m=k):(v=k,m=this);for(var g=0,y=0;y>26,this.words[y]=67108863&T;for(;g!==0&&y>26,this.words[y]=67108863&T;if(g===0&&y>>13,O=0|y[1],$=8191&O,E=O>>>13,M=0|y[2],D=8191&M,V=M>>>13,Y=0|y[3],X=8191&Y,G=Y>>>13,et=0|y[4],nt=8191&et,K=et>>>13,tt=0|y[5],Q=8191&tt,st=tt>>>13,it=0|y[6],at=8191&it,ut=it>>>13,ht=0|y[7],dt=8191&ht,xt=ht>>>13,_t=0|y[8],yt=8191&_t,Ot=_t>>>13,Et=0|y[9],At=8191&Et,It=Et>>>13,kt=0|C[0],mt=8191&kt,St=kt>>>13,Tt=0|C[1],Ct=8191&Tt,Yt=Tt>>>13,ie=0|C[2],Nt=8191&ie,ee=ie>>>13,Kt=0|C[3],Ht=8191&Kt,ue=Kt>>>13,re=0|C[4],Dt=8191&re,Jt=re>>>13,ae=0|C[5],Lt=8191&ae,ne=ae>>>13,le=0|C[6],Vt=8191&le,rt=le>>>13,ot=0|C[7],ct=8191&ot,vt=ot>>>13,Ft=0|C[8],wt=8191&Ft,zt=Ft>>>13,Pt=0|C[9],jt=8191&Pt,$t=Pt>>>13;v.negative=k.negative^T.negative,v.length=19;var Ut=(I+(m=Math.imul(H,mt))|0)+((8191&(b=(b=Math.imul(H,St))+Math.imul(q,mt)|0))<<13)|0;I=((g=Math.imul(q,St))+(b>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,m=Math.imul($,mt),b=(b=Math.imul($,St))+Math.imul(E,mt)|0,g=Math.imul(E,St);var Xt=(I+(m=m+Math.imul(H,Ct)|0)|0)+((8191&(b=(b=b+Math.imul(H,Yt)|0)+Math.imul(q,Ct)|0))<<13)|0;I=((g=g+Math.imul(q,Yt)|0)+(b>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,m=Math.imul(D,mt),b=(b=Math.imul(D,St))+Math.imul(V,mt)|0,g=Math.imul(V,St),m=m+Math.imul($,Ct)|0,b=(b=b+Math.imul($,Yt)|0)+Math.imul(E,Ct)|0,g=g+Math.imul(E,Yt)|0;var pe=(I+(m=m+Math.imul(H,Nt)|0)|0)+((8191&(b=(b=b+Math.imul(H,ee)|0)+Math.imul(q,Nt)|0))<<13)|0;I=((g=g+Math.imul(q,ee)|0)+(b>>>13)|0)+(pe>>>26)|0,pe&=67108863,m=Math.imul(X,mt),b=(b=Math.imul(X,St))+Math.imul(G,mt)|0,g=Math.imul(G,St),m=m+Math.imul(D,Ct)|0,b=(b=b+Math.imul(D,Yt)|0)+Math.imul(V,Ct)|0,g=g+Math.imul(V,Yt)|0,m=m+Math.imul($,Nt)|0,b=(b=b+Math.imul($,ee)|0)+Math.imul(E,Nt)|0,g=g+Math.imul(E,ee)|0;var he=(I+(m=m+Math.imul(H,Ht)|0)|0)+((8191&(b=(b=b+Math.imul(H,ue)|0)+Math.imul(q,Ht)|0))<<13)|0;I=((g=g+Math.imul(q,ue)|0)+(b>>>13)|0)+(he>>>26)|0,he&=67108863,m=Math.imul(nt,mt),b=(b=Math.imul(nt,St))+Math.imul(K,mt)|0,g=Math.imul(K,St),m=m+Math.imul(X,Ct)|0,b=(b=b+Math.imul(X,Yt)|0)+Math.imul(G,Ct)|0,g=g+Math.imul(G,Yt)|0,m=m+Math.imul(D,Nt)|0,b=(b=b+Math.imul(D,ee)|0)+Math.imul(V,Nt)|0,g=g+Math.imul(V,ee)|0,m=m+Math.imul($,Ht)|0,b=(b=b+Math.imul($,ue)|0)+Math.imul(E,Ht)|0,g=g+Math.imul(E,ue)|0;var be=(I+(m=m+Math.imul(H,Dt)|0)|0)+((8191&(b=(b=b+Math.imul(H,Jt)|0)+Math.imul(q,Dt)|0))<<13)|0;I=((g=g+Math.imul(q,Jt)|0)+(b>>>13)|0)+(be>>>26)|0,be&=67108863,m=Math.imul(Q,mt),b=(b=Math.imul(Q,St))+Math.imul(st,mt)|0,g=Math.imul(st,St),m=m+Math.imul(nt,Ct)|0,b=(b=b+Math.imul(nt,Yt)|0)+Math.imul(K,Ct)|0,g=g+Math.imul(K,Yt)|0,m=m+Math.imul(X,Nt)|0,b=(b=b+Math.imul(X,ee)|0)+Math.imul(G,Nt)|0,g=g+Math.imul(G,ee)|0,m=m+Math.imul(D,Ht)|0,b=(b=b+Math.imul(D,ue)|0)+Math.imul(V,Ht)|0,g=g+Math.imul(V,ue)|0,m=m+Math.imul($,Dt)|0,b=(b=b+Math.imul($,Jt)|0)+Math.imul(E,Dt)|0,g=g+Math.imul(E,Jt)|0;var ge=(I+(m=m+Math.imul(H,Lt)|0)|0)+((8191&(b=(b=b+Math.imul(H,ne)|0)+Math.imul(q,Lt)|0))<<13)|0;I=((g=g+Math.imul(q,ne)|0)+(b>>>13)|0)+(ge>>>26)|0,ge&=67108863,m=Math.imul(at,mt),b=(b=Math.imul(at,St))+Math.imul(ut,mt)|0,g=Math.imul(ut,St),m=m+Math.imul(Q,Ct)|0,b=(b=b+Math.imul(Q,Yt)|0)+Math.imul(st,Ct)|0,g=g+Math.imul(st,Yt)|0,m=m+Math.imul(nt,Nt)|0,b=(b=b+Math.imul(nt,ee)|0)+Math.imul(K,Nt)|0,g=g+Math.imul(K,ee)|0,m=m+Math.imul(X,Ht)|0,b=(b=b+Math.imul(X,ue)|0)+Math.imul(G,Ht)|0,g=g+Math.imul(G,ue)|0,m=m+Math.imul(D,Dt)|0,b=(b=b+Math.imul(D,Jt)|0)+Math.imul(V,Dt)|0,g=g+Math.imul(V,Jt)|0,m=m+Math.imul($,Lt)|0,b=(b=b+Math.imul($,ne)|0)+Math.imul(E,Lt)|0,g=g+Math.imul(E,ne)|0;var ve=(I+(m=m+Math.imul(H,Vt)|0)|0)+((8191&(b=(b=b+Math.imul(H,rt)|0)+Math.imul(q,Vt)|0))<<13)|0;I=((g=g+Math.imul(q,rt)|0)+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,m=Math.imul(dt,mt),b=(b=Math.imul(dt,St))+Math.imul(xt,mt)|0,g=Math.imul(xt,St),m=m+Math.imul(at,Ct)|0,b=(b=b+Math.imul(at,Yt)|0)+Math.imul(ut,Ct)|0,g=g+Math.imul(ut,Yt)|0,m=m+Math.imul(Q,Nt)|0,b=(b=b+Math.imul(Q,ee)|0)+Math.imul(st,Nt)|0,g=g+Math.imul(st,ee)|0,m=m+Math.imul(nt,Ht)|0,b=(b=b+Math.imul(nt,ue)|0)+Math.imul(K,Ht)|0,g=g+Math.imul(K,ue)|0,m=m+Math.imul(X,Dt)|0,b=(b=b+Math.imul(X,Jt)|0)+Math.imul(G,Dt)|0,g=g+Math.imul(G,Jt)|0,m=m+Math.imul(D,Lt)|0,b=(b=b+Math.imul(D,ne)|0)+Math.imul(V,Lt)|0,g=g+Math.imul(V,ne)|0,m=m+Math.imul($,Vt)|0,b=(b=b+Math.imul($,rt)|0)+Math.imul(E,Vt)|0,g=g+Math.imul(E,rt)|0;var J=(I+(m=m+Math.imul(H,ct)|0)|0)+((8191&(b=(b=b+Math.imul(H,vt)|0)+Math.imul(q,ct)|0))<<13)|0;I=((g=g+Math.imul(q,vt)|0)+(b>>>13)|0)+(J>>>26)|0,J&=67108863,m=Math.imul(yt,mt),b=(b=Math.imul(yt,St))+Math.imul(Ot,mt)|0,g=Math.imul(Ot,St),m=m+Math.imul(dt,Ct)|0,b=(b=b+Math.imul(dt,Yt)|0)+Math.imul(xt,Ct)|0,g=g+Math.imul(xt,Yt)|0,m=m+Math.imul(at,Nt)|0,b=(b=b+Math.imul(at,ee)|0)+Math.imul(ut,Nt)|0,g=g+Math.imul(ut,ee)|0,m=m+Math.imul(Q,Ht)|0,b=(b=b+Math.imul(Q,ue)|0)+Math.imul(st,Ht)|0,g=g+Math.imul(st,ue)|0,m=m+Math.imul(nt,Dt)|0,b=(b=b+Math.imul(nt,Jt)|0)+Math.imul(K,Dt)|0,g=g+Math.imul(K,Jt)|0,m=m+Math.imul(X,Lt)|0,b=(b=b+Math.imul(X,ne)|0)+Math.imul(G,Lt)|0,g=g+Math.imul(G,ne)|0,m=m+Math.imul(D,Vt)|0,b=(b=b+Math.imul(D,rt)|0)+Math.imul(V,Vt)|0,g=g+Math.imul(V,rt)|0,m=m+Math.imul($,ct)|0,b=(b=b+Math.imul($,vt)|0)+Math.imul(E,ct)|0,g=g+Math.imul(E,vt)|0;var lt=(I+(m=m+Math.imul(H,wt)|0)|0)+((8191&(b=(b=b+Math.imul(H,zt)|0)+Math.imul(q,wt)|0))<<13)|0;I=((g=g+Math.imul(q,zt)|0)+(b>>>13)|0)+(lt>>>26)|0,lt&=67108863,m=Math.imul(At,mt),b=(b=Math.imul(At,St))+Math.imul(It,mt)|0,g=Math.imul(It,St),m=m+Math.imul(yt,Ct)|0,b=(b=b+Math.imul(yt,Yt)|0)+Math.imul(Ot,Ct)|0,g=g+Math.imul(Ot,Yt)|0,m=m+Math.imul(dt,Nt)|0,b=(b=b+Math.imul(dt,ee)|0)+Math.imul(xt,Nt)|0,g=g+Math.imul(xt,ee)|0,m=m+Math.imul(at,Ht)|0,b=(b=b+Math.imul(at,ue)|0)+Math.imul(ut,Ht)|0,g=g+Math.imul(ut,ue)|0,m=m+Math.imul(Q,Dt)|0,b=(b=b+Math.imul(Q,Jt)|0)+Math.imul(st,Dt)|0,g=g+Math.imul(st,Jt)|0,m=m+Math.imul(nt,Lt)|0,b=(b=b+Math.imul(nt,ne)|0)+Math.imul(K,Lt)|0,g=g+Math.imul(K,ne)|0,m=m+Math.imul(X,Vt)|0,b=(b=b+Math.imul(X,rt)|0)+Math.imul(G,Vt)|0,g=g+Math.imul(G,rt)|0,m=m+Math.imul(D,ct)|0,b=(b=b+Math.imul(D,vt)|0)+Math.imul(V,ct)|0,g=g+Math.imul(V,vt)|0,m=m+Math.imul($,wt)|0,b=(b=b+Math.imul($,zt)|0)+Math.imul(E,wt)|0,g=g+Math.imul(E,zt)|0;var ft=(I+(m=m+Math.imul(H,jt)|0)|0)+((8191&(b=(b=b+Math.imul(H,$t)|0)+Math.imul(q,jt)|0))<<13)|0;I=((g=g+Math.imul(q,$t)|0)+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,m=Math.imul(At,Ct),b=(b=Math.imul(At,Yt))+Math.imul(It,Ct)|0,g=Math.imul(It,Yt),m=m+Math.imul(yt,Nt)|0,b=(b=b+Math.imul(yt,ee)|0)+Math.imul(Ot,Nt)|0,g=g+Math.imul(Ot,ee)|0,m=m+Math.imul(dt,Ht)|0,b=(b=b+Math.imul(dt,ue)|0)+Math.imul(xt,Ht)|0,g=g+Math.imul(xt,ue)|0,m=m+Math.imul(at,Dt)|0,b=(b=b+Math.imul(at,Jt)|0)+Math.imul(ut,Dt)|0,g=g+Math.imul(ut,Jt)|0,m=m+Math.imul(Q,Lt)|0,b=(b=b+Math.imul(Q,ne)|0)+Math.imul(st,Lt)|0,g=g+Math.imul(st,ne)|0,m=m+Math.imul(nt,Vt)|0,b=(b=b+Math.imul(nt,rt)|0)+Math.imul(K,Vt)|0,g=g+Math.imul(K,rt)|0,m=m+Math.imul(X,ct)|0,b=(b=b+Math.imul(X,vt)|0)+Math.imul(G,ct)|0,g=g+Math.imul(G,vt)|0,m=m+Math.imul(D,wt)|0,b=(b=b+Math.imul(D,zt)|0)+Math.imul(V,wt)|0,g=g+Math.imul(V,zt)|0;var pt=(I+(m=m+Math.imul($,jt)|0)|0)+((8191&(b=(b=b+Math.imul($,$t)|0)+Math.imul(E,jt)|0))<<13)|0;I=((g=g+Math.imul(E,$t)|0)+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,m=Math.imul(At,Nt),b=(b=Math.imul(At,ee))+Math.imul(It,Nt)|0,g=Math.imul(It,ee),m=m+Math.imul(yt,Ht)|0,b=(b=b+Math.imul(yt,ue)|0)+Math.imul(Ot,Ht)|0,g=g+Math.imul(Ot,ue)|0,m=m+Math.imul(dt,Dt)|0,b=(b=b+Math.imul(dt,Jt)|0)+Math.imul(xt,Dt)|0,g=g+Math.imul(xt,Jt)|0,m=m+Math.imul(at,Lt)|0,b=(b=b+Math.imul(at,ne)|0)+Math.imul(ut,Lt)|0,g=g+Math.imul(ut,ne)|0,m=m+Math.imul(Q,Vt)|0,b=(b=b+Math.imul(Q,rt)|0)+Math.imul(st,Vt)|0,g=g+Math.imul(st,rt)|0,m=m+Math.imul(nt,ct)|0,b=(b=b+Math.imul(nt,vt)|0)+Math.imul(K,ct)|0,g=g+Math.imul(K,vt)|0,m=m+Math.imul(X,wt)|0,b=(b=b+Math.imul(X,zt)|0)+Math.imul(G,wt)|0,g=g+Math.imul(G,zt)|0;var Mt=(I+(m=m+Math.imul(D,jt)|0)|0)+((8191&(b=(b=b+Math.imul(D,$t)|0)+Math.imul(V,jt)|0))<<13)|0;I=((g=g+Math.imul(V,$t)|0)+(b>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,m=Math.imul(At,Ht),b=(b=Math.imul(At,ue))+Math.imul(It,Ht)|0,g=Math.imul(It,ue),m=m+Math.imul(yt,Dt)|0,b=(b=b+Math.imul(yt,Jt)|0)+Math.imul(Ot,Dt)|0,g=g+Math.imul(Ot,Jt)|0,m=m+Math.imul(dt,Lt)|0,b=(b=b+Math.imul(dt,ne)|0)+Math.imul(xt,Lt)|0,g=g+Math.imul(xt,ne)|0,m=m+Math.imul(at,Vt)|0,b=(b=b+Math.imul(at,rt)|0)+Math.imul(ut,Vt)|0,g=g+Math.imul(ut,rt)|0,m=m+Math.imul(Q,ct)|0,b=(b=b+Math.imul(Q,vt)|0)+Math.imul(st,ct)|0,g=g+Math.imul(st,vt)|0,m=m+Math.imul(nt,wt)|0,b=(b=b+Math.imul(nt,zt)|0)+Math.imul(K,wt)|0,g=g+Math.imul(K,zt)|0;var bt=(I+(m=m+Math.imul(X,jt)|0)|0)+((8191&(b=(b=b+Math.imul(X,$t)|0)+Math.imul(G,jt)|0))<<13)|0;I=((g=g+Math.imul(G,$t)|0)+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,m=Math.imul(At,Dt),b=(b=Math.imul(At,Jt))+Math.imul(It,Dt)|0,g=Math.imul(It,Jt),m=m+Math.imul(yt,Lt)|0,b=(b=b+Math.imul(yt,ne)|0)+Math.imul(Ot,Lt)|0,g=g+Math.imul(Ot,ne)|0,m=m+Math.imul(dt,Vt)|0,b=(b=b+Math.imul(dt,rt)|0)+Math.imul(xt,Vt)|0,g=g+Math.imul(xt,rt)|0,m=m+Math.imul(at,ct)|0,b=(b=b+Math.imul(at,vt)|0)+Math.imul(ut,ct)|0,g=g+Math.imul(ut,vt)|0,m=m+Math.imul(Q,wt)|0,b=(b=b+Math.imul(Q,zt)|0)+Math.imul(st,wt)|0,g=g+Math.imul(st,zt)|0;var gt=(I+(m=m+Math.imul(nt,jt)|0)|0)+((8191&(b=(b=b+Math.imul(nt,$t)|0)+Math.imul(K,jt)|0))<<13)|0;I=((g=g+Math.imul(K,$t)|0)+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,m=Math.imul(At,Lt),b=(b=Math.imul(At,ne))+Math.imul(It,Lt)|0,g=Math.imul(It,ne),m=m+Math.imul(yt,Vt)|0,b=(b=b+Math.imul(yt,rt)|0)+Math.imul(Ot,Vt)|0,g=g+Math.imul(Ot,rt)|0,m=m+Math.imul(dt,ct)|0,b=(b=b+Math.imul(dt,vt)|0)+Math.imul(xt,ct)|0,g=g+Math.imul(xt,vt)|0,m=m+Math.imul(at,wt)|0,b=(b=b+Math.imul(at,zt)|0)+Math.imul(ut,wt)|0,g=g+Math.imul(ut,zt)|0;var Zt=(I+(m=m+Math.imul(Q,jt)|0)|0)+((8191&(b=(b=b+Math.imul(Q,$t)|0)+Math.imul(st,jt)|0))<<13)|0;I=((g=g+Math.imul(st,$t)|0)+(b>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,m=Math.imul(At,Vt),b=(b=Math.imul(At,rt))+Math.imul(It,Vt)|0,g=Math.imul(It,rt),m=m+Math.imul(yt,ct)|0,b=(b=b+Math.imul(yt,vt)|0)+Math.imul(Ot,ct)|0,g=g+Math.imul(Ot,vt)|0,m=m+Math.imul(dt,wt)|0,b=(b=b+Math.imul(dt,zt)|0)+Math.imul(xt,wt)|0,g=g+Math.imul(xt,zt)|0;var qt=(I+(m=m+Math.imul(at,jt)|0)|0)+((8191&(b=(b=b+Math.imul(at,$t)|0)+Math.imul(ut,jt)|0))<<13)|0;I=((g=g+Math.imul(ut,$t)|0)+(b>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(At,ct),b=(b=Math.imul(At,vt))+Math.imul(It,ct)|0,g=Math.imul(It,vt),m=m+Math.imul(yt,wt)|0,b=(b=b+Math.imul(yt,zt)|0)+Math.imul(Ot,wt)|0,g=g+Math.imul(Ot,zt)|0;var Wt=(I+(m=m+Math.imul(dt,jt)|0)|0)+((8191&(b=(b=b+Math.imul(dt,$t)|0)+Math.imul(xt,jt)|0))<<13)|0;I=((g=g+Math.imul(xt,$t)|0)+(b>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,m=Math.imul(At,wt),b=(b=Math.imul(At,zt))+Math.imul(It,wt)|0,g=Math.imul(It,zt);var Bt=(I+(m=m+Math.imul(yt,jt)|0)|0)+((8191&(b=(b=b+Math.imul(yt,$t)|0)+Math.imul(Ot,jt)|0))<<13)|0;I=((g=g+Math.imul(Ot,$t)|0)+(b>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var se=(I+(m=Math.imul(At,jt))|0)+((8191&(b=(b=Math.imul(At,$t))+Math.imul(It,jt)|0))<<13)|0;return I=((g=Math.imul(It,$t))+(b>>>13)|0)+(se>>>26)|0,se&=67108863,R[0]=Ut,R[1]=Xt,R[2]=pe,R[3]=he,R[4]=be,R[5]=ge,R[6]=ve,R[7]=J,R[8]=lt,R[9]=ft,R[10]=pt,R[11]=Mt,R[12]=bt,R[13]=gt,R[14]=Zt,R[15]=qt,R[16]=Wt,R[17]=Bt,R[18]=se,I!==0&&(R[19]=I,v.length++),v};function w(k,T,v){return new x().mulp(k,T,v)}function x(k,T){this.x=k,this.y=T}Math.imul||(f=p),t.prototype.mulTo=function(k,T){var v=this.length+k.length;return this.length===10&&k.length===10?f(this,k,T):v<63?p(this,k,T):v<1024?function(m,b,g){g.negative=b.negative^m.negative,g.length=m.length+b.length;for(var y=0,C=0,R=0;R>>26)|0)>>>26,I&=67108863}g.words[R]=z,y=I,I=C}return y!==0?g.words[R]=y:g.length--,g.strip()}(this,k,T):w(this,k,T)},x.prototype.makeRBT=function(k){for(var T=new Array(k),v=t.prototype._countBits(k)-1,m=0;m>=1;return m},x.prototype.permute=function(k,T,v,m,b,g){for(var y=0;y>>=1)b++;return 1<>>=13,v[2*g+1]=8191&b,b>>>=13;for(g=2*T;g>=26,T+=m/67108864|0,T+=b>>>26,this.words[v]=67108863&b}return T!==0&&(this.words[v]=T,this.length++),this},t.prototype.muln=function(k){return this.clone().imuln(k)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(k){var T=function(g){for(var y=new Array(g.bitLength()),C=0;C>>I}return y}(k);if(T.length===0)return new t(1);for(var v=this,m=0;m=0);var T,v=k%26,m=(k-v)/26,b=67108863>>>26-v<<26-v;if(v!==0){var g=0;for(T=0;T>>26-v}g&&(this.words[T]=g,this.length++)}if(m!==0){for(T=this.length-1;T>=0;T--)this.words[T+m]=this.words[T];for(T=0;T=0),m=T?(T-T%26)/26:0;var b=k%26,g=Math.min((k-b)/26,this.length),y=67108863^67108863>>>b<g)for(this.length-=g,R=0;R=0&&(I!==0||R>=m);R--){var z=0|this.words[R];this.words[R]=I<<26-b|z>>>b,I=z&y}return C&&I!==0&&(C.words[C.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(k,T,v){return a(this.negative===0),this.iushrn(k,T,v)},t.prototype.shln=function(k){return this.clone().ishln(k)},t.prototype.ushln=function(k){return this.clone().iushln(k)},t.prototype.shrn=function(k){return this.clone().ishrn(k)},t.prototype.ushrn=function(k){return this.clone().iushrn(k)},t.prototype.testn=function(k){a(typeof k=="number"&&k>=0);var T=k%26,v=(k-T)/26,m=1<=0);var T=k%26,v=(k-T)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(T!==0&&v++,this.length=Math.min(v,this.length),T!==0){var m=67108863^67108863>>>T<=67108864;T++)this.words[T]-=67108864,T===this.length-1?this.words[T+1]=1:this.words[T+1]++;return this.length=Math.max(this.length,T+1),this},t.prototype.isubn=function(k){if(a(typeof k=="number"),a(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var T=0;T>26)-(C/67108864|0),this.words[m+v]=67108863&b}for(;m>26,this.words[m+v]=67108863&b;if(y===0)return this.strip();for(a(y===-1),y=0,m=0;m>26,this.words[m]=67108863&b;return this.negative=1,this.strip()},t.prototype._wordDiv=function(k,T){var v=(this.length,k.length),m=this.clone(),b=k,g=0|b.words[b.length-1];(v=26-this._countBits(g))!==0&&(b=b.ushln(v),m.iushln(v),g=0|b.words[b.length-1]);var y,C=m.length-b.length;if(T!=="mod"){(y=new t(null)).length=C+1,y.words=new Array(y.length);for(var R=0;R=0;z--){var H=67108864*(0|m.words[b.length+z])+(0|m.words[b.length+z-1]);for(H=Math.min(H/g|0,67108863),m._ishlnsubmul(b,H,z);m.negative!==0;)H--,m.negative=0,m._ishlnsubmul(b,1,z),m.isZero()||(m.negative^=1);y&&(y.words[z]=H)}return y&&y.strip(),m.strip(),T!=="div"&&v!==0&&m.iushrn(v),{div:y||null,mod:m}},t.prototype.divmod=function(k,T,v){return a(!k.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&k.negative===0?(g=this.neg().divmod(k,T),T!=="mod"&&(m=g.div.neg()),T!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.iadd(k)),{div:m,mod:b}):this.negative===0&&k.negative!==0?(g=this.divmod(k.neg(),T),T!=="mod"&&(m=g.div.neg()),{div:m,mod:g.mod}):this.negative&k.negative?(g=this.neg().divmod(k.neg(),T),T!=="div"&&(b=g.mod.neg(),v&&b.negative!==0&&b.isub(k)),{div:g.div,mod:b}):k.length>this.length||this.cmp(k)<0?{div:new t(0),mod:this}:k.length===1?T==="div"?{div:this.divn(k.words[0]),mod:null}:T==="mod"?{div:null,mod:new t(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new t(this.modn(k.words[0]))}:this._wordDiv(k,T);var m,b,g},t.prototype.div=function(k){return this.divmod(k,"div",!1).div},t.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},t.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},t.prototype.divRound=function(k){var T=this.divmod(k);if(T.mod.isZero())return T.div;var v=T.div.negative!==0?T.mod.isub(k):T.mod,m=k.ushrn(1),b=k.andln(1),g=v.cmp(m);return g<0||b===1&&g===0?T.div:T.div.negative!==0?T.div.isubn(1):T.div.iaddn(1)},t.prototype.modn=function(k){a(k<=67108863);for(var T=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(T*v+(0|this.words[m]))%k;return v},t.prototype.idivn=function(k){a(k<=67108863);for(var T=0,v=this.length-1;v>=0;v--){var m=(0|this.words[v])+67108864*T;this.words[v]=m/k|0,T=m%k}return this.strip()},t.prototype.divn=function(k){return this.clone().idivn(k)},t.prototype.egcd=function(k){a(k.negative===0),a(!k.isZero());var T=this,v=k.clone();T=T.negative!==0?T.umod(k):T.clone();for(var m=new t(1),b=new t(0),g=new t(0),y=new t(1),C=0;T.isEven()&&v.isEven();)T.iushrn(1),v.iushrn(1),++C;for(var R=v.clone(),I=T.clone();!T.isZero();){for(var z=0,H=1;!(T.words[0]&H)&&z<26;++z,H<<=1);if(z>0)for(T.iushrn(z);z-- >0;)(m.isOdd()||b.isOdd())&&(m.iadd(R),b.isub(I)),m.iushrn(1),b.iushrn(1);for(var q=0,O=1;!(v.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(v.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(R),y.isub(I)),g.iushrn(1),y.iushrn(1);T.cmp(v)>=0?(T.isub(v),m.isub(g),b.isub(y)):(v.isub(T),g.isub(m),y.isub(b))}return{a:g,b:y,gcd:v.iushln(C)}},t.prototype._invmp=function(k){a(k.negative===0),a(!k.isZero());var T=this,v=k.clone();T=T.negative!==0?T.umod(k):T.clone();for(var m,b=new t(1),g=new t(0),y=v.clone();T.cmpn(1)>0&&v.cmpn(1)>0;){for(var C=0,R=1;!(T.words[0]&R)&&C<26;++C,R<<=1);if(C>0)for(T.iushrn(C);C-- >0;)b.isOdd()&&b.iadd(y),b.iushrn(1);for(var I=0,z=1;!(v.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(v.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(y),g.iushrn(1);T.cmp(v)>=0?(T.isub(v),b.isub(g)):(v.isub(T),g.isub(b))}return(m=T.cmpn(1)===0?b:g).cmpn(0)<0&&m.iadd(k),m},t.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var T=this.clone(),v=k.clone();T.negative=0,v.negative=0;for(var m=0;T.isEven()&&v.isEven();m++)T.iushrn(1),v.iushrn(1);for(;;){for(;T.isEven();)T.iushrn(1);for(;v.isEven();)v.iushrn(1);var b=T.cmp(v);if(b<0){var g=T;T=v,v=g}else if(b===0||v.cmpn(1)===0)break;T.isub(v)}return v.iushln(m)},t.prototype.invm=function(k){return this.egcd(k).a.umod(k)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(k){return this.words[0]&k},t.prototype.bincn=function(k){a(typeof k=="number");var T=k%26,v=(k-T)/26,m=1<>>26,y&=67108863,this.words[g]=y}return b!==0&&(this.words[g]=b,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(k){var T,v=k<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;if(this.strip(),this.length>1)T=1;else{v&&(k=-k),a(k<=67108863,"Number is too big");var m=0|this.words[0];T=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=0|this.words[v],b=0|k.words[v];if(m!==b){mb&&(T=1);break}}return T},t.prototype.gtn=function(k){return this.cmpn(k)===1},t.prototype.gt=function(k){return this.cmp(k)===1},t.prototype.gten=function(k){return this.cmpn(k)>=0},t.prototype.gte=function(k){return this.cmp(k)>=0},t.prototype.ltn=function(k){return this.cmpn(k)===-1},t.prototype.lt=function(k){return this.cmp(k)===-1},t.prototype.lten=function(k){return this.cmpn(k)<=0},t.prototype.lte=function(k){return this.cmp(k)<=0},t.prototype.eqn=function(k){return this.cmpn(k)===0},t.prototype.eq=function(k){return this.cmp(k)===0},t.red=function(k){return new U(k)},t.prototype.toRed=function(k){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(k){return this.red=k,this},t.prototype.forceRed=function(k){return a(!this.red,"Already a number in reduction context"),this._forceRed(k)},t.prototype.redAdd=function(k){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},t.prototype.redIAdd=function(k){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},t.prototype.redSub=function(k){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},t.prototype.redISub=function(k){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},t.prototype.redShl=function(k){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},t.prototype.redMul=function(k){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},t.prototype.redIMul=function(k){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(k){return a(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var A={k256:null,p224:null,p192:null,p25519:null};function N(k,T){this.name=k,this.p=new t(T,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function L(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function F(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function U(k){if(typeof k=="string"){var T=t._prime(k);this.m=T.p,this.prime=T}else a(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}function B(k){U.call(this,k),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}N.prototype._tmp=function(){var k=new t(null);return k.words=new Array(Math.ceil(this.n/13)),k},N.prototype.ireduce=function(k){var T,v=k;do this.split(v,this.tmp),T=(v=(v=this.imulK(v)).iadd(this.tmp)).bitLength();while(T>this.n);var m=T0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},N.prototype.split=function(k,T){k.iushrn(this.n,0,T)},N.prototype.imulK=function(k){return k.imul(this.k)},n(L,N),L.prototype.split=function(k,T){for(var v=Math.min(k.length,9),m=0;m>>22,b=g}b>>>=22,k.words[m-10]=b,b===0&&k.length>10?k.length-=10:k.length-=9},L.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var T=0,v=0;v>>=26,k.words[v]=b,T=m}return T!==0&&(k.words[k.length++]=T),k},t._prime=function(k){if(A[k])return A[k];var T;if(k==="k256")T=new L;else if(k==="p224")T=new j;else if(k==="p192")T=new F;else{if(k!=="p25519")throw new Error("Unknown prime "+k);T=new P}return A[k]=T,T},U.prototype._verify1=function(k){a(k.negative===0,"red works only with positives"),a(k.red,"red works only with red numbers")},U.prototype._verify2=function(k,T){a((k.negative|T.negative)==0,"red works only with positives"),a(k.red&&k.red===T.red,"red works only with red numbers")},U.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},U.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},U.prototype.add=function(k,T){this._verify2(k,T);var v=k.add(T);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},U.prototype.iadd=function(k,T){this._verify2(k,T);var v=k.iadd(T);return v.cmp(this.m)>=0&&v.isub(this.m),v},U.prototype.sub=function(k,T){this._verify2(k,T);var v=k.sub(T);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},U.prototype.isub=function(k,T){this._verify2(k,T);var v=k.isub(T);return v.cmpn(0)<0&&v.iadd(this.m),v},U.prototype.shl=function(k,T){return this._verify1(k),this.imod(k.ushln(T))},U.prototype.imul=function(k,T){return this._verify2(k,T),this.imod(k.imul(T))},U.prototype.mul=function(k,T){return this._verify2(k,T),this.imod(k.mul(T))},U.prototype.isqr=function(k){return this.imul(k,k.clone())},U.prototype.sqr=function(k){return this.mul(k,k)},U.prototype.sqrt=function(k){if(k.isZero())return k.clone();var T=this.m.andln(3);if(a(T%2==1),T===3){var v=this.m.add(new t(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),b=0;!m.isZero()&&m.andln(1)===0;)b++,m.iushrn(1);a(!m.isZero());var g=new t(1).toRed(this),y=g.redNeg(),C=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new t(2*R*R).toRed(this);this.pow(R,C).cmp(y)!==0;)R.redIAdd(y);for(var I=this.pow(R,m),z=this.pow(k,m.addn(1).iushrn(1)),H=this.pow(k,m),q=b;H.cmp(g)!==0;){for(var O=H,$=0;O.cmp(g)!==0;$++)O=O.redSqr();a($=0;m--){for(var R=T.words[m],I=C-1;I>=0;I--){var z=R>>I&1;b!==v[0]&&(b=this.sqr(b)),z!==0||g!==0?(g<<=1,g|=z,(++y===4||m===0&&I===0)&&(b=this.mul(b,v[g]),y=0,g=0)):y=0}C=26}return b},U.prototype.convertTo=function(k){var T=k.umod(this.m);return T===k?T.clone():T},U.prototype.convertFrom=function(k){var T=k.clone();return T.red=null,T},t.mont=function(k){return new B(k)},n(B,U),B.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},B.prototype.convertFrom=function(k){var T=this.imod(k.mul(this.rinv));return T.red=null,T},B.prototype.imul=function(k,T){if(k.isZero()||T.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(T),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.mul=function(k,T){if(k.isZero()||T.isZero())return new t(0)._forceRed(this);var v=k.mul(T),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=v.isub(m).iushrn(this.shift),g=b;return b.cmp(this.m)>=0?g=b.isub(this.m):b.cmpn(0)<0&&(g=b.iadd(this.m)),g._forceRed(this)},B.prototype.invm=function(k){return this.imod(k._invmp(this.m).mul(this.r2))._forceRed(this)}})(S===void 0||S)},{buffer:188}],185:[function(e,S,_){_.byteLength=function(s){var h=l(s),c=h[0],u=h[1];return 3*(c+u)/4-u},_.toByteArray=function(s){var h,c,u=l(s),p=u[0],f=u[1],w=new a(function(N,L,j){return 3*(L+j)/4-j}(0,p,f)),x=0,A=f>0?p-4:p;for(c=0;c>16&255,w[x++]=h>>8&255,w[x++]=255&h;return f===2&&(h=o[s.charCodeAt(c)]<<2|o[s.charCodeAt(c+1)]>>4,w[x++]=255&h),f===1&&(h=o[s.charCodeAt(c)]<<10|o[s.charCodeAt(c+1)]<<4|o[s.charCodeAt(c+2)]>>2,w[x++]=h>>8&255,w[x++]=255&h),w},_.fromByteArray=function(s){for(var h,c=s.length,u=c%3,p=[],f=0,w=c-u;fw?w:f+16383));return u===1?(h=s[c-1],p.push(d[h>>2]+d[h<<4&63]+"==")):u===2&&(h=(s[c-2]<<8)+s[c-1],p.push(d[h>>10]+d[h>>4&63]+d[h<<2&63]+"=")),p.join("")};for(var d=[],o=[],a=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=n.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");var c=s.indexOf("=");return c===-1&&(c=h),[c,c===h?0:4-c%4]}function i(s,h,c){for(var u,p,f=[],w=h;w>18&63]+d[p>>12&63]+d[p>>6&63]+d[63&p]);return f.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],186:[function(e,S,_){(function(d,o){function a(v,m){if(!v)throw new Error(m||"Assertion failed")}function n(v,m){v.super_=m;var b=function(){};b.prototype=m.prototype,v.prototype=new b,v.prototype.constructor=v}function t(v,m,b){if(t.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&(m!=="le"&&m!=="be"||(b=m,m=10),this._init(v||0,m||10,b||"be"))}var r;typeof d=="object"?d.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{r=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:e("buffer").Buffer}catch{}function l(v,m){var b=v.charCodeAt(m);return b>=48&&b<=57?b-48:b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:void a(!1,"Invalid character in "+v)}function i(v,m,b){var g=l(v,b);return b-1>=m&&(g|=l(v,b-1)<<4),g}function s(v,m,b,g){for(var y=0,C=0,R=Math.min(v.length,b),I=m;I=49?z-49+10:z>=17?z-17+10:z,a(z>=0&&C0?v:m},t.min=function(v,m){return v.cmp(m)<0?v:m},t.prototype._init=function(v,m,b){if(typeof v=="number")return this._initNumber(v,m,b);if(typeof v=="object")return this._initArray(v,m,b);m==="hex"&&(m=16),a(m===(0|m)&&m>=2&&m<=36);var g=0;(v=v.toString().replace(/\s+/g,""))[0]==="-"&&(g++,this.negative=1),g=0;g-=3)C=v[g]|v[g-1]<<8|v[g-2]<<16,this.words[y]|=C<>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);else if(b==="le")for(g=0,y=0;g>>26-R&67108863,(R+=24)>=26&&(R-=26,y++);return this._strip()},t.prototype._parseHex=function(v,m,b){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var g=0;g=m;g-=2)y=i(v,m,g)<=18?(C-=18,R+=1,this.words[R]|=y>>>26):C+=8;else for(g=(v.length-m)%2==0?m+1:m;g=18?(C-=18,R+=1,this.words[R]|=y>>>26):C+=8;this._strip()},t.prototype._parseBase=function(v,m,b){this.words=[0],this.length=1;for(var g=0,y=1;y<=67108863;y*=m)g++;g--,y=y/m|0;for(var C=v.length-b,R=C%g,I=Math.min(C,C-R)+b,z=0,H=b;H1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{t.prototype.inspect=c}else t.prototype.inspect=c;function c(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(v,m){var b;if(m=0|m||1,(v=v||10)===16||v==="hex"){b="";for(var g=0,y=0,C=0;C>>24-g&16777215,(g+=2)>=26&&(g-=26,C--),b=y!==0||C!==this.length-1?u[6-I.length]+I+b:I+b}for(y!==0&&(b=y.toString(16)+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(v===(0|v)&&v>=2&&v<=36){var z=p[v],H=f[v];b="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modrn(H).toString(v);b=(q=q.idivn(H)).isZero()?O+b:u[z-O.length]+O+b}for(this.isZero()&&(b="0"+b);b.length%m!=0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=67108864*this.words[1]:this.length===3&&this.words[2]===1?v+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},t.prototype.toJSON=function(){return this.toString(16,2)},r&&(t.prototype.toBuffer=function(v,m){return this.toArrayLike(r,v,m)}),t.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};function w(v,m,b){b.negative=m.negative^v.negative;var g=v.length+m.length|0;b.length=g,g=g-1|0;var y=0|v.words[0],C=0|m.words[0],R=y*C,I=67108863&R,z=R/67108864|0;b.words[0]=I;for(var H=1;H>>26,O=67108863&z,$=Math.min(H,m.length-1),E=Math.max(0,H-v.length+1);E<=$;E++){var M=H-E|0;q+=(R=(y=0|v.words[M])*(C=0|m.words[E])+O)/67108864|0,O=67108863&R}b.words[H]=0|O,z=0|q}return z!==0?b.words[H]=0|z:b.length--,b._strip()}t.prototype.toArrayLike=function(v,m,b){this._strip();var g=this.byteLength(),y=b||Math.max(1,g);a(g<=y,"byte array longer than desired length"),a(y>0,"Requested array length <= 0");var C=function(R,I){return R.allocUnsafe?R.allocUnsafe(I):new R(I)}(v,y);return this["_toArrayLike"+(m==="le"?"LE":"BE")](C,g),C},t.prototype._toArrayLikeLE=function(v,m){for(var b=0,g=0,y=0,C=0;y>8&255),b>16&255),C===6?(b>24&255),g=0,C=0):(g=R>>>24,C+=2)}if(b=0&&(v[b--]=R>>8&255),b>=0&&(v[b--]=R>>16&255),C===6?(b>=0&&(v[b--]=R>>24&255),g=0,C=0):(g=R>>>24,C+=2)}if(b>=0)for(v[b--]=g;b>=0;)v[b--]=0},Math.clz32?t.prototype._countBits=function(v){return 32-Math.clz32(v)}:t.prototype._countBits=function(v){var m=v,b=0;return m>=4096&&(b+=13,m>>>=13),m>=64&&(b+=7,m>>>=7),m>=8&&(b+=4,m>>>=4),m>=2&&(b+=2,m>>>=2),b+m},t.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,b=0;return!(8191&m)&&(b+=13,m>>>=13),!(127&m)&&(b+=7,m>>>=7),!(15&m)&&(b+=4,m>>>=4),!(3&m)&&(b+=2,m>>>=2),!(1&m)&&b++,b},t.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return 26*(this.length-1)+m},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},t.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},t.prototype.iuand=function(v){var m;m=this.length>v.length?v:this;for(var b=0;bv.length?this.clone().iand(v):v.clone().iand(this)},t.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},t.prototype.iuxor=function(v){var m,b;this.length>v.length?(m=this,b=v):(m=v,b=this);for(var g=0;gv.length?this.clone().ixor(v):v.clone().ixor(this)},t.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},t.prototype.inotn=function(v){a(typeof v=="number"&&v>=0);var m=0|Math.ceil(v/26),b=v%26;this._expand(m),b>0&&m--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-b),this._strip()},t.prototype.notn=function(v){return this.clone().inotn(v)},t.prototype.setn=function(v,m){a(typeof v=="number"&&v>=0);var b=v/26|0,g=v%26;return this._expand(b+1),this.words[b]=m?this.words[b]|1<v.length?(b=this,g=v):(b=v,g=this);for(var y=0,C=0;C>>26;for(;y!==0&&C>>26;if(this.length=b.length,y!==0)this.words[this.length]=y,this.length++;else if(b!==this)for(;Cv.length?this.clone().iadd(v):v.clone().iadd(this)},t.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var b,g,y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(b=this,g=v):(b=v,g=this);for(var C=0,R=0;R>26,this.words[R]=67108863&m;for(;C!==0&&R>26,this.words[R]=67108863&m;if(C===0&&R>>13,E=0|R[1],M=8191&E,D=E>>>13,V=0|R[2],Y=8191&V,X=V>>>13,G=0|R[3],et=8191&G,nt=G>>>13,K=0|R[4],tt=8191&K,Q=K>>>13,st=0|R[5],it=8191&st,at=st>>>13,ut=0|R[6],ht=8191&ut,dt=ut>>>13,xt=0|R[7],_t=8191&xt,yt=xt>>>13,Ot=0|R[8],Et=8191&Ot,At=Ot>>>13,It=0|R[9],kt=8191&It,mt=It>>>13,St=0|I[0],Tt=8191&St,Ct=St>>>13,Yt=0|I[1],ie=8191&Yt,Nt=Yt>>>13,ee=0|I[2],Kt=8191&ee,Ht=ee>>>13,ue=0|I[3],re=8191&ue,Dt=ue>>>13,Jt=0|I[4],ae=8191&Jt,Lt=Jt>>>13,ne=0|I[5],le=8191&ne,Vt=ne>>>13,rt=0|I[6],ot=8191&rt,ct=rt>>>13,vt=0|I[7],Ft=8191&vt,wt=vt>>>13,zt=0|I[8],Pt=8191&zt,jt=zt>>>13,$t=0|I[9],Ut=8191&$t,Xt=$t>>>13;b.negative=v.negative^m.negative,b.length=19;var pe=(H+(g=Math.imul(O,Tt))|0)+((8191&(y=(y=Math.imul(O,Ct))+Math.imul($,Tt)|0))<<13)|0;H=((C=Math.imul($,Ct))+(y>>>13)|0)+(pe>>>26)|0,pe&=67108863,g=Math.imul(M,Tt),y=(y=Math.imul(M,Ct))+Math.imul(D,Tt)|0,C=Math.imul(D,Ct);var he=(H+(g=g+Math.imul(O,ie)|0)|0)+((8191&(y=(y=y+Math.imul(O,Nt)|0)+Math.imul($,ie)|0))<<13)|0;H=((C=C+Math.imul($,Nt)|0)+(y>>>13)|0)+(he>>>26)|0,he&=67108863,g=Math.imul(Y,Tt),y=(y=Math.imul(Y,Ct))+Math.imul(X,Tt)|0,C=Math.imul(X,Ct),g=g+Math.imul(M,ie)|0,y=(y=y+Math.imul(M,Nt)|0)+Math.imul(D,ie)|0,C=C+Math.imul(D,Nt)|0;var be=(H+(g=g+Math.imul(O,Kt)|0)|0)+((8191&(y=(y=y+Math.imul(O,Ht)|0)+Math.imul($,Kt)|0))<<13)|0;H=((C=C+Math.imul($,Ht)|0)+(y>>>13)|0)+(be>>>26)|0,be&=67108863,g=Math.imul(et,Tt),y=(y=Math.imul(et,Ct))+Math.imul(nt,Tt)|0,C=Math.imul(nt,Ct),g=g+Math.imul(Y,ie)|0,y=(y=y+Math.imul(Y,Nt)|0)+Math.imul(X,ie)|0,C=C+Math.imul(X,Nt)|0,g=g+Math.imul(M,Kt)|0,y=(y=y+Math.imul(M,Ht)|0)+Math.imul(D,Kt)|0,C=C+Math.imul(D,Ht)|0;var ge=(H+(g=g+Math.imul(O,re)|0)|0)+((8191&(y=(y=y+Math.imul(O,Dt)|0)+Math.imul($,re)|0))<<13)|0;H=((C=C+Math.imul($,Dt)|0)+(y>>>13)|0)+(ge>>>26)|0,ge&=67108863,g=Math.imul(tt,Tt),y=(y=Math.imul(tt,Ct))+Math.imul(Q,Tt)|0,C=Math.imul(Q,Ct),g=g+Math.imul(et,ie)|0,y=(y=y+Math.imul(et,Nt)|0)+Math.imul(nt,ie)|0,C=C+Math.imul(nt,Nt)|0,g=g+Math.imul(Y,Kt)|0,y=(y=y+Math.imul(Y,Ht)|0)+Math.imul(X,Kt)|0,C=C+Math.imul(X,Ht)|0,g=g+Math.imul(M,re)|0,y=(y=y+Math.imul(M,Dt)|0)+Math.imul(D,re)|0,C=C+Math.imul(D,Dt)|0;var ve=(H+(g=g+Math.imul(O,ae)|0)|0)+((8191&(y=(y=y+Math.imul(O,Lt)|0)+Math.imul($,ae)|0))<<13)|0;H=((C=C+Math.imul($,Lt)|0)+(y>>>13)|0)+(ve>>>26)|0,ve&=67108863,g=Math.imul(it,Tt),y=(y=Math.imul(it,Ct))+Math.imul(at,Tt)|0,C=Math.imul(at,Ct),g=g+Math.imul(tt,ie)|0,y=(y=y+Math.imul(tt,Nt)|0)+Math.imul(Q,ie)|0,C=C+Math.imul(Q,Nt)|0,g=g+Math.imul(et,Kt)|0,y=(y=y+Math.imul(et,Ht)|0)+Math.imul(nt,Kt)|0,C=C+Math.imul(nt,Ht)|0,g=g+Math.imul(Y,re)|0,y=(y=y+Math.imul(Y,Dt)|0)+Math.imul(X,re)|0,C=C+Math.imul(X,Dt)|0,g=g+Math.imul(M,ae)|0,y=(y=y+Math.imul(M,Lt)|0)+Math.imul(D,ae)|0,C=C+Math.imul(D,Lt)|0;var J=(H+(g=g+Math.imul(O,le)|0)|0)+((8191&(y=(y=y+Math.imul(O,Vt)|0)+Math.imul($,le)|0))<<13)|0;H=((C=C+Math.imul($,Vt)|0)+(y>>>13)|0)+(J>>>26)|0,J&=67108863,g=Math.imul(ht,Tt),y=(y=Math.imul(ht,Ct))+Math.imul(dt,Tt)|0,C=Math.imul(dt,Ct),g=g+Math.imul(it,ie)|0,y=(y=y+Math.imul(it,Nt)|0)+Math.imul(at,ie)|0,C=C+Math.imul(at,Nt)|0,g=g+Math.imul(tt,Kt)|0,y=(y=y+Math.imul(tt,Ht)|0)+Math.imul(Q,Kt)|0,C=C+Math.imul(Q,Ht)|0,g=g+Math.imul(et,re)|0,y=(y=y+Math.imul(et,Dt)|0)+Math.imul(nt,re)|0,C=C+Math.imul(nt,Dt)|0,g=g+Math.imul(Y,ae)|0,y=(y=y+Math.imul(Y,Lt)|0)+Math.imul(X,ae)|0,C=C+Math.imul(X,Lt)|0,g=g+Math.imul(M,le)|0,y=(y=y+Math.imul(M,Vt)|0)+Math.imul(D,le)|0,C=C+Math.imul(D,Vt)|0;var lt=(H+(g=g+Math.imul(O,ot)|0)|0)+((8191&(y=(y=y+Math.imul(O,ct)|0)+Math.imul($,ot)|0))<<13)|0;H=((C=C+Math.imul($,ct)|0)+(y>>>13)|0)+(lt>>>26)|0,lt&=67108863,g=Math.imul(_t,Tt),y=(y=Math.imul(_t,Ct))+Math.imul(yt,Tt)|0,C=Math.imul(yt,Ct),g=g+Math.imul(ht,ie)|0,y=(y=y+Math.imul(ht,Nt)|0)+Math.imul(dt,ie)|0,C=C+Math.imul(dt,Nt)|0,g=g+Math.imul(it,Kt)|0,y=(y=y+Math.imul(it,Ht)|0)+Math.imul(at,Kt)|0,C=C+Math.imul(at,Ht)|0,g=g+Math.imul(tt,re)|0,y=(y=y+Math.imul(tt,Dt)|0)+Math.imul(Q,re)|0,C=C+Math.imul(Q,Dt)|0,g=g+Math.imul(et,ae)|0,y=(y=y+Math.imul(et,Lt)|0)+Math.imul(nt,ae)|0,C=C+Math.imul(nt,Lt)|0,g=g+Math.imul(Y,le)|0,y=(y=y+Math.imul(Y,Vt)|0)+Math.imul(X,le)|0,C=C+Math.imul(X,Vt)|0,g=g+Math.imul(M,ot)|0,y=(y=y+Math.imul(M,ct)|0)+Math.imul(D,ot)|0,C=C+Math.imul(D,ct)|0;var ft=(H+(g=g+Math.imul(O,Ft)|0)|0)+((8191&(y=(y=y+Math.imul(O,wt)|0)+Math.imul($,Ft)|0))<<13)|0;H=((C=C+Math.imul($,wt)|0)+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,g=Math.imul(Et,Tt),y=(y=Math.imul(Et,Ct))+Math.imul(At,Tt)|0,C=Math.imul(At,Ct),g=g+Math.imul(_t,ie)|0,y=(y=y+Math.imul(_t,Nt)|0)+Math.imul(yt,ie)|0,C=C+Math.imul(yt,Nt)|0,g=g+Math.imul(ht,Kt)|0,y=(y=y+Math.imul(ht,Ht)|0)+Math.imul(dt,Kt)|0,C=C+Math.imul(dt,Ht)|0,g=g+Math.imul(it,re)|0,y=(y=y+Math.imul(it,Dt)|0)+Math.imul(at,re)|0,C=C+Math.imul(at,Dt)|0,g=g+Math.imul(tt,ae)|0,y=(y=y+Math.imul(tt,Lt)|0)+Math.imul(Q,ae)|0,C=C+Math.imul(Q,Lt)|0,g=g+Math.imul(et,le)|0,y=(y=y+Math.imul(et,Vt)|0)+Math.imul(nt,le)|0,C=C+Math.imul(nt,Vt)|0,g=g+Math.imul(Y,ot)|0,y=(y=y+Math.imul(Y,ct)|0)+Math.imul(X,ot)|0,C=C+Math.imul(X,ct)|0,g=g+Math.imul(M,Ft)|0,y=(y=y+Math.imul(M,wt)|0)+Math.imul(D,Ft)|0,C=C+Math.imul(D,wt)|0;var pt=(H+(g=g+Math.imul(O,Pt)|0)|0)+((8191&(y=(y=y+Math.imul(O,jt)|0)+Math.imul($,Pt)|0))<<13)|0;H=((C=C+Math.imul($,jt)|0)+(y>>>13)|0)+(pt>>>26)|0,pt&=67108863,g=Math.imul(kt,Tt),y=(y=Math.imul(kt,Ct))+Math.imul(mt,Tt)|0,C=Math.imul(mt,Ct),g=g+Math.imul(Et,ie)|0,y=(y=y+Math.imul(Et,Nt)|0)+Math.imul(At,ie)|0,C=C+Math.imul(At,Nt)|0,g=g+Math.imul(_t,Kt)|0,y=(y=y+Math.imul(_t,Ht)|0)+Math.imul(yt,Kt)|0,C=C+Math.imul(yt,Ht)|0,g=g+Math.imul(ht,re)|0,y=(y=y+Math.imul(ht,Dt)|0)+Math.imul(dt,re)|0,C=C+Math.imul(dt,Dt)|0,g=g+Math.imul(it,ae)|0,y=(y=y+Math.imul(it,Lt)|0)+Math.imul(at,ae)|0,C=C+Math.imul(at,Lt)|0,g=g+Math.imul(tt,le)|0,y=(y=y+Math.imul(tt,Vt)|0)+Math.imul(Q,le)|0,C=C+Math.imul(Q,Vt)|0,g=g+Math.imul(et,ot)|0,y=(y=y+Math.imul(et,ct)|0)+Math.imul(nt,ot)|0,C=C+Math.imul(nt,ct)|0,g=g+Math.imul(Y,Ft)|0,y=(y=y+Math.imul(Y,wt)|0)+Math.imul(X,Ft)|0,C=C+Math.imul(X,wt)|0,g=g+Math.imul(M,Pt)|0,y=(y=y+Math.imul(M,jt)|0)+Math.imul(D,Pt)|0,C=C+Math.imul(D,jt)|0;var Mt=(H+(g=g+Math.imul(O,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(O,Xt)|0)+Math.imul($,Ut)|0))<<13)|0;H=((C=C+Math.imul($,Xt)|0)+(y>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,g=Math.imul(kt,ie),y=(y=Math.imul(kt,Nt))+Math.imul(mt,ie)|0,C=Math.imul(mt,Nt),g=g+Math.imul(Et,Kt)|0,y=(y=y+Math.imul(Et,Ht)|0)+Math.imul(At,Kt)|0,C=C+Math.imul(At,Ht)|0,g=g+Math.imul(_t,re)|0,y=(y=y+Math.imul(_t,Dt)|0)+Math.imul(yt,re)|0,C=C+Math.imul(yt,Dt)|0,g=g+Math.imul(ht,ae)|0,y=(y=y+Math.imul(ht,Lt)|0)+Math.imul(dt,ae)|0,C=C+Math.imul(dt,Lt)|0,g=g+Math.imul(it,le)|0,y=(y=y+Math.imul(it,Vt)|0)+Math.imul(at,le)|0,C=C+Math.imul(at,Vt)|0,g=g+Math.imul(tt,ot)|0,y=(y=y+Math.imul(tt,ct)|0)+Math.imul(Q,ot)|0,C=C+Math.imul(Q,ct)|0,g=g+Math.imul(et,Ft)|0,y=(y=y+Math.imul(et,wt)|0)+Math.imul(nt,Ft)|0,C=C+Math.imul(nt,wt)|0,g=g+Math.imul(Y,Pt)|0,y=(y=y+Math.imul(Y,jt)|0)+Math.imul(X,Pt)|0,C=C+Math.imul(X,jt)|0;var bt=(H+(g=g+Math.imul(M,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(M,Xt)|0)+Math.imul(D,Ut)|0))<<13)|0;H=((C=C+Math.imul(D,Xt)|0)+(y>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(kt,Kt),y=(y=Math.imul(kt,Ht))+Math.imul(mt,Kt)|0,C=Math.imul(mt,Ht),g=g+Math.imul(Et,re)|0,y=(y=y+Math.imul(Et,Dt)|0)+Math.imul(At,re)|0,C=C+Math.imul(At,Dt)|0,g=g+Math.imul(_t,ae)|0,y=(y=y+Math.imul(_t,Lt)|0)+Math.imul(yt,ae)|0,C=C+Math.imul(yt,Lt)|0,g=g+Math.imul(ht,le)|0,y=(y=y+Math.imul(ht,Vt)|0)+Math.imul(dt,le)|0,C=C+Math.imul(dt,Vt)|0,g=g+Math.imul(it,ot)|0,y=(y=y+Math.imul(it,ct)|0)+Math.imul(at,ot)|0,C=C+Math.imul(at,ct)|0,g=g+Math.imul(tt,Ft)|0,y=(y=y+Math.imul(tt,wt)|0)+Math.imul(Q,Ft)|0,C=C+Math.imul(Q,wt)|0,g=g+Math.imul(et,Pt)|0,y=(y=y+Math.imul(et,jt)|0)+Math.imul(nt,Pt)|0,C=C+Math.imul(nt,jt)|0;var gt=(H+(g=g+Math.imul(Y,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(Y,Xt)|0)+Math.imul(X,Ut)|0))<<13)|0;H=((C=C+Math.imul(X,Xt)|0)+(y>>>13)|0)+(gt>>>26)|0,gt&=67108863,g=Math.imul(kt,re),y=(y=Math.imul(kt,Dt))+Math.imul(mt,re)|0,C=Math.imul(mt,Dt),g=g+Math.imul(Et,ae)|0,y=(y=y+Math.imul(Et,Lt)|0)+Math.imul(At,ae)|0,C=C+Math.imul(At,Lt)|0,g=g+Math.imul(_t,le)|0,y=(y=y+Math.imul(_t,Vt)|0)+Math.imul(yt,le)|0,C=C+Math.imul(yt,Vt)|0,g=g+Math.imul(ht,ot)|0,y=(y=y+Math.imul(ht,ct)|0)+Math.imul(dt,ot)|0,C=C+Math.imul(dt,ct)|0,g=g+Math.imul(it,Ft)|0,y=(y=y+Math.imul(it,wt)|0)+Math.imul(at,Ft)|0,C=C+Math.imul(at,wt)|0,g=g+Math.imul(tt,Pt)|0,y=(y=y+Math.imul(tt,jt)|0)+Math.imul(Q,Pt)|0,C=C+Math.imul(Q,jt)|0;var Zt=(H+(g=g+Math.imul(et,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(et,Xt)|0)+Math.imul(nt,Ut)|0))<<13)|0;H=((C=C+Math.imul(nt,Xt)|0)+(y>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(kt,ae),y=(y=Math.imul(kt,Lt))+Math.imul(mt,ae)|0,C=Math.imul(mt,Lt),g=g+Math.imul(Et,le)|0,y=(y=y+Math.imul(Et,Vt)|0)+Math.imul(At,le)|0,C=C+Math.imul(At,Vt)|0,g=g+Math.imul(_t,ot)|0,y=(y=y+Math.imul(_t,ct)|0)+Math.imul(yt,ot)|0,C=C+Math.imul(yt,ct)|0,g=g+Math.imul(ht,Ft)|0,y=(y=y+Math.imul(ht,wt)|0)+Math.imul(dt,Ft)|0,C=C+Math.imul(dt,wt)|0,g=g+Math.imul(it,Pt)|0,y=(y=y+Math.imul(it,jt)|0)+Math.imul(at,Pt)|0,C=C+Math.imul(at,jt)|0;var qt=(H+(g=g+Math.imul(tt,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(tt,Xt)|0)+Math.imul(Q,Ut)|0))<<13)|0;H=((C=C+Math.imul(Q,Xt)|0)+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,g=Math.imul(kt,le),y=(y=Math.imul(kt,Vt))+Math.imul(mt,le)|0,C=Math.imul(mt,Vt),g=g+Math.imul(Et,ot)|0,y=(y=y+Math.imul(Et,ct)|0)+Math.imul(At,ot)|0,C=C+Math.imul(At,ct)|0,g=g+Math.imul(_t,Ft)|0,y=(y=y+Math.imul(_t,wt)|0)+Math.imul(yt,Ft)|0,C=C+Math.imul(yt,wt)|0,g=g+Math.imul(ht,Pt)|0,y=(y=y+Math.imul(ht,jt)|0)+Math.imul(dt,Pt)|0,C=C+Math.imul(dt,jt)|0;var Wt=(H+(g=g+Math.imul(it,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(it,Xt)|0)+Math.imul(at,Ut)|0))<<13)|0;H=((C=C+Math.imul(at,Xt)|0)+(y>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(kt,ot),y=(y=Math.imul(kt,ct))+Math.imul(mt,ot)|0,C=Math.imul(mt,ct),g=g+Math.imul(Et,Ft)|0,y=(y=y+Math.imul(Et,wt)|0)+Math.imul(At,Ft)|0,C=C+Math.imul(At,wt)|0,g=g+Math.imul(_t,Pt)|0,y=(y=y+Math.imul(_t,jt)|0)+Math.imul(yt,Pt)|0,C=C+Math.imul(yt,jt)|0;var Bt=(H+(g=g+Math.imul(ht,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(ht,Xt)|0)+Math.imul(dt,Ut)|0))<<13)|0;H=((C=C+Math.imul(dt,Xt)|0)+(y>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(kt,Ft),y=(y=Math.imul(kt,wt))+Math.imul(mt,Ft)|0,C=Math.imul(mt,wt),g=g+Math.imul(Et,Pt)|0,y=(y=y+Math.imul(Et,jt)|0)+Math.imul(At,Pt)|0,C=C+Math.imul(At,jt)|0;var se=(H+(g=g+Math.imul(_t,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(_t,Xt)|0)+Math.imul(yt,Ut)|0))<<13)|0;H=((C=C+Math.imul(yt,Xt)|0)+(y>>>13)|0)+(se>>>26)|0,se&=67108863,g=Math.imul(kt,Pt),y=(y=Math.imul(kt,jt))+Math.imul(mt,Pt)|0,C=Math.imul(mt,jt);var ce=(H+(g=g+Math.imul(Et,Ut)|0)|0)+((8191&(y=(y=y+Math.imul(Et,Xt)|0)+Math.imul(At,Ut)|0))<<13)|0;H=((C=C+Math.imul(At,Xt)|0)+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863;var Qt=(H+(g=Math.imul(kt,Ut))|0)+((8191&(y=(y=Math.imul(kt,Xt))+Math.imul(mt,Ut)|0))<<13)|0;return H=((C=Math.imul(mt,Xt))+(y>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,z[0]=pe,z[1]=he,z[2]=be,z[3]=ge,z[4]=ve,z[5]=J,z[6]=lt,z[7]=ft,z[8]=pt,z[9]=Mt,z[10]=bt,z[11]=gt,z[12]=Zt,z[13]=qt,z[14]=Wt,z[15]=Bt,z[16]=se,z[17]=ce,z[18]=Qt,H!==0&&(z[19]=H,b.length++),b};function A(v,m,b){b.negative=m.negative^v.negative,b.length=v.length+m.length;for(var g=0,y=0,C=0;C>>26)|0)>>>26,R&=67108863}b.words[C]=I,g=R,R=y}return g!==0?b.words[C]=g:b.length--,b._strip()}function N(v,m,b){return A(v,m,b)}Math.imul||(x=w),t.prototype.mulTo=function(v,m){var b=this.length+v.length;return this.length===10&&v.length===10?x(this,v,m):b<63?w(this,v,m):b<1024?A(this,v,m):N(this,v,m)},t.prototype.mul=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},t.prototype.mulf=function(v){var m=new t(null);return m.words=new Array(this.length+v.length),N(this,v,m)},t.prototype.imul=function(v){return this.clone().mulTo(v,this)},t.prototype.imuln=function(v){var m=v<0;m&&(v=-v),a(typeof v=="number"),a(v<67108864);for(var b=0,g=0;g>=26,b+=y/67108864|0,b+=C>>>26,this.words[g]=67108863&C}return b!==0&&(this.words[g]=b,this.length++),m?this.ineg():this},t.prototype.muln=function(v){return this.clone().imuln(v)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(v){var m=function(C){for(var R=new Array(C.bitLength()),I=0;I>>H&1}return R}(v);if(m.length===0)return new t(1);for(var b=this,g=0;g=0);var m,b=v%26,g=(v-b)/26,y=67108863>>>26-b<<26-b;if(b!==0){var C=0;for(m=0;m>>26-b}C&&(this.words[m]=C,this.length++)}if(g!==0){for(m=this.length-1;m>=0;m--)this.words[m+g]=this.words[m];for(m=0;m=0),g=m?(m-m%26)/26:0;var y=v%26,C=Math.min((v-y)/26,this.length),R=67108863^67108863>>>y<C)for(this.length-=C,z=0;z=0&&(H!==0||z>=g);z--){var q=0|this.words[z];this.words[z]=H<<26-y|q>>>y,H=q&R}return I&&H!==0&&(I.words[I.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(v,m,b){return a(this.negative===0),this.iushrn(v,m,b)},t.prototype.shln=function(v){return this.clone().ishln(v)},t.prototype.ushln=function(v){return this.clone().iushln(v)},t.prototype.shrn=function(v){return this.clone().ishrn(v)},t.prototype.ushrn=function(v){return this.clone().iushrn(v)},t.prototype.testn=function(v){a(typeof v=="number"&&v>=0);var m=v%26,b=(v-m)/26,g=1<=0);var m=v%26,b=(v-m)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(m!==0&&b++,this.length=Math.min(b,this.length),m!==0){var g=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},t.prototype.isubn=function(v){if(a(typeof v=="number"),a(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(I/67108864|0),this.words[g+b]=67108863&y}for(;g>26,this.words[g+b]=67108863&y;if(R===0)return this._strip();for(a(R===-1),R=0,g=0;g>26,this.words[g]=67108863&y;return this.negative=1,this._strip()},t.prototype._wordDiv=function(v,m){var b=(this.length,v.length),g=this.clone(),y=v,C=0|y.words[y.length-1];(b=26-this._countBits(C))!==0&&(y=y.ushln(b),g.iushln(b),C=0|y.words[y.length-1]);var R,I=g.length-y.length;if(m!=="mod"){(R=new t(null)).length=I+1,R.words=new Array(R.length);for(var z=0;z=0;q--){var O=67108864*(0|g.words[y.length+q])+(0|g.words[y.length+q-1]);for(O=Math.min(O/C|0,67108863),g._ishlnsubmul(y,O,q);g.negative!==0;)O--,g.negative=0,g._ishlnsubmul(y,1,q),g.isZero()||(g.negative^=1);R&&(R.words[q]=O)}return R&&R._strip(),g._strip(),m!=="div"&&b!==0&&g.iushrn(b),{div:R||null,mod:g}},t.prototype.divmod=function(v,m,b){return a(!v.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&v.negative===0?(C=this.neg().divmod(v,m),m!=="mod"&&(g=C.div.neg()),m!=="div"&&(y=C.mod.neg(),b&&y.negative!==0&&y.iadd(v)),{div:g,mod:y}):this.negative===0&&v.negative!==0?(C=this.divmod(v.neg(),m),m!=="mod"&&(g=C.div.neg()),{div:g,mod:C.mod}):this.negative&v.negative?(C=this.neg().divmod(v.neg(),m),m!=="div"&&(y=C.mod.neg(),b&&y.negative!==0&&y.isub(v)),{div:C.div,mod:y}):v.length>this.length||this.cmp(v)<0?{div:new t(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new t(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new t(this.modrn(v.words[0]))}:this._wordDiv(v,m);var g,y,C},t.prototype.div=function(v){return this.divmod(v,"div",!1).div},t.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},t.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},t.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var b=m.div.negative!==0?m.mod.isub(v):m.mod,g=v.ushrn(1),y=v.andln(1),C=b.cmp(g);return C<0||y===1&&C===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},t.prototype.modrn=function(v){var m=v<0;m&&(v=-v),a(v<=67108863);for(var b=(1<<26)%v,g=0,y=this.length-1;y>=0;y--)g=(b*g+(0|this.words[y]))%v;return m?-g:g},t.prototype.modn=function(v){return this.modrn(v)},t.prototype.idivn=function(v){var m=v<0;m&&(v=-v),a(v<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var y=(0|this.words[g])+67108864*b;this.words[g]=y/v|0,b=y%v}return this._strip(),m?this.ineg():this},t.prototype.divn=function(v){return this.clone().idivn(v)},t.prototype.egcd=function(v){a(v.negative===0),a(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g=new t(1),y=new t(0),C=new t(0),R=new t(1),I=0;m.isEven()&&b.isEven();)m.iushrn(1),b.iushrn(1),++I;for(var z=b.clone(),H=m.clone();!m.isZero();){for(var q=0,O=1;!(m.words[0]&O)&&q<26;++q,O<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(g.isOdd()||y.isOdd())&&(g.iadd(z),y.isub(H)),g.iushrn(1),y.iushrn(1);for(var $=0,E=1;!(b.words[0]&E)&&$<26;++$,E<<=1);if($>0)for(b.iushrn($);$-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd(z),R.isub(H)),C.iushrn(1),R.iushrn(1);m.cmp(b)>=0?(m.isub(b),g.isub(C),y.isub(R)):(b.isub(m),C.isub(g),R.isub(y))}return{a:C,b:R,gcd:b.iushln(I)}},t.prototype._invmp=function(v){a(v.negative===0),a(!v.isZero());var m=this,b=v.clone();m=m.negative!==0?m.umod(v):m.clone();for(var g,y=new t(1),C=new t(0),R=b.clone();m.cmpn(1)>0&&b.cmpn(1)>0;){for(var I=0,z=1;!(m.words[0]&z)&&I<26;++I,z<<=1);if(I>0)for(m.iushrn(I);I-- >0;)y.isOdd()&&y.iadd(R),y.iushrn(1);for(var H=0,q=1;!(b.words[0]&q)&&H<26;++H,q<<=1);if(H>0)for(b.iushrn(H);H-- >0;)C.isOdd()&&C.iadd(R),C.iushrn(1);m.cmp(b)>=0?(m.isub(b),y.isub(C)):(b.isub(m),C.isub(y))}return(g=m.cmpn(1)===0?y:C).cmpn(0)<0&&g.iadd(v),g},t.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),b=v.clone();m.negative=0,b.negative=0;for(var g=0;m.isEven()&&b.isEven();g++)m.iushrn(1),b.iushrn(1);for(;;){for(;m.isEven();)m.iushrn(1);for(;b.isEven();)b.iushrn(1);var y=m.cmp(b);if(y<0){var C=m;m=b,b=C}else if(y===0||b.cmpn(1)===0)break;m.isub(b)}return b.iushln(g)},t.prototype.invm=function(v){return this.egcd(v).a.umod(v)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(v){return this.words[0]&v},t.prototype.bincn=function(v){a(typeof v=="number");var m=v%26,b=(v-m)/26,g=1<>>26,R&=67108863,this.words[C]=R}return y!==0&&(this.words[C]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(v){var m,b=v<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;if(this._strip(),this.length>1)m=1;else{b&&(v=-v),a(v<=67108863,"Number is too big");var g=0|this.words[0];m=g===v?0:gv.length)return 1;if(this.length=0;b--){var g=0|this.words[b],y=0|v.words[b];if(g!==y){gy&&(m=1);break}}return m},t.prototype.gtn=function(v){return this.cmpn(v)===1},t.prototype.gt=function(v){return this.cmp(v)===1},t.prototype.gten=function(v){return this.cmpn(v)>=0},t.prototype.gte=function(v){return this.cmp(v)>=0},t.prototype.ltn=function(v){return this.cmpn(v)===-1},t.prototype.lt=function(v){return this.cmp(v)===-1},t.prototype.lten=function(v){return this.cmpn(v)<=0},t.prototype.lte=function(v){return this.cmp(v)<=0},t.prototype.eqn=function(v){return this.cmpn(v)===0},t.prototype.eq=function(v){return this.cmp(v)===0},t.red=function(v){return new k(v)},t.prototype.toRed=function(v){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(v){return this.red=v,this},t.prototype.forceRed=function(v){return a(!this.red,"Already a number in reduction context"),this._forceRed(v)},t.prototype.redAdd=function(v){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},t.prototype.redIAdd=function(v){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},t.prototype.redSub=function(v){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},t.prototype.redISub=function(v){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},t.prototype.redShl=function(v){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},t.prototype.redMul=function(v){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},t.prototype.redIMul=function(v){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(v){return a(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var L={k256:null,p224:null,p192:null,p25519:null};function j(v,m){this.name=v,this.p=new t(m,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function F(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function U(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(v){if(typeof v=="string"){var m=t._prime(v);this.m=m.p,this.prime=m}else a(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}function T(v){k.call(this,v),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}j.prototype._tmp=function(){var v=new t(null);return v.words=new Array(Math.ceil(this.n/13)),v},j.prototype.ireduce=function(v){var m,b=v;do this.split(b,this.tmp),m=(b=(b=this.imulK(b)).iadd(this.tmp)).bitLength();while(m>this.n);var g=m0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},j.prototype.split=function(v,m){v.iushrn(this.n,0,m)},j.prototype.imulK=function(v){return v.imul(this.k)},n(F,j),F.prototype.split=function(v,m){for(var b=Math.min(v.length,9),g=0;g>>22,y=C}y>>>=22,v.words[g-10]=y,y===0&&v.length>10?v.length-=10:v.length-=9},F.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,b=0;b>>=26,v.words[b]=y,m=g}return m!==0&&(v.words[v.length++]=m),v},t._prime=function(v){if(L[v])return L[v];var m;if(v==="k256")m=new F;else if(v==="p224")m=new P;else if(v==="p192")m=new U;else{if(v!=="p25519")throw new Error("Unknown prime "+v);m=new B}return L[v]=m,m},k.prototype._verify1=function(v){a(v.negative===0,"red works only with positives"),a(v.red,"red works only with red numbers")},k.prototype._verify2=function(v,m){a((v.negative|m.negative)==0,"red works only with positives"),a(v.red&&v.red===m.red,"red works only with red numbers")},k.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(h(v,v.umod(this.m)._forceRed(this)),v)},k.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},k.prototype.add=function(v,m){this._verify2(v,m);var b=v.add(m);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},k.prototype.iadd=function(v,m){this._verify2(v,m);var b=v.iadd(m);return b.cmp(this.m)>=0&&b.isub(this.m),b},k.prototype.sub=function(v,m){this._verify2(v,m);var b=v.sub(m);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},k.prototype.isub=function(v,m){this._verify2(v,m);var b=v.isub(m);return b.cmpn(0)<0&&b.iadd(this.m),b},k.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},k.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},k.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},k.prototype.isqr=function(v){return this.imul(v,v.clone())},k.prototype.sqr=function(v){return this.mul(v,v)},k.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(a(m%2==1),m===3){var b=this.m.add(new t(1)).iushrn(2);return this.pow(v,b)}for(var g=this.m.subn(1),y=0;!g.isZero()&&g.andln(1)===0;)y++,g.iushrn(1);a(!g.isZero());var C=new t(1).toRed(this),R=C.redNeg(),I=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new t(2*z*z).toRed(this);this.pow(z,I).cmp(R)!==0;)z.redIAdd(R);for(var H=this.pow(z,g),q=this.pow(v,g.addn(1).iushrn(1)),O=this.pow(v,g),$=y;O.cmp(C)!==0;){for(var E=O,M=0;E.cmp(C)!==0;M++)E=E.redSqr();a(M<$);var D=this.pow(H,new t(1).iushln($-M-1));q=q.redMul(D),H=D.redSqr(),O=O.redMul(H),$=M}return q},k.prototype.invm=function(v){var m=v._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},k.prototype.pow=function(v,m){if(m.isZero())return new t(1).toRed(this);if(m.cmpn(1)===0)return v.clone();var b=new Array(16);b[0]=new t(1).toRed(this),b[1]=v;for(var g=2;g=0;g--){for(var z=m.words[g],H=I-1;H>=0;H--){var q=z>>H&1;y!==b[0]&&(y=this.sqr(y)),q!==0||C!==0?(C<<=1,C|=q,(++R===4||g===0&&H===0)&&(y=this.mul(y,b[C]),R=0,C=0)):R=0}I=26}return y},k.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},k.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},t.mont=function(v){return new T(v)},n(T,k),T.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},T.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},T.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var b=v.imul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),C=y;return y.cmp(this.m)>=0?C=y.isub(this.m):y.cmpn(0)<0&&(C=y.iadd(this.m)),C._forceRed(this)},T.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new t(0)._forceRed(this);var b=v.mul(m),g=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=b.isub(g).iushrn(this.shift),C=y;return y.cmp(this.m)>=0?C=y.isub(this.m):y.cmpn(0)<0&&(C=y.iadd(this.m)),C._forceRed(this)},T.prototype.invm=function(v){return this.imod(v._invmp(this.m).mul(this.r2))._forceRed(this)}})(S===void 0||S)},{buffer:188}],187:[function(e,S,_){var d;function o(n){this.rand=n}if(S.exports=function(n){return d||(d=new o(null)),d.generate(n)},S.exports.Rand=o,o.prototype.generate=function(n){return this._rand(n)},o.prototype._rand=function(n){if(this.rand.getBytes)return this.rand.getBytes(n);for(var t=new Uint8Array(n),r=0;r>>24]^N[P>>>16&255]^L[U>>>8&255]^j[255&B]^s[k++],f=A[P>>>24]^N[U>>>16&255]^L[B>>>8&255]^j[255&F]^s[k++],w=A[U>>>24]^N[B>>>16&255]^L[F>>>8&255]^j[255&P]^s[k++],x=A[B>>>24]^N[F>>>16&255]^L[P>>>8&255]^j[255&U]^s[k++],F=p,P=f,U=w,B=x;return p=(c[F>>>24]<<24|c[P>>>16&255]<<16|c[U>>>8&255]<<8|c[255&B])^s[k++],f=(c[P>>>24]<<24|c[U>>>16&255]<<16|c[B>>>8&255]<<8|c[255&F])^s[k++],w=(c[U>>>24]<<24|c[B>>>16&255]<<16|c[F>>>8&255]<<8|c[255&P])^s[k++],x=(c[B>>>24]<<24|c[F>>>16&255]<<16|c[P>>>8&255]<<8|c[255&U])^s[k++],[p>>>=0,f>>>=0,w>>>=0,x>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],r=function(){for(var i=new Array(256),s=0;s<256;s++)i[s]=s<128?s<<1:s<<1^283;for(var h=[],c=[],u=[[],[],[],[]],p=[[],[],[],[]],f=0,w=0,x=0;x<256;++x){var A=w^w<<1^w<<2^w<<3^w<<4;A=A>>>8^255&A^99,h[f]=A,c[A]=f;var N=i[f],L=i[N],j=i[L],F=257*i[A]^16843008*A;u[0][f]=F<<24|F>>>8,u[1][f]=F<<16|F>>>16,u[2][f]=F<<8|F>>>24,u[3][f]=F,F=16843009*j^65537*L^257*N^16843008*f,p[0][A]=F<<24|F>>>8,p[1][A]=F<<16|F>>>16,p[2][A]=F<<8|F>>>24,p[3][A]=F,f===0?f=w=1:(f=N^i[i[i[j^N]]],w^=i[i[w]])}return{SBOX:h,INV_SBOX:c,SUB_MIX:u,INV_SUB_MIX:p}}();function l(i){this._key=o(i),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var i=this._key,s=i.length,h=s+6,c=4*(h+1),u=[],p=0;p>>24,f=r.SBOX[f>>>24]<<24|r.SBOX[f>>>16&255]<<16|r.SBOX[f>>>8&255]<<8|r.SBOX[255&f],f^=t[p/s|0]<<24):s>6&&p%s==4&&(f=r.SBOX[f>>>24]<<24|r.SBOX[f>>>16&255]<<16|r.SBOX[f>>>8&255]<<8|r.SBOX[255&f]),u[p]=u[p-s]^f}for(var w=[],x=0;x>>24]]^r.INV_SUB_MIX[1][r.SBOX[N>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[N>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[255&N]]}this._nRounds=h,this._keySchedule=u,this._invKeySchedule=w},l.prototype.encryptBlockRaw=function(i){return n(i=o(i),this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},l.prototype.encryptBlock=function(i){var s=this.encryptBlockRaw(i),h=d.allocUnsafe(16);return h.writeUInt32BE(s[0],0),h.writeUInt32BE(s[1],4),h.writeUInt32BE(s[2],8),h.writeUInt32BE(s[3],12),h},l.prototype.decryptBlock=function(i){var s=(i=o(i))[1];i[1]=i[3],i[3]=s;var h=n(i,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),c=d.allocUnsafe(16);return c.writeUInt32BE(h[0],0),c.writeUInt32BE(h[3],4),c.writeUInt32BE(h[2],8),c.writeUInt32BE(h[1],12),c},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},S.exports.AES=l},{"safe-buffer":494}],190:[function(e,S,_){var d=e("./aes"),o=e("safe-buffer").Buffer,a=e("cipher-base"),n=e("inherits"),t=e("./ghash"),r=e("buffer-xor"),l=e("./incr32");function i(s,h,c,u){a.call(this);var p=o.alloc(4,0);this._cipher=new d.AES(h);var f=this._cipher.encryptBlock(p);this._ghash=new t(f),c=function(w,x,A){if(x.length===12)return w._finID=o.concat([x,o.from([0,0,0,1])]),o.concat([x,o.from([0,0,0,2])]);var N=new t(A),L=x.length,j=L%16;N.update(x),j&&(j=16-j,N.update(o.alloc(j,0))),N.update(o.alloc(8,0));var F=8*L,P=o.alloc(8);P.writeUIntBE(F,0,8),N.update(P),w._finID=N.state;var U=o.from(w._finID);return l(U),U}(this,c,f),this._prev=o.from(c),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=s,this._authTag=null,this._called=!1}n(i,a),i.prototype._update=function(s){if(!this._called&&this._alen){var h=16-this._alen%16;h<16&&(h=o.alloc(h,0),this._ghash.update(h))}this._called=!0;var c=this._mode.encrypt(this,s);return this._decrypt?this._ghash.update(s):this._ghash.update(c),this._len+=s.length,c},i.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var s=r(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(h,c){var u=0;h.length!==c.length&&u++;for(var p=Math.min(h.length,c.length),f=0;f16)throw new Error("unable to decrypt data");for(var f=-1;++f16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u}else if(this.cache.length>=16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},_.createDecipher=function(c,u){var p=a[c.toLowerCase()];if(!p)throw new TypeError("invalid suite type");var f=l(u,!1,p.key,p.iv);return h(c,f.key,f.iv)},_.createDecipheriv=h},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,S,_){var d=e("./modes"),o=e("./authCipher"),a=e("safe-buffer").Buffer,n=e("./streamCipher"),t=e("cipher-base"),r=e("./aes"),l=e("evp_bytestokey");function i(u,p,f){t.call(this),this._cache=new h,this._cipher=new r.AES(p),this._prev=a.from(f),this._mode=u,this._autopadding=!0}e("inherits")(i,t),i.prototype._update=function(u){var p,f;this._cache.add(u);for(var w=[];p=this._cache.get();)f=this._mode.encrypt(this,p),w.push(f);return a.concat(w)};var s=a.alloc(16,16);function h(){this.cache=a.allocUnsafe(0)}function c(u,p,f){var w=d[u.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof p=="string"&&(p=a.from(p)),p.length!==w.key/8)throw new TypeError("invalid key length "+p.length);if(typeof f=="string"&&(f=a.from(f)),w.mode!=="GCM"&&f.length!==w.iv)throw new TypeError("invalid iv length "+f.length);return w.type==="stream"?new n(w.module,p,f):w.type==="auth"?new o(w.module,p,f):new i(w.module,p,f)}i.prototype._final=function(){var u=this._cache.flush();if(this._autopadding)return u=this._mode.encrypt(this,u),this._cipher.scrub(),u;if(!u.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},i.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},h.prototype.add=function(u){this.cache=a.concat([this.cache,u])},h.prototype.get=function(){if(this.cache.length>15){var u=this.cache.slice(0,16);return this.cache=this.cache.slice(16),u}return null},h.prototype.flush=function(){for(var u=16-this.cache.length,p=a.allocUnsafe(u),f=-1;++f>>0,0),r.writeUInt32BE(t[1]>>>0,4),r.writeUInt32BE(t[2]>>>0,8),r.writeUInt32BE(t[3]>>>0,12),r}function n(t){this.h=t,this.state=d.alloc(16,0),this.cache=d.allocUnsafe(0)}n.prototype.ghash=function(t){for(var r=-1;++r0;r--)i[r]=i[r]>>>1|(1&i[r-1])<<31;i[0]=i[0]>>>1,l&&(i[0]=i[0]^225<<24)}this.state=a(s)},n.prototype.update=function(t){var r;for(this.cache=d.concat([this.cache,t]);this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},n.prototype.final=function(t,r){return this.cache.length&&this.ghash(d.concat([this.cache,o],16)),this.ghash(a([0,t,0,r])),this.state},S.exports=n},{"safe-buffer":494}],195:[function(e,S,_){S.exports=function(d){for(var o,a=d.length;a--;){if((o=d.readUInt8(a))!==255){o++,d.writeUInt8(o,a);break}d.writeUInt8(0,a)}}},{}],196:[function(e,S,_){var d=e("buffer-xor");_.encrypt=function(o,a){var n=d(a,o._prev);return o._prev=o._cipher.encryptBlock(n),o._prev},_.decrypt=function(o,a){var n=o._prev;o._prev=a;var t=o._cipher.decryptBlock(a);return d(t,n)}},{"buffer-xor":219}],197:[function(e,S,_){var d=e("safe-buffer").Buffer,o=e("buffer-xor");function a(n,t,r){var l=t.length,i=o(t,n._cache);return n._cache=n._cache.slice(l),n._prev=d.concat([n._prev,r?t:i]),i}_.encrypt=function(n,t,r){for(var l,i=d.allocUnsafe(0);t.length;){if(n._cache.length===0&&(n._cache=n._cipher.encryptBlock(n._prev),n._prev=d.allocUnsafe(0)),!(n._cache.length<=t.length)){i=d.concat([i,a(n,t,r)]);break}l=n._cache.length,i=d.concat([i,a(n,t.slice(0,l),r)]),t=t.slice(l)}return i}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,S,_){var d=e("safe-buffer").Buffer;function o(n,t,r){for(var l,i,s=-1,h=0;++s<8;)l=t&1<<7-s?128:0,h+=(128&(i=n._cipher.encryptBlock(n._prev)[0]^l))>>s%8,n._prev=a(n._prev,r?l:i);return h}function a(n,t){var r=n.length,l=-1,i=d.allocUnsafe(n.length);for(n=d.concat([n,d.from([t])]);++l>7;return i}_.encrypt=function(n,t,r){for(var l=t.length,i=d.allocUnsafe(l),s=-1;++s=0||!l.umod(r.prime1)||!l.umod(r.prime2));return l}function t(r,l){var i=function(L){var j=n(L);return{blinder:j.toRed(o.mont(L.modulus)).redPow(new o(L.publicExponent)).fromRed(),unblinder:j.invm(L.modulus)}}(l),s=l.modulus.byteLength(),h=new o(r).mul(i.blinder).umod(l.modulus),c=h.toRed(o.mont(l.prime1)),u=h.toRed(o.mont(l.prime2)),p=l.coefficient,f=l.prime1,w=l.prime2,x=c.redPow(l.exponent1).fromRed(),A=u.redPow(l.exponent2).fromRed(),N=x.isub(A).imul(p).umod(f).imul(w);return A.iadd(N).imul(i.unblinder).umod(l.modulus).toArrayLike(d,"be",s)}t.getr=n,S.exports=t}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,S,_){S.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(e,S,_){S.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(e,S,_){S.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(e,S,_){var d=e("safe-buffer").Buffer,o=e("create-hash"),a=e("readable-stream"),n=e("inherits"),t=e("./sign"),r=e("./verify"),l=e("./algorithms.json");function i(u){a.Writable.call(this);var p=l[u];if(!p)throw new Error("Unknown message digest");this._hashType=p.hash,this._hash=o(p.hash),this._tag=p.id,this._signType=p.sign}function s(u){a.Writable.call(this);var p=l[u];if(!p)throw new Error("Unknown message digest");this._hash=o(p.hash),this._tag=p.id,this._signType=p.sign}function h(u){return new i(u)}function c(u){return new s(u)}Object.keys(l).forEach(function(u){l[u].id=d.from(l[u].id,"hex"),l[u.toLowerCase()]=l[u]}),n(i,a.Writable),i.prototype._write=function(u,p,f){this._hash.update(u),f()},i.prototype.update=function(u,p){return typeof u=="string"&&(u=d.from(u,p)),this._hash.update(u),this},i.prototype.sign=function(u,p){this.end();var f=this._hash.digest(),w=t(f,u,this._hashType,this._signType,this._tag);return p?w.toString(p):w},n(s,a.Writable),s.prototype._write=function(u,p,f){this._hash.update(u),f()},s.prototype.update=function(u,p){return typeof u=="string"&&(u=d.from(u,p)),this._hash.update(u),this},s.prototype.verify=function(u,p,f){typeof p=="string"&&(p=d.from(p,f)),this.end();var w=this._hash.digest();return r(p,w,u,this._signType,this._tag)},S.exports={Sign:h,Verify:c,createSign:h,createVerify:c}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,S,_){var d=e("safe-buffer").Buffer,o=e("create-hmac"),a=e("browserify-rsa"),n=e("elliptic").ec,t=e("bn.js"),r=e("parse-asn1"),l=e("./curves.json");function i(u,p,f,w){if((u=d.from(u.toArray())).length0&&f.ishrn(w),f}function h(u,p,f){var w,x;do{for(w=d.alloc(0);8*w.length=i)throw new Error("invalid sig")}S.exports=function(l,i,s,h,c){var u=n(s);if(u.type==="ec"){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");return function(L,j,F){var P=t[F.data.algorithm.curve.join(".")];if(!P)throw new Error("unknown curve "+F.data.algorithm.curve.join("."));var U=new a(P),B=F.data.subjectPrivateKey.data;return U.verify(j,L,B)}(l,i,u)}if(u.type==="dsa"){if(h!=="dsa")throw new Error("wrong public key type");return function(L,j,F){var P=F.data.p,U=F.data.q,B=F.data.g,k=F.data.pub_key,T=n.signature.decode(L,"der"),v=T.s,m=T.r;r(v,U),r(m,U);var b=o.mont(P),g=v.invm(U);return B.toRed(b).redPow(new o(j).mul(g).mod(U)).fromRed().mul(k.toRed(b).redPow(m.mul(g).mod(U)).fromRed()).mod(P).mod(U).cmp(m)===0}(l,i,u)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");i=d.concat([c,i]);for(var p=u.modulus.byteLength(),f=[1],w=0;i.length+f.length+2>5==6?2:u>>4==14?3:u>>3==30?4:u>>6==2?-1:-2}function t(u){var p=this.lastTotal-this.lastNeed,f=function(w,x,A){if((192&x[0])!=128)return w.lastNeed=0,"�";if(w.lastNeed>1&&x.length>1){if((192&x[1])!=128)return w.lastNeed=1,"�";if(w.lastNeed>2&&x.length>2&&(192&x[2])!=128)return w.lastNeed=2,"�"}}(this,u);return f!==void 0?f:this.lastNeed<=u.length?(u.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(u.copy(this.lastChar,p,0,u.length),void(this.lastNeed-=u.length))}function r(u,p){if((u.length-p)%2==0){var f=u.toString("utf16le",p);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",p,u.length-1)}function l(u){var p=u&&u.length?this.write(u):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,f)}return p}function i(u,p){var f=(u.length-p)%3;return f===0?u.toString("base64",p):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",p,u.length-f))}function s(u){var p=u&&u.length?this.write(u):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function h(u){return u.toString(this.encoding)}function c(u){return u&&u.length?this.write(u):""}_.StringDecoder=a,a.prototype.write=function(u){if(u.length===0)return"";var p,f;if(this.lastNeed){if((p=this.fillLast(u))===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f=0?(j>0&&(x.lastNeed=j-1),j):--L=0?(j>0&&(x.lastNeed=j-2),j):--L=0?(j>0&&(j===2?j=0:x.lastNeed=j-3),j):0}(this,u,p);if(!this.lastNeed)return u.toString("utf8",p);this.lastTotal=f;var w=u.length-(f-this.lastNeed);return u.copy(this.lastChar,0,w),u.toString("utf8",p,w)},a.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length}},{"safe-buffer":217}],219:[function(e,S,_){(function(d){(function(){S.exports=function(o,a){for(var n=Math.min(o.length,a.length),t=new d(n),r=0;r2147483647)throw new RangeError('The value "'+E+'" is invalid for option "size"');var M=new Uint8Array(E);return M.__proto__=t.prototype,M}function t(E,M,D){if(typeof E=="number"){if(typeof M=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(E)}return r(E,M,D)}function r(E,M,D){if(typeof E=="string")return function(X,G){if(typeof G=="string"&&G!==""||(G="utf8"),!t.isEncoding(G))throw new TypeError("Unknown encoding: "+G);var et=0|c(X,G),nt=n(et),K=nt.write(X,G);return K!==et&&(nt=nt.slice(0,K)),nt}(E,M);if(ArrayBuffer.isView(E))return s(E);if(E==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(O(E,ArrayBuffer)||E&&O(E.buffer,ArrayBuffer))return function(X,G,et){if(G<0||X.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|E}function c(E,M){if(t.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||O(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);var D=E.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&D===0)return 0;for(var Y=!1;;)switch(M){case"ascii":case"latin1":case"binary":return D;case"utf8":case"utf-8":return z(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*D;case"hex":return D>>>1;case"base64":return H(E).length;default:if(Y)return V?-1:z(E).length;M=(""+M).toLowerCase(),Y=!0}}function u(E,M,D){var V=!1;if((M===void 0||M<0)&&(M=0),M>this.length||((D===void 0||D>this.length)&&(D=this.length),D<=0)||(D>>>=0)<=(M>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return T(this,M,D);case"utf8":case"utf-8":return U(this,M,D);case"ascii":return B(this,M,D);case"latin1":case"binary":return k(this,M,D);case"base64":return P(this,M,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,M,D);default:if(V)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),V=!0}}function p(E,M,D){var V=E[M];E[M]=E[D],E[D]=V}function f(E,M,D,V,Y){if(E.length===0)return-1;if(typeof D=="string"?(V=D,D=0):D>2147483647?D=2147483647:D<-2147483648&&(D=-2147483648),$(D=+D)&&(D=Y?0:E.length-1),D<0&&(D=E.length+D),D>=E.length){if(Y)return-1;D=E.length-1}else if(D<0){if(!Y)return-1;D=0}if(typeof M=="string"&&(M=t.from(M,V)),t.isBuffer(M))return M.length===0?-1:w(E,M,D,V,Y);if(typeof M=="number")return M&=255,typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(E,M,D):Uint8Array.prototype.lastIndexOf.call(E,M,D):w(E,[M],D,V,Y);throw new TypeError("val must be string, number or Buffer")}function w(E,M,D,V,Y){var X,G=1,et=E.length,nt=M.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(E.length<2||M.length<2)return-1;G=2,et/=2,nt/=2,D/=2}function K(it,at){return G===1?it[at]:it.readUInt16BE(at*G)}if(Y){var tt=-1;for(X=D;Xet&&(D=et-nt),X=D;X>=0;X--){for(var Q=!0,st=0;stY&&(V=Y):V=Y;var X=M.length;V>X/2&&(V=X/2);for(var G=0;G>8,nt=G%256,K.push(nt),K.push(et);return K}(M,E.length-D),E,D,V)}function P(E,M,D){return M===0&&D===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(M,D))}function U(E,M,D){D=Math.min(E.length,D);for(var V=[],Y=M;Y239?4:K>223?3:K>191?2:1;if(Y+Q<=D)switch(Q){case 1:K<128&&(tt=K);break;case 2:(192&(X=E[Y+1]))==128&&(nt=(31&K)<<6|63&X)>127&&(tt=nt);break;case 3:X=E[Y+1],G=E[Y+2],(192&X)==128&&(192&G)==128&&(nt=(15&K)<<12|(63&X)<<6|63&G)>2047&&(nt<55296||nt>57343)&&(tt=nt);break;case 4:X=E[Y+1],G=E[Y+2],et=E[Y+3],(192&X)==128&&(192&G)==128&&(192&et)==128&&(nt=(15&K)<<18|(63&X)<<12|(63&G)<<6|63&et)>65535&&nt<1114112&&(tt=nt)}tt===null?(tt=65533,Q=1):tt>65535&&(tt-=65536,V.push(tt>>>10&1023|55296),tt=56320|1023&tt),V.push(tt),Y+=Q}return function(st){var it=st.length;if(it<=4096)return String.fromCharCode.apply(String,st);for(var at="",ut=0;ut"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(E,M,D){return r(E,M,D)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(E,M,D){return function(V,Y,X){return l(V),V<=0?n(V):Y!==void 0?typeof X=="string"?n(V).fill(Y,X):n(V).fill(Y):n(V)}(E,M,D)},t.allocUnsafe=function(E){return i(E)},t.allocUnsafeSlow=function(E){return i(E)},t.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==t.prototype},t.compare=function(E,M){if(O(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),O(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(E)||!t.isBuffer(M))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===M)return 0;for(var D=E.length,V=M.length,Y=0,X=Math.min(D,V);YM&&(E+=" ... "),""},t.prototype.compare=function(E,M,D,V,Y){if(O(E,Uint8Array)&&(E=t.from(E,E.offset,E.byteLength)),!t.isBuffer(E))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof E);if(M===void 0&&(M=0),D===void 0&&(D=E?E.length:0),V===void 0&&(V=0),Y===void 0&&(Y=this.length),M<0||D>E.length||V<0||Y>this.length)throw new RangeError("out of range index");if(V>=Y&&M>=D)return 0;if(V>=Y)return-1;if(M>=D)return 1;if(this===E)return 0;for(var X=(Y>>>=0)-(V>>>=0),G=(D>>>=0)-(M>>>=0),et=Math.min(X,G),nt=this.slice(V,Y),K=E.slice(M,D),tt=0;tt>>=0,isFinite(D)?(D>>>=0,V===void 0&&(V="utf8")):(V=D,D=void 0)}var Y=this.length-M;if((D===void 0||D>Y)&&(D=Y),E.length>0&&(D<0||M<0)||M>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var X=!1;;)switch(V){case"hex":return x(this,E,M,D);case"utf8":case"utf-8":return A(this,E,M,D);case"ascii":return N(this,E,M,D);case"latin1":case"binary":return L(this,E,M,D);case"base64":return j(this,E,M,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,E,M,D);default:if(X)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),X=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(E,M,D){var V="";D=Math.min(E.length,D);for(var Y=M;YV)&&(D=V);for(var Y="",X=M;XD)throw new RangeError("Trying to access beyond buffer length")}function b(E,M,D,V,Y,X){if(!t.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(M>Y||ME.length)throw new RangeError("Index out of range")}function g(E,M,D,V,Y,X){if(D+V>E.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("Index out of range")}function y(E,M,D,V,Y){return M=+M,D>>>=0,Y||g(E,0,D,4),a.write(E,M,D,V,23,4),D+4}function C(E,M,D,V,Y){return M=+M,D>>>=0,Y||g(E,0,D,8),a.write(E,M,D,V,52,8),D+8}t.prototype.slice=function(E,M){var D=this.length;(E=~~E)<0?(E+=D)<0&&(E=0):E>D&&(E=D),(M=M===void 0?D:~~M)<0?(M+=D)<0&&(M=0):M>D&&(M=D),M>>=0,M>>>=0,D||m(E,M,this.length);for(var V=this[E],Y=1,X=0;++X>>=0,M>>>=0,D||m(E,M,this.length);for(var V=this[E+--M],Y=1;M>0&&(Y*=256);)V+=this[E+--M]*Y;return V},t.prototype.readUInt8=function(E,M){return E>>>=0,M||m(E,1,this.length),this[E]},t.prototype.readUInt16LE=function(E,M){return E>>>=0,M||m(E,2,this.length),this[E]|this[E+1]<<8},t.prototype.readUInt16BE=function(E,M){return E>>>=0,M||m(E,2,this.length),this[E]<<8|this[E+1]},t.prototype.readUInt32LE=function(E,M){return E>>>=0,M||m(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+16777216*this[E+3]},t.prototype.readUInt32BE=function(E,M){return E>>>=0,M||m(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},t.prototype.readIntLE=function(E,M,D){E>>>=0,M>>>=0,D||m(E,M,this.length);for(var V=this[E],Y=1,X=0;++X=(Y*=128)&&(V-=Math.pow(2,8*M)),V},t.prototype.readIntBE=function(E,M,D){E>>>=0,M>>>=0,D||m(E,M,this.length);for(var V=M,Y=1,X=this[E+--V];V>0&&(Y*=256);)X+=this[E+--V]*Y;return X>=(Y*=128)&&(X-=Math.pow(2,8*M)),X},t.prototype.readInt8=function(E,M){return E>>>=0,M||m(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},t.prototype.readInt16LE=function(E,M){E>>>=0,M||m(E,2,this.length);var D=this[E]|this[E+1]<<8;return 32768&D?4294901760|D:D},t.prototype.readInt16BE=function(E,M){E>>>=0,M||m(E,2,this.length);var D=this[E+1]|this[E]<<8;return 32768&D?4294901760|D:D},t.prototype.readInt32LE=function(E,M){return E>>>=0,M||m(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},t.prototype.readInt32BE=function(E,M){return E>>>=0,M||m(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},t.prototype.readFloatLE=function(E,M){return E>>>=0,M||m(E,4,this.length),a.read(this,E,!0,23,4)},t.prototype.readFloatBE=function(E,M){return E>>>=0,M||m(E,4,this.length),a.read(this,E,!1,23,4)},t.prototype.readDoubleLE=function(E,M){return E>>>=0,M||m(E,8,this.length),a.read(this,E,!0,52,8)},t.prototype.readDoubleBE=function(E,M){return E>>>=0,M||m(E,8,this.length),a.read(this,E,!1,52,8)},t.prototype.writeUIntLE=function(E,M,D,V){E=+E,M>>>=0,D>>>=0,V||b(this,E,M,D,Math.pow(2,8*D)-1,0);var Y=1,X=0;for(this[M]=255&E;++X>>=0,D>>>=0,V||b(this,E,M,D,Math.pow(2,8*D)-1,0);var Y=D-1,X=1;for(this[M+Y]=255&E;--Y>=0&&(X*=256);)this[M+Y]=E/X&255;return M+D},t.prototype.writeUInt8=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,1,255,0),this[M]=255&E,M+1},t.prototype.writeUInt16LE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,2,65535,0),this[M]=255&E,this[M+1]=E>>>8,M+2},t.prototype.writeUInt16BE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,2,65535,0),this[M]=E>>>8,this[M+1]=255&E,M+2},t.prototype.writeUInt32LE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,4,4294967295,0),this[M+3]=E>>>24,this[M+2]=E>>>16,this[M+1]=E>>>8,this[M]=255&E,M+4},t.prototype.writeUInt32BE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,4,4294967295,0),this[M]=E>>>24,this[M+1]=E>>>16,this[M+2]=E>>>8,this[M+3]=255&E,M+4},t.prototype.writeIntLE=function(E,M,D,V){if(E=+E,M>>>=0,!V){var Y=Math.pow(2,8*D-1);b(this,E,M,D,Y-1,-Y)}var X=0,G=1,et=0;for(this[M]=255&E;++X>0)-et&255;return M+D},t.prototype.writeIntBE=function(E,M,D,V){if(E=+E,M>>>=0,!V){var Y=Math.pow(2,8*D-1);b(this,E,M,D,Y-1,-Y)}var X=D-1,G=1,et=0;for(this[M+X]=255&E;--X>=0&&(G*=256);)E<0&&et===0&&this[M+X+1]!==0&&(et=1),this[M+X]=(E/G>>0)-et&255;return M+D},t.prototype.writeInt8=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,1,127,-128),E<0&&(E=255+E+1),this[M]=255&E,M+1},t.prototype.writeInt16LE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,2,32767,-32768),this[M]=255&E,this[M+1]=E>>>8,M+2},t.prototype.writeInt16BE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,2,32767,-32768),this[M]=E>>>8,this[M+1]=255&E,M+2},t.prototype.writeInt32LE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,4,2147483647,-2147483648),this[M]=255&E,this[M+1]=E>>>8,this[M+2]=E>>>16,this[M+3]=E>>>24,M+4},t.prototype.writeInt32BE=function(E,M,D){return E=+E,M>>>=0,D||b(this,E,M,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[M]=E>>>24,this[M+1]=E>>>16,this[M+2]=E>>>8,this[M+3]=255&E,M+4},t.prototype.writeFloatLE=function(E,M,D){return y(this,E,M,!0,D)},t.prototype.writeFloatBE=function(E,M,D){return y(this,E,M,!1,D)},t.prototype.writeDoubleLE=function(E,M,D){return C(this,E,M,!0,D)},t.prototype.writeDoubleBE=function(E,M,D){return C(this,E,M,!1,D)},t.prototype.copy=function(E,M,D,V){if(!t.isBuffer(E))throw new TypeError("argument should be a Buffer");if(D||(D=0),V||V===0||(V=this.length),M>=E.length&&(M=E.length),M||(M=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),E.length-M=0;--X)E[X+M]=this[X+D];else Uint8Array.prototype.set.call(E,this.subarray(D,V),M);return Y},t.prototype.fill=function(E,M,D,V){if(typeof E=="string"){if(typeof M=="string"?(V=M,M=0,D=this.length):typeof D=="string"&&(V=D,D=this.length),V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!t.isEncoding(V))throw new TypeError("Unknown encoding: "+V);if(E.length===1){var Y=E.charCodeAt(0);(V==="utf8"&&Y<128||V==="latin1")&&(E=Y)}}else typeof E=="number"&&(E&=255);if(M<0||this.length>>=0,D=D===void 0?this.length:D>>>0,E||(E=0),typeof E=="number")for(X=M;X55295&&D<57344){if(!Y){if(D>56319){(M-=3)>-1&&X.push(239,191,189);continue}if(G+1===V){(M-=3)>-1&&X.push(239,191,189);continue}Y=D;continue}if(D<56320){(M-=3)>-1&&X.push(239,191,189),Y=D;continue}D=65536+(Y-55296<<10|D-56320)}else Y&&(M-=3)>-1&&X.push(239,191,189);if(Y=null,D<128){if((M-=1)<0)break;X.push(D)}else if(D<2048){if((M-=2)<0)break;X.push(D>>6|192,63&D|128)}else if(D<65536){if((M-=3)<0)break;X.push(D>>12|224,D>>6&63|128,63&D|128)}else{if(!(D<1114112))throw new Error("Invalid code point");if((M-=4)<0)break;X.push(D>>18|240,D>>12&63|128,D>>6&63|128,63&D|128)}}return X}function H(E){return o.toByteArray(function(M){if((M=(M=M.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;M.length%4!=0;)M+="=";return M}(E))}function q(E,M,D,V){for(var Y=0;Y=M.length||Y>=E.length);++Y)M[Y+D]=E[Y];return Y}function O(E,M){return E instanceof M||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===M.name}function $(E){return E!=E}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,S,_){var d=e("safe-buffer").Buffer,o=e("stream").Transform,a=e("string_decoder").StringDecoder;function n(t){o.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(n,o),n.prototype.update=function(t,r,l){typeof t=="string"&&(t=d.from(t,r));var i=this._update(t);return this.hashMode?this:(l&&(i=this._toString(i,l)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,r,l){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(s){i=s}finally{l(i)}},n.prototype._flush=function(t){var r;try{this.push(this.__final())}catch(l){r=l}t(r)},n.prototype._finalOrDigest=function(t){var r=this.__final()||d.alloc(0);return t&&(r=this._toString(r,t,!0)),r},n.prototype._toString=function(t,r,l){if(this._decoder||(this._decoder=new a(r),this._encoding=r),this._encoding!==r)throw new Error("can't switch encodings");var i=this._decoder.write(t);return l&&(i+=this._decoder.end()),i},S.exports=n},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,S,_){var d=e("../internals/is-callable"),o=e("../internals/try-to-string"),a=TypeError;S.exports=function(n){if(d(n))return n;throw new a(o(n)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,S,_){var d=e("../internals/is-constructor"),o=e("../internals/try-to-string"),a=TypeError;S.exports=function(n){if(d(n))return n;throw new a(o(n)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,S,_){var d=e("../internals/is-callable"),o=String,a=TypeError;S.exports=function(n){if(typeof n=="object"||d(n))return n;throw new a("Can't set "+o(n)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(e,S,_){var d=e("../internals/well-known-symbol"),o=e("../internals/object-create"),a=e("../internals/object-define-property").f,n=d("unscopables"),t=Array.prototype;t[n]===void 0&&a(t,n,{configurable:!0,value:o(null)}),S.exports=function(r){t[n][r]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,S,_){var d=e("../internals/object-is-prototype-of"),o=TypeError;S.exports=function(a,n){if(d(n,a))return a;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(e,S,_){var d=e("../internals/is-object"),o=String,a=TypeError;S.exports=function(n){if(d(n))return n;throw new a(o(n)+" is not an object")}},{"../internals/is-object":289}],228:[function(e,S,_){var d=e("../internals/to-indexed-object"),o=e("../internals/to-absolute-index"),a=e("../internals/length-of-array-like"),n=function(t){return function(r,l,i){var s,h=d(r),c=a(h),u=o(i,c);if(t&&l!=l){for(;c>u;)if((s=h[u++])!=s)return!0}else for(;c>u;u++)if((t||u in h)&&h[u]===l)return t||u||0;return!t&&-1}};S.exports={includes:n(!0),indexOf:n(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,S,_){var d=e("../internals/function-bind-context"),o=e("../internals/function-uncurry-this"),a=e("../internals/indexed-object"),n=e("../internals/to-object"),t=e("../internals/length-of-array-like"),r=e("../internals/array-species-create"),l=o([].push),i=function(s){var h=s===1,c=s===2,u=s===3,p=s===4,f=s===6,w=s===7,x=s===5||f;return function(A,N,L,j){for(var F,P,U=n(A),B=a(U),k=d(N,L),T=t(B),v=0,m=j||r,b=h?m(A,T):c||w?m(A,0):void 0;T>v;v++)if((x||v in B)&&(P=k(F=B[v],v,U),s))if(h)b[v]=P;else if(P)switch(s){case 3:return!0;case 5:return F;case 6:return v;case 2:l(b,F)}else switch(s){case 4:return!1;case 7:l(b,F)}return f?-1:u||p?p:b}};S.exports={forEach:i(0),map:i(1),filter:i(2),some:i(3),every:i(4),find:i(5),findIndex:i(6),filterReject:i(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,S,_){var d=e("../internals/to-absolute-index"),o=e("../internals/length-of-array-like"),a=e("../internals/create-property"),n=Array,t=Math.max;S.exports=function(r,l,i){for(var s=o(r),h=d(l,s),c=d(i===void 0?s:i,s),u=n(t(c-h,0)),p=0;h0&&d[0]<4?1:+(d[0]+d[1])),!o&&n&&(!(d=n.match(/Edge\/(\d+)/))||d[1]>=74)&&(d=n.match(/Chrome\/(\d+)/))&&(o=+d[1]),S.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,S,_){S.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(e,S,_){var d=e("../internals/global"),o=e("../internals/object-get-own-property-descriptor").f,a=e("../internals/create-non-enumerable-property"),n=e("../internals/define-built-in"),t=e("../internals/define-global-property"),r=e("../internals/copy-constructor-properties"),l=e("../internals/is-forced");S.exports=function(i,s){var h,c,u,p,f,w=i.target,x=i.global,A=i.stat;if(h=x?d:A?d[w]||t(w,{}):(d[w]||{}).prototype)for(c in s){if(p=s[c],u=i.dontCallGetSet?(f=o(h,c))&&f.value:h[c],!l(x?c:w+(A?".":"#")+c,i.forced)&&u!==void 0){if(typeof p==typeof u)continue;r(p,u)}(i.sham||u&&u.sham)&&a(p,"sham",!0),n(h,c,p,i)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,S,_){S.exports=function(d){try{return!!d()}catch{return!0}}},{}],261:[function(e,S,_){var d=e("../internals/function-bind-native"),o=Function.prototype,a=o.apply,n=o.call;S.exports=typeof Reflect=="object"&&Reflect.apply||(d?n.bind(a):function(){return n.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,S,_){var d=e("../internals/function-uncurry-this-clause"),o=e("../internals/a-callable"),a=e("../internals/function-bind-native"),n=d(d.bind);S.exports=function(t,r){return o(t),r===void 0?t:a?n(t,r):function(){return t.apply(r,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,S,_){var d=e("../internals/fails");S.exports=!d(function(){var o=(function(){}).bind();return typeof o!="function"||o.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(e,S,_){var d=e("../internals/function-bind-native"),o=Function.prototype.call;S.exports=d?o.bind(o):function(){return o.apply(o,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,S,_){var d=e("../internals/descriptors"),o=e("../internals/has-own-property"),a=Function.prototype,n=d&&Object.getOwnPropertyDescriptor,t=o(a,"name"),r=t&&(function(){}).name==="something",l=t&&(!d||d&&n(a,"name").configurable);S.exports={EXISTS:t,PROPER:r,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,S,_){var d=e("../internals/function-uncurry-this"),o=e("../internals/a-callable");S.exports=function(a,n,t){try{return d(o(Object.getOwnPropertyDescriptor(a,n)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,S,_){var d=e("../internals/classof-raw"),o=e("../internals/function-uncurry-this");S.exports=function(a){if(d(a)==="Function")return o(a)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,S,_){var d=e("../internals/function-bind-native"),o=Function.prototype,a=o.call,n=d&&o.bind.bind(a,a);S.exports=d?n:function(t){return function(){return a.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,S,_){var d=e("../internals/global"),o=e("../internals/is-callable"),a=function(n){return o(n)?n:void 0};S.exports=function(n,t){return arguments.length<2?a(d[n]):d[n]&&d[n][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,S,_){var d=e("../internals/classof"),o=e("../internals/get-method"),a=e("../internals/is-null-or-undefined"),n=e("../internals/iterators"),t=e("../internals/well-known-symbol")("iterator");S.exports=function(r){if(!a(r))return o(r,t)||o(r,"@@iterator")||n[d(r)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,S,_){var d=e("../internals/function-call"),o=e("../internals/a-callable"),a=e("../internals/an-object"),n=e("../internals/try-to-string"),t=e("../internals/get-iterator-method"),r=TypeError;S.exports=function(l,i){var s=arguments.length<2?t(l):i;if(o(s))return a(d(s,l));throw new r(n(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,S,_){var d=e("../internals/function-uncurry-this"),o=e("../internals/is-array"),a=e("../internals/is-callable"),n=e("../internals/classof-raw"),t=e("../internals/to-string"),r=d([].push);S.exports=function(l){if(a(l))return l;if(o(l)){for(var i=l.length,s=[],h=0;hL;L++)if((F=y(f[L]))&&l(p,F))return F;return new u(!1)}A=i(f,N)}for(P=T?f.next:A.next;!(U=o(P,A)).done;){try{F=y(U.value)}catch(C){h(A,"throw",C)}if(typeof F=="object"&&F&&l(p,F))return F}return new u(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,S,_){var d=e("../internals/function-call"),o=e("../internals/an-object"),a=e("../internals/get-method");S.exports=function(n,t,r){var l,i;o(n);try{if(!(l=a(n,"return"))){if(t==="throw")throw r;return r}l=d(l,n)}catch(s){i=!0,l=s}if(t==="throw")throw r;if(i)throw l;return o(l),r}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,S,_){var d=e("../internals/iterators-core").IteratorPrototype,o=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),n=e("../internals/set-to-string-tag"),t=e("../internals/iterators"),r=function(){return this};S.exports=function(l,i,s,h){var c=i+" Iterator";return l.prototype=o(d,{next:a(+!h,s)}),n(l,c,!1,!0),t[c]=r,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,S,_){var d=e("../internals/export"),o=e("../internals/function-call"),a=e("../internals/is-pure"),n=e("../internals/function-name"),t=e("../internals/is-callable"),r=e("../internals/iterator-create-constructor"),l=e("../internals/object-get-prototype-of"),i=e("../internals/object-set-prototype-of"),s=e("../internals/set-to-string-tag"),h=e("../internals/create-non-enumerable-property"),c=e("../internals/define-built-in"),u=e("../internals/well-known-symbol"),p=e("../internals/iterators"),f=e("../internals/iterators-core"),w=n.PROPER,x=n.CONFIGURABLE,A=f.IteratorPrototype,N=f.BUGGY_SAFARI_ITERATORS,L=u("iterator"),j=function(){return this};S.exports=function(F,P,U,B,k,T,v){r(U,P,B);var m,b,g,y=function(O){if(O===k&&H)return H;if(!N&&O&&O in I)return I[O];switch(O){case"keys":case"values":case"entries":return function(){return new U(this,O)}}return function(){return new U(this)}},C=P+" Iterator",R=!1,I=F.prototype,z=I[L]||I["@@iterator"]||k&&I[k],H=!N&&z||y(k),q=P==="Array"&&I.entries||z;if(q&&(m=l(q.call(new F)))!==Object.prototype&&m.next&&(a||l(m)===A||(i?i(m,A):t(m[L])||c(m,L,j)),s(m,C,!0,!0),a&&(p[C]=j)),w&&k==="values"&&z&&z.name!=="values"&&(!a&&x?h(I,"name","values"):(R=!0,H=function(){return o(z,this)})),k)if(b={values:y("values"),keys:T?H:y("keys"),entries:y("entries")},v)for(g in b)(N||R||!(g in I))&&c(I,g,b[g]);else d({target:P,proto:!0,forced:N||R},b);return a&&!v||I[L]===H||c(I,L,H,{name:k}),p[P]=H,b}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,S,_){var d,o,a,n=e("../internals/fails"),t=e("../internals/is-callable"),r=e("../internals/is-object"),l=e("../internals/object-create"),i=e("../internals/object-get-prototype-of"),s=e("../internals/define-built-in"),h=e("../internals/well-known-symbol"),c=e("../internals/is-pure"),u=h("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(o=i(i(a)))!==Object.prototype&&(d=o):p=!0),!r(d)||n(function(){var f={};return d[u].call(f)!==f})?d={}:c&&(d=l(d)),t(d[u])||s(d,u,function(){return this}),S.exports={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:p}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,S,_){arguments[4][276][0].apply(_,arguments)},{dup:276}],299:[function(e,S,_){var d=e("../internals/to-length");S.exports=function(o){return d(o.length)}},{"../internals/to-length":343}],300:[function(e,S,_){var d=e("../internals/function-uncurry-this"),o=e("../internals/fails"),a=e("../internals/is-callable"),n=e("../internals/has-own-property"),t=e("../internals/descriptors"),r=e("../internals/function-name").CONFIGURABLE,l=e("../internals/inspect-source"),i=e("../internals/internal-state"),s=i.enforce,h=i.get,c=String,u=Object.defineProperty,p=d("".slice),f=d("".replace),w=d([].join),x=t&&!o(function(){return u(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),N=S.exports=function(L,j,F){p(c(j),0,7)==="Symbol("&&(j="["+f(c(j),/^Symbol\(([^)]*)\)/,"$1")+"]"),F&&F.getter&&(j="get "+j),F&&F.setter&&(j="set "+j),(!n(L,"name")||r&&L.name!==j)&&(t?u(L,"name",{value:j,configurable:!0}):L.name=j),x&&F&&n(F,"arity")&&L.length!==F.arity&&u(L,"length",{value:F.arity});try{F&&n(F,"constructor")&&F.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch{}var P=s(L);return n(P,"source")||(P.source=w(A,typeof j=="string"?j:"")),L};Function.prototype.toString=N(function(){return a(this)&&h(this).source||l(this)},"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,S,_){var d=Math.ceil,o=Math.floor;S.exports=Math.trunc||function(a){var n=+a;return(n>0?o:d)(n)}},{}],302:[function(e,S,_){var d,o,a,n,t,r=e("../internals/global"),l=e("../internals/function-bind-context"),i=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/task").set,h=e("../internals/queue"),c=e("../internals/engine-is-ios"),u=e("../internals/engine-is-ios-pebble"),p=e("../internals/engine-is-webos-webkit"),f=e("../internals/engine-is-node"),w=r.MutationObserver||r.WebKitMutationObserver,x=r.document,A=r.process,N=r.Promise,L=i(r,"queueMicrotask"),j=L&&L.value;if(!j){var F=new h,P=function(){var U,B;for(f&&(U=A.domain)&&U.exit();B=F.get();)try{B()}catch(k){throw F.head&&d(),k}U&&U.enter()};c||f||p||!w||!x?!u&&N&&N.resolve?((n=N.resolve(void 0)).constructor=N,t=l(n.then,n),d=function(){t(P)}):f?d=function(){A.nextTick(P)}:(s=l(s,r),d=function(){s(P)}):(o=!0,a=x.createTextNode(""),new w(P).observe(a,{characterData:!0}),d=function(){a.data=o=!o}),j=function(U){F.head||d(),F.add(U)}}S.exports=j},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,S,_){var d=e("../internals/a-callable"),o=TypeError,a=function(n){var t,r;this.promise=new n(function(l,i){if(t!==void 0||r!==void 0)throw new o("Bad Promise constructor");t=l,r=i}),this.resolve=d(t),this.reject=d(r)};S.exports.f=function(n){return new a(n)}},{"../internals/a-callable":222}],304:[function(e,S,_){var d=e("../internals/is-regexp"),o=TypeError;S.exports=function(a){if(d(a))throw new o("The method doesn't accept regular expressions");return a}},{"../internals/is-regexp":291}],305:[function(e,S,_){var d=e("../internals/descriptors"),o=e("../internals/function-uncurry-this"),a=e("../internals/function-call"),n=e("../internals/fails"),t=e("../internals/object-keys"),r=e("../internals/object-get-own-property-symbols"),l=e("../internals/object-property-is-enumerable"),i=e("../internals/to-object"),s=e("../internals/indexed-object"),h=Object.assign,c=Object.defineProperty,u=o([].concat);S.exports=!h||n(function(){if(d&&h({b:1},h(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var p={},f={},w=Symbol("assign detection");return p[w]=7,"abcdefghijklmnopqrst".split("").forEach(function(x){f[x]=x}),h({},p)[w]!==7||t(h({},f)).join("")!=="abcdefghijklmnopqrst"})?function(p,f){for(var w=i(p),x=arguments.length,A=1,N=r.f,L=l.f;x>A;)for(var j,F=s(arguments[A++]),P=N?u(t(F),N(F)):t(F),U=P.length,B=0;U>B;)j=P[B++],d&&!a(L,F,j)||(w[j]=F[j]);return w}:h},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,S,_){var d,o=e("../internals/an-object"),a=e("../internals/object-define-properties"),n=e("../internals/enum-bug-keys"),t=e("../internals/hidden-keys"),r=e("../internals/html"),l=e("../internals/document-create-element"),i=e("../internals/shared-key"),s=i("IE_PROTO"),h=function(){},c=function(f){return"