(function(_r,ae){typeof exports=="object"&&typeof module<"u"?ae(exports):typeof define=="function"&&define.amd?define(["exports"],ae):(_r=typeof globalThis<"u"?globalThis:_r||self,ae(_r.SevenClient={}))})(this,function(exports){"use strict";var Er=Object.defineProperty;var $r=(_r,ae,ie)=>ae in _r?Er(_r,ae,{enumerable:!0,configurable:!0,writable:!0,value:ie}):_r[ae]=ie;var Mr=(_r,ae,ie)=>$r(_r,typeof ae!="symbol"?ae+"":ae,ie);function _mergeNamespaces(ae,ie){for(var he=0;heoe[pe]})}}}return Object.freeze(Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"}))}const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="ARRAYBUFFER not supported by this environment",e="UINT8ARRAY not supported by this environment";function r$1(ae,ie,he,oe){let pe,se,be;const ge=ie||[0],_e=(he=he||0)>>>3,Ee=oe===-1?3:0;for(pe=0;pe>>2,ge.length<=se&&ge.push(0),ge[se]|=ae[pe]<<8*(Ee+oe*(be%4));return{value:ge,binLen:8*ae.length+he}}function i(ae,ie,he){switch(ie){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(ae){case"HEX":return function(oe,pe,se){return function(be,ge,_e,Ee){let we,Me,$e,Re;if(be.length%2!=0)throw new Error("String of HEX type must be in byte increments");const ke=ge||[0],Ne=(_e=_e||0)>>>3,ze=Ee===-1?3:0;for(we=0;we>>1)+Ne,$e=Re>>>2;ke.length<=$e;)ke.push(0);ke[$e]|=Me<<8*(ze+Ee*(Re%4))}return{value:ke,binLen:4*be.length+_e}}(oe,pe,se,he)};case"TEXT":return function(oe,pe,se){return function(be,ge,_e,Ee,we){let Me,$e,Re,ke,Ne,ze,He,qe,We=0;const je=_e||[0],Xe=(Ee=Ee||0)>>>3;if(ge==="UTF8")for(He=we===-1?3:0,Re=0;ReMe?$e.push(Me):2048>Me?($e.push(192|Me>>>6),$e.push(128|63&Me)):55296>Me||57344<=Me?$e.push(224|Me>>>12,128|Me>>>6&63,128|63&Me):(Re+=1,Me=65536+((1023&Me)<<10|1023&be.charCodeAt(Re)),$e.push(240|Me>>>18,128|Me>>>12&63,128|Me>>>6&63,128|63&Me)),ke=0;ke<$e.length;ke+=1){for(ze=We+Xe,Ne=ze>>>2;je.length<=Ne;)je.push(0);je[Ne]|=$e[ke]<<8*(He+we*(ze%4)),We+=1}else for(He=we===-1?2:0,qe=ge==="UTF16LE"&&we!==1||ge!=="UTF16LE"&&we===1,Re=0;Re>>8),ze=We+Xe,Ne=ze>>>2;je.length<=Ne;)je.push(0);je[Ne]|=Me<<8*(He+we*(ze%4)),We+=2}return{value:je,binLen:8*We+Ee}}(oe,ie,pe,se,he)};case"B64":return function(oe,pe,se){return function(be,ge,_e,Ee){let we,Me,$e,Re,ke,Ne,ze,He=0;const qe=ge||[0],We=(_e=_e||0)>>>3,je=Ee===-1?3:0,Xe=be.indexOf("=");if(be.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(be=be.replace(/=/g,""),Xe!==-1&&XeformatRelativeLocale[ae];function buildLocalizeFn(ae){return(ie,he)=>{const oe=he!=null&&he.context?String(he.context):"standalone";let pe;if(oe==="formatting"&&ae.formattingValues){const be=ae.defaultFormattingWidth||ae.defaultWidth,ge=he!=null&&he.width?String(he.width):be;pe=ae.formattingValues[ge]||ae.formattingValues[be]}else{const be=ae.defaultWidth,ge=he!=null&&he.width?String(he.width):ae.defaultWidth;pe=ae.values[ge]||ae.values[be]}const se=ae.argumentCallback?ae.argumentCallback(ie):ie;return pe[se]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(ae,ie)=>{const he=Number(ae),oe=he%100;if(oe>20||oe<10)switch(oe%10){case 1:return he+"st";case 2:return he+"nd";case 3:return he+"rd"}return he+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:ae=>ae-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(ae){return(ie,he={})=>{const oe=he.width,pe=oe&&ae.matchPatterns[oe]||ae.matchPatterns[ae.defaultMatchWidth],se=ie.match(pe);if(!se)return null;const be=se[0],ge=oe&&ae.parsePatterns[oe]||ae.parsePatterns[ae.defaultParseWidth],_e=Array.isArray(ge)?findIndex(ge,Me=>Me.test(be)):findKey(ge,Me=>Me.test(be));let Ee;Ee=ae.valueCallback?ae.valueCallback(_e):_e,Ee=he.valueCallback?he.valueCallback(Ee):Ee;const we=ie.slice(be.length);return{value:Ee,rest:we}}}function findKey(ae,ie){for(const he in ae)if(Object.prototype.hasOwnProperty.call(ae,he)&&ie(ae[he]))return he}function findIndex(ae,ie){for(let he=0;he{const oe=ie.match(ae.matchPattern);if(!oe)return null;const pe=oe[0],se=ie.match(ae.parsePattern);if(!se)return null;let be=ae.valueCallback?ae.valueCallback(se[0]):se[0];be=he.valueCallback?he.valueCallback(be):be;const ge=ie.slice(pe.length);return{value:be,rest:ge}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:ae=>parseInt(ae,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:ae=>ae+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(ae,ie){const he=toDate(ae,ie==null?void 0:ie.in);return differenceInCalendarDays(he,startOfYear(he))+1}function getISOWeek(ae,ie){const he=toDate(ae,ie==null?void 0:ie.in),oe=+startOfISOWeek(he)-+startOfISOWeekYear(he);return Math.round(oe/millisecondsInWeek)+1}function getWeekYear(ae,ie){var we,Me,$e,Re;const he=toDate(ae,ie==null?void 0:ie.in),oe=he.getFullYear(),pe=getDefaultOptions(),se=(ie==null?void 0:ie.firstWeekContainsDate)??((Me=(we=ie==null?void 0:ie.locale)==null?void 0:we.options)==null?void 0:Me.firstWeekContainsDate)??pe.firstWeekContainsDate??((Re=($e=pe.locale)==null?void 0:$e.options)==null?void 0:Re.firstWeekContainsDate)??1,be=constructFrom((ie==null?void 0:ie.in)||ae,0);be.setFullYear(oe+1,0,se),be.setHours(0,0,0,0);const ge=startOfWeek(be,ie),_e=constructFrom((ie==null?void 0:ie.in)||ae,0);_e.setFullYear(oe,0,se),_e.setHours(0,0,0,0);const Ee=startOfWeek(_e,ie);return+he>=+ge?oe+1:+he>=+Ee?oe:oe-1}function startOfWeekYear(ae,ie){var ge,_e,Ee,we;const he=getDefaultOptions(),oe=(ie==null?void 0:ie.firstWeekContainsDate)??((_e=(ge=ie==null?void 0:ie.locale)==null?void 0:ge.options)==null?void 0:_e.firstWeekContainsDate)??he.firstWeekContainsDate??((we=(Ee=he.locale)==null?void 0:Ee.options)==null?void 0:we.firstWeekContainsDate)??1,pe=getWeekYear(ae,ie),se=constructFrom((ie==null?void 0:ie.in)||ae,0);return se.setFullYear(pe,0,oe),se.setHours(0,0,0,0),startOfWeek(se,ie)}function getWeek(ae,ie){const he=toDate(ae,ie==null?void 0:ie.in),oe=+startOfWeek(he,ie)-+startOfWeekYear(he,ie);return Math.round(oe/millisecondsInWeek)+1}function addLeadingZeros(ae,ie){const he=ae<0?"-":"",oe=Math.abs(ae).toString().padStart(ie,"0");return he+oe}const lightFormatters={y(ae,ie){const he=ae.getFullYear(),oe=he>0?he:1-he;return addLeadingZeros(ie==="yy"?oe%100:oe,ie.length)},M(ae,ie){const he=ae.getMonth();return ie==="M"?String(he+1):addLeadingZeros(he+1,2)},d(ae,ie){return addLeadingZeros(ae.getDate(),ie.length)},a(ae,ie){const he=ae.getHours()/12>=1?"pm":"am";switch(ie){case"a":case"aa":return he.toUpperCase();case"aaa":return he;case"aaaaa":return he[0];case"aaaa":default:return he==="am"?"a.m.":"p.m."}},h(ae,ie){return addLeadingZeros(ae.getHours()%12||12,ie.length)},H(ae,ie){return addLeadingZeros(ae.getHours(),ie.length)},m(ae,ie){return addLeadingZeros(ae.getMinutes(),ie.length)},s(ae,ie){return addLeadingZeros(ae.getSeconds(),ie.length)},S(ae,ie){const he=ie.length,oe=ae.getMilliseconds(),pe=Math.trunc(oe*Math.pow(10,he-3));return addLeadingZeros(pe,ie.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(ae,ie,he){const oe=ae.getFullYear()>0?1:0;switch(ie){case"G":case"GG":case"GGG":return he.era(oe,{width:"abbreviated"});case"GGGGG":return he.era(oe,{width:"narrow"});case"GGGG":default:return he.era(oe,{width:"wide"})}},y:function(ae,ie,he){if(ie==="yo"){const oe=ae.getFullYear(),pe=oe>0?oe:1-oe;return he.ordinalNumber(pe,{unit:"year"})}return lightFormatters.y(ae,ie)},Y:function(ae,ie,he,oe){const pe=getWeekYear(ae,oe),se=pe>0?pe:1-pe;if(ie==="YY"){const be=se%100;return addLeadingZeros(be,2)}return ie==="Yo"?he.ordinalNumber(se,{unit:"year"}):addLeadingZeros(se,ie.length)},R:function(ae,ie){const he=getISOWeekYear(ae);return addLeadingZeros(he,ie.length)},u:function(ae,ie){const he=ae.getFullYear();return addLeadingZeros(he,ie.length)},Q:function(ae,ie,he){const oe=Math.ceil((ae.getMonth()+1)/3);switch(ie){case"Q":return String(oe);case"QQ":return addLeadingZeros(oe,2);case"Qo":return he.ordinalNumber(oe,{unit:"quarter"});case"QQQ":return he.quarter(oe,{width:"abbreviated",context:"formatting"});case"QQQQQ":return he.quarter(oe,{width:"narrow",context:"formatting"});case"QQQQ":default:return he.quarter(oe,{width:"wide",context:"formatting"})}},q:function(ae,ie,he){const oe=Math.ceil((ae.getMonth()+1)/3);switch(ie){case"q":return String(oe);case"qq":return addLeadingZeros(oe,2);case"qo":return he.ordinalNumber(oe,{unit:"quarter"});case"qqq":return he.quarter(oe,{width:"abbreviated",context:"standalone"});case"qqqqq":return he.quarter(oe,{width:"narrow",context:"standalone"});case"qqqq":default:return he.quarter(oe,{width:"wide",context:"standalone"})}},M:function(ae,ie,he){const oe=ae.getMonth();switch(ie){case"M":case"MM":return lightFormatters.M(ae,ie);case"Mo":return he.ordinalNumber(oe+1,{unit:"month"});case"MMM":return he.month(oe,{width:"abbreviated",context:"formatting"});case"MMMMM":return he.month(oe,{width:"narrow",context:"formatting"});case"MMMM":default:return he.month(oe,{width:"wide",context:"formatting"})}},L:function(ae,ie,he){const oe=ae.getMonth();switch(ie){case"L":return String(oe+1);case"LL":return addLeadingZeros(oe+1,2);case"Lo":return he.ordinalNumber(oe+1,{unit:"month"});case"LLL":return he.month(oe,{width:"abbreviated",context:"standalone"});case"LLLLL":return he.month(oe,{width:"narrow",context:"standalone"});case"LLLL":default:return he.month(oe,{width:"wide",context:"standalone"})}},w:function(ae,ie,he,oe){const pe=getWeek(ae,oe);return ie==="wo"?he.ordinalNumber(pe,{unit:"week"}):addLeadingZeros(pe,ie.length)},I:function(ae,ie,he){const oe=getISOWeek(ae);return ie==="Io"?he.ordinalNumber(oe,{unit:"week"}):addLeadingZeros(oe,ie.length)},d:function(ae,ie,he){return ie==="do"?he.ordinalNumber(ae.getDate(),{unit:"date"}):lightFormatters.d(ae,ie)},D:function(ae,ie,he){const oe=getDayOfYear(ae);return ie==="Do"?he.ordinalNumber(oe,{unit:"dayOfYear"}):addLeadingZeros(oe,ie.length)},E:function(ae,ie,he){const oe=ae.getDay();switch(ie){case"E":case"EE":case"EEE":return he.day(oe,{width:"abbreviated",context:"formatting"});case"EEEEE":return he.day(oe,{width:"narrow",context:"formatting"});case"EEEEEE":return he.day(oe,{width:"short",context:"formatting"});case"EEEE":default:return he.day(oe,{width:"wide",context:"formatting"})}},e:function(ae,ie,he,oe){const pe=ae.getDay(),se=(pe-oe.weekStartsOn+8)%7||7;switch(ie){case"e":return String(se);case"ee":return addLeadingZeros(se,2);case"eo":return he.ordinalNumber(se,{unit:"day"});case"eee":return he.day(pe,{width:"abbreviated",context:"formatting"});case"eeeee":return he.day(pe,{width:"narrow",context:"formatting"});case"eeeeee":return he.day(pe,{width:"short",context:"formatting"});case"eeee":default:return he.day(pe,{width:"wide",context:"formatting"})}},c:function(ae,ie,he,oe){const pe=ae.getDay(),se=(pe-oe.weekStartsOn+8)%7||7;switch(ie){case"c":return String(se);case"cc":return addLeadingZeros(se,ie.length);case"co":return he.ordinalNumber(se,{unit:"day"});case"ccc":return he.day(pe,{width:"abbreviated",context:"standalone"});case"ccccc":return he.day(pe,{width:"narrow",context:"standalone"});case"cccccc":return he.day(pe,{width:"short",context:"standalone"});case"cccc":default:return he.day(pe,{width:"wide",context:"standalone"})}},i:function(ae,ie,he){const oe=ae.getDay(),pe=oe===0?7:oe;switch(ie){case"i":return String(pe);case"ii":return addLeadingZeros(pe,ie.length);case"io":return he.ordinalNumber(pe,{unit:"day"});case"iii":return he.day(oe,{width:"abbreviated",context:"formatting"});case"iiiii":return he.day(oe,{width:"narrow",context:"formatting"});case"iiiiii":return he.day(oe,{width:"short",context:"formatting"});case"iiii":default:return he.day(oe,{width:"wide",context:"formatting"})}},a:function(ae,ie,he){const pe=ae.getHours()/12>=1?"pm":"am";switch(ie){case"a":case"aa":return he.dayPeriod(pe,{width:"abbreviated",context:"formatting"});case"aaa":return he.dayPeriod(pe,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return he.dayPeriod(pe,{width:"narrow",context:"formatting"});case"aaaa":default:return he.dayPeriod(pe,{width:"wide",context:"formatting"})}},b:function(ae,ie,he){const oe=ae.getHours();let pe;switch(oe===12?pe=dayPeriodEnum.noon:oe===0?pe=dayPeriodEnum.midnight:pe=oe/12>=1?"pm":"am",ie){case"b":case"bb":return he.dayPeriod(pe,{width:"abbreviated",context:"formatting"});case"bbb":return he.dayPeriod(pe,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return he.dayPeriod(pe,{width:"narrow",context:"formatting"});case"bbbb":default:return he.dayPeriod(pe,{width:"wide",context:"formatting"})}},B:function(ae,ie,he){const oe=ae.getHours();let pe;switch(oe>=17?pe=dayPeriodEnum.evening:oe>=12?pe=dayPeriodEnum.afternoon:oe>=4?pe=dayPeriodEnum.morning:pe=dayPeriodEnum.night,ie){case"B":case"BB":case"BBB":return he.dayPeriod(pe,{width:"abbreviated",context:"formatting"});case"BBBBB":return he.dayPeriod(pe,{width:"narrow",context:"formatting"});case"BBBB":default:return he.dayPeriod(pe,{width:"wide",context:"formatting"})}},h:function(ae,ie,he){if(ie==="ho"){let oe=ae.getHours()%12;return oe===0&&(oe=12),he.ordinalNumber(oe,{unit:"hour"})}return lightFormatters.h(ae,ie)},H:function(ae,ie,he){return ie==="Ho"?he.ordinalNumber(ae.getHours(),{unit:"hour"}):lightFormatters.H(ae,ie)},K:function(ae,ie,he){const oe=ae.getHours()%12;return ie==="Ko"?he.ordinalNumber(oe,{unit:"hour"}):addLeadingZeros(oe,ie.length)},k:function(ae,ie,he){let oe=ae.getHours();return oe===0&&(oe=24),ie==="ko"?he.ordinalNumber(oe,{unit:"hour"}):addLeadingZeros(oe,ie.length)},m:function(ae,ie,he){return ie==="mo"?he.ordinalNumber(ae.getMinutes(),{unit:"minute"}):lightFormatters.m(ae,ie)},s:function(ae,ie,he){return ie==="so"?he.ordinalNumber(ae.getSeconds(),{unit:"second"}):lightFormatters.s(ae,ie)},S:function(ae,ie){return lightFormatters.S(ae,ie)},X:function(ae,ie,he){const oe=ae.getTimezoneOffset();if(oe===0)return"Z";switch(ie){case"X":return formatTimezoneWithOptionalMinutes(oe);case"XXXX":case"XX":return formatTimezone(oe);case"XXXXX":case"XXX":default:return formatTimezone(oe,":")}},x:function(ae,ie,he){const oe=ae.getTimezoneOffset();switch(ie){case"x":return formatTimezoneWithOptionalMinutes(oe);case"xxxx":case"xx":return formatTimezone(oe);case"xxxxx":case"xxx":default:return formatTimezone(oe,":")}},O:function(ae,ie,he){const oe=ae.getTimezoneOffset();switch(ie){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(oe,":");case"OOOO":default:return"GMT"+formatTimezone(oe,":")}},z:function(ae,ie,he){const oe=ae.getTimezoneOffset();switch(ie){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(oe,":");case"zzzz":default:return"GMT"+formatTimezone(oe,":")}},t:function(ae,ie,he){const oe=Math.trunc(+ae/1e3);return addLeadingZeros(oe,ie.length)},T:function(ae,ie,he){return addLeadingZeros(+ae,ie.length)}};function formatTimezoneShort(ae,ie=""){const he=ae>0?"-":"+",oe=Math.abs(ae),pe=Math.trunc(oe/60),se=oe%60;return se===0?he+String(pe):he+String(pe)+ie+addLeadingZeros(se,2)}function formatTimezoneWithOptionalMinutes(ae,ie){return ae%60===0?(ae>0?"-":"+")+addLeadingZeros(Math.abs(ae)/60,2):formatTimezone(ae,ie)}function formatTimezone(ae,ie=""){const he=ae>0?"-":"+",oe=Math.abs(ae),pe=addLeadingZeros(Math.trunc(oe/60),2),se=addLeadingZeros(oe%60,2);return he+pe+ie+se}const dateLongFormatter=(ae,ie)=>{switch(ae){case"P":return ie.date({width:"short"});case"PP":return ie.date({width:"medium"});case"PPP":return ie.date({width:"long"});case"PPPP":default:return ie.date({width:"full"})}},timeLongFormatter=(ae,ie)=>{switch(ae){case"p":return ie.time({width:"short"});case"pp":return ie.time({width:"medium"});case"ppp":return ie.time({width:"long"});case"pppp":default:return ie.time({width:"full"})}},dateTimeLongFormatter=(ae,ie)=>{const he=ae.match(/(P+)(p+)?/)||[],oe=he[1],pe=he[2];if(!pe)return dateLongFormatter(ae,ie);let se;switch(oe){case"P":se=ie.dateTime({width:"short"});break;case"PP":se=ie.dateTime({width:"medium"});break;case"PPP":se=ie.dateTime({width:"long"});break;case"PPPP":default:se=ie.dateTime({width:"full"});break}return se.replace("{{date}}",dateLongFormatter(oe,ie)).replace("{{time}}",timeLongFormatter(pe,ie))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(ae){return dayOfYearTokenRE.test(ae)}function isProtectedWeekYearToken(ae){return weekYearTokenRE.test(ae)}function warnOrThrowProtectedError(ae,ie,he){const oe=message(ae,ie,he);if(console.warn(oe),throwTokens.includes(ae))throw new RangeError(oe)}function message(ae,ie,he){const oe=ae[0]==="Y"?"years":"days of the month";return`Use \`${ae.toLowerCase()}\` instead of \`${ae}\` (in \`${ie}\`) for formatting ${oe} to the input \`${he}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format(ae,ie,he){var we,Me,$e,Re;const oe=getDefaultOptions(),pe=oe.locale??enUS,se=oe.firstWeekContainsDate??((Me=(we=oe.locale)==null?void 0:we.options)==null?void 0:Me.firstWeekContainsDate)??1,be=oe.weekStartsOn??((Re=($e=oe.locale)==null?void 0:$e.options)==null?void 0:Re.weekStartsOn)??0,ge=toDate(ae,he==null?void 0:he.in);if(!isValid(ge))throw new RangeError("Invalid time value");let _e=ie.match(longFormattingTokensRegExp).map(ke=>{const Ne=ke[0];if(Ne==="p"||Ne==="P"){const ze=longFormatters[Ne];return ze(ke,pe.formatLong)}return ke}).join("").match(formattingTokensRegExp).map(ke=>{if(ke==="''")return{isToken:!1,value:"'"};const Ne=ke[0];if(Ne==="'")return{isToken:!1,value:cleanEscapedString(ke)};if(formatters[Ne])return{isToken:!0,value:ke};if(Ne.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return{isToken:!1,value:ke}});pe.localize.preprocessor&&(_e=pe.localize.preprocessor(ge,_e));const Ee={firstWeekContainsDate:se,weekStartsOn:be,locale:pe};return _e.map(ke=>{if(!ke.isToken)return ke.value;const Ne=ke.value;(isProtectedWeekYearToken(Ne)||isProtectedDayOfYearToken(Ne))&&warnOrThrowProtectedError(Ne,ie,String(ae));const ze=formatters[Ne[0]];return ze(ge,Ne,pe.localize,Ee)}).join("")}function cleanEscapedString(ae){const ie=ae.match(escapedStringRegExp);return ie?ie[1].replace(doubleQuoteRegExp,"'"):ae}class ApiPayload{constructor(ie={}){Mr(this,"payload");this.params=ie,this.payload=ie}convert(){return this.payload}}class AnalyticsPayload extends ApiPayload{convert(){return this.end(),this.start(),this.payload}end(){return this.params.end&&(this.payload.end=this.formatDate(this.params.end)),this.payload.end}start(){this.params.start&&(this.payload.start=this.formatDate(this.params.start))}formatDate(ie){return format(ie,"yyyy-MM-dd")}}class AnalyticsResource extends AbstractResource{async byCountry(ie={}){const he=new AnalyticsPayload(ie).convert();return await this.client.request("get","analytics/country",he)}async byDate(ie={}){const he=new AnalyticsPayload(ie).convert();return await this.client.request("get","analytics/date",he)}async byLabel(ie={}){const he=new AnalyticsPayload(ie).convert();return await this.client.request("get","analytics/label",he)}async bySubaccount(ie={}){const he=new AnalyticsPayload(ie).convert();return await this.client.request("get","analytics/subaccount",he)}}const ANALYTICS_LABELS=["all"],ANALYTICS_SUBACCOUNTS=["only_main","all"];class BalanceResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"get",async()=>await this.client.request("get","balance",new ApiPayload().convert()))}}class ContactsListPayload extends ApiPayload{convert(){const{groupId:ie,orderBy:he,orderDirection:oe,...pe}=this.params;return{...pe,group_id:ie,order_by:he,order_direction:oe}}}class ContactsUpsertPayload extends ApiPayload{convert(){const{avatar:ie,groups:he,properties:oe}=this.params,{fullname:pe,...se}=oe,be={};return Object.entries(se).forEach(([ge,_e])=>{_e!==null&&(be[ge]=_e)}),{avatar:ie,groups:he,...be}}}class ContactsResource extends AbstractResource{async create({avatar:ie,groups:he,properties:oe}){const pe={avatar:ie,created:"",groups:he,id:0,initials:{color:"",initials:""},properties:{...oe,fullname:""},validation:{state:null,timestamp:null}},se=new ContactsUpsertPayload(pe).convert();return await this.client.request("post","contacts",se,Client.CONTENT_TYPE_URLENCODED)}async delete(ie){return await this.client.request("delete",`contacts/${ie}`,new ApiPayload().convert())}async get(ie){return await this.client.request("get",`contacts/${ie}`,new ApiPayload().convert())}async list(ie={}){return await this.client.request("get","contacts",new ContactsListPayload(ie).convert())}async update(ie){const he=new ContactsUpsertPayload(ie).convert();return await this.client.request("patch",`contacts/${ie.id}`,he,Client.CONTENT_TYPE_URLENCODED)}}class GroupsResource extends AbstractResource{async edit(ie,he){const oe=new ApiPayload(he).convert();return await this.client.request("patch",`groups/${ie}`,oe)}async create(ie){return await this.client.request("post","groups",new ApiPayload(ie).convert())}async delete(ie,he=!1){const oe=`groups/${ie}?delete_contacts=${he}`;return await this.client.request("delete",oe,new ApiPayload().convert())}async all(){return await this.client.request("get","groups",new ApiPayload().convert())}async one(ie){return await this.client.request("get",`groups/${ie}`,new ApiPayload().convert())}}class HooksSubscribePayload extends ApiPayload{convert(){const{eventFilter:ie,eventType:he,requestMethod:oe,targetUrl:pe}=this.params;return{request_method:oe,event_filter:ie,event_type:he,target_url_:pe}}}class HooksResource extends AbstractResource{async read(){const ie=new ApiPayload().convert(),he=await this.client.request("get","hooks",ie);return he.hooks&&(he.hooks=he.hooks.map(oe=>(oe.created=new Date(oe.created),oe))),he}async subscribe(ie){return await this.client.request("post","hooks",new HooksSubscribePayload(ie).convert())}async unsubscribe(ie){return await this.client.request("delete","hooks",new ApiPayload({id:ie}).convert())}}const HOOK_EVENT_TYPES=["all","dlr","sms_mo","rcs","tracking","voice_call","voice_status"],HOOK_REQUEST_METHODS=["GET","JSON","POST"];class JournalPayload extends ApiPayload{convert(){const{dateFrom:ie,dateTo:he,...oe}=this.params;return{...oe,date_from:ie,date_to:he}}}class JournalResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"replies",async(he={})=>this.client.request("get","journal/replies",new JournalPayload(he).convert()));Mr(this,"voice",async(he={})=>this.client.request("get","journal/voice",new JournalPayload(he).convert()))}async inbound(he={}){return this.client.request("get","journal/inbound",new JournalPayload(he).convert())}async outbound(he={}){return this.client.request("get","journal/outbound",new JournalPayload(he).convert())}}const LOOKUP_GSM_CODES=["0","1","2","3","5","6","7","8","9","a","b","c","d","e","f","10","11","12","13","14","15","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","3a","47","48","56","2100","2101","2102","2200","2201","2202","2203","2204","2205","2206","2207","2300","2301","2302","2400","2401","2402","2403","2404","6000","6xxx","6001","6002","6003","6004","6005","6006","8000","8001","8002","8003","8004","8008","800b","8010","a001","a002","cxxx","c000","c001","c002","c003","c004","c005","c006","c007","c008","c009","c00a","c00b","c00d","d000","d001","d002","d004","d00a","d00c","d010","d020","e010","e040","e082","fc0a","fc06","fc07","fc08","ffdd","ffde","ffdf","ffe0","ffe1","ffe5","fff0","ffff","4xxx","81xx","82xx","83xx","84xx","85xx","86xx","87xx","88xx","8axx","89xx","8cxx","exxx","e140"];var NetworkType=(ae=>(ae.FixedLine="fixed_line",ae.FixedLineOrMobile="fixed_line_or_mobile",ae.Mobile="mobile",ae.Pager="pager",ae.PersonalNumber="personal_number",ae.PremiumRate="premium_rate",ae.SharedCost="shared_cost",ae.TollFree="toll_free",ae.Uan="uan",ae.Unknown="unknown",ae.Voicemail="voicemail",ae.Voip="voip",ae))(NetworkType||{}),ProviderName=(ae=>(ae.D1="d1",ae.D2="d2",ae.O2="o2",ae.Eplus="eplus",ae.NotAvailable="N/A",ae.International="int",ae))(ProviderName||{});const API_RESPONSE_CODES=[100,ErrorCode.InvalidRecipientNumber,ErrorCode.InsufficientCredits,ErrorCode.CarrierFailed],CNAM_API_CODES=[ErrorCode.InvalidRecipientNumber,ErrorCode.CarrierFailed],HLR_LOOKUP_OUTCOME_CODES=[1,2,0],HLR_PORTED_CODES=["assumed_not_ported","assumed_ported","not_ported","ported","unknown"],HLR_REACHABLE_CODES=["absent","bad_number","blacklisted","reachable","undeliverable","unknown"],HLR_ROAMING_CODES=["not_roaming"],HLR_STATUS_MESSAGE_CODES=["error","success"],HLR_VALID_NUMBER_CODES=["not_valid","unknown","valid"],ROAMING_STATUS_CODES=["not_roaming","roaming","unknown"],STRING_RESPONSE_CODES=["100",ErrorCode.InvalidRecipientNumber.toString(),ErrorCode.InsufficientCredits.toString(),ErrorCode.CarrierFailed.toString()];class LookupPayload extends ApiPayload{convert(){const{numbers:ie,...he}=this.params;return{...he,number:this.params.numbers.join(",")}}}class LookupResource extends AbstractResource{async cnam(ie){const he=await this.client.request("get","lookup/cnam",new LookupPayload(ie).convert());return Array.isArray(he)?he:[he]}async format(ie){return await this.client.request("get","lookup/format",new LookupPayload(ie).convert())}async hlr(ie){return await this.client.request("get","lookup/hlr",new LookupPayload(ie).convert())}async mnp(ie){return await this.client.request("get","lookup/mnp",new LookupPayload(ie).convert())}async rcs(ie){return await this.client.request("get","lookup/rcs",new LookupPayload(ie).convert())}}class PricingResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"get",async he=>await this.client.request("get","pricing",new ApiPayload(he).convert()))}}class RcsDispatchPayload extends ApiPayload{convert(){const{delay:ie,...he}=this.params;return{...he,delay:ie?ie.valueOf():void 0}}}class RcsResource extends AbstractResource{async delete(ie){const he=new ApiPayload().convert();return await this.client.request("delete",`rcs/messages/${ie.id}`,he)}async dispatch(ie){const he=new RcsDispatchPayload(ie).convert();return await this.client.request("post","rcs/messages",he)}async event(ie){return await this.client.request("post","rcs/events",new ApiPayload(ie).convert())}}const SMS_ENCODINGS=["gsm","ucs2"],SMS_TYPES=["direct","economy"];class DeleteSmsPayload extends ApiPayload{convert(){return{ids:this.params.ids.join(",")}}}class SmsPayload extends ApiPayload{convert(){const{delay:ie,to:he,...oe}=this.params;return{...oe,delay:ie?ie.valueOf():void 0,to:he.join(",")}}}class SmsResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"delete",async he=>await this.client.request("delete","sms",new DeleteSmsPayload(he).convert()));Mr(this,"dispatch",async he=>await this.client.request("post","sms",new SmsPayload(he).convert()))}}var StatusReportCode=(ae=>(ae.Delivered="DELIVERED",ae.NotDelivered="NOTDELIVERED",ae.Buffered="BUFFERED",ae.Transmitted="TRANSMITTED",ae.Accepted="ACCEPTED",ae.Expired="EXPIRED",ae.Rejected="REJECTED",ae.Failed="FAILED",ae.Unknown="UNKNOWN",ae))(StatusReportCode||{});class StatusPayload extends ApiPayload{convert(){return{msg_id:this.params.ids.join()}}}class StatusResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"get",async he=>{const oe=new StatusPayload({ids:he}).convert(),pe=await this.client.request("get","status",oe);return console.log("res",pe),Array.isArray(pe)?pe:[pe]})}}class SubaccountsResource extends AbstractResource{constructor(){super(...arguments);Mr(this,"read",async he=>{const oe=new ApiPayload({id:he}).convert();return await this.client.request("get","subaccounts/read",oe)});Mr(this,"create",async he=>await this.client.request("post","subaccounts/create",new ApiPayload(he).convert()));Mr(this,"delete",async he=>await this.client.request("post","subaccounts/delete",new ApiPayload(he).convert()));Mr(this,"transferCredits",async he=>await this.client.request("post","subaccounts/transfer_credits",new ApiPayload(he).convert()));Mr(this,"autoCharge",async he=>await this.client.request("post","subaccounts/update",new ApiPayload(he).convert()))}}class ValidateResource extends AbstractResource{async start(ie){return await this.client.request("post","validate_for_voice",new ApiPayload(ie).convert())}}class VoiceResource extends AbstractResource{async dispatch(ie){return await this.client.request("post","voice",new ApiPayload(ie).convert())}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(ae){return ae&&ae.__esModule&&Object.prototype.hasOwnProperty.call(ae,"default")?ae.default:ae}var md5$4={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$2={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(ae){Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var ie={},he={};he.byteLength=we,he.toByteArray=$e,he.fromByteArray=Ne;for(var oe=[],pe=[],se=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=0,_e=be.length;ge<_e;++ge)oe[ge]=be[ge],pe[be.charCodeAt(ge)]=ge;pe[45]=62,pe[95]=63;function Ee(qe){var We=qe.length;if(We%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var je=qe.indexOf("=");je===-1&&(je=We);var Xe=je===We?0:4-je%4;return[je,Xe]}function we(qe){var We=Ee(qe),je=We[0],Xe=We[1];return(je+Xe)*3/4-Xe}function Me(qe,We,je){return(We+je)*3/4-je}function $e(qe){var We,je=Ee(qe),Xe=je[0],lt=je[1],At=new se(Me(qe,Xe,lt)),mt=0,Ge=lt>0?Xe-4:Xe,Lt;for(Lt=0;Lt>16&255,At[mt++]=We>>8&255,At[mt++]=We&255;return lt===2&&(We=pe[qe.charCodeAt(Lt)]<<2|pe[qe.charCodeAt(Lt+1)]>>4,At[mt++]=We&255),lt===1&&(We=pe[qe.charCodeAt(Lt)]<<10|pe[qe.charCodeAt(Lt+1)]<<4|pe[qe.charCodeAt(Lt+2)]>>2,At[mt++]=We>>8&255,At[mt++]=We&255),At}function Re(qe){return oe[qe>>18&63]+oe[qe>>12&63]+oe[qe>>6&63]+oe[qe&63]}function ke(qe,We,je){for(var Xe,lt=[],At=We;AtGe?Ge:mt+At));return Xe===1?(We=qe[je-1],lt.push(oe[We>>2]+oe[We<<4&63]+"==")):Xe===2&&(We=(qe[je-2]<<8)+qe[je-1],lt.push(oe[We>>10]+oe[We>>4&63]+oe[We<<2&63]+"=")),lt.join("")}var ze={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ze.read=function(qe,We,je,Xe,lt){var At,mt,Ge=lt*8-Xe-1,Lt=(1<>1,ee=-7,re=je?lt-1:0,ne=je?-1:1,fe=qe[We+re];for(re+=ne,At=fe&(1<<-ee)-1,fe>>=-ee,ee+=Ge;ee>0;At=At*256+qe[We+re],re+=ne,ee-=8);for(mt=At&(1<<-ee)-1,At>>=-ee,ee+=Xe;ee>0;mt=mt*256+qe[We+re],re+=ne,ee-=8);if(At===0)At=1-me;else{if(At===Lt)return mt?NaN:(fe?-1:1)*(1/0);mt=mt+Math.pow(2,Xe),At=At-me}return(fe?-1:1)*mt*Math.pow(2,At-Xe)},ze.write=function(qe,We,je,Xe,lt,At){var mt,Ge,Lt,me=At*8-lt-1,ee=(1<>1,ne=lt===23?Math.pow(2,-24)-Math.pow(2,-77):0,fe=Xe?0:At-1,le=Xe?1:-1,ce=We<0||We===0&&1/We<0?1:0;for(We=Math.abs(We),isNaN(We)||We===1/0?(Ge=isNaN(We)?1:0,mt=ee):(mt=Math.floor(Math.log(We)/Math.LN2),We*(Lt=Math.pow(2,-mt))<1&&(mt--,Lt*=2),mt+re>=1?We+=ne/Lt:We+=ne*Math.pow(2,1-re),We*Lt>=2&&(mt++,Lt/=2),mt+re>=ee?(Ge=0,mt=ee):mt+re>=1?(Ge=(We*Lt-1)*Math.pow(2,lt),mt=mt+re):(Ge=We*Math.pow(2,re-1)*Math.pow(2,lt),mt=0));lt>=8;qe[je+fe]=Ge&255,fe+=le,Ge/=256,lt-=8);for(mt=mt<0;qe[je+fe]=mt&255,fe+=le,mt/=256,me-=8);qe[je+fe-le]|=ce*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */(function(qe){const We=he,je=ze,Xe=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qe.Buffer=ee,qe.SlowBuffer=xe,qe.INSPECT_MAX_BYTES=50;const lt=2147483647;qe.kMaxLength=lt;const{Uint8Array:At,ArrayBuffer:mt,SharedArrayBuffer:Ge}=globalThis;ee.TYPED_ARRAY_SUPPORT=Lt(),!ee.TYPED_ARRAY_SUPPORT&&typeof console<"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.");function Lt(){try{const Ie=new At(1),Se={foo:function(){return 42}};return Object.setPrototypeOf(Se,At.prototype),Object.setPrototypeOf(Ie,Se),Ie.foo()===42}catch{return!1}}Object.defineProperty(ee.prototype,"parent",{enumerable:!0,get:function(){if(ee.isBuffer(this))return this.buffer}}),Object.defineProperty(ee.prototype,"offset",{enumerable:!0,get:function(){if(ee.isBuffer(this))return this.byteOffset}});function me(Ie){if(Ie>lt)throw new RangeError('The value "'+Ie+'" is invalid for option "size"');const Se=new At(Ie);return Object.setPrototypeOf(Se,ee.prototype),Se}function ee(Ie,Se,Ae){if(typeof Ie=="number"){if(typeof Se=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return le(Ie)}return re(Ie,Se,Ae)}ee.poolSize=8192;function re(Ie,Se,Ae){if(typeof Ie=="string")return ce(Ie,Se);if(mt.isView(Ie))return ue(Ie);if(Ie==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ie);if(Pt(Ie,mt)||Ie&&Pt(Ie.buffer,mt)||typeof Ge<"u"&&(Pt(Ie,Ge)||Ie&&Pt(Ie.buffer,Ge)))return te(Ie,Se,Ae);if(typeof Ie=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Oe=Ie.valueOf&&Ie.valueOf();if(Oe!=null&&Oe!==Ie)return ee.from(Oe,Se,Ae);const Ke=de(Ie);if(Ke)return Ke;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ie[Symbol.toPrimitive]=="function")return ee.from(Ie[Symbol.toPrimitive]("string"),Se,Ae);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ie)}ee.from=function(Ie,Se,Ae){return re(Ie,Se,Ae)},Object.setPrototypeOf(ee.prototype,At.prototype),Object.setPrototypeOf(ee,At);function ne(Ie){if(typeof Ie!="number")throw new TypeError('"size" argument must be of type number');if(Ie<0)throw new RangeError('The value "'+Ie+'" is invalid for option "size"')}function fe(Ie,Se,Ae){return ne(Ie),Ie<=0?me(Ie):Se!==void 0?typeof Ae=="string"?me(Ie).fill(Se,Ae):me(Ie).fill(Se):me(Ie)}ee.alloc=function(Ie,Se,Ae){return fe(Ie,Se,Ae)};function le(Ie){return ne(Ie),me(Ie<0?0:ye(Ie)|0)}ee.allocUnsafe=function(Ie){return le(Ie)},ee.allocUnsafeSlow=function(Ie){return le(Ie)};function ce(Ie,Se){if((typeof Se!="string"||Se==="")&&(Se="utf8"),!ee.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se);const Ae=Pe(Ie,Se)|0;let Oe=me(Ae);const Ke=Oe.write(Ie,Se);return Ke!==Ae&&(Oe=Oe.slice(0,Ke)),Oe}function ve(Ie){const Se=Ie.length<0?0:ye(Ie.length)|0,Ae=me(Se);for(let Oe=0;Oe=lt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+lt.toString(16)+" bytes");return Ie|0}function xe(Ie){return+Ie!=Ie&&(Ie=0),ee.alloc(+Ie)}ee.isBuffer=function(Se){return Se!=null&&Se._isBuffer===!0&&Se!==ee.prototype},ee.compare=function(Se,Ae){if(Pt(Se,At)&&(Se=ee.from(Se,Se.offset,Se.byteLength)),Pt(Ae,At)&&(Ae=ee.from(Ae,Ae.offset,Ae.byteLength)),!ee.isBuffer(Se)||!ee.isBuffer(Ae))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Se===Ae)return 0;let Oe=Se.length,Ke=Ae.length;for(let at=0,Ve=Math.min(Oe,Ke);atKe.length?(ee.isBuffer(Ve)||(Ve=ee.from(Ve)),Ve.copy(Ke,at)):At.prototype.set.call(Ke,Ve,at);else if(ee.isBuffer(Ve))Ve.copy(Ke,at);else throw new TypeError('"list" argument must be an Array of Buffers');at+=Ve.length}return Ke};function Pe(Ie,Se){if(ee.isBuffer(Ie))return Ie.length;if(mt.isView(Ie)||Pt(Ie,mt))return Ie.byteLength;if(typeof Ie!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ie);const Ae=Ie.length,Oe=arguments.length>2&&arguments[2]===!0;if(!Oe&&Ae===0)return 0;let Ke=!1;for(;;)switch(Se){case"ascii":case"latin1":case"binary":return Ae;case"utf8":case"utf-8":return Vt(Ie).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ae*2;case"hex":return Ae>>>1;case"base64":return Xt(Ie).length;default:if(Ke)return Oe?-1:Vt(Ie).length;Se=(""+Se).toLowerCase(),Ke=!0}}ee.byteLength=Pe;function Le(Ie,Se,Ae){let Oe=!1;if((Se===void 0||Se<0)&&(Se=0),Se>this.length||((Ae===void 0||Ae>this.length)&&(Ae=this.length),Ae<=0)||(Ae>>>=0,Se>>>=0,Ae<=Se))return"";for(Ie||(Ie="utf8");;)switch(Ie){case"hex":return zt(this,Se,Ae);case"utf8":case"utf-8":return Qe(this,Se,Ae);case"ascii":return pt(this,Se,Ae);case"latin1":case"binary":return Je(this,Se,Ae);case"base64":return Nt(this,Se,Ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bt(this,Se,Ae);default:if(Oe)throw new TypeError("Unknown encoding: "+Ie);Ie=(Ie+"").toLowerCase(),Oe=!0}}ee.prototype._isBuffer=!0;function De(Ie,Se,Ae){const Oe=Ie[Se];Ie[Se]=Ie[Ae],Ie[Ae]=Oe}ee.prototype.swap16=function(){const Se=this.length;if(Se%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ae=0;AeAe&&(Se+=" ... "),""},Xe&&(ee.prototype[Xe]=ee.prototype.inspect),ee.prototype.compare=function(Se,Ae,Oe,Ke,at){if(Pt(Se,At)&&(Se=ee.from(Se,Se.offset,Se.byteLength)),!ee.isBuffer(Se))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Se);if(Ae===void 0&&(Ae=0),Oe===void 0&&(Oe=Se?Se.length:0),Ke===void 0&&(Ke=0),at===void 0&&(at=this.length),Ae<0||Oe>Se.length||Ke<0||at>this.length)throw new RangeError("out of range index");if(Ke>=at&&Ae>=Oe)return 0;if(Ke>=at)return-1;if(Ae>=Oe)return 1;if(Ae>>>=0,Oe>>>=0,Ke>>>=0,at>>>=0,this===Se)return 0;let Ve=at-Ke,ct=Oe-Ae;const jt=Math.min(Ve,ct),dt=this.slice(Ke,at),Mt=Se.slice(Ae,Oe);for(let Ut=0;Ut2147483647?Ae=2147483647:Ae<-2147483648&&(Ae=-2147483648),Ae=+Ae,Jt(Ae)&&(Ae=Ke?0:Ie.length-1),Ae<0&&(Ae=Ie.length+Ae),Ae>=Ie.length){if(Ke)return-1;Ae=Ie.length-1}else if(Ae<0)if(Ke)Ae=0;else return-1;if(typeof Se=="string"&&(Se=ee.from(Se,Oe)),ee.isBuffer(Se))return Se.length===0?-1:Ce(Ie,Se,Ae,Oe,Ke);if(typeof Se=="number")return Se=Se&255,typeof At.prototype.indexOf=="function"?Ke?At.prototype.indexOf.call(Ie,Se,Ae):At.prototype.lastIndexOf.call(Ie,Se,Ae):Ce(Ie,[Se],Ae,Oe,Ke);throw new TypeError("val must be string, number or Buffer")}function Ce(Ie,Se,Ae,Oe,Ke){let at=1,Ve=Ie.length,ct=Se.length;if(Oe!==void 0&&(Oe=String(Oe).toLowerCase(),Oe==="ucs2"||Oe==="ucs-2"||Oe==="utf16le"||Oe==="utf-16le")){if(Ie.length<2||Se.length<2)return-1;at=2,Ve/=2,ct/=2,Ae/=2}function jt(Mt,Ut){return at===1?Mt[Ut]:Mt.readUInt16BE(Ut*at)}let dt;if(Ke){let Mt=-1;for(dt=Ae;dtVe&&(Ae=Ve-ct),dt=Ae;dt>=0;dt--){let Mt=!0;for(let Ut=0;UtKe&&(Oe=Ke)):Oe=Ke;const at=Se.length;Oe>at/2&&(Oe=at/2);let Ve;for(Ve=0;Ve>>0,isFinite(Oe)?(Oe=Oe>>>0,Ke===void 0&&(Ke="utf8")):(Ke=Oe,Oe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const at=this.length-Ae;if((Oe===void 0||Oe>at)&&(Oe=at),Se.length>0&&(Oe<0||Ae<0)||Ae>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ke||(Ke="utf8");let Ve=!1;for(;;)switch(Ke){case"hex":return Fe(this,Se,Ae,Oe);case"utf8":case"utf-8":return Ye(this,Se,Ae,Oe);case"ascii":case"latin1":case"binary":return Ue(this,Se,Ae,Oe);case"base64":return Te(this,Se,Ae,Oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,Se,Ae,Oe);default:if(Ve)throw new TypeError("Unknown encoding: "+Ke);Ke=(""+Ke).toLowerCase(),Ve=!0}},ee.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(Ie,Se,Ae){return Se===0&&Ae===Ie.length?We.fromByteArray(Ie):We.fromByteArray(Ie.slice(Se,Ae))}function Qe(Ie,Se,Ae){Ae=Math.min(Ie.length,Ae);const Oe=[];let Ke=Se;for(;Ke239?4:at>223?3:at>191?2:1;if(Ke+ct<=Ae){let jt,dt,Mt,Ut;switch(ct){case 1:at<128&&(Ve=at);break;case 2:jt=Ie[Ke+1],(jt&192)===128&&(Ut=(at&31)<<6|jt&63,Ut>127&&(Ve=Ut));break;case 3:jt=Ie[Ke+1],dt=Ie[Ke+2],(jt&192)===128&&(dt&192)===128&&(Ut=(at&15)<<12|(jt&63)<<6|dt&63,Ut>2047&&(Ut<55296||Ut>57343)&&(Ve=Ut));break;case 4:jt=Ie[Ke+1],dt=Ie[Ke+2],Mt=Ie[Ke+3],(jt&192)===128&&(dt&192)===128&&(Mt&192)===128&&(Ut=(at&15)<<18|(jt&63)<<12|(dt&63)<<6|Mt&63,Ut>65535&&Ut<1114112&&(Ve=Ut))}}Ve===null?(Ve=65533,ct=1):Ve>65535&&(Ve-=65536,Oe.push(Ve>>>10&1023|55296),Ve=56320|Ve&1023),Oe.push(Ve),Ke+=ct}return Ft(Oe)}const ut=4096;function Ft(Ie){const Se=Ie.length;if(Se<=ut)return String.fromCharCode.apply(String,Ie);let Ae="",Oe=0;for(;OeOe)&&(Ae=Oe);let Ke="";for(let at=Se;atOe&&(Se=Oe),Ae<0?(Ae+=Oe,Ae<0&&(Ae=0)):Ae>Oe&&(Ae=Oe),AeAe)throw new RangeError("Trying to access beyond buffer length")}ee.prototype.readUintLE=ee.prototype.readUIntLE=function(Se,Ae,Oe){Se=Se>>>0,Ae=Ae>>>0,Oe||gt(Se,Ae,this.length);let Ke=this[Se],at=1,Ve=0;for(;++Ve>>0,Ae=Ae>>>0,Oe||gt(Se,Ae,this.length);let Ke=this[Se+--Ae],at=1;for(;Ae>0&&(at*=256);)Ke+=this[Se+--Ae]*at;return Ke},ee.prototype.readUint8=ee.prototype.readUInt8=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,1,this.length),this[Se]},ee.prototype.readUint16LE=ee.prototype.readUInt16LE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,2,this.length),this[Se]|this[Se+1]<<8},ee.prototype.readUint16BE=ee.prototype.readUInt16BE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,2,this.length),this[Se]<<8|this[Se+1]},ee.prototype.readUint32LE=ee.prototype.readUInt32LE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,4,this.length),(this[Se]|this[Se+1]<<8|this[Se+2]<<16)+this[Se+3]*16777216},ee.prototype.readUint32BE=ee.prototype.readUInt32BE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,4,this.length),this[Se]*16777216+(this[Se+1]<<16|this[Se+2]<<8|this[Se+3])},ee.prototype.readBigUInt64LE=kt(function(Se){Se=Se>>>0,Tt(Se,"offset");const Ae=this[Se],Oe=this[Se+7];(Ae===void 0||Oe===void 0)&&Wt(Se,this.length-8);const Ke=Ae+this[++Se]*2**8+this[++Se]*2**16+this[++Se]*2**24,at=this[++Se]+this[++Se]*2**8+this[++Se]*2**16+Oe*2**24;return BigInt(Ke)+(BigInt(at)<>>0,Tt(Se,"offset");const Ae=this[Se],Oe=this[Se+7];(Ae===void 0||Oe===void 0)&&Wt(Se,this.length-8);const Ke=Ae*2**24+this[++Se]*2**16+this[++Se]*2**8+this[++Se],at=this[++Se]*2**24+this[++Se]*2**16+this[++Se]*2**8+Oe;return(BigInt(Ke)<>>0,Ae=Ae>>>0,Oe||gt(Se,Ae,this.length);let Ke=this[Se],at=1,Ve=0;for(;++Ve=at&&(Ke-=Math.pow(2,8*Ae)),Ke},ee.prototype.readIntBE=function(Se,Ae,Oe){Se=Se>>>0,Ae=Ae>>>0,Oe||gt(Se,Ae,this.length);let Ke=Ae,at=1,Ve=this[Se+--Ke];for(;Ke>0&&(at*=256);)Ve+=this[Se+--Ke]*at;return at*=128,Ve>=at&&(Ve-=Math.pow(2,8*Ae)),Ve},ee.prototype.readInt8=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,1,this.length),this[Se]&128?(255-this[Se]+1)*-1:this[Se]},ee.prototype.readInt16LE=function(Se,Ae){Se=Se>>>0,Ae||gt(Se,2,this.length);const Oe=this[Se]|this[Se+1]<<8;return Oe&32768?Oe|4294901760:Oe},ee.prototype.readInt16BE=function(Se,Ae){Se=Se>>>0,Ae||gt(Se,2,this.length);const Oe=this[Se+1]|this[Se]<<8;return Oe&32768?Oe|4294901760:Oe},ee.prototype.readInt32LE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,4,this.length),this[Se]|this[Se+1]<<8|this[Se+2]<<16|this[Se+3]<<24},ee.prototype.readInt32BE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,4,this.length),this[Se]<<24|this[Se+1]<<16|this[Se+2]<<8|this[Se+3]},ee.prototype.readBigInt64LE=kt(function(Se){Se=Se>>>0,Tt(Se,"offset");const Ae=this[Se],Oe=this[Se+7];(Ae===void 0||Oe===void 0)&&Wt(Se,this.length-8);const Ke=this[Se+4]+this[Se+5]*2**8+this[Se+6]*2**16+(Oe<<24);return(BigInt(Ke)<>>0,Tt(Se,"offset");const Ae=this[Se],Oe=this[Se+7];(Ae===void 0||Oe===void 0)&&Wt(Se,this.length-8);const Ke=(Ae<<24)+this[++Se]*2**16+this[++Se]*2**8+this[++Se];return(BigInt(Ke)<>>0,Ae||gt(Se,4,this.length),je.read(this,Se,!0,23,4)},ee.prototype.readFloatBE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,4,this.length),je.read(this,Se,!1,23,4)},ee.prototype.readDoubleLE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,8,this.length),je.read(this,Se,!0,52,8)},ee.prototype.readDoubleBE=function(Se,Ae){return Se=Se>>>0,Ae||gt(Se,8,this.length),je.read(this,Se,!1,52,8)};function Ht(Ie,Se,Ae,Oe,Ke,at){if(!ee.isBuffer(Ie))throw new TypeError('"buffer" argument must be a Buffer instance');if(Se>Ke||SeIe.length)throw new RangeError("Index out of range")}ee.prototype.writeUintLE=ee.prototype.writeUIntLE=function(Se,Ae,Oe,Ke){if(Se=+Se,Ae=Ae>>>0,Oe=Oe>>>0,!Ke){const ct=Math.pow(2,8*Oe)-1;Ht(this,Se,Ae,Oe,ct,0)}let at=1,Ve=0;for(this[Ae]=Se&255;++Ve>>0,Oe=Oe>>>0,!Ke){const ct=Math.pow(2,8*Oe)-1;Ht(this,Se,Ae,Oe,ct,0)}let at=Oe-1,Ve=1;for(this[Ae+at]=Se&255;--at>=0&&(Ve*=256);)this[Ae+at]=Se/Ve&255;return Ae+Oe},ee.prototype.writeUint8=ee.prototype.writeUInt8=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,1,255,0),this[Ae]=Se&255,Ae+1},ee.prototype.writeUint16LE=ee.prototype.writeUInt16LE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,2,65535,0),this[Ae]=Se&255,this[Ae+1]=Se>>>8,Ae+2},ee.prototype.writeUint16BE=ee.prototype.writeUInt16BE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,2,65535,0),this[Ae]=Se>>>8,this[Ae+1]=Se&255,Ae+2},ee.prototype.writeUint32LE=ee.prototype.writeUInt32LE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,4,4294967295,0),this[Ae+3]=Se>>>24,this[Ae+2]=Se>>>16,this[Ae+1]=Se>>>8,this[Ae]=Se&255,Ae+4},ee.prototype.writeUint32BE=ee.prototype.writeUInt32BE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,4,4294967295,0),this[Ae]=Se>>>24,this[Ae+1]=Se>>>16,this[Ae+2]=Se>>>8,this[Ae+3]=Se&255,Ae+4};function vt(Ie,Se,Ae,Oe,Ke){xt(Se,Oe,Ke,Ie,Ae,7);let at=Number(Se&BigInt(4294967295));Ie[Ae++]=at,at=at>>8,Ie[Ae++]=at,at=at>>8,Ie[Ae++]=at,at=at>>8,Ie[Ae++]=at;let Ve=Number(Se>>BigInt(32)&BigInt(4294967295));return Ie[Ae++]=Ve,Ve=Ve>>8,Ie[Ae++]=Ve,Ve=Ve>>8,Ie[Ae++]=Ve,Ve=Ve>>8,Ie[Ae++]=Ve,Ae}function Rt(Ie,Se,Ae,Oe,Ke){xt(Se,Oe,Ke,Ie,Ae,7);let at=Number(Se&BigInt(4294967295));Ie[Ae+7]=at,at=at>>8,Ie[Ae+6]=at,at=at>>8,Ie[Ae+5]=at,at=at>>8,Ie[Ae+4]=at;let Ve=Number(Se>>BigInt(32)&BigInt(4294967295));return Ie[Ae+3]=Ve,Ve=Ve>>8,Ie[Ae+2]=Ve,Ve=Ve>>8,Ie[Ae+1]=Ve,Ve=Ve>>8,Ie[Ae]=Ve,Ae+8}ee.prototype.writeBigUInt64LE=kt(function(Se,Ae=0){return vt(this,Se,Ae,BigInt(0),BigInt("0xffffffffffffffff"))}),ee.prototype.writeBigUInt64BE=kt(function(Se,Ae=0){return Rt(this,Se,Ae,BigInt(0),BigInt("0xffffffffffffffff"))}),ee.prototype.writeIntLE=function(Se,Ae,Oe,Ke){if(Se=+Se,Ae=Ae>>>0,!Ke){const jt=Math.pow(2,8*Oe-1);Ht(this,Se,Ae,Oe,jt-1,-jt)}let at=0,Ve=1,ct=0;for(this[Ae]=Se&255;++at>0)-ct&255;return Ae+Oe},ee.prototype.writeIntBE=function(Se,Ae,Oe,Ke){if(Se=+Se,Ae=Ae>>>0,!Ke){const jt=Math.pow(2,8*Oe-1);Ht(this,Se,Ae,Oe,jt-1,-jt)}let at=Oe-1,Ve=1,ct=0;for(this[Ae+at]=Se&255;--at>=0&&(Ve*=256);)Se<0&&ct===0&&this[Ae+at+1]!==0&&(ct=1),this[Ae+at]=(Se/Ve>>0)-ct&255;return Ae+Oe},ee.prototype.writeInt8=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,1,127,-128),Se<0&&(Se=255+Se+1),this[Ae]=Se&255,Ae+1},ee.prototype.writeInt16LE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,2,32767,-32768),this[Ae]=Se&255,this[Ae+1]=Se>>>8,Ae+2},ee.prototype.writeInt16BE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,2,32767,-32768),this[Ae]=Se>>>8,this[Ae+1]=Se&255,Ae+2},ee.prototype.writeInt32LE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,4,2147483647,-2147483648),this[Ae]=Se&255,this[Ae+1]=Se>>>8,this[Ae+2]=Se>>>16,this[Ae+3]=Se>>>24,Ae+4},ee.prototype.writeInt32BE=function(Se,Ae,Oe){return Se=+Se,Ae=Ae>>>0,Oe||Ht(this,Se,Ae,4,2147483647,-2147483648),Se<0&&(Se=4294967295+Se+1),this[Ae]=Se>>>24,this[Ae+1]=Se>>>16,this[Ae+2]=Se>>>8,this[Ae+3]=Se&255,Ae+4},ee.prototype.writeBigInt64LE=kt(function(Se,Ae=0){return vt(this,Se,Ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ee.prototype.writeBigInt64BE=kt(function(Se,Ae=0){return Rt(this,Se,Ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Kt(Ie,Se,Ae,Oe,Ke,at){if(Ae+Oe>Ie.length)throw new RangeError("Index out of range");if(Ae<0)throw new RangeError("Index out of range")}function yt(Ie,Se,Ae,Oe,Ke){return Se=+Se,Ae=Ae>>>0,Ke||Kt(Ie,Se,Ae,4),je.write(Ie,Se,Ae,Oe,23,4),Ae+4}ee.prototype.writeFloatLE=function(Se,Ae,Oe){return yt(this,Se,Ae,!0,Oe)},ee.prototype.writeFloatBE=function(Se,Ae,Oe){return yt(this,Se,Ae,!1,Oe)};function It(Ie,Se,Ae,Oe,Ke){return Se=+Se,Ae=Ae>>>0,Ke||Kt(Ie,Se,Ae,8),je.write(Ie,Se,Ae,Oe,52,8),Ae+8}ee.prototype.writeDoubleLE=function(Se,Ae,Oe){return It(this,Se,Ae,!0,Oe)},ee.prototype.writeDoubleBE=function(Se,Ae,Oe){return It(this,Se,Ae,!1,Oe)},ee.prototype.copy=function(Se,Ae,Oe,Ke){if(!ee.isBuffer(Se))throw new TypeError("argument should be a Buffer");if(Oe||(Oe=0),!Ke&&Ke!==0&&(Ke=this.length),Ae>=Se.length&&(Ae=Se.length),Ae||(Ae=0),Ke>0&&Ke=this.length)throw new RangeError("Index out of range");if(Ke<0)throw new RangeError("sourceEnd out of bounds");Ke>this.length&&(Ke=this.length),Se.length-Ae>>0,Oe=Oe===void 0?this.length:Oe>>>0,Se||(Se=0);let at;if(typeof Se=="number")for(at=Ae;at2**32?Ke=Dt(String(Ae)):typeof Ae=="bigint"&&(Ke=String(Ae),(Ae>BigInt(2)**BigInt(32)||Ae<-(BigInt(2)**BigInt(32)))&&(Ke=Dt(Ke)),Ke+="n"),Oe+=` It must be ${Se}. Received ${Ke}`,Oe},RangeError);function Dt(Ie){let Se="",Ae=Ie.length;const Oe=Ie[0]==="-"?1:0;for(;Ae>=Oe+4;Ae-=3)Se=`_${Ie.slice(Ae-3,Ae)}${Se}`;return`${Ie.slice(0,Ae)}${Se}`}function Qt(Ie,Se,Ae){Tt(Se,"offset"),(Ie[Se]===void 0||Ie[Se+Ae]===void 0)&&Wt(Se,Ie.length-(Ae+1))}function xt(Ie,Se,Ae,Oe,Ke,at){if(Ie>Ae||Ie= 0${Ve} and < 2${Ve} ** ${(at+1)*8}${Ve}`:ct=`>= -(2${Ve} ** ${(at+1)*8-1}${Ve}) and < 2 ** ${(at+1)*8-1}${Ve}`,new Yt.ERR_OUT_OF_RANGE("value",ct,Ie)}Qt(Oe,Ke,at)}function Tt(Ie,Se){if(typeof Ie!="number")throw new Yt.ERR_INVALID_ARG_TYPE(Se,"number",Ie)}function Wt(Ie,Se,Ae){throw Math.floor(Ie)!==Ie?(Tt(Ie,Ae),new Yt.ERR_OUT_OF_RANGE("offset","an integer",Ie)):Se<0?new Yt.ERR_BUFFER_OUT_OF_BOUNDS:new Yt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Se}`,Ie)}const St=/[^+/0-9A-Za-z-_]/g;function Ct(Ie){if(Ie=Ie.split("=")[0],Ie=Ie.trim().replace(St,""),Ie.length<2)return"";for(;Ie.length%4!==0;)Ie=Ie+"=";return Ie}function Vt(Ie,Se){Se=Se||1/0;let Ae;const Oe=Ie.length;let Ke=null;const at=[];for(let Ve=0;Ve55295&&Ae<57344){if(!Ke){if(Ae>56319){(Se-=3)>-1&&at.push(239,191,189);continue}else if(Ve+1===Oe){(Se-=3)>-1&&at.push(239,191,189);continue}Ke=Ae;continue}if(Ae<56320){(Se-=3)>-1&&at.push(239,191,189),Ke=Ae;continue}Ae=(Ke-55296<<10|Ae-56320)+65536}else Ke&&(Se-=3)>-1&&at.push(239,191,189);if(Ke=null,Ae<128){if((Se-=1)<0)break;at.push(Ae)}else if(Ae<2048){if((Se-=2)<0)break;at.push(Ae>>6|192,Ae&63|128)}else if(Ae<65536){if((Se-=3)<0)break;at.push(Ae>>12|224,Ae>>6&63|128,Ae&63|128)}else if(Ae<1114112){if((Se-=4)<0)break;at.push(Ae>>18|240,Ae>>12&63|128,Ae>>6&63|128,Ae&63|128)}else throw new Error("Invalid code point")}return at}function Et(Ie){const Se=[];for(let Ae=0;Ae>8,Ke=Ae%256,at.push(Ke),at.push(Oe);return at}function Xt(Ie){return We.toByteArray(Ct(Ie))}function wt(Ie,Se,Ae,Oe){let Ke;for(Ke=0;Ke=Se.length||Ke>=Ie.length);++Ke)Se[Ke+Ae]=Ie[Ke];return Ke}function Pt(Ie,Se){return Ie instanceof Se||Ie!=null&&Ie.constructor!=null&&Ie.constructor.name!=null&&Ie.constructor.name===Se.name}function Jt(Ie){return Ie!==Ie}const $t=function(){const Ie="0123456789abcdef",Se=new Array(256);for(let Ae=0;Ae<16;++Ae){const Oe=Ae*16;for(let Ke=0;Ke<16;++Ke)Se[Oe+Ke]=Ie[Ae]+Ie[Ke]}return Se}();function kt(Ie){return typeof BigInt>"u"?er:Ie}function er(){throw new Error("BigInt not supported")}})(ie);const He=ie.Buffer;ae.Blob=ie.Blob,ae.BlobOptions=ie.BlobOptions,ae.Buffer=ie.Buffer,ae.File=ie.File,ae.FileOptions=ie.FileOptions,ae.INSPECT_MAX_BYTES=ie.INSPECT_MAX_BYTES,ae.SlowBuffer=ie.SlowBuffer,ae.TranscodeEncoding=ie.TranscodeEncoding,ae.atob=ie.atob,ae.btoa=ie.btoa,ae.constants=ie.constants,ae.default=He,ae.isAscii=ie.isAscii,ae.isUtf8=ie.isUtf8,ae.kMaxLength=ie.kMaxLength,ae.kStringMaxLength=ie.kStringMaxLength,ae.resolveObjectURL=ie.resolveObjectURL,ae.transcode=ie.transcode}(dist)),dist}/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(ae,ie){var he=requireDist(),oe=he.Buffer;function pe(be,ge){for(var _e in be)ge[_e]=be[_e]}oe.from&&oe.alloc&&oe.allocUnsafe&&oe.allocUnsafeSlow?ae.exports=he:(pe(he,ie),ie.Buffer=se);function se(be,ge,_e){return oe(be,ge,_e)}se.prototype=Object.create(oe.prototype),pe(oe,se),se.from=function(be,ge,_e){if(typeof be=="number")throw new TypeError("Argument must not be a number");return oe(be,ge,_e)},se.alloc=function(be,ge,_e){if(typeof be!="number")throw new TypeError("Argument must be a number");var Ee=oe(be);return ge!==void 0?typeof _e=="string"?Ee.fill(ge,_e):Ee.fill(ge):Ee.fill(0),Ee},se.allocUnsafe=function(be){if(typeof be!="number")throw new TypeError("Argument must be a number");return oe(be)},se.allocUnsafeSlow=function(be){if(typeof be!="number")throw new TypeError("Argument must be a number");return he.SlowBuffer(be)}})(safeBuffer$2,safeBuffer$2.exports);var safeBufferExports$1=safeBuffer$2.exports,MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser$1(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$C=safeBufferExports$1.Buffer,crypto$1=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$1&&crypto$1.getRandomValues?browser$b.exports=randomBytes$2:browser$b.exports=oldBrowser$1;function randomBytes$2(ae,ie){if(ae>MAX_UINT32)throw new RangeError("requested too many random bytes");var he=Buffer$C.allocUnsafe(ae);if(ae>0)if(ae>MAX_BYTES)for(var oe=0;oe0&&(be=he[0]),be instanceof Error)throw be;var ge=new Error("Unhandled error."+(be?" ("+be.message+")":""));throw ge.context=be,ge}var _e=se[ie];if(_e===void 0)return!1;if(typeof _e=="function")ReflectApply(_e,this,he);else for(var Ee=_e.length,we=arrayClone(_e,Ee),oe=0;oe0&&be.length>pe&&!be.warned){be.warned=!0;var ge=new Error("Possible EventEmitter memory leak detected. "+be.length+" "+String(ie)+" listeners added. Use emitter.setMaxListeners() to increase limit");ge.name="MaxListenersExceededWarning",ge.emitter=ae,ge.type=ie,ge.count=be.length,ProcessEmitWarning(ge)}return ae}EventEmitter.prototype.addListener=function(ie,he){return _addListener(this,ie,he,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(ie,he){return _addListener(this,ie,he,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(ae,ie,he){var oe={fired:!1,wrapFn:void 0,target:ae,type:ie,listener:he},pe=onceWrapper.bind(oe);return pe.listener=he,oe.wrapFn=pe,pe}EventEmitter.prototype.once=function(ie,he){return checkListener(he),this.on(ie,_onceWrap(this,ie,he)),this},EventEmitter.prototype.prependOnceListener=function(ie,he){return checkListener(he),this.prependListener(ie,_onceWrap(this,ie,he)),this},EventEmitter.prototype.removeListener=function(ie,he){var oe,pe,se,be,ge;if(checkListener(he),pe=this._events,pe===void 0)return this;if(oe=pe[ie],oe===void 0)return this;if(oe===he||oe.listener===he)--this._eventsCount===0?this._events=Object.create(null):(delete pe[ie],pe.removeListener&&this.emit("removeListener",ie,oe.listener||he));else if(typeof oe!="function"){for(se=-1,be=oe.length-1;be>=0;be--)if(oe[be]===he||oe[be].listener===he){ge=oe[be].listener,se=be;break}if(se<0)return this;se===0?oe.shift():spliceOne(oe,se),oe.length===1&&(pe[ie]=oe[0]),pe.removeListener!==void 0&&this.emit("removeListener",ie,ge||he)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(ie){var he,oe,pe;if(oe=this._events,oe===void 0)return this;if(oe.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):oe[ie]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete oe[ie]),this;if(arguments.length===0){var se=Object.keys(oe),be;for(pe=0;pe=0;pe--)this.removeListener(ie,he[pe]);return this};function _listeners(ae,ie,he){var oe=ae._events;if(oe===void 0)return[];var pe=oe[ie];return pe===void 0?[]:typeof pe=="function"?he?[pe.listener||pe]:[pe]:he?unwrapListeners(pe):arrayClone(pe,pe.length)}EventEmitter.prototype.listeners=function(ie){return _listeners(this,ie,!0)},EventEmitter.prototype.rawListeners=function(ie){return _listeners(this,ie,!1)},EventEmitter.listenerCount=function(ae,ie){return typeof ae.listenerCount=="function"?ae.listenerCount(ie):listenerCount.call(ae,ie)},EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(ae){var ie=this._events;if(ie!==void 0){var he=ie[ae];if(typeof he=="function")return 1;if(he!==void 0)return he.length}return 0}EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(ae,ie){for(var he=new Array(ie),oe=0;oe"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(ae){var errorProto=getProto$1(getProto$1(ae));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function ae(ie){var he;if(ie==="%AsyncFunction%")he=getEvalledConstructor("async function () {}");else if(ie==="%GeneratorFunction%")he=getEvalledConstructor("function* () {}");else if(ie==="%AsyncGeneratorFunction%")he=getEvalledConstructor("async function* () {}");else if(ie==="%AsyncGenerator%"){var oe=ae("%AsyncGeneratorFunction%");oe&&(he=oe.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var pe=ae("%AsyncGenerator%");pe&&getProto$1&&(he=getProto$1(pe.prototype))}return INTRINSICS[ie]=he,he},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(ie){var he=$strSlice(ie,0,1),oe=$strSlice(ie,-1);if(he==="%"&&oe!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(oe==="%"&&he!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var pe=[];return $replace(ie,rePropName,function(se,be,ge,_e){pe[pe.length]=ge?$replace(_e,reEscapeChar,"$1"):be||se}),pe},getBaseIntrinsic=function(ie,he){var oe=ie,pe;if(hasOwn(LEGACY_ALIASES,oe)&&(pe=LEGACY_ALIASES[oe],oe="%"+pe[0]+"%"),hasOwn(INTRINSICS,oe)){var se=INTRINSICS[oe];if(se===needsEval&&(se=doEval(oe)),typeof se>"u"&&!he)throw new $TypeError$2("intrinsic "+ie+" exists, but is not available. Please file an issue!");return{alias:pe,name:oe,value:se}}throw new $SyntaxError$1("intrinsic "+ie+" does not exist!")},getIntrinsic=function(ie,he){if(typeof ie!="string"||ie.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,ie)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var oe=stringToPath(ie),pe=oe.length>0?oe[0]:"",se=getBaseIntrinsic("%"+pe+"%",he),be=se.name,ge=se.value,_e=!1,Ee=se.alias;Ee&&(pe=Ee[0],$spliceApply(oe,$concat([0,1],Ee)));for(var we=1,Me=!0;we=oe.length){var Ne=$gOPD$1(ge,$e);Me=!!Ne,Me&&"get"in Ne&&!("originalValue"in Ne.get)?ge=Ne.get:ge=ge[$e]}else Me=hasOwn(ge,$e),ge=ge[$e];Me&&!_e&&(INTRINSICS[be]=ge)}}return ge},callBind$2={exports:{}},esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var ae=getIntrinsic,ie=ae("%Object.defineProperty%",!0)||!1;if(ie)try{ie({},"a",{value:1})}catch{ie=!1}return esDefineProperty=ie,esDefineProperty}var GetIntrinsic$2=getIntrinsic,$gOPD=GetIntrinsic$2("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,$defineProperty$1=requireEsDefineProperty(),$SyntaxError=syntax,$TypeError$1=type,gopd=gopd$1,defineDataProperty=function(ie,he,oe){if(!ie||typeof ie!="object"&&typeof ie!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof he!="string"&&typeof he!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var pe=arguments.length>3?arguments[3]:null,se=arguments.length>4?arguments[4]:null,be=arguments.length>5?arguments[5]:null,ge=arguments.length>6?arguments[6]:!1,_e=!!gopd&&gopd(ie,he);if($defineProperty$1)$defineProperty$1(ie,he,{configurable:be===null&&_e?_e.configurable:!be,enumerable:pe===null&&_e?_e.enumerable:!pe,value:oe,writable:se===null&&_e?_e.writable:!se});else if(ge||!pe&&!se&&!be)ie[he]=oe;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},$defineProperty=requireEsDefineProperty(),hasPropertyDescriptors=function(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!$defineProperty)return null;try{return $defineProperty([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic$1=getIntrinsic,define=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$1=gopd$1,$TypeError=type,$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(ie,he){if(typeof ie!="function")throw new $TypeError("`fn` is not a function");if(typeof he!="number"||he<0||he>4294967295||$floor(he)!==he)throw new $TypeError("`length` must be a positive 32-bit integer");var oe=arguments.length>2&&!!arguments[2],pe=!0,se=!0;if("length"in ie&&gOPD$1){var be=gOPD$1(ie,"length");be&&!be.configurable&&(pe=!1),be&&!be.writable&&(se=!1)}return(pe||se||!oe)&&(hasDescriptors?define(ie,"length",he,!0,!0):define(ie,"length",he)),ie};(function(ae){var ie=functionBind,he=getIntrinsic,oe=setFunctionLength,pe=type,se=he("%Function.prototype.apply%"),be=he("%Function.prototype.call%"),ge=he("%Reflect.apply%",!0)||ie.call(be,se),_e=requireEsDefineProperty(),Ee=he("%Math.max%");ae.exports=function($e){if(typeof $e!="function")throw new pe("a function is required");var Re=ge(ie,be,arguments);return oe(Re,1+Ee(0,$e.length-(arguments.length-1)),!0)};var we=function(){return ge(ie,se,arguments)};_e?_e(ae.exports,"apply",{value:we}):ae.exports.apply=we})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$2=function(ie,he){var oe=GetIntrinsic(ie,!!he);return typeof oe=="function"&&$indexOf$1(ie,".prototype.")>-1?callBind$1(oe):oe},hasToStringTag$3=shams(),callBound$1=callBound$2,$toString$1=callBound$1("Object.prototype.toString"),isStandardArguments=function(ie){return hasToStringTag$3&&ie&&typeof ie=="object"&&Symbol.toStringTag in ie?!1:$toString$1(ie)==="[object Arguments]"},isLegacyArguments=function(ie){return isStandardArguments(ie)?!0:ie!==null&&typeof ie=="object"&&typeof ie.length=="number"&&ie.length>=0&&$toString$1(ie)!=="[object Array]"&&$toString$1(ie.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$2=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(ie){if(typeof ie!="function")return!1;if(isFnRegex.test(fnToStr$1.call(ie)))return!0;if(!hasToStringTag$2){var he=toStr$2.call(ie);return he==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var oe=getGeneratorFunc();GeneratorFunction=oe?getProto(oe):!1}return getProto(ie)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(ae){ae!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(ie){try{var he=fnToStr.call(ie);return constructorRegex.test(he)}catch{return!1}},tryFunctionObject=function(ie){try{return isES6ClassFn(ie)?!1:(fnToStr.call(ie),!0)}catch{return!1}},toStr$1=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$1.call(all)===toStr$1.call(document.all)&&(isDDA=function(ie){if((isIE68||!ie)&&(typeof ie>"u"||typeof ie=="object"))try{var he=toStr$1.call(ie);return(he===ddaClass||he===ddaClass2||he===ddaClass3||he===objectClass)&&ie("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(ie){if(isDDA(ie))return!0;if(!ie||typeof ie!="function"&&typeof ie!="object")return!1;try{reflectApply(ie,null,badArrayLike)}catch(he){if(he!==isCallableMarker)return!1}return!isES6ClassFn(ie)&&tryFunctionObject(ie)}:function(ie){if(isDDA(ie))return!0;if(!ie||typeof ie!="function"&&typeof ie!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(ie);if(isES6ClassFn(ie))return!1;var he=toStr$1.call(ie);return he!==fnClass&&he!==genClass&&!/^\[object HTML/.test(he)?!1:tryFunctionObject(ie)},isCallable=isCallable$1,toStr=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,forEachArray=function(ie,he,oe){for(var pe=0,se=ie.length;pe=3&&(pe=oe),toStr.call(ie)==="[object Array]"?forEachArray(ie,he,pe):typeof ie=="string"?forEachString(ie,he,pe):forEachObject(ie,he,pe)},forEach_1=forEach$1,possibleTypedArrayNames=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],possibleNames=possibleTypedArrayNames,g$1=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var ie=[],he=0;he"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound("String.prototype.slice"),getPrototypeOf=Object.getPrototypeOf,$indexOf=callBound("Array.prototype.indexOf",!0)||function(ie,he){for(var oe=0;oe-1?he:he!=="Object"?!1:trySlices(ie)}return gOPD?tryTypedArrays(ie):null},whichTypedArray=whichTypedArray$1,isTypedArray=function(ie){return!!whichTypedArray(ie)};(function(ae){var ie=isArguments,he=isGeneratorFunction,oe=whichTypedArray$1,pe=isTypedArray;function se(Je){return Je.call.bind(Je)}var be=typeof BigInt<"u",ge=typeof Symbol<"u",_e=se(Object.prototype.toString),Ee=se(Number.prototype.valueOf),we=se(String.prototype.valueOf),Me=se(Boolean.prototype.valueOf);if(be)var $e=se(BigInt.prototype.valueOf);if(ge)var Re=se(Symbol.prototype.valueOf);function ke(Je,zt){if(typeof Je!="object")return!1;try{return zt(Je),!0}catch{return!1}}ae.isArgumentsObject=ie,ae.isGeneratorFunction=he,ae.isTypedArray=pe;function Ne(Je){return typeof Promise<"u"&&Je instanceof Promise||Je!==null&&typeof Je=="object"&&typeof Je.then=="function"&&typeof Je.catch=="function"}ae.isPromise=Ne;function ze(Je){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Je):pe(Je)||xe(Je)}ae.isArrayBufferView=ze;function He(Je){return oe(Je)==="Uint8Array"}ae.isUint8Array=He;function qe(Je){return oe(Je)==="Uint8ClampedArray"}ae.isUint8ClampedArray=qe;function We(Je){return oe(Je)==="Uint16Array"}ae.isUint16Array=We;function je(Je){return oe(Je)==="Uint32Array"}ae.isUint32Array=je;function Xe(Je){return oe(Je)==="Int8Array"}ae.isInt8Array=Xe;function lt(Je){return oe(Je)==="Int16Array"}ae.isInt16Array=lt;function At(Je){return oe(Je)==="Int32Array"}ae.isInt32Array=At;function mt(Je){return oe(Je)==="Float32Array"}ae.isFloat32Array=mt;function Ge(Je){return oe(Je)==="Float64Array"}ae.isFloat64Array=Ge;function Lt(Je){return oe(Je)==="BigInt64Array"}ae.isBigInt64Array=Lt;function me(Je){return oe(Je)==="BigUint64Array"}ae.isBigUint64Array=me;function ee(Je){return _e(Je)==="[object Map]"}ee.working=typeof Map<"u"&&ee(new Map);function re(Je){return typeof Map>"u"?!1:ee.working?ee(Je):Je instanceof Map}ae.isMap=re;function ne(Je){return _e(Je)==="[object Set]"}ne.working=typeof Set<"u"&&ne(new Set);function fe(Je){return typeof Set>"u"?!1:ne.working?ne(Je):Je instanceof Set}ae.isSet=fe;function le(Je){return _e(Je)==="[object WeakMap]"}le.working=typeof WeakMap<"u"&&le(new WeakMap);function ce(Je){return typeof WeakMap>"u"?!1:le.working?le(Je):Je instanceof WeakMap}ae.isWeakMap=ce;function ve(Je){return _e(Je)==="[object WeakSet]"}ve.working=typeof WeakSet<"u"&&ve(new WeakSet);function ue(Je){return ve(Je)}ae.isWeakSet=ue;function te(Je){return _e(Je)==="[object ArrayBuffer]"}te.working=typeof ArrayBuffer<"u"&&te(new ArrayBuffer);function de(Je){return typeof ArrayBuffer>"u"?!1:te.working?te(Je):Je instanceof ArrayBuffer}ae.isArrayBuffer=de;function ye(Je){return _e(Je)==="[object DataView]"}ye.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ye(new DataView(new ArrayBuffer(1),0,1));function xe(Je){return typeof DataView>"u"?!1:ye.working?ye(Je):Je instanceof DataView}ae.isDataView=xe;var Pe=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Le(Je){return _e(Je)==="[object SharedArrayBuffer]"}function De(Je){return typeof Pe>"u"?!1:(typeof Le.working>"u"&&(Le.working=Le(new Pe)),Le.working?Le(Je):Je instanceof Pe)}ae.isSharedArrayBuffer=De;function Be(Je){return _e(Je)==="[object AsyncFunction]"}ae.isAsyncFunction=Be;function Ce(Je){return _e(Je)==="[object Map Iterator]"}ae.isMapIterator=Ce;function Fe(Je){return _e(Je)==="[object Set Iterator]"}ae.isSetIterator=Fe;function Ye(Je){return _e(Je)==="[object Generator]"}ae.isGeneratorObject=Ye;function Ue(Je){return _e(Je)==="[object WebAssembly.Module]"}ae.isWebAssemblyCompiledModule=Ue;function Te(Je){return ke(Je,Ee)}ae.isNumberObject=Te;function Ze(Je){return ke(Je,we)}ae.isStringObject=Ze;function Nt(Je){return ke(Je,Me)}ae.isBooleanObject=Nt;function Qe(Je){return be&&ke(Je,$e)}ae.isBigIntObject=Qe;function ut(Je){return ge&&ke(Je,Re)}ae.isSymbolObject=ut;function Ft(Je){return Te(Je)||Ze(Je)||Nt(Je)||Qe(Je)||ut(Je)}ae.isBoxedPrimitive=Ft;function pt(Je){return typeof Uint8Array<"u"&&(de(Je)||De(Je))}ae.isAnyArrayBuffer=pt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Je){Object.defineProperty(ae,Je,{enumerable:!1,value:function(){throw new Error(Je+" is not supported in userland")}})})})(types);var isBufferBrowser=function(ie){return ie&&typeof ie=="object"&&typeof ie.copy=="function"&&typeof ie.fill=="function"&&typeof ie.readUInt8=="function"};(function(ae){var ie=Object.getOwnPropertyDescriptors||function(xe){for(var Pe=Object.keys(xe),Le={},De=0;De=De)return Fe;switch(Fe){case"%s":return String(Le[Pe++]);case"%d":return Number(Le[Pe++]);case"%j":try{return JSON.stringify(Le[Pe++])}catch{return"[Circular]"}default:return Fe}}),Ce=Le[Pe];Pe"u")return function(){return ae.deprecate(ye,xe).apply(this,arguments)};var Pe=!1;function Le(){if(!Pe){if(process$1.throwDeprecation)throw new Error(xe);process$1.traceDeprecation?console.trace(xe):console.error(xe),Pe=!0}return ye.apply(this,arguments)}return Le};var oe={},pe=/^$/;if(process$1.env.NODE_DEBUG){var se=process$1.env.NODE_DEBUG;se=se.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),pe=new RegExp("^"+se+"$","i")}ae.debuglog=function(ye){if(ye=ye.toUpperCase(),!oe[ye])if(pe.test(ye)){var xe=process$1.pid;oe[ye]=function(){var Pe=ae.format.apply(ae,arguments);console.error("%s %d: %s",ye,xe,Pe)}}else oe[ye]=function(){};return oe[ye]};function be(ye,xe){var Pe={seen:[],stylize:_e};return arguments.length>=3&&(Pe.depth=arguments[2]),arguments.length>=4&&(Pe.colors=arguments[3]),He(xe)?Pe.showHidden=xe:xe&&ae._extend(Pe,xe),At(Pe.showHidden)&&(Pe.showHidden=!1),At(Pe.depth)&&(Pe.depth=2),At(Pe.colors)&&(Pe.colors=!1),At(Pe.customInspect)&&(Pe.customInspect=!0),Pe.colors&&(Pe.stylize=ge),we(Pe,ye,Pe.depth)}ae.inspect=be,be.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},be.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function ge(ye,xe){var Pe=be.styles[xe];return Pe?"\x1B["+be.colors[Pe][0]+"m"+ye+"\x1B["+be.colors[Pe][1]+"m":ye}function _e(ye,xe){return ye}function Ee(ye){var xe={};return ye.forEach(function(Pe,Le){xe[Pe]=!0}),xe}function we(ye,xe,Pe){if(ye.customInspect&&xe&&ee(xe.inspect)&&xe.inspect!==ae.inspect&&!(xe.constructor&&xe.constructor.prototype===xe)){var Le=xe.inspect(Pe,ye);return Xe(Le)||(Le=we(ye,Le,Pe)),Le}var De=Me(ye,xe);if(De)return De;var Be=Object.keys(xe),Ce=Ee(Be);if(ye.showHidden&&(Be=Object.getOwnPropertyNames(xe)),me(xe)&&(Be.indexOf("message")>=0||Be.indexOf("description")>=0))return $e(xe);if(Be.length===0){if(ee(xe)){var Fe=xe.name?": "+xe.name:"";return ye.stylize("[Function"+Fe+"]","special")}if(mt(xe))return ye.stylize(RegExp.prototype.toString.call(xe),"regexp");if(Lt(xe))return ye.stylize(Date.prototype.toString.call(xe),"date");if(me(xe))return $e(xe)}var Ye="",Ue=!1,Te=["{","}"];if(ze(xe)&&(Ue=!0,Te=["[","]"]),ee(xe)){var Ze=xe.name?": "+xe.name:"";Ye=" [Function"+Ze+"]"}if(mt(xe)&&(Ye=" "+RegExp.prototype.toString.call(xe)),Lt(xe)&&(Ye=" "+Date.prototype.toUTCString.call(xe)),me(xe)&&(Ye=" "+$e(xe)),Be.length===0&&(!Ue||xe.length==0))return Te[0]+Ye+Te[1];if(Pe<0)return mt(xe)?ye.stylize(RegExp.prototype.toString.call(xe),"regexp"):ye.stylize("[Object]","special");ye.seen.push(xe);var Nt;return Ue?Nt=Re(ye,xe,Pe,Ce,Be):Nt=Be.map(function(Qe){return ke(ye,xe,Pe,Ce,Qe,Ue)}),ye.seen.pop(),Ne(Nt,Ye,Te)}function Me(ye,xe){if(At(xe))return ye.stylize("undefined","undefined");if(Xe(xe)){var Pe="'"+JSON.stringify(xe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ye.stylize(Pe,"string")}if(je(xe))return ye.stylize(""+xe,"number");if(He(xe))return ye.stylize(""+xe,"boolean");if(qe(xe))return ye.stylize("null","null")}function $e(ye){return"["+Error.prototype.toString.call(ye)+"]"}function Re(ye,xe,Pe,Le,De){for(var Be=[],Ce=0,Fe=xe.length;Ce-1&&(Be?Fe=Fe.split(` `).map(function(Ue){return" "+Ue}).join(` `).slice(2):Fe=` `+Fe.split(` `).map(function(Ue){return" "+Ue}).join(` `))):Fe=ye.stylize("[Circular]","special")),At(Ce)){if(Be&&De.match(/^\d+$/))return Fe;Ce=JSON.stringify(""+De),Ce.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Ce=Ce.slice(1,-1),Ce=ye.stylize(Ce,"name")):(Ce=Ce.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Ce=ye.stylize(Ce,"string"))}return Ce+": "+Fe}function Ne(ye,xe,Pe){var Le=ye.reduce(function(De,Be){return Be.indexOf(` `)>=0,De+Be.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Le>60?Pe[0]+(xe===""?"":xe+` `)+" "+ye.join(`, `)+" "+Pe[1]:Pe[0]+xe+" "+ye.join(", ")+" "+Pe[1]}ae.types=types;function ze(ye){return Array.isArray(ye)}ae.isArray=ze;function He(ye){return typeof ye=="boolean"}ae.isBoolean=He;function qe(ye){return ye===null}ae.isNull=qe;function We(ye){return ye==null}ae.isNullOrUndefined=We;function je(ye){return typeof ye=="number"}ae.isNumber=je;function Xe(ye){return typeof ye=="string"}ae.isString=Xe;function lt(ye){return typeof ye=="symbol"}ae.isSymbol=lt;function At(ye){return ye===void 0}ae.isUndefined=At;function mt(ye){return Ge(ye)&&ne(ye)==="[object RegExp]"}ae.isRegExp=mt,ae.types.isRegExp=mt;function Ge(ye){return typeof ye=="object"&&ye!==null}ae.isObject=Ge;function Lt(ye){return Ge(ye)&&ne(ye)==="[object Date]"}ae.isDate=Lt,ae.types.isDate=Lt;function me(ye){return Ge(ye)&&(ne(ye)==="[object Error]"||ye instanceof Error)}ae.isError=me,ae.types.isNativeError=me;function ee(ye){return typeof ye=="function"}ae.isFunction=ee;function re(ye){return ye===null||typeof ye=="boolean"||typeof ye=="number"||typeof ye=="string"||typeof ye=="symbol"||typeof ye>"u"}ae.isPrimitive=re,ae.isBuffer=isBufferBrowser;function ne(ye){return Object.prototype.toString.call(ye)}function fe(ye){return ye<10?"0"+ye.toString(10):ye.toString(10)}var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ce(){var ye=new Date,xe=[fe(ye.getHours()),fe(ye.getMinutes()),fe(ye.getSeconds())].join(":");return[ye.getDate(),le[ye.getMonth()],xe].join(" ")}ae.log=function(){console.log("%s - %s",ce(),ae.format.apply(ae,arguments))},ae.inherits=inherits_browserExports,ae._extend=function(ye,xe){if(!xe||!Ge(xe))return ye;for(var Pe=Object.keys(xe),Le=Pe.length;Le--;)ye[Pe[Le]]=xe[Pe[Le]];return ye};function ve(ye,xe){return Object.prototype.hasOwnProperty.call(ye,xe)}var ue=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ae.promisify=function(xe){if(typeof xe!="function")throw new TypeError('The "original" argument must be of type Function');if(ue&&xe[ue]){var Pe=xe[ue];if(typeof Pe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Pe,ue,{value:Pe,enumerable:!1,writable:!1,configurable:!0}),Pe}function Pe(){for(var Le,De,Be=new Promise(function(Ye,Ue){Le=Ye,De=Ue}),Ce=[],Fe=0;Fe0?this.tail.next=He:this.head=He,this.tail=He,++this.length}},{key:"unshift",value:function(ze){var He={data:ze,next:this.head};this.length===0&&(this.tail=He),this.head=He,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ze=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ze}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ze){if(this.length===0)return"";for(var He=this.head,qe=""+He.data;He=He.next;)qe+=ze+He.data;return qe}},{key:"concat",value:function(ze){if(this.length===0)return Ee.alloc(0);for(var He=Ee.allocUnsafe(ze>>>0),qe=this.head,We=0;qe;)Re(qe.data,He,We),We+=qe.data.length,qe=qe.next;return He}},{key:"consume",value:function(ze,He){var qe;return zeje.length?je.length:ze;if(Xe===je.length?We+=je:We+=je.slice(0,ze),ze-=Xe,ze===0){Xe===je.length?(++qe,He.next?this.head=He.next:this.head=this.tail=null):(this.head=He,He.data=je.slice(Xe));break}++qe}return this.length-=qe,We}},{key:"_getBuffer",value:function(ze){var He=Ee.allocUnsafe(ze),qe=this.head,We=1;for(qe.data.copy(He),ze-=qe.data.length;qe=qe.next;){var je=qe.data,Xe=ze>je.length?je.length:ze;if(je.copy(He,He.length-ze,0,Xe),ze-=Xe,ze===0){Xe===je.length?(++We,qe.next?this.head=qe.next:this.head=this.tail=null):(this.head=qe,qe.data=je.slice(Xe));break}++We}return this.length-=We,He}},{key:$e,value:function(ze,He){return Me(this,ie(ie({},He),{},{depth:0,customInspect:!1}))}}]),ke}(),buffer_list}var destroy_1$1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1$1;hasRequiredDestroy=1;function ae(be,ge){var _e=this,Ee=this._readableState&&this._readableState.destroyed,we=this._writableState&&this._writableState.destroyed;return Ee||we?(ge?ge(be):be&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(pe,this,be)):process$1.nextTick(pe,this,be)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(be||null,function(Me){!ge&&Me?_e._writableState?_e._writableState.errorEmitted?process$1.nextTick(he,_e):(_e._writableState.errorEmitted=!0,process$1.nextTick(ie,_e,Me)):process$1.nextTick(ie,_e,Me):ge?(process$1.nextTick(he,_e),ge(Me)):process$1.nextTick(he,_e)}),this)}function ie(be,ge){pe(be,ge),he(be)}function he(be){be._writableState&&!be._writableState.emitClose||be._readableState&&!be._readableState.emitClose||be.emit("close")}function oe(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function pe(be,ge){be.emit("error",ge)}function se(be,ge){var _e=be._readableState,Ee=be._writableState;_e&&_e.autoDestroy||Ee&&Ee.autoDestroy?be.destroy(ge):be.emit("error",ge)}return destroy_1$1={destroy:ae,undestroy:oe,errorOrDestroy:se},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function ae(ge,_e){ge.prototype=Object.create(_e.prototype),ge.prototype.constructor=ge,ge.__proto__=_e}var ie={};function he(ge,_e,Ee){Ee||(Ee=Error);function we($e,Re,ke){return typeof _e=="string"?_e:_e($e,Re,ke)}var Me=function($e){ae(Re,$e);function Re(ke,Ne,ze){return $e.call(this,we(ke,Ne,ze))||this}return Re}(Ee);Me.prototype.name=Ee.name,Me.prototype.code=ge,ie[ge]=Me}function oe(ge,_e){if(Array.isArray(ge)){var Ee=ge.length;return ge=ge.map(function(we){return String(we)}),Ee>2?"one of ".concat(_e," ").concat(ge.slice(0,Ee-1).join(", "),", or ")+ge[Ee-1]:Ee===2?"one of ".concat(_e," ").concat(ge[0]," or ").concat(ge[1]):"of ".concat(_e," ").concat(ge[0])}else return"of ".concat(_e," ").concat(String(ge))}function pe(ge,_e,Ee){return ge.substr(0,_e.length)===_e}function se(ge,_e,Ee){return(Ee===void 0||Ee>ge.length)&&(Ee=ge.length),ge.substring(Ee-_e.length,Ee)===_e}function be(ge,_e,Ee){return typeof Ee!="number"&&(Ee=0),Ee+_e.length>ge.length?!1:ge.indexOf(_e,Ee)!==-1}return he("ERR_INVALID_OPT_VALUE",function(ge,_e){return'The value "'+_e+'" is invalid for option "'+ge+'"'},TypeError),he("ERR_INVALID_ARG_TYPE",function(ge,_e,Ee){var we;typeof _e=="string"&&pe(_e,"not ")?(we="must not be",_e=_e.replace(/^not /,"")):we="must be";var Me;if(se(ge," argument"))Me="The ".concat(ge," ").concat(we," ").concat(oe(_e,"type"));else{var $e=be(ge,".")?"property":"argument";Me='The "'.concat(ge,'" ').concat($e," ").concat(we," ").concat(oe(_e,"type"))}return Me+=". Received type ".concat(typeof Ee),Me},TypeError),he("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),he("ERR_METHOD_NOT_IMPLEMENTED",function(ge){return"The "+ge+" method is not implemented"}),he("ERR_STREAM_PREMATURE_CLOSE","Premature close"),he("ERR_STREAM_DESTROYED",function(ge){return"Cannot call "+ge+" after a stream was destroyed"}),he("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),he("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),he("ERR_STREAM_WRITE_AFTER_END","write after end"),he("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),he("ERR_UNKNOWN_ENCODING",function(ge){return"Unknown encoding: "+ge},TypeError),he("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=ie,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var ae=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function ie(oe,pe,se){return oe.highWaterMark!=null?oe.highWaterMark:pe?oe[se]:null}function he(oe,pe,se,be){var ge=ie(pe,be,se);if(ge!=null){if(!(isFinite(ge)&&Math.floor(ge)===ge)||ge<0){var _e=be?se:"highWaterMark";throw new ae(_e,ge)}return Math.floor(ge)}return oe.objectMode?16:16*1024}return state={getHighWaterMark:he},state}var browser$a=deprecate;function deprecate(ae,ie){if(config("noDeprecation"))return ae;var he=!1;function oe(){if(!he){if(config("throwDeprecation"))throw new Error(ie);config("traceDeprecation")?console.trace(ie):console.warn(ie),he=!0}return ae.apply(this,arguments)}return oe}function config(ae){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var ie=commonjsGlobal.localStorage[ae];return ie==null?!1:String(ie).toLowerCase()==="true"}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=mt;function ae(De){var Be=this;this.next=null,this.entry=null,this.finish=function(){Le(Be,De)}}var ie;mt.WritableState=lt;var he={deprecate:browser$a},oe=requireStreamBrowser(),pe=requireDist().Buffer,se=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function be(De){return pe.from(De)}function ge(De){return pe.isBuffer(De)||De instanceof se}var _e=requireDestroy(),Ee=requireState(),we=Ee.getHighWaterMark,Me=requireErrorsBrowser().codes,$e=Me.ERR_INVALID_ARG_TYPE,Re=Me.ERR_METHOD_NOT_IMPLEMENTED,ke=Me.ERR_MULTIPLE_CALLBACK,Ne=Me.ERR_STREAM_CANNOT_PIPE,ze=Me.ERR_STREAM_DESTROYED,He=Me.ERR_STREAM_NULL_VALUES,qe=Me.ERR_STREAM_WRITE_AFTER_END,We=Me.ERR_UNKNOWN_ENCODING,je=_e.errorOrDestroy;inherits_browserExports(mt,oe);function Xe(){}function lt(De,Be,Ce){ie=ie||require_stream_duplex$1(),De=De||{},typeof Ce!="boolean"&&(Ce=Be instanceof ie),this.objectMode=!!De.objectMode,Ce&&(this.objectMode=this.objectMode||!!De.writableObjectMode),this.highWaterMark=we(this,De,"writableHighWaterMark",Ce),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Fe=De.decodeStrings===!1;this.decodeStrings=!Fe,this.defaultEncoding=De.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Ye){le(Be,Ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=De.emitClose!==!1,this.autoDestroy=!!De.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ae(this)}lt.prototype.getBuffer=function(){for(var Be=this.bufferedRequest,Ce=[];Be;)Ce.push(Be),Be=Be.next;return Ce},function(){try{Object.defineProperty(lt.prototype,"buffer",{get:he.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var At;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(At=Function.prototype[Symbol.hasInstance],Object.defineProperty(mt,Symbol.hasInstance,{value:function(Be){return At.call(this,Be)?!0:this!==mt?!1:Be&&Be._writableState instanceof lt}})):At=function(Be){return Be instanceof this};function mt(De){ie=ie||require_stream_duplex$1();var Be=this instanceof ie;if(!Be&&!At.call(mt,this))return new mt(De);this._writableState=new lt(De,this,Be),this.writable=!0,De&&(typeof De.write=="function"&&(this._write=De.write),typeof De.writev=="function"&&(this._writev=De.writev),typeof De.destroy=="function"&&(this._destroy=De.destroy),typeof De.final=="function"&&(this._final=De.final)),oe.call(this)}mt.prototype.pipe=function(){je(this,new Ne)};function Ge(De,Be){var Ce=new qe;je(De,Ce),process$1.nextTick(Be,Ce)}function Lt(De,Be,Ce,Fe){var Ye;return Ce===null?Ye=new He:typeof Ce!="string"&&!Be.objectMode&&(Ye=new $e("chunk",["string","Buffer"],Ce)),Ye?(je(De,Ye),process$1.nextTick(Fe,Ye),!1):!0}mt.prototype.write=function(De,Be,Ce){var Fe=this._writableState,Ye=!1,Ue=!Fe.objectMode&&ge(De);return Ue&&!pe.isBuffer(De)&&(De=be(De)),typeof Be=="function"&&(Ce=Be,Be=null),Ue?Be="buffer":Be||(Be=Fe.defaultEncoding),typeof Ce!="function"&&(Ce=Xe),Fe.ending?Ge(this,Ce):(Ue||Lt(this,Fe,De,Ce))&&(Fe.pendingcb++,Ye=ee(this,Fe,Ue,De,Be,Ce)),Ye},mt.prototype.cork=function(){this._writableState.corked++},mt.prototype.uncork=function(){var De=this._writableState;De.corked&&(De.corked--,!De.writing&&!De.corked&&!De.bufferProcessing&&De.bufferedRequest&&ue(this,De))},mt.prototype.setDefaultEncoding=function(Be){if(typeof Be=="string"&&(Be=Be.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Be+"").toLowerCase())>-1))throw new We(Be);return this._writableState.defaultEncoding=Be,this},Object.defineProperty(mt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function me(De,Be,Ce){return!De.objectMode&&De.decodeStrings!==!1&&typeof Be=="string"&&(Be=pe.from(Be,Ce)),Be}Object.defineProperty(mt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ee(De,Be,Ce,Fe,Ye,Ue){if(!Ce){var Te=me(Be,Fe,Ye);Fe!==Te&&(Ce=!0,Ye="buffer",Fe=Te)}var Ze=Be.objectMode?1:Fe.length;Be.length+=Ze;var Nt=Be.length>5===6?2:ae>>4===14?3:ae>>3===30?4:ae>>6===2?-1:-2}function utf8CheckIncomplete(ae,ie,he){var oe=ie.length-1;if(oe=0?(pe>0&&(ae.lastNeed=pe-1),pe):--oe=0?(pe>0&&(ae.lastNeed=pe-2),pe):--oe=0?(pe>0&&(pe===2?pe=0:ae.lastNeed=pe-3),pe):0))}function utf8CheckExtraBytes(ae,ie,he){if((ie[0]&192)!==128)return ae.lastNeed=0,"�";if(ae.lastNeed>1&&ie.length>1){if((ie[1]&192)!==128)return ae.lastNeed=1,"�";if(ae.lastNeed>2&&ie.length>2&&(ie[2]&192)!==128)return ae.lastNeed=2,"�"}}function utf8FillLast(ae){var ie=this.lastTotal-this.lastNeed,he=utf8CheckExtraBytes(this,ae);if(he!==void 0)return he;if(this.lastNeed<=ae.length)return ae.copy(this.lastChar,ie,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);ae.copy(this.lastChar,ie,0,ae.length),this.lastNeed-=ae.length}function utf8Text(ae,ie){var he=utf8CheckIncomplete(this,ae,ie);if(!this.lastNeed)return ae.toString("utf8",ie);this.lastTotal=he;var oe=ae.length-(he-this.lastNeed);return ae.copy(this.lastChar,0,oe),ae.toString("utf8",ie,oe)}function utf8End(ae){var ie=ae&&ae.length?this.write(ae):"";return this.lastNeed?ie+"�":ie}function utf16Text(ae,ie){if((ae.length-ie)%2===0){var he=ae.toString("utf16le",ie);if(he){var oe=he.charCodeAt(he.length-1);if(oe>=55296&&oe<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=ae[ae.length-2],this.lastChar[1]=ae[ae.length-1],he.slice(0,-1)}return he}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=ae[ae.length-1],ae.toString("utf16le",ie,ae.length-1)}function utf16End(ae){var ie=ae&&ae.length?this.write(ae):"";if(this.lastNeed){var he=this.lastTotal-this.lastNeed;return ie+this.lastChar.toString("utf16le",0,he)}return ie}function base64Text(ae,ie){var he=(ae.length-ie)%3;return he===0?ae.toString("base64",ie):(this.lastNeed=3-he,this.lastTotal=3,he===1?this.lastChar[0]=ae[ae.length-1]:(this.lastChar[0]=ae[ae.length-2],this.lastChar[1]=ae[ae.length-1]),ae.toString("base64",ie,ae.length-he))}function base64End(ae){var ie=ae&&ae.length?this.write(ae):"";return this.lastNeed?ie+this.lastChar.toString("base64",0,3-this.lastNeed):ie}function simpleWrite(ae){return ae.toString(this.encoding)}function simpleEnd(ae){return ae&&ae.length?this.write(ae):""}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var ae=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function ie(se){var be=!1;return function(){if(!be){be=!0;for(var ge=arguments.length,_e=new Array(ge),Ee=0;Ee0)if(typeof Te!="string"&&!ut.objectMode&&Object.getPrototypeOf(Te)!==oe.prototype&&(Te=se(Te)),Nt)ut.endEmitted?Xe(Ue,new He):me(Ue,ut,Te,!0);else if(ut.ended)Xe(Ue,new Ne);else{if(ut.destroyed)return!1;ut.reading=!1,ut.decoder&&!Ze?(Te=ut.decoder.write(Te),ut.objectMode||Te.length!==0?me(Ue,ut,Te,!1):ue(Ue,ut)):me(Ue,ut,Te,!1)}else Nt||(ut.reading=!1,ue(Ue,ut))}return!ut.ended&&(ut.length=re?Ue=re:(Ue--,Ue|=Ue>>>1,Ue|=Ue>>>2,Ue|=Ue>>>4,Ue|=Ue>>>8,Ue|=Ue>>>16,Ue++),Ue}function fe(Ue,Te){return Ue<=0||Te.length===0&&Te.ended?0:Te.objectMode?1:Ue!==Ue?Te.flowing&&Te.length?Te.buffer.head.data.length:Te.length:(Ue>Te.highWaterMark&&(Te.highWaterMark=ne(Ue)),Ue<=Te.length?Ue:Te.ended?Te.length:(Te.needReadable=!0,0))}Ge.prototype.read=function(Ue){_e("read",Ue),Ue=parseInt(Ue,10);var Te=this._readableState,Ze=Ue;if(Ue!==0&&(Te.emittedReadable=!1),Ue===0&&Te.needReadable&&((Te.highWaterMark!==0?Te.length>=Te.highWaterMark:Te.length>0)||Te.ended))return _e("read: emitReadable",Te.length,Te.ended),Te.length===0&&Te.ended?Ce(this):ce(this),null;if(Ue=fe(Ue,Te),Ue===0&&Te.ended)return Te.length===0&&Ce(this),null;var Nt=Te.needReadable;_e("need readable",Nt),(Te.length===0||Te.length-Ue0?Qe=Be(Ue,Te):Qe=null,Qe===null?(Te.needReadable=Te.length<=Te.highWaterMark,Ue=0):(Te.length-=Ue,Te.awaitDrain=0),Te.length===0&&(Te.ended||(Te.needReadable=!0),Ze!==Ue&&Te.ended&&Ce(this)),Qe!==null&&this.emit("data",Qe),Qe};function le(Ue,Te){if(_e("onEofChunk"),!Te.ended){if(Te.decoder){var Ze=Te.decoder.end();Ze&&Ze.length&&(Te.buffer.push(Ze),Te.length+=Te.objectMode?1:Ze.length)}Te.ended=!0,Te.sync?ce(Ue):(Te.needReadable=!1,Te.emittedReadable||(Te.emittedReadable=!0,ve(Ue)))}}function ce(Ue){var Te=Ue._readableState;_e("emitReadable",Te.needReadable,Te.emittedReadable),Te.needReadable=!1,Te.emittedReadable||(_e("emitReadable",Te.flowing),Te.emittedReadable=!0,process$1.nextTick(ve,Ue))}function ve(Ue){var Te=Ue._readableState;_e("emitReadable_",Te.destroyed,Te.length,Te.ended),!Te.destroyed&&(Te.length||Te.ended)&&(Ue.emit("readable"),Te.emittedReadable=!1),Te.needReadable=!Te.flowing&&!Te.ended&&Te.length<=Te.highWaterMark,De(Ue)}function ue(Ue,Te){Te.readingMore||(Te.readingMore=!0,process$1.nextTick(te,Ue,Te))}function te(Ue,Te){for(;!Te.reading&&!Te.ended&&(Te.length1&&Ye(Nt.pipes,Ue)!==-1)&&!zt&&(_e("false write response, pause",Nt.awaitDrain),Nt.awaitDrain++),Ze.pause())}function Ht(yt){_e("onerror",yt),Kt(),Ue.removeListener("error",Ht),ie(Ue,"error")===0&&Xe(Ue,yt)}At(Ue,"error",Ht);function vt(){Ue.removeListener("finish",Rt),Kt()}Ue.once("close",vt);function Rt(){_e("onfinish"),Ue.removeListener("close",vt),Kt()}Ue.once("finish",Rt);function Kt(){_e("unpipe"),Ze.unpipe(Ue)}return Ue.emit("pipe",Ze),Nt.flowing||(_e("pipe resume"),Ze.resume()),Ue};function de(Ue){return function(){var Ze=Ue._readableState;_e("pipeOnDrain",Ze.awaitDrain),Ze.awaitDrain&&Ze.awaitDrain--,Ze.awaitDrain===0&&ie(Ue,"data")&&(Ze.flowing=!0,De(Ue))}}Ge.prototype.unpipe=function(Ue){var Te=this._readableState,Ze={hasUnpiped:!1};if(Te.pipesCount===0)return this;if(Te.pipesCount===1)return Ue&&Ue!==Te.pipes?this:(Ue||(Ue=Te.pipes),Te.pipes=null,Te.pipesCount=0,Te.flowing=!1,Ue&&Ue.emit("unpipe",this,Ze),this);if(!Ue){var Nt=Te.pipes,Qe=Te.pipesCount;Te.pipes=null,Te.pipesCount=0,Te.flowing=!1;for(var ut=0;ut0,Nt.flowing!==!1&&this.resume()):Ue==="readable"&&!Nt.endEmitted&&!Nt.readableListening&&(Nt.readableListening=Nt.needReadable=!0,Nt.flowing=!1,Nt.emittedReadable=!1,_e("on readable",Nt.length,Nt.reading),Nt.length?ce(this):Nt.reading||process$1.nextTick(xe,this)),Ze},Ge.prototype.addListener=Ge.prototype.on,Ge.prototype.removeListener=function(Ue,Te){var Ze=he.prototype.removeListener.call(this,Ue,Te);return Ue==="readable"&&process$1.nextTick(ye,this),Ze},Ge.prototype.removeAllListeners=function(Ue){var Te=he.prototype.removeAllListeners.apply(this,arguments);return(Ue==="readable"||Ue===void 0)&&process$1.nextTick(ye,this),Te};function ye(Ue){var Te=Ue._readableState;Te.readableListening=Ue.listenerCount("readable")>0,Te.resumeScheduled&&!Te.paused?Te.flowing=!0:Ue.listenerCount("data")>0&&Ue.resume()}function xe(Ue){_e("readable nexttick read 0"),Ue.read(0)}Ge.prototype.resume=function(){var Ue=this._readableState;return Ue.flowing||(_e("resume"),Ue.flowing=!Ue.readableListening,Pe(this,Ue)),Ue.paused=!1,this};function Pe(Ue,Te){Te.resumeScheduled||(Te.resumeScheduled=!0,process$1.nextTick(Le,Ue,Te))}function Le(Ue,Te){_e("resume",Te.reading),Te.reading||Ue.read(0),Te.resumeScheduled=!1,Ue.emit("resume"),De(Ue),Te.flowing&&!Te.reading&&Ue.read(0)}Ge.prototype.pause=function(){return _e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function De(Ue){var Te=Ue._readableState;for(_e("flow",Te.flowing);Te.flowing&&Ue.read()!==null;);}Ge.prototype.wrap=function(Ue){var Te=this,Ze=this._readableState,Nt=!1;Ue.on("end",function(){if(_e("wrapped end"),Ze.decoder&&!Ze.ended){var Ft=Ze.decoder.end();Ft&&Ft.length&&Te.push(Ft)}Te.push(null)}),Ue.on("data",function(Ft){if(_e("wrapped data"),Ze.decoder&&(Ft=Ze.decoder.write(Ft)),!(Ze.objectMode&&Ft==null)&&!(!Ze.objectMode&&(!Ft||!Ft.length))){var pt=Te.push(Ft);pt||(Nt=!0,Ue.pause())}});for(var Qe in Ue)this[Qe]===void 0&&typeof Ue[Qe]=="function"&&(this[Qe]=function(pt){return function(){return Ue[pt].apply(Ue,arguments)}}(Qe));for(var ut=0;ut=Te.length?(Te.decoder?Ze=Te.buffer.join(""):Te.buffer.length===1?Ze=Te.buffer.first():Ze=Te.buffer.concat(Te.length),Te.buffer.clear()):Ze=Te.buffer.consume(Ue,Te.decoder),Ze}function Ce(Ue){var Te=Ue._readableState;_e("endReadable",Te.endEmitted),Te.endEmitted||(Te.ended=!0,process$1.nextTick(Fe,Te,Ue))}function Fe(Ue,Te){if(_e("endReadableNT",Ue.endEmitted,Ue.length),!Ue.endEmitted&&Ue.length===0&&(Ue.endEmitted=!0,Te.readable=!1,Te.emit("end"),Ue.autoDestroy)){var Ze=Te._writableState;(!Ze||Ze.autoDestroy&&Ze.finished)&&Te.destroy()}}typeof Symbol=="function"&&(Ge.from=function(Ue,Te){return je===void 0&&(je=requireFromBrowser()),je(Ge,Ue,Te)});function Ye(Ue,Te){for(var Ze=0,Nt=Ue.length;Ze0;return ge(qe,je,Xe,function(lt){ze||(ze=lt),lt&&He.forEach(_e),!je&&(He.forEach(_e),Ne(ze))})});return Re.reduce(Ee)}return pipeline_1=Me,pipeline_1}var streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$q=inherits_browserExports;inherits$q(Stream,EE),Stream.Readable=require_stream_readable$1(),Stream.Writable=require_stream_writable$1(),Stream.Duplex=require_stream_duplex$1(),Stream.Transform=require_stream_transform(),Stream.PassThrough=require_stream_passthrough(),Stream.finished=requireEndOfStream(),Stream.pipeline=requirePipeline(),Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(ae,ie){var he=this;function oe(we){ae.writable&&ae.write(we)===!1&&he.pause&&he.pause()}he.on("data",oe);function pe(){he.readable&&he.resume&&he.resume()}ae.on("drain",pe),!ae._isStdio&&(!ie||ie.end!==!1)&&(he.on("end",be),he.on("close",ge));var se=!1;function be(){se||(se=!0,ae.end())}function ge(){se||(se=!0,typeof ae.destroy=="function"&&ae.destroy())}function _e(we){if(Ee(),EE.listenerCount(this,"error")===0)throw we}he.on("error",_e),ae.on("error",_e);function Ee(){he.removeListener("data",oe),ae.removeListener("drain",pe),he.removeListener("end",be),he.removeListener("close",ge),he.removeListener("error",_e),ae.removeListener("error",_e),he.removeListener("end",Ee),he.removeListener("close",Ee),ae.removeListener("close",Ee)}return he.on("end",Ee),he.on("close",Ee),ae.on("close",Ee),ae.emit("pipe",he),ae};var Buffer$A=safeBufferExports$1.Buffer,Transform$7=streamBrowserify.Transform,inherits$p=inherits_browserExports;function throwIfNotStringOrBuffer(ae,ie){if(!Buffer$A.isBuffer(ae)&&typeof ae!="string")throw new TypeError(ie+" must be a string or a buffer")}function HashBase$2(ae){Transform$7.call(this),this._block=Buffer$A.allocUnsafe(ae),this._blockSize=ae,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$p(HashBase$2,Transform$7),HashBase$2.prototype._transform=function(ae,ie,he){var oe=null;try{this.update(ae,ie)}catch(pe){oe=pe}he(oe)},HashBase$2.prototype._flush=function(ae){var ie=null;try{this.push(this.digest())}catch(he){ie=he}ae(ie)},HashBase$2.prototype.update=function(ae,ie){if(throwIfNotStringOrBuffer(ae,"Data"),this._finalized)throw new Error("Digest already called");Buffer$A.isBuffer(ae)||(ae=Buffer$A.from(ae,ie));for(var he=this._block,oe=0;this._blockOffset+ae.length-oe>=this._blockSize;){for(var pe=this._blockOffset;pe0;++se)this._length[se]+=be,be=this._length[se]/4294967296|0,be>0&&(this._length[se]-=4294967296*be);return this},HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")},HashBase$2.prototype.digest=function(ae){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var ie=this._digest();ae!==void 0&&(ie=ie.toString(ae)),this._block.fill(0),this._blockOffset=0;for(var he=0;he<4;++he)this._length[he]=0;return ie},HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$o=inherits_browserExports,HashBase$1=hashBase,Buffer$z=safeBufferExports$1.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$o(MD5$3,HashBase$1),MD5$3.prototype._update=function(){for(var ae=ARRAY16$1,ie=0;ie<16;++ie)ae[ie]=this._block.readInt32LE(ie*4);var he=this._a,oe=this._b,pe=this._c,se=this._d;he=fnF(he,oe,pe,se,ae[0],3614090360,7),se=fnF(se,he,oe,pe,ae[1],3905402710,12),pe=fnF(pe,se,he,oe,ae[2],606105819,17),oe=fnF(oe,pe,se,he,ae[3],3250441966,22),he=fnF(he,oe,pe,se,ae[4],4118548399,7),se=fnF(se,he,oe,pe,ae[5],1200080426,12),pe=fnF(pe,se,he,oe,ae[6],2821735955,17),oe=fnF(oe,pe,se,he,ae[7],4249261313,22),he=fnF(he,oe,pe,se,ae[8],1770035416,7),se=fnF(se,he,oe,pe,ae[9],2336552879,12),pe=fnF(pe,se,he,oe,ae[10],4294925233,17),oe=fnF(oe,pe,se,he,ae[11],2304563134,22),he=fnF(he,oe,pe,se,ae[12],1804603682,7),se=fnF(se,he,oe,pe,ae[13],4254626195,12),pe=fnF(pe,se,he,oe,ae[14],2792965006,17),oe=fnF(oe,pe,se,he,ae[15],1236535329,22),he=fnG(he,oe,pe,se,ae[1],4129170786,5),se=fnG(se,he,oe,pe,ae[6],3225465664,9),pe=fnG(pe,se,he,oe,ae[11],643717713,14),oe=fnG(oe,pe,se,he,ae[0],3921069994,20),he=fnG(he,oe,pe,se,ae[5],3593408605,5),se=fnG(se,he,oe,pe,ae[10],38016083,9),pe=fnG(pe,se,he,oe,ae[15],3634488961,14),oe=fnG(oe,pe,se,he,ae[4],3889429448,20),he=fnG(he,oe,pe,se,ae[9],568446438,5),se=fnG(se,he,oe,pe,ae[14],3275163606,9),pe=fnG(pe,se,he,oe,ae[3],4107603335,14),oe=fnG(oe,pe,se,he,ae[8],1163531501,20),he=fnG(he,oe,pe,se,ae[13],2850285829,5),se=fnG(se,he,oe,pe,ae[2],4243563512,9),pe=fnG(pe,se,he,oe,ae[7],1735328473,14),oe=fnG(oe,pe,se,he,ae[12],2368359562,20),he=fnH(he,oe,pe,se,ae[5],4294588738,4),se=fnH(se,he,oe,pe,ae[8],2272392833,11),pe=fnH(pe,se,he,oe,ae[11],1839030562,16),oe=fnH(oe,pe,se,he,ae[14],4259657740,23),he=fnH(he,oe,pe,se,ae[1],2763975236,4),se=fnH(se,he,oe,pe,ae[4],1272893353,11),pe=fnH(pe,se,he,oe,ae[7],4139469664,16),oe=fnH(oe,pe,se,he,ae[10],3200236656,23),he=fnH(he,oe,pe,se,ae[13],681279174,4),se=fnH(se,he,oe,pe,ae[0],3936430074,11),pe=fnH(pe,se,he,oe,ae[3],3572445317,16),oe=fnH(oe,pe,se,he,ae[6],76029189,23),he=fnH(he,oe,pe,se,ae[9],3654602809,4),se=fnH(se,he,oe,pe,ae[12],3873151461,11),pe=fnH(pe,se,he,oe,ae[15],530742520,16),oe=fnH(oe,pe,se,he,ae[2],3299628645,23),he=fnI(he,oe,pe,se,ae[0],4096336452,6),se=fnI(se,he,oe,pe,ae[7],1126891415,10),pe=fnI(pe,se,he,oe,ae[14],2878612391,15),oe=fnI(oe,pe,se,he,ae[5],4237533241,21),he=fnI(he,oe,pe,se,ae[12],1700485571,6),se=fnI(se,he,oe,pe,ae[3],2399980690,10),pe=fnI(pe,se,he,oe,ae[10],4293915773,15),oe=fnI(oe,pe,se,he,ae[1],2240044497,21),he=fnI(he,oe,pe,se,ae[8],1873313359,6),se=fnI(se,he,oe,pe,ae[15],4264355552,10),pe=fnI(pe,se,he,oe,ae[6],2734768916,15),oe=fnI(oe,pe,se,he,ae[13],1309151649,21),he=fnI(he,oe,pe,se,ae[4],4149444226,6),se=fnI(se,he,oe,pe,ae[11],3174756917,10),pe=fnI(pe,se,he,oe,ae[2],718787259,15),oe=fnI(oe,pe,se,he,ae[9],3951481745,21),this._a=this._a+he|0,this._b=this._b+oe|0,this._c=this._c+pe|0,this._d=this._d+se|0},MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var ae=Buffer$z.allocUnsafe(16);return ae.writeInt32LE(this._a,0),ae.writeInt32LE(this._b,4),ae.writeInt32LE(this._c,8),ae.writeInt32LE(this._d,12),ae};function rotl$1(ae,ie){return ae<>>32-ie}function fnF(ae,ie,he,oe,pe,se,be){return rotl$1(ae+(ie&he|~ie&oe)+pe+se|0,be)+ie|0}function fnG(ae,ie,he,oe,pe,se,be){return rotl$1(ae+(ie&oe|he&~oe)+pe+se|0,be)+ie|0}function fnH(ae,ie,he,oe,pe,se,be){return rotl$1(ae+(ie^he^oe)+pe+se|0,be)+ie|0}function fnI(ae,ie,he,oe,pe,se,be){return rotl$1(ae+(he^(ie|~oe))+pe+se|0,be)+ie|0}var md5_js=MD5$3,Buffer$y=requireDist().Buffer,inherits$n=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$4(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$n(RIPEMD160$4,HashBase),RIPEMD160$4.prototype._update=function(){for(var ae=ARRAY16,ie=0;ie<16;++ie)ae[ie]=this._block.readInt32LE(ie*4);for(var he=this._a|0,oe=this._b|0,pe=this._c|0,se=this._d|0,be=this._e|0,ge=this._a|0,_e=this._b|0,Ee=this._c|0,we=this._d|0,Me=this._e|0,$e=0;$e<80;$e+=1){var Re,ke;$e<16?(Re=fn1(he,oe,pe,se,be,ae[zl[$e]],hl[0],sl[$e]),ke=fn5(ge,_e,Ee,we,Me,ae[zr[$e]],hr[0],sr[$e])):$e<32?(Re=fn2(he,oe,pe,se,be,ae[zl[$e]],hl[1],sl[$e]),ke=fn4(ge,_e,Ee,we,Me,ae[zr[$e]],hr[1],sr[$e])):$e<48?(Re=fn3(he,oe,pe,se,be,ae[zl[$e]],hl[2],sl[$e]),ke=fn3(ge,_e,Ee,we,Me,ae[zr[$e]],hr[2],sr[$e])):$e<64?(Re=fn4(he,oe,pe,se,be,ae[zl[$e]],hl[3],sl[$e]),ke=fn2(ge,_e,Ee,we,Me,ae[zr[$e]],hr[3],sr[$e])):(Re=fn5(he,oe,pe,se,be,ae[zl[$e]],hl[4],sl[$e]),ke=fn1(ge,_e,Ee,we,Me,ae[zr[$e]],hr[4],sr[$e])),he=be,be=se,se=rotl(pe,10),pe=oe,oe=Re,ge=Me,Me=we,we=rotl(Ee,10),Ee=_e,_e=ke}var Ne=this._b+pe+we|0;this._b=this._c+se+Me|0,this._c=this._d+be+ge|0,this._d=this._e+he+_e|0,this._e=this._a+oe+Ee|0,this._a=Ne},RIPEMD160$4.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var ae=Buffer$y.alloc?Buffer$y.alloc(20):new Buffer$y(20);return ae.writeInt32LE(this._a,0),ae.writeInt32LE(this._b,4),ae.writeInt32LE(this._c,8),ae.writeInt32LE(this._d,12),ae.writeInt32LE(this._e,16),ae};function rotl(ae,ie){return ae<>>32-ie}function fn1(ae,ie,he,oe,pe,se,be,ge){return rotl(ae+(ie^he^oe)+se+be|0,ge)+pe|0}function fn2(ae,ie,he,oe,pe,se,be,ge){return rotl(ae+(ie&he|~ie&oe)+se+be|0,ge)+pe|0}function fn3(ae,ie,he,oe,pe,se,be,ge){return rotl(ae+((ie|~he)^oe)+se+be|0,ge)+pe|0}function fn4(ae,ie,he,oe,pe,se,be,ge){return rotl(ae+(ie&oe|he&~oe)+se+be|0,ge)+pe|0}function fn5(ae,ie,he,oe,pe,se,be,ge){return rotl(ae+(ie^(he|~oe))+se+be|0,ge)+pe|0}var ripemd160=RIPEMD160$4,sha_js={exports:{}},Buffer$x=safeBufferExports$1.Buffer;function Hash$7(ae,ie){this._block=Buffer$x.alloc(ae),this._finalSize=ie,this._blockSize=ae,this._len=0}Hash$7.prototype.update=function(ae,ie){typeof ae=="string"&&(ie=ie||"utf8",ae=Buffer$x.from(ae,ie));for(var he=this._block,oe=this._blockSize,pe=ae.length,se=this._len,be=0;be=this._finalSize&&(this._update(this._block),this._block.fill(0));var he=this._len*8;if(he<=4294967295)this._block.writeUInt32BE(he,this._blockSize-4);else{var oe=(he&4294967295)>>>0,pe=(he-oe)/4294967296;this._block.writeUInt32BE(pe,this._blockSize-8),this._block.writeUInt32BE(oe,this._blockSize-4)}this._update(this._block);var se=this._hash();return ae?se.toString(ae):se},Hash$7.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$3=Hash$7,inherits$m=inherits_browserExports,Hash$6=hash$3,Buffer$w=safeBufferExports$1.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$6.call(this,64,56)}inherits$m(Sha,Hash$6),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(ae){return ae<<5|ae>>>27}function rotl30$1(ae){return ae<<30|ae>>>2}function ft$1(ae,ie,he,oe){return ae===0?ie&he|~ie&oe:ae===2?ie&he|ie&oe|he&oe:ie^he^oe}Sha.prototype._update=function(ae){for(var ie=this._w,he=this._a|0,oe=this._b|0,pe=this._c|0,se=this._d|0,be=this._e|0,ge=0;ge<16;++ge)ie[ge]=ae.readInt32BE(ge*4);for(;ge<80;++ge)ie[ge]=ie[ge-3]^ie[ge-8]^ie[ge-14]^ie[ge-16];for(var _e=0;_e<80;++_e){var Ee=~~(_e/20),we=rotl5$1(he)+ft$1(Ee,oe,pe,se)+be+ie[_e]+K$4[Ee]|0;be=se,se=pe,pe=rotl30$1(oe),oe=he,he=we}this._a=he+this._a|0,this._b=oe+this._b|0,this._c=pe+this._c|0,this._d=se+this._d|0,this._e=be+this._e|0},Sha.prototype._hash=function(){var ae=Buffer$w.allocUnsafe(20);return ae.writeInt32BE(this._a|0,0),ae.writeInt32BE(this._b|0,4),ae.writeInt32BE(this._c|0,8),ae.writeInt32BE(this._d|0,12),ae.writeInt32BE(this._e|0,16),ae};var sha$4=Sha,inherits$l=inherits_browserExports,Hash$5=hash$3,Buffer$v=safeBufferExports$1.Buffer,K$3=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$5.call(this,64,56)}inherits$l(Sha1,Hash$5),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(ae){return ae<<1|ae>>>31}function rotl5(ae){return ae<<5|ae>>>27}function rotl30(ae){return ae<<30|ae>>>2}function ft(ae,ie,he,oe){return ae===0?ie&he|~ie&oe:ae===2?ie&he|ie&oe|he&oe:ie^he^oe}Sha1.prototype._update=function(ae){for(var ie=this._w,he=this._a|0,oe=this._b|0,pe=this._c|0,se=this._d|0,be=this._e|0,ge=0;ge<16;++ge)ie[ge]=ae.readInt32BE(ge*4);for(;ge<80;++ge)ie[ge]=rotl1(ie[ge-3]^ie[ge-8]^ie[ge-14]^ie[ge-16]);for(var _e=0;_e<80;++_e){var Ee=~~(_e/20),we=rotl5(he)+ft(Ee,oe,pe,se)+be+ie[_e]+K$3[Ee]|0;be=se,se=pe,pe=rotl30(oe),oe=he,he=we}this._a=he+this._a|0,this._b=oe+this._b|0,this._c=pe+this._c|0,this._d=se+this._d|0,this._e=be+this._e|0},Sha1.prototype._hash=function(){var ae=Buffer$v.allocUnsafe(20);return ae.writeInt32BE(this._a|0,0),ae.writeInt32BE(this._b|0,4),ae.writeInt32BE(this._c|0,8),ae.writeInt32BE(this._d|0,12),ae.writeInt32BE(this._e|0,16),ae};var sha1=Sha1,inherits$k=inherits_browserExports,Hash$4=hash$3,Buffer$u=safeBufferExports$1.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$4.call(this,64,56)}inherits$k(Sha256$1,Hash$4),Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(ae,ie,he){return he^ae&(ie^he)}function maj$1(ae,ie,he){return ae&ie|he&(ae|ie)}function sigma0$1(ae){return(ae>>>2|ae<<30)^(ae>>>13|ae<<19)^(ae>>>22|ae<<10)}function sigma1$1(ae){return(ae>>>6|ae<<26)^(ae>>>11|ae<<21)^(ae>>>25|ae<<7)}function gamma0(ae){return(ae>>>7|ae<<25)^(ae>>>18|ae<<14)^ae>>>3}function gamma1(ae){return(ae>>>17|ae<<15)^(ae>>>19|ae<<13)^ae>>>10}Sha256$1.prototype._update=function(ae){for(var ie=this._w,he=this._a|0,oe=this._b|0,pe=this._c|0,se=this._d|0,be=this._e|0,ge=this._f|0,_e=this._g|0,Ee=this._h|0,we=0;we<16;++we)ie[we]=ae.readInt32BE(we*4);for(;we<64;++we)ie[we]=gamma1(ie[we-2])+ie[we-7]+gamma0(ie[we-15])+ie[we-16]|0;for(var Me=0;Me<64;++Me){var $e=Ee+sigma1$1(be)+ch(be,ge,_e)+K$2[Me]+ie[Me]|0,Re=sigma0$1(he)+maj$1(he,oe,pe)|0;Ee=_e,_e=ge,ge=be,be=se+$e|0,se=pe,pe=oe,oe=he,he=$e+Re|0}this._a=he+this._a|0,this._b=oe+this._b|0,this._c=pe+this._c|0,this._d=se+this._d|0,this._e=be+this._e|0,this._f=ge+this._f|0,this._g=_e+this._g|0,this._h=Ee+this._h|0},Sha256$1.prototype._hash=function(){var ae=Buffer$u.allocUnsafe(32);return ae.writeInt32BE(this._a,0),ae.writeInt32BE(this._b,4),ae.writeInt32BE(this._c,8),ae.writeInt32BE(this._d,12),ae.writeInt32BE(this._e,16),ae.writeInt32BE(this._f,20),ae.writeInt32BE(this._g,24),ae.writeInt32BE(this._h,28),ae};var sha256$1=Sha256$1,inherits$j=inherits_browserExports,Sha256=sha256$1,Hash$3=hash$3,Buffer$t=safeBufferExports$1.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$3.call(this,64,56)}inherits$j(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var ae=Buffer$t.allocUnsafe(28);return ae.writeInt32BE(this._a,0),ae.writeInt32BE(this._b,4),ae.writeInt32BE(this._c,8),ae.writeInt32BE(this._d,12),ae.writeInt32BE(this._e,16),ae.writeInt32BE(this._f,20),ae.writeInt32BE(this._g,24),ae};var sha224$1=Sha224,inherits$i=inherits_browserExports,Hash$2=hash$3,Buffer$s=safeBufferExports$1.Buffer,K$1=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$2.call(this,128,112)}inherits$i(Sha512,Hash$2),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(ae,ie,he){return he^ae&(ie^he)}function maj(ae,ie,he){return ae&ie|he&(ae|ie)}function sigma0(ae,ie){return(ae>>>28|ie<<4)^(ie>>>2|ae<<30)^(ie>>>7|ae<<25)}function sigma1(ae,ie){return(ae>>>14|ie<<18)^(ae>>>18|ie<<14)^(ie>>>9|ae<<23)}function Gamma0(ae,ie){return(ae>>>1|ie<<31)^(ae>>>8|ie<<24)^ae>>>7}function Gamma0l(ae,ie){return(ae>>>1|ie<<31)^(ae>>>8|ie<<24)^(ae>>>7|ie<<25)}function Gamma1(ae,ie){return(ae>>>19|ie<<13)^(ie>>>29|ae<<3)^ae>>>6}function Gamma1l(ae,ie){return(ae>>>19|ie<<13)^(ie>>>29|ae<<3)^(ae>>>6|ie<<26)}function getCarry(ae,ie){return ae>>>0>>0?1:0}Sha512.prototype._update=function(ae){for(var ie=this._w,he=this._ah|0,oe=this._bh|0,pe=this._ch|0,se=this._dh|0,be=this._eh|0,ge=this._fh|0,_e=this._gh|0,Ee=this._hh|0,we=this._al|0,Me=this._bl|0,$e=this._cl|0,Re=this._dl|0,ke=this._el|0,Ne=this._fl|0,ze=this._gl|0,He=this._hl|0,qe=0;qe<32;qe+=2)ie[qe]=ae.readInt32BE(qe*4),ie[qe+1]=ae.readInt32BE(qe*4+4);for(;qe<160;qe+=2){var We=ie[qe-30],je=ie[qe-15*2+1],Xe=Gamma0(We,je),lt=Gamma0l(je,We);We=ie[qe-2*2],je=ie[qe-2*2+1];var At=Gamma1(We,je),mt=Gamma1l(je,We),Ge=ie[qe-7*2],Lt=ie[qe-7*2+1],me=ie[qe-16*2],ee=ie[qe-16*2+1],re=lt+Lt|0,ne=Xe+Ge+getCarry(re,lt)|0;re=re+mt|0,ne=ne+At+getCarry(re,mt)|0,re=re+ee|0,ne=ne+me+getCarry(re,ee)|0,ie[qe]=ne,ie[qe+1]=re}for(var fe=0;fe<160;fe+=2){ne=ie[fe],re=ie[fe+1];var le=maj(he,oe,pe),ce=maj(we,Me,$e),ve=sigma0(he,we),ue=sigma0(we,he),te=sigma1(be,ke),de=sigma1(ke,be),ye=K$1[fe],xe=K$1[fe+1],Pe=Ch(be,ge,_e),Le=Ch(ke,Ne,ze),De=He+de|0,Be=Ee+te+getCarry(De,He)|0;De=De+Le|0,Be=Be+Pe+getCarry(De,Le)|0,De=De+xe|0,Be=Be+ye+getCarry(De,xe)|0,De=De+re|0,Be=Be+ne+getCarry(De,re)|0;var Ce=ue+ce|0,Fe=ve+le+getCarry(Ce,ue)|0;Ee=_e,He=ze,_e=ge,ze=Ne,ge=be,Ne=ke,ke=Re+De|0,be=se+Be+getCarry(ke,Re)|0,se=pe,Re=$e,pe=oe,$e=Me,oe=he,Me=we,we=De+Ce|0,he=Be+Fe+getCarry(we,De)|0}this._al=this._al+we|0,this._bl=this._bl+Me|0,this._cl=this._cl+$e|0,this._dl=this._dl+Re|0,this._el=this._el+ke|0,this._fl=this._fl+Ne|0,this._gl=this._gl+ze|0,this._hl=this._hl+He|0,this._ah=this._ah+he+getCarry(this._al,we)|0,this._bh=this._bh+oe+getCarry(this._bl,Me)|0,this._ch=this._ch+pe+getCarry(this._cl,$e)|0,this._dh=this._dh+se+getCarry(this._dl,Re)|0,this._eh=this._eh+be+getCarry(this._el,ke)|0,this._fh=this._fh+ge+getCarry(this._fl,Ne)|0,this._gh=this._gh+_e+getCarry(this._gl,ze)|0,this._hh=this._hh+Ee+getCarry(this._hl,He)|0},Sha512.prototype._hash=function(){var ae=Buffer$s.allocUnsafe(64);function ie(he,oe,pe){ae.writeInt32BE(he,pe),ae.writeInt32BE(oe,pe+4)}return ie(this._ah,this._al,0),ie(this._bh,this._bl,8),ie(this._ch,this._cl,16),ie(this._dh,this._dl,24),ie(this._eh,this._el,32),ie(this._fh,this._fl,40),ie(this._gh,this._gl,48),ie(this._hh,this._hl,56),ae};var sha512$1=Sha512,inherits$h=inherits_browserExports,SHA512$2=sha512$1,Hash$1=hash$3,Buffer$r=safeBufferExports$1.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$1.call(this,128,112)}inherits$h(Sha384,SHA512$2),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var ae=Buffer$r.allocUnsafe(48);function ie(he,oe,pe){ae.writeInt32BE(he,pe),ae.writeInt32BE(oe,pe+4)}return ie(this._ah,this._al,0),ie(this._bh,this._bl,8),ie(this._ch,this._cl,16),ie(this._dh,this._dl,24),ie(this._eh,this._el,32),ie(this._fh,this._fl,40),ae};var sha384$1=Sha384,exports$1=sha_js.exports=function(ie){ie=ie.toLowerCase();var he=exports$1[ie];if(!he)throw new Error(ie+" is not supported (we accept pull requests)");return new he};exports$1.sha=sha$4,exports$1.sha1=sha1,exports$1.sha224=sha224$1,exports$1.sha256=sha256$1,exports$1.sha384=sha384$1,exports$1.sha512=sha512$1;var sha_jsExports=sha_js.exports,Buffer$q=safeBufferExports$1.Buffer,Transform$6=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$g=inherits_browserExports;function CipherBase$1(ae){Transform$6.call(this),this.hashMode=typeof ae=="string",this.hashMode?this[ae]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$g(CipherBase$1,Transform$6);var useUint8Array=typeof Uint8Array<"u",useArrayBuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(Buffer$q.prototype instanceof Uint8Array||Buffer$q.TYPED_ARRAY_SUPPORT);CipherBase$1.prototype.update=function(ae,ie,he){var oe;if(ae instanceof Buffer$q)oe=ae;else if(typeof ae=="string")oe=Buffer$q.from(ae,ie);else if(useArrayBuffer&&ArrayBuffer.isView(ae))oe=Buffer$q.from(ae.buffer,ae.byteOffset,ae.byteLength);else if(useUint8Array&&ae instanceof Uint8Array)oe=Buffer$q.from(ae);else if(Buffer$q.isBuffer(ae)&&ae.constructor&&ae.constructor.isBuffer&&ae.constructor.isBuffer(ae))oe=Buffer$q.from(ae);else throw new Error('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.');var pe=this._update(oe);return this.hashMode?this:(he&&(pe=this._toString(pe,he)),pe)},CipherBase$1.prototype.setAutoPadding=function(){},CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase$1.prototype._transform=function(ae,ie,he){var oe;try{this.hashMode?this._update(ae):this.push(this._update(ae))}catch(pe){oe=pe}finally{he(oe)}},CipherBase$1.prototype._flush=function(ae){var ie;try{this.push(this.__final())}catch(he){ie=he}ae(ie)},CipherBase$1.prototype._finalOrDigest=function(ae){var ie=this.__final()||Buffer$q.alloc(0);return ae&&(ie=this._toString(ie,ae,!0)),ie},CipherBase$1.prototype._toString=function(ae,ie,he){if(this._decoder||(this._decoder=new StringDecoder(ie),this._encoding=ie),this._encoding!==ie)throw new Error("can’t switch encodings");var oe=this._decoder.write(ae);return he&&(oe+=this._decoder.end()),oe};var cipherBase=CipherBase$1,inherits$f=inherits_browserExports,MD5$2=md5_js,RIPEMD160$3=ripemd160,sha$3=sha_jsExports,Base$5=cipherBase;function Hash(ae){Base$5.call(this,"digest"),this._hash=ae}inherits$f(Hash,Base$5),Hash.prototype._update=function(ae){this._hash.update(ae)},Hash.prototype._final=function(){return this._hash.digest()};var browser$9=function(ie){return ie=ie.toLowerCase(),ie==="md5"?new MD5$2:ie==="rmd160"||ie==="ripemd160"?new RIPEMD160$3:new Hash(sha$3(ie))},inherits$e=inherits_browserExports,Buffer$p=safeBufferExports$1.Buffer,Base$4=cipherBase,ZEROS$2=Buffer$p.alloc(128),blocksize=64;function Hmac$3(ae,ie){Base$4.call(this,"digest"),typeof ie=="string"&&(ie=Buffer$p.from(ie)),this._alg=ae,this._key=ie,ie.length>blocksize?ie=ae(ie):ie.lengthhe){var oe=ae==="rmd160"?new RIPEMD160$2:sha$2(ae);ie=oe.update(ie).digest()}else ie.lengthMAX_ALLOC||ie!==ie)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process$1.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$n=safeBufferExports$1.Buffer,toBuffer$2=function(ae,ie,he){if(Buffer$n.isBuffer(ae))return ae;if(typeof ae=="string")return Buffer$n.from(ae,ie);if(ArrayBuffer.isView(ae))return Buffer$n.from(ae.buffer);throw new TypeError(he+" must be a string, a Buffer, a typed array or a DataView")},md5$1=md5$3,RIPEMD160$1=ripemd160,sha$1=sha_jsExports,Buffer$m=safeBufferExports$1.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$1=toBuffer$2,ZEROS=Buffer$m.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(ae,ie,he){var oe=getDigest(ae),pe=ae==="sha512"||ae==="sha384"?128:64;ie.length>pe?ie=oe(ie):ie.length>>0},utils$n.writeUInt32BE=function(ie,he,oe){ie[0+oe]=he>>>24,ie[1+oe]=he>>>16&255,ie[2+oe]=he>>>8&255,ie[3+oe]=he&255},utils$n.ip=function(ie,he,oe,pe){for(var se=0,be=0,ge=6;ge>=0;ge-=2){for(var _e=0;_e<=24;_e+=8)se<<=1,se|=he>>>_e+ge&1;for(var _e=0;_e<=24;_e+=8)se<<=1,se|=ie>>>_e+ge&1}for(var ge=6;ge>=0;ge-=2){for(var _e=1;_e<=25;_e+=8)be<<=1,be|=he>>>_e+ge&1;for(var _e=1;_e<=25;_e+=8)be<<=1,be|=ie>>>_e+ge&1}oe[pe+0]=se>>>0,oe[pe+1]=be>>>0},utils$n.rip=function(ie,he,oe,pe){for(var se=0,be=0,ge=0;ge<4;ge++)for(var _e=24;_e>=0;_e-=8)se<<=1,se|=he>>>_e+ge&1,se<<=1,se|=ie>>>_e+ge&1;for(var ge=4;ge<8;ge++)for(var _e=24;_e>=0;_e-=8)be<<=1,be|=he>>>_e+ge&1,be<<=1,be|=ie>>>_e+ge&1;oe[pe+0]=se>>>0,oe[pe+1]=be>>>0},utils$n.pc1=function(ie,he,oe,pe){for(var se=0,be=0,ge=7;ge>=5;ge--){for(var _e=0;_e<=24;_e+=8)se<<=1,se|=he>>_e+ge&1;for(var _e=0;_e<=24;_e+=8)se<<=1,se|=ie>>_e+ge&1}for(var _e=0;_e<=24;_e+=8)se<<=1,se|=he>>_e+ge&1;for(var ge=1;ge<=3;ge++){for(var _e=0;_e<=24;_e+=8)be<<=1,be|=he>>_e+ge&1;for(var _e=0;_e<=24;_e+=8)be<<=1,be|=ie>>_e+ge&1}for(var _e=0;_e<=24;_e+=8)be<<=1,be|=ie>>_e+ge&1;oe[pe+0]=se>>>0,oe[pe+1]=be>>>0},utils$n.r28shl=function(ie,he){return ie<>>28-he};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$n.pc2=function(ie,he,oe,pe){for(var se=0,be=0,ge=pc2table.length>>>1,_e=0;_e>>pc2table[_e]&1;for(var _e=ge;_e>>pc2table[_e]&1;oe[pe+0]=se>>>0,oe[pe+1]=be>>>0},utils$n.expand=function(ie,he,oe){var pe=0,se=0;pe=(ie&1)<<5|ie>>>27;for(var be=23;be>=15;be-=4)pe<<=6,pe|=ie>>>be&63;for(var be=11;be>=3;be-=4)se|=ie>>>be&63,se<<=6;se|=(ie&31)<<1|ie>>>31,he[oe+0]=pe>>>0,he[oe+1]=se>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$n.substitute=function(ie,he){for(var oe=0,pe=0;pe<4;pe++){var se=ie>>>18-pe*6&63,be=sTable[pe*64+se];oe<<=4,oe|=be}for(var pe=0;pe<4;pe++){var se=he>>>18-pe*6&63,be=sTable[4*64+pe*64+se];oe<<=4,oe|=be}return oe>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$n.permute=function(ie){for(var he=0,oe=0;oe>>permuteTable[oe]&1;return he>>>0},utils$n.padSplit=function(ie,he,oe){for(var pe=ie.toString(2);pe.length0;pe--)he+=this._buffer(ie,he),oe+=this._flushBuffer(se,oe);return he+=this._buffer(ie,he),se},Cipher$3.prototype.final=function(ie){var he;ie&&(he=this.update(ie));var oe;return this.type==="encrypt"?oe=this._finalEncrypt():oe=this._finalDecrypt(),he?he.concat(oe):oe},Cipher$3.prototype._pad=function(ie,he){if(he===0)return!1;for(;he>>1];oe=utils$m.r28shl(oe,be),pe=utils$m.r28shl(pe,be),utils$m.pc2(oe,pe,ie.keys,se)}},DES$3.prototype._update=function(ie,he,oe,pe){var se=this._desState,be=utils$m.readUInt32BE(ie,he),ge=utils$m.readUInt32BE(ie,he+4);utils$m.ip(be,ge,se.tmp,0),be=se.tmp[0],ge=se.tmp[1],this.type==="encrypt"?this._encrypt(se,be,ge,se.tmp,0):this._decrypt(se,be,ge,se.tmp,0),be=se.tmp[0],ge=se.tmp[1],utils$m.writeUInt32BE(oe,be,pe),utils$m.writeUInt32BE(oe,ge,pe+4)},DES$3.prototype._pad=function(ie,he){if(this.padding===!1)return!1;for(var oe=ie.length-he,pe=he;pe>>0,be=Re}utils$m.rip(ge,be,pe,se)},DES$3.prototype._decrypt=function(ie,he,oe,pe,se){for(var be=oe,ge=he,_e=ie.keys.length-2;_e>=0;_e-=2){var Ee=ie.keys[_e],we=ie.keys[_e+1];utils$m.expand(be,ie.tmp,0),Ee^=ie.tmp[0],we^=ie.tmp[1];var Me=utils$m.substitute(Ee,we),$e=utils$m.permute(Me),Re=be;be=(ge^$e)>>>0,ge=Re}utils$m.rip(be,ge,pe,se)};var cbc$1={},assert$f=minimalisticAssert,inherits$b=inherits_browserExports,proto={};function CBCState(ae){assert$f.equal(ae.length,8,"Invalid IV length"),this.iv=new Array(8);for(var ie=0;ie>pe%8,ae._prev=shiftIn(ae._prev,he?ge:_e);return be}function shiftIn(ae,ie){var he=ae.length,oe=-1,pe=Buffer$g.allocUnsafe(ae.length);for(ae=Buffer$g.concat([ae,Buffer$g.from([ie])]);++oe>7;return pe}cfb1.encrypt=function(ae,ie,he){for(var oe=ie.length,pe=Buffer$g.allocUnsafe(oe),se=-1;++se>>24]^be[we>>>16&255]^ge[Me>>>8&255]^_e[$e&255]^ie[He++],ke=se[we>>>24]^be[Me>>>16&255]^ge[$e>>>8&255]^_e[Ee&255]^ie[He++],Ne=se[Me>>>24]^be[$e>>>16&255]^ge[Ee>>>8&255]^_e[we&255]^ie[He++],ze=se[$e>>>24]^be[Ee>>>16&255]^ge[we>>>8&255]^_e[Me&255]^ie[He++],Ee=Re,we=ke,Me=Ne,$e=ze;return Re=(oe[Ee>>>24]<<24|oe[we>>>16&255]<<16|oe[Me>>>8&255]<<8|oe[$e&255])^ie[He++],ke=(oe[we>>>24]<<24|oe[Me>>>16&255]<<16|oe[$e>>>8&255]<<8|oe[Ee&255])^ie[He++],Ne=(oe[Me>>>24]<<24|oe[$e>>>16&255]<<16|oe[Ee>>>8&255]<<8|oe[we&255])^ie[He++],ze=(oe[$e>>>24]<<24|oe[Ee>>>16&255]<<16|oe[we>>>8&255]<<8|oe[Me&255])^ie[He++],Re=Re>>>0,ke=ke>>>0,Ne=Ne>>>0,ze=ze>>>0,[Re,ke,Ne,ze]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var ae=new Array(256),ie=0;ie<256;ie++)ie<128?ae[ie]=ie<<1:ae[ie]=ie<<1^283;for(var he=[],oe=[],pe=[[],[],[],[]],se=[[],[],[],[]],be=0,ge=0,_e=0;_e<256;++_e){var Ee=ge^ge<<1^ge<<2^ge<<3^ge<<4;Ee=Ee>>>8^Ee&255^99,he[be]=Ee,oe[Ee]=be;var we=ae[be],Me=ae[we],$e=ae[Me],Re=ae[Ee]*257^Ee*16843008;pe[0][be]=Re<<24|Re>>>8,pe[1][be]=Re<<16|Re>>>16,pe[2][be]=Re<<8|Re>>>24,pe[3][be]=Re,Re=$e*16843009^Me*65537^we*257^be*16843008,se[0][Ee]=Re<<24|Re>>>8,se[1][Ee]=Re<<16|Re>>>16,se[2][Ee]=Re<<8|Re>>>24,se[3][Ee]=Re,be===0?be=ge=1:(be=we^ae[ae[ae[$e^we]]],ge^=ae[ae[ge]])}return{SBOX:he,INV_SBOX:oe,SUB_MIX:pe,INV_SUB_MIX:se}}();function AES(ae){this._key=asUInt32Array(ae),this._reset()}AES.blockSize=4*4,AES.keySize=256/8,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var ae=this._key,ie=ae.length,he=ie+6,oe=(he+1)*4,pe=[],se=0;se>>24,be=G.SBOX[be>>>24]<<24|G.SBOX[be>>>16&255]<<16|G.SBOX[be>>>8&255]<<8|G.SBOX[be&255],be^=RCON[se/ie|0]<<24):ie>6&&se%ie===4&&(be=G.SBOX[be>>>24]<<24|G.SBOX[be>>>16&255]<<16|G.SBOX[be>>>8&255]<<8|G.SBOX[be&255]),pe[se]=pe[se-ie]^be}for(var ge=[],_e=0;_e>>24]]^G.INV_SUB_MIX[1][G.SBOX[we>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[we>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[we&255]]}this._nRounds=he,this._keySchedule=pe,this._invKeySchedule=ge},AES.prototype.encryptBlockRaw=function(ae){return ae=asUInt32Array(ae),cryptBlock(ae,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(ae){var ie=this.encryptBlockRaw(ae),he=Buffer$e.allocUnsafe(16);return he.writeUInt32BE(ie[0],0),he.writeUInt32BE(ie[1],4),he.writeUInt32BE(ie[2],8),he.writeUInt32BE(ie[3],12),he},AES.prototype.decryptBlock=function(ae){ae=asUInt32Array(ae);var ie=ae[1];ae[1]=ae[3],ae[3]=ie;var he=cryptBlock(ae,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),oe=Buffer$e.allocUnsafe(16);return oe.writeUInt32BE(he[0],0),oe.writeUInt32BE(he[3],4),oe.writeUInt32BE(he[2],8),oe.writeUInt32BE(he[1],12),oe},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},aes$5.AES=AES;var Buffer$d=safeBufferExports$1.Buffer,ZEROES=Buffer$d.alloc(16,0);function toArray$1(ae){return[ae.readUInt32BE(0),ae.readUInt32BE(4),ae.readUInt32BE(8),ae.readUInt32BE(12)]}function fromArray(ae){var ie=Buffer$d.allocUnsafe(16);return ie.writeUInt32BE(ae[0]>>>0,0),ie.writeUInt32BE(ae[1]>>>0,4),ie.writeUInt32BE(ae[2]>>>0,8),ie.writeUInt32BE(ae[3]>>>0,12),ie}function GHASH$1(ae){this.h=ae,this.state=Buffer$d.alloc(16,0),this.cache=Buffer$d.allocUnsafe(0)}GHASH$1.prototype.ghash=function(ae){for(var ie=-1;++ie0;he--)ae[he]=ae[he]>>>1|(ae[he-1]&1)<<31;ae[0]=ae[0]>>>1,pe&&(ae[0]=ae[0]^225<<24)}this.state=fromArray(ie)},GHASH$1.prototype.update=function(ae){this.cache=Buffer$d.concat([this.cache,ae]);for(var ie;this.cache.length>=16;)ie=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(ie)},GHASH$1.prototype.final=function(ae,ie){return this.cache.length&&this.ghash(Buffer$d.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,ae,0,ie])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$c=safeBufferExports$1.Buffer,Transform$5=cipherBase,inherits$8=inherits_browserExports,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(ae,ie){var he=0;ae.length!==ie.length&&he++;for(var oe=Math.min(ae.length,ie.length),pe=0;pe0||oe>0;){var _e=new MD5;_e.update(ge),_e.update(ae),ie&&_e.update(ie),ge=_e.digest();var Ee=0;if(pe>0){var we=se.length-pe;Ee=Math.min(pe,ge.length),ge.copy(se,we,0,Ee),pe-=Ee}if(Ee0){var Me=be.length-oe,$e=Math.min(oe,ge.length-Ee);ge.copy(be,Me,Ee,Ee+$e),oe-=$e}}return ge.fill(0),{key:se,iv:be}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$9=safeBufferExports$1.Buffer,StreamCipher$1=streamCipher,Transform$3=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$6=inherits_browserExports;function Cipher(ae,ie,he){Transform$3.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(ie),this._prev=Buffer$9.from(he),this._mode=ae,this._autopadding=!0}inherits$6(Cipher,Transform$3),Cipher.prototype._update=function(ae){this._cache.add(ae);for(var ie,he,oe=[];ie=this._cache.get();)he=this._mode.encrypt(this,ie),oe.push(he);return Buffer$9.concat(oe)};var PADDING=Buffer$9.alloc(16,16);Cipher.prototype._final=function(){var ae=this._cache.flush();if(this._autopadding)return ae=this._mode.encrypt(this,ae),this._cipher.scrub(),ae;if(!ae.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(ae){return this._autopadding=!!ae,this};function Splitter$1(){this.cache=Buffer$9.allocUnsafe(0)}Splitter$1.prototype.add=function(ae){this.cache=Buffer$9.concat([this.cache,ae])},Splitter$1.prototype.get=function(){if(this.cache.length>15){var ae=this.cache.slice(0,16);return this.cache=this.cache.slice(16),ae}return null},Splitter$1.prototype.flush=function(){for(var ae=16-this.cache.length,ie=Buffer$9.allocUnsafe(ae),he=-1;++he16)return ie=this.cache.slice(0,16),this.cache=this.cache.slice(16),ie}else if(this.cache.length>=16)return ie=this.cache.slice(0,16),this.cache=this.cache.slice(16),ie;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(ae){var ie=ae[15];if(ie<1||ie>16)throw new Error("unable to decrypt data");for(var he=-1;++he0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn$6);var bnExports$6=bn$6.exports,bn$5={exports:{}};bn$5.exports,function(ae){(function(ie,he){function oe(me,ee){if(!me)throw new Error(ee||"Assertion failed")}function pe(me,ee){me.super_=ee;var re=function(){};re.prototype=ee.prototype,me.prototype=new re,me.prototype.constructor=me}function se(me,ee,re){if(se.isBN(me))return me;this.negative=0,this.words=null,this.length=0,this.red=null,me!==null&&((ee==="le"||ee==="be")&&(re=ee,ee=10),this._init(me||0,ee||10,re||"be"))}typeof ie=="object"?ie.exports=se:he.BN=se,se.BN=se,se.wordSize=26;var be;try{typeof window<"u"&&typeof window.Buffer<"u"?be=window.Buffer:be=requireDist().Buffer}catch{}se.isBN=function(ee){return ee instanceof se?!0:ee!==null&&typeof ee=="object"&&ee.constructor.wordSize===se.wordSize&&Array.isArray(ee.words)},se.max=function(ee,re){return ee.cmp(re)>0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn$5);var bnExports$5=bn$5.exports,brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var ae;brorand.exports=function(pe){return ae||(ae=new ie(null)),ae.generate(pe)};function ie(oe){this.rand=oe}if(brorand.exports.Rand=ie,ie.prototype.generate=function(pe){return this._rand(pe)},ie.prototype._rand=function(pe){if(this.rand.getBytes)return this.rand.getBytes(pe);for(var se=new Uint8Array(pe),be=0;be=0);return ge},he.prototype._randrange=function(pe,se){var be=se.sub(pe);return pe.add(this._randbelow(be))},he.prototype.test=function(pe,se,be){var ge=pe.bitLength(),_e=ae.mont(pe),Ee=new ae(1).toRed(_e);se||(se=Math.max(1,ge/48|0));for(var we=pe.subn(1),Me=0;!we.testn(Me);Me++);for(var $e=pe.shrn(Me),Re=we.toRed(_e),ke=!0;se>0;se--){var Ne=this._randrange(new ae(2),we);be&&be(Ne);var ze=Ne.toRed(_e).redPow($e);if(!(ze.cmp(Ee)===0||ze.cmp(Re)===0)){for(var He=1;He0;se--){var Re=this._randrange(new ae(2),Ee),ke=pe.gcd(Re);if(ke.cmpn(1)!==0)return ke;var Ne=Re.toRed(ge).redPow(Me);if(!(Ne.cmp(_e)===0||Ne.cmp($e)===0)){for(var ze=1;zeHe;)We.ishrn(1);if(We.isEven()&&We.iadd(se),We.testn(1)||We.iadd(be),qe.cmp(be)){if(!qe.cmp(ge))for(;We.mod(_e).cmp(Ee);)We.iadd(Me)}else for(;We.mod(he).cmp(we);)We.iadd(Me);if(je=We.shrn(1),ke(je)&&ke(We)&&Ne(je)&&Ne(We)&&pe.test(je)&&pe.test(We))return We}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var ae=bnExports$6,ie=requireMr(),he=new ie,oe=new ae(24),pe=new ae(11),se=new ae(10),be=new ae(3),ge=new ae(7),_e=requireGeneratePrime(),Ee=browserExports;dh=ke;function we(ze,He){return He=He||"utf8",Buffer$j.isBuffer(ze)||(ze=new Buffer$j(ze,He)),this._pub=new ae(ze),this}function Me(ze,He){return He=He||"utf8",Buffer$j.isBuffer(ze)||(ze=new Buffer$j(ze,He)),this._priv=new ae(ze),this}var $e={};function Re(ze,He){var qe=He.toString("hex"),We=[qe,ze.toString(16)].join("_");if(We in $e)return $e[We];var je=0;if(ze.isEven()||!_e.simpleSieve||!_e.fermatTest(ze)||!he.test(ze))return je+=1,qe==="02"||qe==="05"?je+=8:je+=4,$e[We]=je,je;he.test(ze.shrn(1))||(je+=2);var Xe;switch(qe){case"02":ze.mod(oe).cmp(pe)&&(je+=8);break;case"05":Xe=ze.mod(se),Xe.cmp(be)&&Xe.cmp(ge)&&(je+=8);break;default:je+=4}return $e[We]=je,je}function ke(ze,He,qe){this.setGenerator(He),this.__prime=new ae(ze),this._prime=ae.mont(this.__prime),this._primeLen=ze.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,qe?(this.setPublicKey=we,this.setPrivateKey=Me):this._primeCode=8}Object.defineProperty(ke.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=Re(this.__prime,this.__gen)),this._primeCode}}),ke.prototype.generateKeys=function(){return this._priv||(this._priv=new ae(Ee(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},ke.prototype.computeSecret=function(ze){ze=new ae(ze),ze=ze.toRed(this._prime);var He=ze.redPow(this._priv).fromRed(),qe=new Buffer$j(He.toArray()),We=this.getPrime();if(qe.length"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick}:processNextickArgs.exports=process$1;function nextTick(ae,ie,he,oe){if(typeof ae!="function")throw new TypeError('"callback" argument must be a function');var pe=arguments.length,se,be;switch(pe){case 0:case 1:return process$1.nextTick(ae);case 2:return process$1.nextTick(function(){ae.call(null,ie)});case 3:return process$1.nextTick(function(){ae.call(null,ie,he)});case 4:return process$1.nextTick(function(){ae.call(null,ie,he,oe)});default:for(se=new Array(pe-1),be=0;be"u"}util$2.isPrimitive=isPrimitive,util$2.isBuffer=requireDist().Buffer.isBuffer;function objectToString(ae){return Object.prototype.toString.call(ae)}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(ae){function ie(se,be){if(!(se instanceof be))throw new TypeError("Cannot call a class as a function")}var he=safeBufferExports.Buffer,oe=util$3;function pe(se,be,ge){se.copy(be,ge)}ae.exports=function(){function se(){ie(this,se),this.head=null,this.tail=null,this.length=0}return se.prototype.push=function(ge){var _e={data:ge,next:null};this.length>0?this.tail.next=_e:this.head=_e,this.tail=_e,++this.length},se.prototype.unshift=function(ge){var _e={data:ge,next:this.head};this.length===0&&(this.tail=_e),this.head=_e,++this.length},se.prototype.shift=function(){if(this.length!==0){var ge=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ge}},se.prototype.clear=function(){this.head=this.tail=null,this.length=0},se.prototype.join=function(ge){if(this.length===0)return"";for(var _e=this.head,Ee=""+_e.data;_e=_e.next;)Ee+=ge+_e.data;return Ee},se.prototype.concat=function(ge){if(this.length===0)return he.alloc(0);for(var _e=he.allocUnsafe(ge>>>0),Ee=this.head,we=0;Ee;)pe(Ee.data,_e,we),we+=Ee.data.length,Ee=Ee.next;return _e},se}(),oe&&oe.inspect&&oe.inspect.custom&&(ae.exports.prototype[oe.inspect.custom]=function(){var se=oe.inspect({length:this.length});return this.constructor.name+" "+se})}(BufferList)),BufferList.exports}var pna=processNextickArgsExports;function destroy(ae,ie){var he=this,oe=this._readableState&&this._readableState.destroyed,pe=this._writableState&&this._writableState.destroyed;return oe||pe?(ie?ie(ae):ae&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,ae)):pna.nextTick(emitErrorNT,this,ae)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(ae||null,function(se){!ie&&se?he._writableState?he._writableState.errorEmitted||(he._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,he,se)):pna.nextTick(emitErrorNT,he,se):ie&&ie(se)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(ae,ie){ae.emit("error",ie)}var destroy_1={destroy,undestroy},_stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var ae=processNextickArgsExports;_stream_writable=Ne;function ie(ce){var ve=this;this.next=null,this.entry=null,this.finish=function(){le(ve,ce)}}var he=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:ae.nextTick,oe;Ne.WritableState=Re;var pe=Object.create(util$2);pe.inherits=inherits_browserExports;var se={deprecate:browser$a},be=streamBrowser,ge=safeBufferExports.Buffer,_e=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ee(ce){return ge.from(ce)}function we(ce){return ge.isBuffer(ce)||ce instanceof _e}var Me=destroy_1;pe.inherits(Ne,be);function $e(){}function Re(ce,ve){oe=oe||require_stream_duplex(),ce=ce||{};var ue=ve instanceof oe;this.objectMode=!!ce.objectMode,ue&&(this.objectMode=this.objectMode||!!ce.writableObjectMode);var te=ce.highWaterMark,de=ce.writableHighWaterMark,ye=this.objectMode?16:16*1024;te||te===0?this.highWaterMark=te:ue&&(de||de===0)?this.highWaterMark=de:this.highWaterMark=ye,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var xe=ce.decodeStrings===!1;this.decodeStrings=!xe,this.defaultEncoding=ce.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Pe){At(ve,Pe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new ie(this)}Re.prototype.getBuffer=function(){for(var ve=this.bufferedRequest,ue=[];ve;)ue.push(ve),ve=ve.next;return ue},function(){try{Object.defineProperty(Re.prototype,"buffer",{get:se.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ke;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ke=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ne,Symbol.hasInstance,{value:function(ce){return ke.call(this,ce)?!0:this!==Ne?!1:ce&&ce._writableState instanceof Re}})):ke=function(ce){return ce instanceof this};function Ne(ce){if(oe=oe||require_stream_duplex(),!ke.call(Ne,this)&&!(this instanceof oe))return new Ne(ce);this._writableState=new Re(ce,this),this.writable=!0,ce&&(typeof ce.write=="function"&&(this._write=ce.write),typeof ce.writev=="function"&&(this._writev=ce.writev),typeof ce.destroy=="function"&&(this._destroy=ce.destroy),typeof ce.final=="function"&&(this._final=ce.final)),be.call(this)}Ne.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function ze(ce,ve){var ue=new Error("write after end");ce.emit("error",ue),ae.nextTick(ve,ue)}function He(ce,ve,ue,te){var de=!0,ye=!1;return ue===null?ye=new TypeError("May not write null values to stream"):typeof ue!="string"&&ue!==void 0&&!ve.objectMode&&(ye=new TypeError("Invalid non-string/buffer chunk")),ye&&(ce.emit("error",ye),ae.nextTick(te,ye),de=!1),de}Ne.prototype.write=function(ce,ve,ue){var te=this._writableState,de=!1,ye=!te.objectMode&&we(ce);return ye&&!ge.isBuffer(ce)&&(ce=Ee(ce)),typeof ve=="function"&&(ue=ve,ve=null),ye?ve="buffer":ve||(ve=te.defaultEncoding),typeof ue!="function"&&(ue=$e),te.ended?ze(this,ue):(ye||He(this,te,ce,ue))&&(te.pendingcb++,de=We(this,te,ye,ce,ve,ue)),de},Ne.prototype.cork=function(){var ce=this._writableState;ce.corked++},Ne.prototype.uncork=function(){var ce=this._writableState;ce.corked&&(ce.corked--,!ce.writing&&!ce.corked&&!ce.bufferProcessing&&ce.bufferedRequest&&Lt(this,ce))},Ne.prototype.setDefaultEncoding=function(ve){if(typeof ve=="string"&&(ve=ve.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ve+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ve);return this._writableState.defaultEncoding=ve,this};function qe(ce,ve,ue){return!ce.objectMode&&ce.decodeStrings!==!1&&typeof ve=="string"&&(ve=ge.from(ve,ue)),ve}Object.defineProperty(Ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function We(ce,ve,ue,te,de,ye){if(!ue){var xe=qe(ve,te,de);te!==xe&&(ue=!0,de="buffer",te=xe)}var Pe=ve.objectMode?1:te.length;ve.length+=Pe;var Le=ve.length0?(typeof Ce!="string"&&!Te.objectMode&&Object.getPrototypeOf(Ce)!==se.prototype&&(Ce=ge(Ce)),Ye?Te.endEmitted?Be.emit("error",new Error("stream.unshift() after end event")):je(Be,Te,Ce,!0):Te.ended?Be.emit("error",new Error("stream.push() after EOF")):(Te.reading=!1,Te.decoder&&!Fe?(Ce=Te.decoder.write(Ce),Te.objectMode||Ce.length!==0?je(Be,Te,Ce,!1):re(Be,Te)):je(Be,Te,Ce,!1))):Ye||(Te.reading=!1)}return lt(Te)}function je(Be,Ce,Fe,Ye){Ce.flowing&&Ce.length===0&&!Ce.sync?(Be.emit("data",Fe),Be.read(0)):(Ce.length+=Ce.objectMode?1:Fe.length,Ye?Ce.buffer.unshift(Fe):Ce.buffer.push(Fe),Ce.needReadable&&me(Be)),re(Be,Ce)}function Xe(Be,Ce){var Fe;return!_e(Ce)&&typeof Ce!="string"&&Ce!==void 0&&!Be.objectMode&&(Fe=new TypeError("Invalid non-string/buffer chunk")),Fe}function lt(Be){return!Be.ended&&(Be.needReadable||Be.length=At?Be=At:(Be--,Be|=Be>>>1,Be|=Be>>>2,Be|=Be>>>4,Be|=Be>>>8,Be|=Be>>>16,Be++),Be}function Ge(Be,Ce){return Be<=0||Ce.length===0&&Ce.ended?0:Ce.objectMode?1:Be!==Be?Ce.flowing&&Ce.length?Ce.buffer.head.data.length:Ce.length:(Be>Ce.highWaterMark&&(Ce.highWaterMark=mt(Be)),Be<=Ce.length?Be:Ce.ended?Ce.length:(Ce.needReadable=!0,0))}qe.prototype.read=function(Be){Me("read",Be),Be=parseInt(Be,10);var Ce=this._readableState,Fe=Be;if(Be!==0&&(Ce.emittedReadable=!1),Be===0&&Ce.needReadable&&(Ce.length>=Ce.highWaterMark||Ce.ended))return Me("read: emitReadable",Ce.length,Ce.ended),Ce.length===0&&Ce.ended?Pe(this):me(this),null;if(Be=Ge(Be,Ce),Be===0&&Ce.ended)return Ce.length===0&&Pe(this),null;var Ye=Ce.needReadable;Me("need readable",Ye),(Ce.length===0||Ce.length-Be0?Ue=te(Be,Ce):Ue=null,Ue===null?(Ce.needReadable=!0,Be=0):Ce.length-=Be,Ce.length===0&&(Ce.ended||(Ce.needReadable=!0),Fe!==Be&&Ce.ended&&Pe(this)),Ue!==null&&this.emit("data",Ue),Ue};function Lt(Be,Ce){if(!Ce.ended){if(Ce.decoder){var Fe=Ce.decoder.end();Fe&&Fe.length&&(Ce.buffer.push(Fe),Ce.length+=Ce.objectMode?1:Fe.length)}Ce.ended=!0,me(Be)}}function me(Be){var Ce=Be._readableState;Ce.needReadable=!1,Ce.emittedReadable||(Me("emitReadable",Ce.flowing),Ce.emittedReadable=!0,Ce.sync?ae.nextTick(ee,Be):ee(Be))}function ee(Be){Me("emit readable"),Be.emit("readable"),ue(Be)}function re(Be,Ce){Ce.readingMore||(Ce.readingMore=!0,ae.nextTick(ne,Be,Ce))}function ne(Be,Ce){for(var Fe=Ce.length;!Ce.reading&&!Ce.flowing&&!Ce.ended&&Ce.length1&&De(Ye.pipes,Be)!==-1)&&!ut&&(Me("false write response, pause",Ye.awaitDrain),Ye.awaitDrain++,pt=!0),Fe.pause())}function zt(vt){Me("onerror",vt),Ht(),Be.removeListener("error",zt),oe(Be,"error")===0&&Be.emit("error",vt)}ze(Be,"error",zt);function bt(){Be.removeListener("finish",gt),Ht()}Be.once("close",bt);function gt(){Me("onfinish"),Be.removeListener("close",bt),Ht()}Be.once("finish",gt);function Ht(){Me("unpipe"),Fe.unpipe(Be)}return Be.emit("pipe",Fe),Ye.flowing||(Me("pipe resume"),Fe.resume()),Be};function fe(Be){return function(){var Ce=Be._readableState;Me("pipeOnDrain",Ce.awaitDrain),Ce.awaitDrain&&Ce.awaitDrain--,Ce.awaitDrain===0&&oe(Be,"data")&&(Ce.flowing=!0,ue(Be))}}qe.prototype.unpipe=function(Be){var Ce=this._readableState,Fe={hasUnpiped:!1};if(Ce.pipesCount===0)return this;if(Ce.pipesCount===1)return Be&&Be!==Ce.pipes?this:(Be||(Be=Ce.pipes),Ce.pipes=null,Ce.pipesCount=0,Ce.flowing=!1,Be&&Be.emit("unpipe",this,Fe),this);if(!Be){var Ye=Ce.pipes,Ue=Ce.pipesCount;Ce.pipes=null,Ce.pipesCount=0,Ce.flowing=!1;for(var Te=0;Te=Ce.length?(Ce.decoder?Fe=Ce.buffer.join(""):Ce.buffer.length===1?Fe=Ce.buffer.head.data:Fe=Ce.buffer.concat(Ce.length),Ce.buffer.clear()):Fe=de(Be,Ce.buffer,Ce.decoder),Fe}function de(Be,Ce,Fe){var Ye;return BeTe.length?Te.length:Be;if(Ze===Te.length?Ue+=Te:Ue+=Te.slice(0,Be),Be-=Ze,Be===0){Ze===Te.length?(++Ye,Fe.next?Ce.head=Fe.next:Ce.head=Ce.tail=null):(Ce.head=Fe,Fe.data=Te.slice(Ze));break}++Ye}return Ce.length-=Ye,Ue}function xe(Be,Ce){var Fe=se.allocUnsafe(Be),Ye=Ce.head,Ue=1;for(Ye.data.copy(Fe),Be-=Ye.data.length;Ye=Ye.next;){var Te=Ye.data,Ze=Be>Te.length?Te.length:Be;if(Te.copy(Fe,Fe.length-Be,0,Ze),Be-=Ze,Be===0){Ze===Te.length?(++Ue,Ye.next?Ce.head=Ye.next:Ce.head=Ce.tail=null):(Ce.head=Ye,Ye.data=Te.slice(Ze));break}++Ue}return Ce.length-=Ue,Fe}function Pe(Be){var Ce=Be._readableState;if(Ce.length>0)throw new Error('"endReadable()" called on non-empty stream');Ce.endEmitted||(Ce.ended=!0,ae.nextTick(Le,Ce,Be))}function Le(Be,Ce){!Be.endEmitted&&Be.length===0&&(Be.endEmitted=!0,Ce.readable=!1,Ce.emit("end"))}function De(Be,Ce){for(var Fe=0,Ye=Be.length;Fe0?ne:fe},se.min=function(ne,fe){return ne.cmp(fe)<0?ne:fe},se.prototype._init=function(ne,fe,le){if(typeof ne=="number")return this._initNumber(ne,fe,le);if(typeof ne=="object")return this._initArray(ne,fe,le);fe==="hex"&&(fe=16),oe(fe===(fe|0)&&fe>=2&&fe<=36),ne=ne.toString().replace(/\s+/g,"");var ce=0;ne[0]==="-"&&(ce++,this.negative=1),ce=0;ce-=3)ue=ne[ce]|ne[ce-1]<<8|ne[ce-2]<<16,this.words[ve]|=ue<>>26-te&67108863,te+=24,te>=26&&(te-=26,ve++);else if(le==="le")for(ce=0,ve=0;ce>>26-te&67108863,te+=24,te>=26&&(te-=26,ve++);return this._strip()};function ge(re,ne){var fe=re.charCodeAt(ne);if(fe>=48&&fe<=57)return fe-48;if(fe>=65&&fe<=70)return fe-55;if(fe>=97&&fe<=102)return fe-87;oe(!1,"Invalid character in "+re)}function _e(re,ne,fe){var le=ge(re,fe);return fe-1>=ne&&(le|=ge(re,fe-1)<<4),le}se.prototype._parseHex=function(ne,fe,le){this.length=Math.ceil((ne.length-fe)/6),this.words=new Array(this.length);for(var ce=0;ce=fe;ce-=2)te=_e(ne,fe,ce)<=18?(ve-=18,ue+=1,this.words[ue]|=te>>>26):ve+=8;else{var de=ne.length-fe;for(ce=de%2===0?fe+1:fe;ce=18?(ve-=18,ue+=1,this.words[ue]|=te>>>26):ve+=8}this._strip()};function Ee(re,ne,fe,le){for(var ce=0,ve=0,ue=Math.min(re.length,fe),te=ne;te=49?ve=de-49+10:de>=17?ve=de-17+10:ve=de,oe(de>=0&&ve1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{se.prototype[Symbol.for("nodejs.util.inspect.custom")]=Me}catch{se.prototype.inspect=Me}else se.prototype.inspect=Me;function Me(){return(this.red?""}var $e=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],Re=[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],ke=[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];se.prototype.toString=function(ne,fe){ne=ne||10,fe=fe|0||1;var le;if(ne===16||ne==="hex"){le="";for(var ce=0,ve=0,ue=0;ue>>24-ce&16777215,ce+=2,ce>=26&&(ce-=26,ue--),ve!==0||ue!==this.length-1?le=$e[6-de.length]+de+le:le=de+le}for(ve!==0&&(le=ve.toString(16)+le);le.length%fe!==0;)le="0"+le;return this.negative!==0&&(le="-"+le),le}if(ne===(ne|0)&&ne>=2&&ne<=36){var ye=Re[ne],xe=ke[ne];le="";var Pe=this.clone();for(Pe.negative=0;!Pe.isZero();){var Le=Pe.modrn(xe).toString(ne);Pe=Pe.idivn(xe),Pe.isZero()?le=Le+le:le=$e[ye-Le.length]+Le+le}for(this.isZero()&&(le="0"+le);le.length%fe!==0;)le="0"+le;return this.negative!==0&&(le="-"+le),le}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ne=this.words[0];return this.length===2?ne+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ne+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ne:ne},se.prototype.toJSON=function(){return this.toString(16,2)},be&&(se.prototype.toBuffer=function(ne,fe){return this.toArrayLike(be,ne,fe)}),se.prototype.toArray=function(ne,fe){return this.toArrayLike(Array,ne,fe)};var Ne=function(ne,fe){return ne.allocUnsafe?ne.allocUnsafe(fe):new ne(fe)};se.prototype.toArrayLike=function(ne,fe,le){this._strip();var ce=this.byteLength(),ve=le||Math.max(1,ce);oe(ce<=ve,"byte array longer than desired length"),oe(ve>0,"Requested array length <= 0");var ue=Ne(ne,ve),te=fe==="le"?"LE":"BE";return this["_toArrayLike"+te](ue,ce),ue},se.prototype._toArrayLikeLE=function(ne,fe){for(var le=0,ce=0,ve=0,ue=0;ve>8&255),le>16&255),ue===6?(le>24&255),ce=0,ue=0):(ce=te>>>24,ue+=2)}if(le=0&&(ne[le--]=te>>8&255),le>=0&&(ne[le--]=te>>16&255),ue===6?(le>=0&&(ne[le--]=te>>24&255),ce=0,ue=0):(ce=te>>>24,ue+=2)}if(le>=0)for(ne[le--]=ce;le>=0;)ne[le--]=0},Math.clz32?se.prototype._countBits=function(ne){return 32-Math.clz32(ne)}:se.prototype._countBits=function(ne){var fe=ne,le=0;return fe>=4096&&(le+=13,fe>>>=13),fe>=64&&(le+=7,fe>>>=7),fe>=8&&(le+=4,fe>>>=4),fe>=2&&(le+=2,fe>>>=2),le+fe},se.prototype._zeroBits=function(ne){if(ne===0)return 26;var fe=ne,le=0;return fe&8191||(le+=13,fe>>>=13),fe&127||(le+=7,fe>>>=7),fe&15||(le+=4,fe>>>=4),fe&3||(le+=2,fe>>>=2),fe&1||le++,le},se.prototype.bitLength=function(){var ne=this.words[this.length-1],fe=this._countBits(ne);return(this.length-1)*26+fe};function ze(re){for(var ne=new Array(re.bitLength()),fe=0;fe>>ce&1}return ne}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ne=0,fe=0;fene.length?this.clone().ior(ne):ne.clone().ior(this)},se.prototype.uor=function(ne){return this.length>ne.length?this.clone().iuor(ne):ne.clone().iuor(this)},se.prototype.iuand=function(ne){var fe;this.length>ne.length?fe=ne:fe=this;for(var le=0;lene.length?this.clone().iand(ne):ne.clone().iand(this)},se.prototype.uand=function(ne){return this.length>ne.length?this.clone().iuand(ne):ne.clone().iuand(this)},se.prototype.iuxor=function(ne){var fe,le;this.length>ne.length?(fe=this,le=ne):(fe=ne,le=this);for(var ce=0;cene.length?this.clone().ixor(ne):ne.clone().ixor(this)},se.prototype.uxor=function(ne){return this.length>ne.length?this.clone().iuxor(ne):ne.clone().iuxor(this)},se.prototype.inotn=function(ne){oe(typeof ne=="number"&&ne>=0);var fe=Math.ceil(ne/26)|0,le=ne%26;this._expand(fe),le>0&&fe--;for(var ce=0;ce0&&(this.words[ce]=~this.words[ce]&67108863>>26-le),this._strip()},se.prototype.notn=function(ne){return this.clone().inotn(ne)},se.prototype.setn=function(ne,fe){oe(typeof ne=="number"&&ne>=0);var le=ne/26|0,ce=ne%26;return this._expand(le+1),fe?this.words[le]=this.words[le]|1<ne.length?(le=this,ce=ne):(le=ne,ce=this);for(var ve=0,ue=0;ue>>26;for(;ve!==0&&ue>>26;if(this.length=le.length,ve!==0)this.words[this.length]=ve,this.length++;else if(le!==this)for(;uene.length?this.clone().iadd(ne):ne.clone().iadd(this)},se.prototype.isub=function(ne){if(ne.negative!==0){ne.negative=0;var fe=this.iadd(ne);return ne.negative=1,fe._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ne),this.negative=1,this._normSign();var le=this.cmp(ne);if(le===0)return this.negative=0,this.length=1,this.words[0]=0,this;var ce,ve;le>0?(ce=this,ve=ne):(ce=ne,ve=this);for(var ue=0,te=0;te>26,this.words[te]=fe&67108863;for(;ue!==0&&te>26,this.words[te]=fe&67108863;if(ue===0&&te>>26,Pe=de&67108863,Le=Math.min(ye,ne.length-1),De=Math.max(0,ye-re.length+1);De<=Le;De++){var Be=ye-De|0;ce=re.words[Be]|0,ve=ne.words[De]|0,ue=ce*ve+Pe,xe+=ue/67108864|0,Pe=ue&67108863}fe.words[ye]=Pe|0,de=xe|0}return de!==0?fe.words[ye]=de|0:fe.length--,fe._strip()}var qe=function(ne,fe,le){var ce=ne.words,ve=fe.words,ue=le.words,te=0,de,ye,xe,Pe=ce[0]|0,Le=Pe&8191,De=Pe>>>13,Be=ce[1]|0,Ce=Be&8191,Fe=Be>>>13,Ye=ce[2]|0,Ue=Ye&8191,Te=Ye>>>13,Ze=ce[3]|0,Nt=Ze&8191,Qe=Ze>>>13,ut=ce[4]|0,Ft=ut&8191,pt=ut>>>13,Je=ce[5]|0,zt=Je&8191,bt=Je>>>13,gt=ce[6]|0,Ht=gt&8191,vt=gt>>>13,Rt=ce[7]|0,Kt=Rt&8191,yt=Rt>>>13,It=ce[8]|0,Yt=It&8191,_t=It>>>13,Dt=ce[9]|0,Qt=Dt&8191,xt=Dt>>>13,Tt=ve[0]|0,Wt=Tt&8191,St=Tt>>>13,Ct=ve[1]|0,Vt=Ct&8191,Et=Ct>>>13,Ot=ve[2]|0,Xt=Ot&8191,wt=Ot>>>13,Pt=ve[3]|0,Jt=Pt&8191,$t=Pt>>>13,kt=ve[4]|0,er=kt&8191,Ie=kt>>>13,Se=ve[5]|0,Ae=Se&8191,Oe=Se>>>13,Ke=ve[6]|0,at=Ke&8191,Ve=Ke>>>13,ct=ve[7]|0,jt=ct&8191,dt=ct>>>13,Mt=ve[8]|0,Ut=Mt&8191,Bt=Mt>>>13,qt=ve[9]|0,Gt=qt&8191,Zt=qt>>>13;le.negative=ne.negative^fe.negative,le.length=19,de=Math.imul(Le,Wt),ye=Math.imul(Le,St),ye=ye+Math.imul(De,Wt)|0,xe=Math.imul(De,St);var tr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(tr>>>26)|0,tr&=67108863,de=Math.imul(Ce,Wt),ye=Math.imul(Ce,St),ye=ye+Math.imul(Fe,Wt)|0,xe=Math.imul(Fe,St),de=de+Math.imul(Le,Vt)|0,ye=ye+Math.imul(Le,Et)|0,ye=ye+Math.imul(De,Vt)|0,xe=xe+Math.imul(De,Et)|0;var rr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(rr>>>26)|0,rr&=67108863,de=Math.imul(Ue,Wt),ye=Math.imul(Ue,St),ye=ye+Math.imul(Te,Wt)|0,xe=Math.imul(Te,St),de=de+Math.imul(Ce,Vt)|0,ye=ye+Math.imul(Ce,Et)|0,ye=ye+Math.imul(Fe,Vt)|0,xe=xe+Math.imul(Fe,Et)|0,de=de+Math.imul(Le,Xt)|0,ye=ye+Math.imul(Le,wt)|0,ye=ye+Math.imul(De,Xt)|0,xe=xe+Math.imul(De,wt)|0;var ir=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(ir>>>26)|0,ir&=67108863,de=Math.imul(Nt,Wt),ye=Math.imul(Nt,St),ye=ye+Math.imul(Qe,Wt)|0,xe=Math.imul(Qe,St),de=de+Math.imul(Ue,Vt)|0,ye=ye+Math.imul(Ue,Et)|0,ye=ye+Math.imul(Te,Vt)|0,xe=xe+Math.imul(Te,Et)|0,de=de+Math.imul(Ce,Xt)|0,ye=ye+Math.imul(Ce,wt)|0,ye=ye+Math.imul(Fe,Xt)|0,xe=xe+Math.imul(Fe,wt)|0,de=de+Math.imul(Le,Jt)|0,ye=ye+Math.imul(Le,$t)|0,ye=ye+Math.imul(De,Jt)|0,xe=xe+Math.imul(De,$t)|0;var nr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(nr>>>26)|0,nr&=67108863,de=Math.imul(Ft,Wt),ye=Math.imul(Ft,St),ye=ye+Math.imul(pt,Wt)|0,xe=Math.imul(pt,St),de=de+Math.imul(Nt,Vt)|0,ye=ye+Math.imul(Nt,Et)|0,ye=ye+Math.imul(Qe,Vt)|0,xe=xe+Math.imul(Qe,Et)|0,de=de+Math.imul(Ue,Xt)|0,ye=ye+Math.imul(Ue,wt)|0,ye=ye+Math.imul(Te,Xt)|0,xe=xe+Math.imul(Te,wt)|0,de=de+Math.imul(Ce,Jt)|0,ye=ye+Math.imul(Ce,$t)|0,ye=ye+Math.imul(Fe,Jt)|0,xe=xe+Math.imul(Fe,$t)|0,de=de+Math.imul(Le,er)|0,ye=ye+Math.imul(Le,Ie)|0,ye=ye+Math.imul(De,er)|0,xe=xe+Math.imul(De,Ie)|0;var ar=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(ar>>>26)|0,ar&=67108863,de=Math.imul(zt,Wt),ye=Math.imul(zt,St),ye=ye+Math.imul(bt,Wt)|0,xe=Math.imul(bt,St),de=de+Math.imul(Ft,Vt)|0,ye=ye+Math.imul(Ft,Et)|0,ye=ye+Math.imul(pt,Vt)|0,xe=xe+Math.imul(pt,Et)|0,de=de+Math.imul(Nt,Xt)|0,ye=ye+Math.imul(Nt,wt)|0,ye=ye+Math.imul(Qe,Xt)|0,xe=xe+Math.imul(Qe,wt)|0,de=de+Math.imul(Ue,Jt)|0,ye=ye+Math.imul(Ue,$t)|0,ye=ye+Math.imul(Te,Jt)|0,xe=xe+Math.imul(Te,$t)|0,de=de+Math.imul(Ce,er)|0,ye=ye+Math.imul(Ce,Ie)|0,ye=ye+Math.imul(Fe,er)|0,xe=xe+Math.imul(Fe,Ie)|0,de=de+Math.imul(Le,Ae)|0,ye=ye+Math.imul(Le,Oe)|0,ye=ye+Math.imul(De,Ae)|0,xe=xe+Math.imul(De,Oe)|0;var fr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(fr>>>26)|0,fr&=67108863,de=Math.imul(Ht,Wt),ye=Math.imul(Ht,St),ye=ye+Math.imul(vt,Wt)|0,xe=Math.imul(vt,St),de=de+Math.imul(zt,Vt)|0,ye=ye+Math.imul(zt,Et)|0,ye=ye+Math.imul(bt,Vt)|0,xe=xe+Math.imul(bt,Et)|0,de=de+Math.imul(Ft,Xt)|0,ye=ye+Math.imul(Ft,wt)|0,ye=ye+Math.imul(pt,Xt)|0,xe=xe+Math.imul(pt,wt)|0,de=de+Math.imul(Nt,Jt)|0,ye=ye+Math.imul(Nt,$t)|0,ye=ye+Math.imul(Qe,Jt)|0,xe=xe+Math.imul(Qe,$t)|0,de=de+Math.imul(Ue,er)|0,ye=ye+Math.imul(Ue,Ie)|0,ye=ye+Math.imul(Te,er)|0,xe=xe+Math.imul(Te,Ie)|0,de=de+Math.imul(Ce,Ae)|0,ye=ye+Math.imul(Ce,Oe)|0,ye=ye+Math.imul(Fe,Ae)|0,xe=xe+Math.imul(Fe,Oe)|0,de=de+Math.imul(Le,at)|0,ye=ye+Math.imul(Le,Ve)|0,ye=ye+Math.imul(De,at)|0,xe=xe+Math.imul(De,Ve)|0;var or=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(or>>>26)|0,or&=67108863,de=Math.imul(Kt,Wt),ye=Math.imul(Kt,St),ye=ye+Math.imul(yt,Wt)|0,xe=Math.imul(yt,St),de=de+Math.imul(Ht,Vt)|0,ye=ye+Math.imul(Ht,Et)|0,ye=ye+Math.imul(vt,Vt)|0,xe=xe+Math.imul(vt,Et)|0,de=de+Math.imul(zt,Xt)|0,ye=ye+Math.imul(zt,wt)|0,ye=ye+Math.imul(bt,Xt)|0,xe=xe+Math.imul(bt,wt)|0,de=de+Math.imul(Ft,Jt)|0,ye=ye+Math.imul(Ft,$t)|0,ye=ye+Math.imul(pt,Jt)|0,xe=xe+Math.imul(pt,$t)|0,de=de+Math.imul(Nt,er)|0,ye=ye+Math.imul(Nt,Ie)|0,ye=ye+Math.imul(Qe,er)|0,xe=xe+Math.imul(Qe,Ie)|0,de=de+Math.imul(Ue,Ae)|0,ye=ye+Math.imul(Ue,Oe)|0,ye=ye+Math.imul(Te,Ae)|0,xe=xe+Math.imul(Te,Oe)|0,de=de+Math.imul(Ce,at)|0,ye=ye+Math.imul(Ce,Ve)|0,ye=ye+Math.imul(Fe,at)|0,xe=xe+Math.imul(Fe,Ve)|0,de=de+Math.imul(Le,jt)|0,ye=ye+Math.imul(Le,dt)|0,ye=ye+Math.imul(De,jt)|0,xe=xe+Math.imul(De,dt)|0;var ur=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(ur>>>26)|0,ur&=67108863,de=Math.imul(Yt,Wt),ye=Math.imul(Yt,St),ye=ye+Math.imul(_t,Wt)|0,xe=Math.imul(_t,St),de=de+Math.imul(Kt,Vt)|0,ye=ye+Math.imul(Kt,Et)|0,ye=ye+Math.imul(yt,Vt)|0,xe=xe+Math.imul(yt,Et)|0,de=de+Math.imul(Ht,Xt)|0,ye=ye+Math.imul(Ht,wt)|0,ye=ye+Math.imul(vt,Xt)|0,xe=xe+Math.imul(vt,wt)|0,de=de+Math.imul(zt,Jt)|0,ye=ye+Math.imul(zt,$t)|0,ye=ye+Math.imul(bt,Jt)|0,xe=xe+Math.imul(bt,$t)|0,de=de+Math.imul(Ft,er)|0,ye=ye+Math.imul(Ft,Ie)|0,ye=ye+Math.imul(pt,er)|0,xe=xe+Math.imul(pt,Ie)|0,de=de+Math.imul(Nt,Ae)|0,ye=ye+Math.imul(Nt,Oe)|0,ye=ye+Math.imul(Qe,Ae)|0,xe=xe+Math.imul(Qe,Oe)|0,de=de+Math.imul(Ue,at)|0,ye=ye+Math.imul(Ue,Ve)|0,ye=ye+Math.imul(Te,at)|0,xe=xe+Math.imul(Te,Ve)|0,de=de+Math.imul(Ce,jt)|0,ye=ye+Math.imul(Ce,dt)|0,ye=ye+Math.imul(Fe,jt)|0,xe=xe+Math.imul(Fe,dt)|0,de=de+Math.imul(Le,Ut)|0,ye=ye+Math.imul(Le,Bt)|0,ye=ye+Math.imul(De,Ut)|0,xe=xe+Math.imul(De,Bt)|0;var lr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(lr>>>26)|0,lr&=67108863,de=Math.imul(Qt,Wt),ye=Math.imul(Qt,St),ye=ye+Math.imul(xt,Wt)|0,xe=Math.imul(xt,St),de=de+Math.imul(Yt,Vt)|0,ye=ye+Math.imul(Yt,Et)|0,ye=ye+Math.imul(_t,Vt)|0,xe=xe+Math.imul(_t,Et)|0,de=de+Math.imul(Kt,Xt)|0,ye=ye+Math.imul(Kt,wt)|0,ye=ye+Math.imul(yt,Xt)|0,xe=xe+Math.imul(yt,wt)|0,de=de+Math.imul(Ht,Jt)|0,ye=ye+Math.imul(Ht,$t)|0,ye=ye+Math.imul(vt,Jt)|0,xe=xe+Math.imul(vt,$t)|0,de=de+Math.imul(zt,er)|0,ye=ye+Math.imul(zt,Ie)|0,ye=ye+Math.imul(bt,er)|0,xe=xe+Math.imul(bt,Ie)|0,de=de+Math.imul(Ft,Ae)|0,ye=ye+Math.imul(Ft,Oe)|0,ye=ye+Math.imul(pt,Ae)|0,xe=xe+Math.imul(pt,Oe)|0,de=de+Math.imul(Nt,at)|0,ye=ye+Math.imul(Nt,Ve)|0,ye=ye+Math.imul(Qe,at)|0,xe=xe+Math.imul(Qe,Ve)|0,de=de+Math.imul(Ue,jt)|0,ye=ye+Math.imul(Ue,dt)|0,ye=ye+Math.imul(Te,jt)|0,xe=xe+Math.imul(Te,dt)|0,de=de+Math.imul(Ce,Ut)|0,ye=ye+Math.imul(Ce,Bt)|0,ye=ye+Math.imul(Fe,Ut)|0,xe=xe+Math.imul(Fe,Bt)|0,de=de+Math.imul(Le,Gt)|0,ye=ye+Math.imul(Le,Zt)|0,ye=ye+Math.imul(De,Gt)|0,xe=xe+Math.imul(De,Zt)|0;var dr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(dr>>>26)|0,dr&=67108863,de=Math.imul(Qt,Vt),ye=Math.imul(Qt,Et),ye=ye+Math.imul(xt,Vt)|0,xe=Math.imul(xt,Et),de=de+Math.imul(Yt,Xt)|0,ye=ye+Math.imul(Yt,wt)|0,ye=ye+Math.imul(_t,Xt)|0,xe=xe+Math.imul(_t,wt)|0,de=de+Math.imul(Kt,Jt)|0,ye=ye+Math.imul(Kt,$t)|0,ye=ye+Math.imul(yt,Jt)|0,xe=xe+Math.imul(yt,$t)|0,de=de+Math.imul(Ht,er)|0,ye=ye+Math.imul(Ht,Ie)|0,ye=ye+Math.imul(vt,er)|0,xe=xe+Math.imul(vt,Ie)|0,de=de+Math.imul(zt,Ae)|0,ye=ye+Math.imul(zt,Oe)|0,ye=ye+Math.imul(bt,Ae)|0,xe=xe+Math.imul(bt,Oe)|0,de=de+Math.imul(Ft,at)|0,ye=ye+Math.imul(Ft,Ve)|0,ye=ye+Math.imul(pt,at)|0,xe=xe+Math.imul(pt,Ve)|0,de=de+Math.imul(Nt,jt)|0,ye=ye+Math.imul(Nt,dt)|0,ye=ye+Math.imul(Qe,jt)|0,xe=xe+Math.imul(Qe,dt)|0,de=de+Math.imul(Ue,Ut)|0,ye=ye+Math.imul(Ue,Bt)|0,ye=ye+Math.imul(Te,Ut)|0,xe=xe+Math.imul(Te,Bt)|0,de=de+Math.imul(Ce,Gt)|0,ye=ye+Math.imul(Ce,Zt)|0,ye=ye+Math.imul(Fe,Gt)|0,xe=xe+Math.imul(Fe,Zt)|0;var cr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(cr>>>26)|0,cr&=67108863,de=Math.imul(Qt,Xt),ye=Math.imul(Qt,wt),ye=ye+Math.imul(xt,Xt)|0,xe=Math.imul(xt,wt),de=de+Math.imul(Yt,Jt)|0,ye=ye+Math.imul(Yt,$t)|0,ye=ye+Math.imul(_t,Jt)|0,xe=xe+Math.imul(_t,$t)|0,de=de+Math.imul(Kt,er)|0,ye=ye+Math.imul(Kt,Ie)|0,ye=ye+Math.imul(yt,er)|0,xe=xe+Math.imul(yt,Ie)|0,de=de+Math.imul(Ht,Ae)|0,ye=ye+Math.imul(Ht,Oe)|0,ye=ye+Math.imul(vt,Ae)|0,xe=xe+Math.imul(vt,Oe)|0,de=de+Math.imul(zt,at)|0,ye=ye+Math.imul(zt,Ve)|0,ye=ye+Math.imul(bt,at)|0,xe=xe+Math.imul(bt,Ve)|0,de=de+Math.imul(Ft,jt)|0,ye=ye+Math.imul(Ft,dt)|0,ye=ye+Math.imul(pt,jt)|0,xe=xe+Math.imul(pt,dt)|0,de=de+Math.imul(Nt,Ut)|0,ye=ye+Math.imul(Nt,Bt)|0,ye=ye+Math.imul(Qe,Ut)|0,xe=xe+Math.imul(Qe,Bt)|0,de=de+Math.imul(Ue,Gt)|0,ye=ye+Math.imul(Ue,Zt)|0,ye=ye+Math.imul(Te,Gt)|0,xe=xe+Math.imul(Te,Zt)|0;var pr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(pr>>>26)|0,pr&=67108863,de=Math.imul(Qt,Jt),ye=Math.imul(Qt,$t),ye=ye+Math.imul(xt,Jt)|0,xe=Math.imul(xt,$t),de=de+Math.imul(Yt,er)|0,ye=ye+Math.imul(Yt,Ie)|0,ye=ye+Math.imul(_t,er)|0,xe=xe+Math.imul(_t,Ie)|0,de=de+Math.imul(Kt,Ae)|0,ye=ye+Math.imul(Kt,Oe)|0,ye=ye+Math.imul(yt,Ae)|0,xe=xe+Math.imul(yt,Oe)|0,de=de+Math.imul(Ht,at)|0,ye=ye+Math.imul(Ht,Ve)|0,ye=ye+Math.imul(vt,at)|0,xe=xe+Math.imul(vt,Ve)|0,de=de+Math.imul(zt,jt)|0,ye=ye+Math.imul(zt,dt)|0,ye=ye+Math.imul(bt,jt)|0,xe=xe+Math.imul(bt,dt)|0,de=de+Math.imul(Ft,Ut)|0,ye=ye+Math.imul(Ft,Bt)|0,ye=ye+Math.imul(pt,Ut)|0,xe=xe+Math.imul(pt,Bt)|0,de=de+Math.imul(Nt,Gt)|0,ye=ye+Math.imul(Nt,Zt)|0,ye=ye+Math.imul(Qe,Gt)|0,xe=xe+Math.imul(Qe,Zt)|0;var vr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(vr>>>26)|0,vr&=67108863,de=Math.imul(Qt,er),ye=Math.imul(Qt,Ie),ye=ye+Math.imul(xt,er)|0,xe=Math.imul(xt,Ie),de=de+Math.imul(Yt,Ae)|0,ye=ye+Math.imul(Yt,Oe)|0,ye=ye+Math.imul(_t,Ae)|0,xe=xe+Math.imul(_t,Oe)|0,de=de+Math.imul(Kt,at)|0,ye=ye+Math.imul(Kt,Ve)|0,ye=ye+Math.imul(yt,at)|0,xe=xe+Math.imul(yt,Ve)|0,de=de+Math.imul(Ht,jt)|0,ye=ye+Math.imul(Ht,dt)|0,ye=ye+Math.imul(vt,jt)|0,xe=xe+Math.imul(vt,dt)|0,de=de+Math.imul(zt,Ut)|0,ye=ye+Math.imul(zt,Bt)|0,ye=ye+Math.imul(bt,Ut)|0,xe=xe+Math.imul(bt,Bt)|0,de=de+Math.imul(Ft,Gt)|0,ye=ye+Math.imul(Ft,Zt)|0,ye=ye+Math.imul(pt,Gt)|0,xe=xe+Math.imul(pt,Zt)|0;var yr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(yr>>>26)|0,yr&=67108863,de=Math.imul(Qt,Ae),ye=Math.imul(Qt,Oe),ye=ye+Math.imul(xt,Ae)|0,xe=Math.imul(xt,Oe),de=de+Math.imul(Yt,at)|0,ye=ye+Math.imul(Yt,Ve)|0,ye=ye+Math.imul(_t,at)|0,xe=xe+Math.imul(_t,Ve)|0,de=de+Math.imul(Kt,jt)|0,ye=ye+Math.imul(Kt,dt)|0,ye=ye+Math.imul(yt,jt)|0,xe=xe+Math.imul(yt,dt)|0,de=de+Math.imul(Ht,Ut)|0,ye=ye+Math.imul(Ht,Bt)|0,ye=ye+Math.imul(vt,Ut)|0,xe=xe+Math.imul(vt,Bt)|0,de=de+Math.imul(zt,Gt)|0,ye=ye+Math.imul(zt,Zt)|0,ye=ye+Math.imul(bt,Gt)|0,xe=xe+Math.imul(bt,Zt)|0;var br=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(br>>>26)|0,br&=67108863,de=Math.imul(Qt,at),ye=Math.imul(Qt,Ve),ye=ye+Math.imul(xt,at)|0,xe=Math.imul(xt,Ve),de=de+Math.imul(Yt,jt)|0,ye=ye+Math.imul(Yt,dt)|0,ye=ye+Math.imul(_t,jt)|0,xe=xe+Math.imul(_t,dt)|0,de=de+Math.imul(Kt,Ut)|0,ye=ye+Math.imul(Kt,Bt)|0,ye=ye+Math.imul(yt,Ut)|0,xe=xe+Math.imul(yt,Bt)|0,de=de+Math.imul(Ht,Gt)|0,ye=ye+Math.imul(Ht,Zt)|0,ye=ye+Math.imul(vt,Gt)|0,xe=xe+Math.imul(vt,Zt)|0;var gr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(gr>>>26)|0,gr&=67108863,de=Math.imul(Qt,jt),ye=Math.imul(Qt,dt),ye=ye+Math.imul(xt,jt)|0,xe=Math.imul(xt,dt),de=de+Math.imul(Yt,Ut)|0,ye=ye+Math.imul(Yt,Bt)|0,ye=ye+Math.imul(_t,Ut)|0,xe=xe+Math.imul(_t,Bt)|0,de=de+Math.imul(Kt,Gt)|0,ye=ye+Math.imul(Kt,Zt)|0,ye=ye+Math.imul(yt,Gt)|0,xe=xe+Math.imul(yt,Zt)|0;var wr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(wr>>>26)|0,wr&=67108863,de=Math.imul(Qt,Ut),ye=Math.imul(Qt,Bt),ye=ye+Math.imul(xt,Ut)|0,xe=Math.imul(xt,Bt),de=de+Math.imul(Yt,Gt)|0,ye=ye+Math.imul(Yt,Zt)|0,ye=ye+Math.imul(_t,Gt)|0,xe=xe+Math.imul(_t,Zt)|0;var xr=(te+de|0)+((ye&8191)<<13)|0;te=(xe+(ye>>>13)|0)+(xr>>>26)|0,xr&=67108863,de=Math.imul(Qt,Gt),ye=Math.imul(Qt,Zt),ye=ye+Math.imul(xt,Gt)|0,xe=Math.imul(xt,Zt);var Sr=(te+de|0)+((ye&8191)<<13)|0;return te=(xe+(ye>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,ue[0]=tr,ue[1]=rr,ue[2]=ir,ue[3]=nr,ue[4]=ar,ue[5]=fr,ue[6]=or,ue[7]=ur,ue[8]=lr,ue[9]=dr,ue[10]=cr,ue[11]=pr,ue[12]=vr,ue[13]=yr,ue[14]=br,ue[15]=gr,ue[16]=wr,ue[17]=xr,ue[18]=Sr,te!==0&&(ue[19]=te,le.length++),le};Math.imul||(qe=He);function We(re,ne,fe){fe.negative=ne.negative^re.negative,fe.length=re.length+ne.length;for(var le=0,ce=0,ve=0;ve>>26)|0,ce+=ue>>>26,ue&=67108863}fe.words[ve]=te,le=ue,ue=ce}return le!==0?fe.words[ve]=le:fe.length--,fe._strip()}function je(re,ne,fe){return We(re,ne,fe)}se.prototype.mulTo=function(ne,fe){var le,ce=this.length+ne.length;return this.length===10&&ne.length===10?le=qe(this,ne,fe):ce<63?le=He(this,ne,fe):ce<1024?le=We(this,ne,fe):le=je(this,ne,fe),le},se.prototype.mul=function(ne){var fe=new se(null);return fe.words=new Array(this.length+ne.length),this.mulTo(ne,fe)},se.prototype.mulf=function(ne){var fe=new se(null);return fe.words=new Array(this.length+ne.length),je(this,ne,fe)},se.prototype.imul=function(ne){return this.clone().mulTo(ne,this)},se.prototype.imuln=function(ne){var fe=ne<0;fe&&(ne=-ne),oe(typeof ne=="number"),oe(ne<67108864);for(var le=0,ce=0;ce>=26,le+=ve/67108864|0,le+=ue>>>26,this.words[ce]=ue&67108863}return le!==0&&(this.words[ce]=le,this.length++),fe?this.ineg():this},se.prototype.muln=function(ne){return this.clone().imuln(ne)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ne){var fe=ze(ne);if(fe.length===0)return new se(1);for(var le=this,ce=0;ce=0);var fe=ne%26,le=(ne-fe)/26,ce=67108863>>>26-fe<<26-fe,ve;if(fe!==0){var ue=0;for(ve=0;ve>>26-fe}ue&&(this.words[ve]=ue,this.length++)}if(le!==0){for(ve=this.length-1;ve>=0;ve--)this.words[ve+le]=this.words[ve];for(ve=0;ve=0);var ce;fe?ce=(fe-fe%26)/26:ce=0;var ve=ne%26,ue=Math.min((ne-ve)/26,this.length),te=67108863^67108863>>>ve<ue)for(this.length-=ue,ye=0;ye=0&&(xe!==0||ye>=ce);ye--){var Pe=this.words[ye]|0;this.words[ye]=xe<<26-ve|Pe>>>ve,xe=Pe&te}return de&&xe!==0&&(de.words[de.length++]=xe),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},se.prototype.ishrn=function(ne,fe,le){return oe(this.negative===0),this.iushrn(ne,fe,le)},se.prototype.shln=function(ne){return this.clone().ishln(ne)},se.prototype.ushln=function(ne){return this.clone().iushln(ne)},se.prototype.shrn=function(ne){return this.clone().ishrn(ne)},se.prototype.ushrn=function(ne){return this.clone().iushrn(ne)},se.prototype.testn=function(ne){oe(typeof ne=="number"&&ne>=0);var fe=ne%26,le=(ne-fe)/26,ce=1<=0);var fe=ne%26,le=(ne-fe)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=le)return this;if(fe!==0&&le++,this.length=Math.min(le,this.length),fe!==0){var ce=67108863^67108863>>>fe<=67108864;fe++)this.words[fe]-=67108864,fe===this.length-1?this.words[fe+1]=1:this.words[fe+1]++;return this.length=Math.max(this.length,fe+1),this},se.prototype.isubn=function(ne){if(oe(typeof ne=="number"),oe(ne<67108864),ne<0)return this.iaddn(-ne);if(this.negative!==0)return this.negative=0,this.iaddn(ne),this.negative=1,this;if(this.words[0]-=ne,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var fe=0;fe>26)-(de/67108864|0),this.words[ve+le]=ue&67108863}for(;ve>26,this.words[ve+le]=ue&67108863;if(te===0)return this._strip();for(oe(te===-1),te=0,ve=0;ve>26,this.words[ve]=ue&67108863;return this.negative=1,this._strip()},se.prototype._wordDiv=function(ne,fe){var le=this.length-ne.length,ce=this.clone(),ve=ne,ue=ve.words[ve.length-1]|0,te=this._countBits(ue);le=26-te,le!==0&&(ve=ve.ushln(le),ce.iushln(le),ue=ve.words[ve.length-1]|0);var de=ce.length-ve.length,ye;if(fe!=="mod"){ye=new se(null),ye.length=de+1,ye.words=new Array(ye.length);for(var xe=0;xe=0;Le--){var De=(ce.words[ve.length+Le]|0)*67108864+(ce.words[ve.length+Le-1]|0);for(De=Math.min(De/ue|0,67108863),ce._ishlnsubmul(ve,De,Le);ce.negative!==0;)De--,ce.negative=0,ce._ishlnsubmul(ve,1,Le),ce.isZero()||(ce.negative^=1);ye&&(ye.words[Le]=De)}return ye&&ye._strip(),ce._strip(),fe!=="div"&&le!==0&&ce.iushrn(le),{div:ye||null,mod:ce}},se.prototype.divmod=function(ne,fe,le){if(oe(!ne.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var ce,ve,ue;return this.negative!==0&&ne.negative===0?(ue=this.neg().divmod(ne,fe),fe!=="mod"&&(ce=ue.div.neg()),fe!=="div"&&(ve=ue.mod.neg(),le&&ve.negative!==0&&ve.iadd(ne)),{div:ce,mod:ve}):this.negative===0&&ne.negative!==0?(ue=this.divmod(ne.neg(),fe),fe!=="mod"&&(ce=ue.div.neg()),{div:ce,mod:ue.mod}):this.negative&ne.negative?(ue=this.neg().divmod(ne.neg(),fe),fe!=="div"&&(ve=ue.mod.neg(),le&&ve.negative!==0&&ve.isub(ne)),{div:ue.div,mod:ve}):ne.length>this.length||this.cmp(ne)<0?{div:new se(0),mod:this}:ne.length===1?fe==="div"?{div:this.divn(ne.words[0]),mod:null}:fe==="mod"?{div:null,mod:new se(this.modrn(ne.words[0]))}:{div:this.divn(ne.words[0]),mod:new se(this.modrn(ne.words[0]))}:this._wordDiv(ne,fe)},se.prototype.div=function(ne){return this.divmod(ne,"div",!1).div},se.prototype.mod=function(ne){return this.divmod(ne,"mod",!1).mod},se.prototype.umod=function(ne){return this.divmod(ne,"mod",!0).mod},se.prototype.divRound=function(ne){var fe=this.divmod(ne);if(fe.mod.isZero())return fe.div;var le=fe.div.negative!==0?fe.mod.isub(ne):fe.mod,ce=ne.ushrn(1),ve=ne.andln(1),ue=le.cmp(ce);return ue<0||ve===1&&ue===0?fe.div:fe.div.negative!==0?fe.div.isubn(1):fe.div.iaddn(1)},se.prototype.modrn=function(ne){var fe=ne<0;fe&&(ne=-ne),oe(ne<=67108863);for(var le=(1<<26)%ne,ce=0,ve=this.length-1;ve>=0;ve--)ce=(le*ce+(this.words[ve]|0))%ne;return fe?-ce:ce},se.prototype.modn=function(ne){return this.modrn(ne)},se.prototype.idivn=function(ne){var fe=ne<0;fe&&(ne=-ne),oe(ne<=67108863);for(var le=0,ce=this.length-1;ce>=0;ce--){var ve=(this.words[ce]|0)+le*67108864;this.words[ce]=ve/ne|0,le=ve%ne}return this._strip(),fe?this.ineg():this},se.prototype.divn=function(ne){return this.clone().idivn(ne)},se.prototype.egcd=function(ne){oe(ne.negative===0),oe(!ne.isZero());var fe=this,le=ne.clone();fe.negative!==0?fe=fe.umod(ne):fe=fe.clone();for(var ce=new se(1),ve=new se(0),ue=new se(0),te=new se(1),de=0;fe.isEven()&&le.isEven();)fe.iushrn(1),le.iushrn(1),++de;for(var ye=le.clone(),xe=fe.clone();!fe.isZero();){for(var Pe=0,Le=1;!(fe.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(fe.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(ye),ve.isub(xe)),ce.iushrn(1),ve.iushrn(1);for(var De=0,Be=1;!(le.words[0]&Be)&&De<26;++De,Be<<=1);if(De>0)for(le.iushrn(De);De-- >0;)(ue.isOdd()||te.isOdd())&&(ue.iadd(ye),te.isub(xe)),ue.iushrn(1),te.iushrn(1);fe.cmp(le)>=0?(fe.isub(le),ce.isub(ue),ve.isub(te)):(le.isub(fe),ue.isub(ce),te.isub(ve))}return{a:ue,b:te,gcd:le.iushln(de)}},se.prototype._invmp=function(ne){oe(ne.negative===0),oe(!ne.isZero());var fe=this,le=ne.clone();fe.negative!==0?fe=fe.umod(ne):fe=fe.clone();for(var ce=new se(1),ve=new se(0),ue=le.clone();fe.cmpn(1)>0&&le.cmpn(1)>0;){for(var te=0,de=1;!(fe.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(fe.iushrn(te);te-- >0;)ce.isOdd()&&ce.iadd(ue),ce.iushrn(1);for(var ye=0,xe=1;!(le.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(le.iushrn(ye);ye-- >0;)ve.isOdd()&&ve.iadd(ue),ve.iushrn(1);fe.cmp(le)>=0?(fe.isub(le),ce.isub(ve)):(le.isub(fe),ve.isub(ce))}var Pe;return fe.cmpn(1)===0?Pe=ce:Pe=ve,Pe.cmpn(0)<0&&Pe.iadd(ne),Pe},se.prototype.gcd=function(ne){if(this.isZero())return ne.abs();if(ne.isZero())return this.abs();var fe=this.clone(),le=ne.clone();fe.negative=0,le.negative=0;for(var ce=0;fe.isEven()&&le.isEven();ce++)fe.iushrn(1),le.iushrn(1);do{for(;fe.isEven();)fe.iushrn(1);for(;le.isEven();)le.iushrn(1);var ve=fe.cmp(le);if(ve<0){var ue=fe;fe=le,le=ue}else if(ve===0||le.cmpn(1)===0)break;fe.isub(le)}while(!0);return le.iushln(ce)},se.prototype.invm=function(ne){return this.egcd(ne).a.umod(ne)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ne){return this.words[0]&ne},se.prototype.bincn=function(ne){oe(typeof ne=="number");var fe=ne%26,le=(ne-fe)/26,ce=1<>>26,te&=67108863,this.words[ue]=te}return ve!==0&&(this.words[ue]=ve,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ne){var fe=ne<0;if(this.negative!==0&&!fe)return-1;if(this.negative===0&&fe)return 1;this._strip();var le;if(this.length>1)le=1;else{fe&&(ne=-ne),oe(ne<=67108863,"Number is too big");var ce=this.words[0]|0;le=ce===ne?0:cene.length)return 1;if(this.length=0;le--){var ce=this.words[le]|0,ve=ne.words[le]|0;if(ce!==ve){ceve&&(fe=1);break}}return fe},se.prototype.gtn=function(ne){return this.cmpn(ne)===1},se.prototype.gt=function(ne){return this.cmp(ne)===1},se.prototype.gten=function(ne){return this.cmpn(ne)>=0},se.prototype.gte=function(ne){return this.cmp(ne)>=0},se.prototype.ltn=function(ne){return this.cmpn(ne)===-1},se.prototype.lt=function(ne){return this.cmp(ne)===-1},se.prototype.lten=function(ne){return this.cmpn(ne)<=0},se.prototype.lte=function(ne){return this.cmp(ne)<=0},se.prototype.eqn=function(ne){return this.cmpn(ne)===0},se.prototype.eq=function(ne){return this.cmp(ne)===0},se.red=function(ne){return new me(ne)},se.prototype.toRed=function(ne){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ne.convertTo(this)._forceRed(ne)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ne){return this.red=ne,this},se.prototype.forceRed=function(ne){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ne)},se.prototype.redAdd=function(ne){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ne)},se.prototype.redIAdd=function(ne){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ne)},se.prototype.redSub=function(ne){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ne)},se.prototype.redISub=function(ne){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ne)},se.prototype.redShl=function(ne){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ne)},se.prototype.redMul=function(ne){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ne),this.red.mul(this,ne)},se.prototype.redIMul=function(ne){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ne),this.red.imul(this,ne)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ne){return oe(this.red&&!ne.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ne)};var Xe={k256:null,p224:null,p192:null,p25519:null};function lt(re,ne){this.name=re,this.p=new se(ne,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}lt.prototype._tmp=function(){var ne=new se(null);return ne.words=new Array(Math.ceil(this.n/13)),ne},lt.prototype.ireduce=function(ne){var fe=ne,le;do this.split(fe,this.tmp),fe=this.imulK(fe),fe=fe.iadd(this.tmp),le=fe.bitLength();while(le>this.n);var ce=le0?fe.isub(this.p):fe.strip!==void 0?fe.strip():fe._strip(),fe},lt.prototype.split=function(ne,fe){ne.iushrn(this.n,0,fe)},lt.prototype.imulK=function(ne){return ne.imul(this.k)};function At(){lt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(At,lt),At.prototype.split=function(ne,fe){for(var le=4194303,ce=Math.min(ne.length,9),ve=0;ve>>22,ue=te}ue>>>=22,ne.words[ve-10]=ue,ue===0&&ne.length>10?ne.length-=10:ne.length-=9},At.prototype.imulK=function(ne){ne.words[ne.length]=0,ne.words[ne.length+1]=0,ne.length+=2;for(var fe=0,le=0;le>>=26,ne.words[le]=ve,fe=ce}return fe!==0&&(ne.words[ne.length++]=fe),ne},se._prime=function(ne){if(Xe[ne])return Xe[ne];var fe;if(ne==="k256")fe=new At;else if(ne==="p224")fe=new mt;else if(ne==="p192")fe=new Ge;else if(ne==="p25519")fe=new Lt;else throw new Error("Unknown prime "+ne);return Xe[ne]=fe,fe};function me(re){if(typeof re=="string"){var ne=se._prime(re);this.m=ne.p,this.prime=ne}else oe(re.gtn(1),"modulus must be greater than 1"),this.m=re,this.prime=null}me.prototype._verify1=function(ne){oe(ne.negative===0,"red works only with positives"),oe(ne.red,"red works only with red numbers")},me.prototype._verify2=function(ne,fe){oe((ne.negative|fe.negative)===0,"red works only with positives"),oe(ne.red&&ne.red===fe.red,"red works only with red numbers")},me.prototype.imod=function(ne){return this.prime?this.prime.ireduce(ne)._forceRed(this):(we(ne,ne.umod(this.m)._forceRed(this)),ne)},me.prototype.neg=function(ne){return ne.isZero()?ne.clone():this.m.sub(ne)._forceRed(this)},me.prototype.add=function(ne,fe){this._verify2(ne,fe);var le=ne.add(fe);return le.cmp(this.m)>=0&&le.isub(this.m),le._forceRed(this)},me.prototype.iadd=function(ne,fe){this._verify2(ne,fe);var le=ne.iadd(fe);return le.cmp(this.m)>=0&&le.isub(this.m),le},me.prototype.sub=function(ne,fe){this._verify2(ne,fe);var le=ne.sub(fe);return le.cmpn(0)<0&&le.iadd(this.m),le._forceRed(this)},me.prototype.isub=function(ne,fe){this._verify2(ne,fe);var le=ne.isub(fe);return le.cmpn(0)<0&&le.iadd(this.m),le},me.prototype.shl=function(ne,fe){return this._verify1(ne),this.imod(ne.ushln(fe))},me.prototype.imul=function(ne,fe){return this._verify2(ne,fe),this.imod(ne.imul(fe))},me.prototype.mul=function(ne,fe){return this._verify2(ne,fe),this.imod(ne.mul(fe))},me.prototype.isqr=function(ne){return this.imul(ne,ne.clone())},me.prototype.sqr=function(ne){return this.mul(ne,ne)},me.prototype.sqrt=function(ne){if(ne.isZero())return ne.clone();var fe=this.m.andln(3);if(oe(fe%2===1),fe===3){var le=this.m.add(new se(1)).iushrn(2);return this.pow(ne,le)}for(var ce=this.m.subn(1),ve=0;!ce.isZero()&&ce.andln(1)===0;)ve++,ce.iushrn(1);oe(!ce.isZero());var ue=new se(1).toRed(this),te=ue.redNeg(),de=this.m.subn(1).iushrn(1),ye=this.m.bitLength();for(ye=new se(2*ye*ye).toRed(this);this.pow(ye,de).cmp(te)!==0;)ye.redIAdd(te);for(var xe=this.pow(ye,ce),Pe=this.pow(ne,ce.addn(1).iushrn(1)),Le=this.pow(ne,ce),De=ve;Le.cmp(ue)!==0;){for(var Be=Le,Ce=0;Be.cmp(ue)!==0;Ce++)Be=Be.redSqr();oe(Ce=0;ve--){for(var xe=fe.words[ve],Pe=ye-1;Pe>=0;Pe--){var Le=xe>>Pe&1;if(ue!==ce[0]&&(ue=this.sqr(ue)),Le===0&&te===0){de=0;continue}te<<=1,te|=Le,de++,!(de!==le&&(ve!==0||Pe!==0))&&(ue=this.mul(ue,ce[te]),de=0,te=0)}ye=26}return ue},me.prototype.convertTo=function(ne){var fe=ne.umod(this.m);return fe===ne?fe.clone():fe},me.prototype.convertFrom=function(ne){var fe=ne.clone();return fe.red=null,fe},se.mont=function(ne){return new ee(ne)};function ee(re){me.call(this,re),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(ee,me),ee.prototype.convertTo=function(ne){return this.imod(ne.ushln(this.shift))},ee.prototype.convertFrom=function(ne){var fe=this.imod(ne.mul(this.rinv));return fe.red=null,fe},ee.prototype.imul=function(ne,fe){if(ne.isZero()||fe.isZero())return ne.words[0]=0,ne.length=1,ne;var le=ne.imul(fe),ce=le.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ve=le.isub(ce).iushrn(this.shift),ue=ve;return ve.cmp(this.m)>=0?ue=ve.isub(this.m):ve.cmpn(0)<0&&(ue=ve.iadd(this.m)),ue._forceRed(this)},ee.prototype.mul=function(ne,fe){if(ne.isZero()||fe.isZero())return new se(0)._forceRed(this);var le=ne.mul(fe),ce=le.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ve=le.isub(ce).iushrn(this.shift),ue=ve;return ve.cmp(this.m)>=0?ue=ve.isub(this.m):ve.cmpn(0)<0&&(ue=ve.iadd(this.m)),ue._forceRed(this)},ee.prototype.invm=function(ne){var fe=this.imod(ne._invmp(this.m).mul(this.r2));return fe._forceRed(this)}})(ae,commonjsGlobal)}(bn$4);var bnExports$4=bn$4.exports,BN$a=bnExports$4,randomBytes$1=browserExports,Buffer$7=safeBufferExports$1.Buffer;function getr(ae){var ie=ae.modulus.byteLength(),he;do he=new BN$a(randomBytes$1(ie));while(he.cmp(ae.modulus)>=0||!he.umod(ae.prime1)||!he.umod(ae.prime2));return he}function blind(ae){var ie=getr(ae),he=ie.toRed(BN$a.mont(ae.modulus)).redPow(new BN$a(ae.publicExponent)).fromRed();return{blinder:he,unblinder:ie.invm(ae.modulus)}}function crt$2(ae,ie){var he=blind(ie),oe=ie.modulus.byteLength(),pe=new BN$a(ae).mul(he.blinder).umod(ie.modulus),se=pe.toRed(BN$a.mont(ie.prime1)),be=pe.toRed(BN$a.mont(ie.prime2)),ge=ie.coefficient,_e=ie.prime1,Ee=ie.prime2,we=se.redPow(ie.exponent1).fromRed(),Me=be.redPow(ie.exponent2).fromRed(),$e=we.isub(Me).imul(ge).umod(_e).imul(Ee);return Me.iadd($e).imul(he.unblinder).umod(ie.modulus).toArrayLike(Buffer$7,"be",oe)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic={};const name="elliptic",version="6.6.1",description="EC cryptography",main="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny ",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name,version,description,main,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$l={},bn$3={exports:{}};bn$3.exports,function(ae){(function(ie,he){function oe(me,ee){if(!me)throw new Error(ee||"Assertion failed")}function pe(me,ee){me.super_=ee;var re=function(){};re.prototype=ee.prototype,me.prototype=new re,me.prototype.constructor=me}function se(me,ee,re){if(se.isBN(me))return me;this.negative=0,this.words=null,this.length=0,this.red=null,me!==null&&((ee==="le"||ee==="be")&&(re=ee,ee=10),this._init(me||0,ee||10,re||"be"))}typeof ie=="object"?ie.exports=se:he.BN=se,se.BN=se,se.wordSize=26;var be;try{typeof window<"u"&&typeof window.Buffer<"u"?be=window.Buffer:be=requireDist().Buffer}catch{}se.isBN=function(ee){return ee instanceof se?!0:ee!==null&&typeof ee=="object"&&ee.constructor.wordSize===se.wordSize&&Array.isArray(ee.words)},se.max=function(ee,re){return ee.cmp(re)>0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn$3);var bnExports$3=bn$3.exports,utils$k={};(function(ae){var ie=ae;function he(se,be){if(Array.isArray(se))return se.slice();if(!se)return[];var ge=[];if(typeof se!="string"){for(var _e=0;_e>8,Me=Ee&255;we?ge.push(we,Me):ge.push(Me)}return ge}ie.toArray=he;function oe(se){return se.length===1?"0"+se:se}ie.zero2=oe;function pe(se){for(var be="",ge=0;ge(Ne>>1)-1?He=(Ne>>1)-qe:He=qe,ze.isubn(He)):He=0,Re[ke]=He,ze.iushrn(1)}return Re}ie.getNAF=se;function be(we,Me){var $e=[[],[]];we=we.clone(),Me=Me.clone();for(var Re=0,ke=0,Ne;we.cmpn(-Re)>0||Me.cmpn(-ke)>0;){var ze=we.andln(3)+Re&3,He=Me.andln(3)+ke&3;ze===3&&(ze=-1),He===3&&(He=-1);var qe;ze&1?(Ne=we.andln(7)+Re&7,(Ne===3||Ne===5)&&He===2?qe=-ze:qe=ze):qe=0,$e[0].push(qe);var We;He&1?(Ne=Me.andln(7)+ke&7,(Ne===3||Ne===5)&&ze===2?We=-He:We=He):We=0,$e[1].push(We),2*Re===qe+1&&(Re=1-Re),2*ke===We+1&&(ke=1-ke),we.iushrn(1),Me.iushrn(1)}return $e}ie.getJSF=be;function ge(we,Me,$e){var Re="_"+Me;we.prototype[Me]=function(){return this[Re]!==void 0?this[Re]:this[Re]=$e.call(this)}}ie.cachedProperty=ge;function _e(we){return typeof we=="string"?ie.toArray(we,"hex"):we}ie.parseBytes=_e;function Ee(we){return new he(we,"hex","le")}ie.intFromLE=Ee}(utils$l);var curve={},BN$9=bnExports$3,utils$j=utils$l,getNAF=utils$j.getNAF,getJSF=utils$j.getJSF,assert$d=utils$j.assert;function BaseCurve(ae,ie){this.type=ae,this.p=new BN$9(ie.p,16),this.red=ie.prime?BN$9.red(ie.prime):BN$9.mont(this.p),this.zero=new BN$9(0).toRed(this.red),this.one=new BN$9(1).toRed(this.red),this.two=new BN$9(2).toRed(this.red),this.n=ie.n&&new BN$9(ie.n,16),this.g=ie.g&&this.pointFromJSON(ie.g,ie.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var he=this.n&&this.p.div(this.n);!he||he.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$1=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(ie,he){assert$d(ie.precomputed);var oe=ie._getDoubles(),pe=getNAF(he,1,this._bitLength),se=(1<=ge;Ee--)_e=(_e<<1)+pe[Ee];be.push(_e)}for(var we=this.jpoint(null,null,null),Me=this.jpoint(null,null,null),$e=se;$e>0;$e--){for(ge=0;ge=0;_e--){for(var Ee=0;_e>=0&&be[_e]===0;_e--)Ee++;if(_e>=0&&Ee++,ge=ge.dblp(Ee),_e<0)break;var we=be[_e];assert$d(we!==0),ie.type==="affine"?we>0?ge=ge.mixedAdd(se[we-1>>1]):ge=ge.mixedAdd(se[-we-1>>1].neg()):we>0?ge=ge.add(se[we-1>>1]):ge=ge.add(se[-we-1>>1].neg())}return ie.type==="affine"?ge.toP():ge},BaseCurve.prototype._wnafMulAdd=function(ie,he,oe,pe,se){var be=this._wnafT1,ge=this._wnafT2,_e=this._wnafT3,Ee=0,we,Me,$e;for(we=0;we=1;we-=2){var ke=we-1,Ne=we;if(be[ke]!==1||be[Ne]!==1){_e[ke]=getNAF(oe[ke],be[ke],this._bitLength),_e[Ne]=getNAF(oe[Ne],be[Ne],this._bitLength),Ee=Math.max(_e[ke].length,Ee),Ee=Math.max(_e[Ne].length,Ee);continue}var ze=[he[ke],null,null,he[Ne]];he[ke].y.cmp(he[Ne].y)===0?(ze[1]=he[ke].add(he[Ne]),ze[2]=he[ke].toJ().mixedAdd(he[Ne].neg())):he[ke].y.cmp(he[Ne].y.redNeg())===0?(ze[1]=he[ke].toJ().mixedAdd(he[Ne]),ze[2]=he[ke].add(he[Ne].neg())):(ze[1]=he[ke].toJ().mixedAdd(he[Ne]),ze[2]=he[ke].toJ().mixedAdd(he[Ne].neg()));var He=[-3,-1,-5,-7,0,7,5,1,3],qe=getJSF(oe[ke],oe[Ne]);for(Ee=Math.max(qe[0].length,Ee),_e[ke]=new Array(Ee),_e[Ne]=new Array(Ee),Me=0;Me=0;we--){for(var At=0;we>=0;){var mt=!0;for(Me=0;Me=0&&At++,Xe=Xe.dblp(At),we<0)break;for(Me=0;Me0?$e=ge[Me][Ge-1>>1]:Ge<0&&($e=ge[Me][-Ge-1>>1].neg()),$e.type==="affine"?Xe=Xe.mixedAdd($e):Xe=Xe.add($e))}}for(we=0;we=Math.ceil((ie.bitLength()+1)/he.step):!1},BasePoint.prototype._getDoubles=function(ie,he){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var oe=[this],pe=this,se=0;se=0&&(Re=Ee,ke=we),Me.negative&&(Me=Me.neg(),$e=$e.neg()),Re.negative&&(Re=Re.neg(),ke=ke.neg()),[{a:Me,b:$e},{a:Re,b:ke}]},ShortCurve.prototype._endoSplit=function(ie){var he=this.endo.basis,oe=he[0],pe=he[1],se=pe.b.mul(ie).divRound(this.n),be=oe.b.neg().mul(ie).divRound(this.n),ge=se.mul(oe.a),_e=be.mul(pe.a),Ee=se.mul(oe.b),we=be.mul(pe.b),Me=ie.sub(ge).sub(_e),$e=Ee.add(we).neg();return{k1:Me,k2:$e}},ShortCurve.prototype.pointFromX=function(ie,he){ie=new BN$8(ie,16),ie.red||(ie=ie.toRed(this.red));var oe=ie.redSqr().redMul(ie).redIAdd(ie.redMul(this.a)).redIAdd(this.b),pe=oe.redSqrt();if(pe.redSqr().redSub(oe).cmp(this.zero)!==0)throw new Error("invalid point");var se=pe.fromRed().isOdd();return(he&&!se||!he&&se)&&(pe=pe.redNeg()),this.point(ie,pe)},ShortCurve.prototype.validate=function(ie){if(ie.inf)return!0;var he=ie.x,oe=ie.y,pe=this.a.redMul(he),se=he.redSqr().redMul(he).redIAdd(pe).redIAdd(this.b);return oe.redSqr().redISub(se).cmpn(0)===0},ShortCurve.prototype._endoWnafMulAdd=function(ie,he,oe){for(var pe=this._endoWnafT1,se=this._endoWnafT2,be=0;be":""},Point$2.prototype.isInfinity=function(){return this.inf},Point$2.prototype.add=function(ie){if(this.inf)return ie;if(ie.inf)return this;if(this.eq(ie))return this.dbl();if(this.neg().eq(ie))return this.curve.point(null,null);if(this.x.cmp(ie.x)===0)return this.curve.point(null,null);var he=this.y.redSub(ie.y);he.cmpn(0)!==0&&(he=he.redMul(this.x.redSub(ie.x).redInvm()));var oe=he.redSqr().redISub(this.x).redISub(ie.x),pe=he.redMul(this.x.redSub(oe)).redISub(this.y);return this.curve.point(oe,pe)},Point$2.prototype.dbl=function(){if(this.inf)return this;var ie=this.y.redAdd(this.y);if(ie.cmpn(0)===0)return this.curve.point(null,null);var he=this.curve.a,oe=this.x.redSqr(),pe=ie.redInvm(),se=oe.redAdd(oe).redIAdd(oe).redIAdd(he).redMul(pe),be=se.redSqr().redISub(this.x.redAdd(this.x)),ge=se.redMul(this.x.redSub(be)).redISub(this.y);return this.curve.point(be,ge)},Point$2.prototype.getX=function(){return this.x.fromRed()},Point$2.prototype.getY=function(){return this.y.fromRed()},Point$2.prototype.mul=function(ie){return ie=new BN$8(ie,16),this.isInfinity()?this:this._hasDoubles(ie)?this.curve._fixedNafMul(this,ie):this.curve.endo?this.curve._endoWnafMulAdd([this],[ie]):this.curve._wnafMul(this,ie)},Point$2.prototype.mulAdd=function(ie,he,oe){var pe=[this,he],se=[ie,oe];return this.curve.endo?this.curve._endoWnafMulAdd(pe,se):this.curve._wnafMulAdd(1,pe,se,2)},Point$2.prototype.jmulAdd=function(ie,he,oe){var pe=[this,he],se=[ie,oe];return this.curve.endo?this.curve._endoWnafMulAdd(pe,se,!0):this.curve._wnafMulAdd(1,pe,se,2,!0)},Point$2.prototype.eq=function(ie){return this===ie||this.inf===ie.inf&&(this.inf||this.x.cmp(ie.x)===0&&this.y.cmp(ie.y)===0)},Point$2.prototype.neg=function(ie){if(this.inf)return this;var he=this.curve.point(this.x,this.y.redNeg());if(ie&&this.precomputed){var oe=this.precomputed,pe=function(se){return se.neg()};he.precomputed={naf:oe.naf&&{wnd:oe.naf.wnd,points:oe.naf.points.map(pe)},doubles:oe.doubles&&{step:oe.doubles.step,points:oe.doubles.points.map(pe)}}}return he},Point$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var ie=this.curve.jpoint(this.x,this.y,this.curve.one);return ie};function JPoint(ae,ie,he,oe){Base$2.BasePoint.call(this,ae,"jacobian"),ie===null&&he===null&&oe===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$8(0)):(this.x=new BN$8(ie,16),this.y=new BN$8(he,16),this.z=new BN$8(oe,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$4(JPoint,Base$2.BasePoint),ShortCurve.prototype.jpoint=function(ie,he,oe){return new JPoint(this,ie,he,oe)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var ie=this.z.redInvm(),he=ie.redSqr(),oe=this.x.redMul(he),pe=this.y.redMul(he).redMul(ie);return this.curve.point(oe,pe)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(ie){if(this.isInfinity())return ie;if(ie.isInfinity())return this;var he=ie.z.redSqr(),oe=this.z.redSqr(),pe=this.x.redMul(he),se=ie.x.redMul(oe),be=this.y.redMul(he.redMul(ie.z)),ge=ie.y.redMul(oe.redMul(this.z)),_e=pe.redSub(se),Ee=be.redSub(ge);if(_e.cmpn(0)===0)return Ee.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var we=_e.redSqr(),Me=we.redMul(_e),$e=pe.redMul(we),Re=Ee.redSqr().redIAdd(Me).redISub($e).redISub($e),ke=Ee.redMul($e.redISub(Re)).redISub(be.redMul(Me)),Ne=this.z.redMul(ie.z).redMul(_e);return this.curve.jpoint(Re,ke,Ne)},JPoint.prototype.mixedAdd=function(ie){if(this.isInfinity())return ie.toJ();if(ie.isInfinity())return this;var he=this.z.redSqr(),oe=this.x,pe=ie.x.redMul(he),se=this.y,be=ie.y.redMul(he).redMul(this.z),ge=oe.redSub(pe),_e=se.redSub(be);if(ge.cmpn(0)===0)return _e.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Ee=ge.redSqr(),we=Ee.redMul(ge),Me=oe.redMul(Ee),$e=_e.redSqr().redIAdd(we).redISub(Me).redISub(Me),Re=_e.redMul(Me.redISub($e)).redISub(se.redMul(we)),ke=this.z.redMul(ge);return this.curve.jpoint($e,Re,ke)},JPoint.prototype.dblp=function(ie){if(ie===0)return this;if(this.isInfinity())return this;if(!ie)return this.dbl();var he;if(this.curve.zeroA||this.curve.threeA){var oe=this;for(he=0;he=0)return!1;if(oe.redIAdd(se),this.x.cmp(oe)===0)return!0}},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$7=bnExports$3,inherits$3=inherits_browserExports,Base$1=base$1,utils$h=utils$l;function MontCurve(ae){Base$1.call(this,"mont",ae),this.a=new BN$7(ae.a,16).toRed(this.red),this.b=new BN$7(ae.b,16).toRed(this.red),this.i4=new BN$7(4).toRed(this.red).redInvm(),this.two=new BN$7(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$3(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(ie){var he=ie.normalize().x,oe=he.redSqr(),pe=oe.redMul(he).redAdd(oe.redMul(this.a)).redAdd(he),se=pe.redSqrt();return se.redSqr().cmp(pe)===0};function Point$1(ae,ie,he){Base$1.BasePoint.call(this,ae,"projective"),ie===null&&he===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$7(ie,16),this.z=new BN$7(he,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$3(Point$1,Base$1.BasePoint),MontCurve.prototype.decodePoint=function(ie,he){return this.point(utils$h.toArray(ie,he),1)},MontCurve.prototype.point=function(ie,he){return new Point$1(this,ie,he)},MontCurve.prototype.pointFromJSON=function(ie){return Point$1.fromJSON(this,ie)},Point$1.prototype.precompute=function(){},Point$1.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$1.fromJSON=function(ie,he){return new Point$1(ie,he[0],he[1]||ie.one)},Point$1.prototype.inspect=function(){return this.isInfinity()?"":""},Point$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Point$1.prototype.dbl=function(){var ie=this.x.redAdd(this.z),he=ie.redSqr(),oe=this.x.redSub(this.z),pe=oe.redSqr(),se=he.redSub(pe),be=he.redMul(pe),ge=se.redMul(pe.redAdd(this.curve.a24.redMul(se)));return this.curve.point(be,ge)},Point$1.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.diffAdd=function(ie,he){var oe=this.x.redAdd(this.z),pe=this.x.redSub(this.z),se=ie.x.redAdd(ie.z),be=ie.x.redSub(ie.z),ge=be.redMul(oe),_e=se.redMul(pe),Ee=he.z.redMul(ge.redAdd(_e).redSqr()),we=he.x.redMul(ge.redISub(_e).redSqr());return this.curve.point(Ee,we)},Point$1.prototype.mul=function(ie){for(var he=ie.clone(),oe=this,pe=this.curve.point(null,null),se=this,be=[];he.cmpn(0)!==0;he.iushrn(1))be.push(he.andln(1));for(var ge=be.length-1;ge>=0;ge--)be[ge]===0?(oe=oe.diffAdd(pe,se),pe=pe.dbl()):(pe=oe.diffAdd(pe,se),oe=oe.dbl());return pe},Point$1.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.eq=function(ie){return this.getX().cmp(ie.getX())===0},Point$1.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$1.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$g=utils$l,BN$6=bnExports$3,inherits$2=inherits_browserExports,Base=base$1,assert$b=utils$g.assert;function EdwardsCurve(ae){this.twisted=(ae.a|0)!==1,this.mOneA=this.twisted&&(ae.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",ae),this.a=new BN$6(ae.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$6(ae.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$6(ae.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$b(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(ae.c|0)===1}inherits$2(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(ie){return this.mOneA?ie.redNeg():this.a.redMul(ie)},EdwardsCurve.prototype._mulC=function(ie){return this.oneC?ie:this.c.redMul(ie)},EdwardsCurve.prototype.jpoint=function(ie,he,oe,pe){return this.point(ie,he,oe,pe)},EdwardsCurve.prototype.pointFromX=function(ie,he){ie=new BN$6(ie,16),ie.red||(ie=ie.toRed(this.red));var oe=ie.redSqr(),pe=this.c2.redSub(this.a.redMul(oe)),se=this.one.redSub(this.c2.redMul(this.d).redMul(oe)),be=pe.redMul(se.redInvm()),ge=be.redSqrt();if(ge.redSqr().redSub(be).cmp(this.zero)!==0)throw new Error("invalid point");var _e=ge.fromRed().isOdd();return(he&&!_e||!he&&_e)&&(ge=ge.redNeg()),this.point(ie,ge)},EdwardsCurve.prototype.pointFromY=function(ie,he){ie=new BN$6(ie,16),ie.red||(ie=ie.toRed(this.red));var oe=ie.redSqr(),pe=oe.redSub(this.c2),se=oe.redMul(this.d).redMul(this.c2).redSub(this.a),be=pe.redMul(se.redInvm());if(be.cmp(this.zero)===0){if(he)throw new Error("invalid point");return this.point(this.zero,ie)}var ge=be.redSqrt();if(ge.redSqr().redSub(be).cmp(this.zero)!==0)throw new Error("invalid point");return ge.fromRed().isOdd()!==he&&(ge=ge.redNeg()),this.point(ge,ie)},EdwardsCurve.prototype.validate=function(ie){if(ie.isInfinity())return!0;ie.normalize();var he=ie.x.redSqr(),oe=ie.y.redSqr(),pe=he.redMul(this.a).redAdd(oe),se=this.c2.redMul(this.one.redAdd(this.d.redMul(he).redMul(oe)));return pe.cmp(se)===0};function Point(ae,ie,he,oe,pe){Base.BasePoint.call(this,ae,"projective"),ie===null&&he===null&&oe===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$6(ie,16),this.y=new BN$6(he,16),this.z=oe?new BN$6(oe,16):this.curve.one,this.t=pe&&new BN$6(pe,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$2(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function(ie){return Point.fromJSON(this,ie)},EdwardsCurve.prototype.point=function(ie,he,oe,pe){return new Point(this,ie,he,oe,pe)},Point.fromJSON=function(ie,he){return new Point(ie,he[0],he[1],he[2])},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},Point.prototype._extDbl=function(){var ie=this.x.redSqr(),he=this.y.redSqr(),oe=this.z.redSqr();oe=oe.redIAdd(oe);var pe=this.curve._mulA(ie),se=this.x.redAdd(this.y).redSqr().redISub(ie).redISub(he),be=pe.redAdd(he),ge=be.redSub(oe),_e=pe.redSub(he),Ee=se.redMul(ge),we=be.redMul(_e),Me=se.redMul(_e),$e=ge.redMul(be);return this.curve.point(Ee,we,$e,Me)},Point.prototype._projDbl=function(){var ie=this.x.redAdd(this.y).redSqr(),he=this.x.redSqr(),oe=this.y.redSqr(),pe,se,be,ge,_e,Ee;if(this.curve.twisted){ge=this.curve._mulA(he);var we=ge.redAdd(oe);this.zOne?(pe=ie.redSub(he).redSub(oe).redMul(we.redSub(this.curve.two)),se=we.redMul(ge.redSub(oe)),be=we.redSqr().redSub(we).redSub(we)):(_e=this.z.redSqr(),Ee=we.redSub(_e).redISub(_e),pe=ie.redSub(he).redISub(oe).redMul(Ee),se=we.redMul(ge.redSub(oe)),be=we.redMul(Ee))}else ge=he.redAdd(oe),_e=this.curve._mulC(this.z).redSqr(),Ee=ge.redSub(_e).redSub(_e),pe=this.curve._mulC(ie.redISub(ge)).redMul(Ee),se=this.curve._mulC(ge).redMul(he.redISub(oe)),be=ge.redMul(Ee);return this.curve.point(pe,se,be)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(ie){var he=this.y.redSub(this.x).redMul(ie.y.redSub(ie.x)),oe=this.y.redAdd(this.x).redMul(ie.y.redAdd(ie.x)),pe=this.t.redMul(this.curve.dd).redMul(ie.t),se=this.z.redMul(ie.z.redAdd(ie.z)),be=oe.redSub(he),ge=se.redSub(pe),_e=se.redAdd(pe),Ee=oe.redAdd(he),we=be.redMul(ge),Me=_e.redMul(Ee),$e=be.redMul(Ee),Re=ge.redMul(_e);return this.curve.point(we,Me,Re,$e)},Point.prototype._projAdd=function(ie){var he=this.z.redMul(ie.z),oe=he.redSqr(),pe=this.x.redMul(ie.x),se=this.y.redMul(ie.y),be=this.curve.d.redMul(pe).redMul(se),ge=oe.redSub(be),_e=oe.redAdd(be),Ee=this.x.redAdd(this.y).redMul(ie.x.redAdd(ie.y)).redISub(pe).redISub(se),we=he.redMul(ge).redMul(Ee),Me,$e;return this.curve.twisted?(Me=he.redMul(_e).redMul(se.redSub(this.curve._mulA(pe))),$e=ge.redMul(_e)):(Me=he.redMul(_e).redMul(se.redSub(pe)),$e=this.curve._mulC(ge).redMul(_e)),this.curve.point(we,Me,$e)},Point.prototype.add=function(ie){return this.isInfinity()?ie:ie.isInfinity()?this:this.curve.extended?this._extAdd(ie):this._projAdd(ie)},Point.prototype.mul=function(ie){return this._hasDoubles(ie)?this.curve._fixedNafMul(this,ie):this.curve._wnafMul(this,ie)},Point.prototype.mulAdd=function(ie,he,oe){return this.curve._wnafMulAdd(1,[this,he],[ie,oe],2,!1)},Point.prototype.jmulAdd=function(ie,he,oe){return this.curve._wnafMulAdd(1,[this,he],[ie,oe],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var ie=this.z.redInvm();return this.x=this.x.redMul(ie),this.y=this.y.redMul(ie),this.t&&(this.t=this.t.redMul(ie)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(ie){return this===ie||this.getX().cmp(ie.getX())===0&&this.getY().cmp(ie.getY())===0},Point.prototype.eqXToP=function(ie){var he=ie.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(he)===0)return!0;for(var oe=ie.clone(),pe=this.curve.redN.redMul(this.z);;){if(oe.iadd(this.curve.n),oe.cmp(this.curve.p)>=0)return!1;if(he.redIAdd(pe),this.x.cmp(he)===0)return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add,function(ae){var ie=ae;ie.base=base$1,ie.short=short,ie.mont=mont,ie.edwards=edwards}(curve);var curves$1={},hash$2={},utils$f={},assert$a=minimalisticAssert,inherits$1=inherits_browserExports;utils$f.inherits=inherits$1;function isSurrogatePair(ae,ie){return(ae.charCodeAt(ie)&64512)!==55296||ie<0||ie+1>=ae.length?!1:(ae.charCodeAt(ie+1)&64512)===56320}function toArray(ae,ie){if(Array.isArray(ae))return ae.slice();if(!ae)return[];var he=[];if(typeof ae=="string")if(ie){if(ie==="hex")for(ae=ae.replace(/[^a-z0-9]+/ig,""),ae.length%2!==0&&(ae="0"+ae),pe=0;pe>6|192,he[oe++]=se&63|128):isSurrogatePair(ae,pe)?(se=65536+((se&1023)<<10)+(ae.charCodeAt(++pe)&1023),he[oe++]=se>>18|240,he[oe++]=se>>12&63|128,he[oe++]=se>>6&63|128,he[oe++]=se&63|128):(he[oe++]=se>>12|224,he[oe++]=se>>6&63|128,he[oe++]=se&63|128)}else for(pe=0;pe>>24|ae>>>8&65280|ae<<8&16711680|(ae&255)<<24;return ie>>>0}utils$f.htonl=htonl;function toHex32(ae,ie){for(var he="",oe=0;oe>>0}return se}utils$f.join32=join32;function split32(ae,ie){for(var he=new Array(ae.length*4),oe=0,pe=0;oe>>24,he[pe+1]=se>>>16&255,he[pe+2]=se>>>8&255,he[pe+3]=se&255):(he[pe+3]=se>>>24,he[pe+2]=se>>>16&255,he[pe+1]=se>>>8&255,he[pe]=se&255)}return he}utils$f.split32=split32;function rotr32$1(ae,ie){return ae>>>ie|ae<<32-ie}utils$f.rotr32=rotr32$1;function rotl32$2(ae,ie){return ae<>>32-ie}utils$f.rotl32=rotl32$2;function sum32$3(ae,ie){return ae+ie>>>0}utils$f.sum32=sum32$3;function sum32_3$1(ae,ie,he){return ae+ie+he>>>0}utils$f.sum32_3=sum32_3$1;function sum32_4$2(ae,ie,he,oe){return ae+ie+he+oe>>>0}utils$f.sum32_4=sum32_4$2;function sum32_5$2(ae,ie,he,oe,pe){return ae+ie+he+oe+pe>>>0}utils$f.sum32_5=sum32_5$2;function sum64$1(ae,ie,he,oe){var pe=ae[ie],se=ae[ie+1],be=oe+se>>>0,ge=(be>>0,ae[ie+1]=be}utils$f.sum64=sum64$1;function sum64_hi$1(ae,ie,he,oe){var pe=ie+oe>>>0,se=(pe>>0}utils$f.sum64_hi=sum64_hi$1;function sum64_lo$1(ae,ie,he,oe){var pe=ie+oe;return pe>>>0}utils$f.sum64_lo=sum64_lo$1;function sum64_4_hi$1(ae,ie,he,oe,pe,se,be,ge){var _e=0,Ee=ie;Ee=Ee+oe>>>0,_e+=Ee>>0,_e+=Ee>>0,_e+=Ee>>0}utils$f.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(ae,ie,he,oe,pe,se,be,ge){var _e=ie+oe+se+ge;return _e>>>0}utils$f.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(ae,ie,he,oe,pe,se,be,ge,_e,Ee){var we=0,Me=ie;Me=Me+oe>>>0,we+=Me>>0,we+=Me>>0,we+=Me>>0,we+=Me>>0}utils$f.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(ae,ie,he,oe,pe,se,be,ge,_e,Ee){var we=ie+oe+se+ge+Ee;return we>>>0}utils$f.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(ae,ie,he){var oe=ie<<32-he|ae>>>he;return oe>>>0}utils$f.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(ae,ie,he){var oe=ae<<32-he|ie>>>he;return oe>>>0}utils$f.rotr64_lo=rotr64_lo$1;function shr64_hi$1(ae,ie,he){return ae>>>he}utils$f.shr64_hi=shr64_hi$1;function shr64_lo$1(ae,ie,he){var oe=ae<<32-he|ie>>>he;return oe>>>0}utils$f.shr64_lo=shr64_lo$1;var common$5={},utils$e=utils$f,assert$9=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$5.BlockHash=BlockHash$4,BlockHash$4.prototype.update=function(ie,he){if(ie=utils$e.toArray(ie,he),this.pending?this.pending=this.pending.concat(ie):this.pending=ie,this.pendingTotal+=ie.length,this.pending.length>=this._delta8){ie=this.pending;var oe=ie.length%this._delta8;this.pending=ie.slice(ie.length-oe,ie.length),this.pending.length===0&&(this.pending=null),ie=utils$e.join32(ie,0,ie.length-oe,this.endian);for(var pe=0;pe>>24&255,pe[se++]=ie>>>16&255,pe[se++]=ie>>>8&255,pe[se++]=ie&255}else for(pe[se++]=ie&255,pe[se++]=ie>>>8&255,pe[se++]=ie>>>16&255,pe[se++]=ie>>>24&255,pe[se++]=0,pe[se++]=0,pe[se++]=0,pe[se++]=0,be=8;be>>3}common$4.g0_256=g0_256$1;function g1_256$1(ae){return rotr32(ae,17)^rotr32(ae,19)^ae>>>10}common$4.g1_256=g1_256$1;var utils$c=utils$f,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$c.rotl32,sum32$2=utils$c.sum32,sum32_5$1=utils$c.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$c.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(ie,he){for(var oe=this.W,pe=0;pe<16;pe++)oe[pe]=ie[he+pe];for(;pethis.blockSize&&(ie=new this.Hash().update(ie).digest()),assert$6(ie.length<=this.blockSize);for(var he=ie.length;he=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(ie,he,oe)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(ie,he,oe){var pe=ie.concat(he).concat(oe);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var se=0;se=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(ie.concat(oe||[])),this._reseed=1},HmacDRBG.prototype.generate=function(ie,he,oe,pe){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof he!="string"&&(pe=oe,oe=he,he=null),oe&&(oe=utils$5.toArray(oe,pe||"hex"),this._update(oe));for(var se=[];se.length"};var BN$4=bnExports$3,utils$3=utils$l,assert$3=utils$3.assert;function Signature$2(ae,ie){if(ae instanceof Signature$2)return ae;this._importDER(ae,ie)||(assert$3(ae.r&&ae.s,"Signature without r or s"),this.r=new BN$4(ae.r,16),this.s=new BN$4(ae.s,16),ae.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=ae.recoveryParam)}var signature$1=Signature$2;function Position(){this.place=0}function getLength(ae,ie){var he=ae[ie.place++];if(!(he&128))return he;var oe=he&15;if(oe===0||oe>4||ae[ie.place]===0)return!1;for(var pe=0,se=0,be=ie.place;se>>=0;return pe<=127?!1:(ie.place=be,pe)}function rmPadding(ae){for(var ie=0,he=ae.length-1;!ae[ie]&&!(ae[ie+1]&128)&&ie>>3);for(ae.push(he|128);--he;)ae.push(ie>>>(he<<3)&255);ae.push(ie)}Signature$2.prototype.toDER=function(ie){var he=this.r.toArray(),oe=this.s.toArray();for(he[0]&128&&(he=[0].concat(he)),oe[0]&128&&(oe=[0].concat(oe)),he=rmPadding(he),oe=rmPadding(oe);!oe[0]&&!(oe[1]&128);)oe=oe.slice(1);var pe=[2];constructLength(pe,he.length),pe=pe.concat(he),pe.push(2),constructLength(pe,oe.length);var se=pe.concat(oe),be=[48];return constructLength(be,se.length),be=be.concat(se),utils$3.encode(be,ie)};var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var ae=bnExports$3,ie=hmacDrbg,he=utils$l,oe=curves$1,pe=requireBrorand(),se=he.assert,be=key$1,ge=signature$1;function _e(Ee){if(!(this instanceof _e))return new _e(Ee);typeof Ee=="string"&&(se(Object.prototype.hasOwnProperty.call(oe,Ee),"Unknown curve "+Ee),Ee=oe[Ee]),Ee instanceof oe.PresetCurve&&(Ee={curve:Ee}),this.curve=Ee.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Ee.curve.g,this.g.precompute(Ee.curve.n.bitLength()+1),this.hash=Ee.hash||Ee.curve.hash}return ec=_e,_e.prototype.keyPair=function(we){return new be(this,we)},_e.prototype.keyFromPrivate=function(we,Me){return be.fromPrivate(this,we,Me)},_e.prototype.keyFromPublic=function(we,Me){return be.fromPublic(this,we,Me)},_e.prototype.genKeyPair=function(we){we||(we={});for(var Me=new ie({hash:this.hash,pers:we.pers,persEnc:we.persEnc||"utf8",entropy:we.entropy||pe(this.hash.hmacStrength),entropyEnc:we.entropy&&we.entropyEnc||"utf8",nonce:this.n.toArray()}),$e=this.n.byteLength(),Re=this.n.sub(new ae(2));;){var ke=new ae(Me.generate($e));if(!(ke.cmp(Re)>0))return ke.iaddn(1),this.keyFromPrivate(ke)}},_e.prototype._truncateToN=function(we,Me,$e){var Re;if(ae.isBN(we)||typeof we=="number")we=new ae(we,16),Re=we.byteLength();else if(typeof we=="object")Re=we.length,we=new ae(we,16);else{var ke=we.toString();Re=ke.length+1>>>1,we=new ae(ke,16)}typeof $e!="number"&&($e=Re*8);var Ne=$e-this.n.bitLength();return Ne>0&&(we=we.ushrn(Ne)),!Me&&we.cmp(this.n)>=0?we.sub(this.n):we},_e.prototype.sign=function(we,Me,$e,Re){if(typeof $e=="object"&&(Re=$e,$e=null),Re||(Re={}),typeof we!="string"&&typeof we!="number"&&!ae.isBN(we)){se(typeof we=="object"&&we&&typeof we.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),se(we.length>>>0===we.length);for(var ke=0;ke=0)){var lt=this.g.mul(Xe);if(!lt.isInfinity()){var At=lt.getX(),mt=At.umod(this.n);if(mt.cmpn(0)!==0){var Ge=Xe.invm(this.n).mul(mt.mul(Me.getPrivate()).iadd(we));if(Ge=Ge.umod(this.n),Ge.cmpn(0)!==0){var Lt=(lt.getY().isOdd()?1:0)|(At.cmp(mt)!==0?2:0);return Re.canonical&&Ge.cmp(this.nh)>0&&(Ge=this.n.sub(Ge),Lt^=1),new ge({r:mt,s:Ge,recoveryParam:Lt})}}}}}},_e.prototype.verify=function(we,Me,$e,Re,ke){ke||(ke={}),we=this._truncateToN(we,!1,ke.msgBitLength),$e=this.keyFromPublic($e,Re),Me=new ge(Me,"hex");var Ne=Me.r,ze=Me.s;if(Ne.cmpn(1)<0||Ne.cmp(this.n)>=0||ze.cmpn(1)<0||ze.cmp(this.n)>=0)return!1;var He=ze.invm(this.n),qe=He.mul(we).umod(this.n),We=He.mul(Ne).umod(this.n),je;return this.curve._maxwellTrick?(je=this.g.jmulAdd(qe,$e.getPublic(),We),je.isInfinity()?!1:je.eqXToP(Ne)):(je=this.g.mulAdd(qe,$e.getPublic(),We),je.isInfinity()?!1:je.getX().umod(this.n).cmp(Ne)===0)},_e.prototype.recoverPubKey=function(Ee,we,Me,$e){se((3&Me)===Me,"The recovery param is more than two bits"),we=new ge(we,$e);var Re=this.n,ke=new ae(Ee),Ne=we.r,ze=we.s,He=Me&1,qe=Me>>1;if(Ne.cmp(this.curve.p.umod(this.curve.n))>=0&&qe)throw new Error("Unable to find sencond key candinate");qe?Ne=this.curve.pointFromX(Ne.add(this.curve.n),He):Ne=this.curve.pointFromX(Ne,He);var We=we.r.invm(Re),je=Re.sub(ke).mul(We).umod(Re),Xe=ze.mul(We).umod(Re);return this.g.mulAdd(je,Ne,Xe)},_e.prototype.getKeyRecoveryParam=function(Ee,we,Me,$e){if(we=new ge(we,$e),we.recoveryParam!==null)return we.recoveryParam;for(var Re=0;Re<4;Re++){var ke;try{ke=this.recoverPubKey(Ee,we,Re)}catch{continue}if(ke.eq(Me))return Re}throw new Error("Unable to find valid recovery factor")},ec}var utils$2=utils$l,assert$2=utils$2.assert,parseBytes$2=utils$2.parseBytes,cachedProperty$1=utils$2.cachedProperty;function KeyPair$1(ae,ie){this.eddsa=ae,this._secret=parseBytes$2(ie.secret),ae.isPoint(ie.pub)?this._pub=ie.pub:this._pubBytes=parseBytes$2(ie.pub)}KeyPair$1.fromPublic=function(ie,he){return he instanceof KeyPair$1?he:new KeyPair$1(ie,{pub:he})},KeyPair$1.fromSecret=function(ie,he){return he instanceof KeyPair$1?he:new KeyPair$1(ie,{secret:he})},KeyPair$1.prototype.secret=function(){return this._secret},cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty$1(KeyPair$1,"privBytes",function(){var ie=this.eddsa,he=this.hash(),oe=ie.encodingLength-1,pe=he.slice(0,ie.encodingLength);return pe[0]&=248,pe[oe]&=127,pe[oe]|=64,pe}),cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair$1.prototype.sign=function(ie){return assert$2(this._secret,"KeyPair can only verify"),this.eddsa.sign(ie,this)},KeyPair$1.prototype.verify=function(ie,he){return this.eddsa.verify(ie,he,this)},KeyPair$1.prototype.getSecret=function(ie){return assert$2(this._secret,"KeyPair is public only"),utils$2.encode(this.secret(),ie)},KeyPair$1.prototype.getPublic=function(ie){return utils$2.encode(this.pubBytes(),ie)};var key=KeyPair$1,BN$3=bnExports$3,utils$1=utils$l,assert$1=utils$1.assert,cachedProperty=utils$1.cachedProperty,parseBytes$1=utils$1.parseBytes;function Signature$1(ae,ie){this.eddsa=ae,typeof ie!="object"&&(ie=parseBytes$1(ie)),Array.isArray(ie)&&(assert$1(ie.length===ae.encodingLength*2,"Signature has invalid size"),ie={R:ie.slice(0,ae.encodingLength),S:ie.slice(ae.encodingLength)}),assert$1(ie.R&&ie.S,"Signature without R or S"),ae.isPoint(ie.R)&&(this._R=ie.R),ie.S instanceof BN$3&&(this._S=ie.S),this._Rencoded=Array.isArray(ie.R)?ie.R:ie.Rencoded,this._Sencoded=Array.isArray(ie.S)?ie.S:ie.Sencoded}cachedProperty(Signature$1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature$1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature$1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature$1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Signature$1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Signature$1.prototype.toHex=function(){return utils$1.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash=hash$2,curves=curves$1,utils=utils$l,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=key,Signature=signature;function EDDSA(ae){if(assert(ae==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(ae);ae=curves[ae].curve,this.curve=ae,this.g=ae.g,this.g.precompute(ae.n.bitLength()+1),this.pointClass=ae.point().constructor,this.encodingLength=Math.ceil(ae.n.bitLength()/8),this.hash=hash.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(ie,he){ie=parseBytes(ie);var oe=this.keyFromSecret(he),pe=this.hashInt(oe.messagePrefix(),ie),se=this.g.mul(pe),be=this.encodePoint(se),ge=this.hashInt(be,oe.pubBytes(),ie).mul(oe.priv()),_e=pe.add(ge).umod(this.curve.n);return this.makeSignature({R:se,S:_e,Rencoded:be})},EDDSA.prototype.verify=function(ie,he,oe){if(ie=parseBytes(ie),he=this.makeSignature(he),he.S().gte(he.eddsa.curve.n)||he.S().isNeg())return!1;var pe=this.keyFromPublic(oe),se=this.hashInt(he.Rencoded(),pe.pubBytes(),ie),be=this.g.mul(he.S()),ge=he.R().add(pe.pub().mul(se));return ge.eq(be)},EDDSA.prototype.hashInt=function(){for(var ie=this.hash(),he=0;he0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn$2);var bnExports$2=bn$2.exports,api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(ae,ie){if(ae.indexOf)return ae.indexOf(ie);for(var he=0;he>6],Re=(Me&32)===0;if((Me&31)===31){var ke=Me;for(Me=0;(ke&128)===128;){if(ke=Ee.readUInt8(we),Ee.isError(ke))return ke;Me<<=7,Me|=ke&127}}else Me&=31;var Ne=pe.tag[Me];return{cls:$e,primitive:Re,tag:Me,tagStr:Ne}}function _e(Ee,we,Me){var $e=Ee.readUInt8(Me);if(Ee.isError($e))return $e;if(!we&&$e===128)return null;if(!($e&128))return $e;var Re=$e&127;if(Re>4)return Ee.error("length octect is too long");$e=0;for(var ke=0;ke=256;ze>>=8)Ne++;var He=new ie(2+Ne);He[0]=ke,He[1]=128|Ne;for(var ze=1+Ne,qe=Re.length;qe>0;ze--,qe>>=8)He[ze]=qe&255;return this._createEncoderBuffer([He,Re])},be.prototype._encodeStr=function(we,Me){if(Me==="bitstr")return this._createEncoderBuffer([we.unused|0,we.data]);if(Me==="bmpstr"){for(var $e=new ie(we.length*2),Re=0;Re=40)return this.reporter.error("Second objid identifier OOB");we.splice(0,2,we[0]*40+we[1])}for(var ke=0,Re=0;Re=128;Ne>>=7)ke++}for(var ze=new ie(ke),He=ze.length-1,Re=we.length-1;Re>=0;Re--){var Ne=we[Re];for(ze[He--]=Ne&127;(Ne>>=7)>0;)ze[He--]=128|Ne&127}return this._createEncoderBuffer(ze)};function ge(Ee){return Ee<10?"0"+Ee:Ee}be.prototype._encodeTime=function(we,Me){var $e,Re=new Date(we);return Me==="gentime"?$e=[ge(Re.getFullYear()),ge(Re.getUTCMonth()+1),ge(Re.getUTCDate()),ge(Re.getUTCHours()),ge(Re.getUTCMinutes()),ge(Re.getUTCSeconds()),"Z"].join(""):Me==="utctime"?$e=[ge(Re.getFullYear()%100),ge(Re.getUTCMonth()+1),ge(Re.getUTCDate()),ge(Re.getUTCHours()),ge(Re.getUTCMinutes()),ge(Re.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+Me+" time is not supported yet"),this._encodeStr($e,"octstr")},be.prototype._encodeNull=function(){return this._createEncoderBuffer("")},be.prototype._encodeInt=function(we,Me){if(typeof we=="string"){if(!Me)return this.reporter.error("String int or enum given, but no values map");if(!Me.hasOwnProperty(we))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(we));we=Me[we]}if(typeof we!="number"&&!ie.isBuffer(we)){var $e=we.toArray();!we.sign&&$e[0]&128&&$e.unshift(0),we=new ie($e)}if(ie.isBuffer(we)){var Re=we.length;we.length===0&&Re++;var Ne=new ie(Re);return we.copy(Ne),we.length===0&&(Ne[0]=0),this._createEncoderBuffer(Ne)}if(we<128)return this._createEncoderBuffer(we);if(we<256)return this._createEncoderBuffer([0,we]);for(var Re=1,ke=we;ke>=256;ke>>=8)Re++;for(var Ne=new Array(Re),ke=Ne.length-1;ke>=0;ke--)Ne[ke]=we&255,we>>=8;return Ne[0]&128&&Ne.unshift(0),this._createEncoderBuffer(new ie(Ne))},be.prototype._encodeBool=function(we){return this._createEncoderBuffer(we?255:0)},be.prototype._use=function(we,Me){return typeof we=="function"&&(we=we(Me)),we._getEncoder("der").tree},be.prototype._skipDefault=function(we,Me,$e){var Re=this._baseState,ke;if(Re.default===null)return!1;var Ne=we.join();if(Re.defaultBuffer===void 0&&(Re.defaultBuffer=this._encodeValue(Re.default,Me,$e).join()),Ne.length!==Re.defaultBuffer.length)return!1;for(ke=0;ke=31?$e.error("Multi-octet tag encoding unsupported"):(we||(Re|=32),Re|=pe.tagClassByName[Me||"universal"]<<6,Re)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var ae=inherits_browserExports,ie=requireDer();function he(oe){ie.call(this,oe),this.enc="pem"}return ae(he,ie),pem=he,he.prototype.encode=function(pe,se){for(var be=ie.prototype.encode.call(this,pe),ge=be.toString("base64"),_e=["-----BEGIN "+se.label+"-----"],Ee=0;Ee0&&We.ishrn(je),We}function ke(He,qe){He=Re(He,qe),He=He.mod(qe);var We=ae.from(He.toArray());if(We.length=0)throw new Error("invalid sig")}return verify_1=se,verify_1}var browser$3,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$3;hasRequiredBrowser$1=1;var ae=safeBufferExports$1.Buffer,ie=browser$9,he=readableBrowserExports,oe=inherits_browserExports,pe=requireSign(),se=requireVerify(),be=require$$6;Object.keys(be).forEach(function(Me){be[Me].id=ae.from(be[Me].id,"hex"),be[Me.toLowerCase()]=be[Me]});function ge(Me){he.Writable.call(this);var $e=be[Me];if(!$e)throw new Error("Unknown message digest");this._hashType=$e.hash,this._hash=ie($e.hash),this._tag=$e.id,this._signType=$e.sign}oe(ge,he.Writable),ge.prototype._write=function($e,Re,ke){this._hash.update($e),ke()},ge.prototype.update=function($e,Re){return this._hash.update(typeof $e=="string"?ae.from($e,Re):$e),this},ge.prototype.sign=function($e,Re){this.end();var ke=this._hash.digest(),Ne=pe(ke,$e,this._hashType,this._signType,this._tag);return Re?Ne.toString(Re):Ne};function _e(Me){he.Writable.call(this);var $e=be[Me];if(!$e)throw new Error("Unknown message digest");this._hash=ie($e.hash),this._tag=$e.id,this._signType=$e.sign}oe(_e,he.Writable),_e.prototype._write=function($e,Re,ke){this._hash.update($e),ke()},_e.prototype.update=function($e,Re){return this._hash.update(typeof $e=="string"?ae.from($e,Re):$e),this},_e.prototype.verify=function($e,Re,ke){var Ne=typeof Re=="string"?ae.from(Re,ke):Re;this.end();var ze=this._hash.digest();return se(Ne,ze,$e,this._signType,this._tag)};function Ee(Me){return new ge(Me)}function we(Me){return new _e(Me)}return browser$3={Sign:Ee,Verify:we,createSign:Ee,createVerify:we},browser$3}var bn$1={exports:{}};bn$1.exports,function(ae){(function(ie,he){function oe(me,ee){if(!me)throw new Error(ee||"Assertion failed")}function pe(me,ee){me.super_=ee;var re=function(){};re.prototype=ee.prototype,me.prototype=new re,me.prototype.constructor=me}function se(me,ee,re){if(se.isBN(me))return me;this.negative=0,this.words=null,this.length=0,this.red=null,me!==null&&((ee==="le"||ee==="be")&&(re=ee,ee=10),this._init(me||0,ee||10,re||"be"))}typeof ie=="object"?ie.exports=se:he.BN=se,se.BN=se,se.wordSize=26;var be;try{typeof window<"u"&&typeof window.Buffer<"u"?be=window.Buffer:be=requireDist().Buffer}catch{}se.isBN=function(ee){return ee instanceof se?!0:ee!==null&&typeof ee=="object"&&ee.constructor.wordSize===se.wordSize&&Array.isArray(ee.words)},se.max=function(ee,re){return ee.cmp(re)>0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn$1);var bnExports$1=bn$1.exports,browser$2,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$2;hasRequiredBrowser=1;var ae=requireElliptic(),ie=bnExports$1;browser$2=function(be){return new oe(be)};var he={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};he.p224=he.secp224r1,he.p256=he.secp256r1=he.prime256v1,he.p192=he.secp192r1=he.prime192v1,he.p384=he.secp384r1,he.p521=he.secp521r1;function oe(se){this.curveType=he[se],this.curveType||(this.curveType={name:se}),this.curve=new ae.ec(this.curveType.name),this.keys=void 0}oe.prototype.generateKeys=function(se,be){return this.keys=this.curve.genKeyPair(),this.getPublicKey(se,be)},oe.prototype.computeSecret=function(se,be,ge){be=be||"utf8",Buffer$j.isBuffer(se)||(se=new Buffer$j(se,be));var _e=this.curve.keyFromPublic(se).getPublic(),Ee=_e.mul(this.keys.getPrivate()).getX();return pe(Ee,ge,this.curveType.byteLength)},oe.prototype.getPublicKey=function(se,be){var ge=this.keys.getPublic(be==="compressed",!0);return be==="hybrid"&&(ge[ge.length-1]%2?ge[0]=7:ge[0]=6),pe(ge,se)},oe.prototype.getPrivateKey=function(se){return pe(this.keys.getPrivate(),se)},oe.prototype.setPublicKey=function(se,be){return be=be||"utf8",Buffer$j.isBuffer(se)||(se=new Buffer$j(se,be)),this.keys._importPublic(se),this},oe.prototype.setPrivateKey=function(se,be){be=be||"utf8",Buffer$j.isBuffer(se)||(se=new Buffer$j(se,be));var ge=new ie(se);return ge=ge.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(ge),this};function pe(se,be,ge){Array.isArray(se)||(se=se.toArray());var _e=new Buffer$j(se);if(ge&&_e.length0?ee:re},se.min=function(ee,re){return ee.cmp(re)<0?ee:re},se.prototype._init=function(ee,re,ne){if(typeof ee=="number")return this._initNumber(ee,re,ne);if(typeof ee=="object")return this._initArray(ee,re,ne);re==="hex"&&(re=16),oe(re===(re|0)&&re>=2&&re<=36),ee=ee.toString().replace(/\s+/g,"");var fe=0;ee[0]==="-"&&(fe++,this.negative=1),fe=0;fe-=3)ce=ee[fe]|ee[fe-1]<<8|ee[fe-2]<<16,this.words[le]|=ce<>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);else if(ne==="le")for(fe=0,le=0;fe>>26-ve&67108863,ve+=24,ve>=26&&(ve-=26,le++);return this.strip()};function ge(me,ee){var re=me.charCodeAt(ee);return re>=65&&re<=70?re-55:re>=97&&re<=102?re-87:re-48&15}function _e(me,ee,re){var ne=ge(me,re);return re-1>=ee&&(ne|=ge(me,re-1)<<4),ne}se.prototype._parseHex=function(ee,re,ne){this.length=Math.ceil((ee.length-re)/6),this.words=new Array(this.length);for(var fe=0;fe=re;fe-=2)ve=_e(ee,re,fe)<=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8;else{var ue=ee.length-re;for(fe=ue%2===0?re+1:re;fe=18?(le-=18,ce+=1,this.words[ce]|=ve>>>26):le+=8}this.strip()};function Ee(me,ee,re,ne){for(var fe=0,le=Math.min(me.length,re),ce=ee;ce=49?fe+=ve-49+10:ve>=17?fe+=ve-17+10:fe+=ve}return fe}se.prototype._parseBase=function(ee,re,ne){this.words=[0],this.length=1;for(var fe=0,le=1;le<=67108863;le*=re)fe++;fe--,le=le/re|0;for(var ce=ee.length-ne,ve=ce%fe,ue=Math.min(ce,ce-ve)+ne,te=0,de=ne;de1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},se.prototype.inspect=function(){return(this.red?""};var we=["","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"],Me=[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],$e=[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];se.prototype.toString=function(ee,re){ee=ee||10,re=re|0||1;var ne;if(ee===16||ee==="hex"){ne="";for(var fe=0,le=0,ce=0;ce>>24-fe&16777215,fe+=2,fe>=26&&(fe-=26,ce--),le!==0||ce!==this.length-1?ne=we[6-ue.length]+ue+ne:ne=ue+ne}for(le!==0&&(ne=le.toString(16)+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}if(ee===(ee|0)&&ee>=2&&ee<=36){var te=Me[ee],de=$e[ee];ne="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var xe=ye.modn(de).toString(ee);ye=ye.idivn(de),ye.isZero()?ne=xe+ne:ne=we[te-xe.length]+xe+ne}for(this.isZero()&&(ne="0"+ne);ne.length%re!==0;)ne="0"+ne;return this.negative!==0&&(ne="-"+ne),ne}oe(!1,"Base should be between 2 and 36")},se.prototype.toNumber=function(){var ee=this.words[0];return this.length===2?ee+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ee+=4503599627370496+this.words[1]*67108864:this.length>2&&oe(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ee:ee},se.prototype.toJSON=function(){return this.toString(16)},se.prototype.toBuffer=function(ee,re){return oe(typeof be<"u"),this.toArrayLike(be,ee,re)},se.prototype.toArray=function(ee,re){return this.toArrayLike(Array,ee,re)},se.prototype.toArrayLike=function(ee,re,ne){var fe=this.byteLength(),le=ne||Math.max(1,fe);oe(fe<=le,"byte array longer than desired length"),oe(le>0,"Requested array length <= 0"),this.strip();var ce=re==="le",ve=new ee(le),ue,te,de=this.clone();if(ce){for(te=0;!de.isZero();te++)ue=de.andln(255),de.iushrn(8),ve[te]=ue;for(;te=4096&&(ne+=13,re>>>=13),re>=64&&(ne+=7,re>>>=7),re>=8&&(ne+=4,re>>>=4),re>=2&&(ne+=2,re>>>=2),ne+re},se.prototype._zeroBits=function(ee){if(ee===0)return 26;var re=ee,ne=0;return re&8191||(ne+=13,re>>>=13),re&127||(ne+=7,re>>>=7),re&15||(ne+=4,re>>>=4),re&3||(ne+=2,re>>>=2),re&1||ne++,ne},se.prototype.bitLength=function(){var ee=this.words[this.length-1],re=this._countBits(ee);return(this.length-1)*26+re};function Re(me){for(var ee=new Array(me.bitLength()),re=0;re>>fe}return ee}se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ee=0,re=0;reee.length?this.clone().ior(ee):ee.clone().ior(this)},se.prototype.uor=function(ee){return this.length>ee.length?this.clone().iuor(ee):ee.clone().iuor(this)},se.prototype.iuand=function(ee){var re;this.length>ee.length?re=ee:re=this;for(var ne=0;neee.length?this.clone().iand(ee):ee.clone().iand(this)},se.prototype.uand=function(ee){return this.length>ee.length?this.clone().iuand(ee):ee.clone().iuand(this)},se.prototype.iuxor=function(ee){var re,ne;this.length>ee.length?(re=this,ne=ee):(re=ee,ne=this);for(var fe=0;feee.length?this.clone().ixor(ee):ee.clone().ixor(this)},se.prototype.uxor=function(ee){return this.length>ee.length?this.clone().iuxor(ee):ee.clone().iuxor(this)},se.prototype.inotn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=Math.ceil(ee/26)|0,ne=ee%26;this._expand(re),ne>0&&re--;for(var fe=0;fe0&&(this.words[fe]=~this.words[fe]&67108863>>26-ne),this.strip()},se.prototype.notn=function(ee){return this.clone().inotn(ee)},se.prototype.setn=function(ee,re){oe(typeof ee=="number"&&ee>=0);var ne=ee/26|0,fe=ee%26;return this._expand(ne+1),re?this.words[ne]=this.words[ne]|1<ee.length?(ne=this,fe=ee):(ne=ee,fe=this);for(var le=0,ce=0;ce>>26;for(;le!==0&&ce>>26;if(this.length=ne.length,le!==0)this.words[this.length]=le,this.length++;else if(ne!==this)for(;ceee.length?this.clone().iadd(ee):ee.clone().iadd(this)},se.prototype.isub=function(ee){if(ee.negative!==0){ee.negative=0;var re=this.iadd(ee);return ee.negative=1,re._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ee),this.negative=1,this._normSign();var ne=this.cmp(ee);if(ne===0)return this.negative=0,this.length=1,this.words[0]=0,this;var fe,le;ne>0?(fe=this,le=ee):(fe=ee,le=this);for(var ce=0,ve=0;ve>26,this.words[ve]=re&67108863;for(;ce!==0&&ve>26,this.words[ve]=re&67108863;if(ce===0&&ve>>26,ye=ue&67108863,xe=Math.min(te,ee.length-1),Pe=Math.max(0,te-me.length+1);Pe<=xe;Pe++){var Le=te-Pe|0;fe=me.words[Le]|0,le=ee.words[Pe]|0,ce=fe*le+ye,de+=ce/67108864|0,ye=ce&67108863}re.words[te]=ye|0,ue=de|0}return ue!==0?re.words[te]=ue|0:re.length--,re.strip()}var Ne=function(ee,re,ne){var fe=ee.words,le=re.words,ce=ne.words,ve=0,ue,te,de,ye=fe[0]|0,xe=ye&8191,Pe=ye>>>13,Le=fe[1]|0,De=Le&8191,Be=Le>>>13,Ce=fe[2]|0,Fe=Ce&8191,Ye=Ce>>>13,Ue=fe[3]|0,Te=Ue&8191,Ze=Ue>>>13,Nt=fe[4]|0,Qe=Nt&8191,ut=Nt>>>13,Ft=fe[5]|0,pt=Ft&8191,Je=Ft>>>13,zt=fe[6]|0,bt=zt&8191,gt=zt>>>13,Ht=fe[7]|0,vt=Ht&8191,Rt=Ht>>>13,Kt=fe[8]|0,yt=Kt&8191,It=Kt>>>13,Yt=fe[9]|0,_t=Yt&8191,Dt=Yt>>>13,Qt=le[0]|0,xt=Qt&8191,Tt=Qt>>>13,Wt=le[1]|0,St=Wt&8191,Ct=Wt>>>13,Vt=le[2]|0,Et=Vt&8191,Ot=Vt>>>13,Xt=le[3]|0,wt=Xt&8191,Pt=Xt>>>13,Jt=le[4]|0,$t=Jt&8191,kt=Jt>>>13,er=le[5]|0,Ie=er&8191,Se=er>>>13,Ae=le[6]|0,Oe=Ae&8191,Ke=Ae>>>13,at=le[7]|0,Ve=at&8191,ct=at>>>13,jt=le[8]|0,dt=jt&8191,Mt=jt>>>13,Ut=le[9]|0,Bt=Ut&8191,qt=Ut>>>13;ne.negative=ee.negative^re.negative,ne.length=19,ue=Math.imul(xe,xt),te=Math.imul(xe,Tt),te=te+Math.imul(Pe,xt)|0,de=Math.imul(Pe,Tt);var Gt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,ue=Math.imul(De,xt),te=Math.imul(De,Tt),te=te+Math.imul(Be,xt)|0,de=Math.imul(Be,Tt),ue=ue+Math.imul(xe,St)|0,te=te+Math.imul(xe,Ct)|0,te=te+Math.imul(Pe,St)|0,de=de+Math.imul(Pe,Ct)|0;var Zt=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ue=Math.imul(Fe,xt),te=Math.imul(Fe,Tt),te=te+Math.imul(Ye,xt)|0,de=Math.imul(Ye,Tt),ue=ue+Math.imul(De,St)|0,te=te+Math.imul(De,Ct)|0,te=te+Math.imul(Be,St)|0,de=de+Math.imul(Be,Ct)|0,ue=ue+Math.imul(xe,Et)|0,te=te+Math.imul(xe,Ot)|0,te=te+Math.imul(Pe,Et)|0,de=de+Math.imul(Pe,Ot)|0;var tr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(tr>>>26)|0,tr&=67108863,ue=Math.imul(Te,xt),te=Math.imul(Te,Tt),te=te+Math.imul(Ze,xt)|0,de=Math.imul(Ze,Tt),ue=ue+Math.imul(Fe,St)|0,te=te+Math.imul(Fe,Ct)|0,te=te+Math.imul(Ye,St)|0,de=de+Math.imul(Ye,Ct)|0,ue=ue+Math.imul(De,Et)|0,te=te+Math.imul(De,Ot)|0,te=te+Math.imul(Be,Et)|0,de=de+Math.imul(Be,Ot)|0,ue=ue+Math.imul(xe,wt)|0,te=te+Math.imul(xe,Pt)|0,te=te+Math.imul(Pe,wt)|0,de=de+Math.imul(Pe,Pt)|0;var rr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(rr>>>26)|0,rr&=67108863,ue=Math.imul(Qe,xt),te=Math.imul(Qe,Tt),te=te+Math.imul(ut,xt)|0,de=Math.imul(ut,Tt),ue=ue+Math.imul(Te,St)|0,te=te+Math.imul(Te,Ct)|0,te=te+Math.imul(Ze,St)|0,de=de+Math.imul(Ze,Ct)|0,ue=ue+Math.imul(Fe,Et)|0,te=te+Math.imul(Fe,Ot)|0,te=te+Math.imul(Ye,Et)|0,de=de+Math.imul(Ye,Ot)|0,ue=ue+Math.imul(De,wt)|0,te=te+Math.imul(De,Pt)|0,te=te+Math.imul(Be,wt)|0,de=de+Math.imul(Be,Pt)|0,ue=ue+Math.imul(xe,$t)|0,te=te+Math.imul(xe,kt)|0,te=te+Math.imul(Pe,$t)|0,de=de+Math.imul(Pe,kt)|0;var ir=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ir>>>26)|0,ir&=67108863,ue=Math.imul(pt,xt),te=Math.imul(pt,Tt),te=te+Math.imul(Je,xt)|0,de=Math.imul(Je,Tt),ue=ue+Math.imul(Qe,St)|0,te=te+Math.imul(Qe,Ct)|0,te=te+Math.imul(ut,St)|0,de=de+Math.imul(ut,Ct)|0,ue=ue+Math.imul(Te,Et)|0,te=te+Math.imul(Te,Ot)|0,te=te+Math.imul(Ze,Et)|0,de=de+Math.imul(Ze,Ot)|0,ue=ue+Math.imul(Fe,wt)|0,te=te+Math.imul(Fe,Pt)|0,te=te+Math.imul(Ye,wt)|0,de=de+Math.imul(Ye,Pt)|0,ue=ue+Math.imul(De,$t)|0,te=te+Math.imul(De,kt)|0,te=te+Math.imul(Be,$t)|0,de=de+Math.imul(Be,kt)|0,ue=ue+Math.imul(xe,Ie)|0,te=te+Math.imul(xe,Se)|0,te=te+Math.imul(Pe,Ie)|0,de=de+Math.imul(Pe,Se)|0;var nr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(nr>>>26)|0,nr&=67108863,ue=Math.imul(bt,xt),te=Math.imul(bt,Tt),te=te+Math.imul(gt,xt)|0,de=Math.imul(gt,Tt),ue=ue+Math.imul(pt,St)|0,te=te+Math.imul(pt,Ct)|0,te=te+Math.imul(Je,St)|0,de=de+Math.imul(Je,Ct)|0,ue=ue+Math.imul(Qe,Et)|0,te=te+Math.imul(Qe,Ot)|0,te=te+Math.imul(ut,Et)|0,de=de+Math.imul(ut,Ot)|0,ue=ue+Math.imul(Te,wt)|0,te=te+Math.imul(Te,Pt)|0,te=te+Math.imul(Ze,wt)|0,de=de+Math.imul(Ze,Pt)|0,ue=ue+Math.imul(Fe,$t)|0,te=te+Math.imul(Fe,kt)|0,te=te+Math.imul(Ye,$t)|0,de=de+Math.imul(Ye,kt)|0,ue=ue+Math.imul(De,Ie)|0,te=te+Math.imul(De,Se)|0,te=te+Math.imul(Be,Ie)|0,de=de+Math.imul(Be,Se)|0,ue=ue+Math.imul(xe,Oe)|0,te=te+Math.imul(xe,Ke)|0,te=te+Math.imul(Pe,Oe)|0,de=de+Math.imul(Pe,Ke)|0;var ar=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ar>>>26)|0,ar&=67108863,ue=Math.imul(vt,xt),te=Math.imul(vt,Tt),te=te+Math.imul(Rt,xt)|0,de=Math.imul(Rt,Tt),ue=ue+Math.imul(bt,St)|0,te=te+Math.imul(bt,Ct)|0,te=te+Math.imul(gt,St)|0,de=de+Math.imul(gt,Ct)|0,ue=ue+Math.imul(pt,Et)|0,te=te+Math.imul(pt,Ot)|0,te=te+Math.imul(Je,Et)|0,de=de+Math.imul(Je,Ot)|0,ue=ue+Math.imul(Qe,wt)|0,te=te+Math.imul(Qe,Pt)|0,te=te+Math.imul(ut,wt)|0,de=de+Math.imul(ut,Pt)|0,ue=ue+Math.imul(Te,$t)|0,te=te+Math.imul(Te,kt)|0,te=te+Math.imul(Ze,$t)|0,de=de+Math.imul(Ze,kt)|0,ue=ue+Math.imul(Fe,Ie)|0,te=te+Math.imul(Fe,Se)|0,te=te+Math.imul(Ye,Ie)|0,de=de+Math.imul(Ye,Se)|0,ue=ue+Math.imul(De,Oe)|0,te=te+Math.imul(De,Ke)|0,te=te+Math.imul(Be,Oe)|0,de=de+Math.imul(Be,Ke)|0,ue=ue+Math.imul(xe,Ve)|0,te=te+Math.imul(xe,ct)|0,te=te+Math.imul(Pe,Ve)|0,de=de+Math.imul(Pe,ct)|0;var fr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(fr>>>26)|0,fr&=67108863,ue=Math.imul(yt,xt),te=Math.imul(yt,Tt),te=te+Math.imul(It,xt)|0,de=Math.imul(It,Tt),ue=ue+Math.imul(vt,St)|0,te=te+Math.imul(vt,Ct)|0,te=te+Math.imul(Rt,St)|0,de=de+Math.imul(Rt,Ct)|0,ue=ue+Math.imul(bt,Et)|0,te=te+Math.imul(bt,Ot)|0,te=te+Math.imul(gt,Et)|0,de=de+Math.imul(gt,Ot)|0,ue=ue+Math.imul(pt,wt)|0,te=te+Math.imul(pt,Pt)|0,te=te+Math.imul(Je,wt)|0,de=de+Math.imul(Je,Pt)|0,ue=ue+Math.imul(Qe,$t)|0,te=te+Math.imul(Qe,kt)|0,te=te+Math.imul(ut,$t)|0,de=de+Math.imul(ut,kt)|0,ue=ue+Math.imul(Te,Ie)|0,te=te+Math.imul(Te,Se)|0,te=te+Math.imul(Ze,Ie)|0,de=de+Math.imul(Ze,Se)|0,ue=ue+Math.imul(Fe,Oe)|0,te=te+Math.imul(Fe,Ke)|0,te=te+Math.imul(Ye,Oe)|0,de=de+Math.imul(Ye,Ke)|0,ue=ue+Math.imul(De,Ve)|0,te=te+Math.imul(De,ct)|0,te=te+Math.imul(Be,Ve)|0,de=de+Math.imul(Be,ct)|0,ue=ue+Math.imul(xe,dt)|0,te=te+Math.imul(xe,Mt)|0,te=te+Math.imul(Pe,dt)|0,de=de+Math.imul(Pe,Mt)|0;var or=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(or>>>26)|0,or&=67108863,ue=Math.imul(_t,xt),te=Math.imul(_t,Tt),te=te+Math.imul(Dt,xt)|0,de=Math.imul(Dt,Tt),ue=ue+Math.imul(yt,St)|0,te=te+Math.imul(yt,Ct)|0,te=te+Math.imul(It,St)|0,de=de+Math.imul(It,Ct)|0,ue=ue+Math.imul(vt,Et)|0,te=te+Math.imul(vt,Ot)|0,te=te+Math.imul(Rt,Et)|0,de=de+Math.imul(Rt,Ot)|0,ue=ue+Math.imul(bt,wt)|0,te=te+Math.imul(bt,Pt)|0,te=te+Math.imul(gt,wt)|0,de=de+Math.imul(gt,Pt)|0,ue=ue+Math.imul(pt,$t)|0,te=te+Math.imul(pt,kt)|0,te=te+Math.imul(Je,$t)|0,de=de+Math.imul(Je,kt)|0,ue=ue+Math.imul(Qe,Ie)|0,te=te+Math.imul(Qe,Se)|0,te=te+Math.imul(ut,Ie)|0,de=de+Math.imul(ut,Se)|0,ue=ue+Math.imul(Te,Oe)|0,te=te+Math.imul(Te,Ke)|0,te=te+Math.imul(Ze,Oe)|0,de=de+Math.imul(Ze,Ke)|0,ue=ue+Math.imul(Fe,Ve)|0,te=te+Math.imul(Fe,ct)|0,te=te+Math.imul(Ye,Ve)|0,de=de+Math.imul(Ye,ct)|0,ue=ue+Math.imul(De,dt)|0,te=te+Math.imul(De,Mt)|0,te=te+Math.imul(Be,dt)|0,de=de+Math.imul(Be,Mt)|0,ue=ue+Math.imul(xe,Bt)|0,te=te+Math.imul(xe,qt)|0,te=te+Math.imul(Pe,Bt)|0,de=de+Math.imul(Pe,qt)|0;var ur=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(ur>>>26)|0,ur&=67108863,ue=Math.imul(_t,St),te=Math.imul(_t,Ct),te=te+Math.imul(Dt,St)|0,de=Math.imul(Dt,Ct),ue=ue+Math.imul(yt,Et)|0,te=te+Math.imul(yt,Ot)|0,te=te+Math.imul(It,Et)|0,de=de+Math.imul(It,Ot)|0,ue=ue+Math.imul(vt,wt)|0,te=te+Math.imul(vt,Pt)|0,te=te+Math.imul(Rt,wt)|0,de=de+Math.imul(Rt,Pt)|0,ue=ue+Math.imul(bt,$t)|0,te=te+Math.imul(bt,kt)|0,te=te+Math.imul(gt,$t)|0,de=de+Math.imul(gt,kt)|0,ue=ue+Math.imul(pt,Ie)|0,te=te+Math.imul(pt,Se)|0,te=te+Math.imul(Je,Ie)|0,de=de+Math.imul(Je,Se)|0,ue=ue+Math.imul(Qe,Oe)|0,te=te+Math.imul(Qe,Ke)|0,te=te+Math.imul(ut,Oe)|0,de=de+Math.imul(ut,Ke)|0,ue=ue+Math.imul(Te,Ve)|0,te=te+Math.imul(Te,ct)|0,te=te+Math.imul(Ze,Ve)|0,de=de+Math.imul(Ze,ct)|0,ue=ue+Math.imul(Fe,dt)|0,te=te+Math.imul(Fe,Mt)|0,te=te+Math.imul(Ye,dt)|0,de=de+Math.imul(Ye,Mt)|0,ue=ue+Math.imul(De,Bt)|0,te=te+Math.imul(De,qt)|0,te=te+Math.imul(Be,Bt)|0,de=de+Math.imul(Be,qt)|0;var lr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(lr>>>26)|0,lr&=67108863,ue=Math.imul(_t,Et),te=Math.imul(_t,Ot),te=te+Math.imul(Dt,Et)|0,de=Math.imul(Dt,Ot),ue=ue+Math.imul(yt,wt)|0,te=te+Math.imul(yt,Pt)|0,te=te+Math.imul(It,wt)|0,de=de+Math.imul(It,Pt)|0,ue=ue+Math.imul(vt,$t)|0,te=te+Math.imul(vt,kt)|0,te=te+Math.imul(Rt,$t)|0,de=de+Math.imul(Rt,kt)|0,ue=ue+Math.imul(bt,Ie)|0,te=te+Math.imul(bt,Se)|0,te=te+Math.imul(gt,Ie)|0,de=de+Math.imul(gt,Se)|0,ue=ue+Math.imul(pt,Oe)|0,te=te+Math.imul(pt,Ke)|0,te=te+Math.imul(Je,Oe)|0,de=de+Math.imul(Je,Ke)|0,ue=ue+Math.imul(Qe,Ve)|0,te=te+Math.imul(Qe,ct)|0,te=te+Math.imul(ut,Ve)|0,de=de+Math.imul(ut,ct)|0,ue=ue+Math.imul(Te,dt)|0,te=te+Math.imul(Te,Mt)|0,te=te+Math.imul(Ze,dt)|0,de=de+Math.imul(Ze,Mt)|0,ue=ue+Math.imul(Fe,Bt)|0,te=te+Math.imul(Fe,qt)|0,te=te+Math.imul(Ye,Bt)|0,de=de+Math.imul(Ye,qt)|0;var dr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(dr>>>26)|0,dr&=67108863,ue=Math.imul(_t,wt),te=Math.imul(_t,Pt),te=te+Math.imul(Dt,wt)|0,de=Math.imul(Dt,Pt),ue=ue+Math.imul(yt,$t)|0,te=te+Math.imul(yt,kt)|0,te=te+Math.imul(It,$t)|0,de=de+Math.imul(It,kt)|0,ue=ue+Math.imul(vt,Ie)|0,te=te+Math.imul(vt,Se)|0,te=te+Math.imul(Rt,Ie)|0,de=de+Math.imul(Rt,Se)|0,ue=ue+Math.imul(bt,Oe)|0,te=te+Math.imul(bt,Ke)|0,te=te+Math.imul(gt,Oe)|0,de=de+Math.imul(gt,Ke)|0,ue=ue+Math.imul(pt,Ve)|0,te=te+Math.imul(pt,ct)|0,te=te+Math.imul(Je,Ve)|0,de=de+Math.imul(Je,ct)|0,ue=ue+Math.imul(Qe,dt)|0,te=te+Math.imul(Qe,Mt)|0,te=te+Math.imul(ut,dt)|0,de=de+Math.imul(ut,Mt)|0,ue=ue+Math.imul(Te,Bt)|0,te=te+Math.imul(Te,qt)|0,te=te+Math.imul(Ze,Bt)|0,de=de+Math.imul(Ze,qt)|0;var cr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(cr>>>26)|0,cr&=67108863,ue=Math.imul(_t,$t),te=Math.imul(_t,kt),te=te+Math.imul(Dt,$t)|0,de=Math.imul(Dt,kt),ue=ue+Math.imul(yt,Ie)|0,te=te+Math.imul(yt,Se)|0,te=te+Math.imul(It,Ie)|0,de=de+Math.imul(It,Se)|0,ue=ue+Math.imul(vt,Oe)|0,te=te+Math.imul(vt,Ke)|0,te=te+Math.imul(Rt,Oe)|0,de=de+Math.imul(Rt,Ke)|0,ue=ue+Math.imul(bt,Ve)|0,te=te+Math.imul(bt,ct)|0,te=te+Math.imul(gt,Ve)|0,de=de+Math.imul(gt,ct)|0,ue=ue+Math.imul(pt,dt)|0,te=te+Math.imul(pt,Mt)|0,te=te+Math.imul(Je,dt)|0,de=de+Math.imul(Je,Mt)|0,ue=ue+Math.imul(Qe,Bt)|0,te=te+Math.imul(Qe,qt)|0,te=te+Math.imul(ut,Bt)|0,de=de+Math.imul(ut,qt)|0;var pr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(pr>>>26)|0,pr&=67108863,ue=Math.imul(_t,Ie),te=Math.imul(_t,Se),te=te+Math.imul(Dt,Ie)|0,de=Math.imul(Dt,Se),ue=ue+Math.imul(yt,Oe)|0,te=te+Math.imul(yt,Ke)|0,te=te+Math.imul(It,Oe)|0,de=de+Math.imul(It,Ke)|0,ue=ue+Math.imul(vt,Ve)|0,te=te+Math.imul(vt,ct)|0,te=te+Math.imul(Rt,Ve)|0,de=de+Math.imul(Rt,ct)|0,ue=ue+Math.imul(bt,dt)|0,te=te+Math.imul(bt,Mt)|0,te=te+Math.imul(gt,dt)|0,de=de+Math.imul(gt,Mt)|0,ue=ue+Math.imul(pt,Bt)|0,te=te+Math.imul(pt,qt)|0,te=te+Math.imul(Je,Bt)|0,de=de+Math.imul(Je,qt)|0;var vr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(vr>>>26)|0,vr&=67108863,ue=Math.imul(_t,Oe),te=Math.imul(_t,Ke),te=te+Math.imul(Dt,Oe)|0,de=Math.imul(Dt,Ke),ue=ue+Math.imul(yt,Ve)|0,te=te+Math.imul(yt,ct)|0,te=te+Math.imul(It,Ve)|0,de=de+Math.imul(It,ct)|0,ue=ue+Math.imul(vt,dt)|0,te=te+Math.imul(vt,Mt)|0,te=te+Math.imul(Rt,dt)|0,de=de+Math.imul(Rt,Mt)|0,ue=ue+Math.imul(bt,Bt)|0,te=te+Math.imul(bt,qt)|0,te=te+Math.imul(gt,Bt)|0,de=de+Math.imul(gt,qt)|0;var yr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(yr>>>26)|0,yr&=67108863,ue=Math.imul(_t,Ve),te=Math.imul(_t,ct),te=te+Math.imul(Dt,Ve)|0,de=Math.imul(Dt,ct),ue=ue+Math.imul(yt,dt)|0,te=te+Math.imul(yt,Mt)|0,te=te+Math.imul(It,dt)|0,de=de+Math.imul(It,Mt)|0,ue=ue+Math.imul(vt,Bt)|0,te=te+Math.imul(vt,qt)|0,te=te+Math.imul(Rt,Bt)|0,de=de+Math.imul(Rt,qt)|0;var br=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(br>>>26)|0,br&=67108863,ue=Math.imul(_t,dt),te=Math.imul(_t,Mt),te=te+Math.imul(Dt,dt)|0,de=Math.imul(Dt,Mt),ue=ue+Math.imul(yt,Bt)|0,te=te+Math.imul(yt,qt)|0,te=te+Math.imul(It,Bt)|0,de=de+Math.imul(It,qt)|0;var gr=(ve+ue|0)+((te&8191)<<13)|0;ve=(de+(te>>>13)|0)+(gr>>>26)|0,gr&=67108863,ue=Math.imul(_t,Bt),te=Math.imul(_t,qt),te=te+Math.imul(Dt,Bt)|0,de=Math.imul(Dt,qt);var wr=(ve+ue|0)+((te&8191)<<13)|0;return ve=(de+(te>>>13)|0)+(wr>>>26)|0,wr&=67108863,ce[0]=Gt,ce[1]=Zt,ce[2]=tr,ce[3]=rr,ce[4]=ir,ce[5]=nr,ce[6]=ar,ce[7]=fr,ce[8]=or,ce[9]=ur,ce[10]=lr,ce[11]=dr,ce[12]=cr,ce[13]=pr,ce[14]=vr,ce[15]=yr,ce[16]=br,ce[17]=gr,ce[18]=wr,ve!==0&&(ce[19]=ve,ne.length++),ne};Math.imul||(Ne=ke);function ze(me,ee,re){re.negative=ee.negative^me.negative,re.length=me.length+ee.length;for(var ne=0,fe=0,le=0;le>>26)|0,fe+=ce>>>26,ce&=67108863}re.words[le]=ve,ne=ce,ce=fe}return ne!==0?re.words[le]=ne:re.length--,re.strip()}function He(me,ee,re){var ne=new qe;return ne.mulp(me,ee,re)}se.prototype.mulTo=function(ee,re){var ne,fe=this.length+ee.length;return this.length===10&&ee.length===10?ne=Ne(this,ee,re):fe<63?ne=ke(this,ee,re):fe<1024?ne=ze(this,ee,re):ne=He(this,ee,re),ne};function qe(me,ee){this.x=me,this.y=ee}qe.prototype.makeRBT=function(ee){for(var re=new Array(ee),ne=se.prototype._countBits(ee)-1,fe=0;fe>=1;return fe},qe.prototype.permute=function(ee,re,ne,fe,le,ce){for(var ve=0;ve>>1)le++;return 1<>>13,ne[2*ce+1]=le&8191,le=le>>>13;for(ce=2*re;ce>=26,re+=fe/67108864|0,re+=le>>>26,this.words[ne]=le&67108863}return re!==0&&(this.words[ne]=re,this.length++),this},se.prototype.muln=function(ee){return this.clone().imuln(ee)},se.prototype.sqr=function(){return this.mul(this)},se.prototype.isqr=function(){return this.imul(this.clone())},se.prototype.pow=function(ee){var re=Re(ee);if(re.length===0)return new se(1);for(var ne=this,fe=0;fe=0);var re=ee%26,ne=(ee-re)/26,fe=67108863>>>26-re<<26-re,le;if(re!==0){var ce=0;for(le=0;le>>26-re}ce&&(this.words[le]=ce,this.length++)}if(ne!==0){for(le=this.length-1;le>=0;le--)this.words[le+ne]=this.words[le];for(le=0;le=0);var fe;re?fe=(re-re%26)/26:fe=0;var le=ee%26,ce=Math.min((ee-le)/26,this.length),ve=67108863^67108863>>>le<ce)for(this.length-=ce,te=0;te=0&&(de!==0||te>=fe);te--){var ye=this.words[te]|0;this.words[te]=de<<26-le|ye>>>le,de=ye&ve}return ue&&de!==0&&(ue.words[ue.length++]=de),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},se.prototype.ishrn=function(ee,re,ne){return oe(this.negative===0),this.iushrn(ee,re,ne)},se.prototype.shln=function(ee){return this.clone().ishln(ee)},se.prototype.ushln=function(ee){return this.clone().iushln(ee)},se.prototype.shrn=function(ee){return this.clone().ishrn(ee)},se.prototype.ushrn=function(ee){return this.clone().iushrn(ee)},se.prototype.testn=function(ee){oe(typeof ee=="number"&&ee>=0);var re=ee%26,ne=(ee-re)/26,fe=1<=0);var re=ee%26,ne=(ee-re)/26;if(oe(this.negative===0,"imaskn works only with positive numbers"),this.length<=ne)return this;if(re!==0&&ne++,this.length=Math.min(ne,this.length),re!==0){var fe=67108863^67108863>>>re<=67108864;re++)this.words[re]-=67108864,re===this.length-1?this.words[re+1]=1:this.words[re+1]++;return this.length=Math.max(this.length,re+1),this},se.prototype.isubn=function(ee){if(oe(typeof ee=="number"),oe(ee<67108864),ee<0)return this.iaddn(-ee);if(this.negative!==0)return this.negative=0,this.iaddn(ee),this.negative=1,this;if(this.words[0]-=ee,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var re=0;re>26)-(ue/67108864|0),this.words[le+ne]=ce&67108863}for(;le>26,this.words[le+ne]=ce&67108863;if(ve===0)return this.strip();for(oe(ve===-1),ve=0,le=0;le>26,this.words[le]=ce&67108863;return this.negative=1,this.strip()},se.prototype._wordDiv=function(ee,re){var ne=this.length-ee.length,fe=this.clone(),le=ee,ce=le.words[le.length-1]|0,ve=this._countBits(ce);ne=26-ve,ne!==0&&(le=le.ushln(ne),fe.iushln(ne),ce=le.words[le.length-1]|0);var ue=fe.length-le.length,te;if(re!=="mod"){te=new se(null),te.length=ue+1,te.words=new Array(te.length);for(var de=0;de=0;xe--){var Pe=(fe.words[le.length+xe]|0)*67108864+(fe.words[le.length+xe-1]|0);for(Pe=Math.min(Pe/ce|0,67108863),fe._ishlnsubmul(le,Pe,xe);fe.negative!==0;)Pe--,fe.negative=0,fe._ishlnsubmul(le,1,xe),fe.isZero()||(fe.negative^=1);te&&(te.words[xe]=Pe)}return te&&te.strip(),fe.strip(),re!=="div"&&ne!==0&&fe.iushrn(ne),{div:te||null,mod:fe}},se.prototype.divmod=function(ee,re,ne){if(oe(!ee.isZero()),this.isZero())return{div:new se(0),mod:new se(0)};var fe,le,ce;return this.negative!==0&&ee.negative===0?(ce=this.neg().divmod(ee,re),re!=="mod"&&(fe=ce.div.neg()),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.iadd(ee)),{div:fe,mod:le}):this.negative===0&&ee.negative!==0?(ce=this.divmod(ee.neg(),re),re!=="mod"&&(fe=ce.div.neg()),{div:fe,mod:ce.mod}):this.negative&ee.negative?(ce=this.neg().divmod(ee.neg(),re),re!=="div"&&(le=ce.mod.neg(),ne&&le.negative!==0&&le.isub(ee)),{div:ce.div,mod:le}):ee.length>this.length||this.cmp(ee)<0?{div:new se(0),mod:this}:ee.length===1?re==="div"?{div:this.divn(ee.words[0]),mod:null}:re==="mod"?{div:null,mod:new se(this.modn(ee.words[0]))}:{div:this.divn(ee.words[0]),mod:new se(this.modn(ee.words[0]))}:this._wordDiv(ee,re)},se.prototype.div=function(ee){return this.divmod(ee,"div",!1).div},se.prototype.mod=function(ee){return this.divmod(ee,"mod",!1).mod},se.prototype.umod=function(ee){return this.divmod(ee,"mod",!0).mod},se.prototype.divRound=function(ee){var re=this.divmod(ee);if(re.mod.isZero())return re.div;var ne=re.div.negative!==0?re.mod.isub(ee):re.mod,fe=ee.ushrn(1),le=ee.andln(1),ce=ne.cmp(fe);return ce<0||le===1&&ce===0?re.div:re.div.negative!==0?re.div.isubn(1):re.div.iaddn(1)},se.prototype.modn=function(ee){oe(ee<=67108863);for(var re=(1<<26)%ee,ne=0,fe=this.length-1;fe>=0;fe--)ne=(re*ne+(this.words[fe]|0))%ee;return ne},se.prototype.idivn=function(ee){oe(ee<=67108863);for(var re=0,ne=this.length-1;ne>=0;ne--){var fe=(this.words[ne]|0)+re*67108864;this.words[ne]=fe/ee|0,re=fe%ee}return this.strip()},se.prototype.divn=function(ee){return this.clone().idivn(ee)},se.prototype.egcd=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=new se(0),ve=new se(1),ue=0;re.isEven()&&ne.isEven();)re.iushrn(1),ne.iushrn(1),++ue;for(var te=ne.clone(),de=re.clone();!re.isZero();){for(var ye=0,xe=1;!(re.words[0]&xe)&&ye<26;++ye,xe<<=1);if(ye>0)for(re.iushrn(ye);ye-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(te),le.isub(de)),fe.iushrn(1),le.iushrn(1);for(var Pe=0,Le=1;!(ne.words[0]&Le)&&Pe<26;++Pe,Le<<=1);if(Pe>0)for(ne.iushrn(Pe);Pe-- >0;)(ce.isOdd()||ve.isOdd())&&(ce.iadd(te),ve.isub(de)),ce.iushrn(1),ve.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(ce),le.isub(ve)):(ne.isub(re),ce.isub(fe),ve.isub(le))}return{a:ce,b:ve,gcd:ne.iushln(ue)}},se.prototype._invmp=function(ee){oe(ee.negative===0),oe(!ee.isZero());var re=this,ne=ee.clone();re.negative!==0?re=re.umod(ee):re=re.clone();for(var fe=new se(1),le=new se(0),ce=ne.clone();re.cmpn(1)>0&&ne.cmpn(1)>0;){for(var ve=0,ue=1;!(re.words[0]&ue)&&ve<26;++ve,ue<<=1);if(ve>0)for(re.iushrn(ve);ve-- >0;)fe.isOdd()&&fe.iadd(ce),fe.iushrn(1);for(var te=0,de=1;!(ne.words[0]&de)&&te<26;++te,de<<=1);if(te>0)for(ne.iushrn(te);te-- >0;)le.isOdd()&&le.iadd(ce),le.iushrn(1);re.cmp(ne)>=0?(re.isub(ne),fe.isub(le)):(ne.isub(re),le.isub(fe))}var ye;return re.cmpn(1)===0?ye=fe:ye=le,ye.cmpn(0)<0&&ye.iadd(ee),ye},se.prototype.gcd=function(ee){if(this.isZero())return ee.abs();if(ee.isZero())return this.abs();var re=this.clone(),ne=ee.clone();re.negative=0,ne.negative=0;for(var fe=0;re.isEven()&&ne.isEven();fe++)re.iushrn(1),ne.iushrn(1);do{for(;re.isEven();)re.iushrn(1);for(;ne.isEven();)ne.iushrn(1);var le=re.cmp(ne);if(le<0){var ce=re;re=ne,ne=ce}else if(le===0||ne.cmpn(1)===0)break;re.isub(ne)}while(!0);return ne.iushln(fe)},se.prototype.invm=function(ee){return this.egcd(ee).a.umod(ee)},se.prototype.isEven=function(){return(this.words[0]&1)===0},se.prototype.isOdd=function(){return(this.words[0]&1)===1},se.prototype.andln=function(ee){return this.words[0]&ee},se.prototype.bincn=function(ee){oe(typeof ee=="number");var re=ee%26,ne=(ee-re)/26,fe=1<>>26,ve&=67108863,this.words[ce]=ve}return le!==0&&(this.words[ce]=le,this.length++),this},se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},se.prototype.cmpn=function(ee){var re=ee<0;if(this.negative!==0&&!re)return-1;if(this.negative===0&&re)return 1;this.strip();var ne;if(this.length>1)ne=1;else{re&&(ee=-ee),oe(ee<=67108863,"Number is too big");var fe=this.words[0]|0;ne=fe===ee?0:feee.length)return 1;if(this.length=0;ne--){var fe=this.words[ne]|0,le=ee.words[ne]|0;if(fe!==le){fele&&(re=1);break}}return re},se.prototype.gtn=function(ee){return this.cmpn(ee)===1},se.prototype.gt=function(ee){return this.cmp(ee)===1},se.prototype.gten=function(ee){return this.cmpn(ee)>=0},se.prototype.gte=function(ee){return this.cmp(ee)>=0},se.prototype.ltn=function(ee){return this.cmpn(ee)===-1},se.prototype.lt=function(ee){return this.cmp(ee)===-1},se.prototype.lten=function(ee){return this.cmpn(ee)<=0},se.prototype.lte=function(ee){return this.cmp(ee)<=0},se.prototype.eqn=function(ee){return this.cmpn(ee)===0},se.prototype.eq=function(ee){return this.cmp(ee)===0},se.red=function(ee){return new Ge(ee)},se.prototype.toRed=function(ee){return oe(!this.red,"Already a number in reduction context"),oe(this.negative===0,"red works only with positives"),ee.convertTo(this)._forceRed(ee)},se.prototype.fromRed=function(){return oe(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},se.prototype._forceRed=function(ee){return this.red=ee,this},se.prototype.forceRed=function(ee){return oe(!this.red,"Already a number in reduction context"),this._forceRed(ee)},se.prototype.redAdd=function(ee){return oe(this.red,"redAdd works only with red numbers"),this.red.add(this,ee)},se.prototype.redIAdd=function(ee){return oe(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ee)},se.prototype.redSub=function(ee){return oe(this.red,"redSub works only with red numbers"),this.red.sub(this,ee)},se.prototype.redISub=function(ee){return oe(this.red,"redISub works only with red numbers"),this.red.isub(this,ee)},se.prototype.redShl=function(ee){return oe(this.red,"redShl works only with red numbers"),this.red.shl(this,ee)},se.prototype.redMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.mul(this,ee)},se.prototype.redIMul=function(ee){return oe(this.red,"redMul works only with red numbers"),this.red._verify2(this,ee),this.red.imul(this,ee)},se.prototype.redSqr=function(){return oe(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},se.prototype.redISqr=function(){return oe(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},se.prototype.redSqrt=function(){return oe(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},se.prototype.redInvm=function(){return oe(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},se.prototype.redNeg=function(){return oe(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},se.prototype.redPow=function(ee){return oe(this.red&&!ee.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ee)};var We={k256:null,p224:null,p192:null,p25519:null};function je(me,ee){this.name=me,this.p=new se(ee,16),this.n=this.p.bitLength(),this.k=new se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}je.prototype._tmp=function(){var ee=new se(null);return ee.words=new Array(Math.ceil(this.n/13)),ee},je.prototype.ireduce=function(ee){var re=ee,ne;do this.split(re,this.tmp),re=this.imulK(re),re=re.iadd(this.tmp),ne=re.bitLength();while(ne>this.n);var fe=ne0?re.isub(this.p):re.strip!==void 0?re.strip():re._strip(),re},je.prototype.split=function(ee,re){ee.iushrn(this.n,0,re)},je.prototype.imulK=function(ee){return ee.imul(this.k)};function Xe(){je.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}pe(Xe,je),Xe.prototype.split=function(ee,re){for(var ne=4194303,fe=Math.min(ee.length,9),le=0;le>>22,ce=ve}ce>>>=22,ee.words[le-10]=ce,ce===0&&ee.length>10?ee.length-=10:ee.length-=9},Xe.prototype.imulK=function(ee){ee.words[ee.length]=0,ee.words[ee.length+1]=0,ee.length+=2;for(var re=0,ne=0;ne>>=26,ee.words[ne]=le,re=fe}return re!==0&&(ee.words[ee.length++]=re),ee},se._prime=function(ee){if(We[ee])return We[ee];var re;if(ee==="k256")re=new Xe;else if(ee==="p224")re=new lt;else if(ee==="p192")re=new At;else if(ee==="p25519")re=new mt;else throw new Error("Unknown prime "+ee);return We[ee]=re,re};function Ge(me){if(typeof me=="string"){var ee=se._prime(me);this.m=ee.p,this.prime=ee}else oe(me.gtn(1),"modulus must be greater than 1"),this.m=me,this.prime=null}Ge.prototype._verify1=function(ee){oe(ee.negative===0,"red works only with positives"),oe(ee.red,"red works only with red numbers")},Ge.prototype._verify2=function(ee,re){oe((ee.negative|re.negative)===0,"red works only with positives"),oe(ee.red&&ee.red===re.red,"red works only with red numbers")},Ge.prototype.imod=function(ee){return this.prime?this.prime.ireduce(ee)._forceRed(this):ee.umod(this.m)._forceRed(this)},Ge.prototype.neg=function(ee){return ee.isZero()?ee.clone():this.m.sub(ee)._forceRed(this)},Ge.prototype.add=function(ee,re){this._verify2(ee,re);var ne=ee.add(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne._forceRed(this)},Ge.prototype.iadd=function(ee,re){this._verify2(ee,re);var ne=ee.iadd(re);return ne.cmp(this.m)>=0&&ne.isub(this.m),ne},Ge.prototype.sub=function(ee,re){this._verify2(ee,re);var ne=ee.sub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne._forceRed(this)},Ge.prototype.isub=function(ee,re){this._verify2(ee,re);var ne=ee.isub(re);return ne.cmpn(0)<0&&ne.iadd(this.m),ne},Ge.prototype.shl=function(ee,re){return this._verify1(ee),this.imod(ee.ushln(re))},Ge.prototype.imul=function(ee,re){return this._verify2(ee,re),this.imod(ee.imul(re))},Ge.prototype.mul=function(ee,re){return this._verify2(ee,re),this.imod(ee.mul(re))},Ge.prototype.isqr=function(ee){return this.imul(ee,ee.clone())},Ge.prototype.sqr=function(ee){return this.mul(ee,ee)},Ge.prototype.sqrt=function(ee){if(ee.isZero())return ee.clone();var re=this.m.andln(3);if(oe(re%2===1),re===3){var ne=this.m.add(new se(1)).iushrn(2);return this.pow(ee,ne)}for(var fe=this.m.subn(1),le=0;!fe.isZero()&&fe.andln(1)===0;)le++,fe.iushrn(1);oe(!fe.isZero());var ce=new se(1).toRed(this),ve=ce.redNeg(),ue=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new se(2*te*te).toRed(this);this.pow(te,ue).cmp(ve)!==0;)te.redIAdd(ve);for(var de=this.pow(te,fe),ye=this.pow(ee,fe.addn(1).iushrn(1)),xe=this.pow(ee,fe),Pe=le;xe.cmp(ce)!==0;){for(var Le=xe,De=0;Le.cmp(ce)!==0;De++)Le=Le.redSqr();oe(De=0;le--){for(var de=re.words[le],ye=te-1;ye>=0;ye--){var xe=de>>ye&1;if(ce!==fe[0]&&(ce=this.sqr(ce)),xe===0&&ve===0){ue=0;continue}ve<<=1,ve|=xe,ue++,!(ue!==ne&&(le!==0||ye!==0))&&(ce=this.mul(ce,fe[ve]),ue=0,ve=0)}te=26}return ce},Ge.prototype.convertTo=function(ee){var re=ee.umod(this.m);return re===ee?re.clone():re},Ge.prototype.convertFrom=function(ee){var re=ee.clone();return re.red=null,re},se.mont=function(ee){return new Lt(ee)};function Lt(me){Ge.call(this,me),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new se(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)}pe(Lt,Ge),Lt.prototype.convertTo=function(ee){return this.imod(ee.ushln(this.shift))},Lt.prototype.convertFrom=function(ee){var re=this.imod(ee.mul(this.rinv));return re.red=null,re},Lt.prototype.imul=function(ee,re){if(ee.isZero()||re.isZero())return ee.words[0]=0,ee.length=1,ee;var ne=ee.imul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.mul=function(ee,re){if(ee.isZero()||re.isZero())return new se(0)._forceRed(this);var ne=ee.mul(re),fe=ne.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),le=ne.isub(fe).iushrn(this.shift),ce=le;return le.cmp(this.m)>=0?ce=le.isub(this.m):le.cmpn(0)<0&&(ce=le.iadd(this.m)),ce._forceRed(this)},Lt.prototype.invm=function(ee){var re=this.imod(ee._invmp(this.m).mul(this.r2));return re._forceRed(this)}})(ae,commonjsGlobal)}(bn);var bnExports=bn.exports,BN$2=bnExports,Buffer$3=safeBufferExports$1.Buffer;function withPublic$2(ae,ie){return Buffer$3.from(ae.toRed(BN$2.mont(ie.modulus)).redPow(new BN$2(ie.publicExponent)).fromRed().toArray())}var withPublic_1=withPublic$2,parseKeys$1=parseAsn1,randomBytes=browserExports,createHash$1=browser$9,mgf$1=mgf$2,xor$1=xor$2,BN$1=bnExports,withPublic$1=withPublic_1,crt$1=browserifyRsa,Buffer$2=safeBufferExports$1.Buffer,publicEncrypt=function ae(ie,he,oe){var pe;ie.padding?pe=ie.padding:oe?pe=1:pe=4;var se=parseKeys$1(ie),be;if(pe===4)be=oaep$1(se,he);else if(pe===1)be=pkcs1$1(se,he,oe);else if(pe===3){if(be=new BN$1(he),be.cmp(se.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return oe?crt$1(be,se):withPublic$1(be,se)};function oaep$1(ae,ie){var he=ae.modulus.byteLength(),oe=ie.length,pe=createHash$1("sha1").update(Buffer$2.alloc(0)).digest(),se=pe.length,be=2*se;if(oe>he-be-2)throw new Error("message too long");var ge=Buffer$2.alloc(he-oe-be-2),_e=he-se-1,Ee=randomBytes(se),we=xor$1(Buffer$2.concat([pe,ge,Buffer$2.alloc(1,1),ie],_e),mgf$1(Ee,_e)),Me=xor$1(Ee,mgf$1(we,se));return new BN$1(Buffer$2.concat([Buffer$2.alloc(1),Me,we],he))}function pkcs1$1(ae,ie,he){var oe=ie.length,pe=ae.modulus.byteLength();if(oe>pe-11)throw new Error("message too long");var se;return he?se=Buffer$2.alloc(pe-oe-3,255):se=nonZero(pe-oe-3),new BN$1(Buffer$2.concat([Buffer$2.from([0,he?1:2]),se,Buffer$2.alloc(1),ie],pe))}function nonZero(ae){for(var ie=Buffer$2.allocUnsafe(ae),he=0,oe=randomBytes(ae*2),pe=0,se;hebe||new BN(he).cmp(se.modulus)>=0)throw new Error("decryption error");var ge;oe?ge=withPublic(new BN(he),se):ge=crt(he,se);var _e=Buffer$1.alloc(be-ge.length);if(ge=Buffer$1.concat([_e,ge],be),pe===4)return oaep(se,ge);if(pe===1)return pkcs1(se,ge,oe);if(pe===3)return ge;throw new Error("unknown padding")};function oaep(ae,ie){var he=ae.modulus.byteLength(),oe=createHash("sha1").update(Buffer$1.alloc(0)).digest(),pe=oe.length;if(ie[0]!==0)throw new Error("decryption error");var se=ie.slice(1,pe+1),be=ie.slice(pe+1),ge=xor(se,mgf(be,pe)),_e=xor(be,mgf(ge,he-pe-1));if(compare(oe,_e.slice(0,pe)))throw new Error("decryption error");for(var Ee=pe;_e[Ee]===0;)Ee++;if(_e[Ee++]!==1)throw new Error("decryption error");return _e.slice(Ee)}function pkcs1(ae,ie,he){for(var oe=ie.slice(0,2),pe=2,se=0;ie[pe++]!==0;)if(pe>=ie.length){se++;break}var be=ie.slice(2,pe-1);if((oe.toString("hex")!=="0002"&&!he||oe.toString("hex")!=="0001"&&he)&&se++,be.length<8&&se++,se)throw new Error("decryption error");return ie.slice(pe)}function compare(ae,ie){ae=Buffer$1.from(ae),ie=Buffer$1.from(ie);var he=0,oe=ae.length;ae.length!==ie.length&&(he++,oe=Math.min(ae.length,ie.length));for(var pe=-1;++pekMaxUint32||ae<0)throw new TypeError("offset must be a uint32");if(ae>kBufferMaxLength||ae>ie)throw new RangeError("offset out of range")}function assertSize(ae,ie,he){if(typeof ae!="number"||ae!==ae)throw new TypeError("size must be a number");if(ae>kMaxUint32||ae<0)throw new TypeError("size must be a uint32");if(ae+ie>he||ae>kBufferMaxLength)throw new RangeError("buffer too small")}crypto&&crypto.getRandomValues||!process$1.browser?(browser.randomFill=randomFill,browser.randomFillSync=randomFillSync):(browser.randomFill=oldBrowser,browser.randomFillSync=oldBrowser);function randomFill(ae,ie,he,oe){if(!Buffer.isBuffer(ae)&&!(ae instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof ie=="function")oe=ie,ie=0,he=ae.length;else if(typeof he=="function")oe=he,he=ae.length-ie;else if(typeof oe!="function")throw new TypeError('"cb" argument must be a function');return assertOffset(ie,ae.length),assertSize(he,ie,ae.length),actualFill(ae,ie,he,oe)}function actualFill(ae,ie,he,oe){if(process$1.browser){var pe=ae.buffer,se=new Uint8Array(pe,ie,he);if(crypto.getRandomValues(se),oe){process$1.nextTick(function(){oe(null,ae)});return}return ae}if(oe){randombytes(he,function(ge,_e){if(ge)return oe(ge);_e.copy(ae,ie),oe(null,ae)});return}var be=randombytes(he);return be.copy(ae,ie),ae}function randomFillSync(ae,ie,he){if(typeof ie>"u"&&(ie=0),!Buffer.isBuffer(ae)&&!(ae instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return assertOffset(ie,ae.length),he===void 0&&(he=ae.length-ie),assertSize(he,ie,ae.length),actualFill(ae,ie,he)}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=browserExports,cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$9,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=browser$8;var ae=algos,ie=Object.keys(ae),he=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(ie);cryptoBrowserify.getHashes=function(){return he};var oe=browser$7;cryptoBrowserify.pbkdf2=oe.pbkdf2,cryptoBrowserify.pbkdf2Sync=oe.pbkdf2Sync;var pe=browser$6;cryptoBrowserify.Cipher=pe.Cipher,cryptoBrowserify.createCipher=pe.createCipher,cryptoBrowserify.Cipheriv=pe.Cipheriv,cryptoBrowserify.createCipheriv=pe.createCipheriv,cryptoBrowserify.Decipher=pe.Decipher,cryptoBrowserify.createDecipher=pe.createDecipher,cryptoBrowserify.Decipheriv=pe.Decipheriv,cryptoBrowserify.createDecipheriv=pe.createDecipheriv,cryptoBrowserify.getCiphers=pe.getCiphers,cryptoBrowserify.listCiphers=pe.listCiphers;var se=requireBrowser$2();cryptoBrowserify.DiffieHellmanGroup=se.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=se.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=se.getDiffieHellman,cryptoBrowserify.createDiffieHellman=se.createDiffieHellman,cryptoBrowserify.DiffieHellman=se.DiffieHellman;var be=requireBrowser$1();cryptoBrowserify.createSign=be.createSign,cryptoBrowserify.Sign=be.Sign,cryptoBrowserify.createVerify=be.createVerify,cryptoBrowserify.Verify=be.Verify,cryptoBrowserify.createECDH=requireBrowser();var ge=browser$1;cryptoBrowserify.publicEncrypt=ge.publicEncrypt,cryptoBrowserify.privateEncrypt=ge.privateEncrypt,cryptoBrowserify.publicDecrypt=ge.publicDecrypt,cryptoBrowserify.privateDecrypt=ge.privateDecrypt;var _e=browser;return cryptoBrowserify.randomFill=_e.randomFill,cryptoBrowserify.randomFillSync=_e.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet we accept pull requests https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}(function(ae){(function(){var ie="input is invalid type",he="finalize already called",oe=typeof window=="object",pe=oe?window:{};pe.JS_MD5_NO_WINDOW&&(oe=!1);var se=!oe&&typeof self=="object",be=!pe.JS_MD5_NO_NODE_JS&&typeof process$1=="object"&&process$1.versions&&process$1.versions.node;be?pe=commonjsGlobal:se&&(pe=self);var ge=!pe.JS_MD5_NO_COMMON_JS&&!0&&ae.exports,_e=!pe.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",Ee="0123456789abcdef".split(""),we=[128,32768,8388608,-2147483648],Me=[0,8,16,24],$e=["hex","array","digest","buffer","arrayBuffer","base64"],Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ke=[],Ne;if(_e){var ze=new ArrayBuffer(68);Ne=new Uint8Array(ze),ke=new Uint32Array(ze)}var He=Array.isArray;(pe.JS_MD5_NO_NODE_JS||!He)&&(He=function(ee){return Object.prototype.toString.call(ee)==="[object Array]"});var qe=ArrayBuffer.isView;_e&&(pe.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!qe)&&(qe=function(ee){return typeof ee=="object"&&ee.buffer&&ee.buffer.constructor===ArrayBuffer});var We=function(ee){var re=typeof ee;if(re==="string")return[ee,!0];if(re!=="object"||ee===null)throw new Error(ie);if(_e&&ee.constructor===ArrayBuffer)return[new Uint8Array(ee),!1];if(!He(ee)&&!qe(ee))throw new Error(ie);return[ee,!1]},je=function(ee){return function(re){return new Ge(!0).update(re)[ee]()}},Xe=function(){var ee=je("hex");be&&(ee=lt(ee)),ee.create=function(){return new Ge},ee.update=function(fe){return ee.create().update(fe)};for(var re=0;re<$e.length;++re){var ne=$e[re];ee[ne]=je(ne)}return ee},lt=function(ee){var re=requireCryptoBrowserify(),ne=requireDist().Buffer,fe;ne.from&&!pe.JS_MD5_NO_BUFFER_FROM?fe=ne.from:fe=function(ce){return new ne(ce)};var le=function(ce){if(typeof ce=="string")return re.createHash("md5").update(ce,"utf8").digest("hex");if(ce==null)throw new Error(ie);return ce.constructor===ArrayBuffer&&(ce=new Uint8Array(ce)),He(ce)||qe(ce)||ce.constructor===ne?re.createHash("md5").update(fe(ce)).digest("hex"):ee(ce)};return le},At=function(ee){return function(re,ne){return new Lt(re,!0).update(ne)[ee]()}},mt=function(){var ee=At("hex");ee.create=function(fe){return new Lt(fe)},ee.update=function(fe,le){return ee.create(fe).update(le)};for(var re=0;re<$e.length;++re){var ne=$e[re];ee[ne]=At(ne)}return ee};function Ge(ee){if(ee)ke[0]=ke[16]=ke[1]=ke[2]=ke[3]=ke[4]=ke[5]=ke[6]=ke[7]=ke[8]=ke[9]=ke[10]=ke[11]=ke[12]=ke[13]=ke[14]=ke[15]=0,this.blocks=ke,this.buffer8=Ne;else if(_e){var re=new ArrayBuffer(68);this.buffer8=new Uint8Array(re),this.blocks=new Uint32Array(re)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Ge.prototype.update=function(ee){if(this.finalized)throw new Error(he);var re=We(ee);ee=re[0];for(var ne=re[1],fe,le=0,ce,ve=ee.length,ue=this.blocks,te=this.buffer8;le>>6,te[ce++]=128|fe&63):fe<55296||fe>=57344?(te[ce++]=224|fe>>>12,te[ce++]=128|fe>>>6&63,te[ce++]=128|fe&63):(fe=65536+((fe&1023)<<10|ee.charCodeAt(++le)&1023),te[ce++]=240|fe>>>18,te[ce++]=128|fe>>>12&63,te[ce++]=128|fe>>>6&63,te[ce++]=128|fe&63);else for(ce=this.start;le>>2]|=fe<>>2]|=(192|fe>>>6)<>>2]|=(128|fe&63)<=57344?(ue[ce>>>2]|=(224|fe>>>12)<>>2]|=(128|fe>>>6&63)<>>2]|=(128|fe&63)<>>2]|=(240|fe>>>18)<>>2]|=(128|fe>>>12&63)<>>2]|=(128|fe>>>6&63)<>>2]|=(128|fe&63)<>>2]|=ee[le]<=64?(this.start=ce-64,this.hash(),this.hashed=!0):this.start=ce}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},Ge.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var ee=this.blocks,re=this.lastByteIndex;ee[re>>>2]|=we[re&3],re>=56&&(this.hashed||this.hash(),ee[0]=ee[16],ee[16]=ee[1]=ee[2]=ee[3]=ee[4]=ee[5]=ee[6]=ee[7]=ee[8]=ee[9]=ee[10]=ee[11]=ee[12]=ee[13]=ee[14]=ee[15]=0),ee[14]=this.bytes<<3,ee[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Ge.prototype.hash=function(){var ee,re,ne,fe,le,ce,ve=this.blocks;this.first?(ee=ve[0]-680876937,ee=(ee<<7|ee>>>25)-271733879<<0,fe=(-1732584194^ee&2004318071)+ve[1]-117830708,fe=(fe<<12|fe>>>20)+ee<<0,ne=(-271733879^fe&(ee^-271733879))+ve[2]-1126478375,ne=(ne<<17|ne>>>15)+fe<<0,re=(ee^ne&(fe^ee))+ve[3]-1316259209,re=(re<<22|re>>>10)+ne<<0):(ee=this.h0,re=this.h1,ne=this.h2,fe=this.h3,ee+=(fe^re&(ne^fe))+ve[0]-680876936,ee=(ee<<7|ee>>>25)+re<<0,fe+=(ne^ee&(re^ne))+ve[1]-389564586,fe=(fe<<12|fe>>>20)+ee<<0,ne+=(re^fe&(ee^re))+ve[2]+606105819,ne=(ne<<17|ne>>>15)+fe<<0,re+=(ee^ne&(fe^ee))+ve[3]-1044525330,re=(re<<22|re>>>10)+ne<<0),ee+=(fe^re&(ne^fe))+ve[4]-176418897,ee=(ee<<7|ee>>>25)+re<<0,fe+=(ne^ee&(re^ne))+ve[5]+1200080426,fe=(fe<<12|fe>>>20)+ee<<0,ne+=(re^fe&(ee^re))+ve[6]-1473231341,ne=(ne<<17|ne>>>15)+fe<<0,re+=(ee^ne&(fe^ee))+ve[7]-45705983,re=(re<<22|re>>>10)+ne<<0,ee+=(fe^re&(ne^fe))+ve[8]+1770035416,ee=(ee<<7|ee>>>25)+re<<0,fe+=(ne^ee&(re^ne))+ve[9]-1958414417,fe=(fe<<12|fe>>>20)+ee<<0,ne+=(re^fe&(ee^re))+ve[10]-42063,ne=(ne<<17|ne>>>15)+fe<<0,re+=(ee^ne&(fe^ee))+ve[11]-1990404162,re=(re<<22|re>>>10)+ne<<0,ee+=(fe^re&(ne^fe))+ve[12]+1804603682,ee=(ee<<7|ee>>>25)+re<<0,fe+=(ne^ee&(re^ne))+ve[13]-40341101,fe=(fe<<12|fe>>>20)+ee<<0,ne+=(re^fe&(ee^re))+ve[14]-1502002290,ne=(ne<<17|ne>>>15)+fe<<0,re+=(ee^ne&(fe^ee))+ve[15]+1236535329,re=(re<<22|re>>>10)+ne<<0,ee+=(ne^fe&(re^ne))+ve[1]-165796510,ee=(ee<<5|ee>>>27)+re<<0,fe+=(re^ne&(ee^re))+ve[6]-1069501632,fe=(fe<<9|fe>>>23)+ee<<0,ne+=(ee^re&(fe^ee))+ve[11]+643717713,ne=(ne<<14|ne>>>18)+fe<<0,re+=(fe^ee&(ne^fe))+ve[0]-373897302,re=(re<<20|re>>>12)+ne<<0,ee+=(ne^fe&(re^ne))+ve[5]-701558691,ee=(ee<<5|ee>>>27)+re<<0,fe+=(re^ne&(ee^re))+ve[10]+38016083,fe=(fe<<9|fe>>>23)+ee<<0,ne+=(ee^re&(fe^ee))+ve[15]-660478335,ne=(ne<<14|ne>>>18)+fe<<0,re+=(fe^ee&(ne^fe))+ve[4]-405537848,re=(re<<20|re>>>12)+ne<<0,ee+=(ne^fe&(re^ne))+ve[9]+568446438,ee=(ee<<5|ee>>>27)+re<<0,fe+=(re^ne&(ee^re))+ve[14]-1019803690,fe=(fe<<9|fe>>>23)+ee<<0,ne+=(ee^re&(fe^ee))+ve[3]-187363961,ne=(ne<<14|ne>>>18)+fe<<0,re+=(fe^ee&(ne^fe))+ve[8]+1163531501,re=(re<<20|re>>>12)+ne<<0,ee+=(ne^fe&(re^ne))+ve[13]-1444681467,ee=(ee<<5|ee>>>27)+re<<0,fe+=(re^ne&(ee^re))+ve[2]-51403784,fe=(fe<<9|fe>>>23)+ee<<0,ne+=(ee^re&(fe^ee))+ve[7]+1735328473,ne=(ne<<14|ne>>>18)+fe<<0,re+=(fe^ee&(ne^fe))+ve[12]-1926607734,re=(re<<20|re>>>12)+ne<<0,le=re^ne,ee+=(le^fe)+ve[5]-378558,ee=(ee<<4|ee>>>28)+re<<0,fe+=(le^ee)+ve[8]-2022574463,fe=(fe<<11|fe>>>21)+ee<<0,ce=fe^ee,ne+=(ce^re)+ve[11]+1839030562,ne=(ne<<16|ne>>>16)+fe<<0,re+=(ce^ne)+ve[14]-35309556,re=(re<<23|re>>>9)+ne<<0,le=re^ne,ee+=(le^fe)+ve[1]-1530992060,ee=(ee<<4|ee>>>28)+re<<0,fe+=(le^ee)+ve[4]+1272893353,fe=(fe<<11|fe>>>21)+ee<<0,ce=fe^ee,ne+=(ce^re)+ve[7]-155497632,ne=(ne<<16|ne>>>16)+fe<<0,re+=(ce^ne)+ve[10]-1094730640,re=(re<<23|re>>>9)+ne<<0,le=re^ne,ee+=(le^fe)+ve[13]+681279174,ee=(ee<<4|ee>>>28)+re<<0,fe+=(le^ee)+ve[0]-358537222,fe=(fe<<11|fe>>>21)+ee<<0,ce=fe^ee,ne+=(ce^re)+ve[3]-722521979,ne=(ne<<16|ne>>>16)+fe<<0,re+=(ce^ne)+ve[6]+76029189,re=(re<<23|re>>>9)+ne<<0,le=re^ne,ee+=(le^fe)+ve[9]-640364487,ee=(ee<<4|ee>>>28)+re<<0,fe+=(le^ee)+ve[12]-421815835,fe=(fe<<11|fe>>>21)+ee<<0,ce=fe^ee,ne+=(ce^re)+ve[15]+530742520,ne=(ne<<16|ne>>>16)+fe<<0,re+=(ce^ne)+ve[2]-995338651,re=(re<<23|re>>>9)+ne<<0,ee+=(ne^(re|~fe))+ve[0]-198630844,ee=(ee<<6|ee>>>26)+re<<0,fe+=(re^(ee|~ne))+ve[7]+1126891415,fe=(fe<<10|fe>>>22)+ee<<0,ne+=(ee^(fe|~re))+ve[14]-1416354905,ne=(ne<<15|ne>>>17)+fe<<0,re+=(fe^(ne|~ee))+ve[5]-57434055,re=(re<<21|re>>>11)+ne<<0,ee+=(ne^(re|~fe))+ve[12]+1700485571,ee=(ee<<6|ee>>>26)+re<<0,fe+=(re^(ee|~ne))+ve[3]-1894986606,fe=(fe<<10|fe>>>22)+ee<<0,ne+=(ee^(fe|~re))+ve[10]-1051523,ne=(ne<<15|ne>>>17)+fe<<0,re+=(fe^(ne|~ee))+ve[1]-2054922799,re=(re<<21|re>>>11)+ne<<0,ee+=(ne^(re|~fe))+ve[8]+1873313359,ee=(ee<<6|ee>>>26)+re<<0,fe+=(re^(ee|~ne))+ve[15]-30611744,fe=(fe<<10|fe>>>22)+ee<<0,ne+=(ee^(fe|~re))+ve[6]-1560198380,ne=(ne<<15|ne>>>17)+fe<<0,re+=(fe^(ne|~ee))+ve[13]+1309151649,re=(re<<21|re>>>11)+ne<<0,ee+=(ne^(re|~fe))+ve[4]-145523070,ee=(ee<<6|ee>>>26)+re<<0,fe+=(re^(ee|~ne))+ve[11]-1120210379,fe=(fe<<10|fe>>>22)+ee<<0,ne+=(ee^(fe|~re))+ve[2]+718787259,ne=(ne<<15|ne>>>17)+fe<<0,re+=(fe^(ne|~ee))+ve[9]-343485551,re=(re<<21|re>>>11)+ne<<0,this.first?(this.h0=ee+1732584193<<0,this.h1=re-271733879<<0,this.h2=ne-1732584194<<0,this.h3=fe+271733878<<0,this.first=!1):(this.h0=this.h0+ee<<0,this.h1=this.h1+re<<0,this.h2=this.h2+ne<<0,this.h3=this.h3+fe<<0)},Ge.prototype.hex=function(){this.finalize();var ee=this.h0,re=this.h1,ne=this.h2,fe=this.h3;return Ee[ee>>>4&15]+Ee[ee&15]+Ee[ee>>>12&15]+Ee[ee>>>8&15]+Ee[ee>>>20&15]+Ee[ee>>>16&15]+Ee[ee>>>28&15]+Ee[ee>>>24&15]+Ee[re>>>4&15]+Ee[re&15]+Ee[re>>>12&15]+Ee[re>>>8&15]+Ee[re>>>20&15]+Ee[re>>>16&15]+Ee[re>>>28&15]+Ee[re>>>24&15]+Ee[ne>>>4&15]+Ee[ne&15]+Ee[ne>>>12&15]+Ee[ne>>>8&15]+Ee[ne>>>20&15]+Ee[ne>>>16&15]+Ee[ne>>>28&15]+Ee[ne>>>24&15]+Ee[fe>>>4&15]+Ee[fe&15]+Ee[fe>>>12&15]+Ee[fe>>>8&15]+Ee[fe>>>20&15]+Ee[fe>>>16&15]+Ee[fe>>>28&15]+Ee[fe>>>24&15]},Ge.prototype.toString=Ge.prototype.hex,Ge.prototype.digest=function(){this.finalize();var ee=this.h0,re=this.h1,ne=this.h2,fe=this.h3;return[ee&255,ee>>>8&255,ee>>>16&255,ee>>>24&255,re&255,re>>>8&255,re>>>16&255,re>>>24&255,ne&255,ne>>>8&255,ne>>>16&255,ne>>>24&255,fe&255,fe>>>8&255,fe>>>16&255,fe>>>24&255]},Ge.prototype.array=Ge.prototype.digest,Ge.prototype.arrayBuffer=function(){this.finalize();var ee=new ArrayBuffer(16),re=new Uint32Array(ee);return re[0]=this.h0,re[1]=this.h1,re[2]=this.h2,re[3]=this.h3,ee},Ge.prototype.buffer=Ge.prototype.arrayBuffer,Ge.prototype.base64=function(){for(var ee,re,ne,fe="",le=this.array(),ce=0;ce<15;)ee=le[ce++],re=le[ce++],ne=le[ce++],fe+=Re[ee>>>2]+Re[(ee<<4|re>>>4)&63]+Re[(re<<2|ne>>>6)&63]+Re[ne&63];return ee=le[ce],fe+=Re[ee>>>2]+Re[ee<<4&63]+"==",fe};function Lt(ee,re){var ne,fe=We(ee);if(ee=fe[0],fe[1]){var le=[],ce=ee.length,ve=0,ue;for(ne=0;ne>>6,le[ve++]=128|ue&63):ue<55296||ue>=57344?(le[ve++]=224|ue>>>12,le[ve++]=128|ue>>>6&63,le[ve++]=128|ue&63):(ue=65536+((ue&1023)<<10|ee.charCodeAt(++ne)&1023),le[ve++]=240|ue>>>18,le[ve++]=128|ue>>>12&63,le[ve++]=128|ue>>>6&63,le[ve++]=128|ue&63);ee=le}ee.length>64&&(ee=new Ge(!0).update(ee).array());var te=[],de=[];for(ne=0;ne<64;++ne){var ye=ee[ne]||0;te[ne]=92^ye,de[ne]=54^ye}Ge.call(this,re),this.update(de),this.oKeyPad=te,this.inner=!0,this.sharedMemory=re}Lt.prototype=new Ge,Lt.prototype.finalize=function(){if(Ge.prototype.finalize.call(this),this.inner){this.inner=!1;var ee=this.array();Ge.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(ee),Ge.prototype.finalize.call(this)}};var me=Xe();me.md5=me,me.md5.hmac=mt(),ge?ae.exports=me:pe.md5=me})()})(md5$4);var md5Exports=md5$4.exports;const md5=_mergeNamespaces({__proto__:null},[md5Exports]);var cryptoBrowserifyExports=requireCryptoBrowserify();const index=_mergeNamespaces({__proto__:null},[cryptoBrowserifyExports]);exports.ANALYTICS_LABELS=ANALYTICS_LABELS,exports.ANALYTICS_SUBACCOUNTS=ANALYTICS_SUBACCOUNTS,exports.API_RESPONSE_CODES=API_RESPONSE_CODES,exports.AnalyticsResource=AnalyticsResource,exports.BalanceResource=BalanceResource,exports.CNAM_API_CODES=CNAM_API_CODES,exports.Client=Client,exports.ContactsResource=ContactsResource,exports.ErrorCode=ErrorCode,exports.GroupsResource=GroupsResource,exports.HLR_LOOKUP_OUTCOME_CODES=HLR_LOOKUP_OUTCOME_CODES,exports.HLR_PORTED_CODES=HLR_PORTED_CODES,exports.HLR_REACHABLE_CODES=HLR_REACHABLE_CODES,exports.HLR_ROAMING_CODES=HLR_ROAMING_CODES,exports.HLR_STATUS_MESSAGE_CODES=HLR_STATUS_MESSAGE_CODES,exports.HLR_VALID_NUMBER_CODES=HLR_VALID_NUMBER_CODES,exports.HOOK_EVENT_TYPES=HOOK_EVENT_TYPES,exports.HOOK_REQUEST_METHODS=HOOK_REQUEST_METHODS,exports.HooksResource=HooksResource,exports.JournalResource=JournalResource,exports.LOOKUP_GSM_CODES=LOOKUP_GSM_CODES,exports.LookupResource=LookupResource,exports.NetworkType=NetworkType,exports.PricingResource=PricingResource,exports.ProviderName=ProviderName,exports.ROAMING_STATUS_CODES=ROAMING_STATUS_CODES,exports.RcsResource=RcsResource,exports.SMS_ENCODINGS=SMS_ENCODINGS,exports.SMS_TYPES=SMS_TYPES,exports.STRING_RESPONSE_CODES=STRING_RESPONSE_CODES,exports.SmsResource=SmsResource,exports.StatusReportCode=StatusReportCode,exports.StatusResource=StatusResource,exports.SubaccountsResource=SubaccountsResource,exports.ValidateResource=ValidateResource,exports.VoiceResource=VoiceResource,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});