window.EmberENV=function(e,t){for(var r in t)e[r]=t[r] return e}(window.EmberENV||{},{FEATURES:{},EXTEND_PROTOTYPES:{Date:!1},_APPLICATION_TEMPLATE_WRAPPER:!1,_DEFAULT_ASYNC_OBSERVERS:!0,_JQUERY_INTEGRATION:!1,_TEMPLATE_ONLY_GLIMMER_COMPONENTS:!0}) var runningTests=!1,loader,define,requireModule,require,requirejs if(function(e){"use strict" function t(){var e=Object.create(null) return e.__=void 0,delete e.__,e}var r={loader:loader,define:define,requireModule:requireModule,require:require,requirejs:requirejs} requirejs=require=requireModule=function(e){for(var t=[],r=l(e,"(require)",t),n=t.length-1;n>=0;n--)t[n].exports() return r.module.exports},loader={noConflict:function(t){var n,i for(n in t)t.hasOwnProperty(n)&&r.hasOwnProperty(n)&&(i=t[n],e[i]=e[n],e[n]=r[n])},makeDefaultExport:!0} var n=t(),i=(t(),0) function o(e){throw new Error("an unsupported module was defined, expected `define(id, deps, module)` instead got: `"+e+"` arguments to define`")}var a=["require","exports","module"] function s(e,t,r,n){this.uuid=i++,this.id=e,this.deps=!t.length&&r.length?a:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=n,this.reified=new Array(t.length),this.state="new"}function u(){}function c(e){this.id=e}function l(e,t,r){for(var i=n[e]||n[e+"/index"];i&&i.isAlias;)i=n[i.id]||n[i.id+"/index"] return i||function(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function f(e,t){if("."!==e.charAt(0))return e for(var r=e.split("/"),n=t.split("/").slice(0,-1),i=0,o=r.length;i=0;--i){var o=this.tryEntries[i],a=o.completion if("root"===o.tryLoc)return n("end") if(o.tryLoc<=this.prev){var s=t.call(o,"catchLoc"),u=t.call(o,"finallyLoc") if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n] if(i.tryLoc<=this.prev&&t.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t] if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),b(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t] if(r.tryLoc===e){var n=r.completion if("throw"===n.type){var i=n.arg b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},s}}}function c(e,t,r,n){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new g(n||[]) return o._invoke=function(e,t,r){var n="suspendedStart" return function(i,o){if("executing"===n)throw new Error("Generator is already running") if("completed"===n){if("throw"===i)throw o return _()}for(;;){var a=r.delegate if(a){if("return"===i||"throw"===i&&void 0===a.iterator[i]){r.delegate=null var u=a.iterator.return if(u)if("throw"===(c=l(u,a.iterator,o)).type){i="throw",o=c.arg continue}if("return"===i)continue}var c if("throw"===(c=l(a.iterator[i],a.iterator,o)).type){r.delegate=null,i="throw",o=c.arg continue}if(i="next",o=void 0,!(f=c.arg).done)return n="suspendedYield",f r[a.resultName]=f.value,r.next=a.nextLoc,r.delegate=null}if("next"===i)r.sent=r._sent=o else if("throw"===i){if("suspendedStart"===n)throw n="completed",o r.dispatchException(o)&&(i="next",o=void 0)}else"return"===i&&r.abrupt("return",o) if(n="executing","normal"===(c=l(e,t,r)).type){n=r.done?"completed":"suspendedYield" var f={value:c.arg,done:r.done} if(c.arg!==s)return f r.delegate&&"next"===i&&(o=void 0)}else"throw"===c.type&&(n="completed",i="throw",o=c.arg)}}}(e,r,a),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function f(){}function h(){}function d(){}function p(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){this.arg=e}function v(e){function t(r,n,i,o){var a=l(e[r],e,n) if("throw"!==a.type){var s=a.arg,u=s.value return u instanceof m?Promise.resolve(u.arg).then((function(e){t("next",e,i,o)}),(function(e){t("throw",e,i,o)})):Promise.resolve(u).then((function(e){s.value=e,i(s)}),o)}o(a.arg)}var r "object"==typeof process&&process.domain&&(t=process.domain.bind(t)),this._invoke=function(e,n){function i(){return new Promise((function(r,i){t(e,n,r,i)}))}return r=r?r.then(i,i):i()}}function y(e){var t={tryLoc:e[0]} 1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{} t.type="normal",delete t.arg,e.completion=t}function g(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}function w(e){if(e){var r=e[n] if(r)return r.call(e) if("function"==typeof e.next)return e if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i>>0 for(t=0;t0)for(r=0;r=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var j=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,T={},C={} function I(e,t,r,n){var i=n "string"==typeof n&&(i=function(){return this[n]()}),e&&(C[e]=i),t&&(C[t[0]]=function(){return A(i.apply(this,arguments),t[1],t[2])}),r&&(C[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function N(e,t){return e.isValid()?(t=D(t,e.localeData()),T[t]=T[t]||function(e){var t,r,n,i=e.match(j) for(t=0,r=i.length;t=0&&R.test(e);)e=e.replace(R,n),R.lastIndex=0,r-=1 return e}var B={} function L(e,t){var r=e.toLowerCase() B[r]=B[r+"s"]=B[t]=e}function F(e){return"string"==typeof e?B[e]||B[e.toLowerCase()]:void 0}function U(e){var t,r,n={} for(r in e)o(e,r)&&(t=F(r))&&(n[t]=e[r]) return n}var z={} function q(e,t){z[e]=t}function H(e){return e%4==0&&e%100!=0||e%400==0}function V(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,r=0 return 0!==t&&isFinite(t)&&(r=V(t)),r}function G(e,t){return function(n){return null!=n?(K(this,e,n),r.updateOffset(this,t),this):Y(this,e)}}function Y(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function K(e,t,r){e.isValid()&&!isNaN(r)&&("FullYear"===t&&H(e.year())&&1===e.month()&&29===e.date()?(r=W(r),e._d["set"+(e._isUTC?"UTC":"")+t](r,e.month(),we(r,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](r))}var J,$=/\d/,Z=/\d\d/,Q=/\d{3}/,X=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,re=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,oe=/\d{1,4}/,ae=/[+-]?\d{1,6}/,se=/\d+/,ue=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,le=/Z|[+-]\d\d(?::?\d\d)?/gi,fe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i function he(e,t,r){J[e]=S(t)?t:function(e,n){return e&&r?r:t}}function de(e,t){return o(J,e)?J[e](t._strict,t._locale):new RegExp(pe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,i){return t||r||n||i}))))}function pe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}J={} var me={} function ve(e,t){var r,n,i=t for("string"==typeof e&&(e=[e]),u(t)&&(i=function(e,r){r[t]=W(e)}),n=e.length,r=0;r68?1900:2e3)} var Re=G("FullYear",!0) function Te(e,t,r,n,i,o,a){var s return e<100&&e>=0?(s=new Date(e+400,t,r,n,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,r,n,i,o,a),s}function Ce(e){var t,r return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ie(e,t,r){var n=7+t-r return-((7+Ce(e,0,n).getUTCDay()-t)%7)+n-1}function Ne(e,t,r,n,i){var o,a,s=1+7*(t-1)+(7+r-n)%7+Ie(e,n,i) return s<=0?a=je(o=e-1)+s:s>je(e)?(o=e+1,a=s-je(e)):(o=e,a=s),{year:o,dayOfYear:a}}function De(e,t,r){var n,i,o=Ie(e.year(),t,r),a=Math.floor((e.dayOfYear()-o-1)/7)+1 return a<1?n=a+Be(i=e.year()-1,t,r):a>Be(e.year(),t,r)?(n=a-Be(e.year(),t,r),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function Be(e,t,r){var n=Ie(e,t,r),i=Ie(e+1,t,r) return(je(e)-n+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),q("week",5),q("isoWeek",5),he("w",te),he("ww",te,Z),he("W",te),he("WW",te,Z),ye(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=W(e)})) function Le(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),I("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),I("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),q("day",11),q("weekday",11),q("isoWeekday",11),he("d",te),he("e",te),he("E",te),he("dd",(function(e,t){return t.weekdaysMinRegex(e)})),he("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),he("dddd",(function(e,t){return t.weekdaysRegex(e)})),ye(["dd","ddd","dddd"],(function(e,t,r,n){var i=r._locale.weekdaysParse(e,n,r._strict) null!=i?t.d=i:d(r).invalidWeekday=e})),ye(["d","e","E"],(function(e,t,r,n){t[n]=W(e)})) var Fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ue="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=fe,He=fe,Ve=fe function We(e,t,r){var n,i,o,a=e.toLocaleLowerCase() if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=h([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase() return r?"dddd"===t?-1!==(i=ge.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ge.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._shortWeekdaysParse,a))||-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ge.call(this._shortWeekdaysParse,a))||-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:-1!==(i=ge.call(this._minWeekdaysParse,a))||-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._shortWeekdaysParse,a))?i:null}function Ge(){function e(e,t){return t.length-e.length}var t,r,n,i,o,a=[],s=[],u=[],c=[] for(t=0;t<7;t++)r=h([2e3,1]).day(t),n=pe(this.weekdaysMin(r,"")),i=pe(this.weekdaysShort(r,"")),o=pe(this.weekdays(r,"")),a.push(n),s.push(i),u.push(o),c.push(n),c.push(i),c.push(o) a.sort(e),s.sort(e),u.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ye(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Je(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Ye),I("k",["kk",2],0,(function(){return this.hours()||24})),I("hmm",0,0,(function(){return""+Ye.apply(this)+A(this.minutes(),2)})),I("hmmss",0,0,(function(){return""+Ye.apply(this)+A(this.minutes(),2)+A(this.seconds(),2)})),I("Hmm",0,0,(function(){return""+this.hours()+A(this.minutes(),2)})),I("Hmmss",0,0,(function(){return""+this.hours()+A(this.minutes(),2)+A(this.seconds(),2)})),Ke("a",!0),Ke("A",!1),L("hour","h"),q("hour",13),he("a",Je),he("A",Je),he("H",te),he("h",te),he("k",te),he("HH",te,Z),he("hh",te,Z),he("kk",te,Z),he("hmm",re),he("hmmss",ne),he("Hmm",re),he("Hmmss",ne),ve(["H","HH"],3),ve(["k","kk"],(function(e,t,r){var n=W(e) t[3]=24===n?0:n})),ve(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),ve(["h","hh"],(function(e,t,r){t[3]=W(e),d(r).bigHour=!0})),ve("hmm",(function(e,t,r){var n=e.length-2 t[3]=W(e.substr(0,n)),t[4]=W(e.substr(n)),d(r).bigHour=!0})),ve("hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2 t[3]=W(e.substr(0,n)),t[4]=W(e.substr(n,2)),t[5]=W(e.substr(i)),d(r).bigHour=!0})),ve("Hmm",(function(e,t,r){var n=e.length-2 t[3]=W(e.substr(0,n)),t[4]=W(e.substr(n))})) ve("Hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2 t[3]=W(e.substr(0,n)),t[4]=W(e.substr(n,2)),t[5]=W(e.substr(i))})) var $e=G("Hours",!0) var Ze,Qe={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:_e,monthsShort:ke,week:{dow:0,doy:6},weekdays:Fe,weekdaysMin:ze,weekdaysShort:Ue,meridiemParse:/[ap]\.?m?\.?/i},Xe={},et={} function tt(e,t){var r,n=Math.min(e.length,t.length) for(r=0;r0;){if(n=nt(i.slice(0,t).join("-")))return n if(r&&r.length>=t&&tt(i,r)>=t-1)break t--}o++}return Ze}(e)}function st(e){var t,r=e._a return r&&-2===d(e).overflow&&(t=r[1]<0||r[1]>11?1:r[2]<1||r[2]>we(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,d(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),d(e)._overflowWeeks&&-1===t&&(t=7),d(e)._overflowWeekday&&-1===t&&(t=8),d(e).overflow=t),e}var ut=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ct=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,lt=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ht=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],dt=/^\/?Date\((-?\d+)/i,pt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,mt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480} function vt(e){var t,r,n,i,o,a,s=e._i,u=ut.exec(s)||ct.exec(s),c=ft.length,l=ht.length if(u){for(d(e).iso=!0,t=0,r=c;t7)&&(u=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=De(Ot(),o,a),r=gt(t.gg,e._a[0],c.year),n=gt(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(u=!0)):i=o) n<1||n>Be(r,o,a)?d(e)._overflowWeeks=!0:null!=u?d(e)._overflowWeekday=!0:(s=Ne(r,n,i,o,a),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=gt(e._a[0],i[0]),(e._dayOfYear>je(a)||0===e._dayOfYear)&&(d(e)._overflowDayOfYear=!0),n=Ce(a,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=i[t] for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t] 24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Ce:Te).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(d(e).weekdayMismatch=!0)}}function _t(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],d(e).empty=!0 var t,n,i,o,a,s,u,c=""+e._i,l=c.length,f=0 for(u=(i=D(e._f,e._locale).match(j)||[]).length,t=0;t0&&d(e).unusedInput.push(a),c=c.slice(c.indexOf(n)+n.length),f+=n.length),C[o]?(n?d(e).empty=!1:d(e).unusedTokens.push(o),be(o,n,e)):e._strict&&!n&&d(e).unusedTokens.push(o) d(e).charsLeftOver=l-f,c.length>0&&d(e).unusedInput.push(c),e._a[3]<=12&&!0===d(e).bigHour&&e._a[3]>0&&(d(e).bigHour=void 0),d(e).parsedDateParts=e._a.slice(0),d(e).meridiem=e._meridiem,e._a[3]=function(e,t,r){var n if(null==r)return t return null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=d(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),wt(e),st(e)}else bt(e) else vt(e)}function kt(e){var t=e._i,o=e._f return e._locale=e._locale||at(e._l),null===t||void 0===o&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new g(st(t)):(c(t)?e._d=t:n(o)?function(e){var t,r,n,i,o,a,s=!1,u=e._f.length if(0===u)return d(e).invalidFormat=!0,void(e._d=new Date(NaN)) for(i=0;ithis?this:e:m()})) function Pt(e,t){var r,i if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Ot() for(r=t[0],i=1;i=0?new Date(e+400,t,r)-126227808e5:new Date(e,t,r).valueOf()}function rr(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-126227808e5:Date.UTC(e,t,r)}function nr(e,t){return t.erasAbbrRegex(e)}function ir(){var e,t,r=[],n=[],i=[],o=[],a=this.eras() for(e=0,t=a.length;e(o=Be(e,n,i))&&(t=o),sr.call(this,e,t,r,n,i))}function sr(e,t,r,n,i){var o=Ne(e,t,r,n,i),a=Ce(o.year,0,o.dayOfYear) return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}I("N",0,0,"eraAbbr"),I("NN",0,0,"eraAbbr"),I("NNN",0,0,"eraAbbr"),I("NNNN",0,0,"eraName"),I("NNNNN",0,0,"eraNarrow"),I("y",["y",1],"yo","eraYear"),I("y",["yy",2],0,"eraYear"),I("y",["yyy",3],0,"eraYear"),I("y",["yyyy",4],0,"eraYear"),he("N",nr),he("NN",nr),he("NNN",nr),he("NNNN",(function(e,t){return t.erasNameRegex(e)})),he("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ve(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,r,n){var i=r._locale.erasParse(e,n,r._strict) i?d(r).era=i:d(r).invalidEra=e})),he("y",se),he("yy",se),he("yyy",se),he("yyyy",se),he("yo",(function(e,t){return t._eraYearOrdinalRegex||se})),ve(["y","yy","yyy","yyyy"],0),ve(["yo"],(function(e,t,r,n){var i r._locale._eraYearOrdinalRegex&&(i=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[0]=r._locale.eraYearOrdinalParse(e,i):t[0]=parseInt(e,10)})),I(0,["gg",2],0,(function(){return this.weekYear()%100})),I(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),or("gggg","weekYear"),or("ggggg","weekYear"),or("GGGG","isoWeekYear"),or("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG") q("weekYear",1),q("isoWeekYear",1),he("G",ue),he("g",ue),he("GG",te,Z),he("gg",te,Z),he("GGGG",oe,X),he("gggg",oe,X),he("GGGGG",ae,ee),he("ggggg",ae,ee),ye(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=W(e)})),ye(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),I("Q",0,"Qo","quarter"),L("quarter","Q"),q("quarter",7),he("Q",$),ve("Q",(function(e,t){t[1]=3*(W(e)-1)})),I("D",["DD",2],"Do","date"),L("date","D"),q("date",9),he("D",te),he("DD",te,Z),he("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ve(["D","DD"],2),ve("Do",(function(e,t){t[2]=W(e.match(te)[0])})) var ur=G("Date",!0) I("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),q("dayOfYear",4),he("DDD",ie),he("DDDD",Q),ve(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=W(e)})),I("m",["mm",2],0,"minute"),L("minute","m"),q("minute",14),he("m",te),he("mm",te,Z),ve(["m","mm"],4) var cr=G("Minutes",!1) I("s",["ss",2],0,"second"),L("second","s"),q("second",15),he("s",te),he("ss",te,Z),ve(["s","ss"],5) var lr,fr,hr=G("Seconds",!1) for(I("S",0,0,(function(){return~~(this.millisecond()/100)})),I(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),I(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),I(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),I(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),I(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),I(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),q("millisecond",16),he("S",ie,$),he("SS",ie,Z),he("SSS",ie,Q),lr="SSSS";lr.length<=9;lr+="S")he(lr,se) function dr(e,t){t[6]=W(1e3*("0."+e))}for(lr="S";lr.length<=9;lr+="S")ve(lr,dr) fr=G("Milliseconds",!1),I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName") var pr=g.prototype function mr(e){return e}pr.add=Wt,pr.calendar=function(e,t){1===arguments.length&&(arguments[0]?Kt(arguments[0])?(e=arguments[0],t=void 0):Jt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0)) var n=e||Ot(),i=Nt(n,this).startOf("day"),o=r.calendarFormat(this,i)||"sameElse",a=t&&(S(t[o])?t[o].call(this,n):t[o]) return this.format(a||this.localeData().calendar(o,this,Ot(n)))},pr.clone=function(){return new g(this)},pr.diff=function(e,t,r){var n,i,o if(!this.isValid())return NaN if(!(n=Nt(e,this)).isValid())return NaN switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=F(t)){case"year":o=$t(this,n)/12 break case"month":o=$t(this,n) break case"quarter":o=$t(this,n)/3 break case"second":o=(this-n)/1e3 break case"minute":o=(this-n)/6e4 break case"hour":o=(this-n)/36e5 break case"day":o=(this-n-i)/864e5 break case"week":o=(this-n-i)/6048e5 break default:o=this-n}return r?o:V(o)},pr.endOf=function(e){var t,n if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this switch(n=this._isUTC?rr:tr,e){case"year":t=n(this.year()+1,0,1)-1 break case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1 break case"month":t=n(this.year(),this.month()+1,1)-1 break case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1 break case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1 break case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1 break case"hour":t=this._d.valueOf(),t+=36e5-er(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1 break case"minute":t=this._d.valueOf(),t+=6e4-er(t,6e4)-1 break case"second":t=this._d.valueOf(),t+=1e3-er(t,1e3)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},pr.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat) var t=N(this,e) return this.localeData().postformat(t)},pr.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ot(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pr.fromNow=function(e){return this.from(Ot(),e)},pr.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ot(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pr.toNow=function(e){return this.to(Ot(),e)},pr.get=function(e){return S(this[e=F(e)])?this[e]():this},pr.invalidAt=function(){return d(this).overflow},pr.isAfter=function(e,t){var r=w(e)?e:Ot(e) return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()9999?N(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(r,"Z")):N(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},pr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)" var e,t,r,n="moment",i="" return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",r=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(pr[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),pr.toJSON=function(){return this.isValid()?this.toISOString():null},pr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pr.unix=function(){return Math.floor(this.valueOf()/1e3)},pr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pr.eraName=function(){var e,t,r,n=this.localeData().eras() for(e=0,t=n.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pr.isLocal=function(){return!!this.isValid()&&!this._isUTC},pr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pr.isUtc=Bt,pr.isUTC=Bt,pr.zoneAbbr=function(){return this._isUTC?"UTC":""},pr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pr.dates=k("dates accessor is deprecated. Use date instead.",ur),pr.months=k("months accessor is deprecated. Use month instead",Me),pr.years=k("years accessor is deprecated. Use year instead",Re),pr.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),pr.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted var e,t={} return b(t,this),(t=kt(t))._a?(e=t._isUTC?h(t._a):Ot(t._a),this._isDSTShifted=this.isValid()&&function(e,t,r){var n,i=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0 for(n=0;n0):this._isDSTShifted=!1,this._isDSTShifted})) var vr=M.prototype function yr(e,t,r,n){var i=at(),o=h().set(n,t) return i[r](o,e)}function br(e,t,r){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return yr(e,t,r,"month") var n,i=[] for(n=0;n<12;n++)i[n]=yr(e,n,r,"month") return i}function gr(e,t,r,n){"boolean"==typeof e?(u(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,u(t)&&(r=t,t=void 0),t=t||"") var i,o=at(),a=e?o._week.dow:0,s=[] if(null!=r)return yr(t,(r+a)%7,n,"day") for(i=0;i<7;i++)s[i]=yr(t,(i+a)%7,n,"day") return s}vr.calendar=function(e,t,r){var n=this._calendar[e]||this._calendar.sameElse return S(n)?n.call(t,r):n},vr.longDateFormat=function(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()] return t||!r?t:(this._longDateFormat[e]=r.match(j).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},vr.invalidDate=function(){return this._invalidDate},vr.ordinal=function(e){return this._ordinal.replace("%d",e)},vr.preparse=mr,vr.postformat=mr,vr.relativeTime=function(e,t,r,n){var i=this._relativeTime[r] return S(i)?i(e,t,r,n):i.replace(/%d/i,e)},vr.pastFuture=function(e,t){var r=this._relativeTime[e>0?"future":"past"] return S(r)?r(t):r.replace(/%s/i,t)},vr.set=function(e){var t,r for(r in e)o(e,r)&&(S(t=e[r])?this[r]=t:this["_"+r]=t) this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},vr.eras=function(e,t){var n,i,o,a=this._eras||at("en")._eras for(n=0,i=a.length;n=0)return u[n]},vr.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1 return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},vr.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||ir.call(this),e?this._erasAbbrRegex:this._erasRegex},vr.erasNameRegex=function(e){return o(this,"_erasNameRegex")||ir.call(this),e?this._erasNameRegex:this._erasRegex},vr.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||ir.call(this),e?this._erasNarrowRegex:this._erasRegex},vr.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||xe).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},vr.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[xe.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},vr.monthsParse=function(e,t,r){var n,i,o if(this._monthsParseExact)return Se.call(this,e,t,r) for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=h([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n if(!r&&this._monthsParse[n].test(e))return n}},vr.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Ae.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},vr.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Ae.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Oe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},vr.week=function(e){return De(e,this._week.dow,this._week.doy).week},vr.firstDayOfYear=function(){return this._week.doy},vr.firstDayOfWeek=function(){return this._week.dow},vr.weekdays=function(e,t){var r=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"] return!0===e?Le(r,this._week.dow):e?r[e.day()]:r},vr.weekdaysMin=function(e){return!0===e?Le(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},vr.weekdaysShort=function(e){return!0===e?Le(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},vr.weekdaysParse=function(e,t,r){var n,i,o if(this._weekdaysParseExact)return We.call(this,e,t,r) for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=h([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n if(!r&&this._weekdaysParse[n].test(e))return n}},vr.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},vr.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=He),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},vr.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ve),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)} vr.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},vr.meridiem=function(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},it("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10 return e+(1===W(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",it),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",at) var wr=Math.abs function _r(e,t,r,n){var i=Ut(t,r) return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function kr(e){return e<0?Math.floor(e):Math.ceil(e)}function xr(e){return 4800*e/146097}function Or(e){return 146097*e/4800}function Er(e){return function(){return this.as(e)}}var Sr=Er("ms"),Pr=Er("s"),Mr=Er("m"),Ar=Er("h"),jr=Er("d"),Rr=Er("w"),Tr=Er("M"),Cr=Er("Q"),Ir=Er("y") function Nr(e){return function(){return this.isValid()?this._data[e]:NaN}}var Dr=Nr("milliseconds"),Br=Nr("seconds"),Lr=Nr("minutes"),Fr=Nr("hours"),Ur=Nr("days"),zr=Nr("months"),qr=Nr("years") var Hr=Math.round,Vr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11} function Wr(e,t,r,n,i){return i.relativeTime(t||1,!!r,e,n)}var Gr=Math.abs function Yr(e){return(e>0)-(e<0)||+e}function Kr(){if(!this.isValid())return this.localeData().invalidDate() var e,t,r,n,i,o,a,s,u=Gr(this._milliseconds)/1e3,c=Gr(this._days),l=Gr(this._months),f=this.asSeconds() return f?(e=V(u/60),t=V(e/60),u%=60,e%=60,r=V(l/12),l%=12,n=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=f<0?"-":"",o=Yr(this._months)!==Yr(f)?"-":"",a=Yr(this._days)!==Yr(f)?"-":"",s=Yr(this._milliseconds)!==Yr(f)?"-":"",i+"P"+(r?o+r+"Y":"")+(l?o+l+"M":"")+(c?a+c+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+n+"S":"")):"P0D"}var Jr=At.prototype return Jr.isValid=function(){return this._isValid},Jr.abs=function(){var e=this._data return this._milliseconds=wr(this._milliseconds),this._days=wr(this._days),this._months=wr(this._months),e.milliseconds=wr(e.milliseconds),e.seconds=wr(e.seconds),e.minutes=wr(e.minutes),e.hours=wr(e.hours),e.months=wr(e.months),e.years=wr(e.years),this},Jr.add=function(e,t){return _r(this,e,t,1)},Jr.subtract=function(e,t){return _r(this,e,t,-1)},Jr.as=function(e){if(!this.isValid())return NaN var t,r,n=this._milliseconds if("month"===(e=F(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+xr(t),e){case"month":return r case"quarter":return r/3 case"year":return r/12}else switch(t=this._days+Math.round(Or(this._months)),e){case"week":return t/7+n/6048e5 case"day":return t+n/864e5 case"hour":return 24*t+n/36e5 case"minute":return 1440*t+n/6e4 case"second":return 86400*t+n/1e3 case"millisecond":return Math.floor(864e5*t)+n default:throw new Error("Unknown unit "+e)}},Jr.asMilliseconds=Sr,Jr.asSeconds=Pr,Jr.asMinutes=Mr,Jr.asHours=Ar,Jr.asDays=jr,Jr.asWeeks=Rr,Jr.asMonths=Tr,Jr.asQuarters=Cr,Jr.asYears=Ir,Jr.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*W(this._months/12):NaN},Jr._bubble=function(){var e,t,r,n,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*kr(Or(s)+a),a=0,s=0),u.milliseconds=o%1e3,e=V(o/1e3),u.seconds=e%60,t=V(e/60),u.minutes=t%60,r=V(t/60),u.hours=r%24,a+=V(r/24),s+=i=V(xr(a)),a-=kr(Or(i)),n=V(s/12),s%=12,u.days=a,u.months=s,u.years=n,this},Jr.clone=function(){return Ut(this)},Jr.get=function(e){return e=F(e),this.isValid()?this[e+"s"]():NaN},Jr.milliseconds=Dr,Jr.seconds=Br,Jr.minutes=Lr,Jr.hours=Fr,Jr.days=Ur,Jr.weeks=function(){return V(this.days()/7)},Jr.months=zr,Jr.years=qr,Jr.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate() var r,n,i=!1,o=Vr return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},Vr,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=function(e,t,r,n){var i=Ut(e).abs(),o=Hr(i.as("s")),a=Hr(i.as("m")),s=Hr(i.as("h")),u=Hr(i.as("d")),c=Hr(i.as("M")),l=Hr(i.as("w")),f=Hr(i.as("y")),h=o<=r.ss&&["s",o]||o0,h[4]=n,Wr.apply(null,h)}(this,!i,o,r=this.localeData()),i&&(n=r.pastFuture(+this,n)),r.postformat(n)},Jr.toISOString=Kr,Jr.toString=Kr,Jr.toJSON=Kr,Jr.locale=Zt,Jr.localeData=Xt,Jr.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kr),Jr.lang=Qt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),he("x",ue),he("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e))})),ve("x",(function(e,t,r){r._d=new Date(W(e))})), //! moment.js r.version="2.29.3",e=Ot,r.fn=pr,r.min=function(){var e=[].slice.call(arguments,0) return Pt("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0) return Pt("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=h,r.unix=function(e){return Ot(1e3*e)},r.months=function(e,t){return br(e,t,"months")},r.isDate=c,r.locale=it,r.invalid=m,r.duration=Ut,r.isMoment=w,r.weekdays=function(e,t,r){return gr(e,t,r,"weekdays")},r.parseZone=function(){return Ot.apply(null,arguments).parseZone()},r.localeData=at,r.isDuration=jt,r.monthsShort=function(e,t){return br(e,t,"monthsShort")},r.weekdaysMin=function(e,t,r){return gr(e,t,r,"weekdaysMin")},r.defineLocale=ot,r.updateLocale=function(e,t){if(null!=t){var r,n,i=Qe null!=Xe[e]&&null!=Xe[e].parentLocale?Xe[e].set(P(Xe[e]._config,t)):(null!=(n=nt(e))&&(i=n._config),t=P(i,t),null==n&&(t.abbr=e),(r=new M(t)).parentLocale=Xe[e],Xe[e]=r),it(e)}else null!=Xe[e]&&(null!=Xe[e].parentLocale?(Xe[e]=Xe[e].parentLocale,e===it()&&it(e)):null!=Xe[e]&&delete Xe[e]) return Xe[e]},r.locales=function(){return x(Xe)},r.weekdaysShort=function(e,t,r){return gr(e,t,r,"weekdaysShort")},r.normalizeUnits=F,r.relativeTimeRounding=function(e){return void 0===e?Hr:"function"==typeof e&&(Hr=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==Vr[e]&&(void 0===t?Vr[e]:(Vr[e]=t,"s"===e&&(Vr.ss=t-1),!0))},r.calendarFormat=function(e,t){var r=e.diff(t,"days",!0) return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},r.prototype=pr,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})),function(){ /*! * @overview Ember - JavaScript Application Framework * @copyright Copyright 2011-2019 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE * @version 3.18.1 */ var e,t,r mainContext=this,function(){var n,i function o(e,r){var a=e,s=n[a] s||(s=n[a+="/index"]) var u=i[a] if(void 0!==u)return u u=i[a]={},s||function(e,t){throw t?new Error("Could not find module "+e+" required by: "+t):new Error("Could not find module "+e)}(e,r) for(var c=s.deps,l=s.callback,f=new Array(c.length),h=0;h0||i>0)&&(0,r.scheduleOnce)("actions",this,s)},willChange:function(){return this}};(0,n.addArrayObserver)(a,this,u) return function(){return(0,n.removeArrayObserver)(a,i,u)}},wrapModelType:function(e,t){var r=this.getRecords(e,t) return{name:t,count:(0,n.get)(r,"length"),columns:this.columnsForType(e),object:e}},getModelTypes:function(){var e,t=this,r=this.get("containerDebugAdapter") return e=r.canCatalogEntriesByType("model")?r.catalogEntriesByType("model"):this._getObjectsOnNamespaces(),e=(0,o.A)(e).map((function(e){return{klass:t._nameToClass(e),name:e}})),e=(0,o.A)(e).filter((function(e){return t.detect(e.klass)})),(0,o.A)(e)},_getObjectsOnNamespaces:function(){var e=this,t=(0,o.A)(o.Namespace.NAMESPACES),r=(0,o.A)() return t.forEach((function(t){for(var n in t)if(t.hasOwnProperty(n)&&e.detect(t[n])){var o=(0,i.dasherize)(n) r.push(o)}})),r},getRecords:function(){return(0,o.A)()},wrapRecord:function(e){var t={object:e} return t.columnValues=this.getRecordColumnValues(e),t.searchKeywords=this.getRecordKeywords(e),t.filterValues=this.getRecordFilterValues(e),t.color=this.getRecordColor(e),t},getRecordColumnValues:function(){return{}},getRecordKeywords:function(){return(0,o.A)()},getRecordFilterValues:function(){return{}},getRecordColor:function(){return null},observeRecord:function(){return function(){}}}) e.default=a})),e("@ember/-internals/glimmer/index",["exports","ember-babel","@ember/polyfills","@glimmer/opcode-compiler","@ember/-internals/metal","@ember/-internals/owner","@ember/-internals/runtime","@ember/-internals/utils","@ember/-internals/views","@ember/debug","@glimmer/reference","@glimmer/runtime","@glimmer/validator","@ember/-internals/browser-environment","@ember/instrumentation","@ember/service","@ember/runloop","@ember/-internals/environment","@glimmer/util","@ember/deprecated-features","@ember/string","@ember/-internals/container","@glimmer/node","@ember/-internals/routing","@ember/component/template-only","@ember/error","rsvp"],(function(e,t,r,n,i,o,a,s,u,c,l,f,h,d,p,m,v,y,b,g,w,_,k,x,O,E,S){"use strict" var P,M,A,j,R,T,C,I function N(e){return"function"==typeof e}Object.defineProperty(e,"__esModule",{value:!0}),e.Component=e.Checkbox=e.AbstractComponentManager=void 0,Object.defineProperty(e,"DOMChanges",{enumerable:!0,get:function(){return f.DOMChanges}}),Object.defineProperty(e,"DOMTreeConstruction",{enumerable:!0,get:function(){return f.DOMTreeConstruction}}),e.LinkComponent=e.InteractiveRenderer=e.InertRenderer=e.INVOKE=e.Helper=void 0,Object.defineProperty(e,"NodeDOMTreeConstruction",{enumerable:!0,get:function(){return k.NodeDOMTreeConstruction}}),e._experimentalMacros=e.TextField=e.TextArea=e.SafeString=e.RootTemplate=e.Renderer=e.OutletView=void 0,e._registerMacros=function(e){Kr.push(e)},e._resetRenderers=function(){Xr.length=0},e.capabilities=function(e,t){void 0===t&&(t={}) var r return r="3.13"!==e||Boolean(t.updateHook),{asyncLifeCycleCallbacks:Boolean(t.asyncLifecycleCallbacks),destructor:Boolean(t.destructor),updateHook:r}},e.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML() if(null==e)return"" if(!e)return String(e) e=String(e)}if(!se.test(e))return e return e.replace(ue,ce)},e.getComponentManager=function(e){var t=Ur(e) return t&&!t.internal&&"component"===t.type?t.factory:void 0},e.getComponentTemplate=Cr,e.getModifierManager=zr,e.getTemplate=function(e){if(un.hasOwnProperty(e))return un[e]},e.getTemplates=function(){return un},e.hasTemplate=function(e){return un.hasOwnProperty(e)},e.helper=ie,e.htmlSafe=le,e.isHTMLSafe=fe,Object.defineProperty(e,"isSerializationFirstNode",{enumerable:!0,get:function(){return f.isSerializationFirstNode}}),e.modifierCapabilities=sr,e.renderSettled=function(){null===rn&&(rn=S.default.defer(),(0,v.getCurrentRunLoop)()||v.backburner.schedule("actions",null,tn)) return rn.promise},e.setComponentManager=function(e,t){var r r=g.COMPONENT_MANAGER_STRING_LOOKUP&&"string"==typeof e?function(t){return t.lookup("component-manager:"+e)}:e return Fr({factory:r,internal:!1,type:"component"},t)},e.setComponentTemplate=function(e,t){return Rr.set(t,e),t},e.setModifierManager=function(e,t){return Fr({factory:e,internal:!1,type:"modifier"},t)},e.setTemplate=function(e,t){return un[e]=t},e.setTemplates=function(e){un=e},e.setupApplicationRegistry=function(e){e.injection("renderer","env","-environment:main"),e.register("service:-dom-builder",{create:function(e){switch(e.bootOptions._renderMode){case"serialize":return k.serializeBuilder.bind(null) case"rehydrate":return f.rehydrationBuilder.bind(null) default:return f.clientBuilder.bind(null)}}}),e.injection("service:-dom-builder","bootOptions","-environment:main"),e.injection("renderer","builder","service:-dom-builder"),e.register((0,_.privatize)(R||(R=(0,t.taggedTemplateLiteralLoose)(["template:-root"]))),L),e.injection("renderer","rootTemplate",(0,_.privatize)(T||(T=(0,t.taggedTemplateLiteralLoose)(["template:-root"])))),e.register("renderer:-dom",sn),e.register("renderer:-inert",an),e.injection("renderer","document","service:-document")},e.setupEngineRegistry=function(e){e.optionsForType("template",{instantiate:!1}),e.register("view:-outlet",yn),e.register("template:-outlet",vn),e.injection("view:-outlet","template","template:-outlet"),e.register((0,_.privatize)(C||(C=(0,t.taggedTemplateLiteralLoose)(["template:components/-default"]))),pn),e.optionsForType("helper",{instantiate:!1}),e.register("helper:loc",dn),e.register("component:-text-field",K),e.register("component:-checkbox",G),e.register("component:link-to",X),e.register("component:input",hn),e.register("template:components/input",mn),e.register("component:textarea",J),y.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS||e.register((0,_.privatize)(I||(I=(0,t.taggedTemplateLiteralLoose)(["component:-default"]))),V)} e.template=B,e.templateCacheCounters=void 0 var D={cacheHit:0,cacheMiss:0} function B(e){var t=(0,n.templateFactory)(e),i=new WeakMap,o=t.meta,a=function(e){var n=i.get(e) return void 0===n?(D.cacheMiss++,n=t.create((0,r.assign)({owner:e},o)),i.set(e,n)):D.cacheHit++,n} return a.__id=t.id,a.__meta=o,a}e.templateCacheCounters=D var L=B({id:"s5o9bxSn",block:'{"symbols":[],"statements":[[1,[30,[36,0],[[32,0]],null]]],"hasEval":false,"upvars":["component"]}',meta:{moduleName:"packages/@ember/-internals/glimmer/lib/templates/root.hbs"}}) e.RootTemplate=L var F=(0,s.symbol)("DIRTY_TAG"),U=(0,s.symbol)("ARGS"),z=(0,s.symbol)("IS_DISPATCHING_ATTRS"),q=(0,s.symbol)("HAS_BLOCK"),H=(0,s.symbol)("BOUNDS"),V=u.CoreView.extend(u.ChildViewsSupport,u.ViewStateSupport,u.ClassNamesSupport,a.TargetActionSupport,u.ActionSupport,u.ViewMixin,((P={isComponent:!0,init:function(){this._super.apply(this,arguments),this[z]=!1,this[F]=(0,h.createTag)(),this[H]=null},rerender:function(){(0,h.dirtyTag)(this[F]),this._super()}})[i.PROPERTY_DID_CHANGE]=function(e,t){if(!this[z]){var r=this[U],n=void 0!==r?r[e]:void 0 void 0!==n&&void 0!==n[l.UPDATE_REFERENCED_VALUE]&&n[l.UPDATE_REFERENCED_VALUE](2===arguments.length?t:(0,i.get)(this,e))}},P.getAttr=function(e){return this.get(e)},P.readDOMAttr=function(e){var t=(0,u.getViewElement)(this),r=t,n="http://www.w3.org/2000/svg"===r.namespaceURI,i=(0,f.normalizeProperty)(r,e),o=i.type,a=i.normalized return n||"attr"===o?r.getAttribute(a):r[a]},P.didReceiveAttrs=function(){},P.didRender=function(){},P.willRender=function(){},P.didUpdateAttrs=function(){},P.willUpdate=function(){},P.didUpdate=function(){},P)) e.Component=V,V.toString=function(){return"@ember/component"},V.reopenClass({isComponentFactory:!0,positionalParams:[]}),(0,a.setFrameworkClass)(V) var W=B({id:"SWbqsLhV",block:'{"symbols":[],"statements":[],"hasEval":false,"upvars":[]}',meta:{moduleName:"packages/@ember/-internals/glimmer/lib/templates/empty.hbs"}}),G=V.extend({layout:W,classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","indeterminate","disabled","tabindex","name","autofocus","required","form"],type:"checkbox",disabled:!1,indeterminate:!1,didInsertElement:function(){this._super.apply(this,arguments),this.element.indeterminate=Boolean(this.indeterminate)},change:function(){(0,i.set)(this,"checked",this.element.checked)}}) e.Checkbox=G,G.toString=function(){return"@ember/component/checkbox"} var Y=d.hasDOM?Object.create(null):null var K=V.extend(u.TextSupport,{layout:W,classNames:["ember-text-field"],tagName:"input",attributeBindings:["accept","autocomplete","autosave","dir","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","lang","list","type","max","min","multiple","name","pattern","size","step","value","width"],value:"",type:(0,i.computed)({get:function(){return"text"},set:function(e,t){var r="text" return function(e){if(!d.hasDOM)return Boolean(e) if(e in Y)return Y[e] var t=document.createElement("input") try{t.type=e}catch(r){}return Y[e]=t.type===e}(t)&&(r=t),r}}),size:null,pattern:null,min:null,max:null}) e.TextField=K,K.toString=function(){return"@ember/component/text-field"} var J=V.extend(u.TextSupport,{classNames:["ember-text-area"],layout:W,tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","autocomplete","wrap","lang","dir","value"],rows:null,cols:null}) e.TextArea=J,J.toString=function(){return"@ember/component/text-area"} var $=B({id:"uDKxl8ne",block:'{"symbols":["&default"],"statements":[[6,[37,0],[[27,[32,1]]],null,[["default","else"],[{"statements":[[18,1,null]],"parameters":[]},{"statements":[[1,[32,0,["linkTitle"]]]],"parameters":[]}]]]],"hasEval":false,"upvars":["if"]}',meta:{moduleName:"packages/@ember/-internals/glimmer/lib/templates/link-to.hbs"}}),Z=Object.freeze({toString:function(){return"UNDEFINED"}}),Q=Object.freeze({}),X=V.extend({layout:$,tagName:"a",route:Z,model:Z,models:Z,query:Z,"current-when":null,title:null,rel:null,tabindex:null,target:null,activeClass:"active",loadingClass:"loading",disabledClass:"disabled",replace:!1,attributeBindings:["href","title","rel","tabindex","target"],classNameBindings:["active","loading","disabled","transitioningIn","transitioningOut"],eventName:"click",init:function(){this._super.apply(this,arguments) var e=this.eventName this.on(e,this,this._invoke)},_routing:(0,m.inject)("-routing"),_currentRoute:(0,i.alias)("_routing.currentRouteName"),_currentRouterState:(0,i.alias)("_routing.currentState"),_targetRouterState:(0,i.alias)("_routing.targetState"),_route:(0,i.computed)("route","_currentRouterState",(function(){var e=this.route return e===Z?this._currentRoute:e})),_models:(0,i.computed)("model","models",(function(){var e=this.model,t=this.models return e!==Z?[e]:t!==Z?t:[]})),_query:(0,i.computed)("query",(function(){var e=this.query return e===Z?Q:(0,r.assign)({},e)})),disabled:(0,i.computed)({get:function(e){return!1},set:function(e,t){return this._isDisabled=t,!!t&&this.disabledClass}}),active:(0,i.computed)("activeClass","_active",(function(){return!!this._active&&this.activeClass})),_active:(0,i.computed)("_currentRouterState","_route","_models","_query","loading","current-when",(function(){var e=this._currentRouterState return!!e&&this._isActive(e)})),willBeActive:(0,i.computed)("_currentRouterState","_targetRouterState","_route","_models","_query","loading","current-when",(function(){var e=this._currentRouterState,t=this._targetRouterState if(e!==t)return this._isActive(t)})),_isActive:function(e){if(this.loading)return!1 var t=this["current-when"] if("boolean"==typeof t)return t var r=Boolean(t) t=r?t.split(" "):[this._route] for(var n=this._models,i=this._query,o=this._routing,a=0;a0){var i=n[n.length-1] "object"==typeof i&&null!==i&&i.isQueryParams&&(this.query=i.values,n.pop())}}}}) e.LinkComponent=X,X.toString=function(){return"@ember/routing/link-component"},X.reopenClass({positionalParams:"params"}) var ee=(0,s.symbol)("RECOMPUTE_TAG") function te(e){return void 0!==e.destroy}var re=a.FrameworkObject.extend({init:function(){this._super.apply(this,arguments),this[ee]=(0,h.createTag)()},recompute:function(){var e=this;(0,v.join)((function(){return(0,h.dirtyTag)(e[ee])}))}}) e.Helper=re,re.isHelperFactory=!0,(0,a.setFrameworkClass)(re) var ne=function(){function e(e){this.compute=e,this.isHelperFactory=!0}return e.prototype.create=function(){return{compute:this.compute}},e}() function ie(e){return new ne(e)}var oe=function(){function e(e){this.string=e}var t=e.prototype return t.toString=function(){return""+this.string},t.toHTML=function(){return this.toString()},e}() e.SafeString=oe var ae={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},se=/[&<>"'`=]/,ue=/[&<>"'`=]/g function ce(e){return ae[e]}function le(e){return null==e?e="":"string"!=typeof e&&(e=String(e)),new oe(e)}function fe(e){return null!==e&&"object"==typeof e&&"function"==typeof e.toHTML}var he=function(){function e(e){this.resolver=e}var t=e.prototype return t.lookupHelper=function(e,t){return this.resolver.lookupHelper(e,t)},t.lookupModifier=function(e,t){return this.resolver.lookupModifier(e,t)},t.lookupComponent=function(e,t){var r=this.resolver.lookupComponentHandle(e,t) if(null===r)return null var n=this.resolver.resolve(r),i=n.manager,o=n.state,a=i.getCapabilities(o) return function(e,t){return!t.dynamicLayout}(0,a)?{handle:r,capabilities:a,compilable:i.getJitStaticLayout(o,this.resolver)}:{handle:r,capabilities:a,compilable:null}},t.lookupPartial=function(e,t){return this.resolver.lookupPartial(e,t)},t.resolve=function(e){return this.resolver.resolve(e)},e}(),de=function(){function e(){}var t=e.prototype return t.prepareArgs=function(e,t){return null},t.didCreateElement=function(e,t,r){},t.didRenderLayout=function(e,t){},t.didCreate=function(e){},t.update=function(e,t){},t.didUpdateLayout=function(e,t){},t.didUpdate=function(e){},e}() function pe(e){return{object:e.name+":"+e.outlet}}e.AbstractComponentManager=de var me={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:y.ENV._DEBUG_RENDER_TREE,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!0,updateHook:y.ENV._DEBUG_RENDER_TREE,createInstance:!0,wrapped:!1,willDestroy:!1},ve=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.create=function(e,t,r,n){var i=n.outletState,o=t.ref n.outletState=o var a={self:new l.ComponentRootReference(t.controller,e),environment:e,finalize:(0,p._instrumentStart)("render.outlet",pe,t)} if(y.ENV._DEBUG_RENDER_TREE){a.outlet={name:t.outlet},e.extra.debugRenderTree.create(a.outlet,{type:"outlet",name:a.outlet.name,args:f.EMPTY_ARGS,instance:void 0,template:void 0}) var s=i.value(),u=s&&s.render&&s.render.owner,c=o.value().render.owner if(u&&u!==c){var h=c,d=h.mountPoint a.engine={mountPoint:d},e.extra.debugRenderTree.create(a.engine,{type:"engine",name:d,args:f.EMPTY_ARGS,instance:h,template:void 0})}e.extra.debugRenderTree.create(a,{type:"route-template",name:t.name,args:r.capture(),instance:t.controller,template:t.template})}return a},n.getJitStaticLayout=function(e,t){var r=e.template return(0,b.unwrapTemplate)(r).asLayout()},n.getCapabilities=function(){return me},n.getSelf=function(e){return e.self},n.getTag=function(){return y.ENV._DEBUG_RENDER_TREE?(0,h.createTag)():h.CONSTANT_TAG},n.didRenderLayout=function(e,t){e.finalize(),y.ENV._DEBUG_RENDER_TREE&&(e.environment.extra.debugRenderTree.didRender(e,t),e.engine&&e.environment.extra.debugRenderTree.didRender(e.engine,t),e.environment.extra.debugRenderTree.didRender(e.outlet,t))},n.update=function(e){y.ENV._DEBUG_RENDER_TREE&&(e.environment.extra.debugRenderTree.update(e.outlet),e.engine&&e.environment.extra.debugRenderTree.update(e.engine),e.environment.extra.debugRenderTree.update(e))},n.didUpdateLayout=function(e,t){y.ENV._DEBUG_RENDER_TREE&&(e.environment.extra.debugRenderTree.didRender(e,t),e.engine&&e.environment.extra.debugRenderTree.didRender(e.engine,t),e.environment.extra.debugRenderTree.didRender(e.outlet,t))},n.getDestructor=function(e){return y.ENV._DEBUG_RENDER_TREE?{destroy:function(){e.environment.extra.debugRenderTree.willDestroy(e),e.engine&&e.environment.extra.debugRenderTree.willDestroy(e.engine),e.environment.extra.debugRenderTree.willDestroy(e.outlet)}}:null},r}(de),ye=new ve,be=function(e,t){void 0===t&&(t=ye),this.state=e,this.manager=t} function ge(){}var we=function(){function e(e,t,r,n,i){this.environment=e,this.component=t,this.args=r,this.finalizer=n,this.hasWrappedElement=i,this.classRef=null,this.classRef=null,this.argsRevision=null===r?0:(0,h.valueForTag)(r.tag),this.rootRef=new l.ComponentRootReference(t,e)}var t=e.prototype return t.willDestroy=function(){var e=this.component if(this.environment.isInteractive){e.trigger("willDestroyElement"),e.trigger("willClearRender") var t=(0,u.getViewElement)(e) t&&((0,u.clearElementView)(t),(0,u.clearViewElement)(e))}e.renderer.unregister(e)},t.destroy=function(){this.component.destroy()},t.finalize=function(){(0,this.finalizer)(),this.finalizer=ge},e}(),_e=function(e){function r(r,n,i){var o,a=function(e){var t,n=e.positional,i=e.named,o=n.value(),a=i.value() return t=r.compute(o,a),r[ee]&&(0,h.consumeTag)(r[ee]),t} return o=e.call(this,a,n,i)||this,(0,t.assertThisInitialized)(o)}return(0,t.inheritsLoose)(r,e),r}(l.HelperRootReference),ke=function(e){function r(t,r,n,i){var o return(o=e.call(this,r)||this).inner=t,o.env=r,o}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.value=function(){return this.inner},n.get=function(e){var t=this.value() return(0,s.isObject)(t)?new xe(t[e],this.env,this,e):f.PrimitiveReference.create(t)},r}(l.RootReference),xe=function(e){function r(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(r,e),r}(ke) function Oe(e,t){for(var r=e,n=0;n-1,l=c?Se(t,a.split(".")):Ee(t,a) g.EMBER_COMPONENT_IS_VISIBLE&&"style"===s&&void 0!==Pe&&(l=new Pe(t,l,Ee(t,"isVisible"),o)),n.setAttribute(s,l,!1,null)},Re=le("display: none;") g.EMBER_COMPONENT_IS_VISIBLE&&(Pe=function(){function e(e,t,r,n){this.inner=t,this.isVisible=r,this.env=n,this.tag=(0,h.combine)([t.tag,r.tag])}var t=e.prototype return t.value=function(){var e=this.inner.value(),t=this.isVisible.value() if(!1!==t)return e if(e){var r=e+" display: none;" return fe(e)?le(r):r}return Re},t.get=function(){return f.UNDEFINED_REFERENCE},e}(),Me=function(e,t,r){t.setAttribute("style",new Pe(e,f.UNDEFINED_REFERENCE,e.get("isVisible"),r),!1,null)}) var Te=function(e,t,r,n){var i=r.split(":"),o=i[0],a=i[1],s=i[2] if(""===o)n.setAttribute("class",f.PrimitiveReference.create(a),!0,null) else{var u,c=o.indexOf(".")>-1,l=c?o.split("."):[],h=c?Se(t,l):Ee(t,o) u=void 0===a?new Ce(h,c?l[l.length-1]:o):new Ie(h,a,s),n.setAttribute("class",u,!1,null)}},Ce=function(){function e(e,t){this.inner=e,this.path=t,this.tag=e.tag,this.dasherizedPath=null}return e.prototype.value=function(){var e=this.inner.value() if(!0===e){var t=this.path return this.dasherizedPath||(this.dasherizedPath=(0,w.dasherize)(t))}return e||0===e?String(e):null},e}(),Ie=function(){function e(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null),this.inner=e,this.truthy=t,this.falsy=r,this.tag=e.tag}return e.prototype.value=function(){var e=this.inner,t=this.truthy,r=this.falsy return e.value()?t:r},e}(),Ne=(0,s.symbol)("INVOKE") e.INVOKE=Ne var De=(0,s.symbol)("SOURCE"),Be=function(e){function r(t,r){var n return(n=e.call(this,r)||this).inner=t,n.tag=t.tag,n[De]=t,n}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.value=function(){return this.inner.value()},n.get=function(e){return this.inner.get(e)},n[l.UPDATE_REFERENCED_VALUE]=function(e){return this.inner[l.UPDATE_REFERENCED_VALUE](e)},n[Ne]=function(e){return this.inner[l.UPDATE_REFERENCED_VALUE](e)},r}(l.RootReference) var Le=(0,s.symbol)("ACTION") function Fe(e){return e}function Ue(e,t,r,n,i){var o,a if("function"==typeof r[Ne])o=r,a=r[Ne] else{var s=typeof r "string"===s?(o=t,a=t.actions&&t.actions[r]):"function"===s&&(o=e,a=r)}return function(){for(var e=arguments.length,t=new Array(e),r=0;r0))return null var c=Math.min(s.length,t.positional.length) a={},(0,r.assign)(a,t.named.capture().map) for(var l=0;l=e)return null var r=this.valueFor(t),n=this.memoFor(t) return this.position++,{value:r,memo:n}},e}(),mt=function(e){function r(t){var r return(r=e.call(this,t.length)||this).array=t,r}return(0,t.inheritsLoose)(r,e),r.from=function(e){return e.length>0?new this(e):null},r.fromForEachable=function(e){var t=[] return e.forEach((function(e){return t.push(e)})),this.from(t)},r.prototype.valueFor=function(e){return this.array[e]},r}(pt),vt=function(e){function r(t){var r return(r=e.call(this,t.length)||this).array=t,r}return(0,t.inheritsLoose)(r,e),r.from=function(e){return e.length>0?new this(e):null},r.prototype.valueFor=function(e){return(0,i.objectAt)(this.array,e)},r}(pt),yt=function(e){function r(t,r){var n return(n=e.call(this,r.length)||this).keys=t,n.values=r,n}(0,t.inheritsLoose)(r,e),r.fromIndexable=function(e){var t=Object.keys(e),r=t.length if(0===r)return null for(var n=[],o=0;o=2)&&t.push(o),r.push(e),n++})),0===n?null:i?new this(t,r):new mt(r)} var n=r.prototype return n.valueFor=function(e){return this.values[e]},n.memoFor=function(e){return this.keys[e]},r}(pt),bt=function(){function e(e,t){this.iterable=e,this.result=t,this.position=0}e.from=function(e){var t=e[Symbol.iterator](),r=t.next() return r.done?null:new this(t,r)} var t=e.prototype return t.isEmpty=function(){return!1},t.next=function(){var e=this.iterable,t=this.result,r=this.position if(t.done)return null var n=this.valueFor(t,r),i=this.memoFor(t,r) return this.position++,this.result=e.next(),{value:n,memo:i}},e}(),gt=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.valueFor=function(e){return e.value},n.memoFor=function(e,t){return t},r}(bt),wt=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.valueFor=function(e){return e.value[1]},n.memoFor=function(e){return e.value[0]},r}(bt) function _t(e){return"function"==typeof e.forEach}function kt(e){return"function"==typeof e[Symbol.iterator]}function xt(e){return(0,s.isProxy)(e)?Boolean((0,i.get)(e,"isTruthy")):(0,a.isArray)(e)?0!==e.length:Boolean(e)}var Ot=function(){function e(e){this.owner=e,y.ENV._DEBUG_RENDER_TREE&&(this._debugRenderTree=new lt)}var r=e.prototype return r.begin=function(){y.ENV._DEBUG_RENDER_TREE&&this.debugRenderTree.begin()},r.commit=function(){y.ENV._DEBUG_RENDER_TREE&&this.debugRenderTree.commit()},(0,t.createClass)(e,[{key:"debugRenderTree",get:function(){if(y.ENV._DEBUG_RENDER_TREE)return this._debugRenderTree throw new Error("Can't access debug render tree outside of the inspector (_DEBUG_RENDER_TREE flag is disabled)")}}]),e}(),Et=function(){function e(e,t){this.toBool=xt,this.toIterator=dt,this.getPath=i.get,this.setPath=i.set,this.extra=new Ot(e),this.isInteractive=t,function(e){var t if(d.hasDOM&&(t=it.call(e,"foobar:baz")),"foobar:"===t)e.protocolForURL=it else if("object"==typeof URL)$e=URL,e.protocolForURL=ot else{if("undefined"==typeof module||"function"!=typeof module.require)throw new Error("Could not find valid URL parsing mechanism for URL Sanitization") $e=module.require("url"),e.protocolForURL=ot}}(this)}var t=e.prototype return t.protocolForURL=function(e){return e},t.getTemplatePathDebugContext=function(e){return"While rendering:\n\n"+this.extra.debugRenderTree.logRenderStackForPath(e)},t.setTemplatePathDebugContext=function(e,t,r){var n="root" e instanceof l.IterationItemReference?n="iterator":e instanceof l.PropertyReference&&(n="property"),this.extra.debugRenderTree.createPath(e,t,n,r)},t.onTransactionBegin=function(){this.extra.begin()},t.onTransactionCommit=function(){this.extra.commit()},e}(),St={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!0,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!0,updateHook:!0,createInstance:!0,wrapped:!1,willDestroy:!1} function Pt(e){return e.capabilities.asyncLifeCycleCallbacks}function Mt(e){return e.capabilities.updateHook}function At(e){return e.capabilities.destructor}var jt=new(function(e){function n(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(n,e) var o=n.prototype return o.create=function(e,t,r){var n,o=t.delegate,a=r.capture(),u=a.named,c={},l=function(e){return u.get(e).tag} if(s.HAS_NATIVE_PROXY){var f={get:function(e,t){if(u.has(t)){var r=u.get(t) return(0,h.consumeTag)(r.tag),r.value()}if(t===i.CUSTOM_TAG_FOR)return l},has:function(e,t){return u.has(t)},ownKeys:function(e){return u.names},getOwnPropertyDescriptor:function(e,t){return{enumerable:!0,configurable:!0}}} 0,c=new Proxy(c,f)}else Object.defineProperty(c,i.CUSTOM_TAG_FOR,{configurable:!1,enumerable:!1,value:l}),u.names.forEach((function(e){Object.defineProperty(c,e,{enumerable:!0,configurable:!0,get:function(){var t=u.get(e) return(0,h.consumeTag)(t.tag),t.value()}})})) n={named:c,positional:a.positional.value()} var d=o.createComponent(t.ComponentClass.class,n),p=new Rt(o,d,a,e,c) return y.ENV._DEBUG_RENDER_TREE&&e.extra.debugRenderTree.create(p,{type:"component",name:t.name,args:r.capture(),instance:d,template:t.template}),p},o.update=function(e){y.ENV._DEBUG_RENDER_TREE&&e.env.extra.debugRenderTree.update(e) var t,r=e.delegate,n=e.component,i=e.args t={named:e.namedArgsProxy,positional:i.positional.value()},Mt(r)&&r.updateComponent(n,t)},o.didCreate=function(e){var t=e.delegate,r=e.component Pt(t)&&t.didCreateComponent(r)},o.didUpdate=function(e){var t=e.delegate,r=e.component;(function(e){return Pt(e)&&Mt(e)})(t)&&t.didUpdateComponent(r)},o.getContext=function(e){var t=e.delegate,r=e.component t.getContext(r)},o.getSelf=function(e){var t=e.env,r=e.delegate,n=e.component return new l.ComponentRootReference(r.getContext(n),t)},o.getDestructor=function(e){var t=null if(At(e.delegate)&&(t=e),y.ENV._DEBUG_RENDER_TREE){var r=t t={destroy:function(){e.env.extra.debugRenderTree.willDestroy(e),r&&r.destroy()}}}return t},o.getCapabilities=function(e){var t=e.delegate return(0,r.assign)({},St,{updateHook:y.ENV._DEBUG_RENDER_TREE||t.capabilities.updateHook})},o.getTag=function(e){var t=e.args return(0,h.isConst)(t)?(0,h.createTag)():t.tag},o.didRenderLayout=function(e,t){y.ENV._DEBUG_RENDER_TREE&&e.env.extra.debugRenderTree.didRender(e,t)},o.didUpdateLayout=function(e,t){y.ENV._DEBUG_RENDER_TREE&&e.env.extra.debugRenderTree.didRender(e,t)},o.getJitStaticLayout=function(e){return(0,b.unwrapTemplate)(e.template).asLayout()},n}(de)),Rt=function(){function e(e,t,r,n,i){this.delegate=e,this.component=t,this.args=r,this.env=n,this.namedArgsProxy=i}return e.prototype.destroy=function(){var e=this.delegate,t=this.component At(e)&&e.destroyComponent(t)},e}(),Tt=function(e,t,r,n){this.name=e,this.ComponentClass=t,this.delegate=r,this.template=n,this.manager=jt,this.state={name:e,ComponentClass:t,template:n,delegate:r}},Ct=function(e,t,r){this.manager=e,this.state={ComponentClass:t,layout:r}},It=function(e){function r(t){var r return(r=e.call(this)||this).owner=t,r}return(0,t.inheritsLoose)(r,e),r.prototype.getJitStaticLayout=function(e){var t=e.layout return(0,b.unwrapTemplate)(t).asLayout()},r}(de),Nt={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:y.ENV._DEBUG_RENDER_TREE,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!1,updateHook:y.ENV._DEBUG_RENDER_TREE,createInstance:!0,wrapped:!1,willDestroy:!1},Dt=new(function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.getJitStaticLayout=function(e){var t=e.template return(0,b.unwrapTemplate)(t).asLayout()},n.getCapabilities=function(){return Nt},n.create=function(e,t,r){var n=t.name,i=t.template if(y.ENV._DEBUG_RENDER_TREE){var o={environment:e} return e.extra.debugRenderTree.create(o,{type:"component",name:n,args:r.capture(),instance:null,template:i}),o}return null},n.getSelf=function(){return f.NULL_REFERENCE},n.getTag=function(){return y.ENV._DEBUG_RENDER_TREE?(0,h.createTag)():h.CONSTANT_TAG},n.getDestructor=function(e){return y.ENV._DEBUG_RENDER_TREE?{destroy:function(){e.environment.extra.debugRenderTree.willDestroy(e)}}:null},n.didRenderLayout=function(e,t){y.ENV._DEBUG_RENDER_TREE&&e.environment.extra.debugRenderTree.didRender(e,t)},n.update=function(e){y.ENV._DEBUG_RENDER_TREE&&e.environment.extra.debugRenderTree.update(e)},n.didUpdateLayout=function(e,t){y.ENV._DEBUG_RENDER_TREE&&e.environment.extra.debugRenderTree.didRender(e,t)},r}(de)),Bt=function(){function e(e,t){this.name=e,this.template=t,this.manager=Dt}return(0,t.createClass)(e,[{key:"state",get:function(){return this}}]),e}(),Lt=function(e){return e.positional.at(0)} function Ft(e){return"checkbox"===e.positional.at(0).value()?"-checkbox":"-text-field"}function Ut(e){var t=e.positional,r=t.at(0).value().split("."),n=r[r.length-1],i=t.at(1).value() return!0===i?(0,w.dasherize)(n):i||0===i?String(i):""}var zt=function(){function e(e){this.inner=e,this.valueTag=(0,h.createUpdatableTag)(),this.tag=(0,h.combine)([e.tag,this.valueTag])}var t=e.prototype return t.value=function(){var e=this.inner.value(),t=(0,i.tagForProperty)(e,"[]") return(0,h.updateTag)(this.valueTag,t),e},t.get=function(e){return this.inner.get(e)},e}() var qt=function(e){return function(e){return null==e||"function"!=typeof e.toString}(e)?"":String(e)} function Ht(e){return e.positional.value().map(qt).join("")}function Vt(e){var t=null return t}var Wt=Vt() function Gt(e){var t=e.positional,r=t.at(0) return function(){for(var e=t.value(),n=e[0],i=e.slice(1),o=arguments.length,a=new Array(o),s=0;s=0)return!0 for(var r=0;r1)if(o=f.at(0),(u=f.at(1))[Ne])a=u else{u.propertyKey a=u.value()}for(var d=[],p=2;p0&&(r=function(e){return t.map((function(e){return e.value()})).concat(e)}) e&&(n=function(t){var r=e.value() return r&&t.length>0&&(t[0]=(0,i.get)(t[0],r)),t}) return r&&n?function(e){return n(r(e))}:r||n||Fe}(n.has("value")&&n.get("value"),u) return(r="function"==typeof s[Ne]?Ue(s,s,s[Ne],f,c):(0,h.isConst)(l)&&(0,h.isConst)(s)?Ue(a.value(),l.value(),s.value(),f,c):function(e,t,r,n,i){0 return function(){return Ue(e,t.value(),r.value(),n,i).apply(void 0,arguments)}}(a.value(),l,s,f,c))[Le]=!0,new ke(r,t.env)},array:function(e){return e.positional.capture()},concat:function(e,t){return new l.HelperRootReference(Ht,e.capture(),t.env)},fn:function(e,t){return new l.HelperRootReference(Gt,e.capture(),t.env)},get:function(e,t){var r=e.positional.at(0),n=e.positional.at(1) if((0,h.isConst)(n)){var i=n.value() return null==i||""===i?f.NULL_REFERENCE:"string"==typeof i&&i.indexOf(".")>-1?Oe(r,i.split(".")):r.get(String(i))}return new Kt(e.capture(),t.env)},hash:Jt,log:function(e,t){return new l.HelperRootReference(Qt,e.capture(),t.env)},mut:function(e,t){var r=e.positional.at(0) return"function"==typeof r[Ne]?r:new Be(r,t.env)},"query-params":function(e,t){return new l.HelperRootReference(Xt,e.capture(),t.env)},readonly:function(e,t){var r=function(e){return e[De]||e}(e.positional.at(0)) return new er(r,t.env)},unbound:function(e,t){return new ke(e.positional.at(0).value(),t.env)},unless:function(e,t){return new l.HelperRootReference(Zt,e.capture(),t.env)},"-hash":Jt,"-each-in":function(e){return new ft(e.positional.at(0))},"-input-type":function(e,t){return new l.HelperRootReference(Ft,e.capture(),t.env)},"-normalize-class":function(e,t){return new l.HelperRootReference(Ut,e.capture(),t.env)},"-track-array":function(e){return new zt(e.positional.at(0))},"-get-dynamic-var":f.getDynamicVar,"-mount":function(e,t){var r=t.env,n=e.positional.at(0),i=null if(e.named.has("model")){var o=e.named.capture() 0,i={tag:o.tag,positional:f.EMPTY_ARGS.positional,named:o,length:1,value:function(){return{named:this.named.value(),positional:this.positional.value()}}}}return new Er(n,r,i)},"-outlet":function(e,t){var r,n=t.dynamicScope() return r=0===e.positional.length?new l.ConstReference("main"):e.positional.at(0),new jr(new Pr(n.outletState,r),t.env)},"-assert-implicit-component-helper-argument":Lt},Gr=function(){function e(e){this.handles=[void 0],this.objToHandle=new WeakMap,this.builtInHelpers=Wr,this.componentDefinitionCache=new Map,this.componentDefinitionCount=0,this.helperDefinitionCount=0,this.isInteractive=e,this.builtInModifiers={action:{manager:new ar,state:null},on:{manager:new _r(e),state:null}}}var r=e.prototype return r.lookupComponent=function(e,t){var r=this.lookupComponentHandle(e,t) return null===r?null:this.resolve(r)},r.lookupComponentHandle=function(e,t){var r=this.handles.length,n=this.handle(this._lookupComponentDefinition(e,t)) return r===n&&this.componentDefinitionCount++,n},r.resolve=function(e){return this.handles[e]},r.lookupHelper=function(e,t){var r=this.handles.length,n=this._lookupHelper(e,t) if(null!==n){var i=this.handle(n) return r===i&&this.helperDefinitionCount++,i}return null},r.lookupModifier=function(e,t){return this.handle(this._lookupModifier(e,t))},r.lookupPartial=function(e,t){if(g.PARTIALS){var r=this._lookupPartial(e,t) return this.handle(r)}return null},r.compilable=function(){},r.handle=function(e){if(null==e)return null var t=this.objToHandle.get(e) return void 0===t&&(t=this.handles.push(e)-1,this.objToHandle.set(e,t)),t},r._lookupHelper=function(e,t){var r=this.builtInHelpers[e] if(void 0!==r)return r var n=t.moduleName,i=t.owner,o=e,a=Hr(n,void 0),s=i.factoryFor("helper:"+o,a)||i.factoryFor("helper:"+o) return function(e){return"object"==typeof e&&null!==e&&e.class&&e.class.isHelperFactory}(s)?function(e,t){var r=s.create() return te(r)&&t.associateDestroyable({destroy:function(){r.destroy()}}),new _e(r,e.capture(),t.env)}:null},r._lookupPartial=function(e,t){var r=t.owner,i=Ir(e,r)(r) return new n.PartialDefinitionImpl(e,i)},r._lookupModifier=function(e,t){var r=this.builtInModifiers[e] if(void 0===r){var n=t.owner,i=n.factoryFor("modifier:"+e) if(void 0!==i){var o=zr(i.class)(n) return new ur(e,i,o,this.isInteractive)}}return r},r._parseNameForNamespace=function(e){var t=e,r=void 0,n=e.indexOf("::") return-1!==n&&(t=e.slice(n+2),r=e.slice(0,n)),{name:t,namespace:r}},r._lookupComponentDefinition=function(e,r){var n,i,o=e,a=r.owner,s=function(e,t,r){if(r.source||r.namespace){var n=Vr(e,t,r) if(null!==n)return n}return Vr(e,t)}(a,o,Hr(r.moduleName,void 0)) if(null===s)return null i=null===s.component?n=s.layout(a):s.component var u=this.componentDefinitionCache.get(i) if(void 0!==u)return u void 0===n&&null!==s.layout&&(n=s.layout(a)) var c=(0,p._instrumentStart)("render.getComponentDefinition",qr,o),l=null if(null===s.component?y.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS&&(l=new Bt(o,n)):(0,O.isTemplateOnlyComponent)(s.component.class)&&(l=new Bt(o,n)),null!==s.component){var f=s.component.class,h=Ur(f) if(null!==h&&"component"===h.type){var d=h.factory l=h.internal?new Ct(d(a),f,n):new Tt(o,s.component,d(a),void 0!==n?n:a.lookup((0,_.privatize)(A||(A=(0,t.taggedTemplateLiteralLoose)(["template:components/-default"]))))(a))}}return null===l&&(l=new et(o,s.component||a.factoryFor((0,_.privatize)(j||(j=(0,t.taggedTemplateLiteralLoose)(["component:-default"])))),n)),c(),this.componentDefinitionCache.set(i,l),l},e}() function Yr(e){return null===e?null:[e[0].map((function(e){return"@"+e})),e[1]]}var Kr=[] function Jr(e,t,r,i){var o=i.resolver.lookupComponent(e,i.meta.referrer) return null!==o?(0,n.staticComponent)(o,[null===t?[]:t,Yr(r),n.EMPTY_BLOCKS]):n.UNHANDLED}function $r(e,t,r,i,o){var a=o.resolver.lookupComponent(e,o.meta.referrer) return null!==a?(0,n.staticComponent)(a,[t,Yr(r),i]):n.NONE}e._experimentalMacros=Kr var Zr=function(){function e(e,t){this.view=e,this.outletState=t}var t=e.prototype return t.child=function(){return new e(this.view,this.outletState)},t.get=function(e){return this.outletState},t.set=function(e,t){return this.outletState=t,t},e}(),Qr=function(){function e(e,t,r,n,i,o,a,s){var c=this this.root=e,this.runtime=t,this.id=(0,u.getViewId)(e),this.result=void 0,this.destroyed=!1,this.render=function(){var e,u=(0,b.unwrapTemplate)(n).asLayout().compile(r),l=(0,f.renderJitMain)(t,r,i,s(t.env,{element:o,nextSibling:null}),(0,b.unwrapHandle)(u),a) do{e=l.next()}while(!e.done) var h=c.result=e.value c.render=function(){return h.rerender({alwaysRevalidate:!1})}}}var t=e.prototype return t.isFor=function(e){return this.root===e},t.destroy=function(){var e=this.result,t=this.runtime.env this.destroyed=!0,this.runtime=void 0,this.root=null,this.result=void 0,this.render=void 0,e&&(0,f.inTransaction)(t,(function(){return e.destroy()}))},e}(),Xr=[] function en(e){var t=Xr.indexOf(e) Xr.splice(t,1)}function tn(){}var rn=null var nn=0 v.backburner.on("begin",(function(){for(var e=0;ey.ENV._RERENDER_LOOP_LIMIT)throw nn=0,Xr[e].destroy(),new Error("infinite rendering invalidation detected") return nn++,v.backburner.join(null,tn)}nn=0,function(){if(null!==rn){var e=rn.resolve rn=null,v.backburner.join(null,e)}}()})) var on=function(){function e(e,t,r,i,o,a,s){void 0===a&&(a=!1),void 0===s&&(s=f.clientBuilder),this._inRenderTransaction=!1,this._lastRevision=-1,this._destroyed=!1,this._rootTemplate=i(e),this._viewRegistry=o,this._destinedForDOM=a,this._roots=[],this._removedRoots=[],this._builder=s var u=this._runtimeResolver=new Gr(r.isInteractive),c=new he(u),l=this._context=(0,n.JitContext)(c);(function(e){var t=e.inlines,r=e.blocks t.addMissing(Jr),r.addMissing($r) for(var n=0;n=e||o.render()}t._lastRevision=(0,h.valueForTag)(h.CURRENT_TAG)}))}while(r.length>e) for(;i.length;){var o=i.pop(),a=r.indexOf(o) r.splice(a,1)}0===this._roots.length&&en(this)},i._renderRootsTransaction=function(){if(!this._inRenderTransaction){this._inRenderTransaction=!0 var e=!1 try{this._renderRoots(),e=!0}finally{e||(this._lastRevision=(0,h.valueForTag)(h.CURRENT_TAG)),this._inRenderTransaction=!1}}},i._clearAllRoots=function(){for(var e=this._roots,t=0;t0&&(r.splice(0,this._inheritedEnd),this._inheritedEnd=0) for(var n=0;n=0;i--){var o=e[i] if(o.event===t&&o.target===r&&o.method===n)return i}return-1}e.meta=d})),e("@ember/-internals/metal/index",["exports","ember-babel","@ember/-internals/meta","@ember/-internals/utils","@ember/debug","@ember/-internals/environment","@ember/runloop","@glimmer/validator","@ember/polyfills","@ember/error","ember/version","@ember/-internals/meta/lib/meta","@ember/deprecated-features","@ember/-internals/owner"],(function(e,t,r,n,i,o,a,s,u,c,l,f,h,d){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.SYNC_OBSERVERS=e.PROXY_CONTENT=e.PROPERTY_DID_CHANGE=e.NAMESPACES_BY_ID=e.NAMESPACES=e.Mixin=e.Libraries=e.DEBUG_INJECTION_FUNCTIONS=e.ComputedProperty=e.CUSTOM_TAG_FOR=e.ASYNC_OBSERVERS=void 0,e._getPath=_e,e._globalsComputed=void 0,e.activateObserver=j,e.addArrayObserver=function(e,t,r){return Q(e,t,r,_,!1)},e.addListener=_,e.addNamespace=function(e){ze.unprocessedNamespaces=!0,He.push(e)},e.addObserver=M,e.alias=function(e){return de(new je(e),Ae)},e.aliasMethod=void 0,e.applyMixin=ut,e.arrayContentDidChange=K,e.arrayContentWillChange=Y,e.beginPropertyChanges=V,e.changeProperties=G,e.classToString=Ke,e.computed=Pe,e.defineProperty=ve,e.deprecateProperty=function(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,set:function(e){ke(this,r,e)},get:function(){return we(this,r)}})},e.descriptorForDecorator=te,e.descriptorForProperty=ee,e.destroy=function(e){var t=(0,f.peekMeta)(e) if(null===t||t.isSourceDestroying())return!1 return t.setSourceDestroying(),function(e){S.size>0&&S.delete(e) P.size>0&&P.delete(e)}(e),(0,a.schedule)("destroy",t,Le),!0},e.eachProxyArrayDidChange=function(e,t,r,n){var i=Ce.get(e) void 0!==i&&i.arrayDidChange(e,t,r,n)},e.eachProxyArrayWillChange=function(e,t,r,n){var i=Ce.get(e) void 0!==i&&i.arrayWillChange(e,t,r,n)},e.endPropertyChanges=W,e.expandProperties=me,e.findNamespace=function(e){Ue||Ye() return Ve[e]},e.findNamespaces=We,e.flushAsyncObservers=function(e){void 0===e&&(e=!0) var t=(0,s.valueForTag)(s.CURRENT_TAG) if(I===t)return I=t,P.forEach((function(t,n){var i=(0,r.peekMeta)(n) i&&(i.isSourceDestroying()||i.isMetaDestroyed())?P.delete(n):t.forEach((function(t,r){if(!(0,s.validateTag)(t.tag,t.lastRevision)){var o=function(){try{x(n,r,[n,t.path],void 0,i)}finally{t.tag=(0,s.combine)(ae(n,t.path)),t.lastRevision=(0,s.valueForTag)(t.tag)}} e?(0,a.schedule)("actions",o):o()}}))}))} e.get=we,e.getCacheFor=v,e.getCachedValueFor=y,e.getChainTagsForKey=ae,e.getProperties=function(e,t){var r={},n=arguments,i=1 2===arguments.length&&Array.isArray(t)&&(i=0,n=arguments[1]) for(;i0},e.inject=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n=0;s-=3){var u=i[s],c=i[s+1],l=i[s+2] c&&(l&&k(e,t,u,c),u||(u=e),"string"==typeof c&&(c=u[c]),c.apply(u,n))}return!0}function O(e){return e+":change"}var E=!o.ENV._DEFAULT_ASYNC_OBSERVERS,S=new Map e.SYNC_OBSERVERS=S var P=new Map function M(e,t,n,i,o){void 0===o&&(o=E) var a=O(t) _(e,a,n,i,!1,o) var s=(0,r.peekMeta)(e) null!==s&&(s.isPrototypeMeta(e)||s.isInitializing())||j(e,a,o)}function A(e,t,n,i,o){void 0===o&&(o=E) var a=O(t),s=(0,r.peekMeta)(e) null!==s&&(s.isPrototypeMeta(e)||s.isInitializing())||C(e,a,o),k(e,a,n,i)}function j(e,t,r){void 0===r&&(r=!1) var n=function(e,t){var r=!0===t?S:P return r.has(e)||r.set(e,new Map),r.get(e)}(e,r) if(n.has(t))n.get(t).count++ else{var i=t.split(":")[0],o=(0,s.combine)(ae(e,i)) n.set(t,{count:1,path:i,tag:o,lastRevision:(0,s.valueForTag)(o),suspended:!1})}}e.ASYNC_OBSERVERS=P var R=!1,T=[] function C(e,t,r){if(void 0===r&&(r=!1),!0!==R){var n=!0===r?S:P,i=n.get(e) if(void 0!==i){var o=i.get(t) o.count--,0===o.count&&(i.delete(t),0===i.size&&n.delete(e))}}else T.push([e,t,r])}var I=0 function N(){S.forEach((function(e,t){var n=(0,r.peekMeta)(t) n&&(n.isSourceDestroying()||n.isMetaDestroyed())?S.delete(t):e.forEach((function(e,r){if(!e.suspended&&!(0,s.validateTag)(e.tag,e.lastRevision))try{e.suspended=!0,x(t,r,[t,e.path],void 0,n)}finally{e.tag=(0,s.combine)(ae(t,e.path)),e.lastRevision=(0,s.valueForTag)(e.tag),e.suspended=!1}}))}))}function D(e,t,r){var n=S.get(e) if(n){var i=n.get(O(t)) i&&(i.suspended=r)}}(0,s.setPropertyDidChange)((function(){return a.backburner.ensureInstance()})) var B=(0,n.symbol)("CUSTOM_TAG_FOR") e.CUSTOM_TAG_FOR=B var L=(0,n.symbol)("SELF_TAG") function F(e,t){if(!(0,n.isObject)(e))return s.CONSTANT_TAG if("function"==typeof e[B])return e[B](t) var r=(0,s.tagFor)(e,t) return r}function U(e,t){(0,s.dirtyTagFor)(e,t),(0,s.dirtyTagFor)(e,L)}var z=(0,n.symbol)("PROPERTY_DID_CHANGE") e.PROPERTY_DID_CHANGE=z var q=0 function H(e,t,n,i){var o=void 0===n?(0,r.peekMeta)(e):n null!==o&&(o.isInitializing()||o.isPrototypeMeta(e))||(U(e,t),q<=0&&N(),z in e&&(4===arguments.length?e[z](t,i):e[z](t)))}function V(){q++,R=!0}function W(){--q<=0&&(N(),function(){R=!1 for(var e,r=(0,t.createForOfIteratorHelperLoose)(T);!(e=r()).done;){var n=e.value C(n[0],n[1],n[2])}T=[]}())}function G(e){V() try{e()}finally{W()}}function Y(e,t,r,n){return void 0===t?(t=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),x(e,"@array:before",[e,t,r,n]),e}function K(e,t,n,i,o){void 0===o&&(o=!0),void 0===t?(t=0,n=i=-1):(void 0===n&&(n=-1),void 0===i&&(i=-1)) var a=(0,r.peekMeta)(e) o&&((i<0||n<0||i-n!=0)&&H(e,"length",a),H(e,"[]",a)),x(e,"@array:change",[e,t,n,i]) var s=w(e) if(void 0!==s){var u=-1===n?0:n,c=e.length-((-1===i?0:i)-u),l=t<0?c+t:t if(s.has("firstObject")&&0===l&&H(e,"firstObject",a),s.has("lastObject"))c-10&&(n=r)._property.apply(n,t) return r}(0,t.inheritsLoose)(i,e) var o=i.prototype return o.setup=function(t,r,n,i){if(e.prototype.setup.call(this,t,r,n,i),!1===this._hasConfig){var o=n.get,a=n.set void 0!==o&&(this._getter=o),void 0!==a&&(this._setter=function(e,t){var r=a.call(this,t) return void 0!==o&&void 0===r?o.call(this):r})}},o.volatile=function(){this._volatile=!0},o.readOnly=function(){this._readOnly=!0},o.property=function(){this._property.apply(this,arguments)},o._property=function(){var e=[] function t(t){e.push(t)}for(var r=0;r=65&&e<=90){var s=$e(t,a) s&&(0,n.setName)(s,a)}}}function Ge(e){(function e(t,r,i){var o=t.length,a=t.join(".") for(var s in Ve[a]=r,(0,n.setName)(r,a),r)if(Fe.call(r,s)){var u=r[s] if(t[o]=s,u&&u.toString===Ke&&void 0===(0,n.getName)(u))(0,n.setName)(u,t.join(".")) else if(u&&u.isNamespace){if(i.has(u))continue i.add(u),e(t,u,i)}}t.length=o})([e.toString()],e,new Set)}function Ye(){var e=ze.unprocessedNamespaces if(e&&(We(),ze.unprocessedNamespaces=!1),e||qe){for(var t=He,r=0;r=0||"concatenatedProperties"===t||"mergedProperties"===t?r=function(e,t,r,i){var o=i[t]||e[t],a=(0,n.makeArray)(o).concat((0,n.makeArray)(r)) return a}(e,t,r,a):c&&c.indexOf(t)>-1?r=function(e,t,r,i){var o=i[t]||e[t] if(!o)return r var a=(0,u.assign)({},o),s=!1 for(var c in r)if(r.hasOwnProperty(c)){var l=r[c] Qe(l)?(s=!0,a[c]=it(e,c,l,o,{})):a[c]=l}return s&&(a._super=n.ROOT),a}(e,t,r,a):Qe(r)&&(r=it(e,t,r,a,o)),o[t]=void 0,a[t]=r)}function at(e,t,r,i){var o=(0,n.getObservers)(r),a=(0,n.getListeners)(r) if(void 0!==o)for(var s=i?M:A,u=0;u0){r=new Array(t) for(var n=0;n7)},e.supportsHistory=function(e,t){if((-1!==e.indexOf("Android 2.")||-1!==e.indexOf("Android 4.0"))&&-1!==e.indexOf("Mobile Safari")&&-1===e.indexOf("Chrome")&&-1===e.indexOf("Windows Phone"))return!1 return Boolean(t&&"pushState"in t)}})),e("@ember/-internals/routing/lib/services/router",["exports","ember-babel","@ember/-internals/runtime","@ember/debug","@ember/object/computed","@ember/service","@ember/-internals/routing/lib/utils"],(function(e,t,r,n,i,o,a){"use strict" function s(e,t){return"/"===t?e:e.substr(t.length,e.length)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var u=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.init=function(){var t=this e.prototype.init.apply(this,arguments),this._router.on("routeWillChange",(function(e){t.trigger("routeWillChange",e)})),this._router.on("routeDidChange",(function(e){t.trigger("routeDidChange",e)}))},n.transitionTo=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),i=1;i0 return!c||(this._router._prepareQueryParams(i,o,s,!0),(0,a.shallowEqual)(s,u.state.queryParams))},n.recognize=function(e){var t=s(e,this.rootURL) return this._router._routerMicrolib.recognize(t)},n.recognizeAndLoad=function(e){var t=s(e,this.rootURL) return this._router._routerMicrolib.recognizeAndLoad(t)},r}(o.default) e.default=u,u.reopen(r.Evented,{currentRouteName:(0,i.readOnly)("_router.currentRouteName"),currentURL:(0,i.readOnly)("_router.currentURL"),location:(0,i.readOnly)("_router.location"),rootURL:(0,i.readOnly)("_router.rootURL"),currentRoute:(0,i.readOnly)("_router.currentRoute")})})),e("@ember/-internals/routing/lib/services/routing",["exports","ember-babel","@ember/object/computed","@ember/polyfills","@ember/service"],(function(e,t,r,n,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var o=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var i=r.prototype return i.hasRoute=function(e){return this.router.hasRoute(e)},i.transitionTo=function(e,t,r,n){var i=this.router._doTransition(e,t,r) return n&&i.method("replace"),i},i.normalizeQueryParams=function(e,t,r){this.router._prepareQueryParams(e,t,r)},i.generateURL=function(e,t,r){var i=this.router if(i._routerMicrolib){var o={} return r&&((0,n.assign)(o,r),this.normalizeQueryParams(e,t,o)),i.generate.apply(i,[e].concat(t,[{queryParams:o}]))}},i.isActiveForRoute=function(e,t,r,n,i){var o=this.router._routerMicrolib.recognizer.handlersFor(r),a=o[o.length-1].handler,s=function(e,t){for(var r=0,n=0;ns&&(r=a),n.isActiveIntent(r,e,t,!i)},r}(i.default) e.default=o,o.reopen({targetState:(0,r.readOnly)("router.targetState"),currentState:(0,r.readOnly)("router.currentState"),currentRouteName:(0,r.readOnly)("router.currentRouteName"),currentPath:(0,r.readOnly)("router.currentPath")})})),e("@ember/-internals/routing/lib/system/cache",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=function(){function e(){this.cache=new Map}var t=e.prototype return t.has=function(e){return this.cache.has(e)},t.stash=function(e,t,r){var n=this.cache.get(e) void 0===n&&(n=new Map,this.cache.set(e,n)),n.set(t,r)},t.lookup=function(e,t,r){if(!this.has(e))return r var n=this.cache.get(e) return n.has(t)?n.get(t):r},e}() e.default=t})),e("@ember/-internals/routing/lib/system/controller_for",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t,r){return e.lookup("controller:"+t,r)}})),e("@ember/-internals/routing/lib/system/dsl",["exports","@ember/debug","@ember/polyfills"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n=0 function i(e){return"function"==typeof e}var o=function(){function e(e,t){void 0===e&&(e=null),this.explicitIndex=!1,this.parent=e,this.enableLoadingSubstates=Boolean(t&&t.enableLoadingSubstates),this.matches=[],this.options=t}var t=e.prototype return t.route=function(t,r,n){var o,u=null,c="/_unused_dummy_error_path_route_"+t+"/:error" if(i(r)?(o={},u=r):i(n)?(o=r,u=n):o=r||{},this.enableLoadingSubstates&&(s(this,t+"_loading",{resetNamespace:o.resetNamespace}),s(this,t+"_error",{resetNamespace:o.resetNamespace,path:c})),u){var l=a(this,t,o.resetNamespace),f=new e(l,this.options) s(f,"loading"),s(f,"error",{path:c}),u.call(f),s(this,t,o,f.generate())}else s(this,t,o)},t.push=function(e,t,n,i){var o=t.split(".") if(this.options.engineInfo){var a=t.slice(this.options.engineInfo.fullName.length+1),s=(0,r.assign)({localFullName:a},this.options.engineInfo) i&&(s.serializeMethod=i),this.options.addRouteForEngine(t,s)}else if(i)throw new Error("Defining a route serializer on route '"+t+"' outside an Engine is not allowed.") ""!==e&&"/"!==e&&"index"!==o[o.length-1]||(this.explicitIndex=!0),this.matches.push(e,t,n)},t.generate=function(){var e=this.matches return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var r=0;r0&&(m.set(this,[]),(0,l.once)(this._router,"_setOutlets"))},s.buildRouteInfoMetadata=function(){},o}(o.Object) function g(e){var t=function(e,t,r){void 0===r&&(r=0) if(!t)return for(var n=0;n0 if(u){var f=(0,n.get)(u,"queryParams")||{} e=function(e,r){var n={},i={defaultValue:!0,type:!0,scope:!0,as:!0} for(var o in e)if(e.hasOwnProperty(o)){var a={};(0,t.assign)(a,e[o],r[o]),n[o]=a,i[o]=!0}for(var s in r)if(r.hasOwnProperty(s)&&!i[s]){var u={};(0,t.assign)(u,r[s],e[s]),n[s]=u}return n}((0,d.normalizeControllerQueryParams)(f),c)}else l&&(u=(0,p.default)(s,a),e=c) var h=[],m={},v=[] for(var y in e)if(e.hasOwnProperty(y)&&"unknownProperty"!==y&&"_super"!==y){var b=e[y],g=b.scope||"model",w=void 0 "controller"===g&&(w=[]) var _=b.as||this.serializeQueryParamKey(y),x=(0,n.get)(u,y) x=k(x) var O=b.type||(0,o.typeOf)(x),E=this.serializeQueryParam(x,_,O),S=a+":"+y,P={undecoratedDefaultValue:(0,n.get)(u,y),defaultValue:x,serializedDefaultValue:E,serializedValue:E,type:O,urlKey:_,prop:y,scopedPropertyName:S,controllerName:a,route:this,parts:w,values:null,scope:g} m[y]=m[_]=m[S]=P,h.push(P),v.push(y)}return{qps:h,map:m,propertyNames:v,states:{inactive:function(e,t){var n=m[e] r._qpChanged(e,t,n)},active:function(e,t){var n=m[e] return r._qpChanged(e,t,n),r._activeQPChanged(n,t)},allowOverrides:function(e,t){var n=m[e] return r._qpChanged(e,t,n),r._updatingQPChanged(n)}}}})),send:function(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i=0;--r){var n=e[r],i=n.route if(void 0!==i&&!0!==t(i,n))return}}var k={willResolveModel:function(e,t,r){this._scheduleLoadingEvent(t,r)},error:function(e,t,r){var n=this,i=e[e.length-1] _(e,(function(e,r){if(r!==i){var o=O(e,"error") if(o)return n._markErrorAsHandled(t),n.intermediateTransitionTo(o,t),!1}var a=x(e,"error") return!a||(n._markErrorAsHandled(t),n.intermediateTransitionTo(a,t),!1)})),function(e,t){var r,n,i=[] n=e&&"object"==typeof e&&"object"==typeof e.errorThrown?e.errorThrown:e t&&i.push(t) n&&(n.message&&i.push(n.message),n.stack&&i.push(n.stack),"string"==typeof n&&i.push(n));(r=console).error.apply(r,i)}(t,"Error while processing route: "+r.targetName)},loading:function(e,t){var r=this,n=e[e.length-1] _(e,(function(e,i){if(i!==n){var o=O(e,"loading") if(o)return r.intermediateTransitionTo(o),!1}var a=x(e,"loading") return a?(r.intermediateTransitionTo(a),!1):t.pivotHandler!==e}))}} function x(e,t){var r=(0,n.getOwner)(e),i=e.routeName,o=e.fullRouteName+"_"+t return E(r,e._router,i+"_"+t,o)?o:""}function O(e,t){var r=(0,n.getOwner)(e),i=e.routeName,o=e.fullRouteName,a="application"===o?t:o+"."+t return E(r,e._router,"application"===i?t:i+"."+t,a)?a:""}function E(e,t,r,n){var i=t.hasRoute(n),o=e.hasRegistration("template:"+r)||e.hasRegistration("route:"+r) return i&&o}function S(e,t,r,n){if(!e){if(t)return throw new s.default("Can't trigger action '"+r+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var i,o,a=!1,u=e.length-1;u>=0;u--)if(o=(i=e[u].route)&&i.actions&&i.actions[r]){if(!0!==o.apply(i,n))return void("error"===r&&i._router._markErrorAsHandled(n[0])) a=!0}var c=k[r] if(c)c.apply(this,[e].concat(n)) else if(!a&&!t)throw new s.default("Nothing handled the action '"+r+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function P(e,t,r){for(var n=e._routerMicrolib.applyIntent(t,r),i=n.routeInfos,o=n.params,a=0;a0;){var n=r.shift() if(n.render.name===t)return n var i=n.outlets for(var o in i)r.push(i[o])}}function T(e,t,n){var i,o={render:n,outlets:Object.create(null),wasUsed:!1} return(i=n.into?R(e,n.into):t)?(0,r.set)(i.outlets,n.outlet,o):e=o,{liveRoutes:e,ownState:o}}function C(e,t,r){var n=R(e,r.routeName) return n||(t.outlets.main={render:{name:r.routeName,outlet:"main"},outlets:{}},t)}w.reopenClass({map:function(e){return this.dslCallbacks||(this.dslCallbacks=[],this.reopenClass({dslCallbacks:this.dslCallbacks})),this.dslCallbacks.push(e),this},_routePath:function(e){var t,r,n=[] function i(e,t){for(var r=0;r0){var s=(0,t.assign)({},i) return this.emberRouter._prepareQueryParams(e,n,s),(0,r.shallowEqual)(s,a.queryParams)}return!0},e}() e.default=n})),e("@ember/-internals/routing/lib/system/transition",[],(function(){})),e("@ember/-internals/routing/lib/utils",["exports","@ember/-internals/metal","@ember/-internals/owner","@ember/error","@ember/polyfills","router_js"],(function(e,t,r,n,i,o){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.calculateCacheKey=function(e,r,n){void 0===r&&(r=[]) for(var i="",o=0;o0)-(r<0)}})),e("@ember/-internals/runtime/lib/copy",["exports","@ember/debug","@ember/-internals/runtime/lib/system/object","@ember/-internals/runtime/lib/mixins/copyable"],(function(e,t,r,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){if("object"!=typeof e||null===e)return e if(!Array.isArray(e)&&n.default.detect(e))return e.copy(t) return function e(t,r,i,o){if("object"!=typeof t||null===t)return t var a,s if(r&&(s=i.indexOf(t))>=0)return o[s] r&&i.push(t) if(Array.isArray(t)){if(a=t.slice(),r)for(o.push(a),s=a.length;--s>=0;)a[s]=e(a[s],r,i,o)}else if(n.default.detect(t))a=t.copy(r,i,o),r&&o.push(a) else if(t instanceof Date)a=new Date(t.getTime()),r&&o.push(a) else{var u for(u in a={},r&&o.push(a),t)Object.prototype.hasOwnProperty.call(t,u)&&"__"!==u.substring(0,2)&&(a[u]=r?e(t[u],r,i,o):t[u])}return a}(e,t,t?[]:null,t?[]:null)}})),e("@ember/-internals/runtime/lib/ext/function",["@ember/-internals/environment","@ember/-internals/metal","@ember/debug","@ember/deprecated-features"],(function(e,t,r,n){"use strict" n.FUNCTION_PROTOTYPE_EXTENSIONS&&e.ENV.EXTEND_PROTOTYPES.Function&&Object.defineProperties(Function.prototype,{property:{configurable:!0,enumerable:!1,writable:!0,value:function(){return t.computed.apply(void 0,Array.prototype.slice.call(arguments).concat([this]))}},observes:{configurable:!0,enumerable:!1,writable:!0,value:function(){return t.observer.apply(void 0,Array.prototype.slice.call(arguments).concat([this]))}},on:{configurable:!0,enumerable:!1,writable:!0,value:function(){return t.on.apply(void 0,Array.prototype.slice.call(arguments).concat([this]))}}})})),e("@ember/-internals/runtime/lib/ext/rsvp",["exports","rsvp","@ember/runloop","@ember/-internals/error-handling","@ember/debug"],(function(e,t,r,n,i){"use strict" function o(e){var t=function(e){if(!e)return if(e.errorThrown)return function(e){var t=e.errorThrown "string"==typeof t&&(t=new Error(t)) return Object.defineProperty(t,"__reason_with_error_thrown__",{value:e,enumerable:!1}),t}(e) if("UnrecognizedURLError"===e.name)return if("TransitionAborted"===e.name)return return e}(e) if(t){var r=(0,n.getDispatchOverride)() if(!r)throw t r(t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.onerrorDefault=o,t.configure("async",(function(e,t){r.backburner.schedule("actions",null,e,t)})),t.configure("after",(function(e){r.backburner.schedule(r._rsvpErrorQueue,null,e)})),t.on("error",o) var a=t e.default=a})),e("@ember/-internals/runtime/lib/is-equal",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){if(e&&"function"==typeof e.isEqual)return e.isEqual(t) if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime() return e===t}})),e("@ember/-internals/runtime/lib/mixins/-proxy",["exports","@ember/-internals/meta","@ember/-internals/metal","@ember/-internals/utils","@ember/debug","@glimmer/validator"],(function(e,t,r,n,i,o){"use strict" var a function s(e){var t=(0,r.get)(e,"content") return(0,o.updateTag)((0,r.tagForObject)(e),(0,r.tagForObject)(t)),t}Object.defineProperty(e,"__esModule",{value:!0}),e.contentFor=s,e.default=void 0 var u=r.Mixin.create(((a={content:null,init:function(){this._super.apply(this,arguments),(0,n.setProxy)(this),(0,r.tagForObject)(this)},willDestroy:function(){this.set("content",null),this._super.apply(this,arguments)},isTruthy:(0,r.computed)("content",(function(){return Boolean((0,r.get)(this,"content"))}))})[r.CUSTOM_TAG_FOR]=function(e){var t=(0,o.tagFor)(this,e) return e in this?t:(0,o.combine)([t].concat((0,r.getChainTagsForKey)(this,"content."+e)))},a.unknownProperty=function(e){var t=s(this) if(t)return(0,r.get)(t,e)},a.setUnknownProperty=function(e,n){var i=(0,t.meta)(this) if(i.isInitializing()||i.isPrototypeMeta(this))return(0,r.defineProperty)(this,e,null,n),n var o=s(this) return(0,r.set)(o,e,n)},a)) e.default=u})),e("@ember/-internals/runtime/lib/mixins/action_handler",["exports","@ember/-internals/metal","@ember/debug"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n=t.Mixin.create({mergedProperties:["actions"],send:function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;ii?r=i:r<0&&(r=i+r);e=n)&&(r=n-1),r<0&&(r+=n) for(var i=r;i>=0;i--)if((0,t.objectAt)(this,i)===e)return i return-1},l.addArrayObserver=function(e,r){return(0,t.addArrayObserver)(this,e,r)},l.removeArrayObserver=function(e,r){return(0,t.removeArrayObserver)(this,e,r)},l.hasArrayObservers=(0,t.nativeDescDecorator)({configurable:!0,enumerable:!1,get:function(){return(0,t.hasListeners)(this,"@array:change")||(0,t.hasListeners)(this,"@array:before")}}),l.arrayContentWillChange=function(e,r,n){return(0,t.arrayContentWillChange)(this,e,r,n)},l.arrayContentDidChange=function(e,r,n){return(0,t.arrayContentDidChange)(this,e,r,n)},l.forEach=function(e,t){void 0===t&&(t=null) for(var r=this.length,n=0;n1?t-1:0),i=1;i=0;){(0,t.objectAt)(this,r)===e&&this.removeAt(r)}return this},removeObjects:function(e){(0,t.beginPropertyChanges)() for(var r=e.length-1;r>=0;r--)this.removeObject(e[r]) return(0,t.endPropertyChanges)(),this},addObject:function(e){return this.includes(e)||this.pushObject(e),this},addObjects:function(e){var r=this return(0,t.beginPropertyChanges)(),e.forEach((function(e){return r.addObject(e)})),(0,t.endPropertyChanges)(),this}}) e.MutableArray=P var M=t.Mixin.create(P,s.default,{objectAt:function(e){return this[e]},replace:function(e,r,n){return void 0===n&&(n=h),(0,t.replaceInNativeArray)(this,e,r,n),this}}) e.NativeArray=M var A,j=["length"] M.keys().forEach((function(e){Array.prototype[e]&&j.push(e)})),e.NativeArray=M=(f=M).without.apply(f,j),e.A=A,a.ENV.EXTEND_PROTOTYPES.Array?(M.apply(Array.prototype),e.A=A=function(e){return e||[]}):e.A=A=function(e){return e||(e=[]),S.detect(e)?e:M.apply(e)} var R=S e.default=R})),e("@ember/-internals/runtime/lib/mixins/comparable",["exports","@ember/-internals/metal"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=t.Mixin.create({compare:null}) e.default=r})),e("@ember/-internals/runtime/lib/mixins/container_proxy",["exports","@ember/runloop","@ember/-internals/metal"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n={__container__:null,ownerInjection:function(){return this.__container__.ownerInjection()},lookup:function(e,t){return this.__container__.lookup(e,t)},destroy:function(){var e=this.__container__ e&&(0,t.join)((function(){e.destroy(),(0,t.schedule)("destroy",e,"finalizeDestroy")})),this._super()},factoryFor:function(e,t){return void 0===t&&(t={}),this.__container__.factoryFor(e,t)}},i=r.Mixin.create(n) e.default=i})),e("@ember/-internals/runtime/lib/mixins/copyable",["exports","@ember/-internals/metal"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=t.Mixin.create({copy:null}) e.default=r})),e("@ember/-internals/runtime/lib/mixins/enumerable",["exports","@ember/-internals/metal"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=t.Mixin.create() e.default=r})),e("@ember/-internals/runtime/lib/mixins/evented",["exports","@ember/-internals/metal"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=t.Mixin.create({on:function(e,r,n){return(0,t.addListener)(this,e,r,n),this},one:function(e,r,n){return(0,t.addListener)(this,e,r,n,!0),this},trigger:function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=this._objectsDirtyIndex){var t=(0,r.get)(this,"arrangedContent") if(t)for(var n=this._objects.length=(0,r.get)(t,"length"),i=this._objectsDirtyIndex;io)&&(this._objectsDirtyIndex=o),this._lengthDirty=!0,this.arrayContentDidChange(t,n,i)},i._invalidate=function(){this._objectsDirtyIndex=0,this._lengthDirty=!0},i._revalidate=function(){!0!==this._arrangedContentIsUpdating&&(null!==this._arrangedContentTag&&(0,a.validateTag)(this._arrangedContentTag,this._arrangedContentRevision)||(null===this._arrangedContentTag?this._addArrangedContentArrayObserver():(this._arrangedContentIsUpdating=!0,this._updateArrangedContentArray(),this._arrangedContentIsUpdating=!1),this._arrangedContentTag=(0,a.combine)((0,r.getChainTagsForKey)(this,"arrangedContent")),this._arrangedContentRevision=(0,a.valueForTag)(this._arrangedContentTag)))},(0,t.createClass)(n,[{key:"length",get:function(){if(this._revalidate(),this._lengthDirty){var e=(0,r.get)(this,"arrangedContent") this._length=e?(0,r.get)(e,"length"):0,this._lengthDirty=!1}return this._length},set:function(e){var t,n=this.length-e if(0!==n){n<0&&(t=new Array(-n),n=0) var i=(0,r.get)(this,"content") i&&((0,r.replace)(i,e,n,t),this._invalidate())}}}]),n}(n.default) e.default=u,u.reopen(i.MutableArray,{arrangedContent:(0,r.alias)("content"),arrayContentDidChange:function(e,t,n){return(0,r.arrayContentDidChange)(this,e,t,n,!1)}})})),e("@ember/-internals/runtime/lib/system/core_object",["exports","ember-babel","@ember/-internals/container","@ember/-internals/owner","@ember/polyfills","@ember/-internals/utils","@ember/runloop","@ember/-internals/meta","@ember/-internals/metal","@ember/-internals/runtime/lib/mixins/action_handler","@ember/debug"],(function(e,t,r,n,i,o,a,s,u,c,l){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.setFrameworkClass=function(e){e[m]=!0} var f=u.Mixin.prototype.reopen,h=new i._WeakSet,d=new WeakMap var p=new WeakMap,m=(0,o.symbol)("FRAMEWORK_CLASS") function v(e,t){var r=(0,s.meta)(e) if(void 0!==t)for(var n=e.concatenatedProperties,a=e.mergedProperties,c=void 0!==n&&n.length>0,l=void 0!==a&&a.length>0,f=Object.keys(t),h=0;h-1&&(p=y?(0,o.makeArray)(y).concat(p):(0,o.makeArray)(p)),l&&a.indexOf(d)>-1&&(p=(0,i.assign)({},y,p))}v?m.set(e,d,p):"function"!=typeof e.setUnknownProperty||d in e?e[d]=p:e.setUnknownProperty(d,p)}e.init(t),r.unsetInitializing() var b=r.observerEvents() if(void 0!==b)for(var g=0;g"},e.extend=function(){var e=function(e){function r(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(r,e),r}(this) return f.apply(e.PrototypeMixin,arguments),e},e.create=function(e,t){var r,i=this if(this[m]){var o,a=d.get(this) void 0!==a?o=a.owner:void 0!==e&&(o=(0,n.getOwner)(e)),r=new i(o)}else r=new i return v(r,void 0===t?e:b.apply(this,arguments)),r},e.reopen=function(){return this.willReopen(),f.apply(this.PrototypeMixin,arguments),this},e.willReopen=function(){var e=this.prototype h.has(e)&&(h.delete(e),p.has(this)&&p.set(this,u.Mixin.create(this.PrototypeMixin)))},e.reopenClass=function(){return(0,u.applyMixin)(this,arguments),this},e.detect=function(e){if("function"!=typeof e)return!1 for(;e;){if(e===this)return!0 e=e.superclass}return!1},e.detectInstance=function(e){return e instanceof this},e.metaForProperty=function(e){var t=this.proto(),r=(0,u.descriptorForProperty)(t,e) return r._meta||{}},e.eachComputedProperty=function(e,t){void 0===t&&(t=this),this.proto() var r={};(0,s.meta)(this.prototype).forEachDescriptors((function(n,i){if(i.enumerable){var o=i._meta||r e.call(t,n,o)}}))},e.proto=function(){var e=this.prototype if(!h.has(e)){h.add(e) var t=this.superclass t&&t.proto(),p.has(this)&&this.PrototypeMixin.apply(e)}return e},(0,t.createClass)(e,[{key:"isDestroyed",get:function(){return(0,s.peekMeta)(this).isSourceDestroyed()},set:function(e){}},{key:"isDestroying",get:function(){return(0,s.peekMeta)(this).isSourceDestroying()},set:function(e){}}],[{key:"PrototypeMixin",get:function(){var e=p.get(this) return void 0===e&&((e=u.Mixin.create()).ownerConstructor=this,p.set(this,e)),e}},{key:"superclass",get:function(){var e=Object.getPrototypeOf(this) return e!==Function.prototype?e:void 0}}]),e}() function b(){for(var e=this.concatenatedProperties,t=this.mergedProperties,r=void 0!==e&&e.length>0,n=void 0!==t&&t.length>0,a={},s=0;s-1){var p=a[h] d=p?(0,o.makeArray)(p).concat(d):(0,o.makeArray)(d)}if(n&&t.indexOf(h)>-1){var m=a[h] d=(0,i.assign)({},m,d)}a[h]=d}return a}y.toString=u.classToString,(0,o.setName)(y,"Ember.CoreObject"),y.isClass=!0,y.isMethod=!1 var g=y e.default=g})),e("@ember/-internals/runtime/lib/system/namespace",["exports","ember-babel","@ember/-internals/metal","@ember/-internals/utils","@ember/-internals/runtime/lib/system/object"],(function(e,t,r,n,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var o=function(e){function i(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(i,e) var o=i.prototype return o.init=function(){(0,r.addNamespace)(this)},o.toString=function(){var e=(0,r.get)(this,"name")||(0,r.get)(this,"modulePrefix") return e||((0,r.findNamespaces)(),void 0===(e=(0,n.getName)(this))&&(e=(0,n.guidFor)(this),(0,n.setName)(this,e)),e)},o.nameClasses=function(){(0,r.processNamespace)(this)},o.destroy=function(){(0,r.removeNamespace)(this),e.prototype.destroy.call(this)},i}(i.default) e.default=o,o.prototype.isNamespace=!0,o.NAMESPACES=r.NAMESPACES,o.NAMESPACES_BY_ID=r.NAMESPACES_BY_ID,o.processAll=r.processAllNamespaces,o.byName=r.findNamespace})),e("@ember/-internals/runtime/lib/system/object",["exports","ember-babel","@ember/-internals/container","@ember/-internals/owner","@ember/-internals/utils","@ember/-internals/metal","@ember/-internals/runtime/lib/system/core_object","@ember/-internals/runtime/lib/mixins/observable","@ember/debug"],(function(e,t,r,n,i,o,a,s,u){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FrameworkObject=void 0 var c,l=new WeakMap,f=function(e){function i(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(i,e),(0,t.createClass)(i,[{key:"_debugContainerKey",get:function(){var e=r.FACTORY_FOR.get(this) return void 0!==e&&e.fullName}},{key:n.OWNER,get:function(){var e=l.get(this) if(void 0!==e)return e var t=r.FACTORY_FOR.get(this) return void 0!==t&&t.owner}},{key:n.OWNER,set:function(e){l.set(this,e)}}]),i}(a.default) e.default=f,(0,i.setName)(f,"Ember.Object"),s.default.apply(f.prototype),e.FrameworkObject=c,e.FrameworkObject=c=function(e){function i(r){var i return i=e.call(this)||this,(0,n.setOwner)((0,t.assertThisInitialized)(i),r),i}return(0,t.inheritsLoose)(i,e),(0,t.createClass)(i,[{key:"_debugContainerKey",get:function(){var e=r.FACTORY_FOR.get(this) return void 0!==e&&e.fullName}}]),i}(a.default),s.default.apply(c.prototype)})) e("@ember/-internals/runtime/lib/system/object_proxy",["exports","ember-babel","@ember/-internals/runtime/lib/system/object","@ember/-internals/runtime/lib/mixins/-proxy"],(function(e,t,r,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var i=function(e){function r(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(r,e),r}(r.default) e.default=i,i.PrototypeMixin.reopen(n.default)})),e("@ember/-internals/runtime/lib/type-of",["exports","@ember/-internals/runtime/lib/system/core_object"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.typeOf=function(e){if(null===e)return"null" if(void 0===e)return"undefined" var i=r[n.call(e)]||"object" "function"===i?t.default.detect(e)&&(i="class"):"object"===i&&(e instanceof Error?i="error":e instanceof t.default?i="instance":e instanceof Date&&(i="date")) return i} var r={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object FileList]":"filelist"},n=Object.prototype.toString})),e("@ember/-internals/utils/index",["exports","@ember/polyfills","@ember/debug"],(function(e,t,r){"use strict" function n(e){var t={} for(var r in t[e]=1,t)if(r===e)return r return e}function i(e){return null!==e&&("object"==typeof e||"function"==typeof e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ROOT=e.HAS_NATIVE_SYMBOL=e.HAS_NATIVE_PROXY=e.GUID_KEY=e.EMBER_ARRAY=e.Cache=void 0,e.canInvoke=L,e.checkHasSuper=void 0,e.dictionary=function(e){var t=Object.create(e) return t._dict=null,delete t._dict,t},e.generateGuid=function(e,t){void 0===t&&(t="ember") var r=t+a() i(e)&&s.set(e,r) return r},e.getDebugName=void 0,e.getListeners=S,e.getName=function(e){return U.get(e)},e.getObservers=x,e.getOwnPropertyDescriptors=void 0,e.guidFor=function(e){var t if(i(e))void 0===(t=s.get(e))&&(t="ember"+a(),s.set(e,t)) else if(void 0===(t=u.get(e))){var r=typeof e t="string"===r?"st"+a():"number"===r?"nu"+a():"symbol"===r?"sy"+a():"("+e+")",u.set(e,t)}return t},e.inspect=function(e){if("number"==typeof e&&2===arguments.length)return this return N(e,0)},e.intern=n,e.isEmberArray=function(e){return e&&e[$]},e.isInternalSymbol=function(e){return-1!==f.indexOf(e)},e.isObject=i,e.isProxy=function(e){if(i(e))return W.has(e) return!1},e.lookupDescriptor=B,e.makeArray=function(e){if(null==e)return[] return F(e)?e:[e]},e.setListeners=E,e.setName=function(e,t){i(e)&&U.set(e,t)},e.setObservers=k,e.setProxy=function(e){i(e)&&W.add(e)},e.setupMandatorySetter=e.setWithMandatorySetter=void 0,e.symbol=h,e.teardownMandatorySetter=void 0,e.toString=function e(t){if("string"==typeof t)return t if(null===t)return"null" if(void 0===t)return"undefined" if(Array.isArray(t)){for(var r="",n=0;n0&&(r+=","),q(t[n])||(r+=e(t[n])) return r}if("function"==typeof t.toString)return t.toString() return z.call(t)},e.tryInvoke=function(e,t,r){if(L(e,t)){return e[t].apply(e,r)}},e.uuid=a e.wrap=function(e,t){if(!w(e))return e if(!P.has(t)&&w(t))return M(e,M(t,g)) return M(e,t)} var o=0 function a(){return++o}var s=new WeakMap,u=new Map,c=n("__ember"+Date.now()) e.GUID_KEY=c var l,f=[] function h(e){var t=n("__"+e+(c+Math.floor(Math.random()*Date.now()))+"__") return f.push(t),t}var d=l e.getDebugName=d var p=void 0!==Object.getOwnPropertyDescriptors?Object.getOwnPropertyDescriptors:function(e){var t={} return Object.keys(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t} e.getOwnPropertyDescriptors=p var m=/\.(_super|call\(this|apply\(this)/,v=Function.prototype.toString,y=v.call((function(){return this})).indexOf("return this")>-1?function(e){return m.test(v.call(e))}:function(){return!0} e.checkHasSuper=y var b=new WeakMap,g=Object.freeze((function(){})) function w(e){var t=b.get(e) return void 0===t&&(t=y(e),b.set(e,t)),t}e.ROOT=g,b.set(g,!1) var _=new WeakMap function k(e,t){_.set(e,t)}function x(e){return _.get(e)}var O=new WeakMap function E(e,t){t&&O.set(e,t)}function S(e){return O.get(e)}var P=new t._WeakSet function M(e,t){function r(){var r=this._super this._super=t var n=e.apply(this,arguments) return this._super=r,n}return P.add(r),k(r,x(e)),E(r,S(e)),r}var A=Object.prototype.toString,j=Function.prototype.toString,R=Array.isArray,T=Object.keys,C=JSON.stringify,I=/^[\w$]+$/ function N(e,r,n){var i=!1 switch(typeof e){case"undefined":return"undefined" case"object":if(null===e)return"null" if(R(e)){i=!0 break}if(e.toString===A||void 0===e.toString)break return e.toString() case"function":return e.toString===j?e.name?"[Function:"+e.name+"]":"[Function]":e.toString() case"string":return C(e) case"symbol":case"boolean":case"number":default:return e.toString()}if(void 0===n)n=new t._WeakSet else if(n.has(e))return"[Circular]" return n.add(e),i?function(e,t,r){if(t>4)return"[Array]" for(var n="[",i=0;i=100){n+="... "+(e.length-100)+" more items" break}n+=N(e[i],t,r)}return n+=" ]"}(e,r+1,n):function(e,t,r){if(t>4)return"[Object]" for(var n="{",i=T(e),o=0;o=100){n+="... "+(i.length-100)+" more keys" break}var a=i[o] n+=D(a)+": "+N(e[a],t,r)}return n+=" }"}(e,r+1,n)}function D(e){return I.test(e)?e:C(e)}function B(e,t){var r=e do{var n=Object.getOwnPropertyDescriptor(r,t) if(void 0!==n)return n r=Object.getPrototypeOf(r)}while(null!==r) return null}function L(e,t){return null!=e&&"function"==typeof e[t]}var F=Array.isArray var U=new WeakMap var z=Object.prototype.toString function q(e){return null==e}var H="function"==typeof Symbol&&"symbol"==typeof Symbol() e.HAS_NATIVE_SYMBOL=H var V="function"==typeof Proxy e.HAS_NATIVE_PROXY=V var W=new t._WeakSet var G=function(){function e(e,t,r){this.limit=e,this.func=t,this.store=r,this.size=0,this.misses=0,this.hits=0,this.store=r||new Map}var t=e.prototype return t.get=function(e){return this.store.has(e)?(this.hits++,this.store.get(e)):(this.misses++,this.set(e,this.func(e)))},t.set=function(e,t){return this.limit>this.size&&(this.size++,this.store.set(e,t)),t},t.purge=function(){this.store.clear(),this.size=0,this.hits=0,this.misses=0},e}() e.Cache=G var Y,K,J,$=h("EMBER_ARRAY") e.EMBER_ARRAY=$,e.setupMandatorySetter=Y,e.teardownMandatorySetter=K,e.setWithMandatorySetter=J})),e("@ember/-internals/views/index",["exports","@ember/-internals/views/lib/system/jquery","@ember/-internals/views/lib/system/utils","@ember/-internals/views/lib/system/event_dispatcher","@ember/-internals/views/lib/component_lookup","@ember/-internals/views/lib/mixins/text_support","@ember/-internals/views/lib/views/core_view","@ember/-internals/views/lib/mixins/class_names_support","@ember/-internals/views/lib/mixins/child_views_support","@ember/-internals/views/lib/mixins/view_state_support","@ember/-internals/views/lib/mixins/view_support","@ember/-internals/views/lib/mixins/action_support","@ember/-internals/views/lib/compat/attrs","@ember/-internals/views/lib/system/action_manager"],(function(e,t,r,n,i,o,a,s,u,c,l,f,h,d){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ActionManager",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"ActionSupport",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"ChildViewsSupport",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"ClassNamesSupport",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ComponentLookup",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CoreView",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventDispatcher",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"MUTABLE_CELL",{enumerable:!0,get:function(){return h.MUTABLE_CELL}}),Object.defineProperty(e,"TextSupport",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ViewMixin",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"ViewStateSupport",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"addChildView",{enumerable:!0,get:function(){return r.addChildView}}),Object.defineProperty(e,"clearElementView",{enumerable:!0,get:function(){return r.clearElementView}}),Object.defineProperty(e,"clearViewElement",{enumerable:!0,get:function(){return r.clearViewElement}}),Object.defineProperty(e,"constructStyleDeprecationMessage",{enumerable:!0,get:function(){return r.constructStyleDeprecationMessage}}),Object.defineProperty(e,"getChildViews",{enumerable:!0,get:function(){return r.getChildViews}}),Object.defineProperty(e,"getElementView",{enumerable:!0,get:function(){return r.getElementView}}),Object.defineProperty(e,"getRootViews",{enumerable:!0,get:function(){return r.getRootViews}}),Object.defineProperty(e,"getViewBoundingClientRect",{enumerable:!0,get:function(){return r.getViewBoundingClientRect}}),Object.defineProperty(e,"getViewBounds",{enumerable:!0,get:function(){return r.getViewBounds}}),Object.defineProperty(e,"getViewClientRects",{enumerable:!0,get:function(){return r.getViewClientRects}}),Object.defineProperty(e,"getViewElement",{enumerable:!0,get:function(){return r.getViewElement}}),Object.defineProperty(e,"getViewId",{enumerable:!0,get:function(){return r.getViewId}}),Object.defineProperty(e,"isSimpleClick",{enumerable:!0,get:function(){return r.isSimpleClick}}),Object.defineProperty(e,"jQuery",{enumerable:!0,get:function(){return t.jQuery}}),Object.defineProperty(e,"jQueryDisabled",{enumerable:!0,get:function(){return t.jQueryDisabled}}),Object.defineProperty(e,"setElementView",{enumerable:!0,get:function(){return r.setElementView}}),Object.defineProperty(e,"setViewElement",{enumerable:!0,get:function(){return r.setViewElement}})})),e("@ember/-internals/views/lib/compat/attrs",["exports","@ember/-internals/utils"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.MUTABLE_CELL=void 0 var r=(0,t.symbol)("MUTABLE_CELL") e.MUTABLE_CELL=r})),e("@ember/-internals/views/lib/compat/fallback-view-registry",["exports","@ember/-internals/utils"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=(0,t.dictionary)(null) e.default=r})),e("@ember/-internals/views/lib/component_lookup",["exports","@ember/-internals/runtime"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=t.Object.extend({componentFor:function(e,t,r){var n="component:"+e return t.factoryFor(n,r)},layoutFor:function(e,t,r){var n="template:components/"+e return t.lookup(n,r)}}) e.default=r})),e("@ember/-internals/views/lib/mixins/action_support",["exports","@ember/-internals/utils","@ember/-internals/metal","@ember/debug","@ember/-internals/views/lib/compat/attrs","@ember/deprecated-features"],(function(e,t,r,n,i,o){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var a={send:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?n-1:0),o=1;o1 return!t&&!r},e.matches=function(e,t){return h.call(e,t)},e.setElementView=function(e,t){o.set(e,t)},e.setViewElement=function(e,t){a.set(e,t)} var o=new WeakMap,a=new WeakMap var s=new WeakMap function u(e){var t=new Set return s.set(e,t),t}function c(e,t){var r=[],n=s.get(e) return void 0!==n&&n.forEach((function(e){var n=t[e] !n||n.isDestroying||n.isDestroyed||r.push(n)})),r}function l(e){return e.renderer.getBounds(e)}function f(e){var t=l(e),r=document.createRange() return r.setStartBefore(t.firstNode),r.setEndAfter(t.lastNode),r}var h="undefined"!=typeof Element?Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector:void 0 e.elMatches=h})),e("@ember/-internals/views/lib/views/core_view",["exports","@ember/-internals/runtime","@ember/-internals/views/lib/views/states"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n=t.FrameworkObject.extend(t.Evented,t.ActionHandler,{isView:!0,_states:r.default,init:function(){if(this._super.apply(this,arguments),this._state="preRender",this._currentState=this._states.preRender,!this.renderer)throw new Error("Cannot instantiate a component without a renderer. Please ensure that you are creating "+this+" with a proper container/registry.")},parentView:null,instrumentDetails:function(e){return e.object=this.toString(),e.containerKey=this._debugContainerKey,e.view=this,e},trigger:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;nr}))},e.gte=function(e,r){return(0,t.computed)(e,(function(){return(0,t.get)(this,e)>=r}))},e.lt=function(e,r){return(0,t.computed)(e,(function(){return(0,t.get)(this,e)2)&&(r=Array.prototype.slice.call(arguments,1)),w(e=(0,t.getString)(e)||e,r)}function k(e){return e.split(/\s+/)}function x(e){return g.get(e)}function O(e){return o.get(e)}function E(e){return u.get(e)}function S(e){return h.get(e)}function P(e){return m.get(e)}function M(e){return y.get(e)}r.ENV.EXTEND_PROTOTYPES.String&&Object.defineProperties(String.prototype,{w:{configurable:!0,enumerable:!1,writeable:!0,value:function(){return k(this)}},loc:{configurable:!0,enumerable:!1,writeable:!0,value:function(){for(var e=arguments.length,t=new Array(e),r=0;r255)throw new Error("Opcode type over 8-bits. Got "+e+".") var r=e|t|arguments.length-2<<8 this.buffer.push(r) for(var n=2;n2147483647)throw new Error("Operand over 32-bits. Got "+i+".") this.buffer.push(i)}this.size=this.buffer.length},t.patch=function(e,t){if(-1!==this.buffer[e+1])throw new Error("Trying to patch operand in populated slot instead of a reserved slot.") this.buffer[e+1]=t},e}() e.InstructionEncoderImpl=t})),e("@glimmer/env",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.DEBUG=e.CI=void 0 e.DEBUG=!1 e.CI=!1})),e("@glimmer/low-level",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Stack=void 0 var t=function(){function e(){this.array=[],this.next=0}var t=e.prototype return t.add=function(e){var t=this.next,r=this.array if(t===r.length)this.next++ else{var n=r[t] this.next=n}return this.array[t]=e,t},t.deref=function(e){return this.array[e]},t.drop=function(e){this.array[e]=this.next,this.next=e},e}() e.Storage=t var r=function(){function e(e){void 0===e&&(e=[]),this.vec=e}var t=e.prototype return t.clone=function(){return new e(this.vec.slice())},t.sliceFrom=function(t){return new e(this.vec.slice(t))},t.slice=function(t,r){return new e(this.vec.slice(t,r))},t.copy=function(e,t){this.vec[t]=this.vec[e]},t.writeRaw=function(e,t){this.vec[e]=t},t.getRaw=function(e){return this.vec[e]},t.reset=function(){this.vec.length=0},t.len=function(){return this.vec.length},e}() e.Stack=r})),e("@glimmer/node",["exports","ember-babel","@glimmer/runtime","@simple-dom/document"],(function(e,t,r,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.NodeDOMTreeConstruction=void 0,e.serializeBuilder=function(e,t){return a.forInitialRender(e,t)} var i=function(e){function i(t){return e.call(this,t||(0,n.default)())||this}(0,t.inheritsLoose)(i,e) var o=i.prototype return o.setupUselessElement=function(){},o.insertHTMLBefore=function(e,t,n){var i=this.document.createRawHTMLSection(n) return e.insertBefore(i,t),new r.ConcreteBounds(e,i,i)},o.createElement=function(e){return this.document.createElement(e)},o.setAttribute=function(e,t,r){e.setAttribute(t,r)},i}(r.DOMTreeConstruction) e.NodeDOMTreeConstruction=i var o=new WeakMap var a=function(e){function n(){var t return(t=e.apply(this,arguments)||this).serializeBlockDepth=0,t}(0,t.inheritsLoose)(n,e) var i=n.prototype return i.__openBlock=function(){var t=this.element.tagName if("TITLE"!==t&&"SCRIPT"!==t&&"STYLE"!==t){var r=this.serializeBlockDepth++ this.__appendComment("%+b:"+r+"%")}e.prototype.__openBlock.call(this)},i.__closeBlock=function(){var t=this.element.tagName if(e.prototype.__closeBlock.call(this),"TITLE"!==t&&"SCRIPT"!==t&&"STYLE"!==t){var r=--this.serializeBlockDepth this.__appendComment("%-b:"+r+"%")}},i.__appendHTML=function(t){var n=this.element.tagName if("TITLE"===n||"SCRIPT"===n||"STYLE"===n)return e.prototype.__appendHTML.call(this,t) var i=this.__appendComment("%glmr%") if("TABLE"===n){var o=t.indexOf("<") if(o>-1)"tr"===t.slice(o+1,o+3)&&(t=""+t+"")}""===t?this.__appendComment("% %"):e.prototype.__appendHTML.call(this,t) var a=this.__appendComment("%glmr%") return new r.ConcreteBounds(this.element,i,a)},i.__appendText=function(t){var r,n,i,o=this.element.tagName,a=(n=(r=this).element,null===(i=r.nextSibling)?n.lastChild:i.previousSibling) return"TITLE"===o||"SCRIPT"===o||"STYLE"===o?e.prototype.__appendText.call(this,t):""===t?this.__appendComment("% %"):(a&&3===a.nodeType&&this.__appendComment("%|%"),e.prototype.__appendText.call(this,t))},i.closeElement=function(){return o.has(this.element)&&(o.delete(this.element),e.prototype.closeElement.call(this)),e.prototype.closeElement.call(this)},i.openElement=function(t){return"tr"===t&&"TBODY"!==this.element.tagName&&"THEAD"!==this.element.tagName&&"TFOOT"!==this.element.tagName&&(this.openElement("tbody"),o.set(this.constructing,!0),this.flushElement(null)),e.prototype.openElement.call(this,t)},i.pushRemoteElement=function(t,r,n){void 0===n&&(n=null) var i=this.dom,o=i.createElement("script") return o.setAttribute("glmr",r),i.insertBefore(t,o,n),e.prototype.pushRemoteElement.call(this,t,r,n)},n}(r.NewElementBuilder)})),e("@glimmer/opcode-compiler",["exports","ember-babel","@glimmer/vm","@glimmer/util","@glimmer/program","@glimmer/encoder"],(function(e,t,r,n,i,o){"use strict" function a(e){return{type:"array",value:e}}function s(e){return{type:"string-array",value:e}}function u(e){return{type:"template-meta",value:e}}function c(e){return{type:"other",value:e}}function l(e){return{type:"label",value:e}}function f(e,t){return{type:"primitive",value:{primitive:e,type:t}}}Object.defineProperty(e,"__esModule",{value:!0}),e.AotContext=function(e,t){void 0===e&&(e={}) void 0===t&&(t=new z) return{program:new Se(new d(e),"aot"),macros:t}},e.Component=function(e,t){var r=Re(JSON.parse(e)) return(0,n.unwrapTemplate)(r.create(t)).asLayout()},e.Context=function(e,t,r){void 0===e&&(e={}) void 0===t&&(t="aot") void 0===r&&(r=new z) return{program:new Se(new d(e),t),macros:r}},e.EMPTY_BLOCKS=e.DefaultCompileTimeResolverDelegate=e.DEFAULT_CAPABILITIES=void 0,e.JitContext=function(e,t){void 0===e&&(e={}) void 0===t&&(t=new z) return{program:new Pe(new d(e)),macros:t}},e.WrappedBuilder=e.UNHANDLED=e.StdLib=e.ProgramCompilationContext=e.PartialDefinitionImpl=e.NONE=e.MacrosImpl=e.MINIMAL_CAPABILITIES=e.JitProgramCompilationContext=void 0,e.compilable=Q,e.compileStatements=X,e.compileStd=xe,e.debugCompiler=void 0,e.invokeStaticBlock=_,e.invokeStaticBlockWithStack=k,e.meta=he,e.resolveLayoutForTag=p,e.staticComponent=function(e,t){var r=t[0],n=t[1],i=t[2] if(null===e)return I var o=e.compilable,a=e.capabilities,s=e.handle return o?[ce(80,s),me({capabilities:a||h,layout:o,attrs:null,params:r,hash:n,blocks:i})]:[ce(80,s),ye({capabilities:a||h,attrs:null,params:r,hash:n,atNames:!0,blocks:i})]},e.syntaxCompilationContext=function(e,t){return{program:e,macros:t}},e.templateCompilationContext=V,e.templateFactory=Re e.DEFAULT_CAPABILITIES={dynamicLayout:!0,dynamicTag:!0,prepareArgs:!0,createArgs:!0,attributeHook:!1,elementHook:!1,dynamicScope:!0,createCaller:!1,updateHook:!0,createInstance:!0,wrapped:!1,willDestroy:!1} var h={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!1,attributeHook:!1,elementHook:!1,dynamicScope:!1,createCaller:!1,updateHook:!1,createInstance:!1,wrapped:!1,willDestroy:!1} e.MINIMAL_CAPABILITIES=h var d=function(){function e(e){this.inner=e}var t=e.prototype return t.lookupHelper=function(e,t){if(this.inner.lookupHelper){var r=this.inner.lookupHelper(e,t) if(void 0===r)throw new Error("Unexpected helper ("+e+" from "+JSON.stringify(t)+") (lookupHelper returned undefined)") return r}throw new Error("Can't compile global helper invocations without an implementation of lookupHelper")},t.lookupModifier=function(e,t){if(this.inner.lookupModifier){var r=this.inner.lookupModifier(e,t) if(void 0===r)throw new Error("Unexpected modifier ("+e+" from "+JSON.stringify(t)+") (lookupModifier returned undefined)") return r}throw new Error("Can't compile global modifier invocations without an implementation of lookupModifier")},t.lookupComponent=function(e,t){if(this.inner.lookupComponent){var r=this.inner.lookupComponent(e,t) if(void 0===r)throw new Error("Unexpected component ("+e+" from "+JSON.stringify(t)+") (lookupComponent returned undefined)") return r}throw new Error("Can't compile global component invocations without an implementation of lookupComponent")},t.lookupPartial=function(e,t){if(this.inner.lookupPartial){var r=this.inner.lookupPartial(e,t) if(void 0===r)throw new Error("Unexpected partial ("+e+" from "+JSON.stringify(t)+") (lookupPartial returned undefined)") return r}throw new Error("Can't compile global partial invocations without an implementation of lookupPartial")},t.resolve=function(e){if(this.inner.resolve)return this.inner.resolve(e) throw new Error("Compile-time debugging requires an implementation of resolve")},e}() function p(e,t){var r=t.resolver,n=t.meta.referrer,i=r.lookupComponent(e,n) return null===i?i:{handle:i.handle,compilable:i.compilable,capabilities:i.capabilities||h}}function m(e){return[v(e),ce(31)]}function v(e){var t switch(typeof e){case"number":t=(0,n.isSmallInt)(e)?f(e,0):f(e,2) break case"string":t=f(e,1) break case"boolean":case"object":case"undefined":t=f(e,0) break default:throw new Error("Invalid primitive passed to pushPrimitive")}return ce(30,t)}function y(e){var t=e.handle,n=e.params,i=e.hash return[ce(0),ce("SimpleArgs",{params:n,hash:i,atNames:!1}),ce(16,t),ce(1),ce(36,r.$v0)]}function b(e,t){return[ce(59),ce(58,s(e)),t(),ce(60)]}function g(e,t){return[ce("SimpleArgs",{params:t,hash:null,atNames:!0}),ce(24,e),ce(25),ce("Option",ce("JitCompileBlock")),ce(64),ce(40),ce(1)]}function w(e){return[x(e&&e.symbolTable),ce(62),ce("PushCompilable",e)]}function _(e){return[ce(0),ce("PushCompilable",e),ce("JitCompileBlock"),ce(2),ce(1)]}function k(e,t){var n=e.symbolTable.parameters,i=n.length,o=Math.min(t,i) if(0===o)return _(e) var a=[] if(a.push(ce(0)),o){a.push(ce(39)) for(var s=0;s=0;u--){var c=r[u] o.push(ce("Label",c.label),ce(34,2),c.callback()),0!==u&&o.push(ce(4,l("END")))}return o.push(ce("Label","END"),ce("StopLabels"),ce(70)),o}function E(e){var t=e.args,r=e.body,n=t(),i=n.count,o=n.actions return[ce("StartLabels"),ce(0),ce(6,l("ENDINITIAL")),o,ce(69,i),r(),ce("Label","FINALLY"),ce(70),ce(5),ce("Label","ENDINITIAL"),ce(1),ce("StopLabels")]}function S(e){var t=e.args,r=e.ifTrue,n=e.ifFalse return E({args:t,body:function(){var e=[ce(66,l("ELSE")),r(),ce(4,l("FINALLY")),ce("Label","ELSE")] return n&&e.push(n()),e}})}function P(e,t){var r=e.encoder,i=e.syntax.program,o=i.mode,a=i.constants switch(t.op){case"Option":return L(e,function(e){var t=e.op1 return null===t?I:t}(t)) case"Label":return r.label(t.op1) case"StartLabels":return r.startLabels() case"StopLabels":return r.stopLabels() case"JitCompileBlock":return L(e,function(e){return"jit"===e?ce(61):I}(o)) case"GetComponentLayout":return r.push(a,function(e){return"aot"===e?94:95}(o),t.op1) case"SetBlock":return r.push(a,function(e){return"aot"===e?20:21}(o),t.op1) default:return(0,n.exhausted)(t)}}function M(e,t){U(e,function(e,t){switch(t.op){case"CompileBlock":return function(e,t){return function(e,t){var r=e[1],n=e[2],i=e[3],o=ne(e[4],t.meta),a=ie(r,t.meta,"Expected block head to be a string") if("string"!=typeof a)return a return t.syntax.macros.blocks.compile(a,n||[],i,o,t)}(t.op1,e)}(e,t) case"CompileInline":return function(e,t){var r=t.op1,n=r.inline,i=r.ifUnhandled,o=function(e,t){return t.syntax.macros.inlines.compile(e,t)}(n,e) return B(o)?o:i(n)}(e,t) case"InvokeStatic":return function(e,t){var r=t.op1 if("aot"===e.program.mode){var n=r.compile(e) return"number"!=typeof n?ce("Error",{problem:"Invalid block",start:0,end:0}):ce(3,n===$?function(){return r.compile(e)}:n)}return[ce(29,c(t.op1)),ce(61),ce(2)]}(e.syntax,t) case"Args":return function(e){for(var t=e.params,r=e.hash,i=e.blocks,o=e.atNames,a=[],u=i.names,c=0;c0?ee(i,e.meta):null,l=Array.isArray(s)||null===s?ne(s,e.meta):s return ve(e.meta,{definition:n,attrs:c,params:o,hash:a,atNames:u,blocks:l})}(e,t) case"IfResolvedComponent":return function(e,t){var r=t.op1,n=r.name,i=r.attrs,o=r.blocks,a=r.staticTemplate,s=r.dynamicTemplate,u=r.orElse,c=p(n,{resolver:e.syntax.program.resolverDelegate,meta:e.meta}),l=e.meta if(null!==c){var f=c.handle,h=c.capabilities,d=c.compilable,m=ee(i,l),v=ne(o,l) return null!==d?a(f,h,d,{attrs:m,blocks:v}):s(f,h,{attrs:m,blocks:v})}if(u)return u() throw new Error("Compile Error: Cannot find component "+n)}(e,t) default:return(0,n.exhausted)(t)}}(e,t))}function A(e,t,r){void 0!==r.op3?e.push(t,r.op,r.op1,r.op2,r.op3):void 0!==r.op2?e.push(t,r.op,r.op1,r.op2):void 0!==r.op1?e.push(t,r.op,r.op1):e.push(t,r.op)}e.DefaultCompileTimeResolverDelegate=d var j=function(){function e(){this.names={},this.funcs=[]}var t=e.prototype return t.add=function(e,t){this.names[e]=this.funcs.push(t)-1},t.compile=function(e,t){var r=e[0],n=this.names[r] return(0,this.funcs[n])(e,t)},e}(),R=new j function T(e,t){if(void 0===t||0===t.length)return e Array.isArray(e)||(e=[e]) for(var r=0;r=34){var r=e[1] return!(!t.upvars||"component"!==t.upvars[r])}var n return!1}(n,t))return i&&0!==i.length?function(e,t){var n=e.definition,i=e.params,o=e.hash,a=e.atNames return[ce(0),ce("SimpleArgs",{params:i,hash:o,atNames:a}),ce(88),ce("Expr",n),ce(79,u(t)),ce(1),ce(36,r.$v0)]}({definition:i[0],params:i.slice(1),hash:o,atNames:!1},t.referrer):ce("Error",{problem:"component helper requires at least one argument",start:0,end:0}) var a=ie(n,t,"Expected call head to be a string") return"string"!=typeof a?a:ce("IfResolved",{kind:"Helper",name:a,andThen:function(e){return y({handle:e,params:i,hash:o})},span:{start:0,end:0}})})),R.add(32,(function(e){var t=e[1],r=e[2] return T(ce(22,t),r)})),R.add(33,(function(e){var t=e[1],r=e[2] return T(ce("ResolveFree",t),r)})),R.add(34,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:0}),r)})),R.add(35,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:1}),r)})),R.add(36,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:2}),r)})),R.add(37,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:3}),r)})),R.add(38,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:4}),r)})),R.add(39,(function(e){var t=e[1],r=e[2] return T(ce("ResolveContextualFree",{freeVar:t,context:5}),r)})),R.add(29,(function(){return m(void 0)})),R.add(27,(function(e){return[ce("Expr",e[1]),ce(26)]})),R.add(28,(function(e){return[ce("Expr",e[1]),ce(25),ce("JitCompileBlock"),ce(27)]})) var I={"no-action":!0} e.NONE=I var N={"not-handled":!0} function D(e){return e&&!!e["no-action"]}function B(e){return!e||!e["not-handled"]}function L(e,r){if(!D(r))if(Array.isArray(r))for(var n,i=(0,t.createForOfIteratorHelperLoose)(r);!(n=i()).done;){L(e,n.value)}else"Simple"===r.type?P(e,r):A(e.encoder,e.syntax.program.constants,r)}function F(e,r,i,o){if(!D(i))if(Array.isArray(i))for(var a,s=(0,t.createForOfIteratorHelperLoose)(i);!(a=s()).done;){F(e,r,a.value,o)}else if("Number"===i.type)A(e,o,i) else if("Resolution"===i.type)C(e,r,i,o) else if("Simple"===i.type)P(r,i) else{if("Error"!==i.type)throw(0,n.assertNever)(i,"unexpected action kind") e.error({problem:i.op1.problem,span:{start:i.op1.start,end:i.op1.end}})}}function U(e,r){if(!D(r))if(Array.isArray(r))for(var i,o=(0,t.createForOfIteratorHelperLoose)(r);!(i=o()).done;){U(e,i.value)}else if("Number"===r.type)A(e.encoder,e.syntax.program.constants,r) else if("Compile"===r.type)M(e,r) else if("Resolution"===r.type)C(e.encoder,e,r,e.syntax.program.constants) else if("Simple"===r.type)P(e,r) else if("Error"!==r.type)throw(0,n.assertNever)(r,"unexpected action type")}e.UNHANDLED=N var z=function(){var e=function(e,t){return e.add("if",(function(e,t,r){if(!e||1!==e.length)throw new Error("SYNTAX ERROR: #if requires a single argument") return S({args:function(){return{count:1,actions:[ce("Expr",e[0]),ce(71)]}},ifTrue:function(){return _(r.get("default"))},ifFalse:function(){return r.has("else")?_(r.get("else")):I}})})),e.add("unless",(function(e,t,r){if(!e||1!==e.length)throw new Error("SYNTAX ERROR: #unless requires a single argument") return S({args:function(){return{count:1,actions:[ce("Expr",e[0]),ce(71)]}},ifTrue:function(){return r.has("else")?_(r.get("else")):I},ifFalse:function(){return _(r.get("default"))}})})),e.add("with",(function(e,t,n){if(!e||1!==e.length)throw new Error("SYNTAX ERROR: #with requires a single argument") return S({args:function(){return{count:2,actions:[ce("Expr",e[0]),ce(33,r.$sp,0),ce(71)]}},ifTrue:function(){return k(n.get("default"),1)},ifFalse:function(){return n.has("else")?_(n.get("else")):I}})})),e.add("let",(function(e,t,r){if(!e)return ue("let requires arguments",0,0) var n=fe(e),i=n.count return[n.actions,k(r.get("default"),i)]})),e.add("each",(function(e,t,n){return E({args:function(){var r return(r=t&&"key"===t[0][0]?[ce("Expr",t[1][0])]:[m(null)]).push(ce("Expr",e[0])),{count:2,actions:r}},body:function(){var e=[ce(74),ce(66,l("ELSE")),ce(0),ce(33,r.$fp,1),ce(6,l("ITER")),ce(72,l("BODY")),ce("Label","ITER"),ce(75,l("BREAK")),ce("Label","BODY"),k(n.get("default"),2),ce(34,2),ce(4,l("FINALLY")),ce("Label","BREAK"),ce(73),ce(1),ce(4,l("FINALLY")),ce("Label","ELSE")] return n.has("else")&&e.push(_(n.get("else"))),e}})})),e.add("in-element",(function(e,t,n){if(!e||1!==e.length)throw new Error("SYNTAX ERROR: #in-element requires a single argument") return S({args:function(){for(var n=t[0],i=t[1],o=[],a=0;a0?null:function(e){return e[0]>=33}(e)?t.upvars[e[1]]:null}function ae(e){return e.length>=2&&e[0]>=32}e.EMPTY_BLOCKS=re,e.debugCompiler=void 0 var se=function(){function e(){this.labels=(0,n.dict)(),this.targets=[]}var t=e.prototype return t.label=function(e,t){this.labels[e]=t},t.target=function(e,t){this.targets.push({at:e,target:t})},t.patch=function(e){for(var t=this.targets,r=this.labels,n=0;n2?i-2:0),a=2;a0?1:0)) for(var g=f.length-1;g>=0;g--){var _=f[g],k=_.symbol _.isBlock?c.push(ce("SetBlock",k)):c.push(ce(19,k))}return c.push(ce("InvokeStatic",n)),t.createInstance&&c.push(ce(103,r.$s0)),c.push(ce(1),ce(40)),t.dynamicScope&&c.push(ce(60)),c.push(ce(101),ce(35,r.$s0)),c}function ve(e,t){var n=t.definition,i=t.attrs,o=t.params,a=t.hash,s=t.atNames,c=t.blocks return E({args:function(){return{count:2,actions:[ce("Expr",n),ce(33,r.$sp,0)]}},body:function(){return[ce(66,l("ELSE")),ce(83,u(e.referrer)),ce(81),ye({capabilities:!0,attrs:i,params:o,hash:a,atNames:s,blocks:c}),ce("Label","ELSE")]}})}function ye(e){var t=e.capabilities,n=e.attrs,i=e.params,o=e.hash,a=e.atNames,s=e.blocks,u=e.layout,c=!!s,l=!0===t||t.prepareArgs||!(!o||0===o[0].length),f=s.with("attrs",n) return[ce(36,r.$s0),ce(33,r.$sp,1),ce(35,r.$s0),ce(0),ce("Args",{params:i,hash:o,blocks:f,atNames:a}),ce(87,r.$s0),be(f.has("default"),c,l,(function(){var e return(e=u?[x(u.symbolTable),ce("PushCompilable",u),ce("JitCompileBlock")]:[ce("GetComponentLayout",r.$s0)]).push(ce(98,r.$s0)),e})),ce(35,r.$s0)]}function be(e,t,n,i){void 0===i&&(i=null) var o=[ce(100),ce(59),ce(89,0|e,r.$s0)] return i&&o.push(i()),o.push(ce(90,r.$s0),ce(92,r.$s0),ce(38,r.$s0),ce(19,0),ce(97,r.$s0),n?ce(17,r.$s0):I,t?ce(18,r.$s0):I,ce(34,1),ce(99,r.$s0),ce(103,r.$s0),ce(1),ce(40),ce(60),ce(101)),o}function ge(e){return ee(e.block.statements,he(e))}var we=function(){function e(e,t,r){this.main=e,this.trustingGuardedAppend=t,this.cautiousGuardedAppend=r}return e.prototype.getAppend=function(e){return e?this.trustingGuardedAppend:this.cautiousGuardedAppend},(0,t.createClass)(e,[{key:"trusting-append",get:function(){return this.trustingGuardedAppend}},{key:"cautious-append",get:function(){return this.cautiousGuardedAppend}}]),e}() function _e(){return[ce(76,r.$s0),be(!1,!1,!0)]}function ke(e){return[ce(78),O((function(t){t(1,(function(){return e?[ce(68),ce(43)]:ce(47)})),t(0,(function(){return[ce(82),ce(81),[ce(36,r.$s0),ce(33,r.$sp,1),ce(35,r.$s0),ce(0),ce(85),ce(87,r.$s0),be(!1,!1,!0,(function(){return[ce("GetComponentLayout",r.$s0),ce(98,r.$s0)]})),ce(35,r.$s0)]]})),t(3,(function(){return[ce(68),ce(44)]})),t(4,(function(){return[ce(68),ce(45)]})),t(5,(function(){return[ce(68),ce(46)]}))}))]}function xe(e){var t=Ee(e,_e),r=Ee(e,(function(){return ke(!0)})),n=Ee(e,(function(){return ke(!1)})) return new we(t,r,n)}e.StdLib=we var Oe={asPartial:!1,evalSymbols:null,upvars:null,referrer:{},size:0} function Ee(e,t){var r=new le,n=new z L({encoder:r,meta:Oe,syntax:{macros:n,program:e}},t()) var i=r.commit(e.heap,0) if("number"!=typeof i)throw new Error("Unexpected errors compiling std") return i}var Se=function(e,t){this.mode=t,this.constants=new i.WriteOnlyConstants,this.heap=new i.HeapImpl,this.resolverDelegate=e,this.stdlib=xe(this)} e.ProgramCompilationContext=Se var Pe=function(e){this.constants=new i.JitConstants,this.heap=new i.HeapImpl,this.mode="jit",this.resolverDelegate=e,this.stdlib=xe(this)} e.JitProgramCompilationContext=Pe var Me=function(){function e(e,t){this.name=e,this.template=t}return e.prototype.getPartial=function(e){var t=(0,n.unwrapTemplate)(this.template).asPartial(),r=t.compile(e) return{symbolTable:t.symbolTable,handle:r}},e}() e.PartialDefinitionImpl=Me var Ae=function(){function e(e){this.layout=e,this.compiled=null var t=e.block,r=t.symbols.slice(),n=r.indexOf("&attrs") this.attrsBlockNumber=-1===n?r.push("&attrs"):n+1,this.symbolTable={hasEval:t.hasEval,symbols:r}}return e.prototype.compile=function(e){if(null!==this.compiled)return this.compiled var t,o,a,s,u=he(this.layout),c=V(e,u) U(c,(t=this.layout,o=this.attrsBlockNumber,[ce("StartLabels"),(a=r.$s1,s=function(){return[ce(93,r.$s0),ce(31),ce(33,r.$sp,0)]},[ce(36,a),s(),ce(35,a)]),ce(66,l("BODY")),ce(36,r.$s1),ce(91),ce(49),ce(102,r.$s0),g(o,n.EMPTY_ARRAY),ce(54),ce("Label","BODY"),_(ge(t)),ce(36,r.$s1),ce(66,l("END")),ce(55),ce("Label","END"),ce(35,r.$s1),ce("StopLabels")])) var f=c.encoder.commit(c.syntax.program.heap,u.size) return"number"!=typeof f||(this.compiled=f,(0,i.patchStdlibs)(c.syntax.program)),f},e}() e.WrappedBuilder=Ae var je=0 function Re(e){var t,r=e.id,i=e.meta,o=e.block,a=r||"client-"+je++ return{id:a,meta:i,create:function(e){var r=e?(0,n.assign)({},e,i):i return t||(t=JSON.parse(o)),new Te({id:a,block:t,referrer:r})}}}var Te=function(){function e(e){this.parsedLayout=e,this.result="ok",this.layout=null,this.partial=null,this.wrappedLayout=null var t=e.block this.symbols=t.symbols,this.hasEval=t.hasEval,this.referrer=e.referrer,this.id=e.id||"client-"+je++}var t=e.prototype return t.asLayout=function(){return this.layout?this.layout:this.layout=Q((0,n.assign)({},this.parsedLayout,{asPartial:!1}))},t.asPartial=function(){return this.partial?this.partial:this.layout=Q((0,n.assign)({},this.parsedLayout,{asPartial:!0}))},t.asWrappedLayout=function(){return this.wrappedLayout?this.wrappedLayout:this.wrappedLayout=new Ae((0,n.assign)({},this.parsedLayout,{asPartial:!1}))},e}()})),e("@glimmer/program",["exports","ember-babel","@glimmer/util"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.WriteOnlyConstants=e.WELL_KNOWN_EMPTY_ARRAY_POSITION=e.RuntimeProgramImpl=e.RuntimeOpImpl=e.RuntimeHeapImpl=e.RuntimeConstantsImpl=e.JitConstants=e.HeapImpl=void 0,e.artifacts=function(e){return y(e.program)},e.hydrateHeap=function(e){return new f(e)},e.hydrateProgram=function(e){var t=new f(e.heap),r=new a(e.constants) return new d(r,t)},e.patchStdlibs=function(e){e.heap.patchStdlibs(e.stdlib)},e.programArtifacts=y var n={} e.WELL_KNOWN_EMPTY_ARRAY_POSITION=0 var i=Object.freeze([]),o=function(){function e(){this.strings=[],this.arrays=[i],this.tables=[],this.handles=[],this.resolved=[],this.numbers=[],this.others=[]}var t=e.prototype return t.other=function(e){return this.others.push(e)-1},t.string=function(e){var t=this.strings.indexOf(e) return t>-1?t:this.strings.push(e)-1},t.stringArray=function(e){for(var t=new Array(e.length),r=0;r-1?t:this.arrays.push(e)-1},t.serializable=function(e){var t=JSON.stringify(e),r=this.strings.indexOf(t) return r>-1?r:this.strings.push(t)-1},t.templateMeta=function(e){return this.serializable(e)},t.number=function(e){var t=this.numbers.indexOf(e) return t>-1?t:this.numbers.push(e)-1},t.toPool=function(){return{strings:this.strings,arrays:this.arrays,handles:this.handles,numbers:this.numbers}},e}() e.WriteOnlyConstants=o var a=function(){function e(e){this.strings=e.strings,this.arrays=e.arrays,this.handles=e.handles,this.numbers=e.numbers,this.others=[]}var t=e.prototype return t.getString=function(e){return this.strings[e]},t.getNumber=function(e){return this.numbers[e]},t.getStringArray=function(e){for(var t=this.getArray(e),r=new Array(t.length),n=0;n-1?t:this.metas.push(e)-1},i.getNumber=function(e){return this.numbers[e]},i.getString=function(e){return this.strings[e]},i.getStringArray=function(e){for(var t=this.getArray(e),r=new Array(t.length),n=0;n>8)}},{key:"isMachine",get:function(){return 1024&this.heap.getbyaddr(this.offset)?1:0}},{key:"type",get:function(){return 255&this.heap.getbyaddr(this.offset)}},{key:"op1",get:function(){return this.heap.getbyaddr(this.offset+1)}},{key:"op2",get:function(){return this.heap.getbyaddr(this.offset+2)}},{key:"op3",get:function(){return this.heap.getbyaddr(this.offset+3)}}]),e}() function c(e,t){return t|e<<2}function l(e,t){return e|t<<30}e.RuntimeOpImpl=u var f=function(){function e(e){var t=e.buffer,r=e.table this.heap=new Int32Array(t),this.table=r}var t=e.prototype return t.getaddr=function(e){return this.table[e]},t.getbyaddr=function(e){return this.heap[e]},t.sizeof=function(e){return m(this.table,e)},t.scopesizeof=function(e){return v(this.table,e)},e}() e.RuntimeHeapImpl=f var h=function(){function e(){this.placeholders=[],this.stdlibs=[],this.offset=0,this.handle=0,this.capacity=1048576,this.heap=new Int32Array(1048576),this.table=[]}var t=e.prototype return t.push=function(e){this.sizeCheck(),this.heap[this.offset++]=e},t.sizeCheck=function(){if(0===this.capacity){var e=p(this.heap,0,this.offset) this.heap=new Int32Array(e.length+1048576),this.heap.set(e,0),this.capacity=1048576}this.capacity--},t.getbyaddr=function(e){return this.heap[e]},t.setbyaddr=function(e,t){this.heap[e]=t},t.malloc=function(){this.table.push(this.offset,0,0) var e=this.handle return this.handle+=3,e},t.finishMalloc=function(e,t){this.table[e+1]=c(t,0)},t.size=function(){return this.offset},t.getaddr=function(e){return this.table[e]},t.gethandle=function(e){this.table.push(e,c(0,3),0) var t=this.handle return this.handle+=3,t},t.sizeof=function(e){return m(this.table,e)},t.scopesizeof=function(e){return v(this.table,e)},t.free=function(e){var t=this.table[e+1] this.table[e+1]=l(t,1)},t.compact=function(){for(var e=0,t=this.table,r=this.table.length,n=this.heap,i=0;i>2}function y(e){return{heap:e.heap.capture(e.stdlib),constants:e.constants.toPool()}}e.RuntimeProgramImpl=d})),e("@glimmer/reference",["exports","ember-babel","@glimmer/util","@glimmer/validator"],(function(e,t,r,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.UPDATE_REFERENCED_VALUE=e.RootReference=e.ReferenceIterator=e.ReferenceCache=e.PropertyReference=e.ListItem=e.IteratorSynchronizer=e.IterationItemReference=e.IterationArtifacts=e.IterableImpl=e.HelperRootReference=e.END=e.ConstReference=e.ComponentRootReference=e.CachedReference=void 0,e.isModified=function(e){return e!==a} var i=function(){function e(){this.lastRevision=null,this.lastValue=null}var t=e.prototype return t.value=function(){var e=this.tag,t=this.lastRevision,r=this.lastValue return null!==t&&(0,n.validateTag)(e,t)||(r=this.lastValue=this.compute(),this.lastRevision=(0,n.valueForTag)(e)),r},t.invalidate=function(){this.lastRevision=null},e}() e.CachedReference=i var o=function(){function e(e){this.lastValue=null,this.lastRevision=null,this.initialized=!1,this.tag=e.tag,this.reference=e}var t=e.prototype return t.peek=function(){return this.initialized?this.lastValue:this.initialize()},t.revalidate=function(){if(!this.initialized)return this.initialize() var e=this.reference,t=this.lastRevision,r=e.tag if((0,n.validateTag)(r,t))return a var i=this.lastValue,o=e.value() return this.lastRevision=(0,n.valueForTag)(r),o===i?a:(this.lastValue=o,o)},t.initialize=function(){var e=this.reference,t=this.lastValue=e.value() return this.lastRevision=(0,n.valueForTag)(e.tag),this.initialized=!0,t},e}() e.ReferenceCache=o var a=(0,r.symbol)("NOT_MODIFIED") var s=new(function(){function e(e){this.inner=e,this.tag=n.CONSTANT_TAG}var t=e.prototype return t.value=function(){return this.inner},t.get=function(e){return s},e}())(void 0),u=function(){function e(e){this.inner=e,this.tag=n.CONSTANT_TAG}var t=e.prototype return t.value=function(){return this.inner},t.get=function(e){return s},e}() e.ConstReference=u var c=function(e){function r(t,r){var n return(n=e.call(this,t.valueReferenceFor(r))||this).retained=!1,n.seen=!1,n.key=r.key,n.iterable=t,n.memo=t.memoReferenceFor(r),n}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.update=function(e){this.retained=!0,this.iterable.updateValueReference(this.value,e),this.iterable.updateMemoReference(this.memo,e)},n.shouldRemove=function(){return!this.retained},n.reset=function(){this.retained=!1,this.seen=!1},r}(r.ListNode) e.ListItem=c var l=function(){function e(e){this.iterator=null,this.map=new Map,this.list=new r.LinkedList,this.tag=e.tag,this.iterable=e}var t=e.prototype return t.isEmpty=function(){return(this.iterator=this.iterable.iterate()).isEmpty()},t.iterate=function(){var e return e=null===this.iterator?this.iterable.iterate():this.iterator,this.iterator=null,e},t.advanceToKey=function(e,t){for(var r=t;null!==r&&r.key!==e;)r=this.advanceNode(r) return r},t.has=function(e){return this.map.has(e)},t.get=function(e){return this.map.get(e)},t.wasSeen=function(e){var t=this.map.get(e) return void 0!==t&&t.seen},t.update=function(e){var t=this.get(e.key) return t.update(e),t},t.append=function(e){var t=this.map,r=this.list,n=this.iterable,i=new c(n,e) return t.set(e.key,i),r.append(i),i},t.insertBefore=function(e,t){var r=this.map,n=this.list,i=this.iterable,o=new c(i,e) return r.set(e.key,o),o.retained=!0,n.insertBefore(o,t),o},t.move=function(e,t){var r=this.list e.retained=!0,r.remove(e),r.insertBefore(e,t)},t.remove=function(e){this.list.remove(e),this.map.delete(e.key)},t.nextNode=function(e){return this.list.nextNode(e)},t.advanceNode=function(e){return e.seen=!0,this.list.nextNode(e)},t.head=function(){return this.list.head()},e}() e.IterationArtifacts=l var f,h=function(){function e(e){this.iterator=null var t=new l(e) this.artifacts=t}return e.prototype.next=function(){var e=this.artifacts,t=(this.iterator=this.iterator||e.iterate()).next() return null===t?null:e.append(t)},e}() e.ReferenceIterator=h,function(e){e[e.Append=0]="Append",e[e.Prune=1]="Prune",e[e.Done=2]="Done"}(f||(f={})) var d=(0,r.symbol)("END") e.END=d var p=function(){function e(e){var t=e.target,r=e.artifacts,n=e.env this.target=t,this.artifacts=r,this.iterator=r.iterate(),this.current=r.head(),this.env=n}var t=e.prototype return t.sync=function(){for(var e=f.Append;;)switch(e){case f.Append:e=this.nextAppend() break case f.Prune:e=this.nextPrune() break case f.Done:return void this.nextDone()}},t.advanceToKey=function(e){var t=this.current,r=this.artifacts if(null!==t){var n=r.advanceNode(t) if(n.key!==e){var i=r.advanceToKey(e,t) i&&(this.move(i,t),this.current=r.nextNode(t))}else this.current=r.advanceNode(n)}},t.move=function(e,t){e.next!==t&&(this.artifacts.move(e,t),this.target.move(this.env,e.key,e.value,e.memo,t?t.key:d))},t.nextAppend=function(){var e=this.iterator,t=this.current,r=this.artifacts,n=e.next() if(null===n)return this.startPrune() var i=n.key return null!==t&&t.key===i?this.nextRetain(n,t):r.has(i)?this.nextMove(n):this.nextInsert(n),f.Append},t.nextRetain=function(e,t){var r=this.artifacts t.update(e),this.current=r.nextNode(t),this.target.retain(this.env,e.key,t.value,t.memo)},t.nextMove=function(e){var t=this.current,r=this.artifacts,n=e.key,i=r.update(e) r.wasSeen(n)?this.move(i,t):this.advanceToKey(n)},t.nextInsert=function(e){var t=this.artifacts,r=this.target,n=this.current,i=t.insertBefore(e,n) r.insert(this.env,i.key,i.value,i.memo,n?n.key:null)},t.startPrune=function(){return this.current=this.artifacts.head(),f.Prune},t.nextPrune=function(){var e=this.artifacts,t=this.target,r=this.current if(null===r)return f.Done var n=r return this.current=e.nextNode(n),n.shouldRemove()?(e.remove(n),t.delete(this.env,n.key)):n.reset(),f.Prune},t.nextDone=function(){this.target.done(this.env)},e}() e.IteratorSynchronizer=p var m=(0,r.symbol)("UPDATE_REFERENCED_VALUE") e.UPDATE_REFERENCED_VALUE=m var v=function(){function e(e){this.env=e,this.children=(0,r.dict)(),this.tag=n.CONSTANT_TAG}return e.prototype.get=function(e){var t=this.children[e] return void 0===t&&(t=this.children[e]=new g(this,e,this.env)),t},e}() e.RootReference=v var y=function(e){function r(t,r){var n return(n=e.call(this,r)||this).inner=t,n}return(0,t.inheritsLoose)(r,e),r.prototype.value=function(){return this.inner},r}(v) e.ComponentRootReference=y var b=function(e){function r(r,i,o,a){var s;(s=e.call(this,o)||this).fn=r,s.args=i,s.computeRevision=null,s.computeTag=null,(0,n.isConst)(i)&&s.compute() var u=(0,t.assertThisInitialized)(s),c=u.tag,l=u.computeTag if(null!==l&&(0,n.isConstTag)(l))c=s.tag=n.CONSTANT_TAG,s.computeRevision=(0,n.valueForTag)(c) else{var f=s.valueTag=(0,n.createUpdatableTag)() c=s.tag=(0,n.combine)([i.tag,f]),null!==l&&((0,n.updateTag)(f,l),s.computeRevision=(0,n.valueForTag)(c))}return s}(0,t.inheritsLoose)(r,e) var i=r.prototype return i.compute=function(){var e=this this.computeTag=(0,n.track)((function(){e.computeValue=e.fn(e.args)}),!1)},i.value=function(){var e=this.tag,t=this.computeRevision return null!==t&&(0,n.validateTag)(e,t)||(this.compute(),(0,n.updateTag)(this.valueTag,this.computeTag),this.computeRevision=(0,n.valueForTag)(e)),this.computeValue},r}(v) e.HelperRootReference=b var g=function(){function e(e,t,i){this.parentReference=e,this.propertyKey=t,this.env=i,this.children=(0,r.dict)(),this.lastRevision=null var o=this.valueTag=(0,n.createUpdatableTag)(),a=e.tag this.tag=(0,n.combine)([a,o])}var t=e.prototype return t.value=function(){var e=this,t=this.tag,i=this.lastRevision,o=this.lastValue,a=this.parentReference,s=this.valueTag,u=this.propertyKey if(null===i||!(0,n.validateTag)(t,i)){var c=a.value() if((0,r.isDict)(c)){var l=(0,n.track)((function(){o=e.env.getPath(c,u)}),!1);(0,n.updateTag)(s,l)}else o=void 0 this.lastValue=o,this.lastRevision=(0,n.valueForTag)(t)}return o},t.get=function(t){var r=this.children[t] return void 0===r&&(r=this.children[t]=new e(this,t,this.env)),r},t[m]=function(e){var t=this.parentReference,r=this.propertyKey,n=t.value() this.env.setPath(n,r,e)},e}() e.PropertyReference=g var w=function(){function e(e,t,i,o){this.parentReference=e,this.itemValue=t,this.env=o,this.tag=(0,n.createUpdatableTag)(),this.children=(0,r.dict)()}var t=e.prototype return t.value=function(){return this.itemValue},t.update=function(e){(0,n.dirtyTag)(this.tag),this.itemValue=e},t.get=function(e){var t=this.children[e] return void 0===t&&(t=this.children[e]=new g(this,e,this.env)),t},e}() e.IterationItemReference=w var _={},k=function(e,t){return t},x=function(e,t){return String(t)},O=function(e){return null===e?_:e} function E(e,t){switch(e){case"@key":return M(k) case"@index":return M(x) case"@identity":return M(O) default:return function(e,t){return M((function(r){return t(r,e)}))}(e,t)}}var S=function(){function e(){}var n=e.prototype return n.set=function(e,t){(0,r.isObject)(e)||"function"==typeof e?this.weakMap.set(e,t):this.primitiveMap.set(e,t)},n.get=function(e){return(0,r.isObject)(e)||"function"==typeof e?this.weakMap.get(e):this.primitiveMap.get(e)},(0,t.createClass)(e,[{key:"weakMap",get:function(){return void 0===this._weakMap&&(this._weakMap=new WeakMap),this._weakMap}},{key:"primitiveMap",get:function(){return void 0===this._primitiveMap&&(this._primitiveMap=new Map),this._primitiveMap}}]),e}(),P=new S function M(e){var t=new S return function(r,n){var i=e(r,n),o=t.get(i)||0 return t.set(i,o+1),0===o?i:function(e,t){var r=P.get(e) void 0===r&&(r=[],P.set(e,r)) var n=r[t] return void 0===n&&(n={value:e,count:t},r[t]=n),n}(i,o)}}var A=function(){function e(e,t,r){this.parentRef=e,this.key=t,this.env=r,this.tag=e.tag}var t=e.prototype return t.iterate=function(){var e=this.parentRef,t=this.key,n=this.env,i=e.value(),o=E(t,n.getPath) if(Array.isArray(i))return new R(i,o) var a=n.toIterator(i) return null===a?new R(r.EMPTY_ARRAY,(function(){return null})):new j(a,o)},t.valueReferenceFor=function(e){var t=this.parentRef,r=this.env return new w(t,e.value,e.memo,r)},t.updateValueReference=function(e,t){e.update(t.value)},t.memoReferenceFor=function(e){var t=this.parentRef,r=this.env return new w(t,e.memo,"",r)},t.updateMemoReference=function(e,t){e.update(t.memo)},e}() e.IterableImpl=A var j=function(){function e(e,t){this.inner=e,this.keyFor=t}var t=e.prototype return t.isEmpty=function(){return this.inner.isEmpty()},t.next=function(){var e=this.inner.next() return null!==e&&(e.key=this.keyFor(e.value,e.memo)),e},e}(),R=function(){function e(e,t){this.iterator=e,this.keyFor=t,this.pos=0,0===e.length?this.current={kind:"empty"}:this.current={kind:"first",value:e[this.pos]}}var t=e.prototype return t.isEmpty=function(){return"empty"===this.current.kind},t.next=function(){var e,t=this.current if("first"===t.kind)this.current={kind:"progress"},e=t.value else{if(this.pos>=this.iterator.length-1)return null e=this.iterator[++this.pos]}return{key:(0,this.keyFor)(e,this.pos),value:e,memo:this.pos}},e}()})),e("@glimmer/runtime",["exports","ember-babel","@glimmer/util","@glimmer/reference","@glimmer/program","@glimmer/vm","@glimmer/validator","@glimmer/low-level"],(function(e,t,r,n,i,o,a,s){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.AotRuntime=function(e,t,r,n){void 0===r&&(r={}) void 0===n&&(n={}) return{env:new Te(e,n),resolver:new Fe(r),program:i.RuntimeProgramImpl.hydrate(t)}},e.IDOMChanges=e.EnvironmentImpl=e.EMPTY_ARGS=e.DynamicAttribute=e.DefaultDynamicScope=e.DOMTreeConstruction=e.DOMChanges=e.DEFAULT_CAPABILITIES=e.CursorImpl=e.CurriedComponentDefinition=e.ConditionalReference=e.ConcreteBounds=e.CapturedPositionalArgumentsImpl=e.CapturedNamedArgumentsImpl=e.CapturedArgumentsImpl=void 0,e.JitRuntime=function(e,t,r,n){void 0===t&&(t={}) void 0===n&&(n={}) return{env:new Te(e,t),program:new i.RuntimeProgramImpl(r.program.constants,r.program.heap),resolver:new Fe(n)}},e.UpdatingVM=e.UpdatableBlockImpl=e.UNDEFINED_REFERENCE=e.TEMPLATE_ONLY_COMPONENT=e.SimpleDynamicAttribute=e.SimpleComponentManager=e.ScopeImpl=e.SERIALIZATION_FIRST_NODE_STRING=e.RemoteLiveBlock=e.RehydrateBuilder=e.PrimitiveReference=e.NewElementBuilder=e.NULL_REFERENCE=e.MINIMAL_CAPABILITIES=e.LowLevelVM=void 0,e.capabilityFlagsFrom=Je,e.clear=w,e.clientBuilder=function(e,t){return M.forInitialRender(e,t)},e.curry=function(e,t){void 0===t&&(t=null) return new et(e,t)},e.dynamicAttribute=ye,e.getDynamicVar=function(e,t){var r=t.dynamicScope(),n=e.positional.at(0) return new At(r,n)},e.hasCapability=Ze,e.inTransaction=Ue,e.isCurriedComponentDefinition=Xe,e.isSerializationFirstNode=fr,e.isWhitespace=function(e){return F.test(e)},e.normalizeProperty=oe,e.rehydrationBuilder=function(e,t){return dr.forInitialRender(e,t)},e.renderAot=function(e,t,r,n){void 0===n&&(n=K) var i=M.forInitialRender(e.env,r),o=new Mt,a=ir.initial(e,{self:n,dynamicScope:o,treeBuilder:i,handle:t}) return new ur(a)},e.renderAotComponent=function(e,t,r,n,i,o){void 0===i&&(i={}) void 0===o&&(o=new Mt) var a,s=ir.empty(e,{treeBuilder:t,handle:r,dynamicScope:o}),u=tt(s.runtime.resolver,n),c=u.manager,l=u.state if(!vt(Je(c.getCapabilities(l)),c))throw new Error("Cannot invoke components with dynamic layouts as a root component.") a=c.getAotStaticLayout(l,s.runtime.resolver) return lr(s,a,u,i)},e.renderAotMain=function(e,t,r,n,i){void 0===i&&(i=new Mt) var o=ir.initial(e,{self:t,dynamicScope:i,treeBuilder:r,handle:n}) return new ur(o)},e.renderJitComponent=function(e,t,n,i,o,a,s){void 0===a&&(a={}) void 0===s&&(s=new Mt) var u,c=sr.empty(e,{treeBuilder:t,handle:i,dynamicScope:s},n),l=tt(c.runtime.resolver,o),f=l.manager,h=l.state if(!vt(Je(f.getCapabilities(h)),f))throw new Error("Cannot invoke components with dynamic layouts as a root component.") var d=f.getJitStaticLayout(h,c.runtime.resolver),p=(0,r.unwrapHandle)(d.compile(n)) if(Array.isArray(p)){var m=p[0] throw new Error("Compile Error: "+m.problem+" "+m.span.start+".."+m.span.end+" :: TODO (thread better)")}u={handle:p,symbolTable:d.symbolTable} return lr(c,u,l,a)},e.renderJitMain=function(e,t,r,n,i,o){void 0===o&&(o=new Mt) var a=sr.initial(e,t,{self:r,dynamicScope:o,treeBuilder:n,handle:i}) return new ur(a)},e.renderSync=cr,e.resetDebuggerCallback=function(){kt=_t},e.setDebuggerCallback=function(e){kt=e} var u=(0,r.symbol)("INNER_VM"),c=(0,r.symbol)("DESTRUCTOR_STACK"),l=(0,r.symbol)("STACKS"),f=(0,r.symbol)("REGISTERS"),h=(0,r.symbol)("HEAP"),d=(0,r.symbol)("CONSTANTS"),p=(0,r.symbol)("ARGS"),m=((0,r.symbol)("PC"),function(e,t){this.element=e,this.nextSibling=t}) e.CursorImpl=m var v=function(){function e(e,t,r){this.parentNode=e,this.first=t,this.last=r}var t=e.prototype return t.parentElement=function(){return this.parentNode},t.firstNode=function(){return this.first},t.lastNode=function(){return this.last},e}() e.ConcreteBounds=v var y,b=function(){function e(e,t){this.parentNode=e,this.node=t}var t=e.prototype return t.parentElement=function(){return this.parentNode},t.firstNode=function(){return this.node},t.lastNode=function(){return this.node},e}() function g(e,t){for(var r=e.parentElement(),n=e.firstNode(),i=e.lastNode(),o=n;;){var a=o.nextSibling if(r.insertBefore(o,t),o===i)return a o=a}}function w(e){for(var t=e.parentElement(),r=e.firstNode(),n=e.lastNode(),i=r;;){var o=i.nextSibling if(t.removeChild(i),i===n)return o i=o}}function _(e,t){var n=(0,r.peekAssociated)(e) null!==n&&t.willDestroy((0,r.snapshot)(n))}function k(e,t){var n=(0,r.takeAssociated)(e) null!==n&&t.didDestroy((0,r.snapshot)(n))}function x(e,t){t.willDestroy((0,r.destructor)(e))}function O(e,t){t.didDestroy((0,r.destructor)(e))}var E=function(){function e(e){this.node=e}return e.prototype.firstNode=function(){return this.node},e}(),S=function(){function e(e){this.node=e}return e.prototype.lastNode=function(){return this.node},e}(),P=(0,r.symbol)("CURSOR_STACK"),M=function(){function e(e,t,n){this.constructing=null,this.operations=null,this[y]=new r.Stack,this.modifierStack=new r.Stack,this.blockStack=new r.Stack,this.pushElement(t,n),this.env=e,this.dom=e.getAppendOperations(),this.updateOperations=e.getDOM()}e.forInitialRender=function(e,t){return new this(e,t.element,t.nextSibling).initialize()},e.resume=function(e,t){var r=new this(e,t.parentElement(),t.reset(e)).initialize() return r.pushLiveBlock(t),r} var n=e.prototype return n.initialize=function(){return this.pushSimpleBlock(),this},n.debugBlocks=function(){return this.blockStack.toArray()},n.block=function(){return this.blockStack.current},n.popElement=function(){this[P].pop(),this[P].current},n.pushSimpleBlock=function(){return this.pushLiveBlock(new A(this.element))},n.pushUpdatableBlock=function(){return this.pushLiveBlock(new R(this.element))},n.pushBlockList=function(e){return this.pushLiveBlock(new T(this.element,e))},n.pushLiveBlock=function(e,t){void 0===t&&(t=!1) var r=this.blockStack.current return null!==r&&(t||r.didAppendBounds(e)),this.__openBlock(),this.blockStack.push(e),e},n.popBlock=function(){return this.block().finalize(this),this.__closeBlock(),this.blockStack.pop()},n.__openBlock=function(){},n.__closeBlock=function(){},n.openElement=function(e){var t=this.__openElement(e) return this.constructing=t,t},n.__openElement=function(e){return this.dom.createElement(e,this.element)},n.flushElement=function(e){var t=this.element,r=this.constructing this.__flushElement(t,r),this.constructing=null,this.operations=null,this.pushModifiers(e),this.pushElement(r,null),this.didOpenElement(r)},n.__flushElement=function(e,t){this.dom.insertBefore(e,t,this.nextSibling)},n.closeElement=function(){return this.willCloseElement(),this.popElement(),this.popModifiers()},n.pushRemoteElement=function(e,t,r){return this.__pushRemoteElement(e,t,r)},n.__pushRemoteElement=function(e,t,r){if(this.pushElement(e,r),void 0===r)for(;e.lastChild;)e.removeChild(e.lastChild) var n=new j(e) return this.pushLiveBlock(n,!0)},n.popRemoteElement=function(){this.popBlock(),this.popElement()},n.pushElement=function(e,t){void 0===t&&(t=null),this[P].push(new m(e,t))},n.pushModifiers=function(e){this.modifierStack.push(e)},n.popModifiers=function(){return this.modifierStack.pop()},n.didAppendBounds=function(e){return this.block().didAppendBounds(e),e},n.didAppendNode=function(e){return this.block().didAppendNode(e),e},n.didOpenElement=function(e){return this.block().openElement(e),e},n.willCloseElement=function(){this.block().closeElement()},n.appendText=function(e){return this.didAppendNode(this.__appendText(e))},n.__appendText=function(e){var t=this.dom,r=this.element,n=this.nextSibling,i=t.createTextNode(e) return t.insertBefore(r,i,n),i},n.__appendNode=function(e){return this.dom.insertBefore(this.element,e,this.nextSibling),e},n.__appendFragment=function(e){var t=e.firstChild if(t){var r=new v(this.element,t,e.lastChild) return this.dom.insertBefore(this.element,e,this.nextSibling),r}return new b(this.element,this.__appendComment(""))},n.__appendHTML=function(e){return this.dom.insertHTMLBefore(this.element,this.nextSibling,e)},n.appendDynamicHTML=function(e){var t=this.trustedContent(e) this.didAppendBounds(t)},n.appendDynamicText=function(e){var t=this.untrustedContent(e) return this.didAppendNode(t),t},n.appendDynamicFragment=function(e){var t=this.__appendFragment(e) this.didAppendBounds(t)},n.appendDynamicNode=function(e){var t=this.__appendNode(e),r=new b(this.element,t) this.didAppendBounds(r)},n.trustedContent=function(e){return this.__appendHTML(e)},n.untrustedContent=function(e){return this.__appendText(e)},n.appendComment=function(e){return this.didAppendNode(this.__appendComment(e))},n.__appendComment=function(e){var t=this.dom,r=this.element,n=this.nextSibling,i=t.createComment(e) return t.insertBefore(r,i,n),i},n.__setAttribute=function(e,t,r){this.dom.setAttribute(this.constructing,e,t,r)},n.__setProperty=function(e,t){this.constructing[e]=t},n.setStaticAttribute=function(e,t,r){this.__setAttribute(e,t,r)},n.setDynamicAttribute=function(e,t,r,n){var i=this.constructing,o=this.env.attributeFor(i,e,r,n) return o.set(this,t,this.env),o},(0,t.createClass)(e,[{key:"element",get:function(){return this[P].current.element}},{key:"nextSibling",get:function(){return this[P].current.nextSibling}},{key:"hasBlocks",get:function(){return this.blockStack.size>0}}]),e}() e.NewElementBuilder=M,y=P var A=function(){function e(e){this.parent=e,this.first=null,this.last=null,this.destroyables=null,this.nesting=0}var t=e.prototype return t.parentElement=function(){return this.parent},t.firstNode=function(){return this.first.firstNode()},t.lastNode=function(){return this.last.lastNode()},t.openElement=function(e){this.didAppendNode(e),this.nesting++},t.closeElement=function(){this.nesting--},t.didAppendNode=function(e){0===this.nesting&&(this.first||(this.first=new E(e)),this.last=new S(e))},t.didAppendBounds=function(e){0===this.nesting&&(this.first||(this.first=e),this.last=e)},t.finalize=function(e){null===this.first&&e.appendComment("")},e}(),j=function(e){function n(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(n,e),n.prototype[r.DESTROY]=function(){this.parentElement()===this.firstNode().parentNode&&w(this)},n}(A) e.RemoteLiveBlock=j var R=function(e){function r(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(r,e),r.prototype.reset=function(e){var t=function(e,t){return _(e,t),k(e,t),w(e)}(this,e) return this.first=null,this.last=null,this.destroyables=null,this.nesting=0,t},r}(A) e.UpdatableBlockImpl=R var T=function(){function e(e,t){this.parent=e,this.boundList=t,this.parent=e,this.boundList=t}var t=e.prototype return t.parentElement=function(){return this.parent},t.firstNode=function(){return this.boundList.head().firstNode()},t.lastNode=function(){return this.boundList.tail().lastNode()},t.openElement=function(e){},t.closeElement=function(){},t.didAppendNode=function(e){},t.didAppendBounds=function(e){},t.finalize=function(e){},e}() var C={foreignObject:1,desc:1,title:1},I=Object.create(null),N=function(){function e(e){this.document=e,this.setupUselessElement()}var t=e.prototype return t.setupUselessElement=function(){this.uselessElement=this.document.createElement("div")},t.createElement=function(e,t){var r,n if(t?(r="http://www.w3.org/2000/svg"===t.namespaceURI||"svg"===e,n=!!C[t.tagName]):(r="svg"===e,n=!1),r&&!n){if(I[e])throw new Error("Cannot create a "+e+" inside an SVG context") return this.document.createElementNS("http://www.w3.org/2000/svg",e)}return this.document.createElement(e)},t.insertBefore=function(e,t,r){e.insertBefore(t,r)},t.insertHTMLBefore=function(e,t,r){if(""===r){var n=this.createComment("") return e.insertBefore(n,t),new v(e,n,n)}var i,o=t?t.previousSibling:e.lastChild if(null===t)e.insertAdjacentHTML("beforeend",r),i=e.lastChild else if(t instanceof HTMLElement)t.insertAdjacentHTML("beforebegin",r),i=t.previousSibling else{var a=this.uselessElement e.insertBefore(a,t),a.insertAdjacentHTML("beforebegin",r),i=a.previousSibling,e.removeChild(a)}var s=o?o.nextSibling:e.firstChild return new v(e,s,i)},t.createTextNode=function(e){return this.document.createTextNode(e)},t.createComment=function(e){return this.document.createComment(e)},e}() function D(e,n,i){if(!e)return n if(!function(e,t){var r=e.createElementNS(t,"svg") try{r.insertAdjacentHTML("beforeend","")}catch(n){}finally{return 1!==r.childNodes.length||"http://www.w3.org/2000/svg"!==r.firstChild.namespaceURI}}(e,i))return n var o=e.createElement("div") return function(e){function n(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(n,e),n.prototype.insertHTMLBefore=function(t,n,a){return""===a||t.namespaceURI!==i?e.prototype.insertHTMLBefore.call(this,t,n,a):function(e,t,n,i){var o if("FOREIGNOBJECT"===e.tagName.toUpperCase()){var a=""+n+"";(0,r.clearElement)(t),t.insertAdjacentHTML("afterbegin",a),o=t.firstChild.firstChild}else{var s=""+n+"";(0,r.clearElement)(t),t.insertAdjacentHTML("afterbegin",s),o=t.firstChild}return function(e,t,r){for(var n=e.firstChild,i=n,o=n;o;){var a=o.nextSibling t.insertBefore(o,r),i=o,o=a}return new v(t,n,i)}(o,e,i)}(t,o,a,n)},n}(n)}function B(e,r){return e&&function(e){var t=e.createElement("div") if(t.appendChild(e.createTextNode("first")),t.insertAdjacentHTML("beforeend","second"),2===t.childNodes.length)return!1 return!0}(e)?function(e){function r(t){var r return(r=e.call(this,t)||this).uselessComment=t.createComment(""),r}return(0,t.inheritsLoose)(r,e),r.prototype.insertHTMLBefore=function(t,r,n){if(""===n)return e.prototype.insertHTMLBefore.call(this,t,r,n) var i=!1,o=r?r.previousSibling:t.lastChild o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,r)) var a=e.prototype.insertHTMLBefore.call(this,t,r,n) return i&&t.removeChild(this.uselessComment),a},r}(r):r}["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach((function(e){return I[e]=1})) var L,F=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/,U="undefined"==typeof document?null:document;(function(e){var r=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.createElementNS=function(e,t){return this.document.createElementNS(e,t)},n.setAttribute=function(e,t,r,n){void 0===n&&(n=null),n?e.setAttributeNS(n,t,r):e.setAttribute(t,r)},r}(N) e.TreeConstruction=r var n=r n=B(U,n),n=D(U,n,"http://www.w3.org/2000/svg"),e.DOMTreeConstruction=n})(L||(L={})) var z=function(e){function r(t){var r return(r=e.call(this,t)||this).document=t,r.namespace=null,r}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.setAttribute=function(e,t,r){e.setAttribute(t,r)},n.removeAttribute=function(e,t){e.removeAttribute(t)},n.insertAfter=function(e,t,r){this.insertBefore(e,t,r.nextSibling)},r}(N) e.IDOMChanges=z var q=z q=B(U,q) var H=q=D(U,q,"http://www.w3.org/2000/svg") e.DOMChanges=H var V=L.DOMTreeConstruction e.DOMTreeConstruction=V var W=function(e){function r(t){return e.call(this,t)||this}return(0,t.inheritsLoose)(r,e),r.create=function(e){return void 0===e?K:null===e?J:!0===e?$:!1===e?Z:"number"==typeof e?new Y(e):new G(e)},r.prototype.get=function(e){return K},r}(n.ConstReference) e.PrimitiveReference=W var G=function(e){function r(){var t return(t=e.apply(this,arguments)||this).lengthReference=null,t}return(0,t.inheritsLoose)(r,e),r.prototype.get=function(t){if("length"===t){var r=this.lengthReference return null===r&&(r=this.lengthReference=new Y(this.inner.length)),r}return e.prototype.get.call(this,t)},r}(W),Y=function(e){function r(t){return e.call(this,t)||this}return(0,t.inheritsLoose)(r,e),r}(W),K=new Y(void 0) e.UNDEFINED_REFERENCE=K var J=new Y(null) e.NULL_REFERENCE=J var $=new Y(!0),Z=new Y(!1),Q=function(){function e(e,t){void 0===t&&(t=X),this.inner=e,this.toBool=t,this.tag=e.tag}return e.prototype.value=function(){return this.toBool(this.inner.value())},e}() function X(e){return!!e}function ee(e){return te(e)?"":String(e)}function te(e){return null==e||"function"!=typeof e.toString}function re(e){return"object"==typeof e&&null!==e&&"function"==typeof e.toHTML}function ne(e){return"object"==typeof e&&null!==e&&"number"==typeof e.nodeType}function ie(e){return"string"==typeof e}function oe(e,t){var r,n,i,o,a if(t in e)n=t,r="prop" else{var s=t.toLowerCase() s in e?(r="prop",n=s):(r="attr",n=t)}return"prop"===r&&("style"===n.toLowerCase()||(i=e.tagName,o=n,(a=ae[i.toUpperCase()])&&a[o.toLowerCase()]))&&(r="attr"),{normalized:n,type:r}}e.ConditionalReference=Q var ae={INPUT:{form:!0,autocorrect:!0,list:!0},SELECT:{form:!0},OPTION:{form:!0},TEXTAREA:{form:!0},LABEL:{form:!0},FIELDSET:{form:!0},LEGEND:{form:!0},OBJECT:{form:!0},BUTTON:{form:!0}} var se=["javascript:","vbscript:"],ue=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],ce=["EMBED"],le=["href","src","background","action"],fe=["src"] function he(e,t){return-1!==e.indexOf(t)}function de(e,t){return(null===e||he(ue,e))&&he(le,t)}function pe(e,t){return null!==e&&(he(ce,e)&&he(fe,t))}function me(e,t){return de(e,t)||pe(e,t)}function ve(e,t,r,n){var i=null if(null==n)return n if(re(n))return n.toHTML() i=t?t.tagName.toUpperCase():null var o=ee(n) if(de(i,r)){var a=e.protocolForURL(o) if(he(se,a))return"unsafe:"+o}return pe(i,r)?"unsafe:"+o:o}function ye(e,t,r){var n=e.tagName,i={element:e,name:t,namespace:r} if("http://www.w3.org/2000/svg"===e.namespaceURI)return be(n,t,i) var o=oe(e,t),a=o.type,s=o.normalized return"attr"===a?be(n,s,i):function(e,t,r){if(me(e,t))return new xe(t,r) if(function(e,t){return("INPUT"===e||"TEXTAREA"===e)&&"value"===t}(e,t))return new Ee(t,r) if(function(e,t){return"OPTION"===e&&"selected"===t}(e,t))return new Se(t,r) return new ke(t,r)}(n,s,i)}function be(e,t,r){return me(e,t)?new Oe(r):new we(r)}var ge=function(e){this.attribute=e} e.DynamicAttribute=ge var we=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(e,t,r){var n=Pe(t) if(null!==n){var i=this.attribute,o=i.name,a=i.namespace e.__setAttribute(o,n,a)}},n.update=function(e,t){var r=Pe(e),n=this.attribute,i=n.element,o=n.name null===r?i.removeAttribute(o):i.setAttribute(o,r)},r}(ge) e.SimpleDynamicAttribute=we var _e,ke=function(e){function r(t,r){var n return(n=e.call(this,r)||this).normalizedName=t,n}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(e,t,r){null!=t&&(this.value=t,e.__setProperty(this.normalizedName,t))},n.update=function(e,t){var r=this.attribute.element this.value!==e&&(r[this.normalizedName]=this.value=e,null==e&&this.removeAttribute())},n.removeAttribute=function(){var e=this.attribute,t=e.element,r=e.namespace r?t.removeAttributeNS(r,this.normalizedName):t.removeAttribute(this.normalizedName)},r}(ge),xe=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(t,r,n){var i=this.attribute,o=ve(n,i.element,i.name,r) e.prototype.set.call(this,t,o,n)},n.update=function(t,r){var n=this.attribute,i=ve(r,n.element,n.name,t) e.prototype.update.call(this,i,r)},r}(ke),Oe=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(t,r,n){var i=this.attribute,o=ve(n,i.element,i.name,r) e.prototype.set.call(this,t,o,n)},n.update=function(t,r){var n=this.attribute,i=ve(r,n.element,n.name,t) e.prototype.update.call(this,i,r)},r}(we),Ee=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(e,t){e.__setProperty("value",ee(t))},n.update=function(e){var t=this.attribute.element,r=t.value,n=ee(e) r!==n&&(t.value=n)},r}(ke),Se=function(e){function r(){return e.apply(this,arguments)||this}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.set=function(e,t){null!=t&&!1!==t&&e.__setProperty("selected",!0)},n.update=function(e){var t=this.attribute.element t.selected=!!e},r}(ke) function Pe(e){return!1===e||null==e||void 0===e.toString?null:!0===e?"":"function"==typeof e?null:String(e)}var Me=function(){function e(e,t,r,n){this.slots=e,this.callerScope=t,this.evalScope=r,this.partialMap=n}e.root=function(t,r){void 0===r&&(r=0) for(var n=new Array(r+1),i=0;i<=r;i++)n[i]=K return new e(n,null,null,null).init({self:t})},e.sized=function(t){void 0===t&&(t=0) for(var r=new Array(t+1),n=0;n<=t;n++)r[n]=K return new e(r,null,null,null)} var t=e.prototype return t.init=function(e){var t=e.self return this.slots[0]=t,this},t.getSelf=function(){return this.get(0)},t.getSymbol=function(e){return this.get(e)},t.getBlock=function(e){var t=this.get(e) return t===K?null:t},t.getEvalScope=function(){return this.evalScope},t.getPartialMap=function(){return this.partialMap},t.bind=function(e,t){this.set(e,t)},t.bindSelf=function(e){this.set(0,e)},t.bindSymbol=function(e,t){this.set(e,t)},t.bindBlock=function(e,t){this.set(e,t)},t.bindEvalScope=function(e){this.evalScope=e},t.bindPartialMap=function(e){this.partialMap=e},t.bindCallerScope=function(e){this.callerScope=e},t.getCallerScope=function(){return this.callerScope},t.child=function(){return new e(this.slots.slice(),this.callerScope,this.evalScope,this.partialMap)},t.get=function(e){if(e>=this.slots.length)throw new RangeError("BUG: cannot get $"+e+" from scope; length="+this.slots.length) return this.slots[e]},t.set=function(e,t){if(e>=this.slots.length)throw new RangeError("BUG: cannot get $"+e+" from scope; length="+this.slots.length) this.slots[e]=t},e}() e.ScopeImpl=Me var Ae=(0,r.symbol)("TRANSACTION"),je=function(){function e(){this.scheduledInstallManagers=[],this.scheduledInstallModifiers=[],this.scheduledUpdateModifierManagers=[],this.scheduledUpdateModifiers=[],this.createdComponents=[],this.createdManagers=[],this.updatedComponents=[],this.updatedManagers=[],this.destructors=[]}var t=e.prototype return t.didCreate=function(e,t){this.createdComponents.push(e),this.createdManagers.push(t)},t.didUpdate=function(e,t){this.updatedComponents.push(e),this.updatedManagers.push(t)},t.scheduleInstallModifier=function(e,t){this.scheduledInstallModifiers.push(e),this.scheduledInstallManagers.push(t)},t.scheduleUpdateModifier=function(e,t){this.scheduledUpdateModifiers.push(e),this.scheduledUpdateModifierManagers.push(t)},t.willDestroy=function(e){e[r.WILL_DROP]()},t.didDestroy=function(e){this.destructors.push(e)},t.commit=function(){for(var e=this.createdComponents,t=this.createdManagers,n=0;n0?e.join(""):null},r}(n.CachedReference) function Ye(e){return"function"!=typeof e.toString?"":String(e)}function Ke(e){return e===K}function Je(e){return 0|(e.dynamicLayout?1:0)|(e.dynamicTag?2:0)|(e.prepareArgs?4:0)|(e.createArgs?8:0)|(e.attributeHook?16:0)|(e.elementHook?32:0)|(e.dynamicScope?64:0)|(e.createCaller?128:0)|(e.updateHook?256:0)|(e.createInstance?512:0)|(e.wrapped?1024:0)|(e.willDestroy?2048:0)}function $e(e,t,r){return!!(t&r)}function Ze(e,t){return!!(e&t)}ze.add(16,(function(e,t){var r=t.op1,n=e.stack,i=e.runtime.resolver.resolve(r)(n.pop(),e) e.loadValue(o.$v0,i)})),ze.add(22,(function(e,t){var r=t.op1,n=e.referenceForSymbol(r) e.stack.push(n)})),ze.add(19,(function(e,t){var r=t.op1,n=e.stack.pop() e.scope().bindSymbol(r,n)})),ze.add(21,(function(e,t){var r=t.op1,n=e.stack.pop(),i=e.stack.pop(),o=e.stack.pop(),a=o?[n,i,o]:null e.scope().bindBlock(r,a)}),"jit"),ze.add(20,(function(e,t){var r=t.op1,n=e.stack.pop(),i=e.stack.pop(),o=e.stack.pop(),a=o?[n,i,o]:null e.scope().bindBlock(r,a)})),ze.add(105,(function(e,t){var r=t.op1,n=e[d].getString(r),i=e.scope().getPartialMap()[n] void 0===i&&(i=e.getSelf().get(n)),e.stack.push(i)})),ze.add(37,(function(e,t){var r=t.op1 e.pushRootScope(r)})),ze.add(23,(function(e,t){var r=t.op1,n=e[d].getString(r),i=e.stack.pop() e.stack.push(i.get(n))})),ze.add(24,(function(e,t){var r=t.op1,n=e.stack,i=e.scope().getBlock(r) n.push(i)})),ze.add(25,(function(e){var t=e.stack,r=t.pop() r&&!Ke(r)?(t.push(r[2]),t.push(r[1]),t.push(r[0])):(t.push(null),t.push(null),t.push(null))})),ze.add(26,(function(e){var t=e.stack,r=t.pop() r&&!Ke(r)?t.push($):t.push(Z)})),ze.add(27,(function(e){e.stack.pop(),e.stack.pop() var t=e.stack.pop(),r=t&&t.parameters.length e.stack.push(r?$:Z)})),ze.add(28,(function(e,t){for(var r=t.op1,n=new Array(r),i=r;i>0;i--){n[i-1]=e.stack.pop()}e.stack.push(new Ge(n))})) var Qe=(0,r.symbol)("CURRIED COMPONENT DEFINITION") function Xe(e){return!(!e||!e[Qe])}var et=function(){function e(e,t){this.inner=e,this.args=t,this[We]=!0}return e.prototype.unwrap=function(e){e.realloc(this.offset) for(var t=this;;){var r=t,n=r.args,i=r.inner if(n&&(e.positional.prepend(n.positional),e.named.merge(n.named)),!Xe(i))return i t=i}},(0,t.createClass)(e,[{key:"offset",get:function(){var e=this.inner,t=this.args,r=t?t.positional.length:0 return Xe(e)?r+e.offset:r}}]),e}() function tt(e,t,r){return e.lookupComponent(t,r)}e.CurriedComponentDefinition=et,We=Qe var rt=function(){function e(e){this.list=e,this.tag=He(e),this.list=e}return e.prototype.value=function(){for(var e=[],t=this.list,r=0;r-1073741825?e[d].getString((0,r.decodeHandle)(i,-1)):e[d].getNumber((0,r.decodeHandle)(i,-1073741825)),o.pushJs(n)):o.pushRaw(i)})),ze.add(31,(function(e){var t=e.stack t.push(W.create(t.pop()))})),ze.add(32,(function(e){var t=e.stack t.push(t.peek().value())})),ze.add(33,(function(e,t){var r=t.op1,n=t.op2,i=e.fetchValue(r)-n e.stack.dup(i)})),ze.add(34,(function(e,t){var r=t.op1 e.stack.pop(r)})),ze.add(35,(function(e,t){var r=t.op1 e.load(r)})),ze.add(36,(function(e,t){var r=t.op1 e.fetch(r)})),ze.add(58,(function(e,t){var r=t.op1,n=e[d].getArray(r) e.bindDynamicScope(n)})),ze.add(69,(function(e,t){var r=t.op1 e.enter(r)})),ze.add(70,(function(e){e.exit()})),ze.add(63,(function(e,t){var r=t.op1 e.stack.push(e[d].getSerializable(r))})),ze.add(62,(function(e){e.stack.push(e.scope())})),ze.add(61,(function(e){var t=e.stack,r=t.pop() r?t.push(e.compile(r)):t.push(null)}),"jit"),ze.add(64,(function(e){var t=e.stack,r=t.pop(),n=t.pop(),i=t.pop(),o=t.pop() if(null===i)return e.pushFrame(),void e.pushScope(n) var a=n,s=i.parameters,u=s.length if(u>0){a=a.child() for(var c=0;c>4,c=8&o,l=7&o?e[d].getStringArray(i):r.EMPTY_ARRAY e[p].setup(a,s,l,u,!!c),a.push(e[p])})),ze.add(85,(function(e){var t=e.stack t.push(e[p].empty(t))})),ze.add(88,(function(e){var t=e.stack,r=t.pop().capture() t.push(r)})),ze.add(87,(function(e,t){var r=t.op1,n=e.stack,i=e.fetchValue(r),o=n.pop(),a=i.definition Xe(a)&&(a=function(e,t,r){var n=e.definition=t.unwrap(r),i=n.manager,o=n.state return e.manager=i,e.capabilities=Je(i.getCapabilities(o)),n}(i,a,o)) var s=a,u=s.manager,c=s.state if($e(0,i.capabilities,4)){var l=o.blocks.values,f=o.blocks.names,h=u.prepareArgs(c,o) if(h){o.clear() for(var d=0;d=0;s--){var u=a[s],c=n.table.symbols.indexOf(a[s]),l=o.named.get(u,!0);-1!==c&&i.bindSymbol(c+1,l),n.lookup&&(n.lookup[u]=l)}})),ze.add(18,(function(e,t){for(var r=t.op1,n=e.fetchValue(r),i=e.stack.peek().blocks,o=0;o)` to debug this template."),t("this")}var kt=_t var xt=function(){function e(e,t,n){this.scope=e,this.locals=(0,r.dict)() for(var i=0;i0&&null!==t){for(var r=this.positional,n=this.named,i=r.base+e,a=r.length+n.length-1;a>=0;a--)t.copy(a+r.base,a+i) r.base+=e,n.base+=e,t[f][o.$sp]+=e}},r.capture=function(){var e=0===this.positional.length?Ut:this.positional.capture(),t=0===this.named.length?Ft:this.named.capture() return new Lt(this.tag,e,t,this.length)},r.clear=function(){var e=this.stack,t=this.length t>0&&null!==e&&e.pop(t)},(0,t.createClass)(e,[{key:"tag",get:function(){return He([this.positional,this.named])}},{key:"base",get:function(){return this.blocks.base}},{key:"length",get:function(){return this.positional.length+this.named.length+3*this.blocks.length}}]),e}(),Rt=function(){function e(){this.base=0,this.length=0,this.stack=null,this._tag=null,this._references=null}var n=e.prototype return n.empty=function(e,t){this.stack=e,this.base=t,this.length=0,this._tag=a.CONSTANT_TAG,this._references=r.EMPTY_ARRAY},n.setup=function(e,t,n){this.stack=e,this.base=t,this.length=n,0===n?(this._tag=a.CONSTANT_TAG,this._references=r.EMPTY_ARRAY):(this._tag=null,this._references=null)},n.at=function(e){var t=this.base,r=this.length,n=this.stack return e<0||e>=r?K:n.get(e,t)},n.capture=function(){return new Tt(this.tag,this.references)},n.prepend=function(e){var t=e.length if(t>0){var r=this.base,n=this.length,i=this.stack this.base=r-=t,this.length=n+t for(var o=0;o=r?K:t[n]},t.valueOf=function(e){return e.value()},e}() e.CapturedPositionalArgumentsImpl=Tt var Ct=function(){function e(){this.base=0,this.length=0,this._references=null,this._names=r.EMPTY_ARRAY,this._atNames=r.EMPTY_ARRAY}var n=e.prototype return n.empty=function(e,t){this.stack=e,this.base=t,this.length=0,this._references=r.EMPTY_ARRAY,this._names=r.EMPTY_ARRAY,this._atNames=r.EMPTY_ARRAY},n.setup=function(e,t,n,i,o){this.stack=e,this.base=t,this.length=n,0===n?(this._references=r.EMPTY_ARRAY,this._names=r.EMPTY_ARRAY,this._atNames=r.EMPTY_ARRAY):(this._references=null,o?(this._names=null,this._atNames=i):(this._names=i,this._atNames=null))},n.has=function(e){return-1!==this.names.indexOf(e)},n.get=function(e,t){void 0===t&&(t=!1) var r=this.base,n=this.stack,i=(t?this.atNames:this.names).indexOf(e) return-1===i?K:n.get(i,r)},n.capture=function(){return new It(this.tag,this.names,this.references)},n.merge=function(e){var t=e.length if(t>0){var r=this.names,n=this.length,i=this.stack,o=e.names Object.isFrozen(r)&&0===r.length&&(r=[]) for(var a=0;a=0;r--){var n=this[d].getString(e[r]) t.set(n,this.stack.pop())}},(0,t.createClass)(e,[{key:"stack",get:function(){return this[u].stack}},{key:"pc",get:function(){return this[u].fetchRegister(o.$pc)}},{key:"program",get:function(){return this.runtime.program}},{key:"env",get:function(){return this.runtime.env}}]),e}() function nr(e,t,r){return void 0===t&&(t=Me.root(K,0)),{pc:e,scope:t,dynamicScope:r,stack:[]}}e.LowLevelVM=rr,Vt=l,Wt=c var ir=function(e){function r(){return e.apply(this,arguments)||this}return(0,t.inheritsLoose)(r,e),r.empty=function(e,t){var r=t.handle,n=t.treeBuilder,i=t.dynamicScope,o=or(e,nr(e.program.heap.getaddr(r),Me.root(K,0),i),n) return o.pushUpdating(),o},r.initial=function(e,t){var r=t.handle,n=t.self,i=t.treeBuilder,o=t.dynamicScope,a=e.program.heap.scopesizeof(r),s=Me.root(n,a),u=e.program.heap.getaddr(r),c=or(e,nr(u,s,o),i) return c.pushUpdating(),c},r.prototype.capture=function(e,t){return void 0===t&&(t=this[u].fetchRegister(o.$pc)),new Gt(this.captureState(e,t),or)},r}(rr) function or(e,t,r){return new ir(e,t,r)}function ar(e){return function(t,r,n){return new sr(t,r,n,e)}}var sr=function(e){function n(t,r,n,i){var o return(o=e.call(this,t,r,n)||this).context=i,o.resume=ar(o.context),o}(0,t.inheritsLoose)(n,e),n.initial=function(e,t,r){var n=r.handle,i=r.self,o=r.dynamicScope,a=r.treeBuilder,s=e.program.heap.scopesizeof(n),u=Me.root(i,s),c=nr(e.program.heap.getaddr(n),u,o),l=ar(t)(e,c,a) return l.pushUpdating(),l},n.empty=function(e,t,r){var n=t.handle,i=t.treeBuilder,o=t.dynamicScope,a=ar(r)(e,nr(e.program.heap.getaddr(n),Me.root(K,0),o),i) return a.pushUpdating(),a} var i=n.prototype return i.capture=function(e,t){return void 0===t&&(t=this[u].fetchRegister(o.$pc)),new Gt(this.captureState(e,t),this.resume)},i.compile=function(e){return(0,r.unwrapHandle)(e.compile(this.context))},n}(rr),ur=function(){function e(e){this.vm=e}var t=e.prototype return t.next=function(){return this.vm.next()},t.sync=function(){return cr(this.vm.runtime.env,this)},e}() function cr(e,t){var r e.begin() do{r=t.next()}while(!r.done) var n=r.value return e.commit(),n}function lr(e,t,r,n){var i=Object.keys(n).map((function(e){return[e,n[e]]})),o=["main","else","attrs"],a=i.map((function(e){return"@"+e[0]})) e.pushFrame() for(var s=0;s<3*o.length;s++)e.stack.push(null) return e.stack.push(null),i.forEach((function(t){var r=t[1] e.stack.push(r)})),e[p].setup(e.stack,a,o,0,!0),e.stack.push(e[p]),e.stack.push(t),e.stack.push(r),new ur(e)}function fr(e){return"%+b:0%"===e.nodeValue}e.SERIALIZATION_FIRST_NODE_STRING="%+b:0%" var hr=function(e){function r(t,r,n){var i return(i=e.call(this,t,r)||this).startingBlockDepth=n,i.candidate=null,i.injectedOmittedNode=!1,i.openBlockDepth=n-1,i}return(0,t.inheritsLoose)(r,e),r}(m),dr=function(e){function r(t,r,n){var i if((i=e.call(this,t,r,n)||this).unmatchedAttributes=null,i.blockDepth=0,n)throw new Error("Rehydration with nextSibling not supported") for(var o=i.currentCursor.element.firstChild;!(null===o||pr(o)&&fr(o));)o=o.nextSibling return i.candidate=o,i}(0,t.inheritsLoose)(r,e) var n=r.prototype return n.disableRehydration=function(e){var t=this.currentCursor t.candidate=null,t.nextSibling=e},n.enableRehydration=function(e){var t=this.currentCursor t.candidate=e,t.nextSibling=null},n.pushElement=function(e,t){void 0===t&&(t=null) var r=new hr(e,t,this.blockDepth||0) null!==this.candidate&&(r.candidate=e.firstChild,this.candidate=e.nextSibling),this[P].push(r)},n.clearMismatch=function(e){var t=e,r=this.currentCursor if(null!==r){var n=r.openBlockDepth if(n>=r.startingBlockDepth)for(;t;){if(mr(t))if(n>=vr(t))break t=this.remove(t)}else for(;null!==t;)t=this.remove(t) this.disableRehydration(t)}},n.__openBlock=function(){var e=this.currentCursor if(null!==e){var t=this.blockDepth this.blockDepth++ var r=e.candidate if(null!==r){var n,i=e.element.tagName 8===(n=r).nodeType&&0===n.nodeValue.lastIndexOf("%+b:",0)&&vr(r)===t?(this.candidate=this.remove(r),e.openBlockDepth=t):"TITLE"!==i&&"SCRIPT"!==i&&"STYLE"!==i&&this.clearMismatch(r)}}},n.__closeBlock=function(){var e=this.currentCursor if(null!==e){var t=e.openBlockDepth this.blockDepth-- var r=e.candidate,n=!1 if(null!==r)if(n=!0,mr(r)&&vr(r)===t){var i=this.remove(r) this.candidate=i,e.openBlockDepth--}else this.clearMismatch(r),n=!1 if(!1===n){var o=e.nextSibling if(null!==o&&mr(o)&&vr(o)===this.blockDepth){var a=this.remove(o) this.enableRehydration(a),e.openBlockDepth--}}}},n.__appendNode=function(t){var r=this.candidate return r||e.prototype.__appendNode.call(this,t)},n.__appendHTML=function(t){var r=this.markerBounds() if(r){var n=r.firstNode(),i=r.lastNode(),o=new v(this.element,n.nextSibling,i.previousSibling),a=this.remove(n) return this.remove(i),null!==a&&gr(a)&&(this.candidate=this.remove(a),null!==this.candidate&&this.clearMismatch(this.candidate)),o}return e.prototype.__appendHTML.call(this,t)},n.remove=function(e){var t=e.parentNode,r=e.nextSibling return t.removeChild(e),r},n.markerBounds=function(){var e=this.candidate if(e&&br(e)){for(var t=e,r=t.nextSibling;r&&!br(r);)r=r.nextSibling return new v(this.element,t,r)}return null},n.__appendText=function(t){var r=this.candidate return r?3===r.nodeType?(r.nodeValue!==t&&(r.nodeValue=t),this.candidate=r.nextSibling,r):function(e){return 8===e.nodeType&&"%|%"===e.nodeValue}(r)||gr(r)&&""===t?(this.candidate=this.remove(r),this.__appendText(t)):(this.clearMismatch(r),e.prototype.__appendText.call(this,t)):e.prototype.__appendText.call(this,t)},n.__appendComment=function(t){var r=this.candidate return r&&pr(r)?(r.nodeValue!==t&&(r.nodeValue=t),this.candidate=r.nextSibling,r):(r&&this.clearMismatch(r),e.prototype.__appendComment.call(this,t))},n.__openElement=function(t){var r=this.candidate if(r&&yr(r)&&function(e,t){if("http://www.w3.org/2000/svg"===e.namespaceURI)return e.tagName===t return e.tagName===t.toUpperCase()}(r,t))return this.unmatchedAttributes=[].slice.call(r.attributes),r if(r){if(yr(r)&&"TBODY"===r.tagName)return this.pushElement(r,null),this.currentCursor.injectedOmittedNode=!0,this.__openElement(t) this.clearMismatch(r)}return e.prototype.__openElement.call(this,t)},n.__setAttribute=function(t,r,n){var i=this.unmatchedAttributes if(i){var o=wr(i,t) if(o)return o.value!==r&&(o.value=r),void i.splice(i.indexOf(o),1)}return e.prototype.__setAttribute.call(this,t,r,n)},n.__setProperty=function(t,r){var n=this.unmatchedAttributes if(n){var i=wr(n,t) if(i)return i.value!==r&&(i.value=r),void n.splice(n.indexOf(i),1)}return e.prototype.__setProperty.call(this,t,r)},n.__flushElement=function(t,r){var n=this.unmatchedAttributes if(n){for(var i=0;i1073741823)switch(e){case 1073741824:return!1 case 1073741825:return!0 case 1073741826:return null case 1073741827:return default:return 1073741827-e}return e},e.deprecate=function(e){console.warn("DEPRECATION: "+e)},e.destructor=x,e.dict=a,e.didDestroyAssociated=k,e.encodeHandle=function(e,t,r){void 0===t&&(t=2147483647) void 0===r&&(r=-1) if(e>t)throw new Error("index "+e+" overflowed range 0 to "+t) return r-e},e.encodeImmediate=function(e){if("number"==typeof e)return e<0?1073741827-e:e if(!1===e)return 1073741824 if(!0===e)return 1073741825 if(null===e)return 1073741826 if(void 0===e)return 1073741827 return c(e)},e.ensureGuid=o,e.exhausted=c,e.expect=function(e,t){if(null==e)throw new Error(t) return e},e.extractHandle=function(e){return"number"==typeof e?e:e.handle},e.fillNulls=function(e){for(var t=new Array(e),r=0;r=t&&e<=r}(e,-1073741820,1073741823)},e.isStringDestroyable=d,e.keys=function(e){return Object.keys(e)},e.peekAssociated=function(e){return p.get(e)||null},e.printDrop=A,e.printDropTree=function(e){A(x(e))},e.snapshot=function(e){return new O(e)},e.strip=function(e){for(var r="",n=arguments.length,i=new Array(n>1?n-1:0),o=1;o0?(p.delete(e),t):null},e.tuple=void 0,e.unreachable=function(e){void 0===e&&(e="unreachable") return new Error(e)},e.unwrap=function(e){if(null==e)throw new Error("Expected value to be present") return e},e.unwrapHandle=function(e){if("number"==typeof e)return e var t=e.errors[0] throw new Error("Compile Error: "+t.problem+" @ "+t.span.start+".."+t.span.end)},e.unwrapTemplate=function(e){if("error"===e.result)throw new Error("Compile Error: "+e.problem+" @ "+e.span.start+".."+e.span.end) return e},e.values=function(e){var t=[] for(var r in e)t.push(e[r]) return t},e.willDestroyAssociated=_ var r=Object.freeze([]) e.EMPTY_ARRAY=r var n=0 function i(e){return e._guid=++n}function o(e){return e._guid||i(e)}function a(){return Object.create(null)}var s=function(){function e(){this.dict=a()}var t=e.prototype return t.add=function(e){return"string"==typeof e?this.dict[e]=e:this.dict[o(e)]=e,this},t.delete=function(e){"string"==typeof e?delete this.dict[e]:e._guid&&delete this.dict[e._guid]},e}() e.DictSet=s var u=function(){function e(){this.stack=[],this.current=null}var r=e.prototype return r.push=function(e){this.current=e,this.stack.push(e)},r.pop=function(){var e=this.stack.pop(),t=this.stack.length return this.current=0===t?null:this.stack[t-1],void 0===e?null:e},r.nth=function(e){var t=this.stack.length return t=e[s]()}e.COMPUTE=s var l,f=o("TAG_TYPE") e.ALLOW_CYCLES=l var h=function(){function e(e){this.revision=1,this.lastChecked=1,this.lastValue=1,this.isUpdating=!1,this.subtags=null,this.subtag=null,this.subtagBufferCache=null,this[f]=e}return e.prototype[s]=function(){var e=this.lastChecked if(!0===this.isUpdating)this.lastChecked=++a else if(e!==a){this.isUpdating=!0,this.lastChecked=a try{var t=this.subtags,r=this.subtag,n=this.subtagBufferCache,i=this.lastValue,o=this.revision if(null!==r){var u=r[s]() u===n?o=Math.max(o,i):(this.subtagBufferCache=null,o=Math.max(o,u))}if(null!==t)for(var c=0;c=0&&e<=15},e.isOp=function(e){return e>=16} e.$pc=0 e.$ra=1 e.$fp=2 e.$sp=3 e.$s0=4 e.$s1=5 e.$t0=6 e.$t1=7 var t,r e.$v0=8,e.SavedRegister=t,function(e){e[e.s0=4]="s0",e[e.s1=5]="s1"}(t||(e.SavedRegister=t={})),e.TemporaryRegister=r,function(e){e[e.t0=6]="t0",e[e.t1=7]="t1"}(r||(e.TemporaryRegister=r={}))})),e("@glimmer/wire-format",["exports"],(function(e){"use strict" function t(e){return function(t){return Array.isArray(t)&&t[0]===e}}Object.defineProperty(e,"__esModule",{value:!0}),e.is=t,e.isArgument=function(e){return 21===e[0]||20===e[0]},e.isAttribute=function(e){return 14===e[0]||15===e[0]||22===e[0]||16===e[0]||24===e[0]||23===e[0]||17===e[0]||4===e[0]},e.isGet=e.isFlushElement=void 0,e.isHelper=function(e){return Array.isArray(e)&&30===e[0]} var r=t(12) e.isFlushElement=r var n=t(32) e.isGet=n})),e("@simple-dom/document",["exports","ember-babel"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var r=[] function n(e,t,r){for(var n=0;n=t[r=i+(n=(o-i)/6)-n%6]?i=r+6:o=r return e>=t[i]?i+6:i}var d=function(){function e(e,t,r){void 0===t&&(t={}),void 0===r&&(r={}),this._queueBeingFlushed=[],this.targetQueues=new Map,this.index=0,this._queue=[],this.name=e,this.options=t,this.globalOptions=r}var t=e.prototype return t.stackFor=function(e){if(e0){var s=u(this.globalOptions) r=s?this.invokeWithOnError:this.invoke for(var c=this.index;c0&&this.flush(!0)},t.hasWork=function(){return this._queueBeingFlushed.length>0||this._queue.length>0},t.cancel=function(e){var t=e.target,r=e.method,n=this._queue,i=this.targetQueues.get(t) void 0!==i&&i.delete(r) var o=c(t,r,n) return o>-1?(n.splice(o,4),!0):(o=c(t,r,n=this._queueBeingFlushed))>-1&&(n[o+1]=null,!0)},t.push=function(e,t,r,n){return this._queue.push(e,t,r,n),{queue:this,target:e,method:t}},t.pushUnique=function(e,t,r,n){var i=this.targetQueues.get(e) void 0===i&&(i=new Map,this.targetQueues.set(e,i)) var o=i.get(t) if(void 0===o){var a=this._queue.push(e,t,r,n)-4 i.set(t,a)}else{var s=this._queue s[o+2]=r,s[o+3]=n}return{queue:this,target:e,method:t}},t._getDebugInfo=function(e){if(e)return f(this._queue,4)},t.invoke=function(e,t,r){void 0===r?t.call(e):t.apply(e,r)},t.invokeWithOnError=function(e,t,r,n,i){try{void 0===r?t.call(e):t.apply(e,r)}catch(o){n(o,i)}},e}(),p=function(){function e(e,t){void 0===e&&(e=[]),this.queues={},this.queueNameIndex=0,this.queueNames=e,e.reduce((function(e,r){return e[r]=new d(r,t[r],t),e}),this.queues)}var t=e.prototype return t.schedule=function(e,t,r,n,i,o){var a=this.queues[e] if(void 0===a)throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist") if(null==r)throw new Error("You attempted to schedule an action in a queue ("+e+") for a method that doesn't exist") return this.queueNameIndex=0,i?a.pushUnique(t,r,n,o):a.push(t,r,n,o)},t.flush=function(e){var t,r void 0===e&&(e=!1) for(var n=this.queueNames.length;this.queueNameIndexi){var u=n-i e=new Array(u) for(var c=0;c0){var a=n[o-1] s(a)&&(i=parseInt(n.pop(),10))}return[t,r,n,i]}function w(){var e,t,r,n,i if(2===arguments.length)t=arguments[0],i=arguments[1],e=null else{var o=b.apply(void 0,arguments) e=o[0],t=o[1],void 0===(n=o[2])?i=0:s(i=n.pop())||(r=!0===i,i=n.pop())}return[e,t,n,i=parseInt(i,10),r]}var _=0,k=0,x=0,O=0,E=0,S=0,P=0,M=0,A=0,j=0,R=0,T=0,C=0,I=0,N=0,D=0,B=0,L=0,F=0,U=0,z=0,q=function(){function e(e,t){var r=this this.DEBUG=!1,this.currentInstance=null,this.instanceStack=[],this._eventCallbacks={end:[],begin:[]},this._timerTimeoutId=null,this._timers=[],this._autorun=!1,this._autorunStack=null,this.queueNames=e,this.options=t||{},"string"==typeof this.options.defaultQueue?this._defaultQueue=this.options.defaultQueue:this._defaultQueue=this.queueNames[0],this._onBegin=this.options.onBegin||v,this._onEnd=this.options.onEnd||v,this._boundRunExpiredTimers=this._runExpiredTimers.bind(this),this._boundAutorunEnd=function(){F++,!1!==r._autorun&&(r._autorun=!1,r._autorunStack=null,r._end(!0))} var n=this.options._buildPlatform||o this._platform=n(this._boundAutorunEnd)}var r=e.prototype return r.begin=function(){k++ var e,t=this.options,r=this.currentInstance return!1!==this._autorun?(e=r,this._cancelAutorun()):(null!==r&&(z++,this.instanceStack.push(r)),U++,e=this.currentInstance=new p(this.queueNames,t),O++,this._trigger("begin",e,r)),this._onBegin(e,r),e},r.end=function(){x++,this._end(!1)},r.on=function(e,t){if("function"!=typeof t)throw new TypeError("Callback must be a function") var r=this._eventCallbacks[e] if(void 0===r)throw new TypeError("Cannot on() event "+e+" because it does not exist") r.push(t)},r.off=function(e,t){var r=this._eventCallbacks[e] if(!e||void 0===r)throw new TypeError("Cannot off() event "+e+" because it does not exist") var n=!1 if(t)for(var i=0;i3?n-3:0),o=3;o1?t-1:0),n=1;n3?n-3:0),o=3;o1?t-1:0),n=1;n0||this._autorun},r.cancel=function(e){if(B++,null==e)return!1 var t=typeof e return"number"===t?this._cancelLaterTimer(e):!("object"!==t||!e.queue||!e.method)&&e.queue.cancel(e)},r.ensureInstance=function(){this._ensureInstance()},r.getDebugInfo=function(){var e=this if(this.DEBUG)return{autorun:this._autorunStack,counters:this.counters,timers:f(this._timers,6,2),instanceStack:[this.currentInstance].concat(this.instanceStack).map((function(t){return t&&t._getDebugInfo(e.DEBUG)}))}},r._end=function(e){var t=this.currentInstance,r=null if(null===t)throw new Error("end called without begin") var n,i=!1 try{n=t.flush(e)}finally{if(!i)if(i=!0,1===n){var o=this.queueNames[t.queueNameIndex] this._scheduleAutorun(o)}else this.currentInstance=null,this.instanceStack.length>0&&(r=this.instanceStack.pop(),this.currentInstance=r),this._trigger("end",t,r),this._onEnd(t,r)}},r._join=function(e,t,r){return null===this.currentInstance?this._run(e,t,r):void 0===e&&void 0===r?t():t.apply(e,r)},r._run=function(e,t,r){var n=u(this.options) if(this.begin(),n)try{return t.apply(e,r)}catch(i){n(i)}finally{this.end()}else try{return t.apply(e,r)}finally{this.end()}},r._cancelAutorun=function(){this._autorun&&(this._platform.clearNext(),this._autorun=!1,this._autorunStack=null)},r._later=function(e,t,r,n){var i=this.DEBUG?new Error:void 0,o=this._platform.now()+n,a=_++ if(0===this._timers.length)this._timers.push(o,a,e,t,r,i),this._installTimerTimeout() else{var s=h(o,this._timers) this._timers.splice(s,0,o,a,e,t,r,i),this._reinstallTimerTimeout()}return a},r._cancelLaterTimer=function(e){for(var t=1;t0&&(this.begin(),this._scheduleExpiredTimers(),this.end())},r._scheduleExpiredTimers=function(){for(var e=this._timers,t=0,r=e.length,n=this._defaultQueue,i=this._platform.now();ti)break var o=e[t+4] if(o!==y){var a=e[t+2],s=e[t+3],u=e[t+5] this.currentInstance.schedule(n,a,s,o,!1,u)}}e.splice(0,t),this._installTimerTimeout()},r._reinstallTimerTimeout=function(){this._clearTimerTimeout(),this._installTimerTimeout()},r._clearTimerTimeout=function(){null!==this._timerTimeoutId&&(this._platform.clearTimeout(this._timerTimeoutId),this._timerTimeoutId=null)},r._installTimerTimeout=function(){if(0!==this._timers.length){var e=this._timers[0],t=this._platform.now(),r=Math.max(0,e-t) this._timerTimeoutId=this._platform.setTimeout(this._boundRunExpiredTimers,r)}},r._ensureInstance=function(){var e=this.currentInstance return null===e&&(this._autorunStack=this.DEBUG?new Error:void 0,e=this.begin(),this._scheduleAutorun(this.queueNames[0])),e},r._scheduleAutorun=function(e){L++ var t=this._platform.next,r=this.options.flush r?r(e,t):t(),this._autorun=!0},(0,t.createClass)(e,[{key:"counters",get:function(){return{begin:k,end:x,events:{begin:O,end:0},autoruns:{created:L,completed:F},run:E,join:S,defer:P,schedule:M,scheduleIterable:A,deferOnce:j,scheduleOnce:R,setTimeout:T,later:C,throttle:I,debounce:N,cancelTimers:D,cancel:B,loops:{total:U,nested:z}}}},{key:"defaultQueue",get:function(){return this._defaultQueue}}]),e}() q.Queue=d,q.buildPlatform=o,q.buildNext=i var H=q e.default=H})),e("dag-map",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=function(){function e(){this._vertices=new r}return e.prototype.add=function(e,t,r,n){if(!e)throw new Error("argument `key` is required") var i=this._vertices,o=i.add(e) if(o.val=t,r)if("string"==typeof r)i.addEdge(o,i.add(r)) else for(var a=0;a0){var n="cycle detected: "+t throw this.each(this.path,(function(e){n+=" <- "+e})),new Error(n)}}},e.prototype.reset=function(){this.stack.length=0,this.path.length=0,this.result.length=0 for(var e=0,t=this.length;e=0){var a=this[o] if(a.flag)continue if(a.flag=!0,n.push(o),t===a.key)break r.push(~o),this.pushIncoming(a)}else n.pop(),i.push(~o)}},e.prototype.pushIncoming=function(e){for(var t=this.stack,r=e.length-1;r>=0;r--){var n=e[r] this[n].flag||t.push(n)}},e.prototype.each=function(e,t){for(var r=0,n=e.length;r=e.length?{done:!0}:{done:!1,value:e[t++]}} throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)},e.createSuper=function(e){return function(){var t,i=r(e) if(n){var o=r(this).constructor t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments) return s(this,t)}},e.inheritsLoose=function(e,r){0 e.prototype=Object.create(null===r?null:r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),null!==r&&t(e,r)},e.objectDestructuringEmpty=function(e){0},e.possibleConstructorReturn=s,e.taggedTemplateLiteralLoose=function(e,t){t||(t=e.slice(0)) return e.raw=t,e},e.wrapNativeSuper=function(e){if(i.has(e))return i.get(e) function r(){}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i.set(e,r),t(r,e)} var t=Object.setPrototypeOf,r=Object.getPrototypeOf,n="object"==typeof Reflect&&"function"==typeof Reflect.construct,i=new Map function o(e,t){for(var r=0;re.length)&&(t=e.length) for(var r=new Array(t),n=0;n0&&47===t.charCodeAt(0)&&(t=t.substr(1)) for(var n=t.split("/"),i=void 0,o=void 0,a=0;a2&&"[]"===o.slice(a-2)&&(s=!0,r[o=o.slice(0,a-2)]||(r[o]=[])),u=i[1]?P(i[1]):""),s?r[o].push(u):r[o]=u}return r},M.prototype.recognize=function(e){var t,r=[this.rootState],n={},i=!1,o=e.indexOf("#");-1!==o&&(e=e.substr(0,o)) var a=e.indexOf("?") if(-1!==a){var u=e.substr(a+1,e.length) e=e.substr(0,a),n=this.parseQueryString(u)}"/"!==e.charAt(0)&&(e="/"+e) var c=e M.ENCODE_AND_DECODE_PATH_SEGMENTS?e=s(e):(e=decodeURI(e),c=decodeURI(c)) var l=e.length l>1&&"/"===e.charAt(l-1)&&(e=e.substr(0,l-1),c=c.substr(0,c.length-1),i=!0) for(var f=0;f0){var n=e[r-1] if(function(e){return e&&s.call(e,"queryParams")}(n))return t=n.queryParams,[a.call(e,0,r-1),t]}return[e,null]}function l(e){for(var t in e){var r=e[t] if("number"==typeof r)e[t]=""+r else if(Array.isArray(r))for(var n=0,i=r.length;n1?t-1:0),n=1;n2?r-2:0),i=2;io;o++)if(n=x.get(e[o]),t.call(r,n,o,i))return n},get name(){return a},get paramNames(){return u},get metadata(){return S(i.route)},get parent(){var t=e[o-1] return void 0===t?null:x.get(t)},get child(){var t=e[o+1] return void 0===t?null:x.get(t)},get localName(){var e=this.name.split(".") return e[e.length-1]},get params(){return s},get queryParams(){return r}} return n&&(d=E(d,c)),x.set(i,d),d}))}function E(e,r){var n={get attributes(){return r}} return Object.isFrozen(e)||e.hasOwnProperty("attributes")?Object.freeze((0,t.assign)({},e,n)):(0,t.assign)(e,n)}function S(e){return null!=e&&void 0!==e.buildRouteInfoMetadata?e.buildRouteInfoMetadata():null}var P=function(){function e(e,t,r,n){this._routePromise=void 0,this._route=null,this.params={},this.isResolved=!1,this.name=t,this.paramNames=r,this.router=e,n&&this._processRoute(n)}var t=e.prototype return t.getModel=function(e){return n.Promise.resolve(this.context)},t.serialize=function(e){return this.params||{}},t.resolve=function(e,t){var r=this return n.Promise.resolve(this.routePromise).then((function(t){return r.checkForAbort(e,t)})).then((function(){return r.runBeforeModelHook(t)})).then((function(){return r.checkForAbort(e,null)})).then((function(){return r.getModel(t)})).then((function(t){return r.checkForAbort(e,t)})).then((function(e){return r.runAfterModelHook(t,e)})).then((function(e){return r.becomeResolved(t,e)}))},t.becomeResolved=function(e,t){var r,n=this.serialize(t) e&&(this.stashResolvedModel(e,t),e[b]=e[b]||{},e[b][this.name]=n) var i=t===this.context !("context"in this)&&i||(r=t) var o=x.get(this),a=new M(this.router,this.name,this.paramNames,n,this.route,r) return void 0!==o&&x.set(a,o),a},t.shouldSupercede=function(e){if(!e)return!0 var t=e.context===this.context return e.name!==this.name||"context"in this&&!t||this.hasOwnProperty("params")&&!function(e,t){if(!e!=!t)return!1 if(!e)return!0 for(var r in e)if(e.hasOwnProperty(r)&&e[r]!==t[r])return!1 return!0}(this.params,e.params)},t.log=function(e,t){e.log&&e.log(this.name+": "+t)},t.updateRoute=function(e){return e._internalName=this.name,this.route=e},t.runBeforeModelHook=function(e){var t return e.trigger&&e.trigger(!0,"willResolveModel",e,this.route),this.route&&void 0!==this.route.beforeModel&&(t=this.route.beforeModel(e)),k(t)&&(t=null),n.Promise.resolve(t)},t.runAfterModelHook=function(e,t){var r,i,o=this.name return this.stashResolvedModel(e,t),void 0!==this.route&&void 0!==this.route.afterModel&&(r=this.route.afterModel(t,e)),r=k(i=r)?null:i,n.Promise.resolve(r).then((function(){return e.resolvedModels[o]}))},t.checkForAbort=function(e,t){return n.Promise.resolve(e()).then((function(){return t}),null)},t.stashResolvedModel=function(e,t){e.resolvedModels=e.resolvedModels||{},e.resolvedModels[this.name]=t},t.fetchRoute=function(){var e=this.router.getRoute(this.name) return this._processRoute(e)},t._processRoute=function(e){var t,r=this return this.routePromise=n.Promise.resolve(e),null!==(t=e)&&"object"==typeof t&&"function"==typeof t.then?(this.routePromise=this.routePromise.then((function(e){return r.updateRoute(e)})),this.route=void 0):e?this.updateRoute(e):void 0},(0,r.createClass)(e,[{key:"route",get:function(){return null!==this._route?this._route:this.fetchRoute()},set:function(e){this._route=e}},{key:"routePromise",get:function(){return this._routePromise||this.fetchRoute(),this._routePromise},set:function(e){this._routePromise=e}}]),e}() e.InternalRouteInfo=P var M=function(e){function t(t,r,n,i,o,a){var s return(s=e.call(this,t,r,n,o)||this).params=i,s.isResolved=!0,s.context=a,s}return(0,r.inheritsLoose)(t,e),t.prototype.resolve=function(e,t){return t&&t.resolvedModels&&(t.resolvedModels[this.name]=this.context),n.Promise.resolve(this)},t}(P),A=function(e){function t(t,r,n,i,o){var a return(a=e.call(this,t,r,n,o)||this).params={},a.params=i,a}return(0,r.inheritsLoose)(t,e),t.prototype.getModel=function(e){var t=this.params e&&e[g]&&(u(t={},this.params),t.queryParams=e[g]) var r=this.route,i=void 0 return r.deserialize?i=r.deserialize(t,e):r.model&&(i=r.model(t,e)),i&&k(i)&&(i=void 0),n.Promise.resolve(i)},t}(P),j=function(e){function t(t,r,n,i){var o return(o=e.call(this,t,r,n)||this).context=i,o.serializer=o.router.getSerializer(r),o}(0,r.inheritsLoose)(t,e) var n=t.prototype return n.getModel=function(t){return void 0!==this.router.log&&this.router.log(this.name+": resolving provided model"),e.prototype.getModel.call(this,t)},n.serialize=function(e){var t=this.paramNames,r=this.context e||(e=r) var n={} if(h(e))return n[t[0]]=e,n if(this.serializer)return this.serializer.call(null,e,t) if(void 0!==this.route&&this.route.serialize)return this.route.serialize(e,t) if(1===t.length){var i=t[0] return/_id$/.test(i)?n[i]=e.id:n[i]=e,n}},t}(P) var R=function(e,t){void 0===t&&(t={}),this.router=e,this.data=t},T=function(){function e(){this.routeInfos=[],this.queryParams={},this.params={}}var t=e.prototype return t.promiseLabel=function(e){var t="" return d(this.routeInfos,(function(e){return""!==t&&(t+="."),t+=e.name,!0})),v("'"+t+"': "+e)},t.resolve=function(e,t){var r=this.params d(this.routeInfos,(function(e){return r[e.name]=e.params||{},!0})),t.resolveIndex=0 var i=this,o=!1 return n.Promise.resolve(null,this.promiseLabel("Start transition")).then(u,null,this.promiseLabel("Resolve route")).catch((function(e){var r=i.routeInfos,a=t.resolveIndex>=r.length?r.length-1:t.resolveIndex return n.Promise.reject(new C(e,i.routeInfos[a].route,o,i))}),this.promiseLabel("Handle error")) function a(){return n.Promise.resolve(e(),i.promiseLabel("Check if should continue")).catch((function(e){return o=!0,n.Promise.reject(e)}),i.promiseLabel("Handle abort"))}function s(e){var r=i.routeInfos[t.resolveIndex].isResolved if(i.routeInfos[t.resolveIndex++]=e,!r){var n=e.route void 0!==n&&n.redirect&&n.redirect(e.context,t)}return a().then(u,null,i.promiseLabel("Resolve route"))}function u(){return t.resolveIndex===i.routeInfos.length?i:i.routeInfos[t.resolveIndex].resolve(a,t).then(s,null,i.promiseLabel("Proceed"))}},e}() e.TransitionState=T var C=function(e,t,r,n){this.error=e,this.route=t,this.wasAborted=r,this.state=n} e.TransitionError=C var I=function(e){function t(t,r,n,i,o,a){var s return void 0===i&&(i=[]),void 0===o&&(o={}),(s=e.call(this,t,a)||this).preTransitionState=void 0,s.name=r,s.pivotHandler=n,s.contexts=i,s.queryParams=o,s}(0,r.inheritsLoose)(t,e) var n=t.prototype return n.applyToState=function(e,t){var r=c([this.name].concat(this.contexts))[0],n=this.router.recognizer.handlersFor(r[0]),i=n[n.length-1].handler return this.applyToHandlers(e,n,i,t,!1)},n.applyToHandlers=function(e,t,r,n,i){var o,a,s=new T,c=this.contexts.slice(0),l=t.length if(this.pivotHandler)for(o=0,a=t.length;o=0;--o){var f=t[o],h=f.handler,d=e.routeInfos[o],p=null if(p=f.names.length>0?o>=l?this.createParamHandlerInfo(h,f.names,c,d):this.getHandlerInfoForDynamicSegment(h,f.names,c,d,r,o):this.createParamHandlerInfo(h,f.names,c,d),i){p=p.becomeResolved(null,p.context) var m=d&&d.context f.names.length>0&&void 0!==d.context&&p.context===m&&(p.params=d&&d.params),p.context=m}var v=d;(o>=l||p.shouldSupercede(d))&&(l=Math.min(o,l),v=p),n&&!i&&(v=v.becomeResolved(null,v.context)),s.routeInfos.unshift(v)}if(c.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+r) return n||this.invalidateChildren(s.routeInfos,l),u(s.queryParams,this.queryParams||{}),s},n.invalidateChildren=function(e,t){for(var r=t,n=e.length;r0){if(h(a=r[r.length-1]))return this.createParamHandlerInfo(e,t,r,n) r.pop()}else{if(n&&n.name===e)return n if(!this.preTransitionState)return n var s=this.preTransitionState.routeInfos[o] a=s&&s.context}return new j(this.router,e,t,a)},n.createParamHandlerInfo=function(e,t,r,n){for(var i={},o=t.length,a=[];o--;){var s=n&&e===n.name&&n.params||{},u=r[r.length-1],c=t[o] h(u)?i[c]=""+r.pop():s.hasOwnProperty(c)?i[c]=s[c]:a.push(c)}if(a.length>0)throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e+". Missing params: "+a) return new A(this.router,e,t,i)},t}(R),N=function(){function e(t){var r=Error.call(this,t) this.name="UnrecognizedURLError",this.message=t||"UnrecognizedURL",Error.captureStackTrace?Error.captureStackTrace(this,e):this.stack=r.stack}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}(),D=function(e){function t(t,r,n){var i return(i=e.call(this,t,n)||this).url=r,i.preTransitionState=void 0,i}return(0,r.inheritsLoose)(t,e),t.prototype.applyToState=function(e){var t,r,n=new T,i=this.router.recognizer.recognize(this.url) if(!i)throw new N(this.url) var o=!1,a=this.url function s(e){if(e&&e.inaccessibleByURL)throw new N(a) return e}for(t=0,r=i.length;t=0&&n;--r){var i=t[r],o=i.handler e.add(t,{as:o}),n="/"===i.path||""===i.path||".index"===o.slice(-6)}}))},r.hasRoute=function(e){return this.recognizer.hasRoute(e)},r.queryParamsTransition=function(e,t,r,n){var i=this if(this.fireQueryParamDidChange(n,e),!t&&this.activeTransition)return this.activeTransition var o=new w(this,void 0,void 0) return o.queryParamsOnly=!0,r.queryParams=this.finalizeQueryParamChange(n.routeInfos,n.queryParams,o),o[g]=n.queryParams,this.toReadOnlyInfos(o,n),this.routeWillChange(o),o.promise=o.promise.then((function(e){return i._updateURL(o,r),i.didTransition(i.currentRouteInfos),i.toInfos(o,n.routeInfos,!0),i.routeDidChange(o),e}),null,v("Transition complete")),o},r.transitionByIntent=function(e,t){try{return this.getTransitionByIntent(e,t)}catch(r){return new w(this,e,void 0,r,void 0)}},r.recognize=function(e){var t=new D(this,e),r=this.generateNewState(t) if(null===r)return r var n=O(r.routeInfos,r.queryParams) return n[n.length-1]},r.recognizeAndLoad=function(e){var t=new D(this,e),r=this.generateNewState(t) if(null===r)return n.Promise.reject("URL "+e+" was not recognized") var i=new w(this,t,r,void 0) return i.then((function(){var e=O(r.routeInfos,i[g],!0) return e[e.length-1]}))},r.generateNewState=function(e){try{return e.applyToState(this.state,!1)}catch(t){return null}},r.getTransitionByIntent=function(e,t){var r,n=this,i=!!this.activeTransition,o=i?this.activeTransition[y]:this.state,a=e.applyToState(o,t),s=p(o.queryParams,a.queryParams) if(B(a.routeInfos,o.routeInfos)){if(s){var u=this.queryParamsTransition(s,i,o,a) return u.queryParamsOnly=!0,u}return this.activeTransition||new w(this,void 0,void 0)}if(t){var c=new w(this,void 0,void 0) return this.toReadOnlyInfos(c,a),this.setupContexts(a),this.routeWillChange(c),this.activeTransition}return r=new w(this,e,a,void 0,this.activeTransition),function(e,t){if(e.length!==t.length)return!1 for(var r=0,n=e.length;r=0;--a){var s=n[a] u(o,s.params),s.route.inaccessibleByURL&&(r=null)}if(r){o.queryParams=e._visibleQueryParams||t.queryParams var c=this.recognizer.generate(i,o),l=e.isCausedByInitialTransition,f="replace"===r&&!e.isCausedByAbortingTransition,h=e.queryParamsOnly&&"replace"===r,d="replace"===r&&e.isCausedByAbortingReplaceTransition l||f||h||d?this.replaceURL(c):this.updateURL(c)}}},r.finalizeQueryParamChange=function(e,t,r){for(var n in t)t.hasOwnProperty(n)&&null===t[n]&&delete t[n] var i=[] this.triggerEvent(e,!0,"finalizeQueryParamChange",[t,i,r]),r&&(r._visibleQueryParams={}) for(var o={},a=0,s=i.length;a0){var n=O(r,(0,t.assign)({},this._lastQueryParams),!0) e.from=n[n.length-1]||null}},r.toInfos=function(e,r,n){if(void 0===n&&(n=!1),void 0!==e&&r.length>0){var i=O(r,(0,t.assign)({},e[g]),n) e.to=i[i.length-1]||null}},r.notifyExistingHandlers=function(e,t){var r,n,i,o,a=this.state.routeInfos for(n=a.length,r=0;r1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1&&(i-=1)),[360*i,100*o,100*c]},i.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2] return[i.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},i.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,i=e[2]/255 return[100*((1-r-(t=Math.min(1-r,1-n,1-i)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},i.rgb.keyword=function(e){var n=r[e] if(n)return n var i,o,a,s=1/0 for(var u in t)if(t.hasOwnProperty(u)){var c=t[u],l=(o=e,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2)) l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},i.rgb.lab=function(e){var t=i.rgb.xyz(e),r=t[0],n=t[1],o=t[2] return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(e){var t,r,n,i,o,a=e[0]/360,s=e[1]/100,u=e[2]/100 if(0===s)return[o=255*u,o,o] t=2*u-(r=u<.5?u*(1+s):u+s-u*s),i=[0,0,0] for(var c=0;c<3;c++)(n=a+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c]=255*o return i},i.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,i=r,o=Math.max(n,.01) return r*=(n*=2)<=1?n:2-n,i*=o<=1?o:2-o,[t,100*(0===n?2*i/(o+i):2*r/(n+r)),100*((n+r)/2)]},i.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o)) switch(n*=255,i){case 0:return[n,u,a] case 1:return[s,n,a] case 2:return[a,n,u] case 3:return[a,s,n] case 4:return[u,a,n] case 5:return[n,a,s]}},i.hsv.hsl=function(e){var t,r,n,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01) return n=(2-o)*a,r=o*s,[i,100*(r=(r/=(t=(2-o)*s)<=1?t:2-t)||0),100*(n/=2)]},i.hwb.rgb=function(e){var t,r,n,i,o,a,s,u=e[0]/360,c=e[1]/100,l=e[2]/100,f=c+l switch(f>1&&(c/=f,l/=f),n=6*u-(t=Math.floor(6*u)),0!=(1&t)&&(n=1-n),i=c+n*((r=1-l)-c),t){default:case 6:case 0:o=r,a=i,s=c break case 1:o=i,a=r,s=c break case 2:o=c,a=r,s=i break case 3:o=c,a=i,s=r break case 4:o=i,a=c,s=r break case 5:o=r,a=c,s=i}return[255*o,255*a,255*s]},i.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100 return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},i.xyz.rgb=function(e){var t,r,n,i=e[0]/100,o=e[1]/100,a=e[2]/100 return r=-.9689*i+1.8758*o+.0415*a,n=.0557*i+-.204*o+1.057*a,t=(t=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2] return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(e){var t,r,n,i=e[0] t=e[1]/500+(r=(i+16)/116),n=r-e[2]/200 var o=Math.pow(r,3),a=Math.pow(t,3),s=Math.pow(n,3) return r=o>.008856?o:(r-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,n=s>.008856?s:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},i.lab.lch=function(e){var t,r=e[0],n=e[1],i=e[2] return(t=360*Math.atan2(i,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+i*i),t]},i.lch.lab=function(e){var t,r=e[0],n=e[1] return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},i.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:i.rgb.hsv(e)[2] if(0===(o=Math.round(o/50)))return 30 var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255)) return 2===o&&(a+=60),a},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2] return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(e){var t=e%10 if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t] var r=.5*(1+~~(e>50)) return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},i.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8 return[t,t,t]}var r return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase() return"000000".substring(t.length)+t},i.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i) if(!t)return[0,0,0] var r=t[0] 3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join("")) var n=parseInt(r,16) return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,i=e[2]/255,o=Math.max(Math.max(r,n),i),a=Math.min(Math.min(r,n),i),s=o-a return t=s<=0?0:o===r?(n-i)/s%6:o===n?2+(i-r)/s:4+(r-n)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},i.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,i=0 return(n=r<.5?2*t*r:2*t*(1-r))<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},i.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,i=0 return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},i.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100 if(0===r)return[255*n,255*n,255*n] var i,o=[0,0,0],a=t%1*6,s=a%1,u=1-s switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0 break case 1:o[0]=u,o[1]=1,o[2]=0 break case 2:o[0]=0,o[1]=1,o[2]=s break case 3:o[0]=0,o[1]=u,o[2]=1 break case 4:o[0]=s,o[1]=0,o[2]=1 break default:o[0]=1,o[1]=0,o[2]=u}return i=(1-r)*n,[255*(r*o[0]+i),255*(r*o[1]+i),255*(r*o[2]+i)]} i.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0 return r>0&&(n=t/r),[e[0],100*n,100*r]},i.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0 return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},i.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t) return[e[0],100*(r-t),100*(1-r)]},i.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,i=0 return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=i.gray.hsv=function(e){return[0,0,e[0]]},i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase() return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})) r.rgb,r.hsl,r.hsv,r.hwb,r.cmyk,r.xyz,r.lab,r.lch,r.hex,r.keyword,r.ansi16,r.ansi256,r.hcg,r.apple,r.gray function n(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)) var r=e(t) if("object"==typeof r)for(var n=r.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)),e(t))} return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})) var s=a,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c={getRgba:l,getHsla:f,getRgb:function(e){var t=l(e) return t&&t.slice(0,3)},getHsl:function(e){var t=f(e) return t&&t.slice(0,3)},getHwb:h,getAlpha:function(e){var t=l(e) if(t)return t[3] if(t=f(e))return t[3] if(t=h(e))return t[3]},hexString:function(e,t){t=void 0!==t&&3===e.length?t:e[3] return"#"+y(e[0])+y(e[1])+y(e[2])+(t>=0&&t<1?y(Math.round(255*t)):"")},rgbString:function(e,t){if(t<1||e[3]&&e[3]<1)return d(e,t) return"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:d,percentString:function(e,t){if(t<1||e[3]&&e[3]<1)return p(e,t) var r=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100) return"rgb("+r+"%, "+n+"%, "+i+"%)"},percentaString:p,hslString:function(e,t){if(t<1||e[3]&&e[3]<1)return m(e,t) return"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:m,hwbString:function(e,t){void 0===t&&(t=void 0!==e[3]?e[3]:1) return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return b[e.slice(0,3)]}} function l(e){if(e){var t=[0,0,0],r=1,n=e.match(/^#([a-fA-F0-9]{3,4})$/i),i="" if(n){i=(n=n[1])[3] for(var o=0;or?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e) return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t] return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2] return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,r=(t[0]+e)%360 return t[0]=r<0?360+r:r,this.setValues("hsl",t),this},mix:function(e,t){var r=e,n=void 0===t?.5:t,i=2*n-1,o=this.alpha()-r.alpha(),a=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-a return this.rgb(a*this.red()+s*r.red(),a*this.green()+s*r.green(),a*this.blue()+s*r.blue()).alpha(this.alpha()*n+r.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var e,t,r=new w,n=this.values,i=r.values for(var o in n)n.hasOwnProperty(o)&&(e=n[o],"[object Array]"===(t={}.toString.call(e))?i[o]=e.slice(0):"[object Number]"===t?i[o]=e:console.error("unexpected color value:",e)) return r}},w.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},w.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},w.prototype.getValues=function(e){for(var t=this.values,r={},n=0;n=0;i--)t.call(r,e[i],i) else for(i=0;i=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,r=0,n=1 return 0===e?0:1===e?1:(r||(r=.3),n<1?(n=1,t=r/4):t=r/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r))},easeOutElastic:function(e){var t=1.70158,r=0,n=1 return 0===e?0:1===e?1:(r||(r=.3),n<1?(n=1,t=r/4):t=r/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},easeInOutElastic:function(e){var t=1.70158,r=0,n=1 return 0===e?0:2==(e/=.5)?1:(r||(r=.45),n<1?(n=1,t=r/4):t=r/(2*Math.PI)*Math.asin(1/n),e<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},easeInBack:function(e){var t=1.70158 return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158 return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158 return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-S.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*S.easeInBounce(2*e):.5*S.easeOutBounce(2*e-1)+.5}},P={effects:S} E.easingEffects=S var M=Math.PI,A=M/180,j=2*M,R=M/2,T=M/4,C=2*M/3,I={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,r,n,i,o){if(o){var a=Math.min(o,i/2,n/2),s=t+a,u=r+a,c=t+n-a,l=r+i-a e.moveTo(t,u),st.left-1e-6&&e.xt.top-1e-6&&e.y0&&this.requestAnimationFrame()},advance:function(){for(var e,t,r,n,i=this.animations,o=0;o=r?(q.callback(e.onAnimationComplete,[e],t),t.animating=!1,i.splice(o,1)):++o}},X=q.options.resolve,ee=["push","pop","shift","splice","unshift"] function te(e,t){var r=e._chartjs if(r){var n=r.listeners,i=n.indexOf(t);-1!==i&&n.splice(i,1),n.length>0||(ee.forEach((function(t){delete e[t]})),delete e._chartjs)}}var re=function(e,t){this.initialize(e,t)} q.extend(re.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var r=this r.chart=e,r.index=t,r.linkScales(),r.addElements(),r._type=r.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this.getMeta(),t=this.chart,r=t.scales,n=this.getDataset(),i=t.options.scales null!==e.xAxisID&&e.xAxisID in r&&!n.xAxisID||(e.xAxisID=n.xAxisID||i.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in r&&!n.yAxisID||(e.yAxisID=n.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&te(this._data,this)},createMetaDataset:function(){var e=this.datasetElementType return e&&new e({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(e){var t=this.dataElementType return t&&new t({_chart:this.chart,_datasetIndex:this.index,_index:e})},addElements:function(){var e,t,r=this.getMeta(),n=this.getDataset().data||[],i=r.data for(e=0,t=n.length;er&&this.insertElements(r,n-r)},insertElements:function(e,t){for(var r=0;ri?(o=i/t.innerRadius,e.arc(a,s,t.innerRadius-i,n+o,r-o,!0)):e.arc(a,s,i,n+Math.PI/2,r-Math.PI/2),e.closePath(),e.clip()}function ae(e,t,r){var n="inner"===t.borderAlign n?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),r.fullCircles&&function(e,t,r,n){var i,o=r.endAngle for(n&&(r.endAngle=r.startAngle+ie,oe(e,r),r.endAngle=o,r.endAngle===r.startAngle&&r.fullCircles&&(r.endAngle+=ie,r.fullCircles--)),e.beginPath(),e.arc(r.x,r.y,r.innerRadius,r.startAngle+ie,r.startAngle,!0),i=0;is;)i-=ie for(;i=a&&i<=s,c=o>=r.innerRadius&&o<=r.outerRadius return u&&c}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,r=(e.innerRadius+e.outerRadius)/2 return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},getArea:function(){var e=this._view return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,r=(e.outerRadius-e.innerRadius)/2+e.innerRadius return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},draw:function(){var e,t=this._chart.ctx,r=this._view,n="inner"===r.borderAlign?.33:0,i={x:r.x,y:r.y,innerRadius:r.innerRadius,outerRadius:Math.max(r.outerRadius-n,0),pixelMargin:n,startAngle:r.startAngle,endAngle:r.endAngle,fullCircles:Math.floor(r.circumference/ie)} if(t.save(),t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+ie,t.beginPath(),t.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),t.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),t.closePath(),e=0;ee.x&&(t=be(t,"left","right")):e.baser?r:n,r:u.right||i<0?0:i>t?t:i,b:u.bottom||o<0?0:o>r?r:o,l:u.left||a<0?0:a>t?t:a}}function we(e,t,r){var n=null===t,i=null===r,o=!(!e||n&&i)&&ye(e) return o&&(n||t>=o.left&&t<=o.right)&&(i||r>=o.top&&r<=o.bottom)}B._set("global",{elements:{rectangle:{backgroundColor:me,borderColor:me,borderSkipped:"bottom",borderWidth:0}}}) var _e=J.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,r=function(e){var t=ye(e),r=t.right-t.left,n=t.bottom-t.top,i=ge(e,r/2,n/2) return{outer:{x:t.left,y:t.top,w:r,h:n},inner:{x:t.left+i.l,y:t.top+i.t,w:r-i.l-i.r,h:n-i.t-i.b}}}(t),n=r.outer,i=r.inner e.fillStyle=t.backgroundColor,e.fillRect(n.x,n.y,n.w,n.h),n.w===i.w&&n.h===i.h||(e.save(),e.beginPath(),e.rect(n.x,n.y,n.w,n.h),e.clip(),e.fillStyle=t.borderColor,e.rect(i.x,i.y,i.w,i.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view return e.base-e.y},inRange:function(e,t){return we(this._view,e,t)},inLabelRange:function(e,t){var r=this._view return ve(r)?we(r,e,null):we(r,null,t)},inXRange:function(e){return we(this._view,e,null)},inYRange:function(e){return we(this._view,null,e)},getCenterPoint:function(){var e,t,r=this._view return ve(r)?(e=r.x,t=(r.y+r.base)/2):(e=(r.x+r.base)/2,t=r.y),{x:e,y:t}},getArea:function(){var e=this._view return ve(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view return{x:e.x,y:e.y}}}),ke={},xe=se,Oe=le,Ee=pe,Se=_e ke.Arc=xe,ke.Line=Oe,ke.Point=Ee,ke.Rectangle=Se var Pe=q._deprecated,Me=q.valueOrDefault function Ae(e,t,r){var n,i,o=r.barThickness,a=t.stackCount,s=t.pixels[e],u=q.isNullOrUndef(o)?function(e,t){var r,n,i,o,a=e._length for(i=1,o=t.length;i0?Math.min(a,Math.abs(n-r)):a,r=n return a}(t.scale,t.pixels):-1 return q.isNullOrUndef(o)?(n=u*r.categoryPercentage,i=r.barPercentage):(n=o*a,i=1),{chunk:n/a,ratio:i,start:s-n/2}}B._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),B._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}}) var je=ne.extend({dataElementType:ke.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,r=this ne.prototype.initialize.apply(r,arguments),(e=r.getMeta()).stack=r.getDataset().stack,e.bar=!0,t=r._getIndexScale().options,Pe("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pe("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pe("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pe("bar chart",r._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pe("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,r,n=this.getMeta().data for(this._ruler=this.getRuler(),t=0,r=n.length;t=0&&m.min>=0?m.min:m.max,w=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=p.length if(y||void 0===y&&void 0!==b)for(n=0;n<_&&(i=p[n]).index!==e;++n)i.stack===b&&(o=void 0===(c=f._parseValue(d[i.index].data[t])).start?c.end:c.min>=0&&c.max>=0?c.max:c.min,(m.min<0&&o<0||m.max>=0&&o>0)&&(g+=o)) return a=f.getPixelForValue(g),u=(s=f.getPixelForValue(g+w))-a,void 0!==v&&Math.abs(u)=0&&!h||w<0&&h?a-v:a+v),{size:u,base:a,head:s,center:s+u/2}},calculateBarIndexPixels:function(e,t,r,n){var i="flex"===n.barThickness?function(e,t,r){var n,i=t.pixels,o=i[e],a=e>0?i[e-1]:null,s=e=Ne?-De:b<-Ne?De:0)+v,w=Math.cos(b),_=Math.sin(b),k=Math.cos(g),x=Math.sin(g),O=b<=0&&g>=0||g>=De,E=b<=Be&&g>=Be||g>=De+Be,S=b<=-Be&&g>=-Be||g>=Ne+Be,P=b===-Ne||g>=Ne?-1:Math.min(w,w*m,k,k*m),M=S?-1:Math.min(_,_*m,x,x*m),A=O?1:Math.max(w,w*m,k,k*m),j=E?1:Math.max(_,_*m,x,x*m) c=(A-P)/2,l=(j-M)/2,f=-(A+P)/2,h=-(j+M)/2}for(n=0,i=p.length;n0&&!isNaN(e)?De*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,r,n,i,o,a,s,u,c=0,l=this.chart if(!e)for(t=0,r=l.data.datasets.length;t(c=s>c?s:c)?u:c) return c},setHoverStyle:function(e){var t=e._model,r=e._options,n=q.getHoverColor e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Ie(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=Ie(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=Ie(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,r=0;r0&&qe(u[e-1]._model,s)&&(r.controlPointPreviousX=c(r.controlPointPreviousX,s.left,s.right),r.controlPointPreviousY=c(r.controlPointPreviousY,s.top,s.bottom)),e0&&(o=e.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(e,t){return it(e,t,{intersect:!1})},point:function(e,t){return tt(e,Xe(t,e))},nearest:function(e,t,r){var n=Xe(t,e) r.axis=r.axis||"xy" var i=nt(r.axis) return rt(e,n,r.intersect,i)},x:function(e,t,r){var n=Xe(t,e),i=[],o=!1 return et(e,(function(e){e.inXRange(n.x)&&i.push(e),e.inRange(n.x,n.y)&&(o=!0)})),r.intersect&&!o&&(i=[]),i},y:function(e,t,r){var n=Xe(t,e),i=[],o=!1 return et(e,(function(e){e.inYRange(n.y)&&i.push(e),e.inRange(n.x,n.y)&&(o=!0)})),r.intersect&&!o&&(i=[]),i}}},at=q.extend function st(e,t){return q.where(e,(function(e){return e.pos===t}))}function ut(e,t){return e.sort((function(e,r){var n=t?r:e,i=t?e:r return n.weight===i.weight?n.index-i.index:n.weight-i.weight}))}function ct(e,t,r,n){return Math.max(e[r],t[r])+Math.max(e[n],t[n])}function lt(e,t,r){var n,i,o=r.box,a=e.maxPadding if(r.size&&(e[r.pos]-=r.size),r.size=r.horizontal?o.height:o.width,e[r.pos]+=r.size,o.getPadding){var s=o.getPadding() a.top=Math.max(a.top,s.top),a.left=Math.max(a.left,s.left),a.bottom=Math.max(a.bottom,s.bottom),a.right=Math.max(a.right,s.right)}if(n=t.outerWidth-ct(a,e,"left","right"),i=t.outerHeight-ct(a,e,"top","bottom"),n!==e.w||i!==e.h){e.w=n,e.h=i var u=r.horizontal?[n,e.w]:[i,e.h] return!(u[0]===u[1]||isNaN(u[0])&&isNaN(u[1]))}}function ft(e,t){var r=t.maxPadding function n(e){var n={left:0,top:0,right:0,bottom:0} return e.forEach((function(e){n[e]=Math.max(t[e],r[e])})),n}return n(e?["left","right"]:["top","bottom"])}function ht(e,t,r){var n,i,o,a,s,u,c=[] for(n=0,i=e.length;n div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&pt.default||pt,yt=["animationstart","webkitAnimationStart"],bt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"} function gt(e,t){var r=q.getStyle(e,t),n=r&&r.match(/^(\d+)(\.\d+)?px$/) return n?Number(n[1]):void 0}var wt=!!function(){var e=!1 try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}) window.addEventListener("e",null,t)}catch(r){}return e}()&&{passive:!0} function _t(e,t,r){e.addEventListener(t,r,wt)}function kt(e,t,r){e.removeEventListener(t,r,wt)}function xt(e,t,r,n,i){return{type:e,chart:t,native:i||null,x:void 0!==r?r:null,y:void 0!==n?n:null}}function Ot(e){var t=document.createElement("div") return t.className=e||"",t}function Et(e,t,r){var n,i,o,a,s=e.$chartjs||(e.$chartjs={}),u=s.resizer=function(e){var t=Ot("chartjs-size-monitor"),r=Ot("chartjs-size-monitor-expand"),n=Ot("chartjs-size-monitor-shrink") r.appendChild(Ot()),n.appendChild(Ot()),t.appendChild(r),t.appendChild(n),t._reset=function(){r.scrollLeft=1e6,r.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6} var i=function(){t._reset(),e()} return _t(r,"scroll",i.bind(r,"expand")),_t(n,"scroll",i.bind(n,"shrink")),t}((n=function(){if(s.resizer){var n=r.options.maintainAspectRatio&&e.parentNode,i=n?n.clientWidth:0 t(xt("resize",r)),n&&n.clientWidth0){var o=e[0] o.label?r=o.label:o.xLabel?r=o.xLabel:i>0&&o.index-1?e.split("\n"):e}function Bt(e){var t=B.global return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Tt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Tt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Tt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Tt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Tt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Tt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Tt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Tt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Tt(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Lt(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Ft(e){return Nt([],Dt(e))}var Ut=J.extend({initialize:function(){this._model=Bt(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,r=t.callbacks,n=r.beforeTitle.apply(e,arguments),i=r.title.apply(e,arguments),o=r.afterTitle.apply(e,arguments),a=[] return a=Nt(a,Dt(n)),a=Nt(a,Dt(i)),a=Nt(a,Dt(o))},getBeforeBody:function(){return Ft(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var r=this,n=r._options.callbacks,i=[] return q.each(e,(function(e){var o={before:[],lines:[],after:[]} Nt(o.before,Dt(n.beforeLabel.call(r,e,t))),Nt(o.lines,n.label.call(r,e,t)),Nt(o.after,Dt(n.afterLabel.call(r,e,t))),i.push(o)})),i},getAfterBody:function(){return Ft(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,r=t.beforeFooter.apply(e,arguments),n=t.footer.apply(e,arguments),i=t.afterFooter.apply(e,arguments),o=[] return o=Nt(o,Dt(r)),o=Nt(o,Dt(n)),o=Nt(o,Dt(i))},update:function(e){var t,r,n,i,o,a,s,u,c,l,f=this,h=f._options,d=f._model,p=f._model=Bt(h),m=f._active,v=f._data,y={xAlign:d.xAlign,yAlign:d.yAlign},b={x:d.x,y:d.y},g={width:d.width,height:d.height},w={x:d.caretX,y:d.caretY} if(m.length){p.opacity=1 var _=[],k=[] w=It[h.position].call(f,m,f._eventPosition) var x=[] for(t=0,r=m.length;tn.width&&(i=n.width-t.width),i<0&&(i=0)),"top"===l?o+=f:o-="bottom"===l?t.height+f:t.height/2,"center"===l?"left"===c?i+=f:"right"===c&&(i-=f):"left"===c?i-=h:"right"===c&&(i+=h),{x:i,y:o}}(p,g,y=function(e,t){var r,n,i,o,a,s=e._model,u=e._chart,c=e._chart.chartArea,l="center",f="center" s.yu.height-t.height&&(f="bottom") var h=(c.left+c.right)/2,d=(c.top+c.bottom)/2 "center"===f?(r=function(e){return e<=h},n=function(e){return e>h}):(r=function(e){return e<=t.width/2},n=function(e){return e>=u.width-t.width/2}),i=function(e){return e+t.width+s.caretSize+s.caretPadding>u.width},o=function(e){return e-t.width-s.caretSize-s.caretPadding<0},a=function(e){return e<=d?"top":"bottom"},r(s.x)?(l="left",i(s.x)&&(l="center",f=a(s.y))):n(s.x)&&(l="right",o(s.x)&&(l="center",f=a(s.y))) var p=e._options return{xAlign:p.xAlign?p.xAlign:l,yAlign:p.yAlign?p.yAlign:f}}(this,g),f._chart)}else p.opacity=0 return p.xAlign=y.xAlign,p.yAlign=y.yAlign,p.x=b.x,p.y=b.y,p.width=g.width,p.height=g.height,p.caretX=w.x,p.caretY=w.y,f._model=p,e&&h.custom&&h.custom.call(f,p),f},drawCaret:function(e,t){var r=this._chart.ctx,n=this._view,i=this.getCaretPosition(e,t,n) r.lineTo(i.x1,i.y1),r.lineTo(i.x2,i.y2),r.lineTo(i.x3,i.y3)},getCaretPosition:function(e,t,r){var n,i,o,a,s,u,c=r.caretSize,l=r.cornerRadius,f=r.xAlign,h=r.yAlign,d=e.x,p=e.y,m=t.width,v=t.height if("center"===h)s=p+v/2,"left"===f?(i=(n=d)-c,o=n,a=s+c,u=s-c):(i=(n=d+m)+c,o=n,a=s-c,u=s+c) else if("left"===f?(n=(i=d+l+c)-c,o=i+c):"right"===f?(n=(i=d+m-l-c)-c,o=i+c):(n=(i=r.caretX)-c,o=i+c),"top"===h)s=(a=p)-c,u=a else{s=(a=p+v)+c,u=a var y=o o=n,n=y}return{x1:n,x2:i,x3:o,y1:a,y2:s,y3:u}},drawTitle:function(e,t,r){var n,i,o,a=t.title,s=a.length if(s){var u=Ct(t.rtl,t.x,t.width) for(e.x=Lt(t,t._titleAlign),r.textAlign=u.textAlign(t._titleAlign),r.textBaseline="middle",n=t.titleFontSize,i=t.titleSpacing,r.fillStyle=t.titleFontColor,r.font=q.fontString(n,t._titleFontStyle,t._titleFontFamily),o=0;o0&&r.stroke()},draw:function(){var e=this._chart.ctx,t=this._view if(0!==t.opacity){var r={width:t.width,height:t.height},n={x:t.x,y:t.y},i=Math.abs(t.opacity<.001)?0:t.opacity,o=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length this._options.enabled&&o&&(e.save(),e.globalAlpha=i,this.drawBackground(n,t,e,r),n.y+=t.yPadding,q.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),q.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,r=this,n=r._options return r._lastActive=r._lastActive||[],"mouseout"===e.type?r._active=[]:(r._active=r._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&r._active.reverse()),(t=!q.arrayEquals(r._active,r._lastActive))&&(r._lastActive=r._active,(n.enabled||n.custom)&&(r._eventPosition={x:e.x,y:e.y},r.update(!0),r.pivot())),t}}),zt=It,qt=Ut qt.positioners=zt var Ht=q.valueOrDefault function Vt(){return q.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){if("xAxes"===e||"yAxes"===e){var i,o,a,s=r[e].length for(t[e]||(t[e]=[]),i=0;i=t[e].length&&t[e].push({}),!t[e][i].type||a.type&&a.type!==t[e][i].type?q.merge(t[e][i],[Rt.getScaleDefaults(o),a]):q.merge(t[e][i],a)}else q._merger(e,t,r,n)}})}function Wt(){return q.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){var i=t[e]||Object.create(null),o=r[e] "scales"===e?t[e]=Vt(i,o):"scale"===e?t[e]=q.merge(i,[Rt.getScaleDefaults(o.type),o]):q._merger(e,t,r,n)}})}function Gt(e){var t=e.options q.each(e.scales,(function(t){mt.removeBox(e,t)})),t=Wt(B.global,B[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Yt(e,t,r){var n,i=function(e){return e.id===n} do{n=t+r++}while(q.findIndex(e,i)>=0) return n}function Kt(e){return"top"===e||"bottom"===e}function Jt(e,t){return function(r,n){return r[e]===n[e]?r[t]-n[t]:r[e]-n[e]}}B._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0}) var $t=function(e,t){return this.construct(e,t),this} q.extend($t.prototype,{construct:function(e,t){var r=this t=function(e){var t=(e=e||Object.create(null)).data=e.data||{} return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Wt(B.global,B[e.type],e.options||{}),e}(t) var n=At.acquireContext(e,t),i=n&&n.canvas,o=i&&i.height,a=i&&i.width r.id=q.uid(),r.ctx=n,r.canvas=i,r.config=t,r.width=a,r.height=o,r.aspectRatio=o?a/o:null,r.options=t.options,r._bufferedRender=!1,r._layers=[],r.chart=r,r.controller=r,$t.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(e){r.config.data=e}}),n&&i?(r.initialize(),r.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this return jt.notify(e,"beforeInit"),q.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),jt.notify(e,"afterInit"),e},clear:function(){return q.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(e){var t=this,r=t.options,n=t.canvas,i=r.maintainAspectRatio&&t.aspectRatio||null,o=Math.max(0,Math.floor(q.getMaximumWidth(n))),a=Math.max(0,Math.floor(i?o/i:q.getMaximumHeight(n))) if((t.width!==o||t.height!==a)&&(n.width=t.width=o,n.height=t.height=a,n.style.width=o+"px",n.style.height=a+"px",q.retinaScale(t,r.devicePixelRatio),!e)){var s={width:o,height:a} jt.notify(t,"resize",[s]),r.onResize&&r.onResize(t,s),t.stop(),t.update({duration:r.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},r=e.scale q.each(t.xAxes,(function(e,r){e.id||(e.id=Yt(t.xAxes,"x-axis-",r))})),q.each(t.yAxes,(function(e,r){e.id||(e.id=Yt(t.yAxes,"y-axis-",r))})),r&&(r.id=r.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,r=e.scales||{},n=[],i=Object.keys(r).reduce((function(e,t){return e[t]=!1,e}),{}) t.scales&&(n=n.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&n.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),q.each(n,(function(t){var n=t.options,o=n.id,a=Ht(n.type,t.dtype) Kt(n.position)!==Kt(t.dposition)&&(n.position=t.dposition),i[o]=!0 var s=null if(o in r&&r[o].type===a)(s=r[o]).options=n,s.ctx=e.ctx,s.chart=e else{var u=Rt.getScaleConstructor(a) if(!u)return s=new u({id:o,type:a,options:n,ctx:e.ctx,chart:e}),r[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)})),q.each(i,(function(e,t){e||delete r[t]})),e.scales=r,Rt.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,r=this,n=[],i=r.data.datasets for(e=0,t=i.length;e=0;--r)this.drawDataset(t[r],e) jt.notify(this,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var r={meta:e,index:e.index,easingValue:t} !1!==jt.notify(this,"beforeDatasetDraw",[r])&&(e.controller.draw(t),jt.notify(this,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this.tooltip,r={tooltip:t,easingValue:e} !1!==jt.notify(this,"beforeTooltipDraw",[r])&&(t.draw(),jt.notify(this,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return ot.modes.single(this,e)},getElementsAtEvent:function(e){return ot.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return ot.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,r){var n=ot.modes[t] return"function"==typeof n?n(this,e,r):[]},getDatasetAtEvent:function(e){return ot.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this.data.datasets[e] t._meta||(t._meta={}) var r=t._meta[this.id] return r||(r=t._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,r=this.data.datasets.length;t3?r[2]-r[1]:r[1]-r[0] Math.abs(n)>1&&e!==Math.floor(e)&&(n=e-Math.floor(e)) var i=q.log10(Math.abs(n)),o="" if(0!==e)if(Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]))<1e-4){var a=q.log10(Math.abs(e)),s=Math.floor(a)-Math.floor(i) s=Math.max(Math.min(s,20),0),o=e.toExponential(s)}else{var u=-1*Math.floor(i) u=Math.max(Math.min(u,20),0),o=e.toFixed(u)}else o="0" return o},logarithmic:function(e,t,r){var n=e/Math.pow(10,Math.floor(q.log10(e))) return 0===e?"0":1===n||2===n||5===n||0===t||t===r.length-1?e.toExponential():""}}},rr=q.isArray,nr=q.isNullOrUndef,ir=q.valueOrDefault,or=q.valueAtIndexOrDefault function ar(e,t,r){var n,i=e.getTicks().length,o=Math.min(t,i-1),a=e.getPixelForTick(o),s=e._startPixel,u=e._endPixel if(!(r&&(n=1===i?Math.max(a-s,u-a):0===t?(e.getPixelForTick(1)-a)/2:(a-e.getPixelForTick(o-1))/2,(a+=ou+1e-6)))return a}function sr(e,t,r,n){var i,o,a,s,u,c,l,f,h,d,p,m,v,y=r.length,b=[],g=[],w=[],_=0,k=0 for(i=0;it){for(r=0;r=h||l<=1||!s.isHorizontal()?s.labelRotation=f:(t=(e=s._getLabelSizes()).widest.width,r=e.highest.height-e.highest.offset,n=Math.min(s.maxWidth,s.chart.width-t),t+6>(i=u.offset?s.maxWidth/l:n/(l-1))&&(i=n/(l-(u.offset?.5:1)),o=s.maxHeight-ur(u.gridLines)-c.padding-cr(u.scaleLabel),a=Math.sqrt(t*t+r*r),d=q.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/i,1)),Math.asin(Math.min(o/a,1))-Math.asin(r/a))),d=Math.max(f,Math.min(h,d))),s.labelRotation=d)},afterCalculateTickRotation:function(){q.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){q.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},r=e.chart,n=e.options,i=n.ticks,o=n.scaleLabel,a=n.gridLines,s=e._isVisible(),u="bottom"===n.position,c=e.isHorizontal() if(c?t.width=e.maxWidth:s&&(t.width=ur(a)+cr(o)),c?s&&(t.height=ur(a)+cr(o)):t.height=e.maxHeight,i.display&&s){var l=fr(i),f=e._getLabelSizes(),h=f.first,d=f.last,p=f.widest,m=f.highest,v=.4*l.minor.lineHeight,y=i.padding if(c){var b=0!==e.labelRotation,g=q.toRadians(e.labelRotation),w=Math.cos(g),_=Math.sin(g),k=_*p.width+w*(m.height-(b?m.offset:0))+(b?0:v) t.height=Math.min(e.maxHeight,t.height+k+y) var x,O,E=e.getPixelForTick(0)-e.left,S=e.right-e.getPixelForTick(e.getTicks().length-1) b?(x=u?w*h.width+_*h.offset:_*(h.height-h.offset),O=u?_*(d.height-d.offset):w*d.width+_*d.offset):(x=h.width/2,O=d.width/2),e.paddingLeft=Math.max((x-E)*e.width/(e.width-E),0)+3,e.paddingRight=Math.max((O-S)*e.width/(e.width-S),0)+3}else{var P=i.mirror?0:p.width+y+v t.width=Math.min(e.maxWidth,t.width+P),e.paddingTop=h.height/2,e.paddingBottom=d.height/2}}e.handleMargins(),c?(e.width=e._length=r.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=r.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){q.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(nr(e))return NaN if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y) return e},_convertTicksToLabels:function(e){var t,r,n,i=this for(i.ticks=e.map((function(e){return e.value})),i.beforeTickToLabelConversion(),t=i.convertTicksToLabels(e)||i.ticks,i.afterTickToLabelConversion(),r=0,n=e.length;rr-1?null:this.getPixelForDecimal(e*n+(t?n/2:0))},getPixelForDecimal:function(e){return this._reversePixels&&(e=1-e),this._startPixel+e*this._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this.min,t=this.max return this.beginAtZero?0:e<0&&t<0?t:e>0&&t>0?e:0},_autoSkip:function(e){var t,r,n,i,o=this.options.ticks,a=this._length,s=o.maxTicksLimit||a/this._tickSize()+1,u=o.major.enabled?function(e){var t,r,n=[] for(t=0,r=e.length;ts)return function(e,t,r){var n,i,o=0,a=t[0] for(r=Math.ceil(r),n=0;nc)return o return Math.max(c,1)}(u,e,0,s),c>0){for(t=0,r=c-1;t1?(f-l)/(c-1):null,dr(e,n,q.isNullOrUndef(i)?0:l-i,l),dr(e,n,f,q.isNullOrUndef(i)?e.length:f+i),hr(e)}return dr(e,n),hr(e)},_tickSize:function(){var e=this.options.ticks,t=q.toRadians(this.labelRotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,a=i?i.widest.width+o:0,s=i?i.highest.height+o:0 return this.isHorizontal()?s*r>a*n?a/r:s/n:s*n=0&&(a=e),void 0!==o&&(e=r.indexOf(o))>=0&&(s=e),t.minIndex=a,t.maxIndex=s,t.min=r[a],t.max=r[s]},buildTicks:function(){var e=this._getLabels(),t=this.minIndex,r=this.maxIndex this.ticks=0===t&&r===e.length-1?e:e.slice(t,r+1)},getLabelForIndex:function(e,t){var r=this.chart return r.getDatasetMeta(t).controller._getValueScaleId()===this.id?this.getRightValue(r.data.datasets[t].data[e]):this._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,r=e.ticks mr.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),r&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(r.length-(t?0:1),1))},getPixelForValue:function(e,t,r){var n,i,o,a=this return vr(t)||vr(r)||(e=a.chart.data.datasets[r].data[t]),vr(e)||(n=a.isHorizontal()?e.x:e.y),(void 0!==n||void 0!==e&&isNaN(t))&&(i=a._getLabels(),e=q.valueOrDefault(n,e),t=-1!==(o=i.indexOf(e))?o:t,isNaN(t)&&(t=e)),a.getPixelForDecimal((t-a._startValue)/a._valueRange)},getPixelForTick:function(e){var t=this.ticks return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange) return Math.min(Math.max(t,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),br={position:"bottom"} yr._defaults=br var gr=q.noop,wr=q.isNullOrUndef var _r=mr.extend({getRightValue:function(e){return"string"==typeof e?+e:mr.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks if(t.beginAtZero){var r=q.sign(e.min),n=q.sign(e.max) r<0&&n<0?e.max=0:r>0&&n>0&&(e.min=0)}var i=void 0!==t.min||void 0!==t.suggestedMin,o=void 0!==t.max||void 0!==t.suggestedMax void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(null===e.min?e.min=t.suggestedMin:e.min=Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(null===e.max?e.max=t.suggestedMax:e.max=Math.max(e.max,t.suggestedMax)),i!==o&&e.min>=e.max&&(i?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this.options.ticks,r=t.stepSize,n=t.maxTicksLimit return r?e=Math.ceil(this.max/r)-Math.floor(this.min/r)+1:(e=this._computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:gr,buildTicks:function(){var e=this,t=e.options.ticks,r=e.getTickLimit(),n={maxTicks:r=Math.max(2,r),min:t.min,max:t.max,precision:t.precision,stepSize:q.valueOrDefault(t.fixedStepSize,t.stepSize)},i=e.ticks=function(e,t){var r,n,i,o,a=[],s=e.stepSize,u=s||1,c=e.maxTicks-1,l=e.min,f=e.max,h=e.precision,d=t.min,p=t.max,m=q.niceNum((p-d)/c/u)*u if(m<1e-14&&wr(l)&&wr(f))return[d,p];(o=Math.ceil(p/m)-Math.floor(d/m))>c&&(m=q.niceNum(o*m/c/u)*u),s||wr(h)?r=Math.pow(10,q._decimalPlaces(m)):(r=Math.pow(10,h),m=Math.ceil(m*r)/r),n=Math.floor(d/m)*m,i=Math.ceil(p/m)*m,s&&(!wr(l)&&q.almostWhole(l/m,m/1e3)&&(n=l),!wr(f)&&q.almostWhole(f/m,m/1e3)&&(i=f)),o=(i-n)/m,o=q.almostEquals(o,Math.round(o),m/1e3)?Math.round(o):Math.ceil(o),n=Math.round(n*r)/r,i=Math.round(i*r)/r,a.push(wr(l)?n:l) for(var v=1;vt.length-1?null:this.getPixelForValue(t[e])}}),Sr=kr Er._defaults=Sr var Pr=q.valueOrDefault,Mr=q.math.log10 var Ar={position:"left",ticks:{callback:tr.formatters.logarithmic}} function jr(e,t){return q.isFinite(e)&&e>=0?e:t}var Rr=mr.extend({determineDataLimits:function(){var e,t,r,n,i,o,a=this,s=a.options,u=a.chart,c=u.data.datasets,l=a.isHorizontal() function f(e){return l?e.xAxisID===a.id:e.yAxisID===a.id}a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,a.minNotZero=Number.POSITIVE_INFINITY var h=s.stacked if(void 0===h)for(e=0;e0){var t=q.min(e),r=q.max(e) a.min=Math.min(a.min,t),a.max=Math.max(a.max,r)}}))}else for(e=0;e0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(Mr(e.max))):e.minNotZero=1)},buildTicks:function(){var e=this,t=e.options.ticks,r=!e.isHorizontal(),n={min:jr(t.min),max:jr(t.max)},i=e.ticks=function(e,t){var r,n,i=[],o=Pr(e.min,Math.pow(10,Math.floor(Mr(t.min)))),a=Math.floor(Mr(t.max)),s=Math.ceil(t.max/Math.pow(10,a)) 0===o?(r=Math.floor(Mr(t.minNotZero)),n=Math.floor(t.minNotZero/Math.pow(10,r)),i.push(o),o=n*Math.pow(10,r)):(r=Math.floor(Mr(o)),n=Math.floor(o/Math.pow(10,r))) var u=r<0?Math.pow(10,Math.abs(r)):1 do{i.push(o),10===++n&&(n=1,u=++r>=0?1:u),o=Math.round(n*Math.pow(10,r)*u)/u}while(rt.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(Mr(e)) return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,r=0 mr.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),r=Pr(e.options.ticks.fontSize,B.global.defaultFontSize)/e._length),e._startValue=Mr(t),e._valueOffset=r,e._valueRange=(Mr(e.max)-Mr(t))/(1-r)},getPixelForValue:function(e){var t=this,r=0 return(e=+t.getRightValue(e))>t.min&&e>0&&(r=(Mr(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(r)},getValueForPixel:function(e){var t=this,r=t.getDecimalForPixel(e) return 0===r&&0===t.min?0:Math.pow(10,t._startValue+(r-t._valueOffset)*t._valueRange)}}),Tr=Ar Rr._defaults=Tr var Cr=q.valueOrDefault,Ir=q.valueAtIndexOrDefault,Nr=q.options.resolve,Dr={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:tr.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}} function Br(e){var t=e.ticks return t.display&&e.display?Cr(t.fontSize,B.global.defaultFontSize)+2*t.backdropPaddingY:0}function Lr(e,t,r,n,i){return e===n||e===i?{start:t-r/2,end:t+r/2}:ei?{start:t-r,end:t}:{start:t,end:t+r}}function Fr(e){return 0===e||180===e?"center":e<180?"left":"right"}function Ur(e,t,r,n){var i,o,a=r.y+n/2 if(q.isArray(t))for(i=0,o=t.length;i270||e<90)&&(r.y-=t.h)}function qr(e){return q.isNumber(e)?e:0}var Hr=_r.extend({setDimensions:function(){var e=this e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Br(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY q.each(t.data.datasets,(function(i,o){if(t.isDatasetVisible(o)){var a=t.getDatasetMeta(o) q.each(i.data,(function(t,i){var o=+e.getRightValue(t) isNaN(o)||a.data[i].hidden||(r=Math.min(o,r),n=Math.max(o,n))}))}})),e.min=r===Number.POSITIVE_INFINITY?0:r,e.max=n===Number.NEGATIVE_INFINITY?0:n,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Br(this.options))},convertTicksToLabels:function(){var e=this _r.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map((function(){var t=q.callback(e.options.pointLabels.callback,arguments,e) return t||0===t?t:""}))},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this.options e.display&&e.pointLabels.display?function(e){var t,r,n,i=q.options._parseFont(e.options.pointLabels),o={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={} e.ctx.font=i.string,e._pointLabelSizes=[] var s,u,c,l=e.chart.data.labels.length for(t=0;to.r&&(o.r=d.end,a.r=f),p.starto.b&&(o.b=p.end,a.b=f)}e.setReductions(e.drawingArea,o,a)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(e,t,r){var n=this,i=t.l/Math.sin(r.l),o=Math.max(t.r-n.width,0)/Math.sin(r.r),a=-t.t/Math.cos(r.t),s=-Math.max(t.b-(n.height-n.paddingTop),0)/Math.cos(r.b) i=qr(i),o=qr(o),a=qr(a),s=qr(s),n.drawingArea=Math.min(Math.floor(e-(i+o)/2),Math.floor(e-(a+s)/2)),n.setCenterPoint(i,o,a,s)},setCenterPoint:function(e,t,r,n){var i=this,o=i.width-t-i.drawingArea,a=e+i.drawingArea,s=r+i.drawingArea,u=i.height-i.paddingTop-n-i.drawingArea i.xCenter=Math.floor((a+o)/2+i.left),i.yCenter=Math.floor((s+u)/2+i.top+i.paddingTop)},getIndexAngle:function(e){var t=this.chart,r=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360 return(r<0?r+360:r)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this if(q.isNullOrUndef(e))return NaN var r=t.drawingArea/(t.max-t.min) return t.options.ticks.reverse?(t.max-e)*r:(e-t.min)*r},getPointPosition:function(e,t){var r=this.getIndexAngle(e)-Math.PI/2 return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this.min,r=this.max return this.getPointPositionForValue(e||0,this.beginAtZero?0:t<0&&r<0?r:t>0&&r>0?t:0)},_drawGrid:function(){var e,t,r,n=this,i=n.ctx,o=n.options,a=o.gridLines,s=o.angleLines,u=Cr(s.lineWidth,a.lineWidth),c=Cr(s.color,a.color) if(o.pointLabels.display&&function(e){var t=e.ctx,r=e.options,n=r.pointLabels,i=Br(r),o=e.getDistanceFromCenterForValue(r.ticks.reverse?e.min:e.max),a=q.options._parseFont(n) t.save(),t.font=a.string,t.textBaseline="middle" for(var s=e.chart.data.labels.length-1;s>=0;s--){var u=0===s?i/2:0,c=e.getPointPosition(s,o+u+5),l=Ir(n.fontColor,s,B.global.defaultFontColor) t.fillStyle=l var f=e.getIndexAngle(s),h=q.toDegrees(f) t.textAlign=Fr(h),zr(h,e._pointLabelSizes[s],c),Ur(t,e.pointLabels[s],c,a.lineHeight)}t.restore()}(n),a.display&&q.each(n.ticks,(function(e,r){0!==r&&(t=n.getDistanceFromCenterForValue(n.ticksAsNumbers[r]),function(e,t,r,n){var i,o=e.ctx,a=t.circular,s=e.chart.data.labels.length,u=Ir(t.color,n-1),c=Ir(t.lineWidth,n-1) if((a||s)&&u&&c){if(o.save(),o.strokeStyle=u,o.lineWidth=c,o.setLineDash&&(o.setLineDash(t.borderDash||[]),o.lineDashOffset=t.borderDashOffset||0),o.beginPath(),a)o.arc(e.xCenter,e.yCenter,r,0,2*Math.PI) else{i=e.getPointPosition(0,r),o.moveTo(i.x,i.y) for(var l=1;l=0;e--)t=n.getDistanceFromCenterForValue(o.ticks.reverse?n.min:n.max),r=n.getPointPosition(e,t),i.beginPath(),i.moveTo(n.xCenter,n.yCenter),i.lineTo(r.x,r.y),i.stroke() i.restore()}},_drawLabels:function(){var e=this,t=e.ctx,r=e.options.ticks if(r.display){var n,i,o=e.getIndexAngle(0),a=q.options._parseFont(r),s=Cr(r.fontColor,B.global.defaultFontColor) t.save(),t.font=a.string,t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",q.each(e.ticks,(function(o,u){(0!==u||r.reverse)&&(n=e.getDistanceFromCenterForValue(e.ticksAsNumbers[u]),r.showLabelBackdrop&&(i=t.measureText(o).width,t.fillStyle=r.backdropColor,t.fillRect(-i/2-r.backdropPaddingX,-n-a.size/2-r.backdropPaddingY,i+2*r.backdropPaddingX,a.size+2*r.backdropPaddingY)),t.fillStyle=s,t.fillText(o,0,-n))})),t.restore()}},_drawTitle:q.noop}),Vr=Dr Hr._defaults=Vr var Wr=q._deprecated,Gr=q.options.resolve,Yr=q.valueOrDefault,Kr=Number.MIN_SAFE_INTEGER||-9007199254740991,Jr=Number.MAX_SAFE_INTEGER||9007199254740991,$r={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Zr=Object.keys($r) function Qr(e,t){return e-t}function Xr(e){return q.valueOrDefault(e.time.min,e.ticks.min)}function en(e){return q.valueOrDefault(e.time.max,e.ticks.max)}function tn(e,t,r,n){var i=function(e,t,r){for(var n,i,o,a=0,s=e.length-1;a>=0&&a<=s;){if(i=e[(n=a+s>>1)-1]||null,o=e[n],!i)return{lo:null,hi:o} if(o[t]r))return{lo:i,hi:o} s=n-1}}return{lo:o,hi:null}}(e,t,r),o=i.lo?i.hi?i.lo:e[e.length-2]:e[0],a=i.lo?i.hi?i.hi:e[e.length-1]:e[1],s=a[t]-o[t],u=s?(r-o[t])/s:0,c=(a[n]-o[n])*u return o[n]+c}function rn(e,t){var r=e._adapter,n=e.options.time,i=n.parser,o=i||n.format,a=t return"function"==typeof i&&(a=i(a)),q.isFinite(a)||(a="string"==typeof o?r.parse(a,o):r.parse(a)),null!==a?+a:(i||"function"!=typeof o||(a=o(t),q.isFinite(a)||(a=r.parse(a))),a)}function nn(e,t){if(q.isNullOrUndef(t))return null var r=e.options.time,n=rn(e,e.getRightValue(t)) return null===n||r.round&&(n=+e._adapter.startOf(n,r.round)),n}function on(e,t,r,n){var i,o,a,s=Zr.length for(i=Zr.indexOf(e);i=0&&(t[o].major=!0) return t}(e,o,a,r):o}var sn=mr.extend({initialize:function(){this.mergeTicksOptions(),mr.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,r=t.time||(t.time={}),n=e._adapter=new er._date(t.adapters.date) return Wr("time scale",r.format,"time.format","time.parser"),Wr("time scale",r.min,"time.min","ticks.min"),Wr("time scale",r.max,"time.max","ticks.max"),q.mergeIf(r.displayFormats,n.formats()),mr.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),mr.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,r,n,i,o,a,s=this,u=s.chart,c=s._adapter,l=s.options,f=l.time.unit||"day",h=Jr,d=Kr,p=[],m=[],v=[],y=s._getLabels() for(e=0,r=y.length;e1?function(e){var t,r,n,i={},o=[] for(t=0,r=e.length;t1e5*c)throw t+" and "+r+" are too far apart with stepSize of "+c+" "+u for(i=f;i=i&&r<=o&&l.push(r) return n.min=i,n.max=o,n._unit=u.unit||(s.autoSkip?on(u.minUnit,n.min,n.max,f):function(e,t,r,n,i){var o,a for(o=Zr.length-1;o>=Zr.indexOf(r);o--)if(a=Zr[o],$r[a].common&&e._adapter.diff(i,n,a)>=t-1)return a return Zr[r?Zr.indexOf(r):0]}(n,l.length,u.minUnit,n.min,n.max)),n._majorUnit=s.major.enabled&&"year"!==n._unit?function(e){for(var t=Zr.indexOf(e)+1,r=Zr.length;tt&&s=0&&e0?s:1}}),un={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}} sn._defaults=un var cn={category:yr,linear:Er,logarithmic:Rr,radialLinear:Hr,time:sn},ln={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"} er._date.override("function"==typeof e?{_id:"moment",formats:function(){return ln},parse:function(t,r){return"string"==typeof t&&"string"==typeof r?t=e(t,r):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,r){return e(t).format(r)},add:function(t,r,n){return e(t).add(r,n).valueOf()},diff:function(t,r,n){return e(t).diff(e(r),n)},startOf:function(t,r,n){return t=e(t),"isoWeek"===r?t.isoWeekday(n).valueOf():t.startOf(r).valueOf()},endOf:function(t,r){return e(t).endOf(r).valueOf()},_create:function(t){return e(t)}}:{}),B._set("global",{plugins:{filler:{propagate:!0}}}) var fn={dataset:function(e){var t=e.fill,r=e.chart,n=r.getDatasetMeta(t),i=n&&r.isDatasetVisible(t)&&n.dataset._children||[],o=i.length||0 return o?function(e,t){return t=r)&&n switch(o){case"bottom":return"start" case"top":return"end" case"zero":return"origin" case"origin":case"start":case"end":return o default:return!1}}function dn(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,r,n,i,o,a=e.el._scale,s=a.options,u=a.chart.data.labels.length,c=e.fill,l=[] if(!u)return null for(t=s.ticks.reverse?a.max:a.min,r=s.ticks.reverse?a.min:a.max,n=a.getPointPositionForValue(0,t),i=0;i0;--o)q.canvas.lineTo(e,r[o],r[o-1],!0) else for(a=r[0].cx,s=r[0].cy,u=Math.sqrt(Math.pow(r[0].x-a,2)+Math.pow(r[0].y-s,2)),o=i-1;o>0;--o)e.arc(a,s,u,r[o].angle,r[o-1].angle,!0)}}function bn(e,t,r,n,i,o){var a,s,u,c,l,f,h,d,p=t.length,m=n.spanGaps,v=[],y=[],b=0,g=0 for(e.beginPath(),a=0,s=p;a=0;--r)(t=u[r].$filler)&&t.visible&&(i=(n=t.el)._view,o=n._children||[],a=t.mapper,s=i.backgroundColor||B.global.defaultColor,a&&s&&o.length&&(q.canvas.clipArea(c,e.chartArea),bn(c,o,a,i,s,n._loop),q.canvas.unclipArea(c)))}},wn=q.rtl.getRtlAdapter,_n=q.noop,kn=q.valueOrDefault function xn(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}B._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var r=t.datasetIndex,n=this.chart,i=n.getDatasetMeta(r) i.hidden=null===i.hidden?!n.data.datasets[r].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,r=e.options.legend||{},n=r.labels&&r.labels.usePointStyle return e._getSortedDatasetMetas().map((function(r){var i=r.controller.getStyle(n?0:void 0) return{text:t[r.index].label,fillStyle:i.backgroundColor,hidden:!e.isDatasetVisible(r.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:r.index}}),this)}}},legendCallback:function(e){var t,r,n,i=document.createElement("ul"),o=e.data.datasets for(i.setAttribute("class",e.id+"-legend"),t=0,r=o.length;tu.width)&&(f+=a+r.padding,l[l.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:n,height:a},l[l.length-1]+=n+r.padding})),u.height+=f}else{var h=r.padding,d=e.columnWidths=[],p=e.columnHeights=[],m=r.padding,v=0,y=0 q.each(e.legendItems,(function(e,t){var n=xn(r,a)+a/2+i.measureText(e.text).width t>0&&y+a+2*h>u.height&&(m+=v+r.padding,d.push(v),p.push(y),v=0,y=0),v=Math.max(v,n),y+=a+h,s[t]={left:0,top:0,width:n,height:a}})),m+=v,d.push(v),p.push(y),u.width+=m}e.width=u.width,e.height=u.height}else e.width=u.width=e.height=u.height=0},afterFit:_n,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,r=t.labels,n=B.global,i=n.defaultColor,o=n.elements.line,a=e.height,s=e.columnHeights,u=e.width,c=e.lineWidths if(t.display){var l,f=wn(t.rtl,e.left,e.minSize.width),h=e.ctx,d=kn(r.fontColor,n.defaultFontColor),p=q.options._parseFont(r),m=p.size h.textAlign=f.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=d,h.fillStyle=d,h.font=p.string var v=xn(r,m),y=e.legendHitBoxes,b=function(e,n){switch(t.align){case"start":return r.padding case"end":return e-n default:return(e-n+r.padding)/2}},g=e.isHorizontal() l=g?{x:e.left+b(u,c[0]),y:e.top+r.padding,line:0}:{x:e.left+r.padding,y:e.top+b(a,s[0]),line:0},q.rtl.overrideTextDirection(e.ctx,t.textDirection) var w=m+r.padding q.each(e.legendItems,(function(t,n){var d=h.measureText(t.text).width,p=v+m/2+d,_=l.x,k=l.y f.setWidth(e.minSize.width),g?n>0&&_+p+r.padding>e.left+e.minSize.width&&(k=l.y+=w,l.line++,_=l.x=e.left+b(u,c[l.line])):n>0&&k+w>e.top+e.minSize.height&&(_=l.x=_+e.columnWidths[l.line]+r.padding,l.line++,k=l.y=e.top+b(a,s[l.line])) var x=f.x(_);(function(e,t,n){if(!(isNaN(v)||v<=0)){h.save() var a=kn(n.lineWidth,o.borderWidth) if(h.fillStyle=kn(n.fillStyle,i),h.lineCap=kn(n.lineCap,o.borderCapStyle),h.lineDashOffset=kn(n.lineDashOffset,o.borderDashOffset),h.lineJoin=kn(n.lineJoin,o.borderJoinStyle),h.lineWidth=a,h.strokeStyle=kn(n.strokeStyle,i),h.setLineDash&&h.setLineDash(kn(n.lineDash,o.borderDash)),r&&r.usePointStyle){var s=v*Math.SQRT2/2,u=f.xPlus(e,v/2),c=t+m/2 q.canvas.drawPoint(h,n.pointStyle,s,u,c,n.rotation)}else h.fillRect(f.leftForLtr(e,v),t,v,m),0!==a&&h.strokeRect(f.leftForLtr(e,v),t,v,m) h.restore()}})(x,k,t),y[n].left=f.leftForLtr(x,y[n].width),y[n].top=k,function(e,t,r,n){var i=m/2,o=f.xPlus(e,v+i),a=t+i h.fillText(r.text,o,a),r.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(o,a),h.lineTo(f.xPlus(o,n),a),h.stroke())}(x,k,t,d),g?l.x+=p+r.padding:l.y+=w})),q.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var r,n,i,o=this if(e>=o.left&&e<=o.right&&t>=o.top&&t<=o.bottom)for(i=o.legendHitBoxes,r=0;r=(n=i[r]).left&&e<=n.left+n.width&&t>=n.top&&t<=n.top+n.height)return o.legendItems[r] return null},handleEvent:function(e){var t,r=this,n=r.options,i="mouseup"===e.type?"click":e.type if("mousemove"===i){if(!n.onHover&&!n.onLeave)return}else{if("click"!==i)return if(!n.onClick)return}t=r._getLegendItemAt(e.x,e.y),"click"===i?t&&n.onClick&&n.onClick.call(r,e.native,t):(n.onLeave&&t!==r._hoveredItem&&(r._hoveredItem&&n.onLeave.call(r,e.native,r._hoveredItem),r._hoveredItem=t),n.onHover&&t&&n.onHover.call(r,e.native,t))}}) function En(e,t){var r=new On({ctx:e.ctx,options:t,chart:e}) mt.configure(e,r,t),mt.addBox(e,r),e.legend=r}var Sn={id:"legend",_element:On,beforeInit:function(e){var t=e.options.legend t&&En(e,t)},beforeUpdate:function(e){var t=e.options.legend,r=e.legend t?(q.mergeIf(t,B.global.legend),r?(mt.configure(e,r,t),r.options=t):En(e,t)):r&&(mt.removeBox(e,r),delete e.legend)},afterEvent:function(e,t){var r=e.legend r&&r.handleEvent(t)}},Pn=q.noop B._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}}) var Mn=J.extend({initialize:function(e){q.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:Pn,update:function(e,t,r){var n=this return n.beforeUpdate(),n.maxWidth=e,n.maxHeight=t,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:Pn,beforeSetDimensions:Pn,setDimensions:function(){var e=this e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:Pn,beforeBuildLabels:Pn,buildLabels:Pn,afterBuildLabels:Pn,beforeFit:Pn,fit:function(){var e,t=this,r=t.options,n=t.minSize={},i=t.isHorizontal() r.display?(e=(q.isArray(r.text)?r.text.length:1)*q.options._parseFont(r).lineHeight+2*r.padding,t.width=n.width=i?t.maxWidth:e,t.height=n.height=i?e:t.maxHeight):t.width=n.width=t.height=n.height=0},afterFit:Pn,isHorizontal:function(){var e=this.options.position return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,r=e.options if(r.display){var n,i,o,a=q.options._parseFont(r),s=a.lineHeight,u=s/2+r.padding,c=0,l=e.top,f=e.left,h=e.bottom,d=e.right t.fillStyle=q.valueOrDefault(r.fontColor,B.global.defaultFontColor),t.font=a.string,e.isHorizontal()?(i=f+(d-f)/2,o=l+u,n=d-f):(i="left"===r.position?f+u:d-u,o=l+(h-l)/2,n=h-l,c=Math.PI*("left"===r.position?-.5:.5)),t.save(),t.translate(i,o),t.rotate(c),t.textAlign="center",t.textBaseline="middle" var p=r.text if(q.isArray(p))for(var m=0,v=0;v=0;n--){var i=e[n] if(t(i))return i}},q.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},q.almostEquals=function(e,t,r){return Math.abs(e-t)=e},q.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},q.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},q.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1},q.toRadians=function(e){return e*(Math.PI/180)},q.toDegrees=function(e){return e*(180/Math.PI)},q._decimalPlaces=function(e){if(q.isFinite(e)){for(var t=1,r=0;Math.round(e*t)/t!==e;)t*=10,r++ return r}},q.getAngleFromPoint=function(e,t){var r=t.x-e.x,n=t.y-e.y,i=Math.sqrt(r*r+n*n),o=Math.atan2(n,r) return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:i}},q.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},q.aliasPixel=function(e){return e%2==0?0:.5},q._alignPixel=function(e,t,r){var n=e.currentDevicePixelRatio,i=r/2 return Math.round((t-i)*n)/n+i},q.splineCurve=function(e,t,r,n){var i=e.skip?t:e,o=t,a=r.skip?t:r,s=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),u=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=s/(s+u),l=u/(s+u),f=n*(c=isNaN(c)?0:c),h=n*(l=isNaN(l)?0:l) return{previous:{x:o.x-f*(a.x-i.x),y:o.y-f*(a.y-i.y)},next:{x:o.x+h*(a.x-i.x),y:o.y+h*(a.y-i.y)}}},q.EPSILON=Number.EPSILON||1e-14,q.splineCurveMonotone=function(e){var t,r,n,i,o,a,s,u,c,l=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),f=l.length for(t=0;t0?l[t-1]:null,(i=t0?l[t-1]:null,i=t=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},q.previousItem=function(e,t,r){return r?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},q.niceNum=function(e,t){var r=Math.floor(q.log10(e)),n=e/Math.pow(10,r) return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)},q.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},q.getRelativePosition=function(e,t){var r,n,i=e.originalEvent||e,o=e.target||e.srcElement,a=o.getBoundingClientRect(),s=i.touches s&&s.length>0?(r=s[0].clientX,n=s[0].clientY):(r=i.clientX,n=i.clientY) var u=parseFloat(q.getStyle(o,"padding-left")),c=parseFloat(q.getStyle(o,"padding-top")),l=parseFloat(q.getStyle(o,"padding-right")),f=parseFloat(q.getStyle(o,"padding-bottom")),h=a.right-a.left-u-l,d=a.bottom-a.top-c-f return{x:r=Math.round((r-a.left-u)/h*o.width/t.currentDevicePixelRatio),y:n=Math.round((n-a.top-c)/d*o.height/t.currentDevicePixelRatio)}},q.getConstraintWidth=function(e){return r(e,"max-width","clientWidth")},q.getConstraintHeight=function(e){return r(e,"max-height","clientHeight")},q._calculatePadding=function(e,t,r){return(t=q.getStyle(e,t)).indexOf("%")>-1?r*parseInt(t,10)/100:parseInt(t,10)},q._getParentNode=function(e){var t=e.parentNode return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},q.getMaximumWidth=function(e){var t=q._getParentNode(e) if(!t)return e.clientWidth var r=t.clientWidth,n=r-q._calculatePadding(t,"padding-left",r)-q._calculatePadding(t,"padding-right",r),i=q.getConstraintWidth(e) return isNaN(i)?n:Math.min(n,i)} q.getMaximumHeight=function(e){var t=q._getParentNode(e) if(!t)return e.clientHeight var r=t.clientHeight,n=r-q._calculatePadding(t,"padding-top",r)-q._calculatePadding(t,"padding-bottom",r),i=q.getConstraintHeight(e) return isNaN(i)?n:Math.min(n,i)},q.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},q.retinaScale=function(e,t){var r=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1 if(1!==r){var n=e.canvas,i=e.height,o=e.width n.height=i*r,n.width=o*r,e.ctx.scale(r,r),n.style.height||n.style.width||(n.style.height=i+"px",n.style.width=o+"px")}},q.fontString=function(e,t,r){return t+" "+e+"px "+r},q.longestText=function(e,t,r,n){var i=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[] n.font!==t&&(i=n.data={},o=n.garbageCollect=[],n.font=t),e.font=t var a,s,u,c,l,f=0,h=r.length for(a=0;ar.length){for(a=0;an&&(n=o),n},q.numberOfLabelLines=function(e){var t=1 return q.each(e,(function(e){q.isArray(e)&&e.length>t&&(t=e.length)})),t},q.color=_?function(e){return e instanceof CanvasGradient&&(e=B.global.defaultColor),_(e)}:function(e){return console.error("Color.js not found!"),e},q.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:q.color(e).saturate(.5).darken(.1).rgbString()}}(),Zt._adapters=er,Zt.Animation=Z,Zt.animationService=Q,Zt.controllers=Qe,Zt.DatasetController=ne,Zt.defaults=B,Zt.Element=J,Zt.elements=ke,Zt.Interaction=ot,Zt.layouts=mt,Zt.platform=At,Zt.plugins=jt,Zt.Scale=mr,Zt.scaleService=Rt,Zt.Ticks=tr,Zt.Tooltip=qt,Zt.helpers.each(cn,(function(e,t){Zt.scaleService.registerScaleType(t,e,e._defaults)})),jn)jn.hasOwnProperty(In)&&Zt.plugins.register(jn[In]) Zt.platform.initialize() var Nn=Zt return"undefined"!=typeof window&&(window.Chart=Zt),Zt.Chart=Zt,Zt.Legend=jn.legend._element,Zt.Title=jn.title._element,Zt.pluginService=Zt.plugins,Zt.PluginBase=Zt.Element.extend({}),Zt.canvasHelpers=Zt.helpers.canvas,Zt.layoutService=Zt.layouts,Zt.LinearScaleBase=_r,Zt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(e){Zt[e]=function(t,r){return new Zt(t,Zt.helpers.merge(r||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}})),Nn})),function(){var e=new WeakMap define("ember-macro-helpers/-computed-store",(function(){return{default:e,__esModule:!0}})) var t=Ember.computed Ember.computed=function(){var r=Array.prototype.slice.call(arguments),n=t.apply(this,r),i=r.slice(0,r.length-1),o=r[r.length-1] return e.set(n,{dependentKeys:i,getter:o}),n},Object.keys(t).forEach((function(r){Ember.computed[r]=function(){var n=Array.prototype.slice.call(arguments),i=t[r].apply(this,n),o=n,a=i._getter return e.set(i,{dependentKeys:o,getter:a}),i}}))}(),"undefined"==typeof FastBoot){var preferNative=!1 function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t) if(n){var i=Object.getOwnPropertyDescriptor(n,t) return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct() return function(){var r,n=_getPrototypeOf(e) if(t){var i=_getPrototypeOf(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined") return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r-1} function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"') return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift() return{done:void 0===t,value:t}}} return i&&(t[Symbol.iterator]=function(){return t}),t}function m(e){this.map={},e instanceof m?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(e.bodyUsed)return n.reject(new TypeError("Already read")) e.bodyUsed=!0}function y(e){return new n((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function b(e){var t=new FileReader,r=y(t) return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0) var t=new Uint8Array(e.byteLength) return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||f(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=v(this) if(e)return e if(this._bodyBlob)return n.resolve(this._bodyBlob) if(this._bodyArrayBuffer)return n.resolve(new Blob([this._bodyArrayBuffer])) if(this._bodyFormData)throw new Error("could not read FormData body as blob") return n.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=v(this) return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?n.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):n.resolve(this._bodyArrayBuffer))}return this.blob().then(b)}),this.text=function(){var e,t,r,i=v(this) if(i)return i if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=y(t),t.readAsText(e),r if(this._bodyArrayBuffer)return n.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests") if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/ if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime()) else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function x(e){var t=new FormData return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ") t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function O(e,t){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new m(t.headers),this.url=t.url||"",this._initBody(e)}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})},w.call(k.prototype),w.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""}) return e.type="error",e} var E=[301,302,303,307,308] O.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code") return new O(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException try{new e.DOMException}catch(P){e.DOMException=function(e,t){this.message=e,this.name=t var r=Error(e) this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(r,i){return new n((function(n,a){var s=new k(r,i) if(s.signal&&s.signal.aborted)return a(new e.DOMException("Aborted","AbortError")) var u=new XMLHttpRequest function l(){u.abort()}u.onload=function(){var e,t,r={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new m,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim() if(n){var i=r.join(":").trim() t.append(n,i)}})),t)} r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL") var i="response"in u?u.response:u.responseText setTimeout((function(){n(new O(i,r))}),0)},u.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){a(new e.DOMException("Aborted","AbortError"))}),0)},u.open(s.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(r){return e}}(s.url),!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&(o?u.responseType="blob":c&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!i||"object"!==_typeof(i.headers)||i.headers instanceof m?s.headers.forEach((function(e,t){u.setRequestHeader(t,e)})):Object.getOwnPropertyNames(i.headers).forEach((function(e){u.setRequestHeader(e,d(i.headers[e]))})),s.signal&&(s.signal.addEventListener("abort",l),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",l)}),u.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=m,t.Request=k,t.Response=O),e.Headers=m,e.Request=k,e.Response=O,e.fetch=S})({}) if(!a.fetch)throw new Error("fetch is not defined - maybe your browser targets are not covering everything you need?") var u=0 function c(e){return u--,e}r.Test?(r.Test.registerWaiter((function(){return 0===u})),t.default=function(){return u++,t.fetch.apply(e,arguments).then((function(e){return e.clone().blob().then(c,c),e}),(function(e){throw c(e),e}))}):t.default=t.fetch,i.forEach((function(e){delete t[e]}))}))})("undefined"!=typeof window&&window||"undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"undefined"==typeof FastBoot&& /* flatpickr v4.6.3, @license MIT */ function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).flatpickr=t()}(this,(function(){"use strict" ;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var e=function(){return(e=Object.assign||function(e){for(var t,r=1,n=arguments.length;r",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},n={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100 if(t>3&&t<21)return"th" switch(t%10){case 1:return"st" case 2:return"nd" case 3:return"rd" default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0} function a(e,t,r){var n return void 0===r&&(r=!1),function(){var i=this,o=arguments null!==n&&clearTimeout(n),n=window.setTimeout((function(){n=null,r||e.apply(i,o)}),t),r&&!n&&e.apply(i,o)}}var s=function(e){return e instanceof Array?e:[e]} function u(e,t,r){if(!0===r)return e.classList.add(t) e.classList.remove(t)}function c(e,t,r){var n=window.document.createElement(e) return t=t||"",r=r||"",n.className=t,void 0!==r&&(n.textContent=r),n}function l(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,t){var r=c("div","numInputWrapper"),n=c("input","numInput "+e),i=c("span","arrowUp"),o=c("span","arrowDown") if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==t)for(var a in t)n.setAttribute(a,t[a]) return r.appendChild(n),r.appendChild(i),r.appendChild(o),r}var h=function(){},d=function(e,t,r){return r.months[t?"shorthand":"longhand"][e]},p={D:h,F:function(e,t,r){e.setMonth(r.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,r){e.setHours(e.getHours()%12+12*o(new RegExp(r.amPM[1],"i").test(t)))},M:function(e,t,r){e.setMonth(r.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,r){var n=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0) return i.setDate(i.getDate()-i.getDay()+r.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:h,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:h,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},m={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},v={Z:function(e){return e.toISOString()},D:function(e,t,r){return t.weekdays.shorthand[v.w(e,t,r)]},F:function(e,t,r){return d(v.n(e,t,r)-1,!1,t)},G:function(e,t,r){return i(v.h(e,t,r))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return d(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,r){return r.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},y=function(e){var t=e.config,i=void 0===t?r:t,o=e.l10n,a=void 0===o?n:o return function(e,t,r){var n=r||a return void 0!==i.formatDate?i.formatDate(e,t,n):t.split("").map((function(t,r,o){return v[t]&&"\\"!==o[r-1]?v[t](e,n,i):"\\"!==t?t:""})).join("")}},b=function(e){var t=e.config,i=void 0===t?r:t,o=e.l10n,a=void 0===o?n:o return function(e,t,n,o){if(0===e||e){var s,u=o||a,c=e if(e instanceof Date)s=new Date(e.getTime()) else if("string"!=typeof e&&void 0!==e.toFixed)s=new Date(e) else if("string"==typeof e){var l=t||(i||r).dateFormat,f=String(e).trim() if("today"===f)s=new Date,n=!0 else if(/Z$/.test(f)||/GMT$/.test(f))s=new Date(e) else if(i&&i.parseDate)s=i.parseDate(e,l) else{s=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0) for(var h=void 0,d=[],v=0,y=0,b="";va&&(l=r===v.hourElement?l-a-o(!v.amPM):n,h&&N(void 0,1,v.hourElement)),v.amPM&&f&&(1===s?l+u===23:Math.abs(l-u)>s)&&(v.amPM.textContent=v.l10n.amPM[o(v.amPM.textContent===v.l10n.amPM[0])]),r.value=i(l)}}(e) var t=v._input.value E(),ye(),v._input.value!==t&&v._debouncedChange()}function E(){if(void 0!==v.hourElement&&void 0!==v.minuteElement){var e,t,r=(parseInt(v.hourElement.value.slice(-2),10)||0)%24,n=(parseInt(v.minuteElement.value,10)||0)%60,i=void 0!==v.secondElement?(parseInt(v.secondElement.value,10)||0)%60:0 void 0!==v.amPM&&(e=r,t=v.amPM.textContent,r=e%12+12*o(t===v.l10n.amPM[1])) var a=void 0!==v.config.minTime||v.config.minDate&&v.minDateHasTime&&v.latestSelectedDateObj&&0===g(v.latestSelectedDateObj,v.config.minDate,!0) if(void 0!==v.config.maxTime||v.config.maxDate&&v.maxDateHasTime&&v.latestSelectedDateObj&&0===g(v.latestSelectedDateObj,v.config.maxDate,!0)){var s=void 0!==v.config.maxTime?v.config.maxTime:v.config.maxDate;(r=Math.min(r,s.getHours()))===s.getHours()&&(n=Math.min(n,s.getMinutes())),n===s.getMinutes()&&(i=Math.min(i,s.getSeconds()))}if(a){var u=void 0!==v.config.minTime?v.config.minTime:v.config.minDate;(r=Math.max(r,u.getHours()))===u.getHours()&&(n=Math.max(n,u.getMinutes())),n===u.getMinutes()&&(i=Math.max(i,u.getSeconds()))}M(r,n,i)}}function S(e){var t=e||v.latestSelectedDateObj t&&M(t.getHours(),t.getMinutes(),t.getSeconds())}function P(){var e=v.config.defaultHour,t=v.config.defaultMinute,r=v.config.defaultSeconds if(void 0!==v.config.minDate){var n=v.config.minDate.getHours(),i=v.config.minDate.getMinutes();(e=Math.max(e,n))===n&&(t=Math.max(i,t)),e===n&&t===i&&(r=v.config.minDate.getSeconds())}if(void 0!==v.config.maxDate){var o=v.config.maxDate.getHours(),a=v.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(a,t)),e===o&&t===a&&(r=v.config.maxDate.getSeconds())}M(e,t,r)}function M(e,t,r){void 0!==v.latestSelectedDateObj&&v.latestSelectedDateObj.setHours(e%24,t,r||0,0),v.hourElement&&v.minuteElement&&!v.isMobile&&(v.hourElement.value=i(v.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),v.minuteElement.value=i(t),void 0!==v.amPM&&(v.amPM.textContent=v.l10n.amPM[o(e>=12)]),void 0!==v.secondElement&&(v.secondElement.value=i(r)))}function A(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&$(t)}function j(e,t,r,n){return t instanceof Array?t.forEach((function(t){return j(e,t,r,n)})):e instanceof Array?e.forEach((function(e){return j(e,t,r,n)})):(e.addEventListener(t,r,n),void v._handlers.push({element:e,event:t,handler:r,options:n}))}function R(e){return function(t){1===t.which&&e(t)}}function T(){he("onChange")}function C(e,t){var r=void 0!==e?v.parseDate(e):v.latestSelectedDateObj||(v.config.minDate&&v.config.minDate>v.now?v.config.minDate:v.config.maxDate&&v.config.maxDate=0&&g(e,v.selectedDates[1])<=0)}(t)&&!pe(t)&&o.classList.add("inRange"),v.weekNumbers&&1===v.config.showMonths&&"prevMonthDay"!==e&&r%7==1&&v.weekNumbers.insertAdjacentHTML("beforeend",""+v.config.getWeek(t)+""),he("onDayCreate",o),o}function B(e){e.focus(),"range"===v.config.mode&&ee(e)}function L(e){for(var t=e>0?0:v.config.showMonths-1,r=e>0?v.config.showMonths:-1,n=t;n!=r;n+=e)for(var i=v.daysContainer.children[n],o=e>0?0:i.children.length-1,a=e>0?i.children.length:-1,s=o;s!=a;s+=e){var u=i.children[s] if(-1===u.className.indexOf("hidden")&&Z(u.dateObj))return u}}function F(e,t){var r=Q(document.activeElement||document.body),n=void 0!==e?e:r?document.activeElement:void 0!==v.selectedDateElem&&Q(v.selectedDateElem)?v.selectedDateElem:void 0!==v.todayDateElem&&Q(v.todayDateElem)?v.todayDateElem:L(t>0?1:-1) return void 0===n?v._input.focus():r?void function(e,t){for(var r=-1===e.className.indexOf("Month")?e.dateObj.getMonth():v.currentMonth,n=t>0?v.config.showMonths:-1,i=t>0?1:-1,o=r-v.currentMonth;o!=n;o+=i)for(var a=v.daysContainer.children[o],s=r-v.currentMonth===o?e.$i+t:t<0?a.children.length-1:0,u=a.children.length,c=s;c>=0&&c0?u:-1);c+=i){var l=a.children[c] if(-1===l.className.indexOf("hidden")&&Z(l.dateObj)&&Math.abs(e.$i-c)>=Math.abs(t))return B(l)}v.changeMonth(i),F(L(i),0)}(n,t):B(n)}function U(e,t){for(var r=(new Date(e,t,1).getDay()-v.l10n.firstDayOfWeek+7)%7,n=v.utils.getDaysInMonth((t-1+12)%12),i=v.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),a=v.config.showMonths>1,s=a?"prevMonthDay hidden":"prevMonthDay",u=a?"nextMonthDay hidden":"nextMonthDay",l=n+1-r,f=0;l<=n;l++,f++)o.appendChild(D(s,new Date(e,t-1,l),l,f)) for(l=1;l<=i;l++,f++)o.appendChild(D("",new Date(e,t,l),l,f)) for(var h=i+1;h<=42-r&&(1===v.config.showMonths||f%7!=0);h++,f++)o.appendChild(D(u,new Date(e,t+1,h%i),h,f)) var d=c("div","dayContainer") return d.appendChild(o),d}function z(){if(void 0!==v.daysContainer){l(v.daysContainer),v.weekNumbers&&l(v.weekNumbers) for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==v.config.monthSelectorType)){var e=function(e){return!(void 0!==v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&ev.config.maxDate.getMonth())} v.monthsDropdownContainer.tabIndex=-1,v.monthsDropdownContainer.innerHTML="" for(var t=0;t<12;t++)if(e(t)){var r=c("option","flatpickr-monthDropdown-month") r.value=new Date(v.currentYear,t).getMonth().toString(),r.textContent=d(t,v.config.shorthandCurrentMonth,v.l10n),r.tabIndex=-1,v.currentMonth===t&&(r.selected=!0),v.monthsDropdownContainer.appendChild(r)}}}function H(){var e,t=c("div","flatpickr-month"),r=window.document.createDocumentFragment() v.config.showMonths>1||"static"===v.config.monthSelectorType?e=c("span","cur-month"):(v.monthsDropdownContainer=c("select","flatpickr-monthDropdown-months"),j(v.monthsDropdownContainer,"change",(function(e){var t=e.target,r=parseInt(t.value,10) v.changeMonth(r-v.currentMonth),he("onMonthChange")})),q(),e=v.monthsDropdownContainer) var n=f("cur-year",{tabindex:"-1"}),i=n.getElementsByTagName("input")[0] i.setAttribute("aria-label",v.l10n.yearAriaLabel),v.config.minDate&&i.setAttribute("min",v.config.minDate.getFullYear().toString()),v.config.maxDate&&(i.setAttribute("max",v.config.maxDate.getFullYear().toString()),i.disabled=!!v.config.minDate&&v.config.minDate.getFullYear()===v.config.maxDate.getFullYear()) var o=c("div","flatpickr-current-month") return o.appendChild(e),o.appendChild(n),r.appendChild(o),t.appendChild(r),{container:t,yearElement:i,monthElement:e}}function V(){l(v.monthNav),v.monthNav.appendChild(v.prevMonthNav),v.config.showMonths&&(v.yearElements=[],v.monthElements=[]) for(var e=v.config.showMonths;e--;){var t=H() v.yearElements.push(t.yearElement),v.monthElements.push(t.monthElement),v.monthNav.appendChild(t.container)}v.monthNav.appendChild(v.nextMonthNav)}function W(){v.weekdayContainer?l(v.weekdayContainer):v.weekdayContainer=c("div","flatpickr-weekdays") for(var e=v.config.showMonths;e--;){var t=c("div","flatpickr-weekdaycontainer") v.weekdayContainer.appendChild(t)}return G(),v.weekdayContainer}function G(){if(v.weekdayContainer){var e=v.l10n.firstDayOfWeek,t=v.l10n.weekdays.shorthand.slice() e>0&&e\n "+t.join("")+"\n \n "}}function Y(e,t){void 0===t&&(t=!0) var r=t?e:e-v.currentMonth r<0&&!0===v._hidePrevMonthArrow||r>0&&!0===v._hideNextMonthArrow||(v.currentMonth+=r,(v.currentMonth<0||v.currentMonth>11)&&(v.currentYear+=v.currentMonth>11?1:-1,v.currentMonth=(v.currentMonth+12)%12,he("onYearChange"),q()),z(),he("onMonthChange"),me())}function K(e){return!(!v.config.appendTo||!v.config.appendTo.contains(e))||v.calendarContainer.contains(e)}function J(e){if(v.isOpen&&!v.config.inline){var t="function"==typeof(a=e).composedPath?a.composedPath()[0]:a.target,r=K(t),n=t===v.input||t===v.altInput||v.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(v.input)||~e.path.indexOf(v.altInput)),i="blur"===e.type?n&&e.relatedTarget&&!K(e.relatedTarget):!n&&!r&&!K(e.relatedTarget),o=!v.config.ignoredFocusElements.some((function(e){return e.contains(t)})) i&&o&&(void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement&&O(),v.close(),"range"===v.config.mode&&1===v.selectedDates.length&&(v.clear(!1),v.redraw()))}var a}function $(e){if(!(!e||v.config.minDate&&ev.config.maxDate.getFullYear())){var t=e,r=v.currentYear!==t v.currentYear=t||v.currentYear,v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth=Math.min(v.config.maxDate.getMonth(),v.currentMonth):v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&(v.currentMonth=Math.max(v.config.minDate.getMonth(),v.currentMonth)),r&&(v.redraw(),he("onYearChange"),q())}}function Z(e,t){void 0===t&&(t=!0) var r=v.parseDate(e,void 0,t) if(v.config.minDate&&r&&g(r,v.config.minDate,void 0!==t?t:!v.minDateHasTime)<0||v.config.maxDate&&r&&g(r,v.config.maxDate,void 0!==t?t:!v.maxDateHasTime)>0)return!1 if(0===v.config.enable.length&&0===v.config.disable.length)return!0 if(void 0===r)return!1 for(var n=v.config.enable.length>0,i=n?v.config.enable:v.config.disable,o=0,a=void 0;o=a.from.getTime()&&r.getTime()<=a.to.getTime())return n}return!n}function Q(e){return void 0!==v.daysContainer&&(-1===e.className.indexOf("hidden")&&v.daysContainer.contains(e))}function X(e){var t=e.target===v._input,r=v.config.allowInput,n=v.isOpen&&(!r||!t),i=v.config.inline&&t&&!r if(13===e.keyCode&&t){if(r)return v.setDate(v._input.value,!0,e.target===v.altInput?v.config.altFormat:v.config.dateFormat),e.target.blur() v.open()}else if(K(e.target)||n||i){var o=!!v.timeContainer&&v.timeContainer.contains(e.target) switch(e.keyCode){case 13:o?(e.preventDefault(),O(),se()):ue(e) break case 27:e.preventDefault(),se() break case 8:case 46:t&&!v.config.allowInput&&(e.preventDefault(),v.clear()) break case 37:case 39:if(o||t)v.hourElement&&v.hourElement.focus() else if(e.preventDefault(),void 0!==v.daysContainer&&(!1===r||document.activeElement&&Q(document.activeElement))){var a=39===e.keyCode?1:-1 e.ctrlKey?(e.stopPropagation(),Y(a),F(L(1),0)):F(void 0,a)}break case 38:case 40:e.preventDefault() var s=40===e.keyCode?1:-1 v.daysContainer&&void 0!==e.target.$i||e.target===v.input||e.target===v.altInput?e.ctrlKey?(e.stopPropagation(),$(v.currentYear-s),F(L(1),0)):o||F(void 0,7*s):e.target===v.currentYearElement?$(v.currentYear-s):v.config.enableTime&&(!o&&v.hourElement&&v.hourElement.focus(),O(e),v._debouncedChange()) break case 9:if(o){var u=[v.hourElement,v.minuteElement,v.secondElement,v.amPM].concat(v.pluginElements).filter((function(e){return e})),c=u.indexOf(e.target) if(-1!==c){var l=u[c+(e.shiftKey?-1:1)] e.preventDefault(),(l||v._input).focus()}}else!v.config.noCalendar&&v.daysContainer&&v.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),v._input.focus())}}if(void 0!==v.amPM&&e.target===v.amPM)switch(e.key){case v.l10n.amPM[0].charAt(0):case v.l10n.amPM[0].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[0],E(),ye() break case v.l10n.amPM[1].charAt(0):case v.l10n.amPM[1].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[1],E(),ye()}(t||K(e.target))&&he("onKeyDown",e)}function ee(e){if(1===v.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():v.days.firstElementChild.dateObj.getTime(),r=v.parseDate(v.selectedDates[0],void 0,!0).getTime(),n=Math.min(t,v.selectedDates[0].getTime()),i=Math.max(t,v.selectedDates[0].getTime()),o=!1,a=0,s=0,u=n;un&&ua)?a=u:u>r&&(!s||u0&&d0&&d>s return p?(h.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach((function(e){h.classList.remove(e)})),"continue"):o&&!p?"continue":(["startRange","inRange","endRange","notAllowed"].forEach((function(e){h.classList.remove(e)})),void(void 0!==e&&(e.classList.add(t<=v.selectedDates[0].getTime()?"startRange":"endRange"),rt&&d===r&&h.classList.add("endRange"),d>=a&&(0===s||d<=s)&&(c=r,f=t,(u=d)>Math.min(c,f)&&u0||r.getMinutes()>0||r.getSeconds()>0),v.selectedDates&&(v.selectedDates=v.selectedDates.filter((function(e){return Z(e)})),v.selectedDates.length||"min"!==e||S(r),ye()),v.daysContainer&&(ae(),void 0!==r?v.currentYearElement[e]=r.getFullYear().toString():v.currentYearElement.removeAttribute(e),v.currentYearElement.disabled=!!n&&void 0!==r&&n.getFullYear()===r.getFullYear())}}function ie(){"object"!=typeof v.config.locale&&void 0===x.l10ns[v.config.locale]&&v.config.errorHandler(new Error("flatpickr: invalid locale "+v.config.locale)),v.l10n=e({},x.l10ns.default,"object"==typeof v.config.locale?v.config.locale:"default"!==v.config.locale?x.l10ns[v.config.locale]:void 0),m.K="("+v.l10n.amPM[0]+"|"+v.l10n.amPM[1]+"|"+v.l10n.amPM[0].toLowerCase()+"|"+v.l10n.amPM[1].toLowerCase()+")",void 0===e({},p,JSON.parse(JSON.stringify(h.dataset||{}))).time_24hr&&void 0===x.defaultConfig.time_24hr&&(v.config.time_24hr=v.l10n.time_24hr),v.formatDate=y(v),v.parseDate=b({config:v.config,l10n:v.l10n})}function oe(e){if(void 0!==v.calendarContainer){he("onPreCalendarPosition") var t=e||v._positionElement,r=Array.prototype.reduce.call(v.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),n=v.calendarContainer.offsetWidth,i=v.config.position.split(" "),o=i[0],a=i.length>1?i[1]:null,s=t.getBoundingClientRect(),c=window.innerHeight-s.bottom,l="above"===o||"below"!==o&&cr,f=window.pageYOffset+s.top+(l?-r-2:t.offsetHeight+2) if(u(v.calendarContainer,"arrowTop",!l),u(v.calendarContainer,"arrowBottom",l),!v.config.inline){var h=window.pageXOffset+s.left-(null!=a&&"center"===a?(n-s.width)/2:0),d=window.document.body.offsetWidth-(window.pageXOffset+s.right),p=h+n>window.document.body.offsetWidth,m=d+n>window.document.body.offsetWidth if(u(v.calendarContainer,"rightMost",p),!v.config.static)if(v.calendarContainer.style.top=f+"px",p)if(m){var y=document.styleSheets[0] if(void 0===y)return var b=window.document.body.offsetWidth,g=Math.max(0,b/2-n/2),w=y.cssRules.length,_="{left:"+s.left+"px;right:auto;}" u(v.calendarContainer,"rightMost",!1),u(v.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+_,w),v.calendarContainer.style.left=g+"px",v.calendarContainer.style.right="auto"}else v.calendarContainer.style.left="auto",v.calendarContainer.style.right=d+"px" else v.calendarContainer.style.left=h+"px",v.calendarContainer.style.right="auto"}}}function ae(){v.config.noCalendar||v.isMobile||(me(),z())}function se(){v._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(v.close,0):v.close()}function ue(e){e.preventDefault(),e.stopPropagation() var t=function e(t,r){return r(t)?t:t.parentNode?e(t.parentNode,r):void 0}(e.target,(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")})) if(void 0!==t){var r=t,n=v.latestSelectedDateObj=new Date(r.dateObj.getTime()),i=(n.getMonth()v.currentMonth+v.config.showMonths-1)&&"range"!==v.config.mode if(v.selectedDateElem=r,"single"===v.config.mode)v.selectedDates=[n] else if("multiple"===v.config.mode){var o=pe(n) o?v.selectedDates.splice(parseInt(o),1):v.selectedDates.push(n)}else"range"===v.config.mode&&(2===v.selectedDates.length&&v.clear(!1,!1),v.latestSelectedDateObj=n,v.selectedDates.push(n),0!==g(n,v.selectedDates[0],!0)&&v.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))) if(E(),i){var a=v.currentYear!==n.getFullYear() v.currentYear=n.getFullYear(),v.currentMonth=n.getMonth(),a&&(he("onYearChange"),q()),he("onMonthChange")}if(me(),z(),ye(),v.config.enableTime&&setTimeout((function(){return v.showTimeInput=!0}),50),i||"range"===v.config.mode||1!==v.config.showMonths?void 0!==v.selectedDateElem&&void 0===v.hourElement&&v.selectedDateElem&&v.selectedDateElem.focus():B(r),void 0!==v.hourElement&&void 0!==v.hourElement&&v.hourElement.focus(),v.config.closeOnSelect){var s="single"===v.config.mode&&!v.config.enableTime,u="range"===v.config.mode&&2===v.selectedDates.length&&!v.config.enableTime;(s||u)&&se()}T()}}v.parseDate=b({config:v.config,l10n:v.l10n}),v._handlers=[],v.pluginElements=[],v.loadedPlugins=[],v._bind=j,v._setHoursFromDate=S,v._positionCalendar=oe,v.changeMonth=Y,v.changeYear=$,v.clear=function(e,t){void 0===e&&(e=!0) void 0===t&&(t=!0) v.input.value="",void 0!==v.altInput&&(v.altInput.value="") void 0!==v.mobileInput&&(v.mobileInput.value="") v.selectedDates=[],v.latestSelectedDateObj=void 0,!0===t&&(v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth()) v.showTimeInput=!1,!0===v.config.enableTime&&P() v.redraw(),e&&he("onChange")},v.close=function(){v.isOpen=!1,v.isMobile||(void 0!==v.calendarContainer&&v.calendarContainer.classList.remove("open"),void 0!==v._input&&v._input.classList.remove("active")) he("onClose")},v._createElement=c,v.destroy=function(){void 0!==v.config&&he("onDestroy") for(var e=v._handlers.length;e--;){var t=v._handlers[e] t.element.removeEventListener(t.event,t.handler,t.options)}if(v._handlers=[],v.mobileInput)v.mobileInput.parentNode&&v.mobileInput.parentNode.removeChild(v.mobileInput),v.mobileInput=void 0 else if(v.calendarContainer&&v.calendarContainer.parentNode)if(v.config.static&&v.calendarContainer.parentNode){var r=v.calendarContainer.parentNode if(r.lastChild&&r.removeChild(r.lastChild),r.parentNode){for(;r.firstChild;)r.parentNode.insertBefore(r.firstChild,r) r.parentNode.removeChild(r)}}else v.calendarContainer.parentNode.removeChild(v.calendarContainer) v.altInput&&(v.input.type="text",v.altInput.parentNode&&v.altInput.parentNode.removeChild(v.altInput),delete v.altInput) v.input&&(v.input.type=v.input._type,v.input.classList.remove("flatpickr-input"),v.input.removeAttribute("readonly"),v.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete v[e]}catch(t){}}))},v.isEnabled=Z,v.jumpToDate=C,v.open=function(e,t){void 0===t&&(t=v._positionElement) if(!0===v.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==v.mobileInput&&(v.mobileInput.focus(),v.mobileInput.click()),void he("onOpen") if(v._input.disabled||v.config.inline)return var r=v.isOpen v.isOpen=!0,r||(v.calendarContainer.classList.add("open"),v._input.classList.add("active"),he("onOpen"),oe(t)) !0===v.config.enableTime&&!0===v.config.noCalendar&&(0===v.selectedDates.length&&re(),!1!==v.config.allowInput||void 0!==e&&v.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return v.hourElement.select()}),50))},v.redraw=ae,v.set=function(e,r){if(null!==e&&"object"==typeof e)for(var n in Object.assign(v.config,e),e)void 0!==ce[n]&&ce[n].forEach((function(e){return e()})) else v.config[e]=r,void 0!==ce[e]?ce[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(v.config[e]=s(r)) v.redraw(),ye(!1)},v.setDate=function(e,t,r){void 0===t&&(t=!1) void 0===r&&(r=v.config.dateFormat) if(0!==e&&!e||e instanceof Array&&0===e.length)return v.clear(t) le(e,r),v.showTimeInput=v.selectedDates.length>0,v.latestSelectedDateObj=v.selectedDates[v.selectedDates.length-1],v.redraw(),C(),S(),0===v.selectedDates.length&&v.clear(!1) ye(t),t&&he("onChange")},v.toggle=function(e){if(!0===v.isOpen)return v.close() v.open(e)} var ce={locale:[ie,G],showMonths:[V,k,W],minDate:[C],maxDate:[C]} function le(e,t){var r=[] if(e instanceof Array)r=e.map((function(e){return v.parseDate(e,t)})) else if(e instanceof Date||"number"==typeof e)r=[v.parseDate(e,t)] else if("string"==typeof e)switch(v.config.mode){case"single":case"time":r=[v.parseDate(e,t)] break case"multiple":r=e.split(v.config.conjunction).map((function(e){return v.parseDate(e,t)})) break case"range":r=e.split(v.l10n.rangeSeparator).map((function(e){return v.parseDate(e,t)}))}else v.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e))) v.selectedDates=r.filter((function(e){return e instanceof Date&&Z(e,!1)})),"range"===v.config.mode&&v.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function fe(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?v.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:v.parseDate(e.from,void 0),to:v.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function he(e,t){if(void 0!==v.config){var r=v.config[e] if(void 0!==r&&r.length>0)for(var n=0;r[n]&&n1||"static"===v.config.monthSelectorType?v.monthElements[t].textContent=d(r.getMonth(),v.config.shorthandCurrentMonth,v.l10n)+" ":v.monthsDropdownContainer.value=r.getMonth().toString(),e.value=r.getFullYear().toString()})),v._hidePrevMonthArrow=void 0!==v.config.minDate&&(v.currentYear===v.config.minDate.getFullYear()?v.currentMonth<=v.config.minDate.getMonth():v.currentYearv.config.maxDate.getMonth():v.currentYear>v.config.maxDate.getFullYear()))}function ve(e){return v.selectedDates.map((function(t){return v.formatDate(t,e)})).filter((function(e,t,r){return"range"!==v.config.mode||v.config.enableTime||r.indexOf(e)===t})).join("range"!==v.config.mode?v.config.conjunction:v.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==v.mobileInput&&v.mobileFormatStr&&(v.mobileInput.value=void 0!==v.latestSelectedDateObj?v.formatDate(v.latestSelectedDateObj,v.mobileFormatStr):""),v.input.value=ve(v.config.dateFormat),void 0!==v.altInput&&(v.altInput.value=ve(v.config.altFormat)),!1!==e&&he("onValueUpdate")}function be(e){var t=v.prevMonthNav.contains(e.target),r=v.nextMonthNav.contains(e.target) t||r?Y(t?-1:1):v.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?v.changeYear(v.currentYear+1):e.target.classList.contains("arrowDown")&&v.changeYear(v.currentYear-1)}return function(){v.element=v.input=h,v.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},p,JSON.parse(JSON.stringify(h.dataset||{}))),o={} v.config.parseDate=i.parseDate,v.config.formatDate=i.formatDate,Object.defineProperty(v.config,"enable",{get:function(){return v.config._enable},set:function(e){v.config._enable=fe(e)}}),Object.defineProperty(v.config,"disable",{get:function(){return v.config._disable},set:function(e){v.config._disable=fe(e)}}) var a="time"===i.mode if(!i.dateFormat&&(i.enableTime||a)){var u=x.defaultConfig.dateFormat||r.dateFormat o.dateFormat=i.noCalendar||a?"H:i"+(i.enableSeconds?":S":""):u+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||a)&&!i.altFormat){var c=x.defaultConfig.altFormat||r.altFormat o.altFormat=i.noCalendar||a?"h:i"+(i.enableSeconds?":S K":" K"):c+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(v.config.altInputClass=v.input.className+" "+v.config.altInputClass) Object.defineProperty(v.config,"minDate",{get:function(){return v.config._minDate},set:ne("min")}),Object.defineProperty(v.config,"maxDate",{get:function(){return v.config._maxDate},set:ne("max")}) var l=function(e){return function(t){v.config["min"===e?"_minTime":"_maxTime"]=v.parseDate(t,"H:i:S")}} Object.defineProperty(v.config,"minTime",{get:function(){return v.config._minTime},set:l("min")}),Object.defineProperty(v.config,"maxTime",{get:function(){return v.config._maxTime},set:l("max")}),"time"===i.mode&&(v.config.noCalendar=!0,v.config.enableTime=!0) Object.assign(v.config,o,i) for(var f=0;f-1?v.config[m]=s(d[m]).map(_).concat(v.config[m]):void 0===i[m]&&(v.config[m]=d[m])}he("onParseConfig")}(),ie(),function(){if(v.input=v.config.wrap?h.querySelector("[data-input]"):h,!v.input)return void v.config.errorHandler(new Error("Invalid input element specified")) v.input._type=v.input.type,v.input.type="text",v.input.classList.add("flatpickr-input"),v._input=v.input,v.config.altInput&&(v.altInput=c(v.input.nodeName,v.config.altInputClass),v._input=v.altInput,v.altInput.placeholder=v.input.placeholder,v.altInput.disabled=v.input.disabled,v.altInput.required=v.input.required,v.altInput.tabIndex=v.input.tabIndex,v.altInput.type="text",v.input.setAttribute("type","hidden"),!v.config.static&&v.input.parentNode&&v.input.parentNode.insertBefore(v.altInput,v.input.nextSibling)) v.config.allowInput||v._input.setAttribute("readonly","readonly") v._positionElement=v.config.positionElement||v._input}(),function(){v.selectedDates=[],v.now=v.parseDate(v.config.now)||new Date var e=v.config.defaultDate||("INPUT"!==v.input.nodeName&&"TEXTAREA"!==v.input.nodeName||!v.input.placeholder||v.input.value!==v.input.placeholder?v.input.value:null) e&&le(e,v.config.dateFormat) v._initialDate=v.selectedDates.length>0?v.selectedDates[0]:v.config.minDate&&v.config.minDate.getTime()>v.now.getTime()?v.config.minDate:v.config.maxDate&&v.config.maxDate.getTime()0&&(v.latestSelectedDateObj=v.selectedDates[0]) void 0!==v.config.minTime&&(v.config.minTime=v.parseDate(v.config.minTime,"H:i")) void 0!==v.config.maxTime&&(v.config.maxTime=v.parseDate(v.config.maxTime,"H:i")) v.minDateHasTime=!!v.config.minDate&&(v.config.minDate.getHours()>0||v.config.minDate.getMinutes()>0||v.config.minDate.getSeconds()>0),v.maxDateHasTime=!!v.config.maxDate&&(v.config.maxDate.getHours()>0||v.config.maxDate.getMinutes()>0||v.config.maxDate.getSeconds()>0),Object.defineProperty(v,"showTimeInput",{get:function(){return v._showTimeInput},set:function(e){v._showTimeInput=e,v.calendarContainer&&u(v.calendarContainer,"showTimeInput",e),v.isOpen&&oe()}})}(),v.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=v.currentMonth),void 0===t&&(t=v.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:v.l10n.daysInMonth[e]}},v.isMobile||function(){var e=window.document.createDocumentFragment() if(v.calendarContainer=c("div","flatpickr-calendar"),v.calendarContainer.tabIndex=-1,!v.config.noCalendar){if(e.appendChild((v.monthNav=c("div","flatpickr-months"),v.yearElements=[],v.monthElements=[],v.prevMonthNav=c("span","flatpickr-prev-month"),v.prevMonthNav.innerHTML=v.config.prevArrow,v.nextMonthNav=c("span","flatpickr-next-month"),v.nextMonthNav.innerHTML=v.config.nextArrow,V(),Object.defineProperty(v,"_hidePrevMonthArrow",{get:function(){return v.__hidePrevMonthArrow},set:function(e){v.__hidePrevMonthArrow!==e&&(u(v.prevMonthNav,"flatpickr-disabled",e),v.__hidePrevMonthArrow=e)}}),Object.defineProperty(v,"_hideNextMonthArrow",{get:function(){return v.__hideNextMonthArrow},set:function(e){v.__hideNextMonthArrow!==e&&(u(v.nextMonthNav,"flatpickr-disabled",e),v.__hideNextMonthArrow=e)}}),v.currentYearElement=v.yearElements[0],me(),v.monthNav)),v.innerContainer=c("div","flatpickr-innerContainer"),v.config.weekNumbers){var t=function(){v.calendarContainer.classList.add("hasWeeks") var e=c("div","flatpickr-weekwrapper") e.appendChild(c("span","flatpickr-weekday",v.l10n.weekAbbreviation)) var t=c("div","flatpickr-weeks") return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),r=t.weekWrapper,n=t.weekNumbers v.innerContainer.appendChild(r),v.weekNumbers=n,v.weekWrapper=r}v.rContainer=c("div","flatpickr-rContainer"),v.rContainer.appendChild(W()),v.daysContainer||(v.daysContainer=c("div","flatpickr-days"),v.daysContainer.tabIndex=-1),z(),v.rContainer.appendChild(v.daysContainer),v.innerContainer.appendChild(v.rContainer),e.appendChild(v.innerContainer)}v.config.enableTime&&e.appendChild(function(){v.calendarContainer.classList.add("hasTime"),v.config.noCalendar&&v.calendarContainer.classList.add("noCalendar") v.timeContainer=c("div","flatpickr-time"),v.timeContainer.tabIndex=-1 var e=c("span","flatpickr-time-separator",":"),t=f("flatpickr-hour",{"aria-label":v.l10n.hourAriaLabel}) v.hourElement=t.getElementsByTagName("input")[0] var r=f("flatpickr-minute",{"aria-label":v.l10n.minuteAriaLabel}) v.minuteElement=r.getElementsByTagName("input")[0],v.hourElement.tabIndex=v.minuteElement.tabIndex=-1,v.hourElement.value=i(v.latestSelectedDateObj?v.latestSelectedDateObj.getHours():v.config.time_24hr?v.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12 default:return e%12}}(v.config.defaultHour)),v.minuteElement.value=i(v.latestSelectedDateObj?v.latestSelectedDateObj.getMinutes():v.config.defaultMinute),v.hourElement.setAttribute("step",v.config.hourIncrement.toString()),v.minuteElement.setAttribute("step",v.config.minuteIncrement.toString()),v.hourElement.setAttribute("min",v.config.time_24hr?"0":"1"),v.hourElement.setAttribute("max",v.config.time_24hr?"23":"12"),v.minuteElement.setAttribute("min","0"),v.minuteElement.setAttribute("max","59"),v.timeContainer.appendChild(t),v.timeContainer.appendChild(e),v.timeContainer.appendChild(r),v.config.time_24hr&&v.timeContainer.classList.add("time24hr") if(v.config.enableSeconds){v.timeContainer.classList.add("hasSeconds") var n=f("flatpickr-second") v.secondElement=n.getElementsByTagName("input")[0],v.secondElement.value=i(v.latestSelectedDateObj?v.latestSelectedDateObj.getSeconds():v.config.defaultSeconds),v.secondElement.setAttribute("step",v.minuteElement.getAttribute("step")),v.secondElement.setAttribute("min","0"),v.secondElement.setAttribute("max","59"),v.timeContainer.appendChild(c("span","flatpickr-time-separator",":")),v.timeContainer.appendChild(n)}v.config.time_24hr||(v.amPM=c("span","flatpickr-am-pm",v.l10n.amPM[o((v.latestSelectedDateObj?v.hourElement.value:v.config.defaultHour)>11)]),v.amPM.title=v.l10n.toggleTitle,v.amPM.tabIndex=-1,v.timeContainer.appendChild(v.amPM)) return v.timeContainer}()) u(v.calendarContainer,"rangeMode","range"===v.config.mode),u(v.calendarContainer,"animate",!0===v.config.animate),u(v.calendarContainer,"multiMonth",v.config.showMonths>1),v.calendarContainer.appendChild(e) var a=void 0!==v.config.appendTo&&void 0!==v.config.appendTo.nodeType if((v.config.inline||v.config.static)&&(v.calendarContainer.classList.add(v.config.inline?"inline":"static"),v.config.inline&&(!a&&v.element.parentNode?v.element.parentNode.insertBefore(v.calendarContainer,v._input.nextSibling):void 0!==v.config.appendTo&&v.config.appendTo.appendChild(v.calendarContainer)),v.config.static)){var s=c("div","flatpickr-wrapper") v.element.parentNode&&v.element.parentNode.insertBefore(s,v.element),s.appendChild(v.element),v.altInput&&s.appendChild(v.altInput),s.appendChild(v.calendarContainer)}v.config.static||v.config.inline||(void 0!==v.config.appendTo?v.config.appendTo:window.document.body).appendChild(v.calendarContainer)}(),function(){v.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(v.element.querySelectorAll("[data-"+e+"]"),(function(t){return j(t,"click",v[e])}))})) if(v.isMobile)return void function(){var e=v.config.enableTime?v.config.noCalendar?"time":"datetime-local":"date" v.mobileInput=c("input",v.input.className+" flatpickr-mobile"),v.mobileInput.step=v.input.getAttribute("step")||"any",v.mobileInput.tabIndex=1,v.mobileInput.type=e,v.mobileInput.disabled=v.input.disabled,v.mobileInput.required=v.input.required,v.mobileInput.placeholder=v.input.placeholder,v.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",v.selectedDates.length>0&&(v.mobileInput.defaultValue=v.mobileInput.value=v.formatDate(v.selectedDates[0],v.mobileFormatStr)) v.config.minDate&&(v.mobileInput.min=v.formatDate(v.config.minDate,"Y-m-d")) v.config.maxDate&&(v.mobileInput.max=v.formatDate(v.config.maxDate,"Y-m-d")) v.input.type="hidden",void 0!==v.altInput&&(v.altInput.type="hidden") try{v.input.parentNode&&v.input.parentNode.insertBefore(v.mobileInput,v.input.nextSibling)}catch(t){}j(v.mobileInput,"change",(function(e){v.setDate(e.target.value,!1,v.mobileFormatStr),he("onChange"),he("onClose")}))}() var e=a(te,50) v._debouncedChange=a(T,300),v.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&j(v.daysContainer,"mouseover",(function(e){"range"===v.config.mode&&ee(e.target)})) j(window.document.body,"keydown",X),v.config.inline||v.config.static||j(window,"resize",e) void 0!==window.ontouchstart?j(window.document,"touchstart",J):j(window.document,"mousedown",R(J)) j(window.document,"focus",J,{capture:!0}),!0===v.config.clickOpens&&(j(v._input,"focus",v.open),j(v._input,"mousedown",R(v.open))) void 0!==v.daysContainer&&(j(v.monthNav,"mousedown",R(be)),j(v.monthNav,["keyup","increment"],A),j(v.daysContainer,"mousedown",R(ue))) if(void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement){j(v.timeContainer,["increment"],O),j(v.timeContainer,"blur",O,{capture:!0}),j(v.timeContainer,"mousedown",R(I)),j([v.hourElement,v.minuteElement],["focus","click"],(function(e){return e.target.select()})),void 0!==v.secondElement&&j(v.secondElement,"focus",(function(){return v.secondElement&&v.secondElement.select()})),void 0!==v.amPM&&j(v.amPM,"mousedown",R((function(e){O(e),T()})))}}(),(v.selectedDates.length||v.config.noCalendar)&&(v.config.enableTime&&S(v.config.noCalendar?v.latestSelectedDateObj||v.config.minDate:void 0),ye(!1)),k(),v.showTimeInput=v.selectedDates.length>0||v.config.noCalendar var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent) !v.isMobile&&n&&oe(),he("onReady")}(),v}function k(e,t){for(var r=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),n=[],i=0;ie.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){n=n.call(e)},n:function(){var e=n.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}(o) try{for(u.s();!(a=u.n()).done;){(0,a.value)(s)}}catch(c){u.e(c)}finally{u.f()}}})),define("@glimmer/component/-private/base-component-manager",["exports","@glimmer/component/-private/component"],(function(e,t){"use strict" function r(e,t){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i2?o-2:0),c=2;c1&&void 0!==arguments[1]?arguments[1]:function(){return o} return function(){for(var n=arguments.length,i=Array(n),o=0;o2?i-2:0),a=2;a2?o-2:0),c=2;c2?h-2:0),p=2;p2?r-2:0),i=2;it}))})),define("ember-awesome-macros/gte",["exports","ember-macro-helpers/curried-computed"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=(0,t.default)((function(e,t){return e>=t}))})),define("ember-awesome-macros/hash",["exports","ember-macro-helpers/curried-computed"],(function(e,t){"use strict" function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:function(){} return(0,r.default)((function(r,n){for(var i=arguments.length,o=Array(i>2?i-2:0),a=2;a1?r-1:0),i=1;ie.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{} return(0,t.decoratorWithParams)((function(t,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],u=s(a,1),c=u[0],l=i.initializer,f=i.value return delete i.initializer,delete i.value,d(o(o({},r),c),e(o(o({},i),{},{initializer:l,value:f})))(t,n,i)}))}Object.defineProperty(e,"__esModule",{value:!0}),e.keepLatestTaskGroup=e.keepLatestTask=e.enqueueTaskGroup=e.enqueueTask=e.dropTaskGroup=e.dropTask=void 0,Object.defineProperty(e,"lastValue",{enumerable:!0,get:function(){return n.default}}),e.taskGroup=e.task=e.restartableTaskGroup=e.restartableTask=void 0 var m=p(f) e.task=m var v=p(f,{restartable:!0}) e.restartableTask=v var y=p(f,{drop:!0}) e.dropTask=y var b=p(f,{keepLatest:!0}) e.keepLatestTask=b var g=p(f,{enqueue:!0}) e.enqueueTask=g var w=p(h) e.taskGroup=w var _=p(h,{restartable:!0}) e.restartableTaskGroup=_ var k=p(h,{drop:!0}) e.dropTaskGroup=k var x=p(h,{keepLatest:!0}) e.keepLatestTaskGroup=x var O=p(h,{enqueue:!0}) e.enqueueTaskGroup=O})),define("ember-concurrency-decorators/last-value",["exports","@ember-decorators/utils/decorator"],(function(e,t){"use strict" function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null==r)return var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return if("string"==typeof e)return n(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) "Object"===r&&e.constructor&&(r=e.constructor.name) if("Map"===r||"Set"===r)return Array.from(e) if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);r0?"succeed":"enqueue"}} e.enqueueTasksPolicy=o var a={cancelReason:"it belongs to a 'drop' Task that was already running",schedule:function(e){n(e),e.spliceTaskInstances(this.cancelReason,e.queuedTaskInstances,0,e.queuedTaskInstances.length)},getNextPerformStatus:function(e){return i(e)>0?"succeed":"drop"}} e.dropQueuedTasksPolicy=a var s={cancelReason:"it belongs to a 'restartable' Task that was .perform()ed again",schedule:function(e){var r=e.activeTaskInstances,n=e.queuedTaskInstances r.push.apply(r,t(n)),n.length=0 var i=Math.max(0,r.length-e.maxConcurrency) e.spliceTaskInstances(this.cancelReason,r,0,i)},getNextPerformStatus:function(e){return i(e)>0?"succeed":"cancel_previous"}} e.cancelOngoingTasksPolicy=s var u={cancelReason:"it belongs to a 'keepLatest' Task that was already running",schedule:function(e){n(e),e.spliceTaskInstances(this.cancelReason,e.queuedTaskInstances,0,e.queuedTaskInstances.length-1)}} e.dropButKeepLatestPolicy=u})),define("ember-concurrency/-cancelable-promise-helpers",["exports","ember-concurrency/-task-instance","ember-concurrency/utils"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.race=e.hashSettled=e.hash=e.allSettled=e.all=void 0 var n=regeneratorRuntime.mark(o),i=h(Ember.RSVP.Promise,"all",l) function o(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e) case 1:case"end":return t.stop()}}),n)}e.all=function(e){if(0===e.length)return Ember.RSVP.Promise.resolve(e) for(var n=0;ne.length)&&(t=e.length) for(var r=0,n=new Array(t);r")},_numRunningOrNumQueued:Ember.computed.or("numRunning","numQueued"),isRunning:Ember.computed.bool("_numRunningOrNumQueued"),isQueued:!1}) e.TaskGroup=u,e.TaskGroupProperty=s,e.TaskGroupProperty=s=o((function e(){a(this,e)})),(0,t.objectAssign)(s.prototype,n.propertyModifiers)})),define("ember-concurrency/-task-instance",["exports","ember-concurrency/utils"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.PERFORM_TYPE_UNLINKED=e.PERFORM_TYPE_LINKED=e.PERFORM_TYPE_DEFAULT=void 0,e.didCancel=n,e.getRunningInstance=function(){return r[r.length-1]},e.go=s,e.wrap=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:".cancel() was explicitly called" if(!this.isCanceling&&!this.isFinished){Ember.set(this,"isCanceling",!0) var r=this.task&&this.task._propertyName||"" Ember.set(this,"cancelReason","TaskInstance '".concat(r,"' was canceled because ").concat(e,". For more information, see: http://ember-concurrency.com/docs/task-cancelation-help")),this.hasStarted?this._proceedSoon(t.YIELDABLE_CANCEL,null):this._finalize(null,3)}},_defer:null,_promise:Ember.computed((function(){return this._defer=Ember.RSVP.defer(),this._maybeResolveDefer(),this._defer.promise})),_maybeResolveDefer:function(){this._defer&&this._completionState&&(1===this._completionState?this._defer.resolve(this.value):this._defer.reject(this.error))},then:i("then"),catch:i("catch"),finally:i("finally"),_finalize:function(e,t){var r=t,n=e this._index++,this.isCanceling&&(r=3,n=new Error(this.cancelReason),(this._debug||Ember.ENV.DEBUG_TASKS)&&console.log(this.cancelReason),n.name="TaskCancelation",n.taskInstance=this),Ember.set(this,"_completionState",r),Ember.set(this,"_result",n),1===r?(Ember.set(this,"isSuccessful",!0),Ember.set(this,"value",n)):2===r?(Ember.set(this,"isError",!0),Ember.set(this,"error",n)):3===r&&Ember.set(this,"error",n),Ember.set(this,"isFinished",!0),this._dispose(),this._runFinalizeCallbacks(),this._dispatchFinalizeEvents()},_finalizeCallbacks:null,_onFinalize:function(e){this._finalizeCallbacks||(this._finalizeCallbacks=[]),this._finalizeCallbacks.push(e),this._completionState&&this._runFinalizeCallbacks()},_runFinalizeCallbacks:function(){if(this._maybeResolveDefer(),this._finalizeCallbacks){for(var e=0,t=this._finalizeCallbacks.length;e1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{} return a.create(Object.assign({args:e,fn:t,context:this},r))._start()}var u=a e.default=u})),define("ember-concurrency/-task-property",["exports","ember-concurrency/-task-instance","ember-concurrency/-task-state-mixin","ember-concurrency/-property-modifiers-mixin","ember-concurrency/utils","ember-concurrency/-encapsulated-task"],(function(e,t,r,n,i,o){"use strict" function a(e,t){for(var r=0;re.length)&&(t=e.length) for(var r=0,n=new Array(t);r")},_taskInstanceFactory:t.default,perform:function(){for(var e=arguments.length,r=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:Boolean return r(this,a),(i=n.call(this)).object=e,i.key=t,i.predicateCallback="function"==typeof o?o:function(e){return e===o},i.observerBound=!1,i}return i(a,[{key:t.yieldableSymbol,value:function(e,r){var n=this this.observerFn=function(){var i=Ember.get(n.object,n.key) if(n.predicateCallback(i))return e.proceed(r,t.YIELDABLE_CONTINUE,i),!0},this.observerFn()||(Ember.addObserver(this.object,this.key,null,this.observerFn),this.observerBound=!0)}},{key:t.cancelableSymbol,value:function(){this.observerBound&&this.observerFn&&(Ember.removeObserver(this.object,this.key,null,this.observerFn),this.observerFn=null)}}]),a}(t.Yieldable)})),define("ember-concurrency/helpers/cancel-all",["exports","ember-concurrency/-helpers"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.cancelHelper=r,e.default=void 0 function r(e){var r=e[0] return!r||r.cancelAll,(0,t.taskHelperClosure)("cancel-all","cancelAll",[r,{reason:"the 'cancel-all' template helper was invoked"}])}var n=Ember.Helper.helper(r) e.default=n})),define("ember-concurrency/helpers/perform",["exports","ember-concurrency/-helpers"],(function(e,t){"use strict" function r(e,r){return(0,t.taskHelperClosure)("perform","perform",e,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.performHelper=r var n=Ember.Helper.helper(r) e.default=n})),define("ember-concurrency/helpers/task",["exports"],(function(e){"use strict" function t(e){return function(e){if(Array.isArray(e))return i(e)}(e)||o(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return e}(e)||o(e)||n(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r3?n-3:0),o=3;o1))throw new Error("Invalid `diffAttrs` argument. Expected either one or more strings and a function, or an options hash.") e=[].slice.call(arguments),n=e.pop()}return function(){var t,r=this,a={},s=!1 i.has(this)||(s=!0,i.set(this,{})),t=i.get(this),e.forEach((function(e){var n=r.get(e) o(e,t[e],n)||(a[e]=[t[e],n],t[e]=n)})),n.apply(this,[s?null:a].concat(Array.prototype.slice.call(arguments)))}}})),define("ember-fetch/errors",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.isAbortError=function(e){return"AbortError"==e.name},e.isBadRequestResponse=function(e){return 400===e.status},e.isConflictResponse=function(e){return 409===e.status},e.isForbiddenResponse=function(e){return 403===e.status},e.isGoneResponse=function(e){return 410===e.status},e.isInvalidResponse=function(e){return 422===e.status},e.isNotFoundResponse=function(e){return 404===e.status},e.isServerErrorResponse=function(e){return e.status>=500&&e.status<600},e.isUnauthorizedResponse=function(e){return 401===e.status}})),define("ember-fetch/types",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.isPlainObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)}})),define("ember-fetch/utils/determine-body-promise",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return e.text().then((function(r){var n=r try{n=JSON.parse(r)}catch(o){if(!(o instanceof SyntaxError))throw o var i=e.status !e.ok||204!==i&&205!==i&&"HEAD"!==t.method?Ember.debug("This response was unable to be parsed as json: ".concat(r)):n=void 0}return n}))}})),define("ember-fetch/utils/mung-options-for-fetch",["exports","ember-fetch/utils/serialize-query-params","ember-fetch/types"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var n=Ember.assign({credentials:"same-origin"},e) if(n.method=(n.method||n.type||"GET").toUpperCase(),n.data)if("GET"===n.method||"HEAD"===n.method){if(Object.keys(n.data).length){var i=n.url.indexOf("?")>-1?"&":"?" n.url+="".concat(i).concat((0,t.serializeQueryParams)(n.data))}}else(0,r.isPlainObject)(n.data)?n.body=JSON.stringify(n.data):n.body=n.data return n}})),define("ember-fetch/utils/serialize-query-params",["exports","ember-fetch/types"],(function(e,t){"use strict" function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.serializeQueryParams=i var n=/\[\]$/ function i(e){var i=[] return function e(a,s){var u,c,l if(a)if(Array.isArray(s))for(u=0,c=s.length;ue.length)&&(t=e.length) for(var r=0,n=new Array(t);r1?r-1:0),i=1;i1)return function(e){return e.map(n).reduce((function(e,t){var r=t.filter((function(t){return-1===e.indexOf(t)})) return e.concat(r)}),[])}(i) var o=e.indexOf(r.ARRAY_EACH) return-1===o&&(o=e.indexOf(r.ARRAY_LENGTH)),0===o?[""]:o>0?[e.slice(0,o-1)]:(0,t.default)(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n})),define("ember-macro-helpers/collapse-keys",["exports","ember-macro-helpers/collapse-key"],(function(e,t){"use strict" function r(e){var r=[],n=[] return e.forEach((function(e){var i=(0,t.default)(e) r=r.concat(i) var o=void 0 o=n.length?n[n.length-1]+1:0,n=n.concat(i.map((function(){return o})))})),{collapsedKeys:r,keyMap:n}}Object.defineProperty(e,"__esModule",{value:!0}),e.collapseKeysWithMap=r,e.default=function(e){return r(e).collapsedKeys}})),define("ember-macro-helpers/computed-unsafe",["exports","ember-macro-helpers/-build-computed","ember-macro-helpers/get-value-unsafe","ember-macro-helpers/flatten-keys-unsafe"],(function(e,t,r,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=(0,t.default)({collapseKeys:function(e){return e},getValue:r.default,flattenKeys:n.default})})),define("ember-macro-helpers/computed",["exports","ember-macro-helpers/-build-computed","ember-macro-helpers/collapse-keys","ember-macro-helpers/get-value","ember-macro-helpers/flatten-keys"],(function(e,t,r,n,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=(0,t.default)({collapseKeys:r.default,getValue:n.default,flattenKeys:i.default})})),define("ember-macro-helpers/create-class-computed",["exports","ember-macro-helpers/get-value","ember-macro-helpers/collapse-keys","ember-macro-helpers/flatten-keys","ember-macro-helpers/-constants"],(function(e,t,r,n,i){"use strict" function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},r=(0,t.default)(e) return void 0!==r?r:e.macro}})),define("ember-macro-helpers/get-value",["exports","ember-macro-helpers/is-computed"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.context,n=e.macro,i=e.key return(0,t.default)(n)?n._getter.call(r,i):"string"!=typeof n?n:Ember.isBlank(n)?r:Ember.get(r,n)}})),define("ember-macro-helpers/index",["exports","ember-macro-helpers/computed","ember-macro-helpers/create-class-computed","ember-macro-helpers/curried-computed","ember-macro-helpers/lazy-computed","ember-macro-helpers/lazy-curried-computed","ember-macro-helpers/literal","ember-macro-helpers/raw","ember-macro-helpers/reads","ember-macro-helpers/writable"],(function(e,t,r,n,i,o,a,s,u,c){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"computed",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"createClassComputed",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"curriedComputed",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"lazyComputed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"lazyCurriedComputed",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"literal",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"raw",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"reads",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"writable",{enumerable:!0,get:function(){return c.default}})})),define("ember-macro-helpers/is-computed",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return e instanceof t} var t=Ember.ComputedProperty})),define("ember-macro-helpers/lazy-computed",["exports","ember-macro-helpers/-build-computed","ember-macro-helpers/collapse-keys","ember-macro-helpers/get-value","ember-macro-helpers/flatten-keys"],(function(e,t,r,n,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=(0,t.default)({collapseKeys:r.default,getValue:n.default,flattenKeys:i.default,isLazy:!0})})),define("ember-macro-helpers/lazy-curried-computed",["exports","ember-macro-helpers/-build-computed","ember-macro-helpers/lazy-computed"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=(0,t.buildCurriedComputed)(r.default)})),define("ember-macro-helpers/literal",["exports","ember-macro-helpers/raw"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("ember-macro-helpers/normalize-array-key",["exports","ember-macro-helpers/-constants"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[] if("string"!=typeof e)return e var n=void 0,i=e.indexOf(t.ARRAY_EACH) if(-1!==i){var o=e.split("."),a=o[o.length-1] n=0===a.indexOf("{")?a.substring(1,a.length-1).split(","):[a]}else i=e.indexOf(t.ARRAY_LENGTH),n=[] 0===i?e="":i>0&&(e=e.slice(0,i-1)),r.forEach((function(e){void 0!==e&&-1===n.indexOf(e)&&n.push(e)})) var s=void 0 return 0===n.length?s=t.ARRAY_LENGTH:(s=t.ARRAY_EACH,1===n.length?s+=n[0]:s+="{"+n.join(",")+"}"),Ember.isBlank(e)?s:e+"."+s}})),define("ember-macro-helpers/raw",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return Ember.computed((function(){return e})).readOnly()}})),define("ember-macro-helpers/reads",["exports","ember-macro-helpers/writable"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("ember-macro-helpers/writable",["exports","ember-macro-helpers/computed"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,n){var i={get:function(e){return e}} return n&&("object"===(void 0===n?"undefined":r(n))&&n.set?i.set=n.set:i.set=function(){return n.apply(this,arguments)}),(0,t.default)(e,i)} var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}})),define("ember-moment/computeds/-base",["exports","ember-macro-helpers/computed-unsafe"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return function(){for(var r=arguments.length,n=Array(r),i=0;i1&&void 0!==arguments[1]?arguments[1]:{} if(!e||e&&e.length>3)throw new TypeError("ember-moment: Invalid Number of arguments, at most 3") var i=n(e,3),o=i[0],a=i[1],s=i[2],u=Object.create(r),c=Ember.assign(u,s) return(0,t.default)(o).calendar(a,c)}))})),define("ember-moment/computeds/duration",["exports","moment","ember-moment/computeds/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=(0,r.default)((function(e){return t.default.duration.apply(t.default,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&(r=e.pop()),t.default.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&(r=e.pop()),t.default.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t3)throw new TypeError("ember-moment: Invalid Number of arguments, expected 2 or 3") var f=[] return l>2&&f.push(c.shift()),(r=this.morphMoment(u.moment.apply(u,f),{locale:a,timeZone:s})).isBetween.apply(r,n(c).concat([i,o]))}))})})),define("ember-moment/helpers/is-same-or-after",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=r.default.extend({compute:(0,t.default)((function(e,t){var r,n=t.precision,i=t.locale,o=t.timeZone this._super.apply(this,arguments) var a=Ember.get(this,"moment"),s=e.length,u=[],c=[] return 1===s?c.push(e[0]):2===s&&(u.push(e[0]),c.push(e[1])),(r=this.morphMoment(a.moment.apply(a,u),{locale:i,timeZone:o})).isSameOrAfter.apply(r,c.concat([n]))}))})})),define("ember-moment/helpers/is-same-or-before",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=r.default.extend({compute:(0,t.default)((function(e,t){var r,n=t.precision,i=t.locale,o=t.timeZone this._super.apply(this,arguments) var a=Ember.get(this,"moment"),s=e.length,u=[],c=[] return 1===s?c.push(e[0]):2===s&&(u.push(e[0]),c.push(e[1])),(r=this.morphMoment(a.moment.apply(a,u),{locale:i,timeZone:o})).isSameOrBefore.apply(r,c.concat([n]))}))})})),define("ember-moment/helpers/is-same",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=r.default.extend({compute:(0,t.default)((function(e,t){var r,n=t.precision,i=t.locale,o=t.timeZone this._super.apply(this,arguments) var a=Ember.get(this,"moment"),s=e.length,u=[],c=[] return 1===s?c.push(e[0]):2===s&&(u.push(e[0]),c.push(e[1])),(r=this.morphMoment(a.moment.apply(a,u),{locale:i,timeZone:o})).isSame.apply(r,c.concat([n]))}))})})),define("ember-moment/helpers/moment-add",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:{} if(this._super.apply(this,arguments),!e||e&&e.length>3)throw new TypeError("ember-moment: Invalid Number of arguments, at most 3") var r=Ember.get(this,"moment"),i=t.locale,o=t.timeZone,a=n(e,3),s=a[0],u=a[1],c=a[2],l=Object.create(t) delete l.locale,delete l.timeZone var f=Ember.assign(l,c) return this.morphMoment(r.moment(s),{locale:i,timeZone:o}).calendar(u,f)}))})})),define("ember-moment/helpers/moment-diff",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) var n=function(e,t){if(Array.isArray(e))return e if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0 try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(u){i=!0,o=u}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t) throw new TypeError("Invalid attempt to destructure non-iterable instance")} e.default=r.default.extend({compute:(0,t.default)((function(e,t){var r=t.precision,i=t.float,o=t.locale,a=t.timeZone if(this._super.apply(this,arguments),!e||e&&2!==e.length)throw new TypeError("ember-moment: Invalid Number of arguments, must be 2") var s=Ember.get(this,"moment"),u=n(e,2),c=u[0],l=u[1] return this.morphMoment(s.moment(l),{locale:o,timeZone:a}).diff(c,r,i)}))})})),define("ember-moment/helpers/moment-duration",["exports","moment","ember-moment/helpers/-base"],(function(e,t,r){"use strict" function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t2)throw new TypeError("ember-moment: Invalid Number of arguments, at most 2") var s=a.moment(t.default.duration.apply(t.default,n(e))) return this.morphMoment(s._i,{locale:i,timeZone:o}).humanize()}})})),define("ember-moment/helpers/moment-format",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=r.default.extend({defaultFormatDidChange:Ember.observer("moment.defaultFormat",(function(){this.recompute()})),compute:(0,t.default)((function(e,t){var r,n=t.locale,i=t.timeZone this._super.apply(this,arguments) var o=Ember.get(this,"moment"),a=e.length if(a>3)throw new TypeError("ember-moment: Invalid number of arguments, expected at most 3") var s=[],u=[],c=Ember.get(this,"moment.defaultFormat") return s.push(e[0]),1!==a||Ember.isEmpty(c)?2===a?u.push(e[1]):a>2&&(s.push(e[2]),u.push(e[1])):u.push(c),(r=this.morphMoment(o.moment.apply(o,s),{locale:n,timeZone:i})).format.apply(r,u)}))})})),define("ember-moment/helpers/moment-from-now",["exports","ember-moment/utils/helper-compute","ember-moment/helpers/-base"],(function(e,t,r){"use strict" function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:{} this.changeLocale(e,t)},changeLocale:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} Ember.setProperties(this,{locale:e,localeOptions:r}),t.default.updateLocale(e,r),this.trigger("localeChanged",e)},setTimeZone:function(e){this.changeTimeZone(e)},changeTimeZone:function(e){Ember.set(this,"timeZone",e),this.trigger("timeZoneChanged",e)},isMoment:function(e){return t.default.isMoment(e)},moment:function(){var e=t.default.apply(void 0,arguments),r=Ember.getProperties(this,"locale","timeZone"),n=r.locale,i=r.timeZone return n&&e.locale&&(e=e.locale(n)),i&&e.tz&&(e=e.tz(i)),e},utc:function(){var e=t.default.utc.apply(t.default,arguments),r=Ember.getProperties(this,"locale"),n=r.locale return n&&e.locale&&(e=e.locale(n)),e}})})),define("ember-moment/utils/helper-compute",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return function(t,r){if(!t||t&&0===t.length)throw new TypeError("ember-moment: Invalid Number of arguments, expected at least 1") var n=t[0],i=r.allowEmpty||r["allow-empty"] if(null==i&&(i=Ember.get(this,"globalAllowEmpty")),Ember.isBlank(n)){if(i)return console.warn('ember-moment: an empty value (null, undefined, or "") was passed to ember-moment helper')}return e.apply(this,arguments)}}})),define("ember-promise-helpers/helpers/await",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) var t=function(e,t){if(Array.isArray(e))return e if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0 try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(u){i=!0,o=u}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t) throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=Ember.RSVP.Promise e.default=Ember.Helper.extend({valueBeforeSettled:null,compute:function(e){var r=this,n=t(e,1)[0] return n&&"function"==typeof n.then?this.ensureLatestPromise(n,(function(e){e.then((function(e){r.setValue(e,n)})).catch((function(){r.setValue(null,n)}))})):n},ensureLatestPromise:function(e,t){return this._wasSettled&&e===this._promise?this._value:(this._unsettle(),this._promise=e,t.call(this,r.resolve(e)),this.get("valueBeforeSettled"))},_settle:function(e){this.allowUpdates(e)&&(this._wasSettled=!0,this.recompute())},_unsettle:function(){this._wasSettled=!1,this._promise=null},setValue:function(e,t){this.allowUpdates(t)&&(this._value=e,this._settle(t))},allowUpdates:function(e){return this._promise===e}})})) define("ember-promise-helpers/helpers/is-fulfilled",["exports","ember-promise-helpers/helpers/await"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.default.extend({compute:function(e){var t=this,r=e[0] return this.ensureLatestPromise(r,(function(e){e.then((function(){t.setValue(!0,r)})).catch((function(){t.setValue(!1,r)}))}))}})})),define("ember-promise-helpers/helpers/is-pending",["exports","ember-promise-helpers/helpers/await"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.default.extend({valueBeforeSettled:!0,compute:function(e){var t=this,r=e[0] return this.ensureLatestPromise(r,(function(e){e.catch((function(){})).finally((function(){t.setValue(!1,r)}))}))}})})),define("ember-promise-helpers/helpers/is-rejected",["exports","ember-promise-helpers/helpers/await"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.default.extend({compute:function(e){var t=this,r=e[0] return this.ensureLatestPromise(r,(function(e){e.then((function(){t.setValue(!1,r)})).catch((function(){t.setValue(!0,r)}))}))}})})),define("ember-promise-helpers/helpers/promise-all",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.extend({compute:function(e){var t=Array.isArray(e[0])?e[0]:e return Ember.RSVP.all(t)}})})),define("ember-promise-helpers/helpers/promise-hash",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.extend({compute:function(e,t){return Ember.RSVP.hash(t)}})})),define("ember-promise-helpers/helpers/promise-rejected-reason",["exports","ember-promise-helpers/helpers/await"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=t.default.extend({compute:function(e){var t=this,r=e[0] return this.ensureLatestPromise(r,(function(e){e.then((function(){t.setValue(null,r)})).catch((function(e){t.setValue(e,r)}))}))}})})),define("ember-resolver/features",[],(function(){})),define("ember-resolver/index",["exports","ember-resolver/resolvers/classic"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("ember-resolver/resolver",["exports","ember-resolver/resolvers/classic"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("ember-resolver/resolvers/classic/container-debug-adapter",["exports","ember-resolver/resolvers/classic/index"],(function(e,t){"use strict" function r(e,t,r){var n=t.match(new RegExp("^/?"+r+"/(.+)/"+e+"$")) if(null!==n)return n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n=Ember.ContainerDebugAdapter.extend({_moduleRegistry:null,init:function(){this._super.apply(this,arguments),this.namespace=Ember.getOwner(this).lookup("application:main"),this._moduleRegistry||(this._moduleRegistry=new t.ModuleRegistry)},canCatalogEntriesByType:function(e){return"model"===e||this._super.apply(this,arguments)},catalogEntriesByType:function(e){for(var t=this._moduleRegistry.moduleNames(),n=Ember.A(),i=this.namespace.modulePrefix,o=0,a=t.length;o1){var r=t[0] return"component"===r||"helper"===r||"modifier"===r||"template"===r&&0===t[1].indexOf("components/")?r+":"+t[1].replace(/_/g,"-"):r+":"+Ember.String.dasherize(t[1].replace(/\./g,"/"))}return e},pluralize:function(e){return this.pluralizedTypes[e]||(this.pluralizedTypes[e]=e+"s")},podBasedLookupWithPrefix:function(e,t){var r=t.fullNameWithoutType return"template"===t.type&&(r=r.replace(/^components\//,"")),e+"/"+r+"/"+t.type},podBasedModuleName:function(e){var t=this.namespace.podModulePrefix||this.namespace.modulePrefix return this.podBasedLookupWithPrefix(t,e)},podBasedComponentsInSubdir:function(e){var t=this.namespace.podModulePrefix||this.namespace.modulePrefix if(t+="/components","component"===e.type||/^components/.test(e.fullNameWithoutType))return this.podBasedLookupWithPrefix(t,e)},resolveEngine:function(e){var t=e.fullNameWithoutType+"/engine" if(this._moduleRegistry.has(t))return this._extractDefaultExport(t)},resolveRouteMap:function(e){var t=e.fullNameWithoutType,r=t+"/routes" if(this._moduleRegistry.has(r)){var n=this._extractDefaultExport(r) return n}},resolveTemplate:function(e){var t=this.resolveOther(e) return null==t&&(t=Ember.TEMPLATES[e.fullNameWithoutType]),t},mainModuleName:function(e){if("main"===e.fullNameWithoutType)return e.prefix+"/"+e.type},defaultModuleName:function(e){return e.prefix+"/"+this.pluralize(e.type)+"/"+e.fullNameWithoutType},nestedColocationComponentModuleName:function(e){if("component"===e.type)return e.prefix+"/"+this.pluralize(e.type)+"/"+e.fullNameWithoutType+"/index"},prefix:function(e){var t=this.namespace.modulePrefix return this.namespace[e.type+"Prefix"]&&(t=this.namespace[e.type+"Prefix"]),t},moduleNameLookupPatterns:Ember.computed((function(){return[this.podBasedModuleName,this.podBasedComponentsInSubdir,this.mainModuleName,this.defaultModuleName,this.nestedColocationComponentModuleName]})).readOnly(),findModuleName:function(e,t){for(var r,n=this.get("moduleNameLookupPatterns"),i=0,o=n.length;i60?".":new Array(60-t.fullName.length).join("."),r||(r=this.lookupDescription(t)),console&&console.info&&console.info(i,t.fullName,n,r)}},knownForType:function(e){for(var t=this._moduleRegistry.moduleNames(),r=Object.create(null),n=0,i=t.length;nn.length+i.length)return e+":"+t.slice(o+n.length,a) var s=r+"/"+this.pluralize(e)+"/" return 0===t.indexOf(s)&&t.length>s.length?e+":"+t.slice(s.length):void 0},_extractDefaultExport:function(e){var t=this._moduleRegistry.get(e,null,null,!0) return t&&t.default&&(t=t.default),t}}) i.reopenClass({moduleBasedResolver:!0}) var o=i e.default=o})),define("ember-resolver/utils/class-factory",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return{create:function(t){return"function"==typeof e.extend?e.extend(t):e}}}})),define("ember-test-waiters/build-waiter",["exports","ember-test-waiters","ember-test-waiters/noop-test-waiter"],(function(e,t,r){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){0 return new r.default(e)}})),define("ember-test-waiters/index",["exports","ember-test-waiters/waiter-manager","ember-test-waiters/test-waiter","ember-test-waiters/build-waiter","ember-test-waiters/wait-for-promise"],(function(e,t,r,n,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"TestWaiter",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"_reset",{enumerable:!0,get:function(){return t._reset}}),Object.defineProperty(e,"buildWaiter",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"getPendingWaiterState",{enumerable:!0,get:function(){return t.getPendingWaiterState}}),Object.defineProperty(e,"getWaiters",{enumerable:!0,get:function(){return t.getWaiters}}),Object.defineProperty(e,"hasPendingWaiters",{enumerable:!0,get:function(){return t.hasPendingWaiters}}),Object.defineProperty(e,"register",{enumerable:!0,get:function(){return t.register}}),Object.defineProperty(e,"unregister",{enumerable:!0,get:function(){return t.unregister}}),Object.defineProperty(e,"waitForPromise",{enumerable:!0,get:function(){return i.default}})})),define("ember-test-waiters/noop-test-waiter",["exports"],(function(e){"use strict" function t(e,t){for(var r=0;re.length)&&(t=e.length) for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:this.nextToken(),t=arguments.length>1?arguments[1]:void 0 if(this.register(),this.items.has(e))throw new Error("beginAsync called for ".concat(e," but it is already pending.")) var r=new Error return this.items.set(e,{get stack(){return r.stack},label:t}),e}},{key:"endAsync",value:function(e){if(!this.items.has(e))throw new Error("endAsync called for ".concat(e," but it is not currently pending.")) this.items.delete(e)}},{key:"waitUntil",value:function(){return 0===this.items.size}},{key:"debugInfo",value:function(){return r(this.items.values())}},{key:"reset",value:function(){this.items.clear()}}])&&i(n.prototype,o),s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),e}() e.default=s})),define("ember-test-waiters/types/index",[],(function(){})),define("ember-test-waiters/wait-for-promise",["exports","ember-test-waiters/test-waiter"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){var r=e 0 return r} new t.default("promise-waiter")})),define("ember-test-waiters/waiter-manager",["exports"],(function(e){"use strict" function t(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r0}Ember.Test&&Ember.Test.registerWaiter((function(){return!i()}))})),define("ember-truth-helpers/helpers/and",["exports","ember-truth-helpers/utils/truth-convert"],(function(e,t){"use strict" function r(e){for(var r=0,n=e.length;re.length)&&(t=e.length) for(var r=0,n=new Array(t);ro}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.gt=n var i=Ember.Helper.helper(n) e.default=i})),define("ember-truth-helpers/helpers/gte",["exports"],(function(e){"use strict" function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null==r)return var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return if("string"==typeof e)return r(e,t) var n=Object.prototype.toString.call(e).slice(8,-1) "Object"===n&&e.constructor&&(n=e.constructor.name) if("Map"===n||"Set"===n)return Array.from(e) if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.gte=n var i=Ember.Helper.helper(n) e.default=i})),define("ember-truth-helpers/helpers/is-array",["exports"],(function(e){"use strict" function t(e){for(var t=0,r=e.length;te.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{} n(this,e) var o=i.addresses,a=i.abis,s=i.ipfsConfig this.provider=t,this.signer=r,this.options=i,this.addresses=o||{},this.abis=a||l,this.ipfs=new d(s),this.contracts={}}var t,r,a return t=e,a=[{key:"setup",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null return c("Kredits.setup() is deprecated use new Kredits().init() instead"),new e(t,r,{ipfsConfig:n}).init()}},{key:"for",value:function(t,r){var n,i,o=t.network,a=t.rpcUrl,u=t.wallet return a||"local"!==o||(a="http://localhost:8545"),n=a?new s.providers.JsonRpcProvider(a):new s.getDefaultProvider(o),u?i=u.connect(n):n.getSigner&&(i=n.getSigner("0xfa77675540E550b911a6AABF3805ac17C6641ec1")),new e(n,i,r)}},{key:"availableNetworks",value:function(){return Object.keys(f)}}],(r=[{key:"init",value:function(){var e=this return this.provider.getNetwork().then((function(t){return 0===Object.keys(e.addresses).length&&(e.addresses=f[t.chainId.toString()]),e}))}},{key:"Contributor",get:function(){return this.contractFor("Contributor")}},{key:"Contributors",get:function(){return c("Contributors is deprecated use Contributor instead"),this.contractFor("Contributor")}},{key:"Operator",get:function(){return this.Proposal}},{key:"Token",get:function(){return this.contractFor("Token")}},{key:"Contribution",get:function(){return this.contractFor("Contribution")}},{key:"Reimbursement",get:function(){return this.contractFor("Reimbursement")}},{key:"contractFor",value:function(e){if(this.contracts[e])return this.contracts[e] var t,r,n,i=(r=(t=o(e))[0],n=t.slice(1),"".concat(r.toUpperCase()).concat(n.join(""))),a=this.addresses[i],u=this.abis[i] if(!a||!u)throw new Error("Address or ABI not found for ".concat(i)) var c=this.signer||this.provider,l=new s.Contract(a,u,c) return this.contracts[e]=new h[i](l),this.contracts[e].ipfs=this.ipfs,this.contracts[e]}},{key:"preflightChecks",value:function(){return new u(this).check()}}])&&i(t.prototype,r),a&&i(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}() e.exports=p},214:function(e,t){},222:function(e,t){},224:function(e,t){function r(e,t){for(var r=0;re.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:"filter" return this.all().then((function(r){var n=Object.entries(e) return r[t]((function(e){return!!e.accounts&&e.accounts.find((function(e){return n.every((function(t){var r=a(t,2),n=r[0],i=r[1] return e[n]===i}))}))}))}))}},{key:"add",value:(n=o(regeneratorRuntime.mark((function e(t){var r,n,i,o=this,a=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},n=new y(t),e.prev=2,e.next=5,n.validate() case 5:e.next=10 break case 7:return e.prev=7,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0)) case 10:return i=n.serialize(),e.abrupt("return",this.ipfs.add(i).then((function(e){var n,i=[t.account,e.hashDigest,e.hashFunction,e.hashSize] return(n=o.contract).addContributor.apply(n,i.concat([r]))})).catch((function(e){throw console.log("Failed to add IPFS document:",e.message),e}))) case 12:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(e){return n.apply(this,arguments)})},{key:"updateProfile",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{} return this.getById(e).then(function(){var i=o(regeneratorRuntime.mark((function i(o){var a,s,u return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=Object.assign(o,t),s=new y(a),i.prev=2,i.next=5,s.validate() case 5:i.next=10 break case 7:return i.prev=7,i.t0=i.catch(2),i.abrupt("return",Promise.reject(i.t0)) case 10:return u=s.serialize(),i.abrupt("return",r.ipfs.add(u).then((function(t){return r.contract.updateContributorProfileHash(e,t.hashDigest,t.hashFunction,t.hashSize,n)}))) case 12:case"end":return i.stop()}}),i,null,[[2,7]])}))) return function(e){return i.apply(this,arguments)}}())}}])&&f(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(v) e.exports=g},232:function(e,t){function r(e,t,r){var n=Math.ceil(r/t) return(e=(e=parseInt(e)||1)>n?n:e)<1?1:e}function n(e,t,r,n){var i,o,a=r*(t-1) "asc"===e?(i=1+a,o=function(e,t){return i+t}):(i=n-a,o=function(e,t){return i-t}) var s=a+r return s>n&&(r-=s-n),Array.from({length:r},o)}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.order,o=t.page i=i||"desc",o=o||{} var a=parseInt(o.size)||25,s=r(o.number,a,e) return n(i,s,a,e)}},233:function(e,t,r){function n(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=n.formatEther(e) return t.asFloat?parseFloat(r):parseInt(r)}},239:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function o(e){return function(){var t=this,r=arguments return new Promise((function(n,o){var a=e.apply(t,r) function s(e){i(a,n,o,s,u,"next",e)}function u(e){i(a,n,o,s,u,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r1&&void 0!==u[1]?u[1]:{},n=new d(t),i=t.confirmedAtBlock||0,o=t.vetoed||!1,e.prev=4,e.next=7,n.validate() case 7:e.next=12 break case 9:return e.prev=9,e.t0=e.catch(4),e.abrupt("return",Promise.reject(e.t0)) case 12:return a=n.serialize(),e.abrupt("return",this.ipfs.add(a).then((function(e){var n,a=[t.amount,t.contributorId,e.hashDigest,e.hashFunction,e.hashSize,i,o] return(n=s.contract).add.apply(n,a.concat([r]))}))) case 14:case"end":return e.stop()}}),e,this,[[4,9]])}))),function(e){return n.apply(this,arguments)})},{key:"addContribution",value:function(){return p("The function `addContribution()` is deprecated and will be removed in the next major version. Use `add()` instead"),this.add.apply(this,arguments)}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(h) e.exports=m},240:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r1&&void 0!==a[1]?a[1]:{},n=new h(t),e.prev=2,e.next=5,n.validate() case 5:e.next=10 break case 7:return e.prev=7,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0)) case 10:return i=n.serialize(),e.abrupt("return",this.ipfs.add(i).then((function(e){var n,i=[t.contributorId,t.amount,e.hashDigest,e.hashFunction,e.hashSize] return(n=o.contract).addProposal.apply(n,i.concat([r]))}))) case 12:case"end":return e.stop()}}),e,this,[[2,7]])})),c=function(){var e=this,t=arguments return new Promise((function(r,o){var a=n.apply(e,t) function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))},function(e){return c.apply(this,arguments)})},{key:"addProposal",value:function(){return d("The function `addProposal()` is deprecated and will be removed in the next major version. Use `add()` instead"),this.add.apply(this,arguments)}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(f) e.exports=p},241:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=u(e) if(t){var i=u(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return s(this,r)}}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined") return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(n,e) var t,r=a(n) function n(){return i(this,n),r.apply(this,arguments)}return t=n,Object.defineProperty(t,"prototype",{writable:!1}),t}(r(118)) e.exports=c},242:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r1&&void 0!==f[1]?f[1]:{},n=parseInt(t.amount),i=t.token,o=t.recipientId,a=t.confirmedAtBlock||0,s=t.vetoed||!1,u=t.expenses.map((function(e){return new h(e)})),("number"!=typeof n||n<=0)&&(c="Invalid data: amount must be a positive number."),i&&""!==i||(c="Invalid data: token must be a token address."),o&&""!==o||(c="Invalid data: recipientId is required."),0===u.length&&(c="Invalid data: at least one expense item is required."),!c){e.next=13 break}return e.abrupt("return",Promise.reject(new Error(c))) case 13:return e.abrupt("return",Promise.all(u.map((function(e){return e.validate()}))).then((function(){var e=JSON.stringify(u.map((function(e){return e.data})),null,2) return l.ipfs.add(e).then((function(e){var t,u=[n,i,parseInt(o),e.hashDigest,e.hashFunction,e.hashSize,a,s] return(t=l.contract).add.apply(t,u.concat([r]))}))}))) case 14:case"end":return e.stop()}}),e)})),c=function(){var e=this,t=arguments return new Promise((function(r,o){var a=n.apply(e,t) function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))},function(e){return c.apply(this,arguments)})}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(f) e.exports=d},243:function(e,t,r){function n(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{} return this.count.then((function(r){var n=f(r,t).map((function(t){return e.getById(t)})) return Promise.all(n)}))}}])&&o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(l) e.exports=h},86:function(e,t){window._eai_r=require,window._eai_d=define},90:function(e,t,r){var n=r(237).freshApi() n.addFormat({date:function(e){return/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(e)?null:"A valid ISO 8601 full-date string is expected"},time:function(e){return/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/.test(e)?null:"A valid ISO 8601 full-time string is expected"}}),e.exports=n}});(window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[2],[function(e,t,r){"use strict" r.d(t,"k",(function(){return a})),r.d(t,"j",(function(){return u})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"o",(function(){return f})),r.d(t,"p",(function(){return h})),r.d(t,"l",(function(){return d})),r.d(t,"i",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return v})),r.d(t,"c",(function(){return y})),r.d(t,"g",(function(){return b})),r.d(t,"f",(function(){return g})),r.d(t,"h",(function(){return w})),r.d(t,"n",(function(){return _})),r.d(t,"m",(function(){return k})) var n=new(r(2).b)("bytes/5.6.1") function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments) return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(e)&&!(e.length%2)||u(e)}function s(e){return"number"==typeof e&&e==e&&e%1==0}function u(e){if(null==e)return!1 if(e.constructor===Uint8Array)return!0 if("string"==typeof e)return!1 if(!s(e.length)||e.length<0)return!1 for(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value") for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256)) return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){var a=e.substring(2) a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e)) for(var s=[],c=0;ct&&n.throwArgumentError("value out of range","value",arguments[0]) var r=new Uint8Array(t) return r.set(e,t-e.length),o(r)}function d(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function p(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value") for(var r="";e;)r="0123456789abcdef"[15&e]+r,e=Math.floor(e/16) return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString() if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase() if(u(e)){for(var o="0x",a=0;a>4]+"0123456789abcdef"[15&s]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!=typeof e)e=p(e) else if(!d(e)||e.length%2)return null return(e.length-2)/2}function v(e,t,r){return"string"!=typeof e?e=p(e):(!d(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function y(e){var t="0x" return e.forEach((function(e){t+=p(e).substring(2)})),t}function b(e){var t=g(p(e,{hexPad:"left"})) return"0x"===t?"0x0":t}function g(e){"string"!=typeof e&&(e=p(e)),d(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2) for(var t=0;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2) return e}function _(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"} if(a(e)){var r=c(e) 64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64))):65===r.length?(t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=p(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=h(c(t._vs),32) t._vs=p(i) var o=i[0]>=128?1:0 null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127 var s=p(i) null==t.s?t.s=s:t.s!==s&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2 else if(null==t.v)t.v=27+t.recoveryParam else{var u=0===t.v||1===t.v?t.v:1-t.v%2 t.recoveryParam!==u&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=w(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=w(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e) var l=c(t.s) l[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128) var f=p(l) t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function k(e){return p(l([(e=_(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict" r.d(t,"k",(function(){return a})),r.d(t,"j",(function(){return u})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"o",(function(){return f})),r.d(t,"p",(function(){return h})),r.d(t,"l",(function(){return d})),r.d(t,"i",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return v})),r.d(t,"c",(function(){return y})),r.d(t,"g",(function(){return b})),r.d(t,"f",(function(){return g})),r.d(t,"h",(function(){return w})),r.d(t,"n",(function(){return _})),r.d(t,"m",(function(){return k})) var n=new(r(3).b)("bytes/5.6.1") function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments) return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(e)&&!(e.length%2)||u(e)}function s(e){return"number"==typeof e&&e==e&&e%1==0}function u(e){if(null==e)return!1 if(e.constructor===Uint8Array)return!0 if("string"==typeof e)return!1 if(!s(e.length)||e.length<0)return!1 for(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value") for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256)) return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){var a=e.substring(2) a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e)) for(var s=[],c=0;ct&&n.throwArgumentError("value out of range","value",arguments[0]) var r=new Uint8Array(t) return r.set(e,t-e.length),o(r)}function d(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function p(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value") for(var r="";e;)r="0123456789abcdef"[15&e]+r,e=Math.floor(e/16) return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString() if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase() if(u(e)){for(var o="0x",a=0;a>4]+"0123456789abcdef"[15&s]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!=typeof e)e=p(e) else if(!d(e)||e.length%2)return null return(e.length-2)/2}function v(e,t,r){return"string"!=typeof e?e=p(e):(!d(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function y(e){var t="0x" return e.forEach((function(e){t+=p(e).substring(2)})),t}function b(e){var t=g(p(e,{hexPad:"left"})) return"0x"===t?"0x0":t}function g(e){"string"!=typeof e&&(e=p(e)),d(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2) for(var t=0;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2) return e}function _(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"} if(a(e)){var r=c(e) 64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64))):65===r.length?(t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=p(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=h(c(t._vs),32) t._vs=p(i) var o=i[0]>=128?1:0 null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127 var s=p(i) null==t.s?t.s=s:t.s!==s&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2 else if(null==t.v)t.v=27+t.recoveryParam else{var u=0===t.v||1===t.v?t.v:1-t.v%2 t.recoveryParam!==u&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=w(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=w(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e) var l=c(t.s) l[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128) var f=p(l) t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function k(e){return p(l([(e=_(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict" function n(e,t){for(var r=0;ru[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=h[15&t[o]] i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version)) var a=t,u="" switch(r){case o.NUMERIC_FAULT:u="NUMERIC_FAULT" var c=t switch(c){case"overflow":case"underflow":case"division-by-zero":u+="-"+c break case"negative-power":case"negative-width":u+="-unsupported" break case"unbound-bitwise-result":u+="-unbound-result"}break case o.CALL_EXCEPTION:case o.INSUFFICIENT_FUNDS:case o.MISSING_NEW:case o.NONCE_EXPIRED:case o.REPLACEMENT_UNDERPRICED:case o.TRANSACTION_REPLACED:case o.UNPREDICTABLE_GAS_LIMIT:u=r}u&&(t+=" [ See: https://links.ethers.org/v5-errors-"+u+" ]"),i.length&&(t+=" ("+i.join(", ")+")") var l=new Error(t) return l.reason=a,l.code=r,Object.keys(n).forEach((function(e){l[e]=n[e]})),l}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}},{key:"checkSafeUint53",value:function(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}])&&n(t.prototype,r),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}() d.errors=o,d.levels=i},function(e,t,r){"use strict" function n(e,t){for(var r=0;ru[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=h[15&t[o]] i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version)) var a=t,u="" switch(r){case o.NUMERIC_FAULT:u="NUMERIC_FAULT" var c=t switch(c){case"overflow":case"underflow":case"division-by-zero":u+="-"+c break case"negative-power":case"negative-width":u+="-unsupported" break case"unbound-bitwise-result":u+="-unbound-result"}break case o.CALL_EXCEPTION:case o.INSUFFICIENT_FUNDS:case o.MISSING_NEW:case o.NONCE_EXPIRED:case o.REPLACEMENT_UNDERPRICED:case o.TRANSACTION_REPLACED:case o.UNPREDICTABLE_GAS_LIMIT:u=r}u&&(t+=" [ See: https://links.ethers.org/v5-errors-"+u+" ]"),i.length&&(t+=" ("+i.join(", ")+")") var l=new Error(t) return l.reason=a,l.code=r,Object.keys(n).forEach((function(e){l[e]=n[e]})),l}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}},{key:"checkSafeUint53",value:function(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}])&&n(t.prototype,r),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}() d.errors=o,d.levels=i},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(95) t.configure=function(e){return function(t){return e(new n.Client(t),t)}}},function(e,t,r){"use strict" var n=["arg","searchParams","hashAlg","mtime","mode"] function i(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]) return i}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}Object.defineProperty(t,"__esModule",{value:!0}) var u=r(141),c=r(142) t.toUrlSearchParams=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.arg,r=e.searchParams,i=e.hashAlg,a=e.mtime,l=e.mode,f=s(e,n) r&&(f=o(o({},f),r)),i&&(f.hash=i),null!=a&&(a=c.parseMtime(a),f.mtime=a.secs,f.mtimeNsecs=a.nsecs),null!=l&&(f.mode=u.modeToString(l)),f.timeout&&!isNaN(f.timeout)&&(f.timeout="".concat(f.timeout,"ms")),null==t?t=[]:Array.isArray(t)||(t=[t]) var h=new URLSearchParams(f) return t.forEach((function(e){return h.append("arg",e)})),h}},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict" function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t var r=function(){} r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s "object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26 try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(468).Buffer}catch(e){}function u(e,t){var r=e.charCodeAt(t) return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=u(e,r) return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""} var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function p(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=d[e] r="" var p=this.clone() for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(e) r=(p=p.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip() var a,s,u="le"===t,c=new e(o),l=this.clone() if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function v(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(m=p),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this.strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863) for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e return r},a.prototype.idivn=function(e){i(e<=67108863) for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this.strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var b={k256:null,p224:null,p192:null,p25519:null} function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(w,g),w.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e] var t if("k256"===e)t=new w else if("p224"===e)t=new _ else if("p192"===e)t=new k else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new x}return b[e]=t,t},O.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new E(e)},o(E,O),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},function(e,t,r){"use strict" function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null!=r){var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=u(e,r) return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""} var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function p(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=d[e] r="" var p=this.clone() for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(e) r=(p=p.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip() var a,s,u="le"===t,c=new e(o),l=this.clone() if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function v(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(m=p),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this.strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863) for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e return r},a.prototype.idivn=function(e){i(e<=67108863) for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this.strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var b={k256:null,p224:null,p192:null,p25519:null} function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(w,g),w.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e] var t if("k256"===e)t=new w else if("p224"===e)t=new _ else if("p192"===e)t=new k else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new x}return b[e]=t,t},O.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new E(e)},o(E,O),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t var r=function(){} r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(245),i=r(246),o=r(120) function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes") return 0|e}function p(e,t){if(u.isBuffer(e))return e.length if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength "string"!=typeof e&&(e=""+e) var r=e.length if(0===r)return 0 for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r case"utf8":case"utf-8":case void 0:return U(e).length case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r case"hex":return r>>>1 case"base64":return z(e).length default:if(n)return U(e).length t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1 if((void 0===t||t<0)&&(t=0),t>this.length)return"" if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"" if((r>>>=0)<=(t>>>=0))return"" for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r) case"utf8":case"utf-8":return S(this,t,r) case"ascii":return P(this,t,r) case"latin1":case"binary":return M(this,t,r) case"base64":return E(this,t,r) case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r) default:if(n)throw new TypeError("Unknown encoding: "+e) e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t] e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1 if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1 r=e.length-1}else if(r<0){if(!i)return-1 r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i) if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i) throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,a=1,s=e.length,u=t.length if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1 a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1 for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i var o=t.length if(o%2!=0)throw new TypeError("Invalid hex string") n>o/2&&(n=o/2) for(var a=0;a>8,i=r%256,o.push(i),o.push(n) return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r) for(var n=[],i=t;i239?4:c>223?3:c>191?2:1 if(i+f<=r)switch(f){case 1:c<128&&(l=c) break case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u) break case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u) break case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length if(t<=4096)return String.fromCharCode.apply(String,e) for(var r="",n=0;nn)&&(r=n) for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance') if(t>i||te.length)throw new RangeError("Index out of range")}function C(e,t,r,n){t<0&&(t=65535+t+1) for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function I(e,t,r,n){t<0&&(t=4294967295+t+1) for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range") if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,o){return o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1) return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers") if(e===t)return 0 for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer") if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index") if(n>=i&&t>=r)return 0 if(n>=i)return-1 if(t>=r)return 1 if(this===e)return 0 for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds") n||(n="utf8") for(var o=!1;;)switch(n){case"hex":return g(this,e,t,r) case"utf8":case"utf-8":return w(this,e,t,r) case"ascii":return _(this,e,t,r) case"latin1":case"binary":return k(this,e,t,r) case"base64":return x(this,e,t,r) case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r) default:if(o)throw new TypeError("Unknown encoding: "+n) n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}} u.prototype.slice=function(e,t){var r,n=this.length if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i return n},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length) for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length) for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length) var r=this[e]|this[e+1]<<8 return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length) var r=this[e+1]|this[e]<<8 return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0) var i=1,o=0 for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255 return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1) T(this,e,t,r,i-1,-i)}var o=0,a=1,s=0 for(this[t]=255&e;++o>0)-s&255 return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1) T(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0 for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255 return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds") if(n<0)throw new RangeError("sourceEnd out of bounds") n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r] else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189) continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189) continue}i=r continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189) if(i=null,r<128){if((t-=1)<0)break o.push(r)}else if(r<2048){if((t-=2)<0)break o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point") if((t-=4)<0)break o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"" for(;e.length%4!=0;)e+="=" return e}(e))}function q(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i] return i}}).call(this,r(11))},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n n=function(){return this}() try{n=n||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}e.exports=n},function(e,t){var r,n,i=e.exports={} function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0) if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0) try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}() var u,c=[],l=!1,f=-1 function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h) l=!0 for(var t=c.length;t;){for(u=c,c=[];++f1)for(var r=1;re.major?1:0}}]),e}() a.uint=new a(0,"uint",!0),a.negint=new a(1,"negint",!0),a.bytes=new a(2,"bytes",!0),a.string=new a(3,"string",!0),a.array=new a(4,"array",!1),a.map=new a(5,"map",!1),a.tag=new a(6,"tag",!1),a.float=new a(7,"float",!0),a.false=new a(7,"false",!0),a.true=new a(7,"true",!0),a.null=new a(7,"null",!0),a.undefined=new a(7,"undefined",!0),a.break=new a(7,"break",!0) var s=function(){function e(t,r,i){n(this,e),this.type=t,this.value=r,this.encodedLength=i,this.encodedBytes=void 0,this.byteValue=void 0}return o(e,[{key:"toString",value:function(){return"Token[".concat(this.type,"].").concat(this.value)}}]),e}() t.Token=s,t.Type=a},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e,t){for(var r=0;r0&&"/"!==t.charAt(0))throw new Error('multiaddr "'.concat(t,'" must start with a "/"')) this.bytes=o.fromString(t)}else{if(!e.isMultiaddr(t))throw new Error("addr must be a string, Buffer, or another Multiaddr") this.bytes=o.fromBytes(t.bytes)}}var t,r,v,y,b return t=e,v=[{key:"fromNodeAddress",value:function(t,r){if(!t)throw new Error("requires node address object") if(!r)throw new Error("requires transport protocol") var n switch(t.family){case 4:n="ip4" break case 6:n="ip6" break default:throw Error("Invalid addr family. Got '".concat(t.family,"' instead of 4 or 6"))}return new e("/"+[n,t.address,r,t.port].join("/"))}},{key:"isName",value:function(t){return!!e.isMultiaddr(t)&&t.protos().some((function(e){return e.resolvable}))}},{key:"isMultiaddr",value:function(t){return t instanceof e||Boolean(t&&t[m])}}],(r=[{key:"toString",value:function(){return o.bytesToString(this.bytes)}},{key:"toJSON",value:function(){return this.toString()}},{key:"toOptions",value:function(){var e={},t=this.toString().split("/") return e.family="ip4"===t[1]?4:6,e.host=t[2],e.transport=t[3],e.port=parseInt(t[4]),e}},{key:"protos",value:function(){return this.protoCodes().map((function(e){return Object.assign({},a(e))}))}},{key:"protoCodes",value:function(){for(var e=[],t=this.bytes,r=0;r=0;n--)if(r[n][0]===t)return new e(o.tuplesToBytes(r.slice(0,n))) return this}},{key:"getPeerId",value:function(){try{var e=this.stringTuples().filter((function(e){return e[0]===a.names.ipfs.code})).pop() if(e&&e[1]){var t=e[1] return"Q"===t[0]||"1"===t[0]?h(c.decode("z".concat(t)),"base58btc"):h(u.parse(t).multihash.bytes,"base58btc")}return null}catch(e){return null}}},{key:"getPath",value:function(){var e=null try{(e=this.stringTuples().filter((function(e){return!!a(e[0]).path}))[0][1])||(e=null)}catch(t){e=null}return e}},{key:"equals",value:function(e){return d(this.bytes,e.bytes)}},{key:"resolve",value:(y=regeneratorRuntime.mark((function t(){var r,n,i return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.protos().find((function(e){return e.resolvable}))){t.next=3 break}return t.abrupt("return",[this]) case 3:if(n=p.get(r.name)){t.next=6 break}throw l(new Error("no available resolver for ".concat(r.name)),"ERR_NO_AVAILABLE_RESOLVER") case 6:return t.next=8,n(this) case 8:return i=t.sent,t.abrupt("return",i.map((function(t){return new e(t)}))) case 10:case"end":return t.stop()}}),t,this)})),b=function(){var e=this,t=arguments return new Promise((function(r,i){var o=y.apply(e,t) function a(e){n(o,r,i,a,s,"next",e)}function s(e){n(o,r,i,a,s,"throw",e)}a(void 0)}))},function(){return b.apply(this,arguments)})},{key:"nodeAddress",value:function(){var e=this.protoCodes(),t=this.protoNames(),r=this.toString().split("/").slice(1) if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".') if(4!==e[0]&&41!==e[0]&&54!==e[0]&&55!==e[0])throw new Error("no protocol with name: \"'".concat(t[0],'\'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".')) if("tcp"!==r[2]&&"udp"!==r[2])throw new Error("no protocol with name: \"'".concat(t[1],'\'". Must have a valid transport protocol: "{tcp, udp}".')) return{family:41===e[0]||55===e[0]?6:4,address:r[1],port:parseInt(r[3])}}},{key:"isThinWaistAddress",value:function(e){var t=(e||this).protos() return!(2!==t.length||4!==t[0].code&&41!==t[0].code||6!==t[1].code&&273!==t[1].code)}},{key:f,value:function(){return""}},{key:"inspect",value:function(){return""}}])&&i(t.prototype,r),v&&i(t,v),Object.defineProperty(t,"prototype",{writable:!1}),e}() v.protocols=a,v.resolvers=p,e.exports={Multiaddr:v,multiaddr:function(e){return new v(e)},protocols:a,resolvers:p}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0}) return e}e.exports=function(e,t,r){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code") r||(r={}),"object"===n(t)&&(r=t,t=""),t&&(r.code=t) try{return i(e,r)}catch(t){r.message=e.message,r.stack=e.stack var o=function(){} return o.prototype=Object.create(Object.getPrototypeOf(e)),i(new o,r)}}},function(e,t,r){var n=r(10),i=n.Buffer function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number") return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number") var n=i(e) return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return n.SlowBuffer(e)}},,,function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=[] n[23]=1,n[24]=2,n[25]=3,n[26]=5,n[27]=9,t.assertEnoughData=function(e,t,r){if(e.length-t(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]] e=e.clone(),t=t.clone() for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3 3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict" !function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1 for(var t=0;t255)return!1 return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e) return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e) throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,u={toBytes:function(e){var t=[],r=0 for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},c=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),l={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],g=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],O=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925] function S(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t] for(var a,s=0,u=i;u>16&255]<<24^h[a>>8&255]<<16^h[255&a]<<8^h[a>>24&255]^f[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^h[a>>16&255]<<16^h[a>>24&255]<<24,t=i/2+1;t>2,d=u%4,this._Ke[c][d]=o[t],this._Kd[e-c][d]=o[t++],u++}for(var c=1;c>24&255]^x[a>>16&255]^O[a>>8&255]^E[255&a]},P.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)") for(var t=this._Ke.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i] for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i] n=r.slice()}var s,u=o(16) for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+3)%4]]^s) return u},P.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)") for(var t=this._Kd.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i] for(var a=1;a>24&255]^g[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[a][i] n=r.slice()}var s,u=o(16) for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(d[n[i]>>24&255]^s>>24),u[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(d[255&n[(i+1)%4]]^s) return u} var M=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`") this.description="Electronic Code Block",this.name="ecb",this._aes=new P(t)} M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)") for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)") this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++ break}this._counter[e]=0}} var C=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`") this.description="Counter",this.name="ctr",r instanceof T||(r=new T(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new P(t)} C.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range") for(var r=e.length-t,n=0;n255)return!1 return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e) return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e) throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,u={toBytes:function(e){var t=[],r=0 for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},c=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),l={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],g=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],O=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925] function S(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t] for(var a,s=0,u=i;u>16&255]<<24^h[a>>8&255]<<16^h[255&a]<<8^h[a>>24&255]^f[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^h[a>>16&255]<<16^h[a>>24&255]<<24,t=i/2+1;t>2,d=u%4,this._Ke[c][d]=o[t],this._Kd[e-c][d]=o[t++],u++}for(var c=1;c>24&255]^x[a>>16&255]^O[a>>8&255]^E[255&a]},P.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)") for(var t=this._Ke.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i] for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i] n=r.slice()}var s,u=o(16) for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+3)%4]]^s) return u},P.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)") for(var t=this._Kd.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i] for(var a=1;a>24&255]^g[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[a][i] n=r.slice()}var s,u=o(16) for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(d[n[i]>>24&255]^s>>24),u[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(d[255&n[(i+1)%4]]^s) return u} var M=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`") this.description="Electronic Code Block",this.name="ecb",this._aes=new P(t)} M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)") for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)") this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++ break}this._counter[e]=0}} var C=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`") this.description="Counter",this.name="ctr",r instanceof T||(r=new T(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new P(t)} C.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range") for(var r=e.length-t,n=0;n=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice() if(!e)return[] var r=[] if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new a(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function a(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(a=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new a(e)}Object.defineProperty(t,"__esModule",{value:!0}) var s=r(306),u=r(325) function c(){return(c=i(regeneratorRuntime.mark((function e(t,r){var n,i,a,c,l,f,h,d,p,m,v,y,b,g,w,_,k,x,O,E,S,P,M=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=M.length>2&&void 0!==M[2]?M[2]:{},i=[],a=new FormData,c=0,l=0,f=!1,h=!1,e.prev=7,p=o(s.normaliseInput(t)) case 9:return e.next=11,p.next() case 11:if(!(f=!(m=e.sent).done)){e.next=37 break}if(v=m.value,y=v.content,b=v.path,g=v.mode,w=v.mtime,_="",k=y?"file":"dir",c>0&&(_="-".concat(c)),x=k+_,O=[],null!=g&&O.push("mode=".concat(u.modeToString(g))),null!=w&&(E=w.secs,S=w.nsecs,O.push("mtime=".concat(E)),null!=S&&O.push("mtime-nsecs=".concat(S))),O.length&&(x="".concat(x,"?").concat(O.join("&"))),!y){e.next=28 break}a.set(x,y,null!=b?encodeURIComponent(b):void 0),P=l+y.size,i.push({name:b,start:l,end:P}),l=P,e.next=33 break case 28:if(null==b){e.next=32 break}a.set(x,new File([""],encodeURIComponent(b),{type:"application/x-directory"})),e.next=33 break case 32:throw new Error("path or content or both must be set") case 33:c++ case 34:f=!1,e.next=9 break case 37:e.next=43 break case 39:e.prev=39,e.t0=e.catch(7),h=!0,d=e.t0 case 43:if(e.prev=43,e.prev=44,!f||null==p.return){e.next=48 break}return e.next=48,p.return() case 48:if(e.prev=48,!h){e.next=51 break}throw d case 51:return e.finish(48) case 52:return e.finish(43) case 53:return e.abrupt("return",{total:l,parts:i,headers:n,body:a}) case 54:case"end":return e.stop()}}),e,null,[[7,39,43,53],[44,,48,52]])})))).apply(this,arguments)}t.multipartRequest=function(e,t){return c.apply(this,arguments)}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(140) function i(e){return e.filter(Boolean)}t.abortSignal=function(){for(var e=arguments.length,t=new Array(e),r=0;r=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice() if(!e)return[] var r=[] if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict" var n=r(16),i=r(9) function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice() if(!e)return[] var r=[] if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict" var n=r(16),i=r(9) function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice() if(!e)return[] var r=[] if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,a=255&i o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){var n=t n.utils=r(32),n.common=r(65),n.sha=r(469),n.ripemd=r(473),n.hmac=r(474),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;tr;)o+=t[i&s>>(a-=r)] if(a&&(o+=t[i&s<=8&&(u-=8,s[l++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data") return s}(e,i,n,t)}})}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(24),o=[24,256,65536,4294967296,BigInt("18446744073709551616")] function a(e,t,r){i.assertEnoughData(e,t,1) var n=e[t] if(!0===r.strict&&n>>8,255&s])}else if(r>>24&255,u>>>16&255,u>>>8&255,255&u])}else{var c=BigInt(r) if(!(c>BigInt(32)&BigInt(4294967295)) l[8]=255&f,f>>=8,l[7]=255&f,f>>=8,l[6]=255&f,f>>=8,l[5]=255&f,l[4]=255&h,h>>=8,l[3]=255&h,h>>=8,l[2]=255&h,h>>=8,l[1]=255&h,e.push(l)}}l.encodedSize=function(e){return f.encodedSize(e.value)},f.encodedSize=function(e){return et.value?1:0},t.decodeUint16=function(e,t,r,i){return new n.Token(n.Type.uint,s(e,t+1,i),3)},t.decodeUint32=function(e,t,r,i){return new n.Token(n.Type.uint,u(e,t+1,i),5)},t.decodeUint64=function(e,t,r,i){return new n.Token(n.Type.uint,c(e,t+1,i),9)},t.decodeUint8=function(e,t,r,i){return new n.Token(n.Type.uint,a(e,t+1,i),2)},t.encodeUint=l,t.encodeUintValue=f,t.readUint16=s,t.readUint32=u,t.readUint64=c,t.readUint8=a,t.uintBoundaries=o},function(e,t,r){"use strict" var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e var t={} if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r) return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0 var s=a(r(490)) t.BN=s.default var u=o(r(492)) t.rlp=u},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=new Uint8Array(0) t.coerce=function(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e if(e instanceof ArrayBuffer)return new Uint8Array(e) if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength) throw new Error("Unknown type, must be binary type")},t.empty=n,t.equals=function(e,t){if(e===t)return!0 if(e.byteLength!==t.byteLength)return!1 for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t] if(!r)throw new Error('Unsupported encoding "'.concat(t,'"')) return r.encoder.encode(e).substring(1)}},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):g(e,t,r)}:function(e,t,r){return r-t>64?a.decode(e.subarray(t,r)):g(e,t,r)},f=o?function(e){return e.length>64?globalThis.Buffer.from(e):b(e)}:function(e){return e.length>64?s.encode(e):b(e)},h=o?function(e,t,r){return u(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r)}:function(e,t,r){return e.slice(t,r)},d=o?function(e,t){return e=e.map((function(e){return e instanceof Uint8Array?e:globalThis.Buffer.from(e)})),c(globalThis.Buffer.concat(e,t))}:function(e,t){var r,i=new Uint8Array(t),o=0,a=n(e) try{for(a.s();!(r=a.n()).done;){var s=r.value o+s.length>i.length&&(s=s.subarray(0,i.length-o)),i.set(s,o),o+=s.length}}catch(e){a.e(e)}finally{a.f()}return i},p=o?function(e){return globalThis.Buffer.allocUnsafe(e)}:function(e){return new Uint8Array(e)},m=o?function(e){return"string"==typeof e?e:globalThis.Buffer.from(y(e)).toString("hex")}:function(e){return"string"==typeof e?e:Array.prototype.reduce.call(y(e),(function(e,t){return"".concat(e).concat(t.toString(16).padStart(2,"0"))}),"")},v=o?function(e){return e instanceof Uint8Array?e:globalThis.Buffer.from(e,"hex")}:function(e){return e instanceof Uint8Array?e:e.length?new Uint8Array(e.split("").map((function(e,t,r){return t%2==0?"0x".concat(e).concat(r[t+1]):""})).filter(Boolean).map((function(e){return parseInt(e,16)}))):new Uint8Array(0)} function y(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e if(e instanceof ArrayBuffer)return new Uint8Array(e) if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength) throw new Error("Unknown type, must be binary type")}function b(e){for(var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=e.length,i=null,o=[],a=0;a55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189) continue}if(a+1===n){(r-=3)>-1&&o.push(239,191,189) continue}i=t continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t continue}t=65536+(i-55296<<10|t-56320)}else i&&(r-=3)>-1&&o.push(239,191,189) if(i=null,t<128){if((r-=1)<0)break o.push(t)}else if(t<2048){if((r-=2)<0)break o.push(t>>6|192,63&t|128)}else if(t<65536){if((r-=3)<0)break o.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point") if((r-=4)<0)break o.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return o}function g(e,t,r){for(var n=[];t239?4:i>223?3:i>191?2:1 if(t+a<=r){var s=void 0,u=void 0,c=void 0,l=void 0 switch(a){case 1:i<128&&(o=i) break case 2:128==(192&(s=e[t+1]))&&(l=(31&i)<<6|63&s)>127&&(o=l) break case 3:s=e[t+1],u=e[t+2],128==(192&s)&&128==(192&u)&&(l=(15&i)<<12|(63&s)<<6|63&u)>2047&&(l<55296||l>57343)&&(o=l) break case 4:s=e[t+1],u=e[t+2],c=e[t+3],128==(192&s)&&128==(192&u)&&128==(192&c)&&(l=(15&i)<<18|(63&s)<<12|(63&u)<<6|63&c)>65535&&l<1114112&&(o=l)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),t+=a}return w(n)}function w(e){var t=e.length if(t<=4096)return String.fromCharCode.apply(String,e) for(var r="",n=0;n1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t] if(!r)throw new Error('Unsupported encoding "'.concat(t,'"')) return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=t function o(e,t,r){for(var n=Object.keys(t),i=0;i0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e) return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=o,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=a,i.ProtocolError=a("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}} throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator] if(!r)return e var n,i,o=r.call(e),a=[] try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a} Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0 var o=r(38),a=r(50),s=r(80) t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e)) return"0x".concat(e.toString(16))},t.intToBuffer=function(r){var n=(0,t.intToHex)(r) return e.from((0,a.padToEven)(n.slice(2)),"hex")},t.zeros=function(t){return e.allocUnsafe(t).fill(0)} var u=function(e,r,n){var i=(0,t.zeros)(r) return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0] return e} t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),c(e)},t.unpadArray=function(e){return(0,s.assertIsArray)(e),c(e)},t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,a.stripHexPrefix)(e),c(e)},t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0) if(e.isBuffer(r))return e.from(r) if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r) if("string"==typeof r){if(!(0,a.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r)) return e.from((0,a.padToEven)((0,a.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r) if(o.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r)) return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray()) if(r.toBuffer)return e.from(r.toBuffer()) throw new Error("invalid type")},t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.fromSigned=function(e){return new o.BN(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||(0,a.isHexPrefixed)(e)?e:"0x"+e},t.toUtf8=function(t){if((t=(0,a.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided") return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex")) if(r instanceof Array){for(var n=[],i=0;i0&&0===c[0])throw new Error("".concat(u," cannot have leading zeroes, received: ").concat(c.toString("hex")))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(10).Buffer)},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)} i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)} var s=Number.isNaN||function(e){return e!=e} function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&b(e,"error",t,{once:!0})}(e,i)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0 var c=10 function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(e))}function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a,s if(l(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0 var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit") u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n) return i.listener=r,n.wrapFn=i,i}function m(e,t,r){var n=e._events if(void 0===n)return[] var i=n[t] return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o var s=new Error("Unhandled error."+(o?" ("+o.message+")":"")) throw s.context=o,s}var u=i[e] if(void 0===u)return!1 if("function"==typeof u)a(u,this,t) else{var c=u.length,l=y(u,c) for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o break}if(i<0)return this 0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]) return this},u.prototype.listeners=function(e){return m(this,e,!0)},u.prototype.rawListeners=function(e){return m(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t,r){"use strict" var n=r(530).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0 default:return!1}} function o(e){var t switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8" for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8" case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le" case"latin1":case"binary":return"latin1" case"base64":case"ascii":case"hex":return e default:if(t)return e=(""+e).toLowerCase(),t=!0}}(e) if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e) return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4 break case"utf8":this.fillLast=s,t=4 break case"base64":this.text=l,this.end=f,t=3 break default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�" if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�" if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e) return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t) if(r){var n=r.charCodeAt(r.length-1) if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"" if(this.lastNeed){var r=this.lastTotal-this.lastNeed return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3 return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"" return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"" var t,r if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"" r=this.lastNeed,this.lastNeed=0}else r=0 return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t) if(!this.lastNeed)return e.toString("utf8",t) this.lastTotal=r var n=e.length-(r-this.lastNeed) return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal) e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict" var n=r(81),i=Object.keys||function(e){var t=[] for(var r in e)t.push(r) return t} e.exports=f var o=Object.create(r(68)) o.inherits=r(9) var a=r(195),s=r(109) o.inherits(f,a) for(var u=i(s.prototype),c=0;ce.length)&&(t=e.length) for(var r=0,n=new Array(t);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length for("0x"===e.substring(0,2)&&(r=2);r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(a(t,"type")) else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument" s='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(a(t,"type"))}return s+". Received type ".concat(n(r))}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[] for(var r in e)t.push(r) return t} e.exports=c var i=r(180),o=r(184) r(9)(c,i) for(var a=n(o.prototype),s=0;s2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(a(t,"type")) else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument" s='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(a(t,"type"))}return s+". Received type ".concat(n(r))}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[] for(var r in e)t.push(r) return t} e.exports=c var i=r(187),o=r(191) r(9)(c,i) for(var a=n(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0)) var r=8*this._len if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4) else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296 this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block) var o=this._hash() return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){var n=t n.utils=r(33),n.common=r(66),n.sha=r(475),n.ripemd=r(479),n.hmac=r(480),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},,,,,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict" var n=r(29),i=r(61) function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8 this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian) for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o1&&void 0!==a[1]?a[1]:{},i=t.getReader(),e.prev=2 case 3:return e.next=6,n(i.read()) case 6:if(!(o=e.sent).done){e.next=9 break}return e.abrupt("return") case 9:return e.next=11,o.value case 11:e.next=3 break case 13:return e.prev=13,!0!==r.preventCancel&&i.cancel(),i.releaseLock(),e.finish(13) case 17:case"end":return e.stop()}}),e,null,[[2,,13,17]])})))).apply(this,arguments)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=function(e){return s.apply(this,arguments)}},function(e,t,r){"use strict" var n=r(32),i=r(16) function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8 this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian) for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=this._delta8){var r=(e=this.pending).length%this._delta8 this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian) for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=this._delta8){var r=(e=this.pending).length%this._delta8 this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian) for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o2&&void 0!==arguments[2]?arguments[2]:0 return n.encode(e,t,r),t},t.encodingLength=function(e){return n.encodingLength(e)}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(36),i=n.baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=n.baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}) t.base58btc=i,t.base58flickr=o},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(36),i=n.rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o=n.rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),a=n.rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),s=n.rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}) t.base64=i,t.base64pad=o,t.base64url=a,t.base64urlpad=s},function(e,t,r){"use strict" function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null!=r){var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed) var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=a;l--)u=(u<<1)+n[l] c.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&0===a[c];c--)l++ if(c>=0&&l++,u=u.dblp(l),c<0)break var f=a[c] s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,l=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0 for(s=0;s=1;s-=2){var m=s-1,v=s if(1===l[m]&&1===l[v]){var y=[t[m],null,null,t[v]] 0===t[m].y.cmp(t[v].y)?(y[1]=t[m].add(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())):0===t[m].y.cmp(t[v].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].add(t[v].neg())):(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())) var b=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[m],r[v]) for(d=Math.max(g[0].length,d),h[m]=new Array(d),h[v]=new Array(d),u=0;u=0;s--){for(var O=0;s>=0;){var E=!0 for(u=0;u=0&&O++,k=k.dblp(O),s<0)break for(u=0;u0?c=f[u][S-1>>1]:S<0&&(c=f[u][-S-1>>1].neg()),k="affine"===c.type?k.mixedAdd(c):k.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles for(var r=[this],n=this,i=0;i=64;){var d=r,p=n,m=i,v=o,y=a,b=s,g=u,w=c,_=void 0,k=void 0,x=void 0,O=void 0,E=void 0 for(k=0;k<16;k++)x=f+4*k,l[k]=(255&e[x])<<24|(255&e[x+1])<<16|(255&e[x+2])<<8|255&e[x+3] for(k=16;k<64;k++)O=((_=l[k-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10,E=((_=l[k-15])>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,l[k]=(O+l[k-7]|0)+(E+l[k-16]|0)|0 for(k=0;k<64;k++)O=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&b^~y&g)|0)+(w+(t[k]+l[k]|0)|0)|0,E=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=g,g=b,b=y,y=v+O|0,v=m,m=p,p=d,d=O+E|0 r=r+d|0,n=n+p|0,i=i+m|0,o=o+v|0,a=a+y|0,s=s+b|0,u=u+g|0,c=c+w|0,f+=64,h-=64}}f(e) var h,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,v=d<56?56:120,y=e.slice(e.length-d,e.length) for(y.push(128),h=d+1;h>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),f(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e) var i,o=64+t.length+4,a=new Array(o),s=new Array(64),u=[] for(i=0;i<64;i++)a[i]=54 for(i=0;i=o-4;e--){if(a[e]++,a[e]<=255)return a[e]=0}}for(;r>=32;)c(),u=u.concat(n(s.concat(n(a)))),r-=32 return r>0&&(c(),u=u.concat(n(s.concat(n(a))).slice(0,r))),u}function o(e,t,r,n,i){var o for(c(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(e,16*o,i,16),s(i,n),c(i,0,e,t+16*o,16) for(o=0;o>>32-t}function s(e,t){c(e,0,t,0,16) for(var r=8;r>0;r-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18) for(var n=0;n<16;++n)e[n]+=t[n]}function u(e,t,r,n){for(var i=0;i=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t) return e}function h(e,r,n,a,s,h,d){if(n=f(n,"N"),a=f(a,"r"),s=f(s,"p"),h=f(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2") if(n>2147483647/128/a)throw new Error("N too large") if(a>2147483647/128/s)throw new Error("r too large") if(!l(e))throw new Error("password must be an array or buffer") if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer") r=Array.prototype.slice.call(r) for(var p=i(e,r,128*s*a),m=new Uint32Array(32*s*a),v=0;vR&&(r=R) for(var l=0;lR&&(r=R) for(var v=0;v>0&255),p.push(m[I]>>8&255),p.push(m[I]>>16&255),p.push(m[I]>>24&255) var N=i(e,p,h) return d&&d(null,1,N),N}d&&T(t)} if(!d)for(;;){var I=C() if(null!=I)return I}C()}var d={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,u){var c=0 a&&a(0),h(e,t,r,n,i,o,(function(e,t,r){if(e)u(e) else if(r)a&&1!==c&&a(1),s(new Uint8Array(r)) else if(a&&t!==c)return c=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(h(e,t,r,n,i,o))}} e.exports=d}()}).call(this,r(88).setImmediate)},function(e,t,r){"use strict";(function(t){!function(r){function n(e){var t=new Uint32Array([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]),r=1779033703,n=3144134277,i=1013904242,o=2773480762,a=1359893119,s=2600822924,u=528734635,c=1541459225,l=new Uint32Array(64) function f(e){for(var f=0,h=e.length;h>=64;){var d=r,p=n,m=i,v=o,y=a,b=s,g=u,w=c,_=void 0,k=void 0,x=void 0,O=void 0,E=void 0 for(k=0;k<16;k++)x=f+4*k,l[k]=(255&e[x])<<24|(255&e[x+1])<<16|(255&e[x+2])<<8|255&e[x+3] for(k=16;k<64;k++)O=((_=l[k-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10,E=((_=l[k-15])>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,l[k]=(O+l[k-7]|0)+(E+l[k-16]|0)|0 for(k=0;k<64;k++)O=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&b^~y&g)|0)+(w+(t[k]+l[k]|0)|0)|0,E=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=g,g=b,b=y,y=v+O|0,v=m,m=p,p=d,d=O+E|0 r=r+d|0,n=n+p|0,i=i+m|0,o=o+v|0,a=a+y|0,s=s+b|0,u=u+g|0,c=c+w|0,f+=64,h-=64}}f(e) var h,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,v=d<56?56:120,y=e.slice(e.length-d,e.length) for(y.push(128),h=d+1;h>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),f(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e) var i,o=64+t.length+4,a=new Array(o),s=new Array(64),u=[] for(i=0;i<64;i++)a[i]=54 for(i=0;i=o-4;e--){if(a[e]++,a[e]<=255)return a[e]=0}}for(;r>=32;)c(),u=u.concat(n(s.concat(n(a)))),r-=32 return r>0&&(c(),u=u.concat(n(s.concat(n(a))).slice(0,r))),u}function o(e,t,r,n,i){var o for(c(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(e,16*o,i,16),s(i,n),c(i,0,e,t+16*o,16) for(o=0;o>>32-t}function s(e,t){c(e,0,t,0,16) for(var r=8;r>0;r-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18) for(var n=0;n<16;++n)e[n]+=t[n]}function u(e,t,r,n){for(var i=0;i=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t) return e}function h(e,r,n,a,s,h,d){if(n=f(n,"N"),a=f(a,"r"),s=f(s,"p"),h=f(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2") if(n>2147483647/128/a)throw new Error("N too large") if(a>2147483647/128/s)throw new Error("r too large") if(!l(e))throw new Error("password must be an array or buffer") if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer") r=Array.prototype.slice.call(r) for(var p=i(e,r,128*s*a),m=new Uint32Array(32*s*a),v=0;vR&&(r=R) for(var l=0;lR&&(r=R) for(var v=0;v>0&255),p.push(m[I]>>8&255),p.push(m[I]>>16&255),p.push(m[I]>>24&255) var N=i(e,p,h) return d&&d(null,1,N),N}d&&T(t)} if(!d)for(;;){var I=C() if(null!=I)return I}C()}var d={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,u){var c=0 a&&a(0),h(e,t,r,n,i,o,(function(e,t,r){if(e)u(e) else if(r)a&&1!==c&&a(1),s(new Uint8Array(r)) else if(a&&t!==c)return c=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(h(e,t,r,n,i,o))}} e.exports=d}()}).call(this,r(88).setImmediate)},,,,function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId) var t=e._idleTimeout t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(223),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(11))},function(e,t,r){var n=r(234),i=r(235),o=r(236) e.exports={contribution:n,contributor:i,expense:o}},,function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(36),i=n.rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o=n.rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),a=n.rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),s=n.rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u=n.rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),c=n.rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),l=n.rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),f=n.rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h=n.rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}) t.base32=i,t.base32hex=u,t.base32hexpad=l,t.base32hexpadupper=f,t.base32hexupper=c,t.base32pad=a,t.base32padupper=s,t.base32upper=o,t.base32z=h},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(121),i=r(129),o=r(18) t.encode=n.encode,t.decode=i.decode,t.Token=o.Token,t.Type=o.Type},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(24),o=r(37),a=r(41) function s(e,t,r,o){i.assertEnoughData(e,t,r+o) var s=a.slice(e,t+r,t+r+o) return new n.Token(n.Type.bytes,s,r+o)}function u(e){return void 0===e.encodedBytes&&(e.encodedBytes=e.type===n.Type.string?a.fromString(e.value):e.value),e.encodedBytes}function c(e,t){var r=u(t) o.encodeUintValue(e,t.type.majorEncoded,r.length),e.push(r)}function l(e,t){return e.lengtht.length?1:a.compare(e,t)}c.encodedSize=function(e){var t=u(e) return o.encodeUintValue.encodedSize(t.length)+t.length},c.compareTokens=function(e,t){return l(u(e),u(t))},t.compareBytes=l,t.decodeBytes16=function(e,t,r,n){return s(e,t,3,o.readUint16(e,t+1,n))},t.decodeBytes32=function(e,t,r,n){return s(e,t,5,o.readUint32(e,t+1,n))},t.decodeBytes64=function(e,t,r,n){var a=o.readUint64(e,t+1,n) if("bigint"==typeof a)throw new Error("".concat(i.decodeErrPrefix," 64-bit integer bytes lengths not supported")) return s(e,t,9,a)},t.decodeBytes8=function(e,t,r,n){return s(e,t,2,o.readUint8(e,t+1,n))},t.decodeBytesCompact=function(e,t,r,n){return s(e,t,1,r)},t.encodeBytes=c},function(e,t,r){"use strict" function n(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return a(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:{},n={} if("string"==typeof r||b.Multiaddr.isMultiaddr(r))e=new URL(O.toUrlString(r)) else if(r instanceof URL)e=r else if("string"==typeof r.url||b.Multiaddr.isMultiaddr(r.url))e=new URL(O.toUrlString(r.url)),n=r else if(r.url instanceof URL)e=r.url,n=r else{var i=((n=r||{}).protocol||I).replace(":",""),o=(n.host||N).split(":")[0],a=n.port||D e=new URL("".concat(i,"://").concat(o,":").concat(a))}if(n.apiPath?e.pathname=n.apiPath:"/"!==e.pathname&&void 0!==e.pathname||(e.pathname="api/v0"),g.isNode){var s=R.default(e) t=n.agent||new s({keepAlive:!0,maxSockets:6})}return m(m({},n),{},{host:e.host,protocol:e.protocol.replace(":",""),port:Number(e.port),apiPath:e.pathname,url:e,agent:t})},L=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(t.headers.get("Content-Type")||"").startsWith("application/json")){e.next=9 break}return e.next=4,t.json() case 4:n=e.sent,T(n),r=n.Message||n.message,e.next=12 break case 9:return e.next=11,t.text() case 11:r=e.sent case 12:e.next=18 break case 14:e.prev=14,e.t0=e.catch(0),T("Failed to parse error response",e.t0),r=e.t0.message case 18:throw i=new A.default.HTTPError(t),r&&(r.includes("deadline has elapsed")&&(i=new A.default.TimeoutError),r&&r.includes("context deadline exceeded")&&(i=new A.default.TimeoutError)),r&&r.includes("request timed out")&&(i=new A.default.TimeoutError),r&&(i.message=r),i case 23:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var t=this,r=arguments return new Promise((function(n,i){var o=e.apply(t,r) function a(e){d(o,n,i,a,s,"next",e)}function s(e){d(o,n,i,a,s,"throw",e)}a(void 0)}))}) return function(e){return t.apply(this,arguments)}}(),F=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,U=function(e){return e.replace(F,(function(e){return"-"+e.toLowerCase()}))},z=function(e){return"string"==typeof e?P.default(e):e},q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(o,e) var t,r=c(o) function o(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{} s(this,o) var a=B(t) delete(e=r.call(this,{timeout:z(a.timeout||0)||void 0,headers:a.headers,base:"".concat(a.url),handleError:L,transformSearchParams:function(e){var t,r=new URLSearchParams,o=i(e) try{for(o.s();!(t=o.n()).done;){var a=n(t.value,2),s=a[0],u=a[1] "undefined"!==u&&"null"!==u&&"signal"!==s&&r.append(U(s),u),"timeout"!==s||isNaN(u)||r.append(U(s),u)}}catch(e){o.e(e)}finally{o.f()}return r},agent:a.agent})).get,delete e.put,delete e.delete,delete e.options var u=e.fetch return e.fetch=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return"string"!=typeof t||t.startsWith("/")||(t="".concat(a.url,"/").concat(t)),u.call(f(e),t,C(r,{method:"POST"}))},e}return t=o,Object.defineProperty(t,"prototype",{writable:!1}),t}(A.default),H=A.default.HTTPError t.Client=q,t.HTTPError=H,t.errorHandler=L},function(e,t,r){"use strict" function n(e){if("number"==typeof e){if(n.codes[e])return n.codes[e] throw new Error("no protocol with code: "+e)}if("string"==typeof e){if(n.names[e])return n.names[e] throw new Error("no protocol with name: "+e)}throw new Error("invalid protocol id type: "+e)}var i=-1 function o(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}n.lengthPrefixedVarSize=i,n.V=i,n.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,i,"ip6zone"],[53,i,"dns","resolvable"],[54,i,"dns4","resolvable"],[55,i,"dns6","resolvable"],[56,i,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,i,"unix",!1,"path"],[421,i,"ipfs"],[421,i,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,i,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,i,"memory"]],n.names={},n.codes={},n.table.map((function(e){var t=o.apply(null,e) return n.codes[t.code]=t,n.names[t.name]=t,null})),n.object=o,e.exports=n},function(e,t,r){e.exports={encode:r(284),decode:r(285),encodingLength:r(286)}},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=t} return new Promise((function(n,o){var a=setTimeout((function(){i()&&(o(new _),r.abort())}),t),s=function(e){return function(t){clearTimeout(a),i()?o(new _):e(t)}} e.then(s(n),s(o))}))},A={throwHttpErrors:!0,credentials:"same-origin"},j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{} u(this,e),this.opts=x(A,t)}var t,r,n,i return t=e,(r=[{key:"fetch",value:(n=regeneratorRuntime.mark((function e(t){var r,n,i,a,s,u,c,h,d,m,v=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=v.length>1&&void 0!==v[1]?v[1]:{},n=x(this.opts,r),i=new g(n.headers),"string"==typeof t||t instanceof E||t instanceof b){e.next=5 break}throw new TypeError("`resource` must be a string, URL, or Request") case 5:return a=new E(t.toString(),n.base),s=n.searchParams,u=n.transformSearchParams,c=n.json,s&&(a.search="function"==typeof u?u(new S(n.searchParams)):new S(n.searchParams)),c&&(n.body=JSON.stringify(n.json),i.set("content-type","application/json")),h=new AbortController,d=P([h.signal,n.signal]),e.next=13,M(y(a.toString(),o(o({},n),{},{signal:d,timeout:void 0,headers:i})),n.timeout,h) case 13:if((m=e.sent).ok||!n.throwHttpErrors){e.next=19 break}if(!n.handleError){e.next=18 break}return e.next=18,n.handleError(m) case 18:throw new k(m) case 19:return m.iterator=function(){return T(m.body)},m.ndjson=f(regeneratorRuntime.mark((function e(){var t,n,i,o,a,s return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!1,n=!1,e.prev=2,o=p(R(m.iterator())) case 4:return e.next=6,l(o.next()) case 6:if(!(t=!(a=e.sent).done)){e.next=18 break}if(s=a.value,!r.transform){e.next=13 break}return e.next=11,r.transform(s) case 11:e.next=15 break case 13:return e.next=15,s case 15:t=!1,e.next=4 break case 18:e.next=24 break case 20:e.prev=20,e.t0=e.catch(2),n=!0,i=e.t0 case 24:if(e.prev=24,e.prev=25,!t||null==o.return){e.next=29 break}return e.next=29,l(o.return()) case 29:if(e.prev=29,!n){e.next=32 break}throw i case 32:return e.finish(29) case 33:return e.finish(24) case 34:case"end":return e.stop()}}),e,null,[[2,20,24,34],[25,,29,33]])}))),e.abrupt("return",m) case 22:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments return new Promise((function(r,i){var o=n.apply(e,t) function a(e){s(o,r,i,a,u,"next",e)}function u(e){s(o,r,i,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"post",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return this.fetch(e,o(o({},t),{},{method:"POST"}))}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return this.fetch(e,o(o({},t),{},{method:"GET"}))}},{key:"put",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return this.fetch(e,o(o({},t),{},{method:"PUT"}))}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return this.fetch(e,o(o({},t),{},{method:"DELETE"}))}},{key:"options",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return this.fetch(e,o(o({},t),{},{method:"OPTIONS"}))}}])&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),R=function(){var e=f(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,c,f,h,d return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new TextDecoder,n="",i=!1,o=!1,e.prev=4,s=p(t) case 6:return e.next=8,l(s.next()) case 8:if(!(i=!(u=e.sent).done)){e.next=25 break}c=u.value,n+=r.decode(c,{stream:!0}),f=n.split(/\r?\n/),h=0 case 13:if(!(h0)){e.next=18 break}return e.next=18,JSON.parse(d) case 18:h++,e.next=13 break case 21:n=f[f.length-1] case 22:i=!1,e.next=6 break case 25:e.next=31 break case 27:e.prev=27,e.t0=e.catch(4),o=!0,a=e.t0 case 31:if(e.prev=31,e.prev=32,!i||null==s.return){e.next=36 break}return e.next=36,l(s.return()) case 36:if(e.prev=36,!o){e.next=39 break}throw a case 39:return e.finish(36) case 40:return e.finish(31) case 41:if(0===(n=(n+=r.decode()).trim()).length){e.next=46 break}return e.next=46,JSON.parse(n) case 46:case"end":return e.stop()}}),e,null,[[4,27,31,41],[32,,36,40]])}))) return function(t){return e.apply(this,arguments)}}(),T=function(e){if(N(e)){var t=e[Symbol.asyncIterator]() return a({},Symbol.asyncIterator,(function(){return{next:t.next.bind(t),return:function(r){return e.destroy(),"function"==typeof t.return?t.return():Promise.resolve({done:!0,value:r})}}}))}if(I(e)){var r=e.getReader() return f(regeneratorRuntime.mark((function e(){var t,n,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0 case 1:return e.next=4,l(r.read()) case 4:if(t=e.sent,n=t.done,i=t.value,!n){e.next=9 break}return e.abrupt("return") case 9:if(!i){e.next=12 break}return e.next=12,i case 12:e.next=1 break case 14:return e.prev=14,r.releaseLock(),e.finish(14) case 17:case"end":return e.stop()}}),e,null,[[0,,14,17]])})))()}if(C(e))return e throw new TypeError("Body can't be converted to AsyncIterable")},C=function(e){return"object"===n(e)&&null!==e&&"function"==typeof e[Symbol.asyncIterator]},I=function(e){return e&&"function"==typeof e.getReader},N=function(e){return Object.prototype.hasOwnProperty.call(e,"readable")&&Object.prototype.hasOwnProperty.call(e,"writable")} j.HTTPError=k,j.TimeoutError=_,j.streamToAsyncIterator=T,j.post=function(e,t){return new j(t).post(e,t)},j.get=function(e,t){return new j(t).get(e,t)},j.put=function(e,t){return new j(t).put(e,t)},j.delete=function(e,t){return new j(t).delete(e,t)},j.options=function(e,t){return new j(t).options(e,t)},e.exports=j},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r * @license MIT */function o(e,t){if(e===t)return 0 for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i=0;u--)if(l[u]!==f[u])return!1 for(u=l.length-1;u>=0;u--)if(!w(e[a=l[u]],t[a],r,n))return!1 return!0}(e,t,r,i))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function k(e,t){if(!e||!t)return!1 if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e) try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,r,n){var i if("function"!=typeof t)throw new TypeError('"block" argument must be a function') "string"==typeof r&&(n=r,r=null),i=function(e){var t try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&b(i,r,"Missing expected exception"+n) var o="string"==typeof n,a=!e&&i&&!r if((!e&&s.isError(i)&&o&&k(i,r)||a)&&b(i,r,"Got unwanted exception"+n),e&&i&&r&&!k(i,r)||!e&&i)throw i}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return v(y(e.actual),128)+" "+e.operator+" "+v(y(e.expected),128)}(this),this.generatedMessage=!0) var t=e.stackStartFunction||b if(Error.captureStackTrace)Error.captureStackTrace(this,t) else{var r=new Error if(r.stack){var n=r.stack,i=m(t),o=n.indexOf("\n"+i) if(o>=0){var a=n.indexOf("\n",o+1) n=n.substring(a+1)}this.stack=n}}},s.inherits(d.AssertionError,Error),d.fail=b,d.ok=g,d.equal=function(e,t,r){e!=t&&b(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&b(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){w(e,t,!1)||b(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){w(e,t,!0)||b(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){w(e,t,!1)&&b(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,n){w(t,r,!0)&&b(t,r,n,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&b(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&b(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){x(!0,e,t,r)},d.doesNotThrow=function(e,t,r){x(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=i((function e(t,r){t||b(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict var O=Object.keys||function(e){var t=[] for(var r in e)u.call(e,r)&&t.push(r) return t}}).call(this,r(11))},function(e,t,r){"use strict" var n,i=t,o=r(103),a=r(174),s=r(25).assert function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t) return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}) try{n=r(513)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t n.utils=r(34),n.common=r(67),n.sha=r(507),n.ripemd=r(511),n.hmac=r(512),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0 var n=r(522),i=r(538),o=r(38),a=r(44),s=r(80) t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e) case 256:return(0,n.keccak256)(e) case 384:return(0,n.keccak384)(e) case 512:return(0,n.keccak512)(e) default:throw new Error("Invald algorithm: keccak".concat(t))}},t.keccak256=function(e){return(0,t.keccak)(e)},t.keccakFromString=function(r,n){void 0===n&&(n=256),(0,s.assertIsString)(r) var i=e.from(r,"utf8") return(0,t.keccak)(i,n)},t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,a.toBuffer)(e),r)},t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,a.toBuffer)(e),r)} var u=function(e){return e=(0,a.toBuffer)(e),i("sha256").update(e).digest()} t.sha256=function(e){return(0,s.assertIsBuffer)(e),u(e)},t.sha256FromString=function(e){return(0,s.assertIsString)(e),u(e)},t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),u(e)} var c=function(e,t){e=(0,a.toBuffer)(e) var r=i("rmd160").update(e).digest() return!0===t?(0,a.setLengthLeft)(r,32):r} t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),c(e,t)},t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),c(e,t)},t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),c(e,t)},t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e] return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e var n=!1 return function(){if(!n){if(r("throwDeprecation"))throw new Error(t) r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(11))},function(e,t,r){"use strict" var n=r(51).codes.ERR_STREAM_PREMATURE_CLOSE function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r) r||(r={}),o=function(e){var t=!1 return function(){if(!t){t=!0 for(var r=arguments.length,n=new Array(r),i=0;i-1?n:o.nextTick b.WritableState=y var c=Object.create(r(68)) c.inherits=r(9) var l,f={deprecate:r(105)},h=r(196),d=r(21).Buffer,p=i.Uint8Array||function(){},m=r(197) function v(){}function y(e,t){s=s||r(47),e=e||{} var n=t instanceof s this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode) var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384 this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,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 f=!1===e.decodeStrings this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(O,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),O(e,t))}(e,r,n,t,i) else{var a=k(r) a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},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 a(this)}function b(e){if(s=s||r(47),!(l.call(b,this)||this instanceof s))return new b(e) this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function g(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),O(e,t)}function _(e,t){t.bufferProcessing=!0 var r=t.bufferedRequest if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree o.entry=r for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1 i.allBuffers=u,g(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback if(g(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var r=k(t) return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,h),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===b&&e&&e._writableState instanceof y}})):l=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof p) return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(e,t){var r=new Error("write after end") e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1 return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i) n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length t.length+=s var u=t.length-1))throw new TypeError("Unknown encoding: "+e) return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState "function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(12),r(88).setImmediate,r(11))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0 var n,i=r(38),o=r(50),a=r(44) function s(t){return(0,a.unpadBuffer)(t.toArrayLike(e))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=s,t.bnToRlp=function(e){return s(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null if(void 0!==e){if("string"==typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e)) if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)") var r=(0,a.toBuffer)(e) if(t===n.Buffer)return r if(t===n.BN)return new i.BN(r) if(t===n.Number){var s=new i.BN(r),u=new i.BN(Number.MAX_SAFE_INTEGER.toString()) if(s.gt(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)") return s.toNumber()}return"0x".concat(r.toString("hex"))}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}for(var i="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o={},a=0;a>25 return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function c(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")" t=u(t)^n>>5}for(t=u(t),r=0;rt)return"Exceeds length limit" var r=e.toLowerCase(),n=e.toUpperCase() if(e!==r&&e!==n)return"Mixed-case string "+e var i=(e=r).lastIndexOf("1") if(-1===i)return"No separator character for "+e if(0===i)return"Missing prefix for "+e var a=e.slice(0,i),s=e.slice(i+1) if(s.length<6)return"Data too short" var l=c(a) if("string"==typeof l)return l for(var f=[],h=0;h=s.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:a,words:f}}function f(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a) if(n)o>0&&s.push(i<=t)return"Excess padding" if(i<r)throw new TypeError("Exceeds length limit") var n=c(e=e.toLowerCase()) if("string"==typeof n)throw new Error(n) for(var o=e+"1",a=0;a>5!=0)throw new Error("Non 5-bit word") n=u(n)^s,o+=i.charAt(s)}for(a=0;a<6;++a)n=u(n) for(n^=1,a=0;a<6;++a)o+=i.charAt(n>>5*(5-a)&31) return o},toWordsUnsafe:function(e){var t=f(e,8,5,!0) if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0) if(Array.isArray(t))return t throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1) if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1) if(Array.isArray(t))return t throw new Error(t)}}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}for(var i="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o={},a=0;a>25 return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function c(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")" t=u(t)^n>>5}for(t=u(t),r=0;rt)return"Exceeds length limit" var r=e.toLowerCase(),n=e.toUpperCase() if(e!==r&&e!==n)return"Mixed-case string "+e var i=(e=r).lastIndexOf("1") if(-1===i)return"No separator character for "+e if(0===i)return"Missing prefix for "+e var a=e.slice(0,i),s=e.slice(i+1) if(s.length<6)return"Data too short" var l=c(a) if("string"==typeof l)return l for(var f=[],h=0;h=s.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:a,words:f}}function f(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a) if(n)o>0&&s.push(i<=t)return"Excess padding" if(i<r)throw new TypeError("Exceeds length limit") var n=c(e=e.toLowerCase()) if("string"==typeof n)throw new Error(n) for(var o=e+"1",a=0;a>5!=0)throw new Error("Non 5-bit word") n=u(n)^s,o+=i.charAt(s)}for(a=0;a<6;++a)n=u(n) for(n^=1,a=0;a<6;++a)o+=i.charAt(n>>5*(5-a)&31) return o},toWordsUnsafe:function(e){var t=f(e,8,5,!0) if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0) if(Array.isArray(t))return t throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1) if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1) if(Array.isArray(t))return t throw new Error(t)}}},,,function(e,t,r){"use strict" var n=r(29).rotr32 function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict" var n=r(29),i=r(62),o=r(115),a=r(61),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,y=[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] function b(){if(!(this instanceof b))return new b v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,v),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n] for(;n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=0?new s.Token(s.Type.uint,e):new s.Token(s.Type.negint,e):new s.Token(s.Type.float,e)},bigint:function(e,t,r,n){return e>=BigInt(0)?new s.Token(s.Type.uint,e):new s.Token(s.Type.negint,e)},Uint8Array:function(e,t,r,n){return new s.Token(s.Type.bytes,e)},string:function(e,t,r,n){return new s.Token(s.Type.string,e)},boolean:function(e,t,r,n){return e?E.true:E.false},null:function(e,t,r,n){return E.null},undefined:function(e,t,r,n){return E.undefined},ArrayBuffer:function(e,t,r,n){return new s.Token(s.Type.bytes,new Uint8Array(e))},DataView:function(e,t,r,n){return new s.Token(s.Type.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array:function(e,t,r,i){if(!e.length)return!0===r.addBreakTokens?[E.emptyArray,new s.Token(s.Type.break)]:E.emptyArray i=O.createCheck(i,e) var o,a=[],u=0,c=n(e) try{for(c.s();!(o=c.n()).done;){var l=o.value a[u++]=j(l,r,i)}}catch(e){c.e(e)}finally{c.f()}return r.addBreakTokens?[new s.Token(s.Type.array,e.length),a,new s.Token(s.Type.break)]:[new s.Token(s.Type.array,e.length),a]},Object:function(e){function t(t,r,n,i){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r,i){var o="Object"!==t,a=o?e.keys():Object.keys(e),u=o?e.size:a.length if(!u)return!0===r.addBreakTokens?[E.emptyMap,new s.Token(s.Type.break)]:E.emptyMap i=O.createCheck(i,e) var c,l=[],f=0,h=n(a) try{for(h.s();!(c=h.n()).done;){var d=c.value l[f++]=[j(d,r,i),j(o?e.get(d):e[d],r,i)]}}catch(e){h.e(e)}finally{h.f()}return function(e,t){t.mapSorter&&e.sort(t.mapSorter)}(l,r),r.addBreakTokens?[new s.Token(s.Type.map,u),l,new s.Token(s.Type.break)]:[new s.Token(s.Type.map,u),l]}))} S.Map=S.Object,S.Buffer=S.Uint8Array var P,M=n("Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" ")) try{for(M.s();!(P=M.n()).done;){var A=P.value S["".concat(A,"Array")]=S.DataView}}catch(e){M.e(e)}finally{M.f()}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=a.is(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||S[n] if("function"==typeof i){var o=i(e,n,t,r) if(null!=o)return o}var s=S[n] if(!s)throw new Error("".concat(c.encodeErrPrefix," unsupported type: ").concat(n)) return s(e,n,t,r)}function R(e,t,r){var i=j(e,r) if(!Array.isArray(i)&&r.quickEncodeToken){var o=r.quickEncodeToken(i) if(o)return o var a=t[i.type.major] if(a.encodedSize){var s=a.encodedSize(i,r),c=new u.Bl(s) if(a(c,i,r),1!==c.chunks.length)throw new Error("Unexpected error: pre-calculated length for ".concat(i," was wrong")) return f.asU8A(c.chunks[0])}}return x.reset(),function e(t,r,i,o){if(Array.isArray(r)){var a,s=n(r) try{for(s.s();!(a=s.n()).done;)e(t,a.value,i,o)}catch(e){s.e(e)}finally{s.f()}}else i[r.type.major](t,r,o)}(x,i,t,r),x.toBytes(!0)}t.Ref=O,t.encode=function(e,t){return t=Object.assign({},w,t),R(e,k,t)},t.encodeCustom=R,t.makeCborEncoders=_,t.objectToTokens=j},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(37),o=r(123),a=r(93),s=r(124),u=r(125),c=r(126),l=r(127),f=r(128),h=r(24),d=r(41) function p(e,t,r){throw new Error("".concat(h.decodeErrPrefix," encountered invalid minor (").concat(r,") for major ").concat(e[t]>>>5))}function m(e){return function(){throw new Error("".concat(h.decodeErrPrefix," ").concat(e))}}for(var v=[],y=0;y<=23;y++)v[y]=p v[24]=i.decodeUint8,v[25]=i.decodeUint16,v[26]=i.decodeUint32,v[27]=i.decodeUint64,v[28]=p,v[29]=p,v[30]=p,v[31]=p for(var b=32;b<=55;b++)v[b]=p v[56]=o.decodeNegint8,v[57]=o.decodeNegint16,v[58]=o.decodeNegint32,v[59]=o.decodeNegint64,v[60]=p,v[61]=p,v[62]=p,v[63]=p for(var g=64;g<=87;g++)v[g]=a.decodeBytesCompact v[88]=a.decodeBytes8,v[89]=a.decodeBytes16,v[90]=a.decodeBytes32,v[91]=a.decodeBytes64,v[92]=p,v[93]=p,v[94]=p,v[95]=m("indefinite length bytes/strings are not supported") for(var w=96;w<=119;w++)v[w]=s.decodeStringCompact v[120]=s.decodeString8,v[121]=s.decodeString16,v[122]=s.decodeString32,v[123]=s.decodeString64,v[124]=p,v[125]=p,v[126]=p,v[127]=m("indefinite length bytes/strings are not supported") for(var _=128;_<=151;_++)v[_]=u.decodeArrayCompact v[152]=u.decodeArray8,v[153]=u.decodeArray16,v[154]=u.decodeArray32,v[155]=u.decodeArray64,v[156]=p,v[157]=p,v[158]=p,v[159]=u.decodeArrayIndefinite for(var k=160;k<=183;k++)v[k]=c.decodeMapCompact v[184]=c.decodeMap8,v[185]=c.decodeMap16,v[186]=c.decodeMap32,v[187]=c.decodeMap64,v[188]=p,v[189]=p,v[190]=p,v[191]=c.decodeMapIndefinite for(var x=192;x<=215;x++)v[x]=l.decodeTagCompact v[216]=l.decodeTag8,v[217]=l.decodeTag16,v[218]=l.decodeTag32,v[219]=l.decodeTag64,v[220]=p,v[221]=p,v[222]=p,v[223]=p for(var O=224;O<=243;O++)v[O]=m("simple values are not supported") v[244]=p,v[245]=p,v[246]=p,v[247]=f.decodeUndefined,v[248]=m("simple values are not supported"),v[249]=f.decodeFloat16,v[250]=f.decodeFloat32,v[251]=f.decodeFloat64,v[252]=p,v[253]=p,v[254]=p,v[255]=f.decodeBreak for(var E=[],S=0;S<24;S++)E[S]=new n.Token(n.Type.uint,S,1) for(var P=-1;P>=-24;P--)E[31-P]=new n.Token(n.Type.negint,P,1) E[64]=new n.Token(n.Type.bytes,new Uint8Array(0),1),E[96]=new n.Token(n.Type.string,"",1),E[128]=new n.Token(n.Type.array,0,1),E[160]=new n.Token(n.Type.map,0,1),E[244]=new n.Token(n.Type.false,!1,1),E[245]=new n.Token(n.Type.true,!0,1),E[246]=new n.Token(n.Type.null,null,1),t.jump=v,t.quick=E,t.quickEncodeToken=function(e){switch(e.type){case n.Type.false:return d.fromArray([244]) case n.Type.true:return d.fromArray([245]) case n.Type.null:return d.fromArray([246]) case n.Type.bytes:return e.value.length?void 0:d.fromArray([64]) case n.Type.string:return""===e.value?d.fromArray([96]):void 0 case n.Type.array:return 0===e.value?d.fromArray([128]):void 0 case n.Type.map:return 0===e.value?d.fromArray([160]):void 0 case n.Type.uint:return e.value<24?d.fromArray([Number(e.value)]):void 0 case n.Type.negint:if(e.value>=-24)return d.fromArray([31-Number(e.value)])}}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(37),o=r(24),a=BigInt(-1),s=BigInt(1) function u(e,t){var r=t.value,n="bigint"==typeof r?r*a-s:-1*r-1 i.encodeUintValue(e,t.type.majorEncoded,n)}u.encodedSize=function(e){var t=e.value,r="bigint"==typeof t?t*a-s:-1*t-1 return rt.value?-1:0},t.decodeNegint16=function(e,t,r,o){return new n.Token(n.Type.negint,-1-i.readUint16(e,t+1,o),3)},t.decodeNegint32=function(e,t,r,o){return new n.Token(n.Type.negint,-1-i.readUint32(e,t+1,o),5)},t.decodeNegint64=function(e,t,r,s){var u=i.readUint64(e,t+1,s) if("bigint"!=typeof u){var c=-1-u if(c>=Number.MIN_SAFE_INTEGER)return new n.Token(n.Type.negint,c,9)}if(!0!==s.allowBigInt)throw new Error("".concat(o.decodeErrPrefix," integers outside of the safe integer range are not supported")) return new n.Token(n.Type.negint,a-BigInt(u),9)},t.decodeNegint8=function(e,t,r,o){return new n.Token(n.Type.negint,-1-i.readUint8(e,t+1,o),2)},t.encodeNegint=u},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(24),o=r(37),a=r(93),s=r(41) function u(e,t,r,o,a){var u=r+o i.assertEnoughData(e,t,u) var c=new n.Token(n.Type.string,s.toString(e,t+r,t+u),u) return!0===a.retainStringBytes&&(c.byteValue=s.slice(e,t+r,t+u)),c}var c=a.encodeBytes t.decodeString16=function(e,t,r,n){return u(e,t,3,o.readUint16(e,t+1,n),n)},t.decodeString32=function(e,t,r,n){return u(e,t,5,o.readUint32(e,t+1,n),n)},t.decodeString64=function(e,t,r,n){var a=o.readUint64(e,t+1,n) if("bigint"==typeof a)throw new Error("".concat(i.decodeErrPrefix," 64-bit integer string lengths not supported")) return u(e,t,9,a,n)},t.decodeString8=function(e,t,r,n){return u(e,t,2,o.readUint8(e,t+1,n),n)},t.decodeStringCompact=function(e,t,r,n){return u(e,t,1,r,n)},t.encodeString=c},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(37),o=r(24) function a(e,t,r,i){return new n.Token(n.Type.array,i,r)}function s(e,t){i.encodeUintValue(e,n.Type.array.majorEncoded,t.value)}s.compareTokens=i.encodeUint.compareTokens,s.encodedSize=function(e){return i.encodeUintValue.encodedSize(e.value)},t.decodeArray16=function(e,t,r,n){return a(0,0,3,i.readUint16(e,t+1,n))},t.decodeArray32=function(e,t,r,n){return a(0,0,5,i.readUint32(e,t+1,n))},t.decodeArray64=function(e,t,r,n){var s=i.readUint64(e,t+1,n) if("bigint"==typeof s)throw new Error("".concat(o.decodeErrPrefix," 64-bit integer array lengths not supported")) return a(0,0,9,s)},t.decodeArray8=function(e,t,r,n){return a(0,0,2,i.readUint8(e,t+1,n))},t.decodeArrayCompact=function(e,t,r,n){return a(0,0,1,r)},t.decodeArrayIndefinite=function(e,t,r,n){if(!1===n.allowIndefinite)throw new Error("".concat(o.decodeErrPrefix," indefinite length items not allowed")) return a(0,0,1,1/0)},t.encodeArray=s},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(37),o=r(24) function a(e,t,r,i){return new n.Token(n.Type.map,i,r)}function s(e,t){i.encodeUintValue(e,n.Type.map.majorEncoded,t.value)}s.compareTokens=i.encodeUint.compareTokens,s.encodedSize=function(e){return i.encodeUintValue.encodedSize(e.value)},t.decodeMap16=function(e,t,r,n){return a(0,0,3,i.readUint16(e,t+1,n))},t.decodeMap32=function(e,t,r,n){return a(0,0,5,i.readUint32(e,t+1,n))},t.decodeMap64=function(e,t,r,n){var s=i.readUint64(e,t+1,n) if("bigint"==typeof s)throw new Error("".concat(o.decodeErrPrefix," 64-bit integer map lengths not supported")) return a(0,0,9,s)},t.decodeMap8=function(e,t,r,n){return a(0,0,2,i.readUint8(e,t+1,n))},t.decodeMapCompact=function(e,t,r,n){return a(0,0,1,r)},t.decodeMapIndefinite=function(e,t,r,n){if(!1===n.allowIndefinite)throw new Error("".concat(o.decodeErrPrefix," indefinite length items not allowed")) return a(0,0,1,1/0)},t.encodeMap=s},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(37) function o(e,t){i.encodeUintValue(e,n.Type.tag.majorEncoded,t.value)}o.compareTokens=i.encodeUint.compareTokens,o.encodedSize=function(e){return i.encodeUintValue.encodedSize(e.value)},t.decodeTag16=function(e,t,r,o){return new n.Token(n.Type.tag,i.readUint16(e,t+1,o),3)},t.decodeTag32=function(e,t,r,o){return new n.Token(n.Type.tag,i.readUint32(e,t+1,o),5)},t.decodeTag64=function(e,t,r,o){return new n.Token(n.Type.tag,i.readUint64(e,t+1,o),9)},t.decodeTag8=function(e,t,r,o){return new n.Token(n.Type.tag,i.readUint8(e,t+1,o),2)},t.decodeTagCompact=function(e,t,r,i){return new n.Token(n.Type.tag,r,1)},t.encodeTag=o},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(18),i=r(24),o=r(37) function a(e,t,r){if(r){if(!1===r.allowNaN&&Number.isNaN(e))throw new Error("".concat(i.decodeErrPrefix," NaN values are not supported")) if(!1===r.allowInfinity&&(e===1/0||e===-1/0))throw new Error("".concat(i.decodeErrPrefix," Infinity values are not supported"))}return new n.Token(n.Type.float,e,t)}function s(e,t,r){var i,o=t.value if(!1===o)e.push([20|n.Type.float.majorEncoded]) else if(!0===o)e.push([21|n.Type.float.majorEncoded]) else if(null===o)e.push([22|n.Type.float.majorEncoded]) else if(void 0===o)e.push([23|n.Type.float.majorEncoded]) else{var a=!1 r&&!0===r.float64||(f(o),o===h(l,1)||Number.isNaN(o)?(l[0]=249,e.push(l.slice(0,3)),a=!0):(d(o),o===p(l,1)&&(l[0]=250,e.push(l.slice(0,5)),a=!0))),a||(i=o,c.setFloat64(0,i,!1),m(l,1),l[0]=251,e.push(l.slice(0,9)))}}s.encodedSize=function(e,t){var r=e.value if(!1===r||!0===r||null==r)return 1 if(!t||!0!==t.float64){f(r) var n=h(l,1) if(r===n||Number.isNaN(r))return 3 if(d(r),r===(n=p(l,1)))return 5}return 9} var u=new ArrayBuffer(9),c=new DataView(u,1),l=new Uint8Array(u,0) function f(e){if(e===1/0)c.setUint16(0,31744,!1) else if(e===-1/0)c.setUint16(0,64512,!1) else if(Number.isNaN(e))c.setUint16(0,32256,!1) else{c.setFloat32(0,e) var t=c.getUint32(0),r=(2139095040&t)>>23,n=8388607&t if(255===r)c.setUint16(0,31744,!1) else if(0===r)c.setUint16(0,(2147483648&e)>>16|n>>13,!1) else{var i=r-127 i<-24?c.setUint16(0,0):i<-14?c.setUint16(0,(2147483648&t)>>16|1<<24+i,!1):c.setUint16(0,(2147483648&t)>>16|i+15<<10|n>>13,!1)}}}function h(e,t){if(e.length-t<2)throw new Error("".concat(i.decodeErrPrefix," not enough data for float16")) var r=(e[t]<<8)+e[t+1] if(31744===r)return 1/0 if(64512===r)return-1/0 if(32256===r)return NaN var n,o=r>>10&31,a=1023&r return n=0===o?a*Math.pow(2,-24):31!==o?(a+1024)*Math.pow(2,o-25):0===a?1/0:NaN,32768&r?-n:n}function d(e){c.setFloat32(0,e,!1)}function p(e,t){if(e.length-t<4)throw new Error("".concat(i.decodeErrPrefix," not enough data for float32")) var r=(e.byteOffset||0)+t return new DataView(e.buffer,r,4).getFloat32(0,!1)}function m(e,t){if(e.length-t<8)throw new Error("".concat(i.decodeErrPrefix," not enough data for float64")) var r=(e.byteOffset||0)+t return new DataView(e.buffer,r,8).getFloat64(0,!1)}s.compareTokens=o.encodeUint.compareTokens,t.decodeBreak=function(e,t,r,o){if(!1===o.allowIndefinite)throw new Error("".concat(i.decodeErrPrefix," indefinite length items not allowed")) return new n.Token(n.Type.break,void 0,1)},t.decodeFloat16=function(e,t,r,n){return a(h(e,t+1),3,n)},t.decodeFloat32=function(e,t,r,n){return a(p(e,t+1),5,n)},t.decodeFloat64=function(e,t,r,n){return a(m(e,t+1),9,n)},t.decodeUndefined=function(e,t,r,o){if(!1===o.allowUndefined)throw new Error("".concat(i.decodeErrPrefix," undefined values are not supported")) return!0===o.coerceUndefinedToNull?new n.Token(n.Type.null,null,1):new n.Token(n.Type.undefined,void 0,1)},t.encodeFloat=s},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{} i(this,e),this.pos=0,this.data=t,this.options=r}var t,r return t=e,(r=[{key:"done",value:function(){return this.pos>=this.data.length}},{key:"next",value:function(){var e=this.data[this.pos],t=u.quick[e] if(void 0===t){var r=u.jump[e] if(!r)throw new Error("".concat(a.decodeErrPrefix," no decoder for major type ").concat(e>>>5," (byte 0x").concat(e.toString(16).padStart(2,"0"),")")) var n=31&e t=r(this.data,this.pos,n,this.options)}return this.pos+=t.encodedLength,t}}])&&o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),f=Symbol.for("DONE"),h=Symbol.for("BREAK") function d(e,t){if(e.done())return f var r=e.next() if(r.type===s.Type.break)return h if(r.type.terminal)return r.value if(r.type===s.Type.array)return function(e,t,r){for(var n=[],i=0;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(i=!1,function(){i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=r(290)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(12))},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"Request timed out" return a(this,r),(e=t.call(this,n)).name="TimeoutError",e}return o(r)}(l(Error)) t.TimeoutError=m var v=function(e){s(r,e) var t=u(r) function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The operation was aborted." return a(this,r),(e=t.call(this,n)).name="AbortError",e}return o(r)}(l(Error)) t.AbortError=v var y=function(e){s(r,e) var t=u(r) function r(e){var n return a(this,r),(n=t.call(this,e.statusText)).name="HTTPError",n.response=e,n}return o(r)}(l(Error)) t.HTTPError=y},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s n(this,e),this.super=new a(t,r),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}var t,r,o return t=e,o=[{key:"createObjectURL",value:function(e){return a.createObjectURL(e)}},{key:"revokeObjectURL",value:function(e){a.revokeObjectURL(e)}}],(r=[{key:"hash",get:function(){return this.super.hash},set:function(e){this.super.hash=e}},{key:"host",get:function(){return this.super.host},set:function(e){this.super.host=e}},{key:"hostname",get:function(){return this.super.hostname},set:function(e){this.super.hostname=e}},{key:"href",get:function(){return this.super.href},set:function(e){this.super.href=e}},{key:"origin",get:function(){return this.super.origin}},{key:"password",get:function(){return this.super.password},set:function(e){this.super.password=e}},{key:"pathname",get:function(){return this.super.pathname},set:function(e){this.super.pathname=e}},{key:"port",get:function(){return this.super.port},set:function(e){this.super.port=e}},{key:"protocol",get:function(){return this.super.protocol},set:function(e){this.super.protocol=e}},{key:"search",get:function(){return this.super.search},set:function(e){this.super.search=e}},{key:"searchParams",get:function(){return this.super.searchParams}},{key:"username",get:function(){return this.super.username},set:function(e){this.super.username=e}},{key:"toJSON",value:function(){return this.super.toJSON()}},{key:"toString",value:function(){return this.super.toString()}},{key:"format",value:function(){return this.toString()}}])&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}() e.exports={URLWithLegacySupport:u,URLSearchParams:self.URLSearchParams,defaultBase:s,format:function(e){if("string"==typeof e)return new a(e).toString() if(!(e instanceof a)){var t=e.username&&e.password?"".concat(e.username,":").concat(e.password,"@"):"",r=e.auth?e.auth+"@":"",n=e.port?":"+e.port:"",i=e.protocol?e.protocol+"//":"",o=e.host||"",s=e.hostname||"",u=e.search||(e.query?"?"+e.query:""),c=e.hash||"",l=e.pathname||"",f=e.path||l+u return"".concat(i).concat(t||r).concat(o||s+n).concat(f).concat(c)}}}},function(e,t){function r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return n(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var i=0,o=function(){} return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r999999999))throw i.default(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS") return t}}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(7),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("bitswap/stat",{searchParams:s.toUrlSearchParams(r),signal:r.signal,headers:r.headers}) case 3:return n=t.sent,t.t0=c,t.next=7,n.json() case 7:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) function c(e){return{provideBufLen:e.ProvideBufLen,wantlist:(e.Wantlist||[]).map((function(e){return o.CID.parse(e["/"])})),peers:e.Peers||[],blocksReceived:BigInt(e.BlocksReceived),dataReceived:BigInt(e.DataReceived),blocksSent:BigInt(e.BlocksSent),dataSent:BigInt(e.DataSent),dupBlksReceived:BigInt(e.DupBlksReceived),dupDataReceived:BigInt(e.DupDataReceived)}}t.createStat=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("block/get",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers}) case 3:return o=t.sent,t.t0=Uint8Array,t.next=7,o.arrayBuffer() case 7:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createGet=l},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new o(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function o(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(o=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new o(e)}var a=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,o,a,s,u,c return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,o=!1,e.prev=3,s=i(t) case 5:return e.next=7,s.next() case 7:if(!(n=!(u=e.sent).done)){e.next=13 break}c=u.value,r.push(c) case 10:n=!1,e.next=5 break case 13:e.next=19 break case 15:e.prev=15,e.t0=e.catch(3),o=!0,a=e.t0 case 19:if(e.prev=19,e.prev=20,!n||null==s.return){e.next=24 break}return e.next=24,s.return() case 24:if(e.prev=24,!o){e.next=27 break}throw a case 27:return e.finish(24) case 28:return e.finish(19) case 29:return e.abrupt("return",r) case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})),function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(e){return t.apply(this,arguments)}}() e.exports=a},function(e,t,r){"use strict" function n(e){return new o(e)}function i(e){var t,r function n(t,r){try{var a=e[t](r),s=a.value,u=s instanceof o Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(a.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){this.wrapped=e}function a(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new s(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function s(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(s=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new s(e)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)} var u=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,r){var i,o,s,u,c,l return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=!1,o=!1,e.prev=2,u=a(t) case 4:return e.next=6,n(u.next()) case 6:if(!(i=!(c=e.sent).done)){e.next=13 break}return l=c.value,e.next=10,r(l) case 10:i=!1,e.next=4 break case 13:e.next=19 break case 15:e.prev=15,e.t0=e.catch(2),o=!0,s=e.t0 case 19:if(e.prev=19,e.prev=20,!i||null==u.return){e.next=24 break}return e.next=24,n(u.return()) case 24:if(e.prev=24,!o){e.next=27 break}throw s case 27:return e.finish(24) case 28:return e.finish(19) case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})),function(){return new i(e.apply(this,arguments))}) return function(e,r){return t.apply(this,arguments)}}() e.exports=u},function(e,t,r){"use strict" function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r999999999))throw u.default(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS") return t}}}var v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"file"} n(this,e) var r=t.type,i=t.data,o=t.blockSizes,a=t.hashType,s=t.fanout,c=t.mtime,f=t.mode if(r&&!l.includes(r))throw u.default(new Error("Type: "+r+" is not valid"),"ERR_INVALID_TYPE") this.type=r||"file",this.data=i,this.hashType=a,this.fanout=s,this.blockSizes=o||[],this._originalMode=0,this.mode=p(f),c&&(this.mtime=m(c),this.mtime&&!this.mtime.nsecs&&(this.mtime.nsecs=0))}var t,r,o return t=e,o=[{key:"unmarshal",value:function(t){var r=c.decode(t),n=c.toObject(r,{defaults:!1,arrays:!0,longs:Number,objects:!1}),i=new e({type:l[n.Type],data:n.Data,blockSizes:n.blocksizes,mode:n.mode,mtime:n.mtime?{secs:n.mtime.Seconds,nsecs:n.mtime.FractionalNanoseconds}:void 0}) return i._originalMode=n.mode||0,i}}],(r=[{key:"mode",get:function(){return this._mode},set:function(e){this._mode=this.isDirectory()?d:h var t=p(e) void 0!==t&&(this._mode=t)}},{key:"isDirectory",value:function(){return Boolean(this.type&&f.includes(this.type))}},{key:"addBlockSize",value:function(e){this.blockSizes.push(e)}},{key:"removeBlockSize",value:function(e){this.blockSizes.splice(e,1)}},{key:"fileSize",value:function(){if(this.isDirectory())return 0 var e=0 return this.blockSizes.forEach((function(t){e+=t})),this.data&&(e+=this.data.length),e}},{key:"marshal",value:function(){var e switch(this.type){case"raw":e=c.DataType.Raw break case"directory":e=c.DataType.Directory break case"file":e=c.DataType.File break case"metadata":e=c.DataType.Metadata break case"symlink":e=c.DataType.Symlink break case"hamt-sharded-directory":e=c.DataType.HAMTShard break default:throw u.default(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE")}var t,r,n=this.data if(this.data&&this.data.length||(n=void 0),null!=this.mode&&((t=4294963200&this._originalMode|(p(this.mode)||0))!==h||this.isDirectory()||(t=void 0),t===d&&this.isDirectory()&&(t=void 0)),null!=this.mtime){var i=m(this.mtime) i&&0===(r={Seconds:i.secs,FractionalNanoseconds:i.nsecs}).FractionalNanoseconds&&delete r.FractionalNanoseconds}var o={Type:e,Data:n,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:t,mtime:r} return c.encode(o).finish()}}])&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}() t.UnixFS=v,t.parseMode=p,t.parseMtime=m},function(e,t,r){"use strict" e.exports=f var n,i=r(43),o=i.LongBits,a=i.base64,s=i.utf8 function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(f.create=function(){return new n})()}:function(){return new f}} function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7 for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7 t[r++]=e.lo}function v(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}f.create=h(),f.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7 t[r]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=o.from(e) return this._push(m,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode() return this._push(m,t.length(),t)},f.prototype.bool=function(e){return this._push(d,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e) return this._push(v,4,t.lo)._push(v,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)} var y=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0 if(!t)return this._push(d,1,0) if(i.isString(e)){var r=f.alloc(t=a.length(e)) a.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=s.length(e) return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next return t},f._configure=function(e){n=e,f.create=h(),n._configure()}},function(e,t,r){"use strict" e.exports=u var n,i=r(43),o=i.LongBits,a=i.utf8 function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e) throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e) throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l} function h(){var e=new o(0,0),t=0 if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this) if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this) if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8) return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10) return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32() return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4) return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4) return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4) var e=i.float.readFloatLE(this.buf,this.pos) return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4) var e=i.float.readDoubleLE(this.buf,this.pos) return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e if(r>this.len)throw s(this,e) return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes() return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e) this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]) return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip() break case 1:this.skip(8) break case 2:this.skip(this.uint32()) break case 3:for(;4!=(e=7&this.uint32());)this.skipType(e) break case 5:this.skip(4) break default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=f(),n._configure() var t=i.Long?"toLong":"toNumber" i.merge(u.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==y[1]?y[1]:{},!(a=i({storeCodec:"dag-cbor",hashAlg:"sha2-256"},o)).inputCodec){r.next=8 break}if(n instanceof Uint8Array){r.next=5 break}throw new Error("Can only inputCodec on raw bytes that can be decoded") case 5:u=n,r.next=13 break case 8:return r.next=10,e.getCodec(a.storeCodec) case 10:h=r.sent,u=h.encode(n),a.inputCodec=a.storeCodec case 13:return d=new AbortController,p=f.abortSignal(d.signal,a.signal),r.t0=t,r.t1=i,r.t2={timeout:a.timeout,signal:p,searchParams:l.toUrlSearchParams(a)},r.next=20,c.multipartRequest([u],d,a.headers) case 20:return r.t3=r.sent,r.t4=(0,r.t1)(r.t2,r.t3),r.next=24,r.t0.post.call(r.t0,"dag/put",r.t4) case 24:return m=r.sent,r.next=27,m.json() case 27:return v=r.sent,r.abrupt("return",s.CID.parse(v.Cid["/"])) case 29:case"end":return r.stop()}}),r)}))) return function(e){return r.apply(this,arguments)}}()}))(t)}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(15) t.objectToCamelWithMetadata=function(e){var t=n.objectToCamel(e) return Object.prototype.hasOwnProperty.call(t,"mode")&&(t.mode=parseInt(t.mode,8)),Object.prototype.hasOwnProperty.call(t,"mtime")&&(t.mtime={secs:t.mtime,nsecs:t.mtimeNsecs||0},delete t.mtimeNsecs),t}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("files/stat",{signal:n.signal,searchParams:f.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return(a=t.sent).WithLocality=a.WithLocality||!1,t.abrupt("return",d(c.objectToCamelWithMetadata(a))) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) function d(e){return e.cid=u.CID.parse(e.hash),delete e.hash,e}t.createStat=h},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==j[1]?j[1]:{},o=!1,s=!1,t.prev=3,l=h(v.normaliseInput(r)) case 5:return t.next=7,u(l.next()) case 7:if(!(o=!(f=t.sent).done)){t.next=63 break}return d=f.value,m=d.path,b=d.recursive,g=d.metadata,t.next=11,u(e.post("pin/add",{signal:i.signal,searchParams:y.toUrlSearchParams(a(a({},i),{},{arg:m,recursive:b,metadata:g?JSON.stringify(g):void 0,stream:!0})),headers:i.headers})) case 11:w=t.sent,_=!1,k=!1,t.prev=14,O=h(w.ndjson()) case 16:return t.next=18,u(O.next()) case 18:if(!(_=!(E=t.sent).done)){t.next=44 break}if(!(S=E.value).Pins){t.next=39 break}P=n(S.Pins),t.prev=22,P.s() case 24:if((M=P.n()).done){t.next=30 break}return A=M.value,t.next=28,p.CID.parse(A) case 28:t.next=24 break case 30:t.next=35 break case 32:t.prev=32,t.t0=t.catch(22),P.e(t.t0) case 35:return t.prev=35,P.f(),t.finish(35) case 38:return t.abrupt("continue",41) case 39:return t.next=41,p.CID.parse(S) case 41:_=!1,t.next=16 break case 44:t.next=50 break case 46:t.prev=46,t.t1=t.catch(14),k=!0,x=t.t1 case 50:if(t.prev=50,t.prev=51,!_||null==O.return){t.next=55 break}return t.next=55,u(O.return()) case 55:if(t.prev=55,!k){t.next=58 break}throw x case 58:return t.finish(55) case 59:return t.finish(50) case 60:o=!1,t.next=5 break case 63:t.next=69 break case 65:t.prev=65,t.t2=t.catch(3),s=!0,c=t.t2 case 69:if(t.prev=69,t.prev=70,!o||null==l.return){t.next=74 break}return t.next=74,u(l.return()) case 74:if(t.prev=74,!s){t.next=77 break}throw c case 77:return t.finish(74) case 78:return t.finish(69) case 79:case"end":return t.stop()}}),t,null,[[3,65,69,79],[14,46,50,60],[22,32,35,38],[51,,55,59],[70,,74,78]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createAddAll=b},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==P[1]?P[1]:{},o=!1,a=!1,t.prev=3,c=f(m.normaliseInput(r)) case 5:return t.next=7,u(c.next()) case 7:if(!(o=!(h=t.sent).done)){t.next=50 break}return p=h.value,y=p.path,b=p.recursive,(g=new URLSearchParams(n.searchParams)).append("arg","".concat(y)),null!=b&&g.set("recursive",String(b)),t.next=14,u(e.post("pin/rm",{signal:n.signal,headers:n.headers,searchParams:v.toUrlSearchParams(i(i({},n),{},{arg:"".concat(y),recursive:b}))})) case 14:w=t.sent,_=!1,k=!1,t.prev=17,O=f(w.ndjson()) case 19:return t.next=21,u(O.next()) case 21:if(!(_=!(E=t.sent).done)){t.next=31 break}if(!(S=E.value).Pins){t.next=26 break}return t.delegateYield(l(f(S.Pins.map((function(e){return d.CID.parse(e)}))),u),"t0",25) case 25:return t.abrupt("continue",28) case 26:return t.next=28,d.CID.parse(S) case 28:_=!1,t.next=19 break case 31:t.next=37 break case 33:t.prev=33,t.t1=t.catch(17),k=!0,x=t.t1 case 37:if(t.prev=37,t.prev=38,!_||null==O.return){t.next=42 break}return t.next=42,u(O.return()) case 42:if(t.prev=42,!k){t.next=45 break}throw x case 45:return t.finish(42) case 46:return t.finish(37) case 47:o=!1,t.next=5 break case 50:t.next=56 break case 52:t.prev=52,t.t2=t.catch(3),a=!0,s=t.t2 case 56:if(t.prev=56,t.prev=57,!o||null==c.return){t.next=61 break}return t.next=61,u(c.return()) case 61:if(t.prev=61,!a){t.next=64 break}throw s case 64:return t.finish(61) case 65:return t.finish(56) case 66:case"end":return t.stop()}}),t,null,[[3,52,56,66],[17,33,37,47],[38,,42,46],[57,,61,65]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createRmAll=y},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){switch(e.Status){case"valid":var t=e.PinCount,r=t.Pinning,n=t.Pinned return{status:"valid",pinCount:{queued:t.Queued,pinning:r,pinned:n,failed:t.Failed}} case"invalid":return{status:"invalid"} default:return{status:e.Status}}}Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRemoteService=function(e){return function(e){for(var t=1;t0&&void 0!==o[0]?o[0]:{},t.next=3,e.post("repo/stat",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,t.abrupt("return",{numObjects:BigInt(i.NumObjects),repoSize:BigInt(i.RepoSize),repoPath:i.RepoPath,version:i.Version,storageMax:BigInt(i.StorageMax)}) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createStat=s},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;te.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==T[1]?T[1]:{},o=new AbortController,s=g.abortSignal(o.signal,n.signal),t.next=5,u(y.multipartRequest(r,o,n.headers)) case 5:return c=t.sent,l=c.headers,f=c.body,d=c.total,p=c.parts,v="function"==typeof n.progress?_(d,p,n.progress):[void 0,void 0],w=a(v,2),k=w[0],O=w[1],t.next=13,u(e.post("add",{searchParams:b.toUrlSearchParams(i(i({"stream-channels":!0},n),{},{progress:Boolean(k)})),onUploadProgress:O,signal:s,headers:l,body:f})) case 13:E=t.sent,S=!1,P=!1,t.prev=16,A=h(E.ndjson()) case 18:return t.next=20,u(A.next()) case 20:if(!(S=!(j=t.sent).done)){t.next=32 break}if(R=j.value,void 0===(R=m.objectToCamel(R)).hash){t.next=28 break}return t.next=26,x(R) case 26:t.next=29 break case 28:k&&k(R.bytes||0,R.name) case 29:S=!1,t.next=18 break case 32:t.next=38 break case 34:t.prev=34,t.t0=t.catch(16),P=!0,M=t.t0 case 38:if(t.prev=38,t.prev=39,!S||null==A.return){t.next=43 break}return t.next=43,u(A.return()) case 43:if(t.prev=43,!P){t.next=46 break}throw M case 46:return t.finish(43) case 47:return t.finish(38) case 48:case"end":return t.stop()}}),t,null,[[16,34,38,48],[39,,43,47]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})),_=function(e,t,r){return t?[void 0,k(e,t,r)]:[r,void 0]},k=function(e,t,r){var n=0,i=t.length return function(o){for(var a=o.loaded,s=o.total,u=Math.floor(a/s*e);n0&&void 0!==s[0]?s[0]:{},t.next=3,e.post("id",{signal:r.signal,searchParams:f.toUrlSearchParams(i({arg:r.peerId?r.peerId.toString():void 0},r)),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return o=t.sent,(a=i({},u.objectToCamel(o))).addresses&&(a.addresses=a.addresses.map((function(e){return new c.Multiaddr(e)}))),t.abrupt("return",a) case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createId=h},function(e,t,r){"use strict" var n=r(32).rotr32 function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict" var n=r(32),i=r(65),o=r(160),a=r(16),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,y=[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] function b(){if(!(this instanceof b))return new b v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,v),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n] for(;n>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict" var n=r(33),i=r(66),o=r(163),a=r(16),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,y=[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] function b(){if(!(this instanceof b))return new b v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,v),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n] for(;n7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1 return!0},p=function(e){var t="" e=(e=(e=(e=(e=a.encode(e)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("") for(var r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16)) return"0x"+t.join("")},isHex:g,isHexStrict:b,stripHexPrefix:function(e){return 0!==e&&g(e)?e.replace(/^(-)?0x/i,"$1"):e},leftPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0 return(n?"0x":"")+new Array(i).join(r||"0")+e},rightPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0 return(n?"0x":"")+e+new Array(i).join(r||"0")},toTwosComplement:function(e){return"0x"+f(e).toTwos(256).toString(16,64)},sha3:_,sha3Raw:function(e){return null===(e=_(e))?w:e},toNumber:function(e){return"number"==typeof e?e:m(y(e))}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0 var n=r(10),i=r(38) t.MAX_UINT64=new i.BN("ffffffffffffffff",16),t.MAX_INTEGER=new i.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new i.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},function(e,t,r){"use strict";(function(e){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator] if(!r)return e var n,i,o=r.call(e),a=[] try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0 var o=i(r(101)),a=r(38),s=r(170),u=r(50),c=r(168),l=r(44),f=r(104),h=r(80),d=r(110),p=function(){function e(e,t,r,n){void 0===e&&(e=new a.BN(0)),void 0===t&&(t=new a.BN(0)),void 0===r&&(r=c.KECCAK256_RLP),void 0===n&&(n=c.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,i=t.stateRoot,o=t.codeHash return new e(r?new a.BN((0,l.toBuffer)(r)):void 0,n?new a.BN((0,l.toBuffer)(n)):void 0,i?(0,l.toBuffer)(i):void 0,o?(0,l.toBuffer)(o):void 0)},e.fromRlpSerializedAccount=function(e){var t=a.rlp.decode(e) if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array") return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=n(t,4),i=r[0],o=r[1],s=r[2],u=r[3] return new e(new a.BN(i),new a.BN(o),s,u)},e.prototype._validate=function(){if(this.nonce.lt(new a.BN(0)))throw new Error("nonce must be greater than zero") if(this.balance.lt(new a.BN(0)))throw new Error("balance must be greater than zero") if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32") if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,d.bnToUnpaddedBuffer)(this.nonce),(0,d.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return a.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(c.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(c.KECCAK256_NULL)},e}() t.Account=p,t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e) var r=(0,u.stripHexPrefix)(e).toLowerCase(),n="" t&&(n=(0,d.toType)(t,d.TypeOutput.BN).toString()+"0x") for(var i=(0,f.keccakFromString)(n+r).toString("hex"),o="0x",a=0;a=8?o+=r[a].toUpperCase():o+=r[a] return o},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(t,r){(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r) var n=new a.BN(r) return n.isZero()?(0,f.rlphash)([t,null]).slice(-20):(0,f.rlphash)([t,e.from(n.toArray())]).slice(-20)},t.generateAddress2=function(t,r,n){return(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,h.assertIsBuffer)(n),(0,o.default)(20===t.length),(0,o.default)(32===r.length),(0,f.keccak256)(e.concat([e.from("ff","hex"),t,r,(0,f.keccak256)(n)])).slice(-20)},t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)},t.isValidPublic=function(t,r){return void 0===r&&(r=!1),(0,h.assertIsBuffer)(t),64===t.length?(0,s.publicKeyVerify)(e.concat([e.from([4]),t])):!!r&&(0,s.publicKeyVerify)(t)},t.pubToAddress=function(t,r){return void 0===r&&(r=!1),(0,h.assertIsBuffer)(t),r&&64!==t.length&&(t=e.from((0,s.publicKeyConvert)(t,!1).slice(1))),(0,o.default)(64===t.length),(0,f.keccak)(t).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(t){return(0,h.assertIsBuffer)(t),e.from((0,s.publicKeyCreate)(t,!1)).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(t){return(0,h.assertIsBuffer)(t),64!==t.length&&(t=e.from((0,s.publicKeyConvert)(t,!1).slice(1))),t},t.zeroAddress=function(){var e=(0,l.zeros)(20) return(0,l.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}}).call(this,r(10).Buffer)},function(e,t,r){"use strict" var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1] return i[1]},trys:[],ops:[]} return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.") for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o break case 4:return a.label++,{value:o[1],done:!1} case 5:a.label++,n=o[1],o=[0] continue case 7:o=a.ops.pop(),a.trys.pop() continue default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0 continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>8,a=255&i o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i function o(e){this.rand=e}if(e.exports=function(e){return i||(i=new o(null)),i.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e) for(var t=new Uint8Array(e),r=0;r>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict" var n=r(34),i=r(67),o=r(175),a=r(16),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,y=[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] function b(){if(!(this instanceof b))return new b v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,v),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n] for(;n4294967295)throw new RangeError("requested too many random bytes") var r=i.allocUnsafe(e) if(e>0)if(e>65536)for(var a=0;a0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?k(e,new _):P(e,s,t,!0) else if(s.ended)k(e,new g) else{if(s.destroyed)return!1 s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?P(e,s,t,!1):R(e,s)):P(e,s,t,!1)}else n||(s.reading=!1,R(e,s)) return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function R(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r) var r}function L(e){var t=e._readableState o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(F,t,e))}function F(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):A(this),null if(0===(e=M(e,t))&&t.ended)return 0===t.length&&L(this),null var n,i=t.needReadable return o("need readable",i),(0===t.length||t.length-e0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){k(this,new w("_read()"))},E.prototype.pipe=function(e,t){var r=this,i=this._readableState switch(i.pipesCount){case 0:i.pipes=e break case 1:i.pipes=[i.pipes,e] break default:i.pipes.push(e)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,t) var s=t&&!1===t.end||e===n.stdout||e===n.stderr?m:u function u(){o("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",(function t(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",f),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())})) var c=function(e){return function(){var t=e._readableState o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,D(e))}}(r) e.on("drain",c) var l=!1 function f(t){o("ondata") var n=e.write(t) o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){o("onerror",t),m(),e.removeListener("error",h),0===a(e,"error")&&k(e,t)}function d(){e.removeListener("finish",p),m()}function p(){o("onfinish"),e.removeListener("close",d),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r) e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1} if(0===t.pipesCount)return this if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this if(!e){var n=t.pipes,i=t.pipesCount t.pipes=null,t.pipesCount=0,t.flowing=!1 for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?A(this):i.reading||n.nextTick(I,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t) return"readable"===e&&n.nextTick(C,this),r},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments) return"readable"!==e&&void 0!==e||n.nextTick(C,this),t},E.prototype.resume=function(){var e=this._readableState return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(N,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1 for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end() e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)) for(var a=0;a-1))throw new _(e) return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var i=this._writableState return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this,r(11),r(12))},function(e,t,r){"use strict" e.exports=l var n=r(51).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(52) function c(e,t){var r=this._transformState r.transforming=!1 var n=r.writecb if(null===n)return this.emit("error",new o) r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e) var i=this._readableState i.reading=!1,(i.needReadable||i.length=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s) return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called") this._finalized=!0 var t=this._digest() void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0 for(var r=0;r<4;++r)this._length[r]=0 return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i e.exports=E,E.ReadableState=O,r(45).EventEmitter var o,a=function(e,t){return e.listeners(t).length},s=r(188),u=r(10).Buffer,c=t.Uint8Array||function(){},l=r(542) o=l&&l.debuglog?l.debuglog("stream"):function(){} var f,h,d,p=r(543),m=r(189),v=r(190).getHighWaterMark,y=r(53).codes,b=y.ERR_INVALID_ARG_TYPE,g=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT r(9)(E,s) var k=m.errorOrDestroy,x=["error","close","destroy","pause","resume"] function O(e,t,n){i=i||r(54),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(46).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function E(e){if(i=i||r(54),!(this instanceof E))return new E(e) var t=this instanceof i this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function S(e,t,r,n,i){o("readableAddChunk",t) var a,s=e._readableState if(null===t)s.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end() r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}(e,s) else if(i||(a=function(e,t){var r,n return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)k(e,a) else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?k(e,new _):P(e,s,t,!0) else if(s.ended)k(e,new g) else{if(s.destroyed)return!1 s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?P(e,s,t,!1):R(e,s)):P(e,s,t,!1)}else n||(s.reading=!1,R(e,s)) return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function R(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r) var r}function L(e){var t=e._readableState o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(F,t,e))}function F(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):A(this),null if(0===(e=M(e,t))&&t.ended)return 0===t.length&&L(this),null var n,i=t.needReadable return o("need readable",i),(0===t.length||t.length-e0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){k(this,new w("_read()"))},E.prototype.pipe=function(e,t){var r=this,i=this._readableState switch(i.pipesCount){case 0:i.pipes=e break case 1:i.pipes=[i.pipes,e] break default:i.pipes.push(e)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,t) var s=t&&!1===t.end||e===n.stdout||e===n.stderr?m:u function u(){o("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",(function t(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",f),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())})) var c=function(e){return function(){var t=e._readableState o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,D(e))}}(r) e.on("drain",c) var l=!1 function f(t){o("ondata") var n=e.write(t) o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){o("onerror",t),m(),e.removeListener("error",h),0===a(e,"error")&&k(e,t)}function d(){e.removeListener("finish",p),m()}function p(){o("onfinish"),e.removeListener("close",d),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r) e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1} if(0===t.pipesCount)return this if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this if(!e){var n=t.pipes,i=t.pipesCount t.pipes=null,t.pipesCount=0,t.flowing=!1 for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?A(this):i.reading||n.nextTick(I,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t) return"readable"===e&&n.nextTick(C,this),r},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments) return"readable"!==e&&void 0!==e||n.nextTick(C,this),t},E.prototype.resume=function(){var e=this._readableState return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(N,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1 for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end() e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)) for(var a=0;a-1))throw new _(e) return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var i=this._writableState return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this,r(11),r(12))},function(e,t,r){"use strict" e.exports=l var n=r(53).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(54) function c(e,t){var r=this._transformState r.transforming=!1 var n=r.writecb if(null===n)return this.emit("error",new o) r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e) var i=this._readableState i.reading=!1,(i.needReadable||i.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.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},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y) for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+d(r[y-15])+r[y-16] for(var b=0;b<64;++b){var g=v+h(u)+c(u,p,m)+a[b]+r[b]|0,w=f(n)+l(n,i,o)|0 v=m,m=p,p=u,u=s+g|0,s=o,o=i,i=n,n=g+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32) return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(9),i=r(55),o=r(21).Buffer,a=[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],s=new Array(160) function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(u,i),u.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},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,b=0|this._gh,g=0|this._hh,w=0|this._al,_=0|this._bl,k=0|this._cl,x=0|this._dl,O=0|this._el,E=0|this._fl,S=0|this._gl,P=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4) for(;M<160;M+=2){var A=t[M-30],j=t[M-30+1],R=d(A,j),T=p(j,A),C=m(A=t[M-4],j=t[M-4+1]),I=v(j,A),N=t[M-14],D=t[M-14+1],B=t[M-32],L=t[M-32+1],F=T+D|0,U=R+N+y(F,T)|0 U=(U=U+C+y(F=F+I|0,I)|0)+B+y(F=F+L|0,L)|0,t[M]=U,t[M+1]=F}for(var z=0;z<160;z+=2){U=t[z],F=t[z+1] var q=l(r,n,i),H=l(w,_,k),V=f(r,w),W=f(w,r),G=h(s,O),Y=h(O,s),K=a[z],J=a[z+1],$=c(s,u,b),Z=c(O,E,S),Q=P+Y|0,X=g+G+y(Q,P)|0 X=(X=(X=X+$+y(Q=Q+Z|0,Z)|0)+K+y(Q=Q+J|0,J)|0)+U+y(Q=Q+F|0,F)|0 var ee=W+H|0,te=V+q+y(ee,W)|0 g=b,P=S,b=u,S=E,u=s,E=O,s=o+X+y(O=x+Q|0,x)|0,o=i,x=k,i=n,k=_,n=r,_=w,r=X+te+y(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+k|0,this._dl=this._dl+x|0,this._el=this._el+O|0,this._fl=this._fl+E|0,this._gl=this._gl+S|0,this._hl=this._hl+P|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,k)|0,this._dh=this._dh+o+y(this._dl,x)|0,this._eh=this._eh+s+y(this._el,O)|0,this._fh=this._fh+u+y(this._fl,E)|0,this._gh=this._gh+b+y(this._gl,S)|0,this._hh=this._hh+g+y(this._hl,P)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64) function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";(function(t,n){var i=r(81) e.exports=g var o,a=r(120) g.ReadableState=b,r(45).EventEmitter var s=function(e,t){return e.listeners(t).length},u=r(196),c=r(21).Buffer,l=t.Uint8Array||function(){},f=Object.create(r(68)) f.inherits=r(9) var h=r(557),d=void 0 d=h&&h.debuglog?h.debuglog("stream"):function(){} var p,m=r(558),v=r(197) f.inherits(g,u) var y=["error","close","destroy","pause","resume"] function b(e,t){e=e||{} var n=t instanceof(o=o||r(47)) this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode) var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384 this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(46).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function g(e){if(o=o||r(47),!(this instanceof g))return new g(e) this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end() r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,x(e)}}(e,a)):(i||(o=function(e,t){var r,n return n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):E(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(O,e):O(e))}function O(e){d("emit readable"),e.emit("readable"),A(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(S,e,t))}function S(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n return eo.length?o.length:e if(a===o.length?i+=o:i+=o.slice(0,e),0==(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a)) break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1 for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a)) break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r) var r}function R(e){var t=e._readableState if(t.length>0)throw new Error('"endReadable()" called on non-empty stream') t.endEmitted||(t.ended=!0,i.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function C(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):x(this),null if(0===(e=k(e,t))&&t.ended)return 0===t.length&&R(this),null var n,i=t.needReadable return d("need readable",i),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var r=this,o=this._readableState switch(o.pipesCount){case 0:o.pipes=e break case 1:o.pipes=[o.pipes,e] break default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t) var u=t&&!1===t.end||e===n.stdout||e===n.stderr?b:c function c(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",(function t(n,i){d("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",v),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",p),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())})) var l=function(e){return function(){var t=e._readableState d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,A(e))}}(r) e.on("drain",l) var f=!1,h=!1 function p(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==C(o.pipes,e))&&!f&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function m(t){d("onerror",t),b(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",v),b()}function b(){d("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r) e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",v),e.once("finish",y),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1} if(0===t.pipesCount)return this if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this if(!e){var n=t.pipes,i=t.pipesCount t.pipes=null,t.pipesCount=0,t.flowing=!1 for(var o=0;o=9007199254740991||t<=-9007199254740991)&&k("overflow","BigNumber.from",t),e.from(String(t)) var r=t if("bigint"==typeof r)return e.from(r.toString()) if(Object(c.j)(r))return e.from(Object(c.i)(r)) if(r)if(r.toHexString){var n=r.toHexString() if("string"==typeof n)return e.from(n)}else{var i=r._hex if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(c.l)(i)||"-"===i[0]&&Object(c.l)(i.substring(1))))return e.from(i)}return m.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return w(_(this).fromTwos(e))}},{key:"toTwos",value:function(e){return w(_(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return w(_(this).add(_(e)))}},{key:"sub",value:function(e){return w(_(this).sub(_(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&k("division-by-zero","div"),w(_(this).div(_(t)))}},{key:"mul",value:function(e){return w(_(this).mul(_(e)))}},{key:"mod",value:function(e){var t=_(e) return t.isNeg()&&k("division-by-zero","mod"),w(_(this).umod(t))}},{key:"pow",value:function(e){var t=_(e) return t.isNeg()&&k("negative-power","pow"),w(_(this).pow(t))}},{key:"and",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","and"),w(_(this).and(t))}},{key:"or",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","or"),w(_(this).or(t))}},{key:"xor",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","xor"),w(_(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","mask"),w(_(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","shl"),w(_(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","shr"),w(_(this).shrn(e))}},{key:"eq",value:function(e){return _(this).eq(_(e))}},{key:"lt",value:function(e){return _(this).lt(_(e))}},{key:"lte",value:function(e){return _(this).lte(_(e))}},{key:"gt",value:function(e){return _(this).gt(_(e))}},{key:"gte",value:function(e){return _(this).gte(_(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return _(this).isZero()}},{key:"toNumber",value:function(){try{return _(this).toNumber()}catch(e){k("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return m.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?y||(y=!0,m.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?m.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):m.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),_(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function g(e){if("string"!=typeof e)return g(e.toString(16)) if("-"===e[0])return"-"===(e=e.substring(1))[0]&&m.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00" for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4) return e}function w(e){return b.from(g(e))}function _(e){var t=b.from(e).toHexString() return"-"===t[0]?new p("-"+t.substring(3),16):new p(t.substring(2),16)}function k(e,t,r){var n={fault:e,operation:t} return null!=r&&(n.value=r),m.throwError(e,h.b.errors.NUMERIC_FAULT,n)}function x(e,t){for(var r=0;rthis.wordSize&&B.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),z=function(){function e(t,r,n,i){I(this,e),S(this,"_data",Object(c.a)(t)),S(this,"wordSize",r||32),S(this,"_coerceFunc",n),S(this,"allowLoose",i),this._offset=0}return D(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:B.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t) return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return b.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$") return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),q=r(201),H=r.n(q) function V(e){return"0x"+H.a.keccak_256(Object(c.a)(e))}var W=new h.b("rlp/5.6.0") function G(e){for(var t=[];e;)t.unshift(255&e),e>>=8 return t}function Y(e,t,r){for(var n=0,i=0;it+1+n&&W.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function $(e,t){if(0===e.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247 t+1+r>e.length&&W.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{}) var n=Y(e,t+1,r) return t+1+r+n>e.length&&W.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),J(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192 return t+1+i>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),J(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183 t+1+o>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}) var a=Y(e,t+1,o) return t+1+o+a>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(c.i)(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128 return t+1+s>e.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(c.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(c.i)(e[t])}}function Z(e){var t=Object(c.a)(e),r=$(t,0) return r.consumed!==t.length&&W.throwArgumentError("invalid rlp data","data",e),r.result}var Q=new h.b("address/5.6.0") function X(e){Object(c.l)(e,20)||Q.throwArgumentError("invalid address","address",e) for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0) for(var i=Object(c.a)(V(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase()) return"0x"+t.join("")}for(var ee={},te=0;te<10;te++)ee[String(te)]=String(te) for(var re=0;re<26;re++)ee[String.fromCharCode(65+re)]=String(10+re) var ne,ie=Math.floor((ne=9007199254740991,Math.log10?Math.log10(ne):Math.log(ne)/Math.LN10)) function oe(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return ee[e]})).join("");t.length>=ie;){var r=t.substring(0,ie) t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n return n}function ae(e){var t,r=null if("string"!=typeof e&&Q.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),r=X(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e&&Q.throwArgumentError("bad address checksum","address",e) else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==oe(e)&&Q.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new p(t,36).toString(16);r.length<40;)r="0"+r r=X("0x"+r)}else Q.throwArgumentError("invalid address","address",e) return r}function se(e){try{return ae(e),!0}catch(e){}return!1}function ue(e){for(var t,r=(t=ae(e).substring(2),new p(t,16).toString(36)).toUpperCase();r.length<30;)r="0"+r return"XE"+oe("XE00"+r)+r}function ce(e){var t=null try{t=ae(e.from)}catch(t){Q.throwArgumentError("missing from address","transaction",e)}var r=Object(c.o)(Object(c.a)(b.from(e.nonce).toHexString())) return ae(Object(c.e)(V(K([t,r])),12))}function le(e,t,r){return 32!==Object(c.d)(t)&&Q.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(c.d)(r)&&Q.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ae(Object(c.e)(V(Object(c.b)(["0xff",ae(e),t,r])),12))}var fe,he,de=new h.b("strings/5.6.0") function pe(e,t,r,n,i){if(e===he.BAD_PREFIX||e===he.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a>6==2;a++)o++ return o}return e===he.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(fe||(fe={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(he||(he={})) var me=Object.freeze({error:function(e,t,r,n,i){return de.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:pe,replace:function(e,t,r,n,i){return e===he.OVERLONG?(n.push(i),0):(n.push(65533),pe(e,t,r))}}) function ve(e,t){null==t&&(t=me.error),e=Object(c.a)(e) for(var r=[],n=0;n>7!=0){var o=null,a=null if(192==(224&i))o=1,a=127 else if(224==(240&i))o=2,a=2047 else{if(240!=(248&i)){n+=t(128==(192&i)?he.UNEXPECTED_CONTINUE:he.BAD_PREFIX,n-1,e,r) continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(he.OVERRUN,n-1,e,r) else{for(var s=i&(1<<8-o-1)-1,u=0;u1114111?n+=t(he.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(he.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(he.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.current t!=fe.current&&(de.checkNormalize(),e=e.normalize(t)) for(var r=[],n=0;n>6|192),r.push(63&i|128) else if(55296==(64512&i)){n++ var o=e.charCodeAt(n) if(n>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string") var a=65536+((1023&i)<<10)+(1023&o) r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(c.a)(r)}function be(e){var t="0000"+e.toString(16) return"\\u"+t.substring(t.length-4)}function ge(e,t){return'"'+ve(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b" case 9:return"\\t" case 10:return"\\n" case 13:return"\\r" case 34:return'\\"' case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?be(e):be(55296+((e-=65536)>>10&1023))+be(56320+(1023&e))})).join("")+'"'}function we(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function _e(e,t){return we(ve(e,t))}function ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.current return ve(ye(e,t))}function xe(e){return V(ye(e))}function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){for(var r=0;r=0?t:"")+"]",s=-1===t||e.dynamic return(o=n.call(this,"array",a,r,s)).coder=e,o.length=t,o}return t=i,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&ze.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}) for(var r=[],n=0;n=0||"tuple"===e)&&ar[t])return!0 return(or[t]||"payable"===t)&&nr.throwArgumentError("invalid modifier","name",t),!1}function ur(e,t){for(var r in t)S(e,r,t[r])}var cr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),lr=new RegExp(/^(.*)\[([0-9]*)\]$/),fr=function(){function e(t,r){er(this,e),t!==ir&&nr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),ur(this,r) var n=this.type.match(lr) ur(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return rr(e,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0} return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="" return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==cr.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+")"):r+=this.type,e!==cr.sighash&&(!0===this.indexed&&(r+=" indexed"),e===cr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(ir,{name:t.name||null,type:kr(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e function n(t){nr.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}} return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ") for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s2&&nr.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||nr.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=b.from(r[1]),r[0]):e}function vr(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0 break case"payable":t.payable=!0,t.stateMutability="payable" break case"nonpayable":t.payable=!1,t.stateMutability="nonpayable" break case"pure":t.constant=!0,t.stateMutability="pure" break case"view":t.constant=!0,t.stateMutability="view" break case"external":case"public":case"":break default:console.log("unknown modifier: "+e)}}))}function yr(e){var t={constant:!1,payable:!0,stateMutability:"payable"} return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&nr.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&nr.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||nr.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&nr.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&nr.throwArgumentError("unable to determine stateMutability","value",e),t}var br=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))}) e===cr.sighash&&nr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"}) var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") " return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e "constructor"!==e.type&&nr.throwArgumentError("invalid constructor object","value",e) var t=yr(e) t.constant&&nr.throwArgumentError("constructor cannot be constant","value",e) var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(fr.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?b.from(e.gas):null} return new r(ir,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=mr(e,t)).match(Er) return n&&"constructor"===n[1].trim()||nr.throwArgumentError("invalid constructor string","value",e),t.inputs=hr(n[2].trim(),!1),vr(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(dr),gr=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))}) var t="" return e!==cr.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") ",e!==cr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e "function"!==e.type&&nr.throwArgumentError("invalid function object","value",e) var t=yr(e),n={type:e.type,name:Or(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(fr.fromObject):[],outputs:e.outputs?e.outputs.map(fr.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?b.from(e.gas):null} return new r(ir,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=mr(e,t)).split(" returns ") n.length>2&&nr.throwArgumentError("invalid function string","value",e) var i=n[0].match(Er) if(i||nr.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Or(t.name),t.inputs=hr(i[2],!1),vr(i[3].trim(),t),n.length>1){var o=n[1].match(Er) ""==o[1].trim()&&""==o[3].trim()||nr.throwArgumentError("unexpected tokens","value",e),t.outputs=hr(o[2],!1)}else t.outputs=[] return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(br) function wr(e){var t=e.format() return"Error(string)"!==t&&"Panic(uint256)"!==t||nr.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var _r=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))}) var t="" return e!==cr.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e "error"!==e.type&&nr.throwArgumentError("invalid error object","value",e) var t={type:e.type,name:Or(e.name),inputs:e.inputs?e.inputs.map(fr.fromObject):[]} return wr(new r(ir,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(Er) return n||nr.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Or(t.name),t.inputs=hr(n[2],!1),wr(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(dr) function kr(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var xr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$") function Or(e){return e&&e.match(xr)||nr.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var Er=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$") function Sr(e,t){for(var r=0;r256||n%8!=0)&&Pr.throwArgumentError("invalid "+r[1]+" bit length","param",e),new It(n/8,"int"===r[1],e.name)}if(r=e.type.match(Mr)){var i=parseInt(r[1]) return(0===i||i>32)&&Pr.throwArgumentError("invalid bytes length","param",e),new pt(i,e.name)}return Pr.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new z(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new U(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(fr.from(e))})) return new Kt(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this e.length!==t.length&&Pr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}}) var n=e.map((function(e){return r._getCoder(fr.from(e))})),i=new Kt(n,"_"),o=this._getWriter() return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(fr.from(e))})) return new Kt(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Sr(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Rr=new jr function Tr(e){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cr(e,t){for(var r=0;r1&&Ur.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[gr.fromString(e).format()] return i||Ur.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase() for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r] Ur.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n})) return 0===i.length?Ur.throwArgumentError("no matching event","name",n):i.length>1&&Ur.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[pr.fromString(e).format()] return o||Ur.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=P(this.constructor,"getSighash") for(var r in this.errors)if(e===t(this.errors[r]))return this.errors[r] Ur.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n})) return 0===i.length?Ur.throwArgumentError("no matching error","name",n):i.length>1&&Ur.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[gr.fromString(e).format()] return o||Ur.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return P(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),P(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e)) var r=Object(c.a)(t) return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Ur.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e)) var r=Object(c.a)(t) return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Ur.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e)) var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break case 4:var u=Object(c.i)(r.slice(0,4)),l=Wr[u] if(l)o=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,s=l.signature,l.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0])) else try{var f=this.getError(u) o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return Ur.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this "string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Ur.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t}) var n=[] e.anonymous||n.push(this.getEventTopic(e)) var i=function(e,t){return"string"===e.type?xe(t):"bytes"===e.type?V(Object(c.i)(t)):("address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))} for(t.forEach((function(t,r){var o=e.inputs[r] o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Ur.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&Ur.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop() return n}},{key:"encodeEventLog",value:function(e,t){var r=this "string"==typeof e&&(e=this.getEvent(e)) var n=[],i=[],o=[] return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Ur.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a] if(e.indexed)if("string"===e.type)n.push(xe(s)) else if("bytes"===e.type)n.push(V(s)) else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented") n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e) Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||Ur.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[] e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(fr.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))})) var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,u=this._abiCoder.decode(o,t,!0),l=[],f=0,d=0 e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)l[t]=new Vr({_isIndexed:!0,hash:null}) else if(a[t])l[t]=new Vr({_isIndexed:!0,hash:s[d++]}) else try{l[t]=s[d++]}catch(e){l[t]=e}else try{l[t]=u[f++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){var r=l[t] r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:function(){throw Gr("property ".concat(JSON.stringify(e.name)),r)}}):l[e.name]=r}})) for(var p=function(e){var t=l[e] t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:function(){throw Gr("index ".concat(e),t)}})},m=0;m=0)throw e return pn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&pn.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,M(r) case 23:return t.abrupt("return",t.sent) case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||pn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&an(e,t)}(r,e) var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=cn(e) if(t){var i=cn(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return sn(this,r)}}(r) function r(e,n){var i return ln(this,r),pn.checkNew(this instanceof r?this.constructor:void 0,r),S(un(i=t.call(this)),"address",e),S(un(i),"provider",n||null),i}return hn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){pn.throwError(e,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(yn),gn=r(200) function wn(e,t){for(var r=0;r32&&Mn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Dn(e,t){return{address:ae(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(c.d)(t)&&Mn.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function Bn(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&Mn.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),Dn(e[0],e[1])):Dn(e.address,e.storageKeys)})) var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{}) return Dn(t,Object.keys(r).sort())})) return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function Ln(e){return Bn(e).map((function(e){return[e.address,e.storageKeys]}))}function Fn(e,t){if(null!=e.gasPrice){var r=b.from(e.gasPrice),n=b.from(e.maxFeePerGas||0) r.eq(n)||Mn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[Nn(e.chainId||0,"chainId"),Nn(e.nonce||0,"nonce"),Nn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Nn(e.maxFeePerGas||0,"maxFeePerGas"),Nn(e.gasLimit||0,"gasLimit"),null!=e.to?ae(e.to):"0x",Nn(e.value||0,"value"),e.data||"0x",Ln(e.accessList||[])] if(t){var o=Object(c.n)(t) i.push(Nn(o.recoveryParam,"recoveryParam")),i.push(Object(c.o)(o.r)),i.push(Object(c.o)(o.s))}return Object(c.c)(["0x02",K(i)])}function Un(e,t){var r=[Nn(e.chainId||0,"chainId"),Nn(e.nonce||0,"nonce"),Nn(e.gasPrice||0,"gasPrice"),Nn(e.gasLimit||0,"gasLimit"),null!=e.to?ae(e.to):"0x",Nn(e.value||0,"value"),e.data||"0x",Ln(e.accessList||[])] if(t){var n=Object(c.n)(t) r.push(Nn(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",K(r)])}function zn(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Mn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){A(e,Tn) var r=[] Rn.forEach((function(t){var n=e[t.name]||[],i={} t.numeric&&(i.hexPad="left"),n=Object(c.a)(Object(c.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Mn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(c.o)(n)).length>t.maxLength&&Mn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(c.i)(n))})) var n=0 if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&Mn.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(c.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!t)return K(r) var i=Object(c.n)(t),o=27+i.recoveryParam return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Mn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Mn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(c.i)(o)),r.push(Object(c.o)(Object(c.a)(i.r))),r.push(Object(c.o)(Object(c.a)(i.s))),K(r)}(e,t) switch(e.type){case 1:return Un(e,t) case 2:return Fn(e,t)}return Mn.throwError("unsupported transaction type: ".concat(e.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function qn(e,t,r){try{var n=jn(t[0]).toNumber() if(0!==n&&1!==n)throw new Error("bad recid") e.v=n}catch(e){Mn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(c.h)(t[1],32),e.s=Object(c.h)(t[2],32) try{var i=V(r(e)) e.from=In(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){console.log(e)}}function Hn(e){var t=Object(c.a)(e) if(t[0]>127)return function(e){var t=Z(e) 9!==t.length&&6!==t.length&&Mn.throwArgumentError("invalid raw transaction","rawTransaction",e) var r={nonce:jn(t[0]).toNumber(),gasPrice:jn(t[1]),gasLimit:jn(t[2]),to:An(t[3]),value:jn(t[4]),data:t[5],chainId:0} if(6===t.length)return r try{r.v=b.from(t[6]).toNumber()}catch(e){return console.log(e),r}if(r.r=Object(c.h)(t[7],32),r.s=Object(c.h)(t[8],32),b.from(r.r).isZero()&&b.from(r.s).isZero())r.chainId=r.v,r.v=0 else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0) var n=r.v-27,i=t.slice(0,6) 0!==r.chainId&&(i.push(Object(c.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8) var o=V(K(i)) try{r.from=In(o,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(e){console.log(e)}r.hash=V(e)}return r.type=null,r}(t) switch(t[0]){case 1:return function(e){var t=Z(e.slice(1)) 8!==t.length&&11!==t.length&&Mn.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(e)) var r={type:1,chainId:jn(t[0]).toNumber(),nonce:jn(t[1]).toNumber(),gasPrice:jn(t[2]),gasLimit:jn(t[3]),to:An(t[4]),value:jn(t[5]),data:t[6],accessList:Bn(t[7])} return 8===t.length||(r.hash=V(e),qn(r,t.slice(8),Un)),r}(t) case 2:return function(e){var t=Z(e.slice(1)) 9!==t.length&&12!==t.length&&Mn.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(e)) var r=jn(t[2]),n=jn(t[3]),i={type:2,chainId:jn(t[0]).toNumber(),nonce:jn(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:jn(t[4]),to:An(t[5]),value:jn(t[6]),data:t[7],accessList:Bn(t[8])} return 9===t.length||(i.hash=V(e),qn(i,t.slice(9),Fn)),i}(t)}return Mn.throwError("unsupported transaction type: ".concat(t[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}function Vn(e){return function(e){if(Array.isArray(e))return Wn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Wn(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1)){e=e.substring(1) var r=t[0] try{null==i[e]&&S(i,e,i[r])}catch(e){}null==i.functions[e]&&S(i.functions,e,i.functions[r]),null==i.callStatic[e]&&S(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&S(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&S(i.estimateGas,e,i.estimateGas[r])}}))}return ti(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&ii.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this this.signer||ii.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"}) var r=j(e||{}) return["from","to"].forEach((function(e){null!=r[e]&&ii.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"==typeof e&&(e=new bn(e,this.provider)) var t=new this.constructor(this.address,this.interface,e) return this.deployTransaction&&S(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new pi) if("event"===e)return this._normalizeRunningEvent(new di("event",null)) if("*"===e)return this._normalizeRunningEvent(new vi(this.address,this.interface)) var t=this.interface.getEvent(e) return this._normalizeRunningEvent(new mi(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0] if("string"!=typeof r)throw new Error("invalid topic") var n=this.interface.getEvent(r) return this._normalizeRunningEvent(new mi(this.address,this.interface,n,e.topics))}catch(e){}var i={address:this.address,topics:e.topics} return this._normalizeRunningEvent(new di(hi(i),i))}return this._normalizeRunningEvent(new vi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag] var t=this._wrappedEmits[e.tag] t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,i=T(t) return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var n=this if(this.provider||ii.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=n._wrapEvent(e,r,t) if(null==i.decodeError)try{var o=e.getEmit(i) n.emit.apply(n,[e.filter].concat(Vn(o)))}catch(e){i.decodeError=e.error}null!=e.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)} this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=j(i.filter) return"string"==typeof t&&Object(c.l)(t,32)?(null!=r&&ii.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1 for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0 return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this if(!this.provider)return[] if(null==e){var r=function(){var e=[] for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)})) return{v:e}}() if("object"===ri(r))return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t] r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e) return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this var r=this._getRunningEvent(e) return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return ce(e)}},{key:"getInterface",value:function(e){return Yr.isInterface(e)?e:new Yr(e)}},{key:"isIndexed",value:function(e){return Vr.isIndexed(e)}}]),e}(),bi=function(e){Kn(r,e) var t=Jn(r) function r(){return Xn(this,r),t.apply(this,arguments)}return ti(r)}(yi),gi=function(){function e(t,r,n){Xn(this,e) var i=null "0x"!==(i="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(c.l)(i)||i.length%2)&&ii.throwArgumentError("invalid bytecode","bytecode",r),n&&!yn.isSigner(n)&&ii.throwArgumentError("invalid signer","signer",n),S(this,"bytecode",i),S(this,"interface",P(this instanceof e?this.constructor:void 0,"getInterface")(t)),S(this,"signer",n||null)}return ti(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n=0&&e<=256&&!(e%1)?"1"+Ai.substring(0,e):Oi.throwArgumentError("invalid decimal size","decimals",e)}function Ri(e,t){null==t&&(t=0) var r=ji(t),n=(e=b.from(e)).lt(Si) n&&(e=e.mul(Pi)) for(var i=e.mod(r).toString();i.length2&&Oi.throwArgumentError("too many decimal points","value",e) var o=i[0],a=i[1] for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1) for(a.length>r.length-1&&Mi("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&Oi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(Ei,r,n,i)}}]),e}(),Ii=function(){function e(t,r,n,i){_i(this,e),Oi.checkNew(this instanceof e?this.constructor:void 0,e),t!==Ei&&Oi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return xi(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Oi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".") 1===t.length&&t.push("0") var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/) return this.isNegative()&&n&&(r=r.subUnsafe(Ni.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".") 1===t.length&&t.push("0") var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/) return!this.isNegative()&&n&&(r=r.addUnsafe(Ni.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0) var r=this.toString().split(".") if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&Oi.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this var n=e.from("1"+Ai.substring(0,t),this.format),i=Di.toFormat(this.format) return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex e%8&&Oi.throwArgumentError("invalid byte width","width",e) var t=b.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString() return Object(c.h)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||function(e){return null!=e&&(b.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(c.l)(e)||"bigint"==typeof e||Object(c.j)(e))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(Ri(t,r),Ci.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed") var n=Ci.from(r),i=Ti(t,n.decimals) !n.signed&&i.lt(Si)&&Mi("unsigned value cannot be negative","overflow","value",t) var o=null n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(c.h)(o,n.width/8)) var a=Ri(i,n.decimals) return new e(Ei,o,a,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed") var n=Ci.from(r) if(Object(c.a)(t).length>n.width/8)throw new Error("overflow") var i=b.from(t) n.signed&&(i=i.fromTwos(n.width)) var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=Ri(i,n.decimals) return new e(Ei,o,a,n)}},{key:"from",value:function(t,r){if("string"==typeof t)return e.fromString(t,r) if(Object(c.j)(t))return e.fromBytes(t,r) try{return e.fromValue(t,0,r)}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT)throw e}return Oi.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),Ni=Ii.from(1),Di=Ii.from("0.5") function Bi(e){return"string"==typeof e&&(e=ye(e)),V(Object(c.b)([ye("Ethereum Signed Message:\n"),ye(String(e.length)),e]))}function Li(e,t){for(var r=0;r256||t[2]&&t[2]!==String(n))&&Fi.throwArgumentError("invalid numeric width","type",e) var i=Vi.mask(r?n-1:n),o=r?i.add(Hi).mul(zi):qi return function(t){var r=b.from(t) return(r.lt(o)||r.gt(i))&&Fi.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/) if(a){var s=parseInt(a[1]) return(0===s||s>32||a[1]!==String(s))&&Fi.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.a)(t).length!==s&&Fi.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.a)(e),r=t.length%32 return r?Object(c.c)([t,Ui.slice(r)]):Object(c.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.h)(ae(e),32)} case"bool":return function(e){return e?Wi:Gi} case"bytes":return function(e){return V(e)} case"string":return function(e){return xe(e)}}return null}function Qi(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name return e.type+" "+t})).join(","),")")}var Xi=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),S(this,"types",Object.freeze(T(t))),S(this,"_encoderCache",{}),S(this,"_types",{}) var r={},n={},i={} Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}})) var o=function(e){var i={} t[e].forEach((function(o){i[o.name]&&Fi.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0 var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1] a===e&&Fi.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),Zi(a)||(n[a]||Fi.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))} for(var a in t)o(a) var s=Object.keys(n).filter((function(e){return 0===n[e].length})) for(var u in 0===s.length?Fi.throwArgumentError("missing primary type","types",t):s.length>1&&Fi.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),S(this,"primaryType",s[0]),function e(o,a){a[o]&&Fi.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]) c.sort(),this._types[u]=Qi(u,t[u])+c.map((function(e){return Qi(e,t[e])})).join("")}}var t,r,n return t=e,n=[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[] for(var n in t){var i=Yi[n] i||Fi.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return Ki.indexOf(e.name)-Ki.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(c.c)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return V(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,u return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=j(t),a={},t.verifyingContract&&!Object(c.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(c.l)(t,20)||(a[t]="0x"),t})),o.t0=regeneratorRuntime.keys(a) case 6:if((o.t1=o.t0()).done){o.next=13 break}return u=o.t1.value,o.next=10,i(u) case 10:a[u]=o.sent,o.next=6 break case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n}) case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t) var i={},o=[] Ki.forEach((function(e){var r=t[e] null!=r&&(i[e]=$i[e](r),o.push({name:e,type:Yi[e]}))})) var a=e.from(r),s=j(r) return s.EIP712Domain?Fi.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(t)) if(e.match(/^u?int/))return b.from(t).toString() switch(e){case"address":return t.toLowerCase() case"bool":return!!t case"string":return"string"!=typeof t&&Fi.throwArgumentError("invalid string","value",t),t}return Fi.throwArgumentError("unsupported type","type",e)}))}}}],(r=[{key:"getEncoder",value:function(e){var t=this._encoderCache[e] return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=Zi(e) if(r)return r var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/) if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]) return function(e){a>=0&&e.length!==a&&Fi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e) var r=e.map(o) return t._types[i]&&(r=r.map(V)),V(Object(c.c)(r))}}var s=this.types[e] if(s){var u=xe(this._types[e]) return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]) return t._types[i]?V(o):o})) return r.unshift(u),Object(c.c)(r)}}return Fi.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e] return t||Fi.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return V(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this if(Zi(e))return r(e,t) var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/) if(i){var o=i[1],a=parseInt(i[3]) return a>=0&&t.length!==a&&Fi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e] return s?s.reduce((function(e,i){var o=i.name,a=i.type return e[o]=n._visit(a,t[o],r),e}),{}):Fi.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}])&&Li(t.prototype,r),n&&Li(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function eo(e,t){for(var r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--u)a+=this.alphabet[r[u]] return a}},{key:"decode",value:function(e){if("string"!=typeof e)throw new TypeError("Expected String") var t=[] if(0===e.length)return new Uint8Array(t) t.push(0) for(var r=0;r>=8 for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a>24&255,f[t.length+1]=h>>16&255,f[t.length+2]=h>>8&255,f[t.length+3]=255&h var d=Object(c.a)(lo(i,e,f)) o||(o=d.length,s=new Uint8Array(o),a=n-((u=Math.ceil(n/o))-1)*o),s.set(d) for(var p=1;p64)throw new Error("invalid seed") var i=Object(c.a)(lo(to.sha512,Mo,n)) return new e(Co,jo(i.slice(0,32)),null,"0x00000000",jo(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=Lo(Bo(t,n=To(n)),n),e._fromSeed(Do(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=no.decode(t) 82===r.length&&Ro(r.slice(0,78))===t||So.throwArgumentError("invalid extended key","extendedKey","[REDACTED]") var n=r[4],i=Object(c.i)(r.slice(5,9)),o=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),s=r.slice(45,78) switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(Co,null,Object(c.i)(s),i,a,o,n,null) case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break return new e(Co,Object(c.i)(s.slice(1)),null,i,a,o,n,null)}return So.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!") return Ro(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(Co,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t)) var r=this.path r&&(r+="/"+(2147483647&t)) var n=new Uint8Array(37) if(2147483648&t){if(!this.privateKey)throw new Error("cannot derive child of neutered node") n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey)) for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255 var o=Object(c.a)(lo(to.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),u=null,l=null this.privateKey?u=jo(b.from(a).add(this.privateKey).mod(Po)):l=new On(Object(c.i)(a))._addPoint(this.publicKey) var f=r,h=this.mnemonic return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new e(Co,u,l,this.fingerprint,jo(s),t,this.depth+1,f)}},{key:"derivePath",value:function(e){var t=e.split("/") if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e) "m"===t[0]&&t.shift() for(var r=this,n=0;n=2147483648)throw new Error("invalid path index - "+i) r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i) var a=parseInt(i) if(a>=2147483648)throw new Error("invalid path index - "+i) r=r._derive(a)}}return r}}])&&Eo(t.prototype,r),n&&Eo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function Do(e,t){t||(t="") var r=ye("mnemonic"+t,fe.NFKD) return fo(ye(e,fe.NFKD),r,2048,64,"sha512")}function Bo(e,t){t=To(t),So.checkNormalize() var r=t.split(e) if(r.length%3!=0)throw new Error("invalid mnemonic") for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var u=32*r.length/3,l=Ao(r.length/3) if((Object(c.a)(uo(n.slice(0,u/8)))[0]&l)!=(n[n.length-1]&l))throw new Error("invalid checksum") return Object(c.i)(n.slice(0,u/8))}function Lo(e,t){if(t=To(t),(e=Object(c.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy") for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3) var o=e.length/4,a=Object(c.a)(uo(e))[0]&Ao(o) return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function Fo(e,t){try{return Bo(e,t),!0}catch(e){}return!1}function Uo(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&So.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var zo=r(575),qo=r(26),Ho=r.n(qo),Vo=r(82),Wo=r.n(Vo) function Go(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(c.a)(e)}function Yo(e,t){for(e=String(e);e.length=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue return i}}return null}var Ka=Ga("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Ja="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),$a=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Za=Wa("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Qa=Wa("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Xa=Wa("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data") for(var t=[],r=0;r=0||e>=65024&&e<=65039?[]:function(e){var t=Ya(e,$a) if(t)return[e+t.s] var r=Za[e] if(r)return r var n=Qa[e] return n?[e+n[0]]:Xa[e]||null}(e)||[e]})),(r=ke(we(r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[])),fe.NFKC)).forEach((function(e){if(Ya(e,es))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(Ya(e,Ka))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")})) var n=we(r) if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen") if(n.length>63)throw new Error("too long") return n}var rs=new h.b("hash/5.6.0"),ns=new Uint8Array(32) ns.fill(0) var is=new RegExp("^((.*)\\.)?([^.]+)$") function os(e){try{for(var t=e.split("."),r=0;r0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n) var i="object"===fs(e)?e.throttleCallback:null,o="object"===fs(e)&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100 hs.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o) var a="object"===fs(e)&&!!e.errorPassThrough,s={},u=null,c={method:"GET"},l=!1,f=12e4 if("string"==typeof e)u=e else if("object"===fs(e)){if(null!=e&&null!=e.url||hs.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var d in e.headers)s[d.toLowerCase()]={key:d,value:String(e.headers[d])},["if-none-match","if-modified-since"].indexOf(d.toLowerCase())>=0&&(l=!0) if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&hs.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"}) var p=e.user+":"+e.password s.authorization={key:"Authorization",value:"Basic "+cs(ye(p))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup)}var m=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),v=u?u.match(m):null if(v)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":v[1]},body:us(v[2])},b=y.body return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(e){hs.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:ps(v[1],v[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)})) var g={} Object.keys(s).forEach((function(e){var t=s[e] g[t.key]=t.value})),c.headers=g var w,_=(w=null,{promise:new Promise((function(e,t){f&&(w=setTimeout((function(){null!=w&&(w=null,t(hs.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:ps(c.body,g["content-type"]),requestMethod:c.method,timeout:f,url:u})))}),f))})),cancel:function(){null!=w&&(clearTimeout(w),w=null)}}),k=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,s,f,d,p,m,v,y,b,w return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0 case 1:if(!(t=300)&&(_.cancel(),hs.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:ps(v,s.headers?s.headers["content-type"]:null),requestBody:ps(c.body,g["content-type"]),requestMethod:c.method,url:u})),!r){e.next=60 break}return e.prev=37,e.next=40,r(v,s) case 40:return y=e.sent,_.cancel(),e.abrupt("return",y) case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&n(new Error("retry limit reached"))) var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u))) ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var bs=r(111),gs=r.n(bs) function ws(e,t){for(var r=0;r0&&null==e[e.length-1];)e.pop() return e.map((function(e){if(Array.isArray(e)){var t={} e.forEach((function(e){t[Bs(e)]=!0})) var r=Object.keys(t) return r.sort(),r.join("|")}return Bs(e)})).join("&")}function Fs(e){if("string"==typeof e){if(e=e.toLowerCase(),32===Object(c.d)(e))return"tx:"+e if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Ls(e) if(rn.isForkEvent(e))throw Ds.warn("not implemented"),new Error("not implemented") if(e&&"object"===Is(e))return"filter:"+(e.address||"*")+":"+Ls(e.topics||[])}throw new Error("invalid event - "+e)}function Us(){return(new Date).getTime()}function zs(e){return new Promise((function(t){setTimeout(t,e)}))}var qs=["block","network","pending","poll"],Hs=function(){function e(t,r,n){Rs(this,e),S(this,"tag",t),S(this,"listener",r),S(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Cs(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":") return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":") if("filter"!==e[0])return null var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[] var t=e.split("|").map((function(e){return"null"===e?null:e})) return 1===t.length?t[0]:t})),i={} return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||qs.indexOf(this.tag)>=0}}]),e}(),Vs={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}} function Ws(e){return Object(c.h)(b.from(e).toHexString(),32)}function Gs(e){return no.encode(Object(c.b)([e,Object(c.e)(uo(uo(e)),0,4)]))}var Ys=new RegExp("^(ipfs)://(.*)$","i"),Ks=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Ys,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")] function Js(e,t){try{return _e($s(e,t))}catch(e){}return null}function $s(e,t){if("0x"===e)return null var r=b.from(Object(c.e)(e,t,t+32)).toNumber(),n=b.from(Object(c.e)(e,r,r+32)).toNumber() return Object(c.e)(e,r+32,r+32+n)}function Zs(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ds.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Qs(e){var t=Object(c.a)(e) if(t.length>32)throw new Error("internal; should not happen") var r=new Uint8Array(32) return r.set(t,32-t.length),r}function Xs(e){if(e.length%32==0)return e var t=new Uint8Array(32*Math.ceil(e.length/32)) return t.set(e),t}function eu(e){for(var t=[],r=0,n=0;n=1&&o<=75)return Gs(Object(c.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/) if(a){var s=parseInt(a[1],16) if(a[2].length===2*s&&s>=1&&s<=75)return Gs(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var u=n[1],l=n[0] if(0===l?20!==u&&32!==u&&(l=-1):l=-1,l>=0&&n.length===2+u&&u>=1&&u<=75){var f=gs.a.toWords(n.slice(2)) return f.unshift(l),gs.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16 break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de") case 5:if("0x"!==(r=t.sent)&&r!==Na){t.next=8 break}return t.abrupt("return",null) case 8:return t.abrupt("return",this.provider.formatter.callAddress(r)) case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==h.b.errors.CALL_EXCEPTION){t.next=15 break}return t.abrupt("return",null) case 15:throw t.t0 case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Ws(e)) case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21 break}return t.abrupt("return",null) case 21:return null==(i=this._getAddress(e,n))&&Ds.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",i) case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,f,h,d,p,m,v,y return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar") case 4:if(null!=(r=e.sent)){e.next=7 break}return e.abrupt("return",null) case 7:n=0 case 8:if(!(n=0?null:JSON.stringify({data:o,sender:i}),n.next=12,vs({url:c,errorPassThrough:!0},l,(function(e,t){return e.status=t.statusCode,e})) case 12:if(!(f=n.sent).data){n.next=15 break}return n.abrupt("return",f.data) case 15:if(d=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18 break}return n.abrupt("return",Ds.throwError("response not found during CCIP fetch: ".concat(d),h.b.errors.SERVER_ERROR,{url:u,errorMessage:d})) case 18:a.push(d) case 19:s++,n.next=6 break case 22:return n.abrupt("return",Ds.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a})) case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready() case 2:if(!(e>0)){t.next=20 break}case 3:if(!this._internalBlockNumber){t.next=20 break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r case 8:if(n=t.sent,!(Us()-n.respTime<=e)){t.next=11 break}return t.abrupt("return",n.blockNumber) case 11:return t.abrupt("break",20) case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18 break}return t.abrupt("break",20) case 18:t.next=3 break case 20:return i=Us(),o=M({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r var n=Us() return(t=b.from(t).toNumber())1e3)Ds.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",Ds.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n) else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i) return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e] "pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)})) r.push(i) break case"filter":if(!e._inflight){e._inflight=!0 var a=e.filter a.fromBlock=e._lastBlockNumber+1,a.toBlock=n,a.toBlock-o._maxFilterBlockRange>a.fromBlock&&(a.fromBlock=a.toBlock-o._maxFilterBlockRange) var s=o.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),o._emitted["b:"+t.blockHash]=t.blockNumber,o._emitted["t:"+t.transactionHash]=t.blockNumber,o.emit(a,t)}))})).catch((function(t){o.emit("error",t),e._inflight=!1})) r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return") case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ds.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})) case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready() case 2:return t=e.sent,e.next=5,this.detectNetwork() case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23 break}if(!this.anyNetwork){e.next=20 break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,zs(0) case 19:return e.abrupt("return",this._network) case 20:throw n=Ds.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n case 23:return e.abrupt("return",t) case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval") this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=Us() return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null)) case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e) case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5 break}return i.abrupt("return",o) case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],u=!1,c=function(){return!!u||(u=!0,s.forEach((function(e){e()})),!1)},l=function(e){e.confirmations0){var m=setTimeout((function(){c()||o(Ds.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r) m.unref&&m.unref(),s.push((function(){clearTimeout(m)}))}}))) case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0)) case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork() case 2:return e.next=4,this.perform("getGasPrice",{}) case 4:return t=e.sent,e.prev=5,e.abrupt("return",b.from(t)) case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0})) case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getBalance",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i)) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i).toNumber()) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getCode",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(i)) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork() case 2:return n.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(c.g)(e)}))}) case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i) case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(o)) case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0})) case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this if(null!=t&&32!==Object(c.d)(t))throw new Error("invalid response - sendTransaction") var i=e return null!=t&&e.hash!==t&&Ds.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return Ns(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o) case 6:if(null!=(a=n.sent)||0!==t){n.next=9 break}return n.abrupt("return",null) case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&Ds.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a) case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork() case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(c.i)(e)})) case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval) case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r}) case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i)) case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0 case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?b.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?Object(c.i)(e):null})))})),t.t0=this.formatter,t.next=12,M(n) case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1)) case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,M(r) case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1)) case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,f,d,p,m,v,y,g,w,_ return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&Ds.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:e}),i=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t}) case 4:if(o=n.sent,!(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(c.d)(o)%32==4)){n.next=31 break}for(n.prev=6,a=Object(c.e)(o,4),s=Object(c.e)(a,0,32),b.from(s).eq(i)||Ds.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),u=[],l=b.from(Object(c.e)(a,32,64)).toNumber(),f=b.from(Object(c.e)(a,l,l+32)).toNumber(),d=Object(c.e)(a,l+32),p=0;pthis._emitted.block)){e.next=10 break}return e.abrupt("return",null) case 10:return e.abrupt("return",void 0) case 11:if(!t){e.next=34 break}o=null,a=0 case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new Hs(Fs(e),t,r) return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&yu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:o}),t}function wu(e){return new Promise((function(t){setTimeout(t,e)}))}function _u(e){if(e.error){var t=new Error(e.error.message) throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function ku(e){return e?e.toLowerCase():e}var xu={},Ou=function(e){lu(r,e) var t=fu(r) function r(e,n,i){var o if(su(this,r),yu.checkNew(this instanceof r?this.constructor:void 0,r),o=t.call(this),e!==xu)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner") return S(du(o),"provider",n),null==i&&(i=0),"string"==typeof i?(S(du(o),"_address",o.provider.formatter.address(i)),S(du(o),"_index",null)):"number"==typeof i?(S(du(o),"_index",i),S(du(o),"_address",null)):yu.throwArgumentError("invalid address or index","addressOrIndex",i),o}return cu(r,[{key:"connect",value:function(e){return yu.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Eu(xu,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&yu.throwError("unknown account #"+e._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this e=j(e) var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e})) if(null==e.gasLimit){var n=j(e) n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return vu(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2 break}return t.abrupt("return",null) case 2:return t.next=4,this.provider.resolveName(e) case 4:return null==(r=t.sent)&&yu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r) case 7:case"end":return t.stop()}}),t,this)})))}))),M({tx:M(e),sender:r}).then((function(r){var n=r.tx,i=r.sender null!=n.from?n.from.toLowerCase()!==i&&yu.throwArgumentError("from address mismatch","transaction",e):n.from=i var o=t.provider.constructor.hexlifyTransaction(n,{from:!0}) return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return gu("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return yu.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval) case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e) case 5:return n=t.sent,t.prev=6,t.next=9,ys((function(){return vu(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n) case 2:if(null!==(t=e.sent)){e.next=5 break}return e.abrupt("return",void 0) case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r)) case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider}) case 9:return t.abrupt("return",t.sent) case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0 case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?ye(e):e,t.next=3,this.getAddress() case 3:return n=t.sent,t.next=6,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]) case 6:return t.abrupt("return",t.sent) case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_legacySignMessage",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?ye(e):e,t.next=3,this.getAddress() case 3:return n=t.sent,t.next=6,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]) case 6:return t.abrupt("return",t.sent) case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return vu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Xi.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)})) case 2:return i=n.sent,n.next=5,this.getAddress() case 5:return o=n.sent,n.next=8,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Xi.getPayload(i.domain,t,i.value))]) case 8:return n.abrupt("return",n.sent) case 9:case"end":return n.stop()}}),n,this)})))}},{key:"unlock",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress() case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null])) case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(yn),Eu=function(e){lu(r,e) var t=fu(r) function r(){return su(this,r),t.apply(this,arguments)}return cu(r,[{key:"sendTransaction",value:function(e){var t=this return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(Ou),Su={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Pu=function(e){lu(r,e) var t=fu(r) function r(e,n){var i su(this,r),yu.checkNew(this instanceof r?this.constructor:void 0,r) var o=n return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=P(i.constructor,"defaultUrl")()),S(du(i),"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(j(e))),i._nextId=42,i}return cu(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return vu(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wu(0) case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]) case 6:t=e.sent,e.next=19 break case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]) case 14:t=e.sent,e.next=19 break case 17:e.prev=17,e.t1=e.catch(11) case 19:if(null==t){e.next=28 break}return r=P(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(b.from(t).toNumber())) case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",yu.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2})) case 28:return e.abrupt("return",yu.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"})) case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new Ou(xu,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"} this.emit("debug",{action:"request",request:T(n),provider:this}) var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0 if(i&&this._cache[e])return this._cache[e] var o=vs(this.connection,JSON.stringify(n),_u).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e})) return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]] case"getGasPrice":return["eth_gasPrice",[]] case"getBalance":return["eth_getBalance",[ku(t.address),t.blockTag]] case"getTransactionCount":return["eth_getTransactionCount",[ku(t.address),t.blockTag]] case"getCode":return["eth_getCode",[ku(t.address),t.blockTag]] case"getStorageAt":return["eth_getStorageAt",[ku(t.address),t.position,t.blockTag]] case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]] case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]] case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]] case"call":return["eth_call",[P(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]] case"estimateGas":return["eth_estimateGas",[P(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]] case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=ku(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return vu(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8 break}if(!(n=t.transaction)||null==n.type||!b.from(n.type).isZero()){r.next=8 break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8 break}return r.next=6,this.getFeeData() case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=j(t)).transaction=j(n),delete t.transaction.type) case 8:return null==(o=this.prepareRequest(e,t))&&yu.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]) case 13:return r.abrupt("return",r.sent) case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",gu(e,r.t0,t)) case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),ou(pu(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]) this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null var n=Promise.resolve() return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return wu(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),ou(pu(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=j(Su) if(t)for(var n in t)t[n]&&(r[n]=!0) A(e,r) var i={} return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(c.g)(e[t]) "gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(c.i)(e[t]))})),e.accessList&&(i.accessList=Bn(e.accessList)),i}}]),r}(iu),Mu=null try{if(null==(Mu=WebSocket))throw new Error("inject please")}catch(e){var Au=new h.b("providers/5.6.4") Mu=function(){Au.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function ju(e){return(ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ru(e,t){for(var r=0;r=0&&(t.throttleRetry=!0),t}return e.result}function Yc(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response") throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var r=new Error("invalid response") throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error") throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function Kc(e){if("pending"===e)throw new Error("pending not supported") return"latest"===e?e:parseInt(e.substring(2),16)}function Jc(e,t,r){if("call"===e&&t.code===h.b.errors.SERVER_ERROR){var n=t.error if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(c.l)(i))return i Vc.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var o=t.message throw t.code===h.b.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&Vc.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Vc.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),o.match(/another transaction with same nonce/)&&Vc.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&Vc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var $c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fc(e,t)}(i,e) var t,r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=qc(e) if(t){var i=qc(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return Uc(this,r)}}(i) function i(e,t){var r return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Vc.checkNew(this instanceof i?this.constructor:void 0,i),S(zc(r=n.call(this,e)),"baseUrl",r.getBaseUrl()),S(zc(r),"apiKey",t||"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"),r}return t=i,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io" case"ropsten":return"https://api-ropsten.etherscan.io" case"rinkeby":return"https://api-rinkeby.etherscan.io" case"kovan":return"https://api-kovan.etherscan.io" case"goerli":return"https://api-goerli.etherscan.io"}return Vc.throwArgumentError("unsupported network","network",name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r] return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"" return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,r){return Hc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,c,l=this return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?Yc:Gc,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&Ss(),Promise.resolve(!0)}},u=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,vs(s,u,a||Yc) case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:T(c),provider:this}),n.abrupt("return",c) case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Hc(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network) case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return Bc(qc(i.prototype),"perform",r)}}}) return Hc(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l,f,d return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72 break case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"})) case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"})) case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag})) case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag})) case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag})) case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag})) case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Jc("sendTransaction",e,t.signedTransaction)}))) case 10:if(!t.blockTag){r.next=12 break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"})) case 12:throw new Error("getBlock by blockHash not implemented") case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash})) case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash})) case 15:if("latest"===t.blockTag){r.next=17 break}throw new Error("EtherscanProvider does not support blockTag for call") case 17:return(i=Wc(t.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0) case 23:return r.abrupt("return",r.sent) case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Jc("call",r.t1,t.transaction)) case 29:return(o=Wc(t.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0) case 35:return r.abrupt("return",r.sent) case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Jc("estimateGas",r.t2,t.transaction)) case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=Kc(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=Kc(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Vc.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"==typeof(s=t.filter.topics[0])&&66===s.length||Vc.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a) case 48:u=r.sent,c={},l=0 case 51:if(!(l0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t] e[t]=e[r],e[r]=n}return e}function Qc(e,t){for(var r=0;rt?null:(n+i)/2}function cl(e){if(null===e)return"null" if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e) if("string"==typeof e)return e if(b.isBigNumber(e))return e.toString() if(Array.isArray(e))return JSON.stringify(e.map((function(e){return cl(e)}))) if("object"===nl(e)){var t=Object.keys(e) return t.sort(),"{"+t.map((function(t){var r=e[t] return r="function"==typeof r?"[function]":cl(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+nl(e))}var ll=1 function fl(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)})) return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var hl=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],dl=["address","args","errorArgs","errorSignature","method","transaction"] function pl(e,t){var r={weight:e.weight} return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function ml(e,t,r){var n=cl switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=ul(t.map((function(e){return e.result})),2) if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber} case"getGasPrice":return function(e){var t=e.map((function(e){return e.result})) return t.sort(),t[Math.floor(t.length/2)]} case"getEtherPrice":return function(e){return ul(e.map((function(e){return e.result})))} case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=j(e)).confirmations=-1,cl(e))} break case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=j(e)).transactions=e.transactions.map((function(e){return(e=j(e)).confirmations=-1,e})),cl(e))}:function(e){return null==e?null:cl(e)} break default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={} r.forEach((function(t){var r=e(t.result) n[r]||(n[r]={count:0,result:t.result}),n[r].count++})) for(var i=Object.keys(n),o=0;o=t)return a.result}}}(n,e.quorum)}function vl(e,t){return il(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3 break}return r.abrupt("return",n) case 3:return r.abrupt("return",ys((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n})) case 4:case"end":return r.stop()}}),r)})))}function yl(e,t,r,n){return il(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?28:"getLogs"===i.t0?29:35 break case 4:return i.abrupt("return",o[r]()) case 5:if(!o.getEtherPrice){i.next=7 break}return i.abrupt("return",o.getEtherPrice()) case 7:return i.abrupt("break",35) case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=12 break}return i.next=11,vl(e,t) case 11:o=i.sent case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest")) case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=17 break}return i.next=16,vl(e,t) case 16:o=i.sent case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest")) case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=22 break}return i.next=21,vl(e,t) case 21:o=i.sent case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash)) case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=27 break}return i.next=26,vl(e,t) case 26:o=i.sent case 27:return i.abrupt("return",o[r](n.transaction)) case 28:return i.abrupt("return",o[r](n.transactionHash)) case 29:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){i.next=34 break}return i.next=33,vl(e,t) case 33:o=i.sent case 34:return i.abrupt("return",o.getLogs(a)) case 35:return i.abrupt("return",ol.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n})) case 36:case"end":return i.stop()}}),i)})))}var bl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xc(e,t)}(i,e) var t,r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=rl(e) if(t){var i=rl(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return el(this,r)}}(i) function i(e,t){var r !function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),ol.checkNew(this instanceof i?this.constructor:void 0,i),0===e.length&&ol.throwArgumentError("missing providers","providers",e) var o=e.map((function(e,t){if(nn.isProvider(e)){var r=Os(e)?2e3:750 return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=j(e) null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Os(e)?2e3:750),null==n.weight&&(n.weight=1) var i=n.weight return(i%1||i>512||i<1)&&ol.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(n)})),a=o.reduce((function(e,t){return e+t.weight}),0) null==t?t=a/2:t>a&&ol.throwArgumentError("quorum will always fail; larger than total weight","quorum",t) var s=sl(o.map((function(e){return e.provider.network}))) return null==s&&(s=new Promise((function(e,t){setTimeout((function(){r.detectNetwork().then(e,t)}),0)}))),S(tl(r=n.call(this,s)),"providerConfigs",Object.freeze(o)),S(tl(r),"quorum",t),r._highestBlockNumber=-1,r}return t=i,(r=[{key:"detectNetwork",value:function(){return il(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()}))) case 2:return t=e.sent,e.abrupt("return",sl(t)) case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return il(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,c,l,f,d,p=this return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13 break}return r.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))}))) case 3:n=r.sent,i=0 case 5:if(!(i=p.quorum)){r.next=19 break}if(void 0===(d=a(h))){r.next=15 break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:d}) case 15:if(l){r.next=18 break}return r.next=18,fl(100).getPromise() case 18:l=!1 case 19:if(m=s.reduce((function(e,t){if(!t.done||null==t.error)return e var r=t.error.code return hl.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(m).forEach((function(e){var t=m[e] if(!(t.weight256)&&bf.throwArgumentError("invalid number type","type",t),n&&(o=256),r=b.from(r).toTwos(o),Object(c.p)(r,o/8)}if(i=t.match(mf)){var a=parseInt(i[1]) return(String(a)!==i[1]||0===a||a>32)&&bf.throwArgumentError("invalid bytes type","type",t),Object(c.a)(r).byteLength!==a&&bf.throwArgumentError("invalid value for ".concat(t),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=t.match(yf))&&Array.isArray(r)){var s=i[1] parseInt(i[2]||String(r.length))!=r.length&&bf.throwArgumentError("invalid array length for ".concat(t),"value",r) var u=[] return r.forEach((function(t){u.push(e(s,t,!0))})),Object(c.b)(u)}return bf.throwArgumentError("invalid type","type",t)}(e,t[n]))})),Object(c.i)(Object(c.b)(r))}function wf(e,t){return V(gf(e,t))}function _f(e,t){return uo(gf(e,t))}function kf(e){var t=ye(e) if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes") return Object(c.i)(Object(c.b)([t,Na]).slice(0,32))}function xf(e){var t=Object(c.a)(e) if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long") if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator") for(var r=31;0===t[r-1];)r-- return _e(t.slice(0,r))}var Of=new h.b("units/5.6.0"),Ef=["wei","kwei","mwei","gwei","szabo","finney","ether"] function Sf(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Of.throwArgumentError("invalid value","value",e) var r=t[0],n="" for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1) ""===r&&(r="0") var i="" for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1) for(var o=[];r.length;){if(r.length<=3){o.unshift(r) break}var a=r.length-3 o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function Pf(e,t){if("string"==typeof t){var r=Ef.indexOf(t);-1!==r&&(t=3*r)}return Ri(e,null!=t?t:18)}function Mf(e,t){if("string"!=typeof e&&Of.throwArgumentError("value must be a string","value",e),"string"==typeof t){var r=Ef.indexOf(t);-1!==r&&(t=3*r)}return Ti(e,null!=t?t:18)}function Af(e){return Pf(e,18)}function jf(e){return Mf(e,18)}var Rf="ethers/5.6.4",Tf=new h.b(Rf) try{var Cf=window null==Cf._ethers&&(Cf._ethers=u)}catch(e){}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return H})) var n=r(8),i=r.n(n),o=r(17),a=r.n(o) function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self var c=l function l(e,t){if(!e)throw new Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)} var f=u((function(e,t){var r=t function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),h=u((function(e,t){var r=t r.assert=c,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1) n.fill(0) for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]] e=e.clone(),t=t.clone() for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3 3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i.a(e,"hex","le")}})),d=h.getNAF,p=h.getJSF,m=h.assert function v(e,t){this.type=e,this.p=new i.a(t.p,16),this.red=t.prime?i.a.red(t.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=t.n&&new i.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n) !r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=v function b(e,t){this.curve=e,this.type=t,this.precomputed=null}v.prototype.point=function(){throw new Error("Not implemented")},v.prototype.validate=function(){throw new Error("Not implemented")},v.prototype._fixedNafMul=function(e,t){m(e.precomputed) var r=e._getDoubles(),n=d(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+n[u] s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++ if(s>=0&&u++,a=a.dblp(u),s<0)break var c=o[s] m(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},v.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0 for(o=0;o=1;o-=2){var m=o-1,v=o if(1===u[m]&&1===u[v]){var y=[t[m],null,null,t[v]] 0===t[m].y.cmp(t[v].y)?(y[1]=t[m].add(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())):0===t[m].y.cmp(t[v].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].add(t[v].neg())):(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())) var b=[-3,-1,-5,-7,0,7,5,1,3],g=p(r[m],r[v]) for(f=Math.max(g[0].length,f),l[m]=new Array(f),l[v]=new Array(f),a=0;a=0;o--){for(var O=0;o>=0;){var E=!0 for(a=0;a=0&&O++,k=k.dblp(O),o<0)break for(a=0;a0?s=c[a][S-1>>1]:S<0&&(s=c[a][-S-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},_.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b) return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},_.prototype.pointFromX=function(e,t){(e=new i.a(e,16)).red||(e=e.toRed(this.red)) var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt() if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point") var o=n.fromRed().isOdd() return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},_.prototype.validate=function(e){if(e.inf)return!0 var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b) return 0===r.redSqr().redISub(i).cmpn(0)},_.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},x.prototype.isInfinity=function(){return this.inf},x.prototype.add=function(e){if(this.inf)return e if(e.inf)return this if(this.eq(e))return this.dbl() if(this.neg().eq(e))return this.curve.point(null,null) if(0===this.x.cmp(e.x))return this.curve.point(null,null) var t=this.y.redSub(e.y) 0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm())) var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y) return this.curve.point(r,n)},x.prototype.dbl=function(){if(this.inf)return this var e=this.y.redAdd(this.y) if(0===e.cmpn(0))return this.curve.point(null,null) var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y) return this.curve.point(o,a)},x.prototype.getX=function(){return this.x.fromRed()},x.prototype.getY=function(){return this.y.fromRed()},x.prototype.mul=function(e){return e=new i.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},x.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},x.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},x.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},x.prototype.neg=function(e){if(this.inf)return this var t=this.curve.point(this.x,this.y.redNeg()) if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()} t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},x.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},g(O,y.BasePoint),_.prototype.jpoint=function(e,t,r){return new O(this,e,t,r)},O.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null) var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e) return this.curve.point(r,n)},O.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},O.prototype.add=function(e){if(this.isInfinity())return e if(e.isInfinity())return this var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a) if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s) return this.curve.jpoint(h,d,p)},O.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ() if(e.isInfinity())return this var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o) if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a) return this.curve.jpoint(f,h,d)},O.prototype.dblp=function(e){if(0===e)return this if(this.isInfinity())return this if(!e)return this.dbl() var t if(this.curve.zeroA||this.curve.threeA){var r=this for(t=0;t=0)return!1 if(r.redIAdd(i),0===this.x.cmp(r))return!0}},O.prototype.inspect=function(){return this.isInfinity()?"":""},O.prototype.isInfinity=function(){return 0===this.z.cmpn(0)} var E=u((function(e,t){var r=t r.base=y,r.short=k,r.mont=null,r.edwards=null})),S=u((function(e,t){var r,n=t,i=h.assert function o(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t) return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}) try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})})) function P(e){if(!(this instanceof P))return new P(e) this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null var t=f.toArray(e.entropy,e.entropyEnc||"hex"),r=f.toArray(e.nonce,e.nonceEnc||"hex"),n=f.toArray(e.pers,e.persEnc||"hex") c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var M=P P.prototype._init=function(e,t,r){var n=e.concat(t).concat(r) this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8) for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},P.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required") "string"!=typeof t&&(n=r,r=t,t=null),r&&(r=f.toArray(r,n||"hex"),this._update(r)) for(var i=[];i.length"} var T=h.assert function C(e,t){if(e instanceof C)return e this._importDER(e,t)||(T(e.r&&e.s,"Signature without r or s"),this.r=new i.a(e.r,16),this.s=new i.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var I=C function N(){this.place=0}function D(e,t){var r=e[t.place++] if(!(128&r))return r var n=15&r if(0===n||n>4)return!1 for(var i=0,o=0,a=t.place;o>>=0 return!(i<=127)&&(t.place=a,i)}function B(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3) for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255) e.push(t)}}C.prototype._importDER=function(e,t){e=h.toArray(e,t) var r=new N if(48!==e[r.place++])return!1 var n=D(e,r) if(!1===n)return!1 if(n+r.place!==e.length)return!1 if(2!==e[r.place++])return!1 var o=D(e,r) if(!1===o)return!1 var a=e.slice(r.place,o+r.place) if(r.place+=o,2!==e[r.place++])return!1 var s=D(e,r) if(!1===s)return!1 if(e.length!==s+r.place)return!1 var u=e.slice(r.place,s+r.place) if(0===a[0]){if(!(128&a[1]))return!1 a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1 u=u.slice(1)}return this.r=new i.a(a),this.s=new i.a(u),this.recoveryParam=null,!0},C.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray() for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=B(t),r=B(r);!(r[0]||128&r[1]);)r=r.slice(1) var n=[2] L(n,t.length),(n=n.concat(t)).push(2),L(n,r.length) var i=n.concat(r),o=[48] return L(o,i.length),o=o.concat(i),h.encode(o,e)} var F=function(){throw new Error("unsupported")},U=h.assert function z(e){if(!(this instanceof z))return new z(e) "string"==typeof e&&(U(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var q=z z.prototype.keyPair=function(e){return new R(this,e)},z.prototype.keyFromPrivate=function(e,t){return R.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return R.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={}) for(var t=new M({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||F(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var o=new i.a(t.generate(r)) if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},z.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength() return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,r,n){"object"===s(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i.a(e,16)) for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),u=e.toArray("be",o),c=new M({hash:this.hash,entropy:a,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new i.a(1)),f=0;;f++){var h=n.k?n.k(f):new i.a(c.generate(this.n.byteLength())) if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var d=this.g.mul(h) if(!d.isInfinity()){var p=d.getX(),m=p.umod(this.n) if(0!==m.cmpn(0)){var v=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e)) if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(d.getY().isOdd()?1:0)|(0!==p.cmp(m)?2:0) return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new I({r:m,s:v,recoveryParam:y})}}}}}},z.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i.a(e,16)),r=this.keyFromPublic(r,n) var o=(t=new I(t,"hex")).r,a=t.s if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1 if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1 var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n) return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},z.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new I(t,n) var o=this.n,a=new i.a(e),s=t.r,u=t.s,c=1&r,l=r>>1 if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate") s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c) var f=t.r.invm(o),h=o.sub(a).mul(f).umod(o),d=u.mul(f).umod(o) return this.g.mulAdd(h,s,d)},z.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new I(t,n)).recoveryParam)return t.recoveryParam for(var i=0;i<4;i++){var o try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")} var H=u((function(e,t){var r=t r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=E,r.curves=S,r.ec=q,r.eddsa=null})).ec}).call(this,r(11))},function(e,t,r){(function(e,n,i){var o function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */!function(){"use strict" var s="input is invalid type",u="object"===("undefined"==typeof window?"undefined":a(window)),c=u?window:{} c.JS_SHA3_NO_WINDOW&&(u=!1) var l=!u&&"object"===("undefined"==typeof self?"undefined":a(self)) !c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":a(e))&&e.versions&&e.versions.node?c=n:l&&(c=self) var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(87),d=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),m=[4,1024,262144,67108864],v=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136} !c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===a(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer}) for(var k=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},x=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},O=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},S=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3 for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called") var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}for(var n,i,o=this.blocks,u=this.byteCount,c=e.length,l=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=u){for(this.start=n-u,this.block=o[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}var n=0,i=e.length if(t)n=i else for(var o=0;o=57344?n+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15] a%t==0&&(F(r),o=0)}return i&&(e=r[o],s+=p[e>>4&15]+p[15&e],i>1&&(s+=p[e>>12&15]+p[e>>8&15]),i>2&&(s+=p[e>>20&15]+p[e>>16&15])),s},B.prototype.arrayBuffer=function(){this.finalize() var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3 e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s) for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255 s%r==0&&F(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)} var F=function(e){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,m,v,b,g,w,_,k,x,O,E,S,P,M,A,j,R,T,C,I,N,D,B,L,F,U,z,q,H,V,W,G,Y,K,J,$,Z,Q,X,ee,te,re,ne,ie,oe,ae,se,ue,ce,le for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,K=e[10]<<4|e[11]>>>28,A=e[20]<<3|e[21]>>>29,j=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,B=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,O=e[49]<<14|e[48]>>>18,e[0]=p^~v&g,e[1]=m^~b&w,e[10]=E^~P&A,e[11]=S^~M&j,e[20]=N^~B&F,e[21]=D^~L&U,e[30]=W^~Y&J,e[31]=G^~K&$,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=v^~g&_,e[3]=b^~w&k,e[12]=P^~A&R,e[13]=M^~j&T,e[22]=B^~F&z,e[23]=L^~U&q,e[32]=Y^~J&Z,e[33]=K^~$&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=g^~_&x,e[5]=w^~k&O,e[14]=A^~R&C,e[15]=j^~T&I,e[24]=F^~z&H,e[25]=U^~q&V,e[34]=J^~Z&X,e[35]=$^~Q&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=_^~x&p,e[7]=k^~O&m,e[16]=R^~C&E,e[17]=T^~I&S,e[26]=z^~H&N,e[27]=q^~V&D,e[36]=Z^~X&W,e[37]=Q^~ee&G,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=x^~p&v,e[9]=O^~m&b,e[18]=C^~E&P,e[19]=I^~S&M,e[28]=H^~N&B,e[29]=V^~D&L,e[38]=X^~W&Y,e[39]=ee^~G&K,e[48]=ce^~te&ne,e[49]=le^~re&ie,e[0]^=y[n],e[1]^=y[n+1]} if(f)i.exports=A else{for(R=0;R=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=u(e,r) return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""} var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function p(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=d[e] r="" var p=this.clone() for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(e) r=(p=p.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip() var a,s,u="le"===t,c=new e(o),l=this.clone() if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function v(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(m=p),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this.strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863) for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e return r},a.prototype.idivn=function(e){i(e<=67108863) for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this.strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var b={k256:null,p224:null,p192:null,p25519:null} function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(w,g),w.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e] var t if("k256"===e)t=new w else if("p224"===e)t=new _ else if("p192"===e)t=new k else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new x}return b[e]=t,t},O.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new E(e)},o(E,O),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},function(e,t,r){"use strict" r.d(t,"a",(function(){return n})) var n="random/5.6.0"},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return H})) var n=r(6),i=r.n(n),o=r(35),a=r.n(o) function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self var c=l function l(e,t){if(!e)throw new Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)} var f=u((function(e,t){var r=t function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),h=u((function(e,t){var r=t r.assert=c,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1) n.fill(0) for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]] e=e.clone(),t=t.clone() for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3 3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i.a(e,"hex","le")}})),d=h.getNAF,p=h.getJSF,m=h.assert function v(e,t){this.type=e,this.p=new i.a(t.p,16),this.red=t.prime?i.a.red(t.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=t.n&&new i.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n) !r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=v function b(e,t){this.curve=e,this.type=t,this.precomputed=null}v.prototype.point=function(){throw new Error("Not implemented")},v.prototype.validate=function(){throw new Error("Not implemented")},v.prototype._fixedNafMul=function(e,t){m(e.precomputed) var r=e._getDoubles(),n=d(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+n[u] s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++ if(s>=0&&u++,a=a.dblp(u),s<0)break var c=o[s] m(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},v.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0 for(o=0;o=1;o-=2){var m=o-1,v=o if(1===u[m]&&1===u[v]){var y=[t[m],null,null,t[v]] 0===t[m].y.cmp(t[v].y)?(y[1]=t[m].add(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())):0===t[m].y.cmp(t[v].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].add(t[v].neg())):(y[1]=t[m].toJ().mixedAdd(t[v]),y[2]=t[m].toJ().mixedAdd(t[v].neg())) var b=[-3,-1,-5,-7,0,7,5,1,3],g=p(r[m],r[v]) for(f=Math.max(g[0].length,f),l[m]=new Array(f),l[v]=new Array(f),a=0;a=0;o--){for(var O=0;o>=0;){var E=!0 for(a=0;a=0&&O++,k=k.dblp(O),o<0)break for(a=0;a0?s=c[a][S-1>>1]:S<0&&(s=c[a][-S-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},_.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b) return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},_.prototype.pointFromX=function(e,t){(e=new i.a(e,16)).red||(e=e.toRed(this.red)) var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt() if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point") var o=n.fromRed().isOdd() return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},_.prototype.validate=function(e){if(e.inf)return!0 var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b) return 0===r.redSqr().redISub(i).cmpn(0)},_.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},x.prototype.isInfinity=function(){return this.inf},x.prototype.add=function(e){if(this.inf)return e if(e.inf)return this if(this.eq(e))return this.dbl() if(this.neg().eq(e))return this.curve.point(null,null) if(0===this.x.cmp(e.x))return this.curve.point(null,null) var t=this.y.redSub(e.y) 0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm())) var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y) return this.curve.point(r,n)},x.prototype.dbl=function(){if(this.inf)return this var e=this.y.redAdd(this.y) if(0===e.cmpn(0))return this.curve.point(null,null) var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y) return this.curve.point(o,a)},x.prototype.getX=function(){return this.x.fromRed()},x.prototype.getY=function(){return this.y.fromRed()},x.prototype.mul=function(e){return e=new i.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},x.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},x.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},x.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},x.prototype.neg=function(e){if(this.inf)return this var t=this.curve.point(this.x,this.y.redNeg()) if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()} t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},x.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},g(O,y.BasePoint),_.prototype.jpoint=function(e,t,r){return new O(this,e,t,r)},O.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null) var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e) return this.curve.point(r,n)},O.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},O.prototype.add=function(e){if(this.isInfinity())return e if(e.isInfinity())return this var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a) if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s) return this.curve.jpoint(h,d,p)},O.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ() if(e.isInfinity())return this var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o) if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a) return this.curve.jpoint(f,h,d)},O.prototype.dblp=function(e){if(0===e)return this if(this.isInfinity())return this if(!e)return this.dbl() var t if(this.curve.zeroA||this.curve.threeA){var r=this for(t=0;t=0)return!1 if(r.redIAdd(i),0===this.x.cmp(r))return!0}},O.prototype.inspect=function(){return this.isInfinity()?"":""},O.prototype.isInfinity=function(){return 0===this.z.cmpn(0)} var E=u((function(e,t){var r=t r.base=y,r.short=k,r.mont=null,r.edwards=null})),S=u((function(e,t){var r,n=t,i=h.assert function o(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t) return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}) try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})})) function P(e){if(!(this instanceof P))return new P(e) this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null var t=f.toArray(e.entropy,e.entropyEnc||"hex"),r=f.toArray(e.nonce,e.nonceEnc||"hex"),n=f.toArray(e.pers,e.persEnc||"hex") c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var M=P P.prototype._init=function(e,t,r){var n=e.concat(t).concat(r) this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8) for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},P.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required") "string"!=typeof t&&(n=r,r=t,t=null),r&&(r=f.toArray(r,n||"hex"),this._update(r)) for(var i=[];i.length"} var T=h.assert function C(e,t){if(e instanceof C)return e this._importDER(e,t)||(T(e.r&&e.s,"Signature without r or s"),this.r=new i.a(e.r,16),this.s=new i.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var I=C function N(){this.place=0}function D(e,t){var r=e[t.place++] if(!(128&r))return r var n=15&r if(0===n||n>4)return!1 for(var i=0,o=0,a=t.place;o>>=0 return!(i<=127)&&(t.place=a,i)}function B(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3) for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255) e.push(t)}}C.prototype._importDER=function(e,t){e=h.toArray(e,t) var r=new N if(48!==e[r.place++])return!1 var n=D(e,r) if(!1===n)return!1 if(n+r.place!==e.length)return!1 if(2!==e[r.place++])return!1 var o=D(e,r) if(!1===o)return!1 var a=e.slice(r.place,o+r.place) if(r.place+=o,2!==e[r.place++])return!1 var s=D(e,r) if(!1===s)return!1 if(e.length!==s+r.place)return!1 var u=e.slice(r.place,s+r.place) if(0===a[0]){if(!(128&a[1]))return!1 a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1 u=u.slice(1)}return this.r=new i.a(a),this.s=new i.a(u),this.recoveryParam=null,!0},C.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray() for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=B(t),r=B(r);!(r[0]||128&r[1]);)r=r.slice(1) var n=[2] L(n,t.length),(n=n.concat(t)).push(2),L(n,r.length) var i=n.concat(r),o=[48] return L(o,i.length),o=o.concat(i),h.encode(o,e)} var F=function(){throw new Error("unsupported")},U=h.assert function z(e){if(!(this instanceof z))return new z(e) "string"==typeof e&&(U(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var q=z z.prototype.keyPair=function(e){return new R(this,e)},z.prototype.keyFromPrivate=function(e,t){return R.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return R.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={}) for(var t=new M({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||F(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var o=new i.a(t.generate(r)) if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},z.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength() return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,r,n){"object"===s(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i.a(e,16)) for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),u=e.toArray("be",o),c=new M({hash:this.hash,entropy:a,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new i.a(1)),f=0;;f++){var h=n.k?n.k(f):new i.a(c.generate(this.n.byteLength())) if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var d=this.g.mul(h) if(!d.isInfinity()){var p=d.getX(),m=p.umod(this.n) if(0!==m.cmpn(0)){var v=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e)) if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(d.getY().isOdd()?1:0)|(0!==p.cmp(m)?2:0) return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new I({r:m,s:v,recoveryParam:y})}}}}}},z.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i.a(e,16)),r=this.keyFromPublic(r,n) var o=(t=new I(t,"hex")).r,a=t.s if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1 if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1 var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n) return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},z.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new I(t,n) var o=this.n,a=new i.a(e),s=t.r,u=t.s,c=1&r,l=r>>1 if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate") s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c) var f=t.r.invm(o),h=o.sub(a).mul(f).umod(o),d=u.mul(f).umod(o) return this.g.mulAdd(h,s,d)},z.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new I(t,n)).recoveryParam)return t.recoveryParam for(var i=0;i<4;i++){var o try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")} var H=u((function(e,t){var r=t r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=E,r.curves=S,r.ec=q,r.eddsa=null})).ec}).call(this,r(11))},function(e,t,r){(function(e,n,i){var o function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */!function(){"use strict" var s="input is invalid type",u="object"===("undefined"==typeof window?"undefined":a(window)),c=u?window:{} c.JS_SHA3_NO_WINDOW&&(u=!1) var l=!u&&"object"===("undefined"==typeof self?"undefined":a(self)) !c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":a(e))&&e.versions&&e.versions.node?c=n:l&&(c=self) var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(87),d=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),m=[4,1024,262144,67108864],v=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136} !c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===a(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer}) for(var k=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},x=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},O=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},S=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3 for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called") var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}for(var n,i,o=this.blocks,u=this.byteCount,c=e.length,l=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=u){for(this.start=n-u,this.block=o[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}var n=0,i=e.length if(t)n=i else for(var o=0;o=57344?n+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15] a%t==0&&(F(r),o=0)}return i&&(e=r[o],s+=p[e>>4&15]+p[15&e],i>1&&(s+=p[e>>12&15]+p[e>>8&15]),i>2&&(s+=p[e>>20&15]+p[e>>16&15])),s},B.prototype.arrayBuffer=function(){this.finalize() var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3 e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s) for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255 s%r==0&&F(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)} var F=function(e){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,m,v,b,g,w,_,k,x,O,E,S,P,M,A,j,R,T,C,I,N,D,B,L,F,U,z,q,H,V,W,G,Y,K,J,$,Z,Q,X,ee,te,re,ne,ie,oe,ae,se,ue,ce,le for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,K=e[10]<<4|e[11]>>>28,A=e[20]<<3|e[21]>>>29,j=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,B=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,O=e[49]<<14|e[48]>>>18,e[0]=p^~v&g,e[1]=m^~b&w,e[10]=E^~P&A,e[11]=S^~M&j,e[20]=N^~B&F,e[21]=D^~L&U,e[30]=W^~Y&J,e[31]=G^~K&$,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=v^~g&_,e[3]=b^~w&k,e[12]=P^~A&R,e[13]=M^~j&T,e[22]=B^~F&z,e[23]=L^~U&q,e[32]=Y^~J&Z,e[33]=K^~$&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=g^~_&x,e[5]=w^~k&O,e[14]=A^~R&C,e[15]=j^~T&I,e[24]=F^~z&H,e[25]=U^~q&V,e[34]=J^~Z&X,e[35]=$^~Q&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=_^~x&p,e[7]=k^~O&m,e[16]=R^~C&E,e[17]=T^~I&S,e[26]=z^~H&N,e[27]=q^~V&D,e[36]=Z^~X&W,e[37]=Q^~ee&G,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=x^~p&v,e[9]=O^~m&b,e[18]=C^~E&P,e[19]=I^~S&M,e[28]=H^~N&B,e[29]=V^~D&L,e[38]=X^~W&Y,e[39]=ee^~G&K,e[48]=ce^~te&ne,e[49]=le^~re&ie,e[0]^=y[n],e[1]^=y[n+1]} if(f)i.exports=A else{for(R=0;Rthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize) for(var t=e.length;t>>0 if(0===r)return-1 var n=0 if(arguments.length>1&&((n=Number(arguments[1]))!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=r)return-1 for(var i=n>=0?n:Math.max(r-Math.abs(n),0);i0&&(t+=f.suffices["*"]&&r||",",f.suffices["*"]&&c&&(t+=f.name+"=")),t+=u?encodeURIComponent(h[p]).replace(/!/g,"%21"):s(h[p])}else if("object"===o(h)){c&&!f.suffices["*"]&&(t+=f.name+"=") var m=!0 for(var v in h)m||(t+=f.suffices["*"]&&r||","),m=!1,t+=u?encodeURIComponent(v).replace(/!/g,"%21"):s(v),t+=f.suffices["*"]?"=":",",t+=u?encodeURIComponent(h[v]).replace(/!/g,"%21"):s(h[v])}else c&&(t+=f.name,l&&""===h||(t+="=")),null!=f.truncate&&(h=h.substring(0,f.truncate)),t+=u?encodeURIComponent(h).replace(/!/g,"%21"):s(h)}return t} return _.varNames=f,{prefix:n,substitution:_}}function c(e){if(!(this instanceof c))return new c(e) for(var t=e.split("{"),r=[t.shift()],n=[],i=[],o=[];t.length>0;){var a=t.shift(),s=a.split("}")[0],l=a.substring(s.length+1),f=u(s) i.push(f.substitution),n.push(f.prefix),r.push(l),o=o.concat(f.substitution.varNames)}this.fill=function(e){for(var t=r[0],n=0;n0&&"/"===t.charAt(e.length-1)||"#"===r.charAt(0)||"?"===r.charAt(0))return!0}return!1}(t,e.id)&&void 0===this.schemas[e.id]&&(this.schemas[e.id]=e),e)if("enum"!==n)if("object"===o(e[n]))this.searchSchemas(e[n],t) else if("$ref"===n){var i=v(e[n]) i&&void 0===this.schemas[i]&&void 0===this.missingMap[i]&&(this.missingMap[i]=i)}},l.prototype.addSchema=function(e,t){if("string"!=typeof e||void 0===t){if("object"!==o(e)||"string"!=typeof e.id)return e=(t=e).id}e===v(e)+"#"&&(e=v(e)),this.schemas[e]=t,delete this.missingMap[e],y(t,e),this.searchSchemas(t,e)},l.prototype.getSchemaMap=function(){var e={} for(var t in this.schemas)e[t]=this.schemas[t] return e},l.prototype.getSchemaUris=function(e){var t=[] for(var r in this.schemas)e&&!e.test(r)||t.push(r) return t},l.prototype.getMissingUris=function(e){var t=[] for(var r in this.missingMap)e&&!e.test(r)||t.push(r) return t},l.prototype.dropSchemas=function(){this.schemas={},this.reset()},l.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},l.prototype.validateAll=function(e,t,r,n,i){var a if(!(t=this.resolveRefs(t)))return null if(t instanceof x)return this.errors.push(t),t var s,u=this.errors.length,c=null,l=null if(this.checkRecursive&&e&&"object"===o(e)){if(a=!this.scanned.length,e[this.validatedSchemasKey]){var f=e[this.validatedSchemasKey].indexOf(t) if(-1!==f)return this.errors=this.errors.concat(e[this.validationErrorsKey][f]),null}if(Object.isFrozen(e)&&-1!==(s=this.scannedFrozen.indexOf(e))){var h=this.scannedFrozenSchemas[s].indexOf(t) if(-1!==h)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[s][h]),null}if(this.scanned.push(e),Object.isFrozen(e))-1===s&&(s=this.scannedFrozen.length,this.scannedFrozen.push(e),this.scannedFrozenSchemas.push([])),c=this.scannedFrozenSchemas[s].length,this.scannedFrozenSchemas[s][c]=t,this.scannedFrozenValidationErrors[s][c]=[] else{if(!e[this.validatedSchemasKey])try{Object.defineProperty(e,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(e,this.validationErrorsKey,{value:[],configurable:!0})}catch(t){e[this.validatedSchemasKey]=[],e[this.validationErrorsKey]=[]}l=e[this.validatedSchemasKey].length,e[this.validatedSchemasKey][l]=t,e[this.validationErrorsKey][l]=[]}}var d=this.errors.length,p=this.validateBasic(e,t,i)||this.validateNumeric(e,t,i)||this.validateString(e,t,i)||this.validateArray(e,t,i)||this.validateObject(e,t,i)||this.validateCombinations(e,t,i)||this.validateHypermedia(e,t,i)||this.validateFormat(e,t,i)||this.validateDefinedKeywords(e,t,i)||null if(a){for(;this.scanned.length;)delete this.scanned.pop()[this.validatedSchemasKey] this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(p||d!==this.errors.length)for(;r&&r.length||n&&n.length;){var m=r&&r.length?""+r.pop():null,v=n&&n.length?""+n.pop():null p&&(p=p.prefixWith(m,v)),this.prefixErrors(d,m,v)}return null!==c?this.scannedFrozenValidationErrors[s][c]=this.errors.slice(u):null!==l&&(e[this.validationErrorsKey][l]=this.errors.slice(u)),this.handleError(p)},l.prototype.validateFormat=function(e,t){if("string"!=typeof t.format||!this.formatValidators[t.format])return null var r=this.formatValidators[t.format].call(null,e,t) return"string"==typeof r||"number"==typeof r?this.createError(g.FORMAT_CUSTOM,{message:r},"","/format",null,e,t):r&&"object"===o(r)?this.createError(g.FORMAT_CUSTOM,{message:r.message||"?"},r.dataPath||"",r.schemaPath||"/format",null,e,t):null},l.prototype.validateDefinedKeywords=function(e,t,r){for(var n in this.definedKeywords)if(void 0!==t[n])for(var i=this.definedKeywords[n],a=0;a=h&&nt.maximum)return this.createError(g.NUMBER_MAXIMUM,{value:e,maximum:t.maximum},"","/maximum",null,e,t) if(t.exclusiveMaximum&&e===t.maximum)return this.createError(g.NUMBER_MAXIMUM_EXCLUSIVE,{value:e,maximum:t.maximum},"","/exclusiveMaximum",null,e,t)}return null},l.prototype.validateNaN=function(e,t){return"number"!=typeof e?null:!0===isNaN(e)||e===1/0||e===-1/0?this.createError(g.NUMBER_NOT_A_NUMBER,{value:e},"","/type",null,e,t):null},l.prototype.validateString=function(e,t,r){return this.validateStringLength(e,t,r)||this.validateStringPattern(e,t,r)||null},l.prototype.validateStringLength=function(e,t){return"string"!=typeof e?null:void 0!==t.minLength&&e.lengtht.maxLength?this.createError(g.STRING_LENGTH_LONG,{length:e.length,maximum:t.maxLength},"","/maxLength",null,e,t):null},l.prototype.validateStringPattern=function(e,t){if("string"!=typeof e||"string"!=typeof t.pattern&&!(t.pattern instanceof RegExp))return null var r if(t.pattern instanceof RegExp)r=t.pattern else{var n,i="",o=t.pattern.match(/^\/(.+)\/([img]*)$/) o?(n=o[1],i=o[2]):n=t.pattern,r=new RegExp(n,i)}return r.test(e)?null:this.createError(g.STRING_PATTERN,{pattern:t.pattern},"","/pattern",null,e,t)},l.prototype.validateArray=function(e,t,r){return Array.isArray(e)&&(this.validateArrayLength(e,t,r)||this.validateArrayUniqueItems(e,t,r)||this.validateArrayItems(e,t,r))||null},l.prototype.validateArrayLength=function(e,t){var r return void 0!==t.minItems&&e.lengtht.maxItems&&(r=this.createError(g.ARRAY_LENGTH_LONG,{length:e.length,maximum:t.maxItems},"","/maxItems",null,e,t),this.handleError(r))?r:null},l.prototype.validateArrayUniqueItems=function(e,t){if(t.uniqueItems)for(var r=0;rt.maxProperties&&(r=this.createError(g.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:n.length,maximum:t.maxProperties},"","/maxProperties",null,e,t),this.handleError(r))?r:null},l.prototype.validateObjectRequiredProperties=function(e,t){if(void 0!==t.required)for(var r=0;r 10000") if(void 0!==g[e])throw new Error("Error already defined: "+e+" as "+g[e]) if(void 0!==w[t])throw new Error("Error code already used: "+w[t]+" as "+t) for(var n in g[e]=t,w[t]=e,k[e]=k[t]=r,O){var i=O[n] i[e]&&(i[t]=i[t]||i[e])}},reset:function(){i.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:v,errorCodes:g} return o.language(t||"en"),o}() return E.addLanguage("en-gb",k),E.tv4=E,E})?n.apply(t,[]):n)||(e.exports=i)},,,,,,,,function(e,t,r){"use strict" t.byteLength=function(e){var t=c(e),r=t[0],n=t[1] return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a for(r=0;r>16&255,u[l++]=t>>8&255,u[l++]=255&t return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383)) return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")} for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4") var r=e.indexOf("=") return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]) return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f] for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c else{if(o===u)return a?NaN:1/0*(d?-1:1) a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0 for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,c-=8);e[r+d-p]|=128*m}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=r(248),o=r(249),a=r(250),s=r(251),u=r(257),c=r(260),l=r(264),f=r(132),h=r(133),d=r(277),p=r(304),m=r(328),v=r(334),y=r(342),b=r(349),g=r(357),w=r(361),_=r(373),k=r(381),x=r(385),O=r(392),E=r(404),S=r(417),P=r(424),M=r(426),A=r(429),j=r(431),R=r(437),T=r(158),C=r(442),I=r(443),N=r(444),D=r(445),B=r(446),L=r(159),F=r(447),U=r(448),z=r(449),q=r(450),H=r(451),V=r(452),W=r(453),G=r(454),Y=r(455),K=r(7),J=r(19),$=r(456) function Z(e){return e&&"object"===n(e)&&"default"in e?e:{default:e}}function Q(e){if(e&&e.__esModule)return e var t=Object.create(null) return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r) Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var X=Q(s),ee=Q(u),te=Q(c),re=Q(l),ne=Z(Y),ie=Z($),oe=ne.default Object.defineProperty(t,"CID",{enumerable:!0,get:function(){return K.CID}}),Object.defineProperty(t,"multiaddr",{enumerable:!0,get:function(){return J.Multiaddr}}),Object.defineProperty(t,"urlSource",{enumerable:!0,get:function(){return ie.default}}),t.create=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={name:f.identity.name,code:f.identity.code,encode:function(e){return e},decode:function(e){return e}},r=Object.values(h.bases);(e.ipld&&e.ipld.bases?e.ipld.bases:[]).forEach((function(e){return r.push(e)})) var n=new i.Multibases({bases:r,loadBase:e.ipld&&e.ipld.loadBase}),s=Object.values(h.codecs);[X,ee,te,re,t].concat(e.ipld&&e.ipld.codecs||[]).forEach((function(e){return s.push(e)})) var u=new o.Multicodecs({codecs:s,loadCodec:e.ipld&&e.ipld.loadCodec}),c=Object.values(h.hashes);(e.ipld&&e.ipld.hashers?e.ipld.hashers:[]).forEach((function(e){return c.push(e)})) var l=new a.Multihashes({hashers:c,loadHasher:e.ipld&&e.ipld.loadHasher}),Y={add:R.createAdd(e),addAll:T.createAddAll(e),bitswap:d.createBitswap(e),block:p.createBlock(e),bootstrap:m.createBootstrap(e),cat:C.createCat(e),commands:I.createCommands(e),config:v.createConfig(e),dag:y.createDag(u,e),dht:b.createDht(e),diag:g.createDiag(e),dns:N.createDns(e),files:w.createFiles(e),get:B.createGet(e),getEndpointConfig:D.createGetEndpointConfig(e),id:L.createId(e),isOnline:F.createIsOnline(e),key:_.createKey(e),log:k.createLog(e),ls:U.createLs(e),mount:z.createMount(e),name:x.createName(e),object:O.createObject(u,e),pin:E.createPin(e),ping:q.createPing(e),pubsub:S.createPubsub(e),refs:P.createRefs(e),repo:M.createRepo(e),resolve:H.createResolve(e),start:V.createStart(e),stats:A.createStats(e),stop:W.createStop(e),swarm:j.createSwarm(e),version:G.createVersion(e),bases:n,codecs:u,hashers:l} return Y},t.globSource=oe},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,i=function(){} return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=n;)r[i++]=255&t|128,t/=128 for(;-128&t;)r[i++]=255&t|128,t>>>=7 return r[i]=0|t,e.bytes=i-o+1,r},decode:function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint") n=t[a++],i+=o<28?(127&n)<=128) return e.bytes=a-r,i},encodingLength:function(e){return e=255)throw new TypeError("Alphabet too long") for(var r=new Uint8Array(256),n=0;n>>0,a=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)] if(255===l)return for(var f=0,h=o-1;(0!==l||f>>0,a[h]=l%256>>>0,l=l/256>>>0 if(0!==l)throw new Error("Non-zero carry") i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===a[d];)d++ for(var p=new Uint8Array(n+(o-d)),m=n;d!==o;)p[m++]=a[d++] return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array") if(0===t.length)return"" for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++ for(var a=(o-i)*l+1>>>0,c=new Uint8Array(a);i!==o;){for(var f=t[i],h=0,d=a-1;(0!==f||h>>0,c[d]=f%s>>>0,f=f/s>>>0 if(0!==f)throw new Error("Non-zero carry") n=h,i++}for(var p=a-n;p!==a&&0===c[p];)p++ for(var m=u.repeat(r);pe.length)&&(t=e.length) for(var r=0,n=new Array(t);r=64)throw new Error("protobuf: varint overflow") if(t>=e.length)throw new Error("protobuf: unexpected end of data") var i=e[t++] if(r+=n<28?(127&i)<e.length)throw new Error("protobuf: unexpected end of data") return[e.subarray(t,o),o]}function u(e,t){var r,i=n(a(e,t),2) return[7&(r=i[0]),r>>3,t=i[1]]}function c(e){for(var t={},r=e.length,i=0;ir)throw new Error("protobuf: (PBLink) unexpected end of data") return t}t.decodeNode=function(e){for(var t,r,i=e.length,o=0,a=!1;oi)throw new Error("protobuf: (PBNode) unexpected end of data") var v={} return r&&(v.Data=r),v.Links=t||[],v}},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=s;)e[t++]=127&r|128,r/=128 for(;r>=128;)e[t++]=127&r|128,r>>>=7 return e[t]=r,n}function f(e){return e%2==0&&e++,Math.floor((function(e){var t=0 return e>=a&&(e=Math.floor(e/a),t=32),e>=65536&&(e>>>=16,t+=16),e>=256&&(e>>>=8,t+=8),t+h[e]}(e)+6)/7)}var h=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8] t.encodeNode=function(e){var t=function(e){var t=0 if(e.Data){var r=e.Data.length t+=1+r+f(r)}if(e.Links){var i,o=n(e.Links) try{for(o.s();!(i=o.n()).done;){var a=c(i.value) t+=1+a+f(a)}}catch(e){o.e(e)}finally{o.f()}}return t}(e),r=new Uint8Array(t),i=t if(e.Data&&(i-=e.Data.length,r.set(e.Data,i),r[i=l(r,i,e.Data.length)-1]=10),e.Links)for(var o=e.Links.length-1;o>=0;o--){var a=u(e.Links[o],r.subarray(0,i)) r[i=l(r,i-=a,a)-1]=18}return r}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=r(7),o=["Data","Links"],a=["Hash","Name","Tsize"],s=new TextEncoder function u(e,t){if(e===t)return 0 for(var r=e.Name?s.encode(e.Name):[],n=t.Name?s.encode(t.Name):[],i=r.length,o=n.length,a=0,u=Math.min(i,o);a1&&void 0!==arguments[1]?arguments[1]:[] return f({Data:e,Links:t})},t.prepare=f,t.validate=function(e){if(!e||"object"!==n(e)||Array.isArray(e))throw new TypeError("Invalid DAG-PB form") if(!c(e,o))throw new TypeError("Invalid DAG-PB form (extraneous properties)") if(void 0!==e.Data&&!(e.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be a Uint8Array)") if(!Array.isArray(e.Links))throw new TypeError("Invalid DAG-PB form (Links must be an array)") for(var t=0;t0&&-1===u(r,e.Links[t-1]))throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(92),i=r(7) var o=function(e){if(e&&e.__esModule)return e var t=Object.create(null) return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r) Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}(n),a={float64:!0,typeEncoders:{Object:function(e){if(e.asCID!==e)return null var t=i.CID.asCID(e) if(!t)return null var r=new Uint8Array(t.bytes.byteLength+1) return r.set(t.bytes,1),[new o.Token(o.Type.tag,42),new o.Token(o.Type.bytes,r)]},undefined:function(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")},number:function(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded") if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded") return null}}},s={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]} s.tags[42]=function(e){if(0!==e[0])throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00") return i.CID.decode(e.subarray(1))},t.code=113,t.decode=function(e){return o.decode(e,s)},t.encode=function(e){return o.encode(e,a)},t.name="dag-cbor"},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=["string","number","bigint","symbol"],o=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"] t.is=function(e){if(null===e)return"null" if(void 0===e)return"undefined" if(!0===e||!1===e)return"boolean" var t=n(e) return i.includes(t)?t:"function"===t?"Function":Array.isArray(e)?"Array":function(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}(e)?"Buffer":function(e){var t=Object.prototype.toString.call(e).slice(8,-1) if(o.includes(t))return t}(e)||"Object"}},function(e,t,r){"use strict" function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:256 n(this,e),this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}var t,r return t=e,(r=[{key:"reset",value:function(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),null!==this._initReuseChunk&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}},{key:"push",value:function(e){var t=this.chunks[this.chunks.length-1] if(this.cursor+e.length<=this.maxCursor+1){var r=t.length-(this.maxCursor-this.cursor)-1 t.set(e,r)}else{if(t){var n=t.length-(this.maxCursor-this.cursor)-1 n0&&void 0!==arguments[0]&&arguments[0] if(1===this.chunks.length){var r=this.chunks[0] t&&this.cursor>r.length/2?(e=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):e=o.slice(r,0,this.cursor)}else e=o.concat(this.chunks,this.cursor) return t&&this.reset(),e}}])&&i(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}() t.Bl=a},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r0?this.tokenBuffer.pop():o(l(a.prototype),"next",this).call(this)}},{key:"next",value:function(){var e=this._next() if(e.type===d.Type.map){var t=this._next() if(t.type===d.Type.string&&"/"===t.value){var r=this._next() if(r.type===d.Type.string){if(this._next().type!==d.Type.break)throw new Error("Invalid encoded CID form") return this.tokenBuffer.push(r),new d.Token(d.Type.tag,42,0)}if(r.type===d.Type.map){var n=this._next() if(n.type===d.Type.string&&"bytes"===n.value){var i=this._next() if(i.type===d.Type.string){for(var o=0;o<2;o++)if(this._next().type!==d.Type.break)throw new Error("Invalid encoded Bytes form") var a=h.base64.decode("m".concat(i.value)) return new d.Token(d.Type.bytes,a,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}}])&&i(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Tokenizer),b={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]} b.tags[42]=f.CID.parse,t.code=297,t.decode=function(e){var t=Object.assign(b,{tokenizer:new y(e,b)}) return p.decode(e,t)},t.encode=function(e){return p.encode(e,v)},t.name="dag-json"},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(262),i=r(263) t.encode=n.encode,t.Tokenizer=i.Tokenizer,t.decode=i.decode},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r32?p.asU8A(r):r)}},{key:s,value:function(e,t){this.prefix(e),this.inRecursive.push({type:f.Type.array,elements:0}),e.push([91])}},{key:h,value:function(e,t){this.prefix(e),this.inRecursive.push({type:f.Type.map,elements:0}),e.push([123])}},{key:m,value:function(e,t){}},{key:v,value:function(e,t){if("break"===t.type.name){var r=this.inRecursive.pop() if(r){if(r.type===f.Type.array)e.push([93]) else{if(r.type!==f.Type.map)throw new Error("Unexpected recursive type; this should not happen!") e.push([125])}return}throw new Error("Unexpected break; this should not happen!")}if(void 0===t.value)throw new Error("".concat(d.encodeErrPrefix," unsupported type: undefined")) if(this.prefix(e),"true"!==t.type.name)if("false"!==t.type.name)if("null"!==t.type.name){for(var n=String(t.value),i=[],o=!1,a=0;an)return 1 throw new Error("".concat(d.encodeErrPrefix," unexpected duplicate map keys, this is not supported"))}} t.encode=function(e,t){return t=Object.assign({},v,t),h.encodeCustom(e,new m,t)}},function(e,t,r){"use strict" function n(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{} o(this,e),this.pos=0,this.data=t,this.options=r,this.modeStack=["value"],this.lastToken=""}var t,r return t=e,(r=[{key:"done",value:function(){return this.pos>=this.data.length}},{key:"ch",value:function(){return this.data[this.pos]}},{key:"currentMode",value:function(){return this.modeStack[this.modeStack.length-1]}},{key:"skipWhitespace",value:function(){for(var e=this.ch();32===e||9===e||13===e||10===e;)e=this.data[++this.pos]}},{key:"expect",value:function(e){if(this.data.length-this.pos=0?u.Type.uint:u.Type.negint,a,this.pos-t):new u.Token(a>=0?u.Type.uint:u.Type.negint,BigInt(o),this.pos-t)}},{key:"parseString",value:function(){var e=this if(34!==this.ch())throw new Error("".concat(l.decodeErrPrefix," unexpected character at position ").concat(this.pos,"; this shouldn't happen")) this.pos++ for(var t=this.pos,r=0;t=128)break if(34===n){var i=String.fromCharCode.apply(null,this.data.subarray(this.pos,t)) return this.pos=t+1,new u.Token(u.Type.string,i,r)}}for(var o=this.pos,a=[],s=function(){if(e.pos+4>=e.data.length)throw new Error("".concat(l.decodeErrPrefix," unexpected end of unicode escape sequence at position ").concat(e.pos)) for(var t=0,r=0;r<4;r++){var n=e.ch() if(n>=48&&n<=57)n-=48 else if(n>=97&&n<=102)n=n-97+10 else{if(!(n>=65&&n<=70))throw new Error("".concat(l.decodeErrPrefix," unexpected unicode escape character at position ").concat(e.pos)) n=n-65+10}t=16*t+n,e.pos++}return t},f=function(){var t,r,n,i,o=e.ch(),s=null,u=o>239?4:o>223?3:o>191?2:1 if(e.pos+u>e.data.length)throw new Error("".concat(l.decodeErrPrefix," unexpected unicode sequence at position ").concat(e.pos)) switch(u){case 1:o<128&&(s=o) break case 2:128==(192&(t=e.data[e.pos+1]))&&(i=(31&o)<<6|63&t)>127&&(s=i) break case 3:t=e.data[e.pos+1],r=e.data[e.pos+2],128==(192&t)&&128==(192&r)&&(i=(15&o)<<12|(63&t)<<6|63&r)>2047&&(i<55296||i>57343)&&(s=i) break case 4:t=e.data[e.pos+1],r=e.data[e.pos+2],n=e.data[e.pos+3],128==(192&t)&&128==(192&r)&&128==(192&n)&&(i=(15&o)<<18|(63&t)<<12|(63&r)<<6|63&n)>65535&&i<1114112&&(s=i)}null===s?(s=65533,u=1):s>65535&&(s-=65536,a.push(s>>>10&1023|55296),s=56320|1023&s),a.push(s),e.pos+=u};!this.done();){var h=this.ch(),d=void 0 switch(h){case 92:if(this.pos++,this.done())throw new Error("".concat(l.decodeErrPrefix," unexpected string termination at position ").concat(this.pos)) switch(d=this.ch(),this.pos++,d){case 34:case 39:case 92:case 47:a.push(d) break case 98:a.push(8) break case 116:a.push(9) break case 110:a.push(10) break case 102:a.push(12) break case 114:a.push(13) break case 117:a.push(s()) break default:throw new Error("".concat(l.decodeErrPrefix," unexpected string escape character at position ").concat(this.pos))}break case 34:return this.pos++,new u.Token(u.Type.string,c.decodeCodePointsArray(a),this.pos-o) default:if(h<32)throw new Error("".concat(l.decodeErrPrefix," invalid control character at position ").concat(this.pos)) h<128?(a.push(h),this.pos++):f()}}throw new Error("".concat(l.decodeErrPrefix," unexpected end of string at position ").concat(this.pos))}},{key:"parseValue",value:function(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this.pos++,new u.Token(u.Type.map,1/0,1) case 91:return this.modeStack.push("array-start"),this.pos++,new u.Token(u.Type.array,1/0,1) case 34:return this.parseString() case 110:return this.expect([110,117,108,108]),new u.Token(u.Type.null,null,4) case 102:return this.expect([102,97,108,115,101]),new u.Token(u.Type.false,!1,5) case 116:return this.expect([116,114,117,101]),new u.Token(u.Type.true,!0,4) case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber() default:throw new Error("".concat(l.decodeErrPrefix," unexpected character at position ").concat(this.pos))}}},{key:"next",value:function(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue() case"array-value":if(this.modeStack.pop(),93===this.ch())return this.pos++,this.skipWhitespace(),new u.Token(u.Type.break,void 0,1) if(44!==this.ch())throw new Error("".concat(l.decodeErrPrefix," unexpected character at position ").concat(this.pos,", was expecting array delimiter but found '").concat(String.fromCharCode(this.ch()),"'")) return this.pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue() case"array-start":return this.modeStack.pop(),93===this.ch()?(this.pos++,this.skipWhitespace(),new u.Token(u.Type.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()) case"obj-key":if(125===this.ch())return this.modeStack.pop(),this.pos++,this.skipWhitespace(),new u.Token(u.Type.break,void 0,1) if(44!==this.ch())throw new Error("".concat(l.decodeErrPrefix," unexpected character at position ").concat(this.pos,", was expecting object delimiter but found '").concat(String.fromCharCode(this.ch()),"'")) this.pos++,this.skipWhitespace() case"obj-start":if(this.modeStack.pop(),125===this.ch())return this.pos++,this.skipWhitespace(),new u.Token(u.Type.break,void 0,1) var e=this.parseString() if(this.skipWhitespace(),58!==this.ch())throw new Error("".concat(l.decodeErrPrefix," unexpected character at position ").concat(this.pos,", was expecting key/value delimiter ':' but found '").concat(String.fromCharCode(this.ch()),"'")) return this.pos++,this.modeStack.push("obj-value"),e case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue() default:throw new Error("".concat(l.decodeErrPrefix," unexpected parse state at position ").concat(this.pos,"; this shouldn't happen"))}}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}() t.Tokenizer=f,t.decode=function(e,t){return t=Object.assign({tokenizer:new f(e,t)},t),s.decode(e,t)}},function(e,t,r){"use strict" var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e var t={} if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r) return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.toGeneral=t.code=t.name=void 0 var s=a(r(265)),u=a(r(266)),c=o(r(267)) function l(e){return"payload"in e&&"string"==typeof e.payload&&"signatures"in e&&Array.isArray(e.signatures)}function f(e){return"ciphertext"in e&&"string"==typeof e.ciphertext&&"iv"in e&&"string"==typeof e.iv&&"protected"in e&&"string"==typeof e.protected&&"tag"in e&&"string"==typeof e.tag}function h(e){if("string"==typeof e){var t=e.split(".") if(3===t.length)return s.default.fromSplit(t) if(5===t.length)return u.default.fromSplit(t) throw new Error("Not a valid JOSE string")}if(l(e)||f(e))return e throw new Error("Not a valid unencoded JOSE object")}t.name="dag-jose",t.code=133,t.toGeneral=h,t.encode=function(e){var t if("string"==typeof e&&(e=h(e)),l(e))t=s.default.encode(e) else{if(!f(e))throw new Error("Not a valid JOSE object") t=u.default.encode(e)}return new Uint8Array(c.encode(t))},t.decode=function(e){var t,r try{t=c.decode(e)}catch(e){throw new Error("Not a valid DAG-JOSE object")}if("payload"in(r=t)&&r.payload instanceof Uint8Array&&"signatures"in r&&Array.isArray(r.signatures))return s.default.decode(t) if(function(e){return"ciphertext"in e&&e.ciphertext instanceof Uint8Array&&"iv"in e&&e.iv instanceof Uint8Array&&"protected"in e&&e.protected instanceof Uint8Array&&"tag"in e&&e.tag instanceof Uint8Array}(t))return u.default.decode(t) throw new Error("Not a valid DAG-JOSE object")}},function(e,t,r){"use strict" function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null!=r){var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);re.length)&&(t=e.length) for(var r=0,n=new Array(t);r0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("bitswap/wantlist",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return t.next=5,t.sent.json() case 5:return n=t.sent,t.abrupt("return",(n.Keys||[]).map((function(e){return o.CID.parse(e["/"])}))) case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createWantlist=u},function(e,t,r){"use strict" var n=r(280),i=r(96),o=r(97),a=r(98).concat,s=r(40).toString function u(e){var t=[],r=e.split("/").slice(1) if(1===r.length&&""===r[0])return[] for(var n=0;n=r.length)throw g("invalid address: "+e) if(a.path){t.push([o,b(r.slice(n).join("/"))]) break}t.push([o,r[n]])}else t.push([o])}return t}function c(e){var t=[] return e.map((function(e){var r=w(e) return t.push(r.name),e.length>1&&t.push(e[1]),null})),b(t.join("/"))}function l(e){return e.map((function(e){Array.isArray(e)||(e=[e]) var t=w(e) return e.length>1?[t.code,n.toBytes(t.code,e[1])]:[t.code]}))}function f(e){return e.map((function(e){var t=w(e) return e[1]?[t.code,n.toString(t.code,e[1])]:[t.code]}))}function h(e){return v(a(e.map((function(e){var t=w(e),r=Uint8Array.from(o.encode(t.code)) return e.length>1&&(r=a([r,e[1]])),r}))))}function d(e,t){return e.size>0?e.size/8:0===e.size?0:o.decode(t)+o.decode.bytes}function p(e){for(var t=[],r=0;re.length)throw g("Invalid address Uint8Array: "+s(e,"base16")) t.push([n,c])}else t.push([n]),r+=a}return t}function m(e){return h(l(u(e=b(e))))}function v(e){var t=y(e) if(t)throw t return Uint8Array.from(e)}function y(e){try{p(e)}catch(e){return e}}function b(e){return"/"+e.trim().split("/").filter((function(e){return e})).join("/")}function g(e){return new Error("Error parsing address: "+e)}function w(e){return i(e[0])}e.exports={stringToStringTuples:u,stringTuplesToString:c,tuplesToStringTuples:f,stringTuplesToTuples:l,bytesToTuples:p,tuplesToBytes:h,bytesToString:function(e){return c(f(p(e)))},stringToBytes:m,fromString:function(e){return m(e)},fromBytes:v,validateBytes:y,isValidBytes:function(e){return void 0===y(e)},cleanPath:b,ParseError:g,protoFromTuple:w,sizeForAddr:d}},function(e,t,r){"use strict" var n=r(281),i=r(96),o=r(7).CID,a=r(91).base32,s=r(72).base58btc,u=r(48),c=r(97),l=r(40).toString,f=r(42).fromString,h=r(98).concat function d(e,t){return t instanceof Uint8Array?d.toString(e,t):d.toBytes(e,t)}function p(e){var t=new ArrayBuffer(2) return new DataView(t).setUint16(0,e),new Uint8Array(t)}function m(e){return new DataView(e.buffer).getUint16(e.byteOffset)}e.exports=d,d.toString=function(e,t){switch(i(e).code){case 4:case 41:return function(e){var t=n.toString(e) if(!t||!n.isIP(t))throw new Error("invalid ip address") return t}(t) case 6:case 273:case 33:case 132:return m(t).toString() case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=c.decode(e) if((e=e.slice(c.decode.bytes)).length!==t)throw new Error("inconsistent lengths") return l(e)}(t) case 421:return function(e){var t=c.decode(e),r=e.slice(c.decode.bytes) if(r.length!==t)throw new Error("inconsistent lengths") return l(r,"base58btc")}(t) case 444:case 445:return function(e){var t=e.slice(0,e.length-2),r=e.slice(e.length-2) return l(t,"base32")+":"+m(r)}(t) default:return l(t,"base16")}},d.toBytes=function(e,t){switch(i(e).code){case 4:case 41:return function(e){if(!n.isIP(e))throw new Error("invalid ip address") return n.toBytes(e)}(t) case 6:case 273:case 33:case 132:return p(parseInt(t,10)) case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=f(e),r=Uint8Array.from(c.encode(t.length)) return h([r,t],r.length+t.length)}(t) case 421:return function(e){var t t="Q"===e[0]||"1"===e[0]?u.decode(s.decode("z".concat(e))).bytes:o.parse(e).multihash.bytes var r=Uint8Array.from(c.encode(t.length)) return h([r,t],r.length+t.length)}(t) case 444:return function(e){var t=e.split(":") if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number") if(16!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion address.") var r=a.decode("b"+t[0]),n=parseInt(t[1],10) if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)") var i=p(n) return h([r,i],r.length+i.length)}(t) case 445:return function(e){var t=e.split(":") if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number") if(56!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion3 address.") var r=a.decode("b"+t[0]),n=parseInt(t[1],10) if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)") var i=p(n) return h([r,i],r.length+i.length)}(t) default:return f(t,"base16")}}},function(e,t,r){"use strict" var n=r(282),i=r(40).toString,o=n,a=n.v4,s=n.v6 e.exports={isIP:o,isV4:a,isV6:s,toBytes:function e(t,r,n){var o if(n=~~n,a(t))o=r||new Uint8Array(n+4),t.split(/\./g).map((function(e){o[n++]=255&parseInt(e,10)})) else if(s(t)){var u,c=t.split(":",8) for(u=0;u0;u--)f.push("0") c.splice.apply(c,f)}for(o=r||new Uint8Array(n+16),u=0;u>8&255,o[n++]=255&h}}if(!o)throw Error("Invalid ip address: "+t) return o},toString:function(e,t,r){t=~~t,r=r||e.length-t var n,i=[],o=new DataView(e.buffer) if(4===r){for(var a=0;aNumber.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint") n=n||[] for(var o=i=i||0;t>=r;)n[i++]=255&t|128,t/=128 for(;-128&t;)n[i++]=255&t|128,t>>>=7 return n[i]=0|t,e.bytes=i-o+1,n} var r=Math.pow(2,31)},function(e,t){e.exports=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length do{if(a>=s||o>49)throw e.bytes=0,new RangeError("Could not decode varint") n=t[a++],i+=o<28?(127&n)<=128) return e.bytes=a-r,i}},function(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),u=Math.pow(2,49),c=Math.pow(2,56),l=Math.pow(2,63) e.exports=function(e){return e=0}}).call(this,r(12))},function(e,t,r){"use strict" r.r(t) let n=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu function i(e="",t="ms"){var r=null return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(n,(function(e,t,n){(n=o(n))&&(r=(r||0)+parseFloat(t,10)*n)})),r&&r/(o(t)||1)}function o(e){return i[e]||i[e.toLowerCase().replace(/s$/,"")]}i.nanosecond=i.ns=1e-6,i["µs"]=i["μs"]=i.us=i.microsecond=.001,i.millisecond=i.ms=i[""]=1,i.second=i.sec=i.s=1e3*i.ms,i.minute=i.min=i.m=60*i.s,i.hour=i.hr=i.h=60*i.m,i.day=i.d=24*i.h,i.week=i.wk=i.w=7*i.d,i.month=i.b=30.4375*i.d,i.year=i.yr=i.y=365.25*i.d,t.default=i},function(e,t,r){function n(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r=1.5*r return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{} var u=r(e) if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e) if(t){var r=parseFloat(t[1]) switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r case"weeks":case"week":case"w":return 6048e5*r case"days":case"day":case"d":return r*a case"hours":case"hour":case"hrs":case"hr":case"h":return r*o case"minutes":case"minute":case"mins":case"min":case"m":return r*i case"seconds":case"second":case"secs":case"sec":case"s":return r*n case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r default:return}}}}(e) if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e) return t>=a?s(e,t,a,"day"):t>=o?s(e,t,o,"hour"):t>=i?s(e,t,i,"minute"):t>=n?s(e,t,n,"second"):e+" ms"}(e):function(e){var t=Math.abs(e) return t>=a?Math.round(e/a)+"d":t>=o?Math.round(e/o)+"h":t>=i?Math.round(e/i)+"m":t>=n?Math.round(e/n)+"s":e+"ms"}(e) throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=u(e) if(t){var i=u(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return a(this,r)}}function a(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined") return s(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(null!=r){var n,i,o=[],a=!0,s=!1 try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=f(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,i=function(){} return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){if(e){if("string"==typeof e)return h(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=new XMLHttpRequest r.open(t.method||"GET",e.toString(),!0) var n=t.timeout,i=t.headers if(n&&n>0&&n<1/0&&(r.timeout=n),null!=t.overrideMimeType&&r.overrideMimeType(t.overrideMimeType),i){var o,a=l(new g(i)) try{for(a.s();!(o=a.n()).done;){var s=c(o.value,2),u=s[0],f=s[1] r.setRequestHeader(u,f)}}catch(e){a.e(e)}finally{a.f()}}return t.signal&&(t.signal.onabort=function(){return r.abort()}),t.onUploadProgress&&(r.upload.onprogress=t.onUploadProgress),r.responseType="arraybuffer",new Promise((function(e,n){var i=function(t){switch(t.type){case"error":e(y.error()) break case"load":e(new O(r.responseURL,r.response,{status:r.status,statusText:r.statusText,headers:x(r.getAllResponseHeaders())})) break case"timeout":n(new p) break case"abort":n(new m)}} r.onerror=i,r.onload=i,r.ontimeout=i,r.onabort=i,r.send(t.body)}))},k=w,x=function(e){var t,r=new g,n=l(e.trim().split(/[\r\n]+/)) try{for(n.s();!(t=n.n()).done;){var i=t.value,o=i.indexOf(": ") o>0&&r.set(i.slice(0,o),i.slice(o+1))}}catch(e){n.e(e)}finally{n.f()}return r},O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(n,e) var t,r=o(n) function n(e,t,i){var o return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),o=r.call(this,t,i),Object.defineProperty(s(o),"url",{value:e}),o}return t=n,Object.defineProperty(t,"prototype",{writable:!1}),t}(y) e.exports={fetch:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} return null!=t.onUploadProgress?_(e,t):k(e,t)},Request:b,Headers:g}},function(e,t,r){"use strict" var n=r(135).isElectronMain e.exports=r(n?294:295)},,function(e,t,r){"use strict" globalThis.fetch&&globalThis.Headers&&globalThis.Request&&globalThis.Response?e.exports={default:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response}:e.exports={default:r(63).default,Headers:r(63).Headers,Request:r(63).Request,Response:r(63).Response}},function(e,t,r){"use strict" e.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1 var t=Object.getPrototypeOf(e) return null===t||t===Object.prototype}},function(e,t,r){"use strict" var n=r(139),i=n.URLWithLegacySupport,o=n.format,a=n.URLSearchParams,s=n.defaultBase,u=r(298) e.exports={URL:i,URLSearchParams:a,format:o,relative:u,defaultBase:s}},function(e,t,r){"use strict" var n=r(139),i=n.URLWithLegacySupport,o=n.format e.exports=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,s=r.protocol?r.protocol.replace(":",""):"http" s=(n[s]||a||s)+":" try{t=new i(e)}catch(e){t={}}var u=Object.assign({},r,{protocol:s||t.protocol,host:r.host||t.host}) return new i(e,o(u)).toString()}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=r(19) var o=function(e){return e&&"object"===n(e)&&"default"in e?e:{default:e}}(r(300)) t.toUrlString=function(e){try{e=o.default(new i.Multiaddr(e))}catch(e){}return e.toString()}},function(e,t,r){var n=r(19).Multiaddr,i=function(e,t){return t},o={ip4:i,ip6:function(e,t,r,n){return 1===n.length&&"ip6"===n[0].protocol?t:"[".concat(t,"]")},tcp:function(e,t,r,n,i){return n.some((function(e){return["http","https","ws","wss"].includes(e.protocol)}))?"".concat(e,":").concat(t):function(e,t,r,n){if(n&&!1===n.assumeHttp)return"tcp://".concat(e,":").concat(t) var i="tcp",o=":".concat(t) return"tcp"===r[r.length-1].protocol&&(i="443"===t?"https":"http",o="443"===t||"80"===t?"":o),"".concat(i,"://").concat(e).concat(o)}(e,t,n,i)},udp:function(e,t){return"udp://".concat(e,":").concat(t)},dnsaddr:i,dns4:i,dns6:i,ipfs:function(e,t){return"".concat(e,"/ipfs/").concat(t)},p2p:function(e,t){return"".concat(e,"/p2p/").concat(t)},http:function(e){return"http://".concat(e)},https:function(e){return"https://".concat(e)},ws:function(e){return"ws://".concat(e)},wss:function(e){return"wss://".concat(e)},"p2p-websocket-star":function(e){return"".concat(e,"/p2p-websocket-star")},"p2p-webrtc-star":function(e){return"".concat(e,"/p2p-webrtc-star")},"p2p-webrtc-direct":function(e){return"".concat(e,"/p2p-webrtc-direct")}} e.exports=function(e,t){var r=new n(e),i=e.toString().split("/").slice(1) return r.tuples().map((function(e){return{protocol:i.shift(),content:e[1]?i.shift():null}})).reduce((function(e,r,n,i){var a=o[r.protocol] if(!a)throw new Error("Unsupported protocol ".concat(r.protocol)) return a(e,r.content,n,i,t)}),"")}},function(e,t,r){"use strict" e.exports=function(){}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("bitswap/wantlist",{signal:n.signal,searchParams:l.toUrlSearchParams(i(i({},n),{},{peer:r.toString()})),headers:n.headers}) case 3:return t.next=5,t.sent.json() case 5:return o=t.sent,t.abrupt("return",(o.Keys||[]).map((function(e){return u.CID.parse(e["/"])}))) case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createWantlistForPeer=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("bitswap/unwant",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers}) case 3:return o=t.sent,t.abrupt("return",o.json()) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createUnwant=l},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(144),i=r(305),o=r(326),a=r(327) t.createBlock=function(e){return{get:n.createGet(e),put:i.createPut(e),rm:o.createRm(e),stat:a.createStat(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==p[1]?p[1]:{},a=new AbortController,s=h.abortSignal(a.signal,o.signal),r.prev=3,r.t0=e,r.t1=i,r.t2={signal:s,searchParams:f.toUrlSearchParams(o)},r.next=9,c.multipartRequest([n],a,o.headers) case 9:return r.t3=r.sent,r.t4=(0,r.t1)(r.t2,r.t3),r.next=13,r.t0.post.call(r.t0,"block/put",r.t4) case 13:return d=r.sent,r.next=16,d.json() case 16:l=r.sent,r.next=28 break case 19:if(r.prev=19,r.t5=r.catch(3),"dag-pb"!==o.format){r.next=25 break}return r.abrupt("return",t(n,i(i({},o),{},{format:"protobuf"}))) case 25:if("dag-cbor"!==o.format){r.next=27 break}return r.abrupt("return",t(n,i(i({},o),{},{format:"cbor"}))) case 27:throw r.t5 case 28:return r.abrupt("return",u.CID.parse(l.Key)) case 29:case"end":return r.stop()}}),r,null,[[3,19]])})))).apply(this,arguments)}return t})) t.createPut=d},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(307),i=r(308) t.normaliseInput=function(e){return i.normaliseCandidateMultiple(e,n.normaliseContent,!0)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new s(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function s(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(s=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new s(e)}Object.defineProperty(t,"__esModule",{value:!0}) var u=r(20),c=r(74),l=r(64),f=r(145),h=r(75) function d(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}var p=d(u),m=d(c),v=d(l),y=d(f) function b(){return(b=i(regeneratorRuntime.mark((function e(t){var r,n,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h.isBytes(t)){e.next=2 break}return e.abrupt("return",new Blob([t])) case 2:if(!("string"==typeof t||t instanceof String)){e.next=4 break}return e.abrupt("return",new Blob([t.toString()])) case 4:if(!h.isBlob(t)){e.next=6 break}return e.abrupt("return",t) case 6:if(h.isReadableStream(t)&&(t=v.default(t)),!(Symbol.iterator in t)&&!(Symbol.asyncIterator in t)){e.next=28 break}return r=m.default(t),e.next=11,r.peek() case 11:if(n=e.sent,i=n.value,!n.done){e.next=16 break}return e.abrupt("return",g(r)) case 16:if(r.push(i),!Number.isInteger(i)){e.next=26 break}return e.t0=Blob,e.t1=Uint8Array,e.next=22,y.default(r) case 22:return e.t2=e.sent,e.t3=e.t1.from.call(e.t1,e.t2),e.t4=[e.t3],e.abrupt("return",new e.t0(e.t4)) case 26:if(!(h.isBytes(i)||"string"==typeof i||i instanceof String)){e.next=28 break}return e.abrupt("return",g(r)) case 28:throw p.default(new Error("Unexpected input: ".concat(t)),"ERR_UNEXPECTED_INPUT") case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return w.apply(this,arguments)}function w(){return(w=i(regeneratorRuntime.mark((function e(t){var r,n,i,o,s,u,c return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,s=a(t) case 5:return e.next=7,s.next() case 7:if(!(n=!(u=e.sent).done)){e.next=13 break}c=u.value,r.push(c) case 10:n=!1,e.next=5 break case 13:e.next=19 break case 15:e.prev=15,e.t0=e.catch(3),i=!0,o=e.t0 case 19:if(e.prev=19,e.prev=20,!n||null==s.return){e.next=24 break}return e.next=24,s.return() case 24:if(e.prev=24,!i){e.next=27 break}throw o case 27:return e.finish(24) case 28:return e.finish(19) case 29:return e.abrupt("return",new Blob(r)) case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}t.normaliseContent=function(e){return b.apply(this,arguments)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(){return new s(e.apply(this,arguments))}}function s(e){var t,r function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof c Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function u(e){return new c(e)}function c(e){this.wrapped=e}function l(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new f(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function f(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(f=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new f(e)}function h(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}s.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(e){return this._invoke("next",e)},s.prototype.throw=function(e){return this._invoke("throw",e)},s.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var d=r(20),p=r(64),m=r(74),v=r(146),y=r(75),b=r(147) function g(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}var w=g(d),_=g(p),k=g(m),x=g(v) function O(){return(O=a(regeneratorRuntime.mark((function e(t,r){var n,i,a return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("string"==typeof t||t instanceof String||y.isBytes(t)||y.isBlob(t)||t._readableState)){e.next=2 break}throw w.default(new Error("Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead"),"ERR_UNEXPECTED_INPUT") case 2:if(y.isReadableStream(t)&&(t=_.default(t)),!(Symbol.iterator in t)&&!(Symbol.asyncIterator in t)){e.next=26 break}return n=k.default(t),e.next=7,u(n.peek()) case 7:if(i=e.sent,a=i.value,!i.done){e.next=13 break}return e.delegateYield(h(l([]),u),"t0",12) case 12:return e.abrupt("return") case 13:if(n.push(a),!Number.isInteger(a)){e.next=16 break}throw w.default(new Error("Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead"),"ERR_UNEXPECTED_INPUT") case 16:if(!a._readableState){e.next=19 break}return e.delegateYield(h(l(x.default(n,(function(e){return E({content:e},r)}))),u),"t1",18) case 18:return e.abrupt("return") case 19:if(!y.isBytes(a)){e.next=23 break}return e.next=22,E({content:n},r) case 22:return e.abrupt("return") case 23:if(!(y.isFileObject(a)||a[Symbol.iterator]||a[Symbol.asyncIterator]||y.isReadableStream(a)||y.isBlob(a))){e.next=26 break}return e.delegateYield(h(l(x.default(n,(function(e){return E(e,r)}))),u),"t2",25) case 25:return e.abrupt("return") case 26:if(!y.isFileObject(t)){e.next=28 break}throw w.default(new Error("Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead"),"ERR_UNEXPECTED_INPUT") case 28:throw w.default(new Error("Unexpected input: "+o(t)),"ERR_UNEXPECTED_INPUT") case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return S.apply(this,arguments)}function S(){return(S=i(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.path,i=t.mode,o=t.mtime,a=t.content,s={path:n||"",mode:b.parseMode(i),mtime:b.parseMtime(o)},!a){e.next=8 break}return e.next=5,r(a) case 5:s.content=e.sent,e.next=12 break case 8:if(n){e.next=12 break}return e.next=11,r(t) case 11:s.content=e.sent case 12:return e.abrupt("return",s) case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.normaliseCandidateMultiple=function(e,t){return O.apply(this,arguments)}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=function(e){return e&&"object"===n(e)&&"default"in e?e:{default:e}}(r(310)),o=i.default.Reader,a=i.default.Writer,s=i.default.util,u=i.default.roots["ipfs-unixfs"]||(i.default.roots["ipfs-unixfs"]={}),c=u.Data=function(){function e(e){if(this.blocksizes=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32() break case 2:n.Data=e.bytes() break case 3:n.filesize=e.uint64() break case 4:if(n.blocksizes&&n.blocksizes.length||(n.blocksizes=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos>>0,e.filesize.high>>>0).toNumber(!0))),e.blocksizes){if(!Array.isArray(e.blocksizes))throw TypeError(".Data.blocksizes: array expected") t.blocksizes=[] for(var r=0;r>>0,e.blocksizes[r].high>>>0).toNumber(!0))}if(null!=e.hashType&&(s.Long?(t.hashType=s.Long.fromValue(e.hashType)).unsigned=!0:"string"==typeof e.hashType?t.hashType=parseInt(e.hashType,10):"number"==typeof e.hashType?t.hashType=e.hashType:"object"===n(e.hashType)&&(t.hashType=new s.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0))),null!=e.fanout&&(s.Long?(t.fanout=s.Long.fromValue(e.fanout)).unsigned=!0:"string"==typeof e.fanout?t.fanout=parseInt(e.fanout,10):"number"==typeof e.fanout?t.fanout=e.fanout:"object"===n(e.fanout)&&(t.fanout=new s.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0))),null!=e.mode&&(t.mode=e.mode>>>0),null!=e.mtime){if("object"!==n(e.mtime))throw TypeError(".Data.mtime: object expected") t.mtime=u.UnixTime.fromObject(e.mtime)}return t},e.toObject=function(e,t){t||(t={}) var r={} if((t.arrays||t.defaults)&&(r.blocksizes=[]),t.defaults){if(r.Type=t.enums===String?"Raw":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data))),s.Long){var n=new s.Long(0,0,!0) r.filesize=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.filesize=t.longs===String?"0":0 s.Long?(n=new s.Long(0,0,!0),r.hashType=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.hashType=t.longs===String?"0":0,s.Long?(n=new s.Long(0,0,!0),r.fanout=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.fanout=t.longs===String?"0":0,r.mode=0,r.mtime=null}if(null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?u.Data.DataType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.filesize&&e.hasOwnProperty("filesize")&&("number"==typeof e.filesize?r.filesize=t.longs===String?String(e.filesize):e.filesize:r.filesize=t.longs===String?s.Long.prototype.toString.call(e.filesize):t.longs===Number?new s.LongBits(e.filesize.low>>>0,e.filesize.high>>>0).toNumber(!0):e.filesize),e.blocksizes&&e.blocksizes.length){r.blocksizes=[] for(var i=0;i>>0,e.blocksizes[i].high>>>0).toNumber(!0):e.blocksizes[i]}return null!=e.hashType&&e.hasOwnProperty("hashType")&&("number"==typeof e.hashType?r.hashType=t.longs===String?String(e.hashType):e.hashType:r.hashType=t.longs===String?s.Long.prototype.toString.call(e.hashType):t.longs===Number?new s.LongBits(e.hashType.low>>>0,e.hashType.high>>>0).toNumber(!0):e.hashType),null!=e.fanout&&e.hasOwnProperty("fanout")&&("number"==typeof e.fanout?r.fanout=t.longs===String?String(e.fanout):e.fanout:r.fanout=t.longs===String?s.Long.prototype.toString.call(e.fanout):t.longs===Number?new s.LongBits(e.fanout.low>>>0,e.fanout.high>>>0).toNumber(!0):e.fanout),null!=e.mode&&e.hasOwnProperty("mode")&&(r.mode=e.mode),null!=e.mtime&&e.hasOwnProperty("mtime")&&(r.mtime=u.UnixTime.toObject(e.mtime,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.default.util.toJSONOptions)},e.DataType=(t={},(r=Object.create(t))[t[0]="Raw"]=0,r[t[1]="Directory"]=1,r[t[2]="File"]=2,r[t[3]="Metadata"]=3,r[t[4]="Symlink"]=4,r[t[5]="HAMTShard"]=5,r),e}(),l=u.UnixTime=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Seconds=e.int64() break case 2:n.FractionalNanoseconds=e.fixed32() break default:e.skipType(7&i)}}if(!n.hasOwnProperty("Seconds"))throw s.ProtocolError("missing required 'Seconds'",{instance:n}) return n},e.fromObject=function(e){if(e instanceof u.UnixTime)return e var t=new u.UnixTime return null!=e.Seconds&&(s.Long?(t.Seconds=s.Long.fromValue(e.Seconds)).unsigned=!1:"string"==typeof e.Seconds?t.Seconds=parseInt(e.Seconds,10):"number"==typeof e.Seconds?t.Seconds=e.Seconds:"object"===n(e.Seconds)&&(t.Seconds=new s.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber())),null!=e.FractionalNanoseconds&&(t.FractionalNanoseconds=e.FractionalNanoseconds>>>0),t},e.toObject=function(e,t){t||(t={}) var r={} if(t.defaults){if(s.Long){var n=new s.Long(0,0,!1) r.Seconds=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.Seconds=t.longs===String?"0":0 r.FractionalNanoseconds=0}return null!=e.Seconds&&e.hasOwnProperty("Seconds")&&("number"==typeof e.Seconds?r.Seconds=t.longs===String?String(e.Seconds):e.Seconds:r.Seconds=t.longs===String?s.Long.prototype.toString.call(e.Seconds):t.longs===Number?new s.LongBits(e.Seconds.low>>>0,e.Seconds.high>>>0).toNumber():e.Seconds),null!=e.FractionalNanoseconds&&e.hasOwnProperty("FractionalNanoseconds")&&(r.FractionalNanoseconds=e.FractionalNanoseconds),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.default.util.toJSONOptions)},e}(),f=u.Metadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.MimeType=e.string() break default:e.skipType(7&i)}}return n},e.fromObject=function(e){if(e instanceof u.Metadata)return e var t=new u.Metadata return null!=e.MimeType&&(t.MimeType=String(e.MimeType)),t},e.toObject=function(e,t){t||(t={}) var r={} return t.defaults&&(r.MimeType=""),null!=e.MimeType&&e.hasOwnProperty("MimeType")&&(r.MimeType=e.MimeType),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.default.util.toJSONOptions)},e}() t.Data=c,t.Metadata=f,t.UnixTime=l,t.default=u},function(e,t,r){"use strict" e.exports=r(311)},function(e,t,r){"use strict" var n=t function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(148),n.BufferWriter=r(320),n.Reader=r(149),n.BufferReader=r(321),n.util=r(43),n.rpc=r(322),n.roots=r(324),n.configure=i,i()},function(e,t,r){"use strict" e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i1&&"="===e.charAt(t);)++r return Math.ceil(3*e.length)/4-r} for(var i=new Array(64),o=new Array(123),a=0;a<64;)o[i[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++ n.encode=function(e,t,r){for(var n,o=null,a=[],s=0,u=0;t>2],n=(3&c)<<4,u=1 break case 1:a[s++]=i[n|c>>4],n=(15&c)<<2,u=2 break case 2:a[s++]=i[n|c>>6],a[s++]=i[63&c],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=i[n],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))},n.decode=function(e,t,r){for(var n,i=r,a=0,s=0;s1)break if(void 0===(u=o[u]))throw Error("invalid encoding") switch(a){case 0:n=u,a=1 break case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2 break case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3 break case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error("invalid encoding") return r-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict" function n(){this._listeners={}}e.exports=n,n.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(void 0===e)this._listeners={} else if(void 0===t)this._listeners[e]=[] else for(var r=this._listeners[e],n=0;n0?0:2147483648,r,n) else if(isNaN(t))e(2143289344,r,n) else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n) else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n) else{var o=Math.floor(Math.log(t)/Math.LN2) e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function r(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,a),e.readFloatBE=r.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7] function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0 if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r) else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r) else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r) else{var s if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r) else{var u=Math.floor(Math.log(n)/Math.LN2) 1024===u&&(u=1023),e(4503599627370496*(s=n*Math.pow(2,-u))>>>0,i,o+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function r(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+o return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,a,0,4),e.readDoubleBE=r.bind(null,s,4,0)}(),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=n(n)},function(module,exports,__webpack_require__){"use strict" function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName) if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},function(e,t,r){"use strict" var n=t n.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0) return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128) return r-o}},function(e,t,r){"use strict" e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n return function(r){if(r<1||r>i)return e(r) a+r>n&&(o=e(n),a=0) var s=t.call(o,a,a+=r) return 7&a&&(a=1+(7|a)),s}}},function(e,t,r){"use strict" e.exports=i var n=r(43) function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0) o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1} var a=i.zeroHash="\0\0\0\0\0\0\0\0" i.fromNumber=function(e){if(0===e)return o var t=e<0 t&&(e=-e) var r=e>>>0,n=(e-r)/4294967296>>>0 return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e) if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10)) e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0 return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}} var s=String.prototype.charCodeAt i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31 return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo) return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24 return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict" e.exports=o var n=r(148);(o.prototype=Object.create(n.prototype)).constructor=o var i=r(43) function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length) else for(var n=0;n>>0 return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e) return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},function(e,t,r){"use strict" e.exports=o var n=r(149);(o.prototype=Object.create(n.prototype)).constructor=o var i=r(43) function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32() return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},function(e,t,r){"use strict" t.Service=r(323)},function(e,t,r){"use strict" e.exports=i var n=r(43) function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function") n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified") var s=this if(!a)return n.asPromise(e,s,t,r,i,o) if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e) if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict" e.exports={}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}),t.modeToString=function(e){if(null!=e)return"string"==typeof e?e:e.toString(8).padStart(4,"0")}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==m[1]?m[1]:{},Array.isArray(r)||(r=[r]),t.next=4,a(e.post("block/rm",{signal:n.signal,searchParams:p.toUrlSearchParams(i({arg:r.map((function(e){return e.toString()})),"stream-channels":!0},n)),headers:n.headers})) case 4:o=t.sent,s=!1,u=!1,t.prev=7,f=l(o.ndjson()) case 9:return t.next=11,a(f.next()) case 11:if(!(s=!(h=t.sent).done)){t.next=18 break}return d=h.value,t.next=15,v(d) case 15:s=!1,t.next=9 break case 18:t.next=24 break case 20:t.prev=20,t.t0=t.catch(7),u=!0,c=t.t0 case 24:if(t.prev=24,t.prev=25,!s||null==f.return){t.next=29 break}return t.next=29,a(f.return()) case 29:if(t.prev=29,!u){t.next=32 break}throw c case 32:return t.finish(29) case 33:return t.finish(24) case 34:case"end":return t.stop()}}),t,null,[[7,20,24,34],[25,,29,33]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) function v(e){var t={cid:h.CID.parse(e.Hash)} return e.Error&&(t.error=new Error(e.Error)),t}t.createRm=m},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("block/stat",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",{cid:u.CID.parse(a.Key),size:a.Size}) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createStat=f},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(329),i=r(330),o=r(331),a=r(332),s=r(333) t.createBootstrap=function(e){return{add:n.createAdd(e),clear:i.createClear(e),list:o.createList(e),reset:a.createReset(e),rm:s.createRm(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("bootstrap/add",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Peers,t.abrupt("return",{Peers:s.map((function(e){return new l.Multiaddr(e)}))}) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createAdd=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==s[0]?s[0]:{},t.next=3,e.post("bootstrap/rm",{signal:r.signal,searchParams:c.toUrlSearchParams(i(i({},r),{},{all:!0})),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return o=t.sent,a=o.Peers,t.abrupt("return",{Peers:a.map((function(e){return new l.Multiaddr(e)}))}) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createClear=f},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=r(19),u=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,o,u=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t.next=3,e.post("bootstrap/list",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,o=i.Peers,t.abrupt("return",{Peers:o.map((function(e){return new s.Multiaddr(e)}))}) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createList=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==s[0]?s[0]:{},t.next=3,e.post("bootstrap/add",{signal:r.signal,searchParams:c.toUrlSearchParams(i(i({},r),{},{default:!0})),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return o=t.sent,a=o.Peers,t.abrupt("return",{Peers:a.map((function(e){return new l.Multiaddr(e)}))}) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createReset=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("bootstrap/rm",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Peers,t.abrupt("return",{Peers:s.map((function(e){return new l.Multiaddr(e)}))}) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createRm=f},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(335),i=r(338),o=r(339),a=r(340),s=r(341) t.createConfig=function(e){return{getAll:o.createGetAll(e),get:i.createGet(e),set:s.createSet(e),replace:a.createReplace(e),profiles:n.createProfiles(e)}}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(336),i=r(337) t.createProfiles=function(e){return{apply:n.createApply(e),list:i.createList(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("config/profile/apply",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",{original:a.OldCfg,updated:a.NewCfg}) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createApply=l},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(15),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,a=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t.next=3,e.post("config/profile/list",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,t.abrupt("return",i.map((function(e){return o.objectToCamel(e)}))) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createList=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},r){t.next=3 break}throw new Error("key argument is required") case 3:return t.next=5,e.post("config",{signal:n.signal,searchParams:u.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 5:return o=t.sent,t.next=8,o.json() case 8:return a=t.sent,t.abrupt("return",a.Value) case 10:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}) return function(e){return r.apply(this,arguments)}}()})) t.createGet=c},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==a[0]?a[0]:{},t.next=3,e.post("config/show",{signal:r.signal,searchParams:u.toUrlSearchParams(i({},r)),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return o=t.sent,t.abrupt("return",o) case 8:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}) return function(){return r.apply(this,arguments)}}()})) t.createGetAll=c},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==h[1]?h[1]:{},o=new AbortController,a=f.abortSignal(o.signal,n.signal),t.t0=e,t.t1=i,t.t2={signal:a,searchParams:l.toUrlSearchParams(n)},t.next=8,u.multipartRequest([s.fromString(JSON.stringify(r))],o,n.headers) case 8:return t.t3=t.sent,t.t4=(0,t.t1)(t.t2,t.t3),t.next=12,t.t0.post.call(t.t0,"config/replace",t.t4) case 12:return c=t.sent,t.next=15,c.text() case 15:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}) return function(e){return r.apply(this,arguments)}}()})) t.createReplace=h},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t2&&void 0!==u[2]?u[2]:{},"string"==typeof r){t.next=3 break}throw new Error("Invalid key type") case 3:return a=o(o({},i),f(r,n)),t.next=6,e.post("config",{signal:i.signal,searchParams:c.toUrlSearchParams(a),headers:i.headers}) case 6:return s=t.sent,t.next=9,s.text() case 9:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))}) return function(e,t){return r.apply(this,arguments)}}()})),f=function(e,t){switch(n(t)){case"boolean":return{arg:[e,t.toString()],bool:!0} case"string":return{arg:[e,t]} default:return{arg:[e,JSON.stringify(t)],json:!0}}} t.createSet=l},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(343),i=r(344),o=r(347),a=r(150),s=r(348) t.createDag=function(e,t){return{export:n.createExport(t),get:i.createGet(e,t),import:o.createImport(t),put:a.createPut(e,t),resolve:s.createResolve(t)}}},function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(4),f=r(5),h=l.configure((function(e){function t(){return(t=n(regeneratorRuntime.mark((function t(r){var n,i,a=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},t.next=3,o(e.post("dag/export",{signal:n.signal,searchParams:f.toUrlSearchParams({arg:r.toString()}),headers:n.headers})) case 3:return i=t.sent,t.delegateYield(c(s(i.iterator()),o),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createExport=h},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(345),s=r(346),u=r(76),c=r(20),l=r(144) function f(e){return e&&"object"===i(e)&&"default"in e?e:{default:e}}var h=f(s),d=f(u),p=f(c) t.createGet=function(e,t){return o.configure((function(t,r){var i=l.createGet(r) return function(){var t=function(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}(regeneratorRuntime.mark((function t(r){var n,o,s,u,c,l,f=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=f.length>1&&void 0!==f[1]?f[1]:{}).path){t.next=16 break}if(!n.localResolve){t.next=8 break}return t.next=5,h.default(a.resolve(r,n.path,e,i,n)) case 5:t.t0=t.sent,t.next=11 break case 8:return t.next=10,d.default(a.resolve(r,n.path,e,i,n)) case 10:t.t0=t.sent case 11:if(o=t.t0,s=o){t.next=15 break}throw p.default(new Error("Not found"),"ERR_NOT_FOUND") case 15:return t.abrupt("return",s) case 16:return t.next=18,e.getCodec(r.code) case 18:return u=t.sent,t.next=21,i(r,n) case 21:return c=t.sent,l=u.decode(c),t.abrupt("return",{value:l,remainderPath:""}) case 24:case"end":return t.stop()}}),t)}))) return function(e){return t.apply(this,arguments)}}()}))(t)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return new c(e)}function s(e){return function(){return new u(e.apply(this,arguments))}}function u(e){var t,r function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof c Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function c(e){this.wrapped=e}u.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},u.prototype.next=function(e){return this._invoke("next",e)},u.prototype.throw=function(e){return this._invoke("throw",e)},u.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(7) var f=function(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}(r(20)) function h(){return(h=s(regeneratorRuntime.mark((function e(t,r,n,o,s){var u,c,h,d,p,m return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=function(){var e=i(regeneratorRuntime.mark((function e(t){var r,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getCodec(t.code) case 2:return r=e.sent,e.next=5,o(t,s) case 5:return i=e.sent,e.abrupt("return",r.decode(i)) case 7:case"end":return e.stop()}}),e)}))) return function(t){return e.apply(this,arguments)}}(),c=r.split("/").filter(Boolean),e.next=4,a(u(t)) case 4:h=e.sent,d=t case 6:if(!c.length){e.next=25 break}if(p=c.shift()){e.next=10 break}throw f.default(new Error('Could not resolve path "'.concat(r,'"')),"ERR_INVALID_PATH") case 10:if(!Object.prototype.hasOwnProperty.call(h,p)){e.next=16 break}return h=h[p],e.next=14,{value:h,remainderPath:c.join("/")} case 14:e.next=17 break case 16:throw f.default(new Error('no link named "'.concat(p,'" under ').concat(d)),"ERR_NO_LINK") case 17:if(!(m=l.CID.asCID(h))){e.next=23 break}return d=m,e.next=22,a(u(h)) case 22:h=e.sent case 23:e.next=6 break case 25:return e.next=27,{value:h,remainderPath:""} case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.resolve=function(e,t,r,n,i){return h.apply(this,arguments)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new o(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function o(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(o=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new o(e)}var a=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,o,a,s,u return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,n=!1,e.prev=2,a=i(t) case 4:return e.next=6,a.next() case 6:if(!(r=!(s=e.sent).done)){e.next=12 break}return u=s.value,e.abrupt("return",u) case 9:r=!1,e.next=4 break case 12:e.next=18 break case 14:e.prev=14,e.t0=e.catch(2),n=!0,o=e.t0 case 18:if(e.prev=18,e.prev=19,!r||null==a.return){e.next=23 break}return e.next=23,a.return() case 23:if(e.prev=23,!n){e.next=26 break}throw o case 26:return e.finish(23) case 27:return e.finish(18) case 28:return e.abrupt("return",void 0) case 29:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})),function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(e){return t.apply(this,arguments)}}() e.exports=a},function(e,t,r){"use strict" function n(e){return new a(e)}function i(e){return function(){return new o(e.apply(this,arguments))}}function o(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var c=r(4),l=r(5),f=r(31),h=r(30),d=r(7),p=c.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(r){var i,o,a,u,c,p,m,v,y,b,g,w,_,k,x,O=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=O.length>1&&void 0!==O[1]?O[1]:{},o=new AbortController,a=f.abortSignal(o.signal,i.signal),t.next=5,n(h.multipartRequest(r,o,i.headers)) case 5:return u=t.sent,c=u.headers,p=u.body,t.next=10,n(e.post("dag/import",{signal:a,headers:c,body:p,searchParams:l.toUrlSearchParams({"pin-roots":i.pinRoots})})) case 10:m=t.sent,v=!1,y=!1,t.prev=13,g=s(m.ndjson()) case 15:return t.next=17,n(g.next()) case 17:if(!(v=!(w=t.sent).done)){t.next=26 break}if(void 0===(_=w.value.Root)){t.next=23 break}return k=_.Cid["/"],x=_.PinErrorMsg,t.next=23,{root:{cid:d.CID.parse(k),pinErrorMsg:x}} case 23:v=!1,t.next=15 break case 26:t.next=32 break case 28:t.prev=28,t.t0=t.catch(13),y=!0,b=t.t0 case 32:if(t.prev=32,t.prev=33,!v||null==g.return){t.next=37 break}return t.next=37,n(g.return()) case 37:if(t.prev=37,!y){t.next=40 break}throw b case 40:return t.finish(37) case 41:return t.finish(32) case 42:case"end":return t.stop()}}),t,null,[[13,28,32,42],[33,,37,41]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createImport=p},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("dag/resolve",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:"".concat(r).concat(n.path?"/".concat(n.path).replace(/\/[/]+/g,"/"):"")},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",{cid:s.CID.parse(a.Cid["/"]),remainderPath:a.RemPath}) case 8:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}) return function(e){return r.apply(this,arguments)}}()})) t.createResolve=l},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(350),i=r(352),o=r(353),a=r(354),s=r(355),u=r(356) t.createDht=function(e){return{findPeer:n.createFindPeer(e),findProvs:i.createFindProvs(e),get:o.createGet(e),provide:a.createProvide(e),put:s.createPut(e),query:u.createQuery(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==v[1]?v[1]:{},t.next=3,a(e.post("dht/findpeer",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:r},n)),headers:n.headers})) case 3:o=t.sent,s=!1,u=!1,t.prev=6,f=l(o.ndjson()) case 8:return t.next=10,a(f.next()) case 10:if(!(s=!(h=t.sent).done)){t.next=17 break}return m=h.value,t.next=14,p.mapEvent(m) case 14:s=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),u=!0,c=t.t0 case 23:if(t.prev=23,t.prev=24,!s||null==f.return){t.next=28 break}return t.next=28,a(f.return()) case 28:if(t.prev=28,!u){t.next=31 break}throw c case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createFindPeer=m},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}),t.AddingPeer=6,t.DialingPeer=7,t.FinalPeer=2,t.PeerResponse=1,t.Provider=4,t.QueryError=3,t.SendingQuery=0,t.Value=5},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==v[1]?v[1]:{},t.next=3,a(e.post("dht/findprovs",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers})) case 3:o=t.sent,s=!1,u=!1,t.prev=6,f=l(o.ndjson()) case 8:return t.next=10,a(f.next()) case 10:if(!(s=!(h=t.sent).done)){t.next=17 break}return m=h.value,t.next=14,p.mapEvent(m) case 14:s=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),u=!0,c=t.t0 case 23:if(t.prev=23,t.prev=24,!s||null==f.return){t.next=28 break}return t.next=28,a(f.return()) case 28:if(t.prev=28,!u){t.next=31 break}throw c case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createFindProvs=m},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==y[1]?y[1]:{},t.next=3,a(e.post("dht/get",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:r instanceof Uint8Array?m.toString(r):r.toString()},n)),headers:n.headers})) case 3:o=t.sent,s=!1,u=!1,t.prev=6,f=l(o.ndjson()) case 8:return t.next=10,a(f.next()) case 10:if(!(s=!(h=t.sent).done)){t.next=17 break}return v=h.value,t.next=14,p.mapEvent(v) case 14:s=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),u=!0,c=t.t0 case 23:if(t.prev=23,t.prev=24,!s||null==f.return){t.next=28 break}return t.next=28,a(f.return()) case 28:if(t.prev=28,!u){t.next=31 break}throw c case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createGet=v},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==y[1]?y[1]:{recursive:!1},o=Array.isArray(r)?r:[r],t.next=4,a(e.post("dht/provide",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:o.map((function(e){return e.toString()}))},n)),headers:n.headers})) case 4:s=t.sent,u=!1,c=!1,t.prev=7,h=l(s.ndjson()) case 9:return t.next=11,a(h.next()) case 11:if(!(u=!(m=t.sent).done)){t.next=18 break}return v=m.value,t.next=15,p.mapEvent(v) case 15:u=!1,t.next=9 break case 18:t.next=24 break case 20:t.prev=20,t.t0=t.catch(7),c=!0,f=t.t0 case 24:if(t.prev=24,t.prev=25,!u||null==h.return){t.next=29 break}return t.next=29,a(h.return()) case 29:if(t.prev=29,!c){t.next=32 break}throw f case 32:return t.finish(29) case 33:return t.finish(24) case 34:case"end":return t.stop()}}),t,null,[[7,20,24,34],[25,,29,33]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createProvide=m},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==k[2]?k[2]:{},s=new AbortController,u=m.abortSignal(s.signal,o.signal),t.t0=a,t.t1=e,t.t2=i,t.t3={signal:u,searchParams:d.toUrlSearchParams(i({arg:r instanceof Uint8Array?v.toString(r):r.toString()},o))},t.next=9,a(p.multipartRequest([n],s,o.headers)) case 9:return t.t4=t.sent,t.t5=(0,t.t2)(t.t3,t.t4),t.t6=t.t1.post.call(t.t1,"dht/put",t.t5),t.next=14,(0,t.t0)(t.t6) case 14:c=t.sent,f=!1,h=!1,t.prev=17,g=l(c.ndjson()) case 19:return t.next=21,a(g.next()) case 21:if(!(f=!(w=t.sent).done)){t.next=28 break}return _=w.value,t.next=25,y.mapEvent(_) case 25:f=!1,t.next=19 break case 28:t.next=34 break case 30:t.prev=30,t.t7=t.catch(17),h=!0,b=t.t7 case 34:if(t.prev=34,t.prev=35,!f||null==g.return){t.next=39 break}return t.next=39,a(g.return()) case 39:if(t.prev=39,!h){t.next=42 break}throw b case 42:return t.finish(39) case 43:return t.finish(34) case 44:case"end":return t.stop()}}),t,null,[[17,30,34,44],[35,,39,43]])})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createPut=b},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==v[1]?v[1]:{},t.next=3,a(e.post("dht/query",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers})) case 3:o=t.sent,s=!1,u=!1,t.prev=6,f=l(o.ndjson()) case 8:return t.next=10,a(f.next()) case 10:if(!(s=!(h=t.sent).done)){t.next=17 break}return m=h.value,t.next=14,p.mapEvent(m) case 14:s=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),u=!0,c=t.t0 case 23:if(t.prev=23,t.prev=24,!s||null==f.return){t.next=28 break}return t.next=28,a(f.return()) case 28:if(t.prev=28,!u){t.next=31 break}throw c case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createQuery=m},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(358),i=r(359),o=r(360) t.createDiag=function(e){return{cmds:n.createCmds(e),net:i.createNet(e),sys:o.createSys(e)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("diag/cmds",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.abrupt("return",n.json()) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createCmds=s},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("diag/net",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.abrupt("return",n.json()) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createNet=s},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("diag/sys",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.abrupt("return",n.json()) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createSys=s},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(362),i=r(363),o=r(364),a=r(365),s=r(366),u=r(367),c=r(368),l=r(370),f=r(152),h=r(371),d=r(372) t.createFiles=function(e){return{chmod:n.createChmod(e),cp:i.createCp(e),flush:o.createFlush(e),ls:a.createLs(e),mkdir:s.createMkdir(e),mv:u.createMv(e),read:c.createRead(e),rm:l.createRm(e),stat:f.createStat(e),touch:h.createTouch(e),write:d.createWrite(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==s[2]?s[2]:{},t.next=3,e.post("files/chmod",{signal:o.signal,searchParams:c.toUrlSearchParams(i({arg:r,mode:n},o)),headers:o.headers}) case 3:return a=t.sent,t.next=6,a.text() case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createChmod=l},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==c[2]?c[2]:{},a=Array.isArray(r)?r:[r],t.next=4,e.post("files/cp",{signal:o.signal,searchParams:l.toUrlSearchParams(i({arg:a.concat(n).map((function(e){return u.CID.asCID(e)?"/ipfs/".concat(e):e}))},o)),headers:o.headers}) case 4:return s=t.sent,t.next=7,s.text() case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createCp=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},r&&"string"==typeof r){t.next=3 break}throw new Error("ipfs.files.flush requires a path") case 3:return t.next=5,e.post("files/flush",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 5:return o=t.sent,t.next=8,o.json() case 8:return a=t.sent,t.abrupt("return",u.CID.parse(a.Cid)) case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createFlush=f},function(e,t,r){"use strict" function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"] if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r) var n=0,o=function(){} return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1&&void 0!==k[1]?k[1]:{},r){t.next=3 break}throw new Error("ipfs.files.ls requires a path") case 3:return t.next=5,u(e.post("files/ls",{signal:i.signal,searchParams:y.toUrlSearchParams(a(a({arg:p.CID.asCID(r)?"/ipfs/".concat(r):r,long:!0},i),{},{stream:!0})),headers:i.headers})) case 5:o=t.sent,s=!1,c=!1,t.prev=8,f=h(o.ndjson()) case 10:return t.next=12,u(f.next()) case 12:if(!(s=!(d=t.sent).done)){t.next=39 break}if(!("Entries"in(v=d.value))){t.next=34 break}b=n(v.Entries||[]),t.prev=16,b.s() case 18:if((w=b.n()).done){t.next=24 break}return _=w.value,t.next=22,g(m.objectToCamelWithMetadata(_)) case 22:t.next=18 break case 24:t.next=29 break case 26:t.prev=26,t.t0=t.catch(16),b.e(t.t0) case 29:return t.prev=29,b.f(),t.finish(29) case 32:t.next=36 break case 34:return t.next=36,g(m.objectToCamelWithMetadata(v)) case 36:s=!1,t.next=10 break case 39:t.next=45 break case 41:t.prev=41,t.t1=t.catch(8),c=!0,l=t.t1 case 45:if(t.prev=45,t.prev=46,!s||null==f.return){t.next=50 break}return t.next=50,u(f.return()) case 50:if(t.prev=50,!c){t.next=53 break}throw l case 53:return t.finish(50) case 54:return t.finish(45) case 55:case"end":return t.stop()}}),t,null,[[8,41,45,55],[16,26,29,32],[46,,50,54]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) function g(e){return e.hash&&(e.cid=p.CID.parse(e.hash)),delete e.hash,e.type=1===e.type?"directory":"file",e}t.createLs=b},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("files/mkdir",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.text() case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createMkdir=l},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==s[2]?s[2]:{},Array.isArray(r)||(r=[r]),t.next=4,e.post("files/mv",{signal:o.signal,searchParams:c.toUrlSearchParams(i({arg:r.concat(n)},o)),headers:o.headers}) case 4:return a=t.sent,t.next=7,a.text() case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createMv=l},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,c(e.post("files/read",{signal:n.signal,searchParams:m.toUrlSearchParams(i({arg:r,count:n.length},n)),headers:n.headers})) case 3:return o=t.sent,t.delegateYield(d(f(v.default(o.body)),c),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createRead=y},function(e,t,r){function n(e){return new o(e)}function i(e){var t,r function n(t,r){try{var a=e[t](r),s=a.value,u=s instanceof o Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(a.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){this.wrapped=e}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=function(e){if(e[Symbol.asyncIterator])return e if(e.getReader)return(t=regeneratorRuntime.mark((function t(){var r,i,o,a return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.getReader(),t.prev=1 case 2:return t.next=5,n(r.read()) case 5:if(i=t.sent,o=i.done,a=i.value,!o){t.next=10 break}return t.abrupt("return") case 10:return t.next=12,a case 12:t.next=2 break case 14:return t.prev=14,r.releaseLock(),t.finish(14) case 17:case"end":return t.stop()}}),t,null,[[1,,14,17]])})),function(){return new i(t.apply(this,arguments))})() var t throw new Error("unknown stream")}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("files/rm",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.text() case 6:if(""===(a=t.sent)){t.next=11 break}throw(s=new f.default.HTTPError(o)).message=a,s case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createRm=h},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("files/touch",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.text() case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createTouch=l},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==p[2]?p[2]:{},a=new AbortController,s=d.abortSignal(a.signal,o.signal),t.t0=e,t.t1=i,t.t2={signal:s,searchParams:h.toUrlSearchParams(i({arg:r,streamChannels:!0,count:o.length},o))},t.next=8,f.multipartRequest([{content:n,path:"arg",mode:u.modeToString(o.mode),mtime:c.parseMtime(o.mtime)}],a,o.headers) case 8:return t.t3=t.sent,t.t4=(0,t.t1)(t.t2,t.t3),t.next=12,t.t0.post.call(t.t0,"files/write",t.t4) case 12:return l=t.sent,t.next=15,l.text() case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createWrite=p},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(374),i=r(375),o=r(376),a=r(377),s=r(378),u=r(379),c=r(380) t.createKey=function(e){return{export:n.createExport(e),gen:i.createGen(e),import:o.createImport(e),info:a.createInfo(e),list:s.createList(e),rename:u.createRename(e),rm:c.createRm(e)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4) var a=function(e){return e&&"object"===i(e)&&"default"in e?e:{default:e}}(r(20)),s=o.configure((function(e){return function(){var e,t=(e=regeneratorRuntime.mark((function e(t,r){var n=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw n.length>2&&void 0!==n[2]&&n[2],a.default(new Error("Not implemented"),"ERR_NOT_IMPLEMENTED") case 2:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(e,r){return t.apply(this,arguments)}}()})) t.createExport=s},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{type:"rsa",size:2048},t.next=3,e.post("key/gen",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",u.objectToCamel(a)) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createGen=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t3&&void 0!==f[3]?f[3]:{},t.next=3,e.post("key/import",{signal:a.signal,searchParams:l.toUrlSearchParams(i({arg:r,pem:n,password:o},a)),headers:a.headers}) case 3:return s=t.sent,t.next=6,s.json() case 6:return c=t.sent,t.abrupt("return",u.objectToCamel(c)) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r,n){return t.apply(this,arguments)}})) t.createImport=f},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4) var a=function(e){return e&&"object"===i(e)&&"default"in e?e:{default:e}}(r(20)),s=o.configure((function(e){return function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw r.length>1&&void 0!==r[1]&&r[1],a.default(new Error("Not implemented"),"ERR_NOT_IMPLEMENTED") case 2:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(e){return t.apply(this,arguments)}}()})) t.createInfo=s},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(15),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,a=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t.next=3,e.post("key/list",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,t.abrupt("return",(i.Keys||[]).map((function(e){return o.objectToCamel(e)}))) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createList=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==s[2]?s[2]:{},t.next=3,e.post("key/rename",{signal:o.signal,searchParams:l.toUrlSearchParams(i({arg:[r,n]},o)),headers:o.headers}) case 3:return a=t.sent,t.t0=u,t.next=7,a.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createRename=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("key/rm",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",u.objectToCamel(a.Keys[0])) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createRm=f},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(382),i=r(383),o=r(384) t.createLog=function(e){return{level:n.createLevel(e),ls:i.createLs(e),tail:o.createTail(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==s[2]?s[2]:{},t.next=3,e.post("log/level",{signal:o.signal,searchParams:l.toUrlSearchParams(i({arg:[r,n]},o)),headers:o.headers}) case 3:return a=t.sent,t.t0=u,t.next=7,a.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createLevel=f},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,o=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,e.post("log/ls",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,t.abrupt("return",i.Strings) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createLs=s},function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(4),f=r(5),h=l.configure((function(e){function t(){return(t=n(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,o(e.post("log/tail",{signal:r.signal,searchParams:f.toUrlSearchParams(r),headers:r.headers})) case 3:return n=t.sent,t.delegateYield(c(s(n.ndjson()),o),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createTail=h},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(386),i=r(387),o=r(388) t.createName=function(e){return{publish:n.createPublish(e),resolve:i.createResolve(e),pubsub:o.createPubsub(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("name/publish",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:"".concat(r)},n)),headers:n.headers}) case 3:return o=t.sent,t.t0=u,t.next=7,o.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createPublish=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==m[1]?m[1]:{},t.next=3,a(e.post("name/resolve",{signal:n.signal,searchParams:d.toUrlSearchParams(i({arg:r,stream:!0},n)),headers:n.headers})) case 3:o=t.sent,s=!1,u=!1,t.prev=6,f=l(o.ndjson()) case 8:return t.next=10,a(f.next()) case 10:if(!(s=!(h=t.sent).done)){t.next=17 break}return p=h.value,t.next=14,p.Path case 14:s=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),u=!0,c=t.t0 case 23:if(t.prev=23,t.prev=24,!s||null==f.return){t.next=28 break}return t.next=28,a(f.return()) case 28:if(t.prev=28,!u){t.next=31 break}throw c case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createResolve=p},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(389),i=r(390),o=r(391) t.createPubsub=function(e){return{cancel:n.createCancel(e),state:i.createState(e),subs:o.createSubs(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,e.post("name/pubsub/cancel",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.t0=u,t.next=7,o.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createCancel=f},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(15),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("name/pubsub/state",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.t0=o,t.next=7,n.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createState=u},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,o=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,e.post("name/pubsub/subs",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,t.abrupt("return",i.Strings||[]) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createSubs=s},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(393),i=r(394),o=r(395),a=r(396),s=r(397),u=r(398),c=r(399) t.createObject=function(e,t){return{data:n.createData(t),get:i.createGet(t),links:o.createLinks(t),new:a.createNew(t),put:s.createPut(e,t),stat:u.createStat(t),patch:c.createPatch(t)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("object/data",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:"".concat(r instanceof Uint8Array?u.CID.decode(r):r)},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.arrayBuffer() case 6:return a=t.sent,t.abrupt("return",new Uint8Array(a,0,a.byteLength)) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createData=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("object/get",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:"".concat(r instanceof Uint8Array?u.CID.decode(r):r),dataEncoding:"base64"},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",{Data:f.fromString(a.Data,"base64pad"),Links:(a.Links||[]).map((function(e){return{Name:e.Name,Hash:u.CID.parse(e.Hash),Tsize:e.Size}}))}) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createGet=h},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("object/links",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:"".concat(r instanceof Uint8Array?u.CID.decode(r):r)},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",(a.Links||[]).map((function(e){return{Name:e.Name,Tsize:e.Size,Hash:u.CID.parse(e.Hash)}}))) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createLinks=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==s[0]?s[0]:{},t.next=3,e.post("object/new",{signal:r.signal,searchParams:l.toUrlSearchParams(i({arg:r.template},r)),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return o=t.sent,a=o.Hash,t.abrupt("return",u.CID.parse(a)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createNew=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==o[1]?o[1]:{},e.abrupt("return",n(t,i(i({},r),{},{storeCodec:"dag-pb",hashAlg:"sha2-256",version:1}))) case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(e){return o.apply(this,arguments)}}))(t)}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("object/stat",{signal:n.signal,searchParams:l.toUrlSearchParams(i({arg:"".concat(r)},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",i(i({},a),{},{Hash:u.CID.parse(a.Hash)})) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createStat=f},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(400),i=r(401),o=r(402),a=r(403) t.createPatch=function(e){return{addLink:n.createAddLink(e),appendData:i.createAppendData(e),rmLink:o.createRmLink(e),setData:a.createSetData(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==f[2]?f[2]:{},t.next=3,e.post("object/patch/add-link",{signal:o.signal,searchParams:l.toUrlSearchParams(i({arg:["".concat(r),n.Name||n.name||"",(n.Hash||n.cid||"").toString()||null]},o)),headers:o.headers}) case 3:return a=t.sent,t.next=6,a.json() case 6:return s=t.sent,c=s.Hash,t.abrupt("return",u.CID.parse(c)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createAddLink=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==m[2]?m[2]:{},a=new AbortController,s=h.abortSignal(a.signal,o.signal),t.t0=e,t.t1=i,t.t2={signal:s,searchParams:f.toUrlSearchParams(i({arg:"".concat(r)},o))},t.next=8,c.multipartRequest([n],a,o.headers) case 8:return t.t3=t.sent,t.t4=(0,t.t1)(t.t2,t.t3),t.next=12,t.t0.post.call(t.t0,"object/patch/append-data",t.t4) case 12:return l=t.sent,t.next=15,l.json() case 15:return d=t.sent,p=d.Hash,t.abrupt("return",u.CID.parse(p)) case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createAppendData=d},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==f[2]?f[2]:{},t.next=3,e.post("object/patch/rm-link",{signal:o.signal,searchParams:l.toUrlSearchParams(i({arg:["".concat(r),n.Name||n.name||null]},o)),headers:o.headers}) case 3:return a=t.sent,t.next=6,a.json() case 6:return s=t.sent,c=s.Hash,t.abrupt("return",u.CID.parse(c)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createRmLink=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==m[2]?m[2]:{},a=new AbortController,s=h.abortSignal(a.signal,o.signal),t.t0=e,t.t1=i,t.t2={signal:s,searchParams:f.toUrlSearchParams(i({arg:["".concat(r)]},o))},t.next=8,c.multipartRequest([n],a,o.headers) case 8:return t.t3=t.sent,t.t4=(0,t.t1)(t.t2,t.t3),t.next=12,t.t0.post.call(t.t0,"object/patch/set-data",t.t4) case 12:return l=t.sent,t.next=15,l.json() case 15:return d=t.sent,p=d.Hash,t.abrupt("return",u.CID.parse(p)) case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createSetData=d},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(153),i=r(405),o=r(406),a=r(155),s=r(407),u=r(408) t.createPin=function(e){return{addAll:n.createAddAll(e),add:i.createAdd(e),ls:o.createLs(e),rmAll:a.createRmAll(e),rm:s.createRm(e),remote:u.createRemote(e)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==o[1]?o[1]:{},e.abrupt("return",h.default(t([i({path:r},n)],n))) case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(t){return e.apply(this,arguments)}}))(e)}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==g[0]?g[0]:{},n=[],r.paths&&(n=Array.isArray(r.paths)?r.paths:[r.paths]),t.next=5,a(e.post("pin/ls",{signal:r.signal,searchParams:p.toUrlSearchParams(i(i({},r),{},{arg:n.map((function(e){return"".concat(e)})),stream:!0})),headers:r.headers})) case 5:o=t.sent,s=!1,u=!1,t.prev=8,f=l(o.ndjson()) case 10:return t.next=12,a(f.next()) case 12:if(!(s=!(h=t.sent).done)){t.next=29 break}if(!(d=h.value).Keys){t.next=24 break}v=0,y=Object.keys(d.Keys) case 16:if(!(v1&&void 0!==o[1]?o[1]:{},e.abrupt("return",h.default(t([i({path:r},n)],n))) case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(t){return e.apply(this,arguments)}}))(e)}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(95),i=r(409),o=r(410),a=r(411),s=r(412),u=r(413) t.createRemote=function(e){var t=new n.Client(e) return{add:i.createAdd(t),ls:o.createLs(t),rm:a.createRm(t),rmAll:s.createRmAll(t),service:u.createService(e)}}},function(e,t,r){"use strict" var n=["timeout","signal","headers"] function i(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]) return i}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function c(e){return function(){var t=this,r=arguments return new Promise((function(n,i){var o=e.apply(t,r) function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var l=r(77) t.createAdd=function(e){function t(){return(t=c(regeneratorRuntime.mark((function t(r,i){var a,u,c,f,h return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.timeout,u=i.signal,c=i.headers,f=s(i,n),t.next=3,e.post("pin/remote/add",{timeout:a,signal:u,headers:c,searchParams:l.encodeAddParams(o({cid:r},f))}) case 3:return h=t.sent,t.t0=l,t.next=7,h.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.decodePin.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}}},function(e,t,r){"use strict" var n=["timeout","signal","headers"] function i(e,t){if(null==e)return{} var r,n,i=function(e,t){if(null==e)return{} var r,n,i={},o=Object.keys(e) for(n=0;n=0||(i[r]=e[r]) return i}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(e){return new u(e)}function a(e){return function(){return new s(e.apply(this,arguments))}}function s(e){var t,r function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof u Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function u(e){this.wrapped=e}function c(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new l(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function l(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(l=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new l(e)}s.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(e){return this._invoke("next",e)},s.prototype.throw=function(e){return this._invoke("throw",e)},s.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var f=r(77) t.createLs=function(e){function t(){return(t=a(regeneratorRuntime.mark((function t(r){var a,s,u,l,h,d,p,m,v,y,b return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=r.timeout,s=r.signal,u=r.headers,l=i(r,n),t.next=3,o(e.post("pin/remote/ls",{timeout:a,signal:s,headers:u,searchParams:f.encodeQuery(l)})) case 3:h=t.sent,d=!1,p=!1,t.prev=6,v=c(h.ndjson()) case 8:return t.next=10,o(v.next()) case 10:if(!(d=!(y=t.sent).done)){t.next=17 break}return b=y.value,t.next=14,f.decodePin(b) case 14:d=!1,t.next=8 break case 17:t.next=23 break case 19:t.prev=19,t.t0=t.catch(6),p=!0,m=t.t0 case 23:if(t.prev=23,t.prev=24,!d||null==v.return){t.next=28 break}return t.next=28,o(v.return()) case 28:if(t.prev=28,!p){t.next=31 break}throw m case 31:return t.finish(28) case 32:return t.finish(23) case 33:case"end":return t.stop()}}),t,null,[[6,19,23,33],[24,,28,32]])})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}}},function(e,t,r){"use strict" var n=["timeout","signal","headers"] function i(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]) return i}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function c(e){return function(){var t=this,r=arguments return new Promise((function(n,i){var o=e.apply(t,r) function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var l=r(77) t.createRm=function(e){function t(){return(t=c(regeneratorRuntime.mark((function t(r){var i,a,u,c return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.timeout,a=r.signal,u=r.headers,c=s(r,n),t.next=3,e.post("pin/remote/rm",{timeout:i,signal:a,headers:u,searchParams:l.encodeQuery(o(o({},c),{},{all:!1}))}) case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}}},function(e,t,r){"use strict" var n=["timeout","signal","headers"] function i(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]) return i}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function c(e){return function(){var t=this,r=arguments return new Promise((function(n,i){var o=e.apply(t,r) function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var l=r(77) t.createRmAll=function(e){function t(){return(t=c(regeneratorRuntime.mark((function t(r){var i,a,u,c return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.timeout,a=r.signal,u=r.headers,c=s(r,n),t.next=3,e.post("pin/remote/rm",{timeout:i,signal:a,headers:u,searchParams:l.encodeQuery(o(o({},c),{},{all:!0}))}) case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(95),i=r(414),o=r(415),a=r(416) t.createService=function(e){var t=new n.Client(e) return{add:i.createAdd(t),ls:o.createLs(t),rm:a.createRm(t)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(5),a=r(156) t.createAdd=function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(r,n){var i,s,u,c,l return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.endpoint,s=n.key,u=n.headers,c=n.timeout,l=n.signal,t.next=3,e.post("pin/remote/service/add",{timeout:c,signal:l,searchParams:o.toUrlSearchParams({arg:[r,a.encodeEndpoint(i),s]}),headers:u}) case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(5),a=r(156) t.createLs=function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,s,u,c,l,f,h=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},n=r.stat,i=r.headers,s=r.timeout,u=r.signal,t.next=4,e.post("pin/remote/service/ls",{timeout:s,signal:u,headers:i,searchParams:!0===n?o.toUrlSearchParams({stat:n}):void 0}) case 4:return c=t.sent,t.next=7,c.json() case 7:return l=t.sent,f=l.RemoteServices,t.abrupt("return",f.map(a.decodeRemoteService)) case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(5) t.createRm=function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(r){var n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,e.post("pin/remote/service/rm",{signal:n.signal,headers:n.headers,searchParams:o.toUrlSearchParams({arg:r})}) case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(418),i=r(419),o=r(420),a=r(421),s=r(422),u=r(423) t.createPubsub=function(e){var t=new u.SubscriptionTracker return{ls:n.createLs(e),peers:i.createPeers(e),publish:o.createPublish(e),subscribe:a.createSubscribe(e,t),unsubscribe:s.createUnsubscribe(e,t)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=r(78),u=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,o=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,e.post("pubsub/ls",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return t.next=5,t.sent.json() case 5:return n=t.sent,i=n.Strings,t.abrupt("return",s.rpcArrayToTextArray(i)||[]) case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createLs=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("pubsub/peers",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:l.textToUrlSafeRpc(r)},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Strings,t.abrupt("return",s||[]) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createPeers=f},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==p[2]?p[2]:{},a=c.toUrlSearchParams(i({arg:h.textToUrlSafeRpc(r)},o)),s=new AbortController,u=f.abortSignal(s.signal,o.signal),t.t0=e,t.t1=i,t.t2={signal:u,searchParams:a},t.next=9,l.multipartRequest([n],s,o.headers) case 9:return t.t3=t.sent,t.t4=(0,t.t1)(t.t2,t.t3),t.next=13,t.t0.post.call(t.t0,"pubsub/pub",t.t4) case 13:return d=t.sent,t.next=16,d.text() case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e,r){return t.apply(this,arguments)}})) t.createPublish=d},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t2&&void 0!==f[2]?f[2]:{}).signal=t.subscribe(n,o,a.signal),c=new Promise((function(e,t){s=e,u=t})),l=setTimeout((function(){return s()}),1e3),e.post("pubsub/sub",{signal:a.signal,searchParams:d.toUrlSearchParams(i({arg:p.textToUrlSafeRpc(n)},a)),headers:a.headers}).catch((function(e){t.unsubscribe(n,o),u(e)})).then((function(e){clearTimeout(l),e&&(v(e,{onMessage:o,onEnd:function(){return t.unsubscribe(n,o)},onError:a.onError}),s())})),r.abrupt("return",c) case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(e,t){return r.apply(this,arguments)}}))(e)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.createUnsubscribe=function(e,t){function r(){return(r=i(regeneratorRuntime.mark((function e(r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.unsubscribe(r,n) case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(e,t){return r.apply(this,arguments)}}},function(e,t,r){"use strict" function n(e,t){for(var r=0;r1&&void 0!==u[1]?u[1]:{},o=Array.isArray(r)?r:[r],t.next=4,s(e.post("refs",{signal:n.signal,searchParams:m.toUrlSearchParams(i({arg:o.map((function(e){return"".concat(e instanceof Uint8Array?h.CID.decode(e):e)}))},n)),headers:n.headers,transform:d.objectToCamel})) case 4:return a=t.sent,t.delegateYield(f(c(a.ndjson()),s),"t0",6) case 6:case"end":return t.stop()}}),t)})),function(){return new a(t.apply(this,arguments))}) return function(e){return r.apply(this,arguments)}}() return Object.assign(r,{local:v.createLocal(t)})})) t.createRefs=y},function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(15),f=r(4),h=r(5),d=f.configure((function(e){function t(){return(t=n(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,o(e.post("refs/local",{signal:r.signal,transform:l.objectToCamel,searchParams:h.toUrlSearchParams(r),headers:r.headers})) case 3:return n=t.sent,t.delegateYield(c(s(n.ndjson()),o),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createLocal=d},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(427),i=r(157),o=r(428) t.createRepo=function(e){return{gc:n.createGc(e),stat:i.createStat(e),version:o.createVersion(e)}}},function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(7),f=r(4),h=r(5),d=f.configure((function(e){function t(){return(t=n(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,o(e.post("repo/gc",{signal:r.signal,searchParams:h.toUrlSearchParams(r),headers:r.headers,transform:function(e){return{err:e.Error?new Error(e.Error):null,cid:(e.Key||{})["/"]?l.CID.parse(e.Key["/"]):null}}})) case 3:return n=t.sent,t.delegateYield(c(s(n.ndjson()),o),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createGc=d},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("repo/version",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return t.next=5,t.sent.json() case 5:return n=t.sent,t.abrupt("return",n.Version) case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createVersion=s},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(143),i=r(157),o=r(430) t.createStats=function(e){return{bitswap:n.createStat(e),repo:i.createStat(e),bw:o.createBw(e)}}},function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(4),f=r(5),h=l.configure((function(e){function t(){return(t=n(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,o(e.post("stats/bw",{signal:r.signal,searchParams:f.toUrlSearchParams(r),headers:r.headers,transform:function(e){return{totalIn:BigInt(e.TotalIn),totalOut:BigInt(e.TotalOut),rateIn:parseFloat(e.RateIn),rateOut:parseFloat(e.RateOut)}}})) case 3:return n=t.sent,t.delegateYield(c(s(n.ndjson()),o),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createBw=h},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(432),i=r(433),o=r(434),a=r(435),s=r(436) t.createSwarm=function(e){return{addrs:n.createAddrs(e),connect:i.createConnect(e),disconnect:o.createDisconnect(e),localAddrs:a.createLocalAddrs(e),peers:s.createPeers(e)}}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(19),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,a,u=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t.next=3,e.post("swarm/addrs",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,a=i.Addrs,t.abrupt("return",Object.keys(a).map((function(e){return{id:e,addrs:(a[e]||[]).map((function(e){return new o.Multiaddr(e)}))}}))) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createAddrs=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("swarm/connect",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Strings,t.abrupt("return",s||[]) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createConnect=l},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("swarm/disconnect",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Strings,t.abrupt("return",s||[]) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createDisconnect=l},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(19),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,a,u=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t.next=3,e.post("swarm/addrs/local",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,a=i.Strings,t.abrupt("return",(a||[]).map((function(e){return new o.Multiaddr(e)}))) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createLocalAddrs=u},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(19),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i,a,u=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t.next=3,e.post("swarm/peers",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.json() case 6:return i=t.sent,a=i.Peers,t.abrupt("return",(a||[]).map((function(e){return{addr:new o.Multiaddr(e.Addr),peer:e.Peer,muxer:e.Muxer,latency:e.Latency,streams:e.Streams,direction:null==e.Direction?void 0:0===e.Direction?"inbound":"outbound"}}))) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createPeers=u},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var a=r(158),s=r(76),u=r(4),c=r(438) var l=function(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}(s) t.createAdd=function(e){var t=a.createAddAll(e) return u.configure((function(){function e(){return(e=i(regeneratorRuntime.mark((function e(r){var n,i=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,l.default(t(c.normaliseInput(r),n)) case 3:return e.abrupt("return",e.sent) case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(t){return e.apply(this,arguments)}}))(e)}},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(439),i=r(441) t.normaliseInput=function(e){return i.normaliseCandidateSingle(e,n.normaliseContent)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(){return new s(e.apply(this,arguments))}}function s(e){var t,r function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof u Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function u(e){this.wrapped=e}s.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(e){return this._invoke("next",e)},s.prototype.throw=function(e){return this._invoke("throw",e)},s.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var c=r(20),l=r(42),f=r(64),h=r(440),d=r(74),p=r(145),m=r(146),v=r(75) function y(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}var b=y(c),g=y(f),w=y(h),_=y(d),k=y(p),x=y(m) function O(e){return E.apply(this,arguments)}function E(){return(E=a(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(){return(S=i(regeneratorRuntime.mark((function e(t){var r,n,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!v.isBytes(t)){e.next=2 break}return e.abrupt("return",O(P(t))) case 2:if(!("string"==typeof t||t instanceof String)){e.next=4 break}return e.abrupt("return",O(P(t.toString()))) case 4:if(!v.isBlob(t)){e.next=6 break}return e.abrupt("return",w.default(t)) case 6:if(v.isReadableStream(t)&&(t=g.default(t)),!(Symbol.iterator in t)&&!(Symbol.asyncIterator in t)){e.next=27 break}return r=_.default(t),e.next=11,r.peek() case 11:if(n=e.sent,i=n.value,!n.done){e.next=16 break}return e.abrupt("return",O(new Uint8Array(0))) case 16:if(r.push(i),!Number.isInteger(i)){e.next=25 break}return e.t0=O,e.t1=Uint8Array,e.next=22,k.default(r) case 22:return e.t2=e.sent,e.t3=e.t1.from.call(e.t1,e.t2),e.abrupt("return",(0,e.t0)(e.t3)) case 25:if(!(v.isBytes(i)||"string"==typeof i||i instanceof String)){e.next=27 break}return e.abrupt("return",x.default(r,P)) case 27:throw b.default(new Error("Unexpected input: ".concat(t)),"ERR_UNEXPECTED_INPUT") case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Array.isArray(e)?Uint8Array.from(e):l.fromString(e.toString())}t.normaliseContent=function(e){return S.apply(this,arguments)}},function(e,t,r){"use strict" var n=r(64) e.exports=function(e){return"function"==typeof e.stream?n(e.stream()):n(new Response(e).body)}},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return new c(e)}function s(e){return function(){return new u(e.apply(this,arguments))}}function u(e){var t,r function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof c Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function c(e){this.wrapped=e}u.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},u.prototype.next=function(e){return this._invoke("next",e)},u.prototype.throw=function(e){return this._invoke("throw",e)},u.prototype.return=function(e){return this._invoke("return",e)},Object.defineProperty(t,"__esModule",{value:!0}) var l=r(20),f=r(64),h=r(74),d=r(75),p=r(147) function m(e){return e&&"object"===o(e)&&"default"in e?e:{default:e}}var v=m(l),y=m(f),b=m(h) function g(){return(g=s(regeneratorRuntime.mark((function e(t,r){var n,i,s return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2 break}throw v.default(new Error("Unexpected input: ".concat(t)),"ERR_UNEXPECTED_INPUT") case 2:if(!("string"==typeof t||t instanceof String)){e.next=6 break}return e.next=5,w(t.toString(),r) case 5:return e.abrupt("return") case 6:if(!d.isBytes(t)&&!d.isBlob(t)){e.next=10 break}return e.next=9,w(t,r) case 9:return e.abrupt("return") case 10:if(d.isReadableStream(t)&&(t=y.default(t)),!(Symbol.iterator in t)&&!(Symbol.asyncIterator in t)){e.next=28 break}return n=b.default(t),e.next=15,a(n.peek()) case 15:if(i=e.sent,s=i.value,!i.done){e.next=22 break}return e.next=21,{content:[]} case 21:return e.abrupt("return") case 22:if(n.push(s),!(Number.isInteger(s)||d.isBytes(s)||"string"==typeof s||s instanceof String)){e.next=27 break}return e.next=26,w(n,r) case 26:return e.abrupt("return") case 27:throw v.default(new Error("Unexpected input: multiple items passed - if you are using ipfs.add, please use ipfs.addAll instead"),"ERR_UNEXPECTED_INPUT") case 28:if(!d.isFileObject(t)){e.next=32 break}return e.next=31,w(t,r) case 31:return e.abrupt("return") case 32:throw v.default(new Error('Unexpected input: cannot convert "'+o(t)+'" into ImportCandidate'),"ERR_UNEXPECTED_INPUT") case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e,t){return _.apply(this,arguments)}function _(){return(_=i(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.path,i=t.mode,o=t.mtime,a=t.content,s={path:n||"",mode:p.parseMode(i),mtime:p.parseMtime(o)},!a){e.next=8 break}return e.next=5,r(a) case 5:s.content=e.sent,e.next=12 break case 8:if(n){e.next=12 break}return e.next=11,r(t) case 11:s.content=e.sent case 12:return e.abrupt("return",s) case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.normaliseCandidateSingle=function(e,t){return g.apply(this,arguments)}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,u(e.post("cat",{signal:n.signal,searchParams:p.toUrlSearchParams(i({arg:r.toString()},n)),headers:n.headers})) case 3:return o=t.sent,t.delegateYield(h(l(o.iterator()),u),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createCat=m},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}Object.defineProperty(t,"__esModule",{value:!0}) var i=r(4),o=r(5),a=i.configure((function(e){return function(){var t,r=(t=regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("commands",{signal:r.signal,searchParams:o.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.abrupt("return",n.json()) case 5:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(i,o){var a=t.apply(e,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(){return r.apply(this,arguments)}}()})) t.createCommands=a},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},t.next=3,e.post("dns",{signal:n.signal,searchParams:u.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,t.abrupt("return",a.Path) case 8:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments return new Promise((function(n,i){var o=t.apply(e,r) function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}) return function(e){return r.apply(this,arguments)}}()})) t.createDns=c},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(4).configure((function(e){return function(){var t=new URL(e.opts.base||"") return{host:t.hostname,port:t.port,protocol:t.protocol,pathname:t.pathname,"api-path":t.pathname}}})) t.createGetEndpointConfig=n},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==s[1]?s[1]:{},(o=i({arg:"".concat(r instanceof Uint8Array?d.CID.decode(r):r)},n)).compressionLevel&&(o["compression-level"]=o.compressionLevel,delete o.compressionLevel),t.next=5,u(e.post("get",{signal:n.signal,searchParams:m.toUrlSearchParams(o),headers:n.headers})) case 5:return a=t.sent,t.delegateYield(h(l(a.iterator()),u),"t0",7) case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createGet=v},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(159) t.createIsOnline=function(e){var t=o.createId(e) function r(){return(r=i(regeneratorRuntime.mark((function e(){var r,n,i=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},e.next=3,t(r) case 3:return n=e.sent,e.abrupt("return",Boolean(n&&n.addresses&&n.addresses.length)) case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return function(){return r.apply(this,arguments)}}},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==E[1]?E[1]:{},a="".concat(n instanceof Uint8Array?m.CID.decode(n):n),r.next=6,l(e.post("ls",{signal:o.signal,searchParams:y.toUrlSearchParams(i({arg:a},o)),headers:o.headers})) case 6:f=r.sent,p=!1,v=!1,r.prev=9,_=d(f.ndjson()) case 11:return r.next=13,l(_.next()) case 13:if(!(p=!(k=r.sent).done)){r.next=32 break}if(x=(x=k.value).Objects){r.next=18 break}throw new Error("expected .Objects in results") case 18:if(x=x[0]){r.next=21 break}throw new Error("expected one array in results.Objects") case 21:if(O=x.Links,Array.isArray(O)){r.next=24 break}throw new Error("expected one array in results.Objects[0].Links") case 24:if(O.length){r.next=28 break}return r.next=27,u(x) case 27:return r.abrupt("return") case 28:return r.delegateYield(h(d(O.map(u)),l),"t0",29) case 29:p=!1,r.next=11 break case 32:r.next=38 break case 34:r.prev=34,r.t1=r.catch(9),v=!0,g=r.t1 case 38:if(r.prev=38,r.prev=39,!p||null==_.return){r.next=43 break}return r.next=43,l(_.return()) case 43:if(r.prev=43,!v){r.next=46 break}throw g case 46:return r.finish(43) case 47:return r.finish(38) case 48:case"end":return r.stop()}}),r,null,[[9,34,38,48],[39,,43,47]])})))).apply(this,arguments)}return function(e){return r.apply(this,arguments)}})) function w(e){switch(e.Type){case 1:case 5:return"dir" case 2:default:return"file"}}t.createLs=g},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(15),a=r(4),s=r(5),u=a.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("dns",{signal:r.signal,searchParams:s.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.t0=o,t.next=7,n.json() case 7:return t.t1=t.sent,t.abrupt("return",t.t0.objectToCamel.call(t.t0,t.t1)) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createMount=u},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},t.next=3,u(e.post("ping",{signal:n.signal,searchParams:m.toUrlSearchParams(i({arg:"".concat(r)},n)),headers:n.headers,transform:d.objectToCamel})) case 3:return o=t.sent,t.delegateYield(h(l(o.ndjson()),u),"t0",5) case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createPing=v},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==u[1]?u[1]:{},t.next=3,e.post("resolve",{signal:n.signal,searchParams:c.toUrlSearchParams(i({arg:r},n)),headers:n.headers}) case 3:return o=t.sent,t.next=6,o.json() case 6:return a=t.sent,s=a.Path,t.abrupt("return",s) case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(e){return t.apply(this,arguments)}})) t.createResolve=l},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4) var a=function(e){return e&&"object"===i(e)&&"default"in e?e:{default:e}}(r(20)),s=o.configure((function(e){return function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t=arguments return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw t.length>0&&void 0!==t[0]&&t[0],a.default(new Error("Not implemented"),"ERR_NOT_IMPLEMENTED") case 2:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}) return function(){return t.apply(this,arguments)}}()})) t.createStart=s},function(e,t,r){"use strict" function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments return new Promise((function(i,o){var a=e.apply(t,r) function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}) var o=r(4),a=r(5),s=o.configure((function(e){function t(){return(t=i(regeneratorRuntime.mark((function t(){var r,n,i=arguments return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.next=3,e.post("shutdown",{signal:r.signal,searchParams:a.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.next=6,n.text() case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createStop=s},function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==o[0]?o[0]:{},t.next=3,e.post("version",{signal:r.signal,searchParams:l.toUrlSearchParams(r),headers:r.headers}) case 3:return n=t.sent,t.t0=i,t.t1=i,t.t2={},t.t3=u,t.next=10,n.json() case 10:return t.t4=t.sent,t.t5=t.t3.objectToCamel.call(t.t3,t.t4),t.t6=(0,t.t1)(t.t2,t.t5),t.t7={},t.t8={"ipfs-http-client":"1.0.0"},t.abrupt("return",(0,t.t0)(t.t6,t.t7,t.t8)) case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){return t.apply(this,arguments)}})) t.createVersion=f},,function(e,t,r){"use strict" function n(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r function n(t,r){try{var o=e[t](r),s=o.value,u=s instanceof a Promise.resolve(u?s.wrapped:s).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0}) break case"throw":t.reject(i) break default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null} r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function o(e){return new a(e)}function a(e){this.wrapped=e}function s(e){var t,r,n,i=2 for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e) if(n&&null!=(t=e[n]))return new u(t.call(e)) r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function u(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object.")) var t=e.done return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(u=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new u(e)}function c(e,t){var r={},n=!1 function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)} var l=r(99) function f(e,t){return h.apply(this,arguments)}function h(){return(h=n(regeneratorRuntime.mark((function e(t,r){var n,i return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new l,e.next=3,o(n.get(t,r)) case 3:return i=e.sent,e.delegateYield(c(s(i.iterator()),o),"t0",5) case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e.exports=function(e,t){return{path:decodeURIComponent(new URL(e).pathname.split("/").pop()||""),content:f(e,t)}}},function(e,t,r){"use strict" var n=r(458),i=r(463),o=r(467).names,a=r(40).toString,s=r(42).fromString,u=r(98).concat,c={} for(var l in o){var f=l c[o[f]]=f}function h(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array") if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.") var t=i.decode(e) if(!m(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16))) e=e.slice(i.decode.bytes) var r=i.decode(e) if(r<0)throw new Error("multihash invalid length: ".concat(r)) if((e=e.slice(i.decode.bytes)).length!==r)throw new Error("multihash length inconsistent: 0x".concat(a(e,"base16"))) return{code:t,name:c[t],length:r,digest:e}}function d(e){var t=e if("string"==typeof e){if(void 0===o[e])throw new Error("Unrecognized hash function named: ".concat(e)) t=o[e]}if("number"!=typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t)) if(void 0===c[t]&&!p(t))throw new Error("Unrecognized function code: ".concat(t)) return t}function p(e){return e>0&&e<16}function m(e){return!!p(e)||!!c[e]}function v(e){h(e)}Object.freeze(c),e.exports={names:o,codes:c,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array") return a(e,"base16")},fromHexString:function(e){return s(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array") return a(n.encode("base58btc",e)).slice(1)},fromB58String:function(e){var t=e instanceof Uint8Array?a(e):e return n.decode("z"+t)},decode:h,encode:function(e,t,r){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code") var n=d(t) if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array") if(null==r&&(r=e.length),r&&e.length!==r)throw new Error("digest length should be equal to specified length.") var o=i.encode(n),a=i.encode(r) return u([o,a,e],o.length+a.length+e.length)},coerceCode:d,isAppCode:p,validate:v,prefix:function(e){return v(e),e.subarray(0,2)},isValidCode:m}},function(e,t,r){"use strict" var n=r(459),i=r(100),o=i.encodeText,a=i.decodeText,s=i.concat function u(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e] if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e] throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array") var r=u(e),n=r.name,i=r.codeBuf return function(e,t){u(e).decode(a(t))}(n,t),s([i,t],i.length+t.length)}).encode=function(e,t){var r=u(e),n=o(r.encode(t)) return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=a(e)) var t=e[0] return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=a(e)),"[object String]"!==Object.prototype.toString.call(e))return!1 try{return u(e[0]).name}catch(e){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=a(e)),u(e[0])} var c=Object.freeze(n.names),l=Object.freeze(n.codes) t.names=c,t.codes=l},function(e,t,r){"use strict" var n=r(460),i=r(461),o=r(462).rfc4648,a=r(100),s=a.decodeText,u=a.encodeText,c=[["identity","\0",function(){return{encode:s,decode:u}},""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce((function(e,t){return e[t[0]]=new i(t[0],t[1],t[2],t[3]),e}),{}),f=c.reduce((function(e,t){return e[t[1]]=l[t[0]],e}),{}) e.exports={names:l,codes:f}},function(e,t,r){"use strict" e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long") for(var t=new Uint8Array(256),r=0;r>>0,c=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)] if(255===l)return for(var f=0,h=o-1;(0!==l||f>>0,c[h]=l%256>>>0,l=l/256>>>0 if(0!==l)throw new Error("Non-zero carry") i=f,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===c[d];)d++ for(var p=new Uint8Array(n+(o-d)),m=n;d!==o;)p[m++]=c[d++] return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array") if(0===t.length)return"" for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++ for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var f=t[i],h=0,d=u-1;(0!==f||h>>0,l[d]=f%a>>>0,f=f/a>>>0 if(0!==f)throw new Error("Non-zero carry") n=h,i++}for(var p=u-n;p!==u&&0===l[p];)p++ for(var m=s.repeat(r);p=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);rr;)o+=t[i&s>>(a-=r)] if(a&&(o+=t[i&s<=8&&(s-=8,a[c++]=255&u>>s)}if(s>=r||255&u<<8-s)throw new SyntaxError("Unexpected end of data") return a}(r,t,e)}}}}}},function(e,t,r){e.exports={encode:r(464),decode:r(465),encodingLength:r(466)}},function(e,t){e.exports=function e(t,n,i){n=n||[] for(var o=i=i||0;t>=r;)n[i++]=255&t|128,t/=128 for(;-128&t;)n[i++]=255&t|128,t>>>=7 return n[i]=0|t,e.bytes=i-o+1,n} var r=Math.pow(2,31)},function(e,t){e.exports=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint") n=t[a++],i+=o<28?(127&n)<=128) return e.bytes=a-r,i}},function(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),u=Math.pow(2,49),c=Math.pow(2,56),l=Math.pow(2,63) e.exports=function(e){return ethis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize) for(var t=e.length;tthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize) for(var t=e.length;t=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function v(e){var t=d[e.name],r={} r.promise=new a((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function y(e){var t=d[e.name].deferredOperations.pop() if(t)return t.resolve(),t.promise}function b(e,t){var r=d[e.name].deferredOperations.pop() if(r)return r.reject(t),r.promise}function g(e,t){return new a((function(r,n){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db) v(e),e.db.close()}var o=[e.name] t&&o.push(e.version) var a=i.open.apply(i,o) t&&(a.onupgradeneeded=function(t){var r=a.result try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore("local-forage-detect-blob-support")}catch(r){if("ConstraintError"!==r.name)throw r console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result t.onversionchange=function(e){e.target.close()},r(t),y(e)}}))}function w(e){return g(e,!1)}function _(e){return g(e,!0)}function k(e,t){if(!e.db)return!0 var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1 o>e.version&&(e.version=o)}return!0}return!1}function x(e){return o([function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_(e)})).then((function(){return function(e){v(e) for(var t=d[e.name],r=t.forages,n=0;n>4,l[u++]=(15&n)<<4|i>>2,l[u++]=(3&i)<<6|63&o return c}function I(e){var t,r=new Uint8Array(e),n="" for(t=0;t>2],n+=M[(3&r[t])<<4|r[t+1]>>4],n+=M[(15&r[t+1])<<2|r[t+2]>>6],n+=M[63&r[t+2]] return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var N={serialize:function(e,t){var r="" if(e&&(r=T.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===T.call(e.buffer))){var n,i="__lfsc__:" e instanceof ArrayBuffer?(n=e,i+="arbf"):(n=e.buffer,"[object Int8Array]"===r?i+="si08":"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+I(n))}else if("[object Blob]"===r){var o=new FileReader o.onload=function(){var r="~~local_forage_type~"+e.type+"~"+I(this.result) t("__lfsc__:blob"+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,j))return JSON.parse(e) var t,r=e.substring(R),n=e.substring(j,R) if("blob"===n&&A.test(r)){var i=r.match(A) t=i[1],r=r.substring(i[0].length)}var a=C(r) switch(n){case"arbf":return a case"blob":return o([a],{type:t}) case"si08":return new Int8Array(a) case"ui08":return new Uint8Array(a) case"uic8":return new Uint8ClampedArray(a) case"si16":return new Int16Array(a) case"ur16":return new Uint16Array(a) case"si32":return new Int32Array(a) case"ui32":return new Uint32Array(a) case"fl32":return new Float32Array(a) case"fl64":return new Float64Array(a) default:throw new Error("Unkown type: "+n)}},stringToBuffer:C,bufferToString:I} function D(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function B(e,t,r,n,i,o){e.executeSql(r,n,i,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):D(e,t,(function(){e.executeSql(r,n,i,o)}),o)}),o):o(e,a)}),o)}function L(e,t,r,n){var i=this e=l(e) var o=new a((function(o,a){i.ready().then((function(){void 0===t&&(t=null) var s=t,u=i._dbInfo u.serializer.serialize(t,(function(t,c){c?a(c):u.db.transaction((function(r){B(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void o(L.apply(i,[e,s,r,n-1])) a(t)}}))}))})).catch(a)})) return u(o,r),o}function F(e){return new a((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],o=0;o0?(this._dbInfo=t,t.serializer=N,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,o=localStorage.length,a=1,s=0;s=0;r--){var n=localStorage.key(r) 0===n.indexOf(e)&&localStorage.removeItem(n)}})) return u(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length})) return u(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t})) return u(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i=0;t--){var r=localStorage.key(t) 0===r.indexOf(e)&&localStorage.removeItem(r)}})):a.reject("Invalid arguments"),t),n}},H=function(e,t){for(var r,n,i=e.length,o=0;o=0&&(o=r.type.substring(a)) var s=e(t,r.components) Array.isArray(s)&&t?i.push("tuple("+s.join(",")+")"+o):t?i.push("("+s+")"):i.push("("+s.join(",")+")"+o)}else i.push(r.type)})),i},l=function(e){if(!o.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.") var t="",r=0,n=e.length for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n] return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,stripHexPrefix:o.stripHexPrefix,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:l,toAscii:l,asciiToHex:f,fromAscii:f,unitMap:i.unitMap,toWei:function(e,t){if(t=h(t),!o.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.") return o.isBN(e)?i.toWei(e,t):i.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=h(t),!o.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.") return o.isBN(e)?i.fromWei(e,t):i.fromWei(e,t).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0 if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1 if("genesis"==t||"earliest"==t)return 1 if("latest"==e)return"pending"==t?-1:1 if("latest"===t)return"pending"==e?1:-1 if("pending"==e)return 1 if("pending"==t)return-1 var r=new u(e),n=new u(t) return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:o.toNumber}},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(484),o=r(166),a=new i(0),s=new i(-1),u={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"} function c(e){var t=e?e.toLowerCase():"ether",r=u[t] if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(u,null,2)) return new i(r,10)}function l(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).") return e}if("number"==typeof e)return String(e) if("object"===n(e)&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10) throw new Error("while converting number to string, invalid number value '"+e+"' type "+n(e)+".")}e.exports={unitMap:u,numberToString:l,getValueOfUnit:c,fromWei:function(e,t,r){var n=o(e),i=n.lt(a),l=c(t),f=u[t].length-1||1,h=r||{} i&&(n=n.mul(s)) for(var d=n.mod(l).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points") var h=f[0],d=f[1] if(h||(h="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places") for(;d.length=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===r?this._parseHex(e,o):this._parseBase(e,r,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this this.length=Math.ceil(e.length/3),this.words=new Array(this.length) for(var n=0;n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var r=0;r=t;r-=6)i=u(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++) r+6!==t&&(i=u(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""} var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function d(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e] r="" var p=this.clone() for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e) r=(p=p.idivn(d)).isZero()?m+r:l[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip() var a,s,u="le"===t,c=new e(o),l=this.clone() if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function m(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},v.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this.strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863) for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e return r},a.prototype.idivn=function(e){i(e<=67108863) for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this.strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new x(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var y={k256:null,p224:null,p192:null,p25519:null} function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}b.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):r.strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},o(g,b),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e] var t if("k256"===e)t=new g else if("p224"===e)t=new w else if("p192"===e)t=new _ else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new k}return y[e]=t,t},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new O(e)},o(O,x),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict" function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t var r=function(){} r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s "object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26 try{s=r(10).Buffer}catch(e){}function u(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===r?this._parseHex(e,o):this._parseBase(e,r,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this this.length=Math.ceil(e.length/3),this.words=new Array(this.length) for(var n=0;n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var r=0;r=t;r-=6)i=u(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++) r+6!==t&&(i=u(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""} var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function d(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e] r="" var p=this.clone() for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e) r=(p=p.idivn(d)).isZero()?m+r:l[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip() var a,s,u="le"===t,c=new e(o),l=this.clone() if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function m(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},v.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this.strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863) for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e return r},a.prototype.idivn=function(e){i(e<=67108863) for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this.strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new x(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var y={k256:null,p224:null,p192:null,p25519:null} function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}b.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):r.strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},o(g,b),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e] var t if("k256"===e)t=new g else if("p224"===e)t=new w else if("p192"===e)t=new _ else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new k}return y[e]=t,t},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new O(e)},o(O,x),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},function(e,t,r){var n=r(487) e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+r(e)+", while checking isHexPrefixed.") return"0x"===e.slice(0,2)}},function(e,t,r){!function(e){var t,r,n,i=String.fromCharCode function o(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return i(e>>t&63|128)}function u(e){if(0==(4294967168&e))return i(e) var t="" return 0==(4294965248&e)?t=i(e>>6&31|192):0==(4294901760&e)?(a(e),t=i(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index") var e=255&t[n] if(n++,128==(192&e))return 63&e throw Error("Invalid continuation byte")}function l(){var e,i if(n>r)throw Error("Invalid byte index") if(n==r)return!1 if(e=255&t[n],n++,0==(128&e))return e if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return a(i),i throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t) return o}(s)}}(t)},function(e,t,r){"use strict" var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)} Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,i(r(168),t),i(r(169),t),i(r(565),t),i(r(104),t),i(r(566),t),i(r(44),t),i(r(567),t),i(r(38),t),i(r(110),t) var o=r(50) Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict" function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t var r=function(){} r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s "object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26 try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(491).Buffer}catch(e){}function u(e,t){var r=e.charCodeAt(t) return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function c(e,t,r){var n=u(e,r) return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,n){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&a0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this._strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(e){a.prototype.inspect=h}else a.prototype.inspect=h function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function v(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=m[e] r="" var f=this.clone() for(f.negative=0;!f.isZero();){var h=f.modrn(l).toString(e) r=(f=f.idivn(l)).isZero()?h+r:d[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){this._strip() var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0") var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o) return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0 return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(y=v),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?y(this,e,t):r<63?v(this,e,t):r<1024?b(this,e,t):g(this,e,t)},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},w.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this._strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0 t&&(e=-e),i(e<=67108863) for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e return t?-n:n},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0 t&&(e=-e),i(e<=67108863) for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r this.words[n]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this._strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new P(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var _={k256:null,p224:null,p192:null,p25519:null} function k(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}k.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},o(x,k),x.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(_[e])return _[e] var t if("k256"===e)t=new x else if("p224"===e)t=new O else if("p192"===e)t=new E else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new S}return _[e]=t,t},P.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},P.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new M(e)},o(M,P),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},,function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0 var i=n(r(493)) function o(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros") return parseInt(e,t)}function a(t,r){if(t<56)return e.from([t+r]) var n=u(t),i=u(r+55+n.length/2) return e.from(i+n,"hex")}function s(e){return"0x"===e.slice(0,2)}function u(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!") var t=e.toString(16) return t.length%2?"0"+t:t}function c(t){if(!e.isBuffer(t)){if("string"==typeof t)return s(t)?e.from((n="string"!=typeof(o=t)?o:s(o)?o.slice(2):o).length%2?"0"+n:n,"hex"):e.from(t) if("number"==typeof t||"bigint"==typeof t)return t?(r=u(t),e.from(r,"hex")):e.from([]) if(null==t)return e.from([]) if(t instanceof Uint8Array)return e.from(t) if(i.default.isBN(t))return e.from(t.toArray()) throw new Error("invalid type")}var r,n,o return t}t.encode=function t(r){if(Array.isArray(r)){for(var n=[],i=0;ir.length)throw new Error("invalid rlp: total length is larger than the data") if(0===(s=r.slice(i,f)).length)throw new Error("invalid rlp, List has a invalid length") for(;s.length;)u=t(s),c.push(u.data),s=u.remainder return{data:c,remainder:r.slice(f)}}(c(t)) if(r)return n if(0!==n.remainder.length)throw new Error("invalid remainder") return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]) var r=c(t),n=r[0] if(n<=127)return r.length if(n<=183)return n-127 if(n<=191)return n-182 if(n<=247)return n-191 var i=n-246 return i+o(r.slice(1,i).toString("hex"),16)}}).call(this,r(10).Buffer)},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict" function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t var r=function(){} r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s "object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26 try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(494).Buffer}catch(e){}function u(e,t){var r=e.charCodeAt(t) return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function c(e,t,r){var n=u(e,r) return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,n){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&a0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n) if("object"===t(e))return this._initArray(e,r,n) "hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36) var o=0 "-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++) return this._strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length) for(var n=0;n=t;n-=2)i=c(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8 this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1 for(var n=0,i=1;i<=67108863;i*=t)n++ n--,i=i/t|0 for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length-- return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(e){a.prototype.inspect=h}else a.prototype.inspect=h function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176] function v(e,t,r){r.negative=t.negative^e.negative var n=e.length+t.length|0 r.length=n,n=n-1|0 var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0 r.words[0]=s for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0 l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}a.prototype.toString=function(e,t){var r if(t=0|t||1,16===(e=e||10)||"hex"===e){r="" for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=m[e] r="" var f=this.clone() for(f.negative=0;!f.isZero();){var h=f.modrn(l).toString(e) r=(f=f.idivn(l)).isZero()?h+r:d[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0] return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){this._strip() var n=this.byteLength(),o=r||Math.max(1,n) i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0") var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o) return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0 return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26 var t=e,r=0 return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e) return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0 for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t t=this.length>e.length?e:this for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r this.length>e.length?(t=this,r=e):(t=e,r=this) for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0) var t=0|Math.ceil(e/26),r=e%26 this._expand(t),r>0&&t-- for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0) var r=e/26|0,n=e%26 return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this) for(var i=0,o=0;o>>26 for(;0!==i&&o>>26 if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++ else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0 var t=this.iadd(e) return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign() var r,n,i=this.cmp(e) if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this i>0?(r=this,n=e):(r=e,n=this) for(var o=0,a=0;a>26,this.words[a]=67108863&t for(;0!==o&&a>26,this.words[a]=67108863&t if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],y=8191&v,b=v>>>13,g=0|a[3],w=8191&g,_=g>>>13,k=0|a[4],x=8191&k,O=k>>>13,E=0|a[5],S=8191&E,P=E>>>13,M=0|a[6],A=8191&M,j=M>>>13,R=0|a[7],T=8191&R,C=R>>>13,I=0|a[8],N=8191&I,D=I>>>13,B=0|a[9],L=8191&B,F=B>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,K=G>>>13,J=0|s[3],$=8191&J,Z=J>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13 r.negative=e.negative^t.negative,r.length=19 var ve=(c+(n=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0 c=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q) var ye=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0 c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,q))+Math.imul(b,z)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0 var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,Y)|0))<<13)|0 c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,K)|0 var ge=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,$)|0))<<13)|0 c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0 var we=(c+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,X)|0))<<13)|0 c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,q))+Math.imul(P,z)|0,o=Math.imul(P,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0 var _e=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0 c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(j,z)|0,o=Math.imul(j,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0 var ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0 c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0 var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0 c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0 var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0 c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,z),i=(i=Math.imul(L,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0 var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0 c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0 var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0 c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,K))+Math.imul(F,Y)|0,o=Math.imul(F,K),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0 var Pe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0 c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0 var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0 c=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(F,X)|0,o=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0 var Ae=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(O,pe)|0))<<13)|0 c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0 var je=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(P,pe)|0))<<13)|0 c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0 var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(j,pe)|0))<<13)|0 c=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0 var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(C,pe)|0))<<13)|0 c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(F,fe)|0,o=Math.imul(F,he) var Ce=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(D,pe)|0))<<13)|0 c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863 var Ie=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(F,pe)|0))<<13)|0 return c=((o=Math.imul(F,me))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=ve,u[1]=ye,u[2]=be,u[3]=ge,u[4]=we,u[5]=_e,u[6]=ke,u[7]=xe,u[8]=Oe,u[9]=Ee,u[10]=Se,u[11]=Pe,u[12]=Me,u[13]=Ae,u[14]=je,u[15]=Re,u[16]=Te,u[17]=Ce,u[18]=Ie,0!==c&&(u[19]=c,r.length++),r} function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(y=v),a.prototype.mulTo=function(e,t){var r=this.length+e.length return 10===this.length&&10===e.length?y(this,e,t):r<63?v(this,e,t):r<1024?b(this,e,t):g(this,e,t)},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1 return n},w.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++ return 1<>>=13,r[2*a+1]=8191&o,o>>>=13 for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e) if(0===t.length)return new a(1) for(var r=this,n=0;n=0) var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r if(0!==r){var a=0 for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t] for(t=0;t=0),n=t?(t-t%26)/26:0 var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=n);c--){var f=0|this.words[c] this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0) var t=e%26,r=(e-t)/26,n=1<=0) var t=e%26,r=(e-t)/26 if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++ return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e) if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1 else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o if(0===s)return this._strip() for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1] 0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]) var s,u=n.length-i.length if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length) for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]) for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1) s&&(s.words[f]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t) var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e) if(t.mod.isZero())return t.div var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n) return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0 t&&(e=-e),i(e<=67108863) for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e return t?-n:n},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0 t&&(e=-e),i(e<=67108863) for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r this.words[n]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1) for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1) t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero()) var t=this,r=e.clone() t=0!==t.negative?t.umod(e):t.clone() for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1) for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1) t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs() if(e.isZero())return this.abs() var t=this.clone(),r=e.clone() t.negative=0,r.negative=0 for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1) for(;;){for(;t.isEven();)t.iushrn(1) for(;r.isEven();)r.iushrn(1) var i=t.cmp(r) if(i<0){var o=t t=r,r=o}else if(0===i||0===r.cmpn(1))break t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e) var t=e%26,r=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0 if(0!==this.negative&&!r)return-1 if(0===this.negative&&r)return 1 if(this._strip(),this.length>1)t=1 else{r&&(e=-e),i(e<=67108863,"Number is too big") var n=0|this.words[0] t=n===e?0:ne.length)return 1 if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r] if(n!==i){ni&&(t=1) break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new P(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)} var _={k256:null,p224:null,p192:null,p25519:null} function k(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=a._prime(e) this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}k.prototype._tmp=function(){var e=new a(null) return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,r=e do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n) var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},o(x,k),x.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2 for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(_[e])return _[e] var t if("k256"===e)t=new x else if("p224"===e)t=new O else if("p192"===e)t=new E else{if("p25519"!==e)throw new Error("Unknown prime "+e) t=new S}return _[e]=t,t},P.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t) var r=e.add(t) return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t) var r=e.iadd(t) return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t) var r=e.sub(t) return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t) var r=e.isub(t) return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone() var t=this.m.andln(3) if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2) return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1) i(!n.isZero()) var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength() for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u) for(var f=this.pow(l,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr() i(v=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1 i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},P.prototype.convertTo=function(e){var t=e.umod(this.m) return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone() return t.red=null,t},a.mont=function(e){return new M(e)},o(M,P),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv)) return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this) var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(28)(e))},,function(e,t,r){"use strict" ;/* object-assign (c) Sindre Sorhus @license MIT */var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined") return Object(e)}e.exports=function(){try{if(!Object.assign)return!1 var e=new String("abc") if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1 for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1 var n={} return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),c=1;c=i)return e switch(e){case"%s":return String(n[r++]) case"%d":return Number(n[r++]) case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,e,n.depth)}function c(e,t){var r=u.styles[t] return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function l(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e) return b(i)||(i=f(e,i,n)),i}var o=function(e,t){if(g(t))return e.stylize("undefined","undefined") if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'" return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r) if(o)return o var a=Object.keys(r),s=function(e){var t={} return e.forEach((function(e,r){t[e]=!0})),t}(a) if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r) if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"" return e.stylize("[Function"+u+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp") if(k(r))return e.stylize(Date.prototype.toString.call(r),"date") if(x(r))return h(r)}var c,l="",_=!1,E=["{","}"] return p(r)&&(_=!0,E=["[","]"]),O(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),x(r)&&(l=" "+h(r)),0!==a.length||_&&0!=r.length?n<0?w(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=_?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,E)):E[0]+l+E[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var a,s,u if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function g(e){return void 0===e}function w(e){return _(e)&&"[object RegExp]"===E(e)}function _(e){return"object"===n(e)&&null!==e}function k(e){return _(e)&&"[object Date]"===E(e)}function x(e){return _(e)&&("[object Error]"===E(e)||e instanceof Error)}function O(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(a)&&(a=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(a)){var n=e.pid s[r]=function(){var e=t.format.apply(t,arguments) console.error("%s %d: %s",r,n,e)}}else s[r]=function(){} return s[r]},t.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=b,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=g,t.isRegExp=w,t.isObject=_,t.isDate=k,t.isError=x,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(497) var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] function M(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":") return[e.getDate(),P[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",M(),t.format.apply(t,arguments))},t.inherits=r(498),t._extend=function(e,t){if(!t||!_(t))return e for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]] return e} var j="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0 function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value") r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function') if(j&&e[j]){var t if("function"!=typeof(t=e[j]))throw new TypeError('The "util.promisify.custom" argument must be of type Function') return Object.defineProperty(t,j,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1 return{s:function(){r=r.call(e)},n:function(){var e=r.next() return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:function(e){return new Uint8Array(e)},t=arguments.length>1?arguments[1]:void 0 return"function"==typeof e&&(e=e(t)),v("output",e,t),e}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=function(e){return{contextRandomize:function(t){switch(m(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&v("seed",t,32),e.contextRandomize(t)){case 1:throw new Error("Unknow error on context randomization")}},privateKeyVerify:function(t){return v("private key",t,32),0===e.privateKeyVerify(t)},privateKeyNegate:function(t){switch(v("private key",t,32),e.privateKeyNegate(t)){case 0:return t case 1:throw new Error(i)}},privateKeyTweakAdd:function(t,r){switch(v("private key",t,32),v("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t case 1:throw new Error(o)}},privateKeyTweakMul:function(t,r){switch(v("private key",t,32),v("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t case 1:throw new Error(a)}},publicKeyVerify:function(t){return v("public key",t,[33,65]),0===e.publicKeyVerify(t)},publicKeyCreate:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0 switch(v("private key",t,32),y(r),n=b(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n case 1:throw new Error(s) case 2:throw new Error(c)}},publicKeyConvert:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0 switch(v("public key",t,[33,65]),y(r),n=b(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n case 1:throw new Error(u) case 2:throw new Error(c)}},publicKeyNegate:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0 switch(v("public key",t,[33,65]),y(r),n=b(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n case 1:throw new Error(u) case 2:throw new Error(i) case 3:throw new Error(c)}},publicKeyCombine:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0 m(Array.isArray(t),"Expected public keys to be an Array"),m(t.length>0,"Expected public keys array will have more than zero items") var o,a=r(t) try{for(a.s();!(o=a.n()).done;){var s=o.value v("public key",s,[33,65])}}catch(e){a.e(e)}finally{a.f()}switch(y(n),i=b(i,n?33:65),e.publicKeyCombine(i,t)){case 0:return i case 1:throw new Error(u) case 2:throw new Error(l) case 3:throw new Error(c)}},publicKeyTweakAdd:function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0 switch(v("public key",t,[33,65]),v("tweak",r,32),y(n),i=b(i,n?33:65),e.publicKeyTweakAdd(i,t,r)){case 0:return i case 1:throw new Error(u) case 2:throw new Error(o)}},publicKeyTweakMul:function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0 switch(v("public key",t,[33,65]),v("tweak",r,32),y(n),i=b(i,n?33:65),e.publicKeyTweakMul(i,t,r)){case 0:return i case 1:throw new Error(u) case 2:throw new Error(a)}},signatureNormalize:function(t){switch(v("signature",t,64),e.signatureNormalize(t)){case 0:return t case 1:throw new Error(f)}},signatureExport:function(t,r){v("signature",t,64) var n={output:r=b(r,72),outputlen:72} switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen) case 1:throw new Error(f) case 2:throw new Error(i)}},signatureImport:function(t,r){switch(v("signature",t),r=b(r,64),e.signatureImport(r,t)){case 0:return r case 1:throw new Error(f) case 2:throw new Error(i)}},ecdsaSign:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0 v("message",t,32),v("private key",r,32),m("Object"===g(n),"Expected options to be an Object"),void 0!==n.data&&v("options.data",n.data),void 0!==n.noncefn&&m("Function"===g(n.noncefn),"Expected options.noncefn to be a Function") var a={signature:o=b(o,64),recid:null} switch(e.ecdsaSign(a,t,r,n.data,n.noncefn)){case 0:return a case 1:throw new Error(h) case 2:throw new Error(i)}},ecdsaVerify:function(t,r,n){switch(v("signature",t,64),v("message",r,32),v("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0 case 3:return!1 case 1:throw new Error(f) case 2:throw new Error(u)}},ecdsaRecover:function(t,r,n){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4?arguments[4]:void 0 switch(v("signature",t,64),m("Number"===g(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),v("message",n,32),y(o),a=b(a,o?33:65),e.ecdsaRecover(a,t,r,n)){case 0:return a case 1:throw new Error(f) case 2:throw new Error(d) case 3:throw new Error(i)}},ecdh:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0 switch(v("public key",t,[33,65]),v("private key",r,32),m("Object"===g(n),"Expected options to be an Object"),void 0!==n.data&&v("options.data",n.data),void 0!==n.hashfn?(m("Function"===g(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&v("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&v("options.ybuf",n.ybuf,32),v("output",i)):i=b(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i case 1:throw new Error(u) case 2:throw new Error(p)}}}}},function(e,t,r){var n=new(0,r(501).ec)("secp256k1"),i=n.curve,o=i.n.constructor function a(e){var t=e[0] switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new o(t) if(r.cmp(i.p)>=0)return null var a=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt() return 3===e!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(t,e.subarray(1,33)) case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var a=new o(t),s=new o(r) if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null if(a=a.toRed(i.red),s=s.toRed(i.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null var u=a.redSqr().redIMul(a) return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(t,e.subarray(1,33),e.subarray(33,65)) default:return null}}function s(e,t){for(var r=t.encode(null,33===e.length),n=0;n=0)return 1 if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1 var n=r.toArrayLike(Uint8Array,"be",32) return e.set(n),0},privateKeyTweakMul:function(e,t){var r=new o(t) if(r.cmp(i.n)>=0||r.isZero())return 1 r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n)) var n=r.toArrayLike(Uint8Array,"be",32) return e.set(n),0},publicKeyVerify:function(e){return null===a(e)?1:0},publicKeyCreate:function(e,t){var r=new o(t) return r.cmp(i.n)>=0||r.isZero()?1:(s(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert:function(e,t){var r=a(t) return null===r?1:(s(e,r.getPublic()),0)},publicKeyNegate:function(e,t){var r=a(t) if(null===r)return 1 var n=r.getPublic() return n.y=n.y.redNeg(),s(e,n),0},publicKeyCombine:function(e,t){for(var r=new Array(t.length),n=0;n=0)return 2 var u=n.getPublic().add(i.g.mul(r)) return u.isInfinity()?2:(s(e,u),0)},publicKeyTweakMul:function(e,t,r){var n=a(t) return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(s(e,n.getPublic().mul(r)),0)},signatureNormalize:function(e){var t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64)) return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport:function(e,t){var r=t.subarray(0,32),n=t.subarray(32,64) if(new o(r).cmp(i.n)>=0)return 1 if(new o(n).cmp(i.n)>=0)return 1 var a=e.output,s=a.subarray(4,37) s[0]=0,s.set(r,1) for(var u=33,c=0;u>1&&0===s[c]&&!(128&s[c+1]);--u,++c);if(128&(s=s.subarray(c))[0])return 1 if(u>1&&0===s[0]&&!(128&s[1]))return 1 var l=a.subarray(39,72) l[0]=0,l.set(n,1) for(var f=33,h=0;f>1&&0===l[h]&&!(128&l[h+1]);--f,++h);return 128&(l=l.subarray(h))[0]||f>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+u+f,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=l.length,a.set(l,6+u),0)},signatureImport:function(e,t){if(t.length<8)return 1 if(t.length>72)return 1 if(48!==t[0])return 1 if(t[1]!==t.length-2)return 1 if(2!==t[2])return 1 var r=t[3] if(0===r)return 1 if(5+r>=t.length)return 1 if(2!==t[4+r])return 1 var n=t[5+r] if(0===n)return 1 if(6+r+n!==t.length)return 1 if(128&t[4])return 1 if(r>1&&0===t[4]&&!(128&t[5]))return 1 if(128&t[r+6])return 1 if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1 var a=t.subarray(4,4+r) if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1 var s=t.subarray(6+r) if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long") var u=new o(a) u.cmp(i.n)>=0&&(u=new o(0)) var c=new o(t.subarray(6+r)) return c.cmp(i.n)>=0&&(c=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign:function(e,t,r,a,s){if(s){var u=s s=function(e){var n=u(t,r,null,a,e) if(!(n instanceof Uint8Array&&32===n.length))throw new Error("This is the way") return new o(n)}}var c,l=new o(r) if(l.cmp(i.n)>=0||l.isZero())return 1 try{c=n.sign(t,r,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),e.recid=c.recoveryParam,0},ecdsaVerify:function(e,t,r){var s={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(s.r),c=new o(s.s) if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1 if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3 var l=a(r) if(null===l)return 2 var f=l.getPublic() return n.verify(t,s,f)?0:3},ecdsaRecover:function(e,t,r,a){var u,c={r:t.slice(0,32),s:t.slice(32,64)},l=new o(c.r),f=new o(c.s) if(l.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1 if(l.isZero()||f.isZero())return 2 try{u=n.recoverPubKey(a,c,r)}catch(e){return 2}return s(e,u),0},ecdh:function(e,t,r,s,u,c,l){var f=a(t) if(null===f)return 1 var h=new o(r) if(h.cmp(i.n)>=0||h.isZero())return 2 var d=f.getPublic().mul(h) if(void 0===u)for(var p=d.encode(null,!0),m=n.hash().update(p).digest(),v=0;v<32;++v)e[v]=m[v] else{c||(c=new Uint8Array(32)) for(var y=d.getX().toArray("be",32),b=0;b<32;++b)c[b]=y[b] l||(l=new Uint8Array(32)) for(var g=d.getY().toArray("be",32),w=0;w<32;++w)l[w]=g[w] var _=u(c,l,s) if(!(_ instanceof Uint8Array&&_.length===e.length))return 2 e.set(_)}return 0}}},function(e,t,r){"use strict" var n=t n.version=r(502).version,n.utils=r(25),n.rand=r(173),n.curve=r(174),n.curves=r(102),n.ec=r(514),n.eddsa=r(518)},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","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"}}')},,function(e,t,r){"use strict" var n=r(25),i=r(6),o=r(9),a=r(79),s=n.assert function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,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}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r if(e.beta)t=new i(e.beta,16).toRed(this.red) else{var n=this._getEndoRoots(this.p) t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16) else{var o=this._getEndoRoots(this.n) 0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r) return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),p=new i(1),m=new i(0),v=new i(0),y=new i(1),b=0;0!==h.cmpn(0);){var g=d.div(h) c=d.sub(g.mul(h)),l=v.sub(g.mul(p)) var w=y.sub(g.mul(m)) if(!n&&c.cmp(f)<0)t=u.neg(),r=p,n=c.neg(),o=l else if(n&&2==++b)break u=c,d=h,h=c,v=p,p=l,y=m,m=w}a=c.neg(),s=l var _=n.sqr().add(o.sqr()) return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b) return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red)) var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt() if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point") var o=n.fromRed().isOdd() return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0 var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b) return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e if(e.inf)return this if(this.eq(e))return this.dbl() if(this.neg().eq(e))return this.curve.point(null,null) if(0===this.x.cmp(e.x))return this.curve.point(null,null) var t=this.y.redSub(e.y) 0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm())) var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y) return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this var e=this.y.redAdd(this.y) if(0===e.cmpn(0))return this.curve.point(null,null) var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y) return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r] return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this var t=this.curve.point(this.x,this.y.redNeg()) if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()} t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null) var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e) return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e if(e.isInfinity())return this var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a) if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s) return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ() if(e.isInfinity())return this var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o) if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl() var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a) return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this if(this.isInfinity())return this if(!e)return this.dbl() var t if(this.curve.zeroA||this.curve.threeA){var r=this for(t=0;t=0)return!1 if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict" var n=r(6),i=r(9),o=r(79),a=r(25) function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t) return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r))) return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr()) return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1)) for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl()) return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict" var n=r(25),i=r(6),o=r(9),a=r(79),s=n.assert function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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 i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red)) var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt() if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point") var u=s.fromRed().isOdd() return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red)) var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm()) if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point") return this.point(this.zero,e)}var s=a.redSqrt() if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point") return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0 e.normalize() var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r))) return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr() r=r.redIAdd(r) var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),f=a.redMul(o) return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr() if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u) this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o) return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s) return this.curve.point(c,l,h,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(u).redMul(l) return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this var e=this.z.redInvm() return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z) if(0===this.x.cmp(t))return!0 for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1 if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict" t.sha1=r(508),t.sha224=r(509),t.sha256=r(176),t.sha384=r(510),t.sha512=r(177)},function(e,t,r){"use strict" var n=r(34),i=r(67),o=r(175),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782] function h(){if(!(this instanceof h))return new h l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n] for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize) for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength() return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16)) for(var s=this.n.byteLength(),u=t.getPrivate().toArray("be",s),c=e.toArray("be",s),l=new o({hash:this.hash,entropy:u,nonce:c,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),d=0;;d++){var p=a.k?a.k(d):new i(l.generate(this.n.byteLength())) if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(h)>=0)){var m=this.g.mul(p) if(!m.isInfinity()){var v=m.getX(),y=v.umod(this.n) if(0!==y.cmpn(0)){var b=p.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e)) if(0!==(b=b.umod(this.n)).cmpn(0)){var g=(m.getY().isOdd()?1:0)|(0!==v.cmp(y)?2:0) return a.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),g^=1),new f({r:y,s:b,recoveryParam:g})}}}}}},h.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n) var o=(t=new f(t,"hex")).r,a=t.s if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1 if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1 var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n) return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new f(t,n) var o=this.n,a=new i(e),s=t.r,u=t.s,l=1&r,h=r>>1 if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate") s=h?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l) var d=t.r.invm(o),p=o.sub(a).mul(d).umod(o),m=u.mul(d).umod(o) return this.g.mulAdd(p,s,m)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam for(var i=0;i<4;i++){var o try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict" var n=r(103),i=r(172),o=r(16) function a(e){if(!(this instanceof a))return new a(e) this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex") o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r) this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8) for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required") "string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r)) for(var o=[];o.length"}},function(e,t,r){"use strict" var n=r(6),i=r(25),o=i.assert function a(e,t){if(e instanceof a)return e this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++] if(!(128&r))return r var n=15&r if(0===n||n>4)return!1 for(var i=0,o=0,a=t.place;o>>=0 return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3) for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255) e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t) var r=new s if(48!==e[r.place++])return!1 var o=u(e,r) if(!1===o)return!1 if(o+r.place!==e.length)return!1 if(2!==e[r.place++])return!1 var a=u(e,r) if(!1===a)return!1 var c=e.slice(r.place,a+r.place) if(r.place+=a,2!==e[r.place++])return!1 var l=u(e,r) if(!1===l)return!1 if(e.length!==l+r.place)return!1 var f=e.slice(r.place,l+r.place) if(0===c[0]){if(!(128&c[1]))return!1 c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1 f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray() for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1) var n=[2] l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length) var o=n.concat(r),a=[48] return l(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict" var n=r(103),i=r(102),o=r(25),a=o.assert,s=o.parseBytes,u=r(519),c=r(520) function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e) e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e) var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n) return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t) var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S()) return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head} 0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"" for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0) for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next return i}},{key:"consume",value:function(e,t){var r return ei.length?i.length:e if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o)) break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1 for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o)) break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t */ var n=r(10),i=n.Buffer function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number") return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number") var n=i(e) return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t){var n function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(106),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream") function d(e,t){return{value:e,done:t}}function p(e){var t=e[a] if(null!==t){var r=e[h].read() null!==r&&(e[l]=null,e[a]=null,e[s]=null,t(d(r,!1)))}}function m(e){t.nextTick(p,e)}var v=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[u] if(null!==r)return Promise.reject(r) if(this[c])return Promise.resolve(d(void 0,!0)) if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(d(void 0,!0))}))})) var n,i=this[l] if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(d(void 0,!0)):t[f](r,n)}),n)}}(i,this)) else{var o=this[h].read() if(null!==o)return Promise.resolve(d(o,!1)) n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),v) e.exports=function(e){var t,r=Object.create(y,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read() n?(r[l]=null,r[a]=null,r[s]=null,e(d(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t)) return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s] return null!==t&&(r[l]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a] null!==n&&(r[l]=null,r[a]=null,r[s]=null,n(d(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this,r(12))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict" e.exports=i var n=r(185) function i(e){if(!(this instanceof i))return new i(e) n.call(this,e)}r(9)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict" var n,i=r(51).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1 return function(){t||(t=!0,e.apply(void 0,arguments))}}(o) var s=!1 e.on("close",(function(){s=!0})),void 0===n&&(n=r(106)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e) s=!0,o()})) var u=!1 return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function c(e){e()}function l(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))})) return t.reduce(l)}},function(e,t,r){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0) return r},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t] e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i}).call(this,r(10).Buffer)},function(e,t){var r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648] t.p1600=function(e){for(var t=0;t<24;++t){var n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],d=f^(o<<1|a>>>31),p=h^(a<<1|o>>>31),m=e[0]^d,v=e[1]^p,y=e[10]^d,b=e[11]^p,g=e[20]^d,w=e[21]^p,_=e[30]^d,k=e[31]^p,x=e[40]^d,O=e[41]^p d=n^(s<<1|u>>>31),p=i^(u<<1|s>>>31) var E=e[2]^d,S=e[3]^p,P=e[12]^d,M=e[13]^p,A=e[22]^d,j=e[23]^p,R=e[32]^d,T=e[33]^p,C=e[42]^d,I=e[43]^p d=o^(c<<1|l>>>31),p=a^(l<<1|c>>>31) var N=e[4]^d,D=e[5]^p,B=e[14]^d,L=e[15]^p,F=e[24]^d,U=e[25]^p,z=e[34]^d,q=e[35]^p,H=e[44]^d,V=e[45]^p d=s^(f<<1|h>>>31),p=u^(h<<1|f>>>31) var W=e[6]^d,G=e[7]^p,Y=e[16]^d,K=e[17]^p,J=e[26]^d,$=e[27]^p,Z=e[36]^d,Q=e[37]^p,X=e[46]^d,ee=e[47]^p d=c^(n<<1|i>>>31),p=l^(i<<1|n>>>31) var te=e[8]^d,re=e[9]^p,ne=e[18]^d,ie=e[19]^p,oe=e[28]^d,ae=e[29]^p,se=e[38]^d,ue=e[39]^p,ce=e[48]^d,le=e[49]^p,fe=m,he=v,de=b<<4|y>>>28,pe=y<<4|b>>>28,me=g<<3|w>>>29,ve=w<<3|g>>>29,ye=k<<9|_>>>23,be=_<<9|k>>>23,ge=x<<18|O>>>14,we=O<<18|x>>>14,_e=E<<1|S>>>31,ke=S<<1|E>>>31,xe=M<<12|P>>>20,Oe=P<<12|M>>>20,Ee=A<<10|j>>>22,Se=j<<10|A>>>22,Pe=T<<13|R>>>19,Me=R<<13|T>>>19,Ae=C<<2|I>>>30,je=I<<2|C>>>30,Re=D<<30|N>>>2,Te=N<<30|D>>>2,Ce=B<<6|L>>>26,Ie=L<<6|B>>>26,Ne=U<<11|F>>>21,De=F<<11|U>>>21,Be=z<<15|q>>>17,Le=q<<15|z>>>17,Fe=V<<29|H>>>3,Ue=H<<29|V>>>3,ze=W<<28|G>>>4,qe=G<<28|W>>>4,He=K<<23|Y>>>9,Ve=Y<<23|K>>>9,We=J<<25|$>>>7,Ge=$<<25|J>>>7,Ye=Z<<21|Q>>>11,Ke=Q<<21|Z>>>11,Je=ee<<24|X>>>8,$e=X<<24|ee>>>8,Ze=te<<27|re>>>5,Qe=re<<27|te>>>5,Xe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|ue>>>24,it=ue<<8|se>>>24,ot=ce<<14|le>>>18,at=le<<14|ce>>>18 e[0]=fe^~xe&Ne,e[1]=he^~Oe&De,e[10]=ze^~Xe&me,e[11]=qe^~et&ve,e[20]=_e^~Ce&We,e[21]=ke^~Ie&Ge,e[30]=Ze^~de&Ee,e[31]=Qe^~pe&Se,e[40]=Re^~He&tt,e[41]=Te^~Ve&rt,e[2]=xe^~Ne&Ye,e[3]=Oe^~De&Ke,e[12]=Xe^~me&Pe,e[13]=et^~ve&Me,e[22]=Ce^~We&nt,e[23]=Ie^~Ge&it,e[32]=de^~Ee&Be,e[33]=pe^~Se&Le,e[42]=He^~tt&ye,e[43]=Ve^~rt&be,e[4]=Ne^~Ye&ot,e[5]=De^~Ke&at,e[14]=me^~Pe&Fe,e[15]=ve^~Me&Ue,e[24]=We^~nt&ge,e[25]=Ge^~it&we,e[34]=Ee^~Be&Je,e[35]=Se^~Le&$e,e[44]=tt^~ye&Ae,e[45]=rt^~be&je,e[6]=Ye^~ot&fe,e[7]=Ke^~at&he,e[16]=Pe^~Fe&ze,e[17]=Me^~Ue&qe,e[26]=nt^~ge&_e,e[27]=it^~we&ke,e[36]=Be^~Je&Ze,e[37]=Le^~$e&Qe,e[46]=ye^~Ae&Re,e[47]=be^~je&Te,e[8]=ot^~fe&xe,e[9]=at^~he&Oe,e[18]=Fe^~ze&Xe,e[19]=Ue^~qe&et,e[28]=ge^~_e&Ce,e[29]=we^~ke&Ie,e[38]=Je^~Ze&de,e[39]=$e^~Qe&pe,e[48]=Ae^~Re&He,e[49]=je^~Te&Ve,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},function(e,t,r){"use strict" var n=r(9),i=r(539),o=r(549),a=r(550),s=r(555) function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){"use strict" var n=r(9),i=r(186),o=r(21).Buffer,a=new Array(16) function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t) var r=this._a,n=this._b,i=this._c,o=this._d r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=l(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,r,n,i,e[6],3225465664,9),i=l(i,o,r,n,e[11],643717713,14),n=l(n,i,o,r,e[0],3921069994,20),r=l(r,n,i,o,e[5],3593408605,5),o=l(o,r,n,i,e[10],38016083,9),i=l(i,o,r,n,e[15],3634488961,14),n=l(n,i,o,r,e[4],3889429448,20),r=l(r,n,i,o,e[9],568446438,5),o=l(o,r,n,i,e[14],3275163606,9),i=l(i,o,r,n,e[3],4107603335,14),n=l(n,i,o,r,e[8],1163531501,20),r=l(r,n,i,o,e[13],2850285829,5),o=l(o,r,n,i,e[2],4243563512,9),i=l(i,o,r,n,e[7],1735328473,14),r=f(r,n=l(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=h(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.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 e=o.allocUnsafe(16) return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var n=r(10),i=n.Buffer function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number") return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number") var n=i(e) return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number") return n.SlowBuffer(e)}},function(e,t,r){(t=e.exports=r(187)).Stream=t,t.Readable=t,t.Writable=r(191),t.Duplex=r(54),t.Transform=r(192),t.PassThrough=r(547),t.finished=r(107),t.pipeline=r(548)},,function(e,t,r){"use strict" function n(e,t){var r=Object.keys(e) if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e) t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head} 0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"" for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0) for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next return i}},{key:"consume",value:function(e,t){var r return ei.length?i.length:e if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o)) break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1 for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o)) break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))})) return t.reduce(l)}},function(e,t,r){"use strict" var n=r(10).Buffer,i=r(9),o=r(186),a=new Array(16),s=[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],u=[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],c=[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],l=[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],f=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0] function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function m(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t) for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,k=0|this._c,x=0|this._d,O=0|this._e,E=0;E<80;E+=1){var S,P E<16?(S=m(r,n,i,o,d,e[s[E]],f[0],c[E]),P=g(w,_,k,x,O,e[u[E]],h[0],l[E])):E<32?(S=v(r,n,i,o,d,e[s[E]],f[1],c[E]),P=b(w,_,k,x,O,e[u[E]],h[1],l[E])):E<48?(S=y(r,n,i,o,d,e[s[E]],f[2],c[E]),P=y(w,_,k,x,O,e[u[E]],h[2],l[E])):E<64?(S=b(r,n,i,o,d,e[s[E]],f[3],c[E]),P=v(w,_,k,x,O,e[u[E]],h[3],l[E])):(S=g(r,n,i,o,d,e[s[E]],f[4],c[E]),P=m(w,_,k,x,O,e[u[E]],h[4],l[E])),r=d,d=o,o=p(i,10),i=n,n=S,w=O,O=x,x=p(k,10),k=_,_=P}var M=this._b+i+x|0 this._b=this._c+o+O|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+k|0,this._a=M},d.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 e=n.alloc?n.alloc(20):new n(20) return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase() var r=t[e] if(!r)throw new Error(e+" is not supported (we accept pull requests)") return new r}).sha=r(551),t.sha1=r(552),t.sha224=r(553),t.sha256=r(193),t.sha384=r(554),t.sha512=r(194)},function(e,t,r){var n=r(9),i=r(55),o=r(21).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80) function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f) for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16] for(var h=0;h<80;++h){var d=~~(h/20),p=0|((t=n)<<5|t>>>27)+l(d,i,o,s)+u+r[h]+a[d] u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20) return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(9),i=r(55),o=r(21).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80) function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h) for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31 for(var d=0;d<80;++d){var p=~~(d/20),m=c(n)+f(p,i,o,s)+u+r[d]+a[p]|0 u=s,s=o,o=l(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20) return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(9),i=r(193),o=r(55),a=r(21).Buffer,s=new Array(64) function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.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},u.prototype._hash=function(){var e=a.allocUnsafe(28) return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(9),i=r(194),o=r(55),a=r(21).Buffer,s=new Array(160) function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.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},u.prototype._hash=function(){var e=a.allocUnsafe(48) function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){var n=r(21).Buffer,i=r(556).Transform,o=r(46).StringDecoder function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(9)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t)) var i=this._update(e) return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0) return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings") var n=this._decoder.write(e) return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){e.exports=i var n=r(45).EventEmitter function i(){n.call(this)}r(9)(i,n),i.Readable=r(108),i.Writable=r(561),i.Duplex=r(562),i.Transform=r(563),i.PassThrough=r(564),i.Stream=i,i.prototype.pipe=function(e,t){var r=this function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u)) var a=!1 function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},,function(e,t,r){"use strict" var n=r(21).Buffer,i=r(559) e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null} this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head} 0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"" for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0) if(1===this.length)return this.head.data for(var t,r,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=i,r=a,o.data.copy(t,r),a+=o.data.length,o=o.next return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length}) return this.constructor.name+" "+e})},,function(e,t,r){"use strict" e.exports=o var n=r(198),i=Object.create(r(68)) function o(e){if(!(this instanceof o))return new o(e) n.call(this,e)}i.inherits=r(9),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(109)},function(e,t,r){e.exports=r(47)},function(e,t,r){e.exports=r(108).Transform},function(e,t,r){e.exports=r(108).PassThrough},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0 var i=n(r(101)),o=r(38),a=r(44),s=r(169),u=function(){function t(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return t.zero=function(){return new t((0,a.zeros)(20))},t.fromString=function(e){return(0,i.default)((0,s.isValidAddress)(e),"Invalid address"),new t((0,a.toBuffer)(e))},t.fromPublicKey=function(r){return(0,i.default)(e.isBuffer(r),"Public key should be Buffer"),new t((0,s.pubToAddress)(r))},t.fromPrivateKey=function(r){return(0,i.default)(e.isBuffer(r),"Private key should be Buffer"),new t((0,s.privateToAddress)(r))},t.generate=function(r,n){return(0,i.default)(o.BN.isBN(n)),new t((0,s.generateAddress)(r.buf,n.toArrayLike(e)))},t.generate2=function(r,n,o){return(0,i.default)(e.isBuffer(n)),(0,i.default)(e.isBuffer(o)),new t((0,s.generateAddress2)(r.buf,n,o))},t.prototype.equals=function(e){return this.buf.equals(e.buf)},t.prototype.isZero=function(){return this.equals(t.zero())},t.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex") return e.gte(t)&&e.lte(r)},t.prototype.toString=function(){return"0x"+this.buf.toString("hex")},t.prototype.toBuffer=function(){return e.from(this.buf)},t}() t.Address=u}).call(this,r(10).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0 var n=r(170),i=r(38),o=r(44),a=r(104),s=r(80),u=r(110) function c(e,t){var r=(0,u.toType)(e,u.TypeOutput.BN) if(!t)return r.subn(27) var n=(0,u.toType)(t,u.TypeOutput.BN) return r.sub(n.muln(2).addn(35))}function l(e){var t=new i.BN(e) return t.eqn(0)||t.eqn(1)}t.ecsign=function(t,r,i){var o=(0,n.ecdsaSign)(t,r),a=o.signature,s=o.recid,c=e.from(a.slice(0,32)),l=e.from(a.slice(32,64)) if(!i||"number"==typeof i){if(i&&!Number.isSafeInteger(i))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)") return{r:c,s:l,v:i?s+(2*i+35):s+27}}return{r:c,s:l,v:(0,u.toType)(i,u.TypeOutput.BN).muln(2).addn(35).addn(s).toArrayLike(e)}},t.ecrecover=function(t,r,i,a,s){var u=e.concat([(0,o.setLengthLeft)(i,32),(0,o.setLengthLeft)(a,32)],64),f=c(r,s) if(!l(f))throw new Error("Invalid signature v value") var h=(0,n.ecdsaRecover)(u,f.toNumber(),t) return e.from((0,n.publicKeyConvert)(h,!1).slice(1))},t.toRpcSig=function(t,r,n,i){if(!l(c(t,i)))throw new Error("Invalid signature v value") return(0,o.bufferToHex)(e.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(n,32),(0,o.toBuffer)(t)]))},t.toCompactSig=function(t,r,n,i){if(!l(c(t,i)))throw new Error("Invalid signature v value") var a=(0,u.toType)(t,u.TypeOutput.Number),s=n return(a>28&&a%2==1||1===a||28===a)&&((s=e.from(n))[0]|=128),(0,o.bufferToHex)(e.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(s,32)]))},t.fromRpcSig=function(e){var t,r,n,i=(0,o.toBuffer)(e) if(i.length>=65)t=i.slice(0,32),r=i.slice(32,64),n=(0,o.bufferToInt)(i.slice(64)) else{if(64!==i.length)throw new Error("Invalid signature length") t=i.slice(0,32),r=i.slice(32,64),n=(0,o.bufferToInt)(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}},t.isValidSignature=function(e,t,r,n,o){void 0===n&&(n=!0) var a=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16) if(32!==t.length||32!==r.length)return!1 if(!l(c(e,o)))return!1 var u=new i.BN(t),f=new i.BN(r) return!(u.isZero()||u.gt(s)||f.isZero()||f.gt(s)||n&&1===f.cmp(a))},t.hashPersonalMessage=function(t){(0,s.assertIsBuffer)(t) var r=e.from("Ethereum Signed Message:\n".concat(t.length),"utf-8") return(0,a.keccak)(e.concat([r,t]))}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}} Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0 var o=i(r(101)),a=r(50),s=r(38),u=r(44) t.defineProperties=function(t,r,i){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={} return t._fields.forEach((function(e){r[e]="0x".concat(t[e].toString("hex"))})),r}return(0,u.baToJSON)(t.raw)},t.serialize=function(){return s.rlp.encode(t.raw)},r.forEach((function(r,n){function i(){return t.raw[n]}function a(i){"00"!==(i=(0,u.toBuffer)(i)).toString("hex")||r.allowZero||(i=e.allocUnsafe(0)),r.allowLess&&r.length?(i=(0,u.unpadBuffer)(i),(0,o.default)(r.length>=i.length,"The field ".concat(r.name," must not have more ").concat(r.length," bytes"))):r.allowZero&&0===i.length||!r.length||(0,o.default)(r.length===i.length,"The field ".concat(r.name," must have byte length of ").concat(r.length)),t.raw[n]=i}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:i,set:a}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:a,get:i})})),i)if("string"==typeof i&&(i=e.from((0,a.stripHexPrefix)(i),"hex")),e.isBuffer(i)&&(i=s.rlp.decode(i)),Array.isArray(i)){if(i.length>t._fields.length)throw new Error("wrong number of fields in data") i.forEach((function(e,r){t[t._fields[r]]=(0,u.toBuffer)(e)}))}else{if("object"!==n(i))throw new Error("invalid data") var c=Object.keys(i) r.forEach((function(e){-1!==c.indexOf(e.name)&&(t[e.name]=i[e.name]),-1!==c.indexOf(e.alias)&&(t[e.alias]=i[e.alias])}))}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict" function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}) var i=r(569) function o(e){return!("string"!=typeof e||!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e))}function a(e,t){"object"===n(t)&&t.constructor===Uint8Array&&(t=i.bytesToHex(t)) for(var r=i.keccak256(t).replace("0x",""),o=0;o<12;o+=4){var a=(parseInt(r.substr(o,2),16)<<8)+parseInt(r.substr(o+2,2),16)&2047,u=1<=48&&e<=57)return e-48 if(e>=65&&e<=70)return e-55 if(e>=97&&e<=102)return e-87 throw new Error("invalid bloom")}function u(e){return!("string"!=typeof e||!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))}function c(e){return!("string"!=typeof e||!e.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=o,t.isInBloom=a,t.isUserEthereumAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given") if(!c(t))throw new Error('Invalid ethereum address given: "'.concat(t,'"')) return a(e,i.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given") if(!c(t))throw new Error('Invalid contract address given: "'.concat(t,'"')) return a(e,t)},t.isTopicInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given") if(!u(t))throw new Error("Invalid topic") return a(e,t)},t.isTopic=u,t.isAddress=c},function(e,t,r){"use strict" Object.defineProperty(t,"__esModule",{value:!0}) var n=r(570) function i(e){if(null==e)throw new Error("cannot convert null value to array") if("string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/) if(!t)throw new Error("invalid hexidecimal string") if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e) for(var r=[],n=0;n=256||parseInt(String(r))!=r)return!1}return!0}(e))return o(new Uint8Array(e)) throw new Error("invalid arrayify value")}function o(e){var t=arguments return void 0!==e.slice||(e.slice=function(){var r=Array.prototype.slice.call(t) return o(new Uint8Array(Array.prototype.slice.apply(e,r)))}),e}t.keccak256=function(e){return"0x"+n.keccak_256(i(e))},t.padLeft=function(e,t){var r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0 return(r?"0x":"")+new Array(n).join("0")+e},t.bytesToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16)) return"0x".concat(t.join("").replace(/^0+/,""))},t.toByteArray=i},function(e,t,r){(function(e,n,i){var o function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */!function(){"use strict" var s="input is invalid type",u="object"===("undefined"==typeof window?"undefined":a(window)),c=u?window:{} c.JS_SHA3_NO_WINDOW&&(u=!1) var l=!u&&"object"===("undefined"==typeof self?"undefined":a(self)) !c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":a(e))&&e.versions&&e.versions.node?c=n:l&&(c=self) var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(87),d=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),m=[4,1024,262144,67108864],v=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136} !c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===a(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer}) for(var k=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},x=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},O=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},S=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3 for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called") var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}for(var n,i,o=this.blocks,u=this.byteCount,c=e.length,l=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=u){for(this.start=n-u,this.block=o[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=a(e) if("string"!==r){if("object"!==r)throw new Error(s) if(null===e)throw new Error(s) if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e) else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw new Error(s) t=!0}var n=0,i=e.length if(t)n=i else for(var o=0;o=57344?n+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15] a%t==0&&(F(r),o=0)}return i&&(e=r[o],s+=p[e>>4&15]+p[15&e],i>1&&(s+=p[e>>12&15]+p[e>>8&15]),i>2&&(s+=p[e>>20&15]+p[e>>16&15])),s},B.prototype.arrayBuffer=function(){this.finalize() var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3 e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s) for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255 s%r==0&&F(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)} var F=function(e){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,m,v,b,g,w,_,k,x,O,E,S,P,M,A,j,R,T,C,I,N,D,B,L,F,U,z,q,H,V,W,G,Y,K,J,$,Z,Q,X,ee,te,re,ne,ie,oe,ae,se,ue,ce,le for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],Y=e[11]<<4|e[10]>>>28,K=e[10]<<4|e[11]>>>28,A=e[20]<<3|e[21]>>>29,j=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,B=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,O=e[49]<<14|e[48]>>>18,e[0]=p^~v&g,e[1]=m^~b&w,e[10]=E^~P&A,e[11]=S^~M&j,e[20]=N^~B&F,e[21]=D^~L&U,e[30]=W^~Y&J,e[31]=G^~K&$,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=v^~g&_,e[3]=b^~w&k,e[12]=P^~A&R,e[13]=M^~j&T,e[22]=B^~F&z,e[23]=L^~U&q,e[32]=Y^~J&Z,e[33]=K^~$&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=g^~_&x,e[5]=w^~k&O,e[14]=A^~R&C,e[15]=j^~T&I,e[24]=F^~z&H,e[25]=U^~q&V,e[34]=J^~Z&X,e[35]=$^~Q&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=_^~x&p,e[7]=k^~O&m,e[16]=R^~C&E,e[17]=T^~I&S,e[26]=z^~H&N,e[27]=q^~V&D,e[36]=Z^~X&W,e[37]=Q^~ee&G,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=x^~p&v,e[9]=O^~m&b,e[18]=C^~E&P,e[19]=I^~S&M,e[28]=H^~N&B,e[29]=V^~D&L,e[38]=X^~W&Y,e[39]=ee^~G&K,e[48]=ce^~te&ne,e[49]=le^~re&ie,e[0]^=y[n],e[1]^=y[n+1]} if(f)i.exports=A else{for(R=0;R32||n256)throw new Error("Invalid uint"+n+" size") if((s=a(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength()) if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative") return n?o.leftPad(s.toString("hex"),n/8*2):s}if(e.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size") if((s=a(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength()) return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+e)},u=function(e){if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.") var t,r,a="" if(e&&"object"===n(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,a=e.hasOwnProperty("v")?e.v:e.value):(t=o.toHex(e,!0),a=o.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof a||/^(-)?0x/i.test(a)||(a=new i(a)),Array.isArray(a)){if((r=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e) return t?parseInt(t[1],10):null}(t))&&a.length!==r)throw new Error(t+" is not matching the given array "+JSON.stringify(a)) r=a.length}return Array.isArray(a)?a.map((function(e){return s(t,e,r).toString("hex").replace("0x","")})).join(""):s(t,a,r).toString("hex").replace("0x","")} e.exports={soliditySha3:function(){var e=Array.prototype.slice.call(arguments),t=e.map(u) return o.sha3("0x"+t.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+Array.prototype.slice.call(arguments).map(u).join(""))},encodePacked:function(){var e=Array.prototype.slice.call(arguments),t=e.map(u) return"0x"+t.join("").toLowerCase()}}},,,function(e,t,r){"use strict" r.r(t),r.d(t,"ethers",(function(){return u})),r.d(t,"Signer",(function(){return yn})),r.d(t,"Wallet",(function(){return Ra})),r.d(t,"VoidSigner",(function(){return bn})),r.d(t,"getDefaultProvider",(function(){return pf})),r.d(t,"providers",(function(){return o})),r.d(t,"BaseContract",(function(){return yi})),r.d(t,"Contract",(function(){return bi})),r.d(t,"ContractFactory",(function(){return gi})),r.d(t,"BigNumber",(function(){return b})),r.d(t,"FixedNumber",(function(){return Ii})),r.d(t,"constants",(function(){return i})),r.d(t,"errors",(function(){return h.a})),r.d(t,"logger",(function(){return Tf})),r.d(t,"utils",(function(){return s})),r.d(t,"wordlists",(function(){return Oo})),r.d(t,"version",(function(){return Rf})),r.d(t,"Wordlist",(function(){return mo})) var n={} r.r(n),r.d(n,"encode",(function(){return K})),r.d(n,"decode",(function(){return Z})) var i={} r.r(i),r.d(i,"AddressZero",(function(){return Ia})),r.d(i,"NegativeOne",(function(){return _t})),r.d(i,"Zero",(function(){return kt})),r.d(i,"One",(function(){return xt})),r.d(i,"Two",(function(){return Ot})),r.d(i,"WeiPerEther",(function(){return Et})),r.d(i,"MaxUint256",(function(){return St})),r.d(i,"MinInt256",(function(){return Pt})),r.d(i,"MaxInt256",(function(){return Mt})),r.d(i,"HashZero",(function(){return Na})),r.d(i,"EtherSymbol",(function(){return Da})) var o={} r.r(o),r.d(o,"Provider",(function(){return nn})),r.d(o,"BaseProvider",(function(){return iu})),r.d(o,"Resolver",(function(){return tu})),r.d(o,"UrlJsonRpcProvider",(function(){return tc})),r.d(o,"FallbackProvider",(function(){return bl})),r.d(o,"AlchemyProvider",(function(){return pc})),r.d(o,"AlchemyWebSocketProvider",(function(){return dc})),r.d(o,"AnkrProvider",(function(){return Oc})),r.d(o,"CloudflareProvider",(function(){return Ic})),r.d(o,"EtherscanProvider",(function(){return $c})),r.d(o,"InfuraProvider",(function(){return Tl})),r.d(o,"InfuraWebSocketProvider",(function(){return Rl})),r.d(o,"JsonRpcProvider",(function(){return Pu})),r.d(o,"JsonRpcBatchProvider",(function(){return Fl})),r.d(o,"NodesmithProvider",(function(){return Yl})),r.d(o,"PocketProvider",(function(){return tf})),r.d(o,"StaticJsonRpcProvider",(function(){return ec})),r.d(o,"Web3Provider",(function(){return hf})),r.d(o,"WebSocketProvider",(function(){return zu})),r.d(o,"IpcProvider",(function(){return gl})),r.d(o,"JsonRpcSigner",(function(){return Ou})),r.d(o,"getDefaultProvider",(function(){return pf})),r.d(o,"getNetwork",(function(){return Va})),r.d(o,"isCommunityResource",(function(){return Os})),r.d(o,"isCommunityResourcable",(function(){return xs})),r.d(o,"showThrottleMessage",(function(){return Ss})),r.d(o,"Formatter",(function(){return ks})) var a={} r.r(a),r.d(a,"decode",(function(){return us})),r.d(a,"encode",(function(){return cs})) var s={} r.r(s),r.d(s,"AbiCoder",(function(){return jr})),r.d(s,"defaultAbiCoder",(function(){return Rr})),r.d(s,"Fragment",(function(){return dr})),r.d(s,"ConstructorFragment",(function(){return br})),r.d(s,"ErrorFragment",(function(){return _r})),r.d(s,"EventFragment",(function(){return pr})),r.d(s,"FunctionFragment",(function(){return gr})),r.d(s,"ParamType",(function(){return fr})),r.d(s,"FormatTypes",(function(){return cr})),r.d(s,"checkResultErrors",(function(){return L})),r.d(s,"Logger",(function(){return h.b})),r.d(s,"RLP",(function(){return n})),r.d(s,"_fetchData",(function(){return ms})),r.d(s,"fetchJson",(function(){return vs})),r.d(s,"poll",(function(){return ys})),r.d(s,"checkProperties",(function(){return A})),r.d(s,"deepCopy",(function(){return T})),r.d(s,"defineReadOnly",(function(){return S})),r.d(s,"getStatic",(function(){return P})),r.d(s,"resolveProperties",(function(){return M})),r.d(s,"shallowCopy",(function(){return j})),r.d(s,"arrayify",(function(){return c.a})),r.d(s,"concat",(function(){return c.b})),r.d(s,"stripZeros",(function(){return c.o})),r.d(s,"zeroPad",(function(){return c.p})),r.d(s,"isBytes",(function(){return c.j})),r.d(s,"isBytesLike",(function(){return c.k})),r.d(s,"defaultPath",(function(){return Io})),r.d(s,"HDNode",(function(){return No})),r.d(s,"SigningKey",(function(){return On})),r.d(s,"Interface",(function(){return Yr})),r.d(s,"LogDescription",(function(){return zr})),r.d(s,"TransactionDescription",(function(){return qr})),r.d(s,"base58",(function(){return no})),r.d(s,"base64",(function(){return a})),r.d(s,"hexlify",(function(){return c.i})),r.d(s,"isHexString",(function(){return c.l})),r.d(s,"hexConcat",(function(){return c.c})),r.d(s,"hexStripZeros",(function(){return c.f})),r.d(s,"hexValue",(function(){return c.g})),r.d(s,"hexZeroPad",(function(){return c.h})),r.d(s,"hexDataLength",(function(){return c.d})),r.d(s,"hexDataSlice",(function(){return c.e})),r.d(s,"nameprep",(function(){return ts})),r.d(s,"_toEscapedUtf8String",(function(){return ge})),r.d(s,"toUtf8Bytes",(function(){return ye})),r.d(s,"toUtf8CodePoints",(function(){return ke})),r.d(s,"toUtf8String",(function(){return _e})),r.d(s,"Utf8ErrorFuncs",(function(){return me})),r.d(s,"formatBytes32String",(function(){return kf})),r.d(s,"parseBytes32String",(function(){return xf})),r.d(s,"dnsEncode",(function(){return ss})),r.d(s,"hashMessage",(function(){return Bi})),r.d(s,"namehash",(function(){return as})),r.d(s,"isValidName",(function(){return os})),r.d(s,"id",(function(){return xe})),r.d(s,"_TypedDataEncoder",(function(){return Xi})),r.d(s,"getAddress",(function(){return ae})),r.d(s,"getIcapAddress",(function(){return ue})),r.d(s,"getContractAddress",(function(){return ce})),r.d(s,"getCreate2Address",(function(){return le})),r.d(s,"isAddress",(function(){return se})),r.d(s,"formatEther",(function(){return Af})),r.d(s,"parseEther",(function(){return jf})),r.d(s,"formatUnits",(function(){return Pf})),r.d(s,"parseUnits",(function(){return Mf})),r.d(s,"commify",(function(){return Sf})),r.d(s,"computeHmac",(function(){return lo})),r.d(s,"keccak256",(function(){return V})),r.d(s,"ripemd160",(function(){return so})),r.d(s,"sha256",(function(){return uo})),r.d(s,"sha512",(function(){return co})),r.d(s,"randomBytes",(function(){return zo.a})),r.d(s,"shuffled",(function(){return Zc})),r.d(s,"solidityPack",(function(){return gf})),r.d(s,"solidityKeccak256",(function(){return wf})),r.d(s,"soliditySha256",(function(){return _f})),r.d(s,"splitSignature",(function(){return c.n})),r.d(s,"joinSignature",(function(){return c.m})),r.d(s,"accessListify",(function(){return Bn})),r.d(s,"parseTransaction",(function(){return Hn})),r.d(s,"serializeTransaction",(function(){return zn})),r.d(s,"TransactionTypes",(function(){return Pn})),r.d(s,"getJsonWalletAddress",(function(){return _a})),r.d(s,"computeAddress",(function(){return Cn})),r.d(s,"recoverAddress",(function(){return In})),r.d(s,"computePublicKey",(function(){return Sn})),r.d(s,"recoverPublicKey",(function(){return En})),r.d(s,"verifyMessage",(function(){return Ta})),r.d(s,"verifyTypedData",(function(){return Ca})),r.d(s,"getAccountPath",(function(){return Uo})),r.d(s,"mnemonicToEntropy",(function(){return Bo})),r.d(s,"entropyToMnemonic",(function(){return Lo})),r.d(s,"isValidMnemonic",(function(){return Fo})),r.d(s,"mnemonicToSeed",(function(){return Do})),r.d(s,"SupportedAlgorithm",(function(){return to})),r.d(s,"UnicodeNormalizationForm",(function(){return fe})),r.d(s,"Utf8ErrorReason",(function(){return he})),r.d(s,"Indexed",(function(){return Vr})) var u={} r.r(u),r.d(u,"Signer",(function(){return yn})),r.d(u,"Wallet",(function(){return Ra})),r.d(u,"VoidSigner",(function(){return bn})),r.d(u,"getDefaultProvider",(function(){return pf})),r.d(u,"providers",(function(){return o})),r.d(u,"BaseContract",(function(){return yi})),r.d(u,"Contract",(function(){return bi})),r.d(u,"ContractFactory",(function(){return gi})),r.d(u,"BigNumber",(function(){return b})),r.d(u,"FixedNumber",(function(){return Ii})),r.d(u,"constants",(function(){return i})),r.d(u,"errors",(function(){return h.a})),r.d(u,"logger",(function(){return Tf})),r.d(u,"utils",(function(){return s})),r.d(u,"wordlists",(function(){return Oo})),r.d(u,"version",(function(){return Rf})),r.d(u,"Wordlist",(function(){return mo})) var c=r(0),l=r(6),f=r.n(l),h=r(2) function d(e,t){for(var r=0;r=9007199254740991||t<=-9007199254740991)&&k("overflow","BigNumber.from",t),e.from(String(t)) var r=t if("bigint"==typeof r)return e.from(r.toString()) if(Object(c.j)(r))return e.from(Object(c.i)(r)) if(r)if(r.toHexString){var n=r.toHexString() if("string"==typeof n)return e.from(n)}else{var i=r._hex if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(c.l)(i)||"-"===i[0]&&Object(c.l)(i.substring(1))))return e.from(i)}return m.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return w(_(this).fromTwos(e))}},{key:"toTwos",value:function(e){return w(_(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return w(_(this).add(_(e)))}},{key:"sub",value:function(e){return w(_(this).sub(_(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&k("division-by-zero","div"),w(_(this).div(_(t)))}},{key:"mul",value:function(e){return w(_(this).mul(_(e)))}},{key:"mod",value:function(e){var t=_(e) return t.isNeg()&&k("division-by-zero","mod"),w(_(this).umod(t))}},{key:"pow",value:function(e){var t=_(e) return t.isNeg()&&k("negative-power","pow"),w(_(this).pow(t))}},{key:"and",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","and"),w(_(this).and(t))}},{key:"or",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","or"),w(_(this).or(t))}},{key:"xor",value:function(e){var t=_(e) return(this.isNegative()||t.isNeg())&&k("unbound-bitwise-result","xor"),w(_(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","mask"),w(_(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","shl"),w(_(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&k("negative-width","shr"),w(_(this).shrn(e))}},{key:"eq",value:function(e){return _(this).eq(_(e))}},{key:"lt",value:function(e){return _(this).lt(_(e))}},{key:"lte",value:function(e){return _(this).lte(_(e))}},{key:"gt",value:function(e){return _(this).gt(_(e))}},{key:"gte",value:function(e){return _(this).gte(_(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return _(this).isZero()}},{key:"toNumber",value:function(){try{return _(this).toNumber()}catch(e){k("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return m.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?y||(y=!0,m.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?m.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):m.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),_(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function g(e){if("string"!=typeof e)return g(e.toString(16)) if("-"===e[0])return"-"===(e=e.substring(1))[0]&&m.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00" for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4) return e}function w(e){return b.from(g(e))}function _(e){var t=b.from(e).toHexString() return"-"===t[0]?new p("-"+t.substring(3),16):new p(t.substring(2),16)}function k(e,t,r){var n={fault:e,operation:t} return null!=r&&(n.value=r),m.throwError(e,h.b.errors.NUMERIC_FAULT,n)}function x(e,t){for(var r=0;rthis.wordSize&&B.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),z=function(){function e(t,r,n,i){I(this,e),S(this,"_data",Object(c.a)(t)),S(this,"wordSize",r||32),S(this,"_coerceFunc",n),S(this,"allowLoose",i),this._offset=0}return D(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:B.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t) return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return b.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$") return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),q=r(205),H=r.n(q) function V(e){return"0x"+H.a.keccak_256(Object(c.a)(e))}var W=new h.b("rlp/5.6.0") function G(e){for(var t=[];e;)t.unshift(255&e),e>>=8 return t}function Y(e,t,r){for(var n=0,i=0;it+1+n&&W.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function $(e,t){if(0===e.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247 t+1+r>e.length&&W.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{}) var n=Y(e,t+1,r) return t+1+r+n>e.length&&W.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),J(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192 return t+1+i>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),J(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183 t+1+o>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}) var a=Y(e,t+1,o) return t+1+o+a>e.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(c.i)(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128 return t+1+s>e.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(c.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(c.i)(e[t])}}function Z(e){var t=Object(c.a)(e),r=$(t,0) return r.consumed!==t.length&&W.throwArgumentError("invalid rlp data","data",e),r.result}var Q=new h.b("address/5.6.0") function X(e){Object(c.l)(e,20)||Q.throwArgumentError("invalid address","address",e) for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0) for(var i=Object(c.a)(V(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase()) return"0x"+t.join("")}for(var ee={},te=0;te<10;te++)ee[String(te)]=String(te) for(var re=0;re<26;re++)ee[String.fromCharCode(65+re)]=String(10+re) var ne,ie=Math.floor((ne=9007199254740991,Math.log10?Math.log10(ne):Math.log(ne)/Math.LN10)) function oe(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return ee[e]})).join("");t.length>=ie;){var r=t.substring(0,ie) t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n return n}function ae(e){var t,r=null if("string"!=typeof e&&Q.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),r=X(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e&&Q.throwArgumentError("bad address checksum","address",e) else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==oe(e)&&Q.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new p(t,36).toString(16);r.length<40;)r="0"+r r=X("0x"+r)}else Q.throwArgumentError("invalid address","address",e) return r}function se(e){try{return ae(e),!0}catch(e){}return!1}function ue(e){for(var t,r=(t=ae(e).substring(2),new p(t,16).toString(36)).toUpperCase();r.length<30;)r="0"+r return"XE"+oe("XE00"+r)+r}function ce(e){var t=null try{t=ae(e.from)}catch(t){Q.throwArgumentError("missing from address","transaction",e)}var r=Object(c.o)(Object(c.a)(b.from(e.nonce).toHexString())) return ae(Object(c.e)(V(K([t,r])),12))}function le(e,t,r){return 32!==Object(c.d)(t)&&Q.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(c.d)(r)&&Q.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ae(Object(c.e)(V(Object(c.b)(["0xff",ae(e),t,r])),12))}var fe,he,de=new h.b("strings/5.6.0") function pe(e,t,r,n,i){if(e===he.BAD_PREFIX||e===he.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a>6==2;a++)o++ return o}return e===he.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(fe||(fe={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(he||(he={})) var me=Object.freeze({error:function(e,t,r,n,i){return de.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:pe,replace:function(e,t,r,n,i){return e===he.OVERLONG?(n.push(i),0):(n.push(65533),pe(e,t,r))}}) function ve(e,t){null==t&&(t=me.error),e=Object(c.a)(e) for(var r=[],n=0;n>7!=0){var o=null,a=null if(192==(224&i))o=1,a=127 else if(224==(240&i))o=2,a=2047 else{if(240!=(248&i)){n+=t(128==(192&i)?he.UNEXPECTED_CONTINUE:he.BAD_PREFIX,n-1,e,r) continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(he.OVERRUN,n-1,e,r) else{for(var s=i&(1<<8-o-1)-1,u=0;u1114111?n+=t(he.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(he.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(he.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.current t!=fe.current&&(de.checkNormalize(),e=e.normalize(t)) for(var r=[],n=0;n>6|192),r.push(63&i|128) else if(55296==(64512&i)){n++ var o=e.charCodeAt(n) if(n>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string") var a=65536+((1023&i)<<10)+(1023&o) r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(c.a)(r)}function be(e){var t="0000"+e.toString(16) return"\\u"+t.substring(t.length-4)}function ge(e,t){return'"'+ve(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b" case 9:return"\\t" case 10:return"\\n" case 13:return"\\r" case 34:return'\\"' case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?be(e):be(55296+((e-=65536)>>10&1023))+be(56320+(1023&e))})).join("")+'"'}function we(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function _e(e,t){return we(ve(e,t))}function ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.current return ve(ye(e,t))}function xe(e){return V(ye(e))}function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){for(var r=0;r=0?t:"")+"]",s=-1===t||e.dynamic return(o=n.call(this,"array",a,r,s)).coder=e,o.length=t,o}return t=i,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&ze.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}) for(var r=[],n=0;n=0||"tuple"===e)&&ar[t])return!0 return(or[t]||"payable"===t)&&nr.throwArgumentError("invalid modifier","name",t),!1}function ur(e,t){for(var r in t)S(e,r,t[r])}var cr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),lr=new RegExp(/^(.*)\[([0-9]*)\]$/),fr=function(){function e(t,r){er(this,e),t!==ir&&nr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),ur(this,r) var n=this.type.match(lr) ur(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return rr(e,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0} return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="" return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==cr.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+")"):r+=this.type,e!==cr.sighash&&(!0===this.indexed&&(r+=" indexed"),e===cr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(ir,{name:t.name||null,type:kr(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e function n(t){nr.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}} return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ") for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s2&&nr.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||nr.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=b.from(r[1]),r[0]):e}function vr(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0 break case"payable":t.payable=!0,t.stateMutability="payable" break case"nonpayable":t.payable=!1,t.stateMutability="nonpayable" break case"pure":t.constant=!0,t.stateMutability="pure" break case"view":t.constant=!0,t.stateMutability="view" break case"external":case"public":case"":break default:console.log("unknown modifier: "+e)}}))}function yr(e){var t={constant:!1,payable:!0,stateMutability:"payable"} return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&nr.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&nr.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||nr.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&nr.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&nr.throwArgumentError("unable to determine stateMutability","value",e),t}var br=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))}) e===cr.sighash&&nr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"}) var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") " return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e "constructor"!==e.type&&nr.throwArgumentError("invalid constructor object","value",e) var t=yr(e) t.constant&&nr.throwArgumentError("constructor cannot be constant","value",e) var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(fr.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?b.from(e.gas):null} return new r(ir,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=mr(e,t)).match(Er) return n&&"constructor"===n[1].trim()||nr.throwArgumentError("invalid constructor string","value",e),t.inputs=hr(n[2].trim(),!1),vr(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(dr),gr=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))}) var t="" return e!==cr.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") ",e!==cr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e "function"!==e.type&&nr.throwArgumentError("invalid function object","value",e) var t=yr(e),n={type:e.type,name:Or(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(fr.fromObject):[],outputs:e.outputs?e.outputs.map(fr.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?b.from(e.gas):null} return new r(ir,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=mr(e,t)).split(" returns ") n.length>2&&nr.throwArgumentError("invalid function string","value",e) var i=n[0].match(Er) if(i||nr.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Or(t.name),t.inputs=hr(i[2],!1),vr(i[3].trim(),t),n.length>1){var o=n[1].match(Er) ""==o[1].trim()&&""==o[3].trim()||nr.throwArgumentError("unexpected tokens","value",e),t.outputs=hr(o[2],!1)}else t.outputs=[] return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(br) function wr(e){var t=e.format() return"Error(string)"!==t&&"Panic(uint256)"!==t||nr.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var _r=function(e){$t(r,e) var t=Zt(r) function r(){return er(this,r),t.apply(this,arguments)}return rr(r,[{key:"format",value:function(e){if(e||(e=cr.sighash),cr[e]||nr.throwArgumentError("invalid format type","format",e),e===cr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))}) var t="" return e!==cr.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===cr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e "error"!==e.type&&nr.throwArgumentError("invalid error object","value",e) var t={type:e.type,name:Or(e.name),inputs:e.inputs?e.inputs.map(fr.fromObject):[]} return wr(new r(ir,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(Er) return n||nr.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Or(t.name),t.inputs=hr(n[2],!1),wr(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(dr) function kr(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var xr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$") function Or(e){return e&&e.match(xr)||nr.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var Er=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$") function Sr(e,t){for(var r=0;r256||n%8!=0)&&Pr.throwArgumentError("invalid "+r[1]+" bit length","param",e),new It(n/8,"int"===r[1],e.name)}if(r=e.type.match(Mr)){var i=parseInt(r[1]) return(0===i||i>32)&&Pr.throwArgumentError("invalid bytes length","param",e),new pt(i,e.name)}return Pr.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new z(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new U(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(fr.from(e))})) return new Kt(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this e.length!==t.length&&Pr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}}) var n=e.map((function(e){return r._getCoder(fr.from(e))})),i=new Kt(n,"_"),o=this._getWriter() return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(fr.from(e))})) return new Kt(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Sr(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Rr=new jr function Tr(e){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cr(e,t){for(var r=0;r1&&Ur.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[gr.fromString(e).format()] return i||Ur.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase() for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r] Ur.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n})) return 0===i.length?Ur.throwArgumentError("no matching event","name",n):i.length>1&&Ur.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[pr.fromString(e).format()] return o||Ur.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=P(this.constructor,"getSighash") for(var r in this.errors)if(e===t(this.errors[r]))return this.errors[r] Ur.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n})) return 0===i.length?Ur.throwArgumentError("no matching error","name",n):i.length>1&&Ur.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[gr.fromString(e).format()] return o||Ur.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return P(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),P(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e)) var r=Object(c.a)(t) return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Ur.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e)) var r=Object(c.a)(t) return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Ur.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e)) var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break case 4:var u=Object(c.i)(r.slice(0,4)),l=Wr[u] if(l)o=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,s=l.signature,l.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0])) else try{var f=this.getError(u) o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return Ur.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this "string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Ur.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t}) var n=[] e.anonymous||n.push(this.getEventTopic(e)) var i=function(e,t){return"string"===e.type?xe(t):"bytes"===e.type?V(Object(c.i)(t)):("address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))} for(t.forEach((function(t,r){var o=e.inputs[r] o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Ur.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&Ur.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop() return n}},{key:"encodeEventLog",value:function(e,t){var r=this "string"==typeof e&&(e=this.getEvent(e)) var n=[],i=[],o=[] return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Ur.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a] if(e.indexed)if("string"===e.type)n.push(xe(s)) else if("bytes"===e.type)n.push(V(s)) else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented") n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e) Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||Ur.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[] e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(fr.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))})) var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,u=this._abiCoder.decode(o,t,!0),l=[],f=0,d=0 e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)l[t]=new Vr({_isIndexed:!0,hash:null}) else if(a[t])l[t]=new Vr({_isIndexed:!0,hash:s[d++]}) else try{l[t]=s[d++]}catch(e){l[t]=e}else try{l[t]=u[f++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){var r=l[t] r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:function(){throw Gr("property ".concat(JSON.stringify(e.name)),r)}}):l[e.name]=r}})) for(var p=function(e){var t=l[e] t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:function(){throw Gr("index ".concat(e),t)}})},m=0;m=0)throw e return pn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&pn.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,M(r) case 23:return t.abrupt("return",t.sent) case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||pn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&an(e,t)}(r,e) var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=cn(e) if(t){var i=cn(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return sn(this,r)}}(r) function r(e,n){var i return ln(this,r),pn.checkNew(this instanceof r?this.constructor:void 0,r),S(un(i=t.call(this)),"address",e),S(un(i),"provider",n||null),i}return hn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){pn.throwError(e,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(yn),gn=r(204) function wn(e,t){for(var r=0;r32&&Mn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Dn(e,t){return{address:ae(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(c.d)(t)&&Mn.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function Bn(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&Mn.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),Dn(e[0],e[1])):Dn(e.address,e.storageKeys)})) var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{}) return Dn(t,Object.keys(r).sort())})) return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function Ln(e){return Bn(e).map((function(e){return[e.address,e.storageKeys]}))}function Fn(e,t){if(null!=e.gasPrice){var r=b.from(e.gasPrice),n=b.from(e.maxFeePerGas||0) r.eq(n)||Mn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[Nn(e.chainId||0,"chainId"),Nn(e.nonce||0,"nonce"),Nn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Nn(e.maxFeePerGas||0,"maxFeePerGas"),Nn(e.gasLimit||0,"gasLimit"),null!=e.to?ae(e.to):"0x",Nn(e.value||0,"value"),e.data||"0x",Ln(e.accessList||[])] if(t){var o=Object(c.n)(t) i.push(Nn(o.recoveryParam,"recoveryParam")),i.push(Object(c.o)(o.r)),i.push(Object(c.o)(o.s))}return Object(c.c)(["0x02",K(i)])}function Un(e,t){var r=[Nn(e.chainId||0,"chainId"),Nn(e.nonce||0,"nonce"),Nn(e.gasPrice||0,"gasPrice"),Nn(e.gasLimit||0,"gasLimit"),null!=e.to?ae(e.to):"0x",Nn(e.value||0,"value"),e.data||"0x",Ln(e.accessList||[])] if(t){var n=Object(c.n)(t) r.push(Nn(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",K(r)])}function zn(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Mn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){A(e,Tn) var r=[] Rn.forEach((function(t){var n=e[t.name]||[],i={} t.numeric&&(i.hexPad="left"),n=Object(c.a)(Object(c.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Mn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(c.o)(n)).length>t.maxLength&&Mn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(c.i)(n))})) var n=0 if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&Mn.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(c.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!t)return K(r) var i=Object(c.n)(t),o=27+i.recoveryParam return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Mn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Mn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(c.i)(o)),r.push(Object(c.o)(Object(c.a)(i.r))),r.push(Object(c.o)(Object(c.a)(i.s))),K(r)}(e,t) switch(e.type){case 1:return Un(e,t) case 2:return Fn(e,t)}return Mn.throwError("unsupported transaction type: ".concat(e.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function qn(e,t,r){try{var n=jn(t[0]).toNumber() if(0!==n&&1!==n)throw new Error("bad recid") e.v=n}catch(e){Mn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(c.h)(t[1],32),e.s=Object(c.h)(t[2],32) try{var i=V(r(e)) e.from=In(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){console.log(e)}}function Hn(e){var t=Object(c.a)(e) if(t[0]>127)return function(e){var t=Z(e) 9!==t.length&&6!==t.length&&Mn.throwArgumentError("invalid raw transaction","rawTransaction",e) var r={nonce:jn(t[0]).toNumber(),gasPrice:jn(t[1]),gasLimit:jn(t[2]),to:An(t[3]),value:jn(t[4]),data:t[5],chainId:0} if(6===t.length)return r try{r.v=b.from(t[6]).toNumber()}catch(e){return console.log(e),r}if(r.r=Object(c.h)(t[7],32),r.s=Object(c.h)(t[8],32),b.from(r.r).isZero()&&b.from(r.s).isZero())r.chainId=r.v,r.v=0 else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0) var n=r.v-27,i=t.slice(0,6) 0!==r.chainId&&(i.push(Object(c.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8) var o=V(K(i)) try{r.from=In(o,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(e){console.log(e)}r.hash=V(e)}return r.type=null,r}(t) switch(t[0]){case 1:return function(e){var t=Z(e.slice(1)) 8!==t.length&&11!==t.length&&Mn.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(e)) var r={type:1,chainId:jn(t[0]).toNumber(),nonce:jn(t[1]).toNumber(),gasPrice:jn(t[2]),gasLimit:jn(t[3]),to:An(t[4]),value:jn(t[5]),data:t[6],accessList:Bn(t[7])} return 8===t.length||(r.hash=V(e),qn(r,t.slice(8),Un)),r}(t) case 2:return function(e){var t=Z(e.slice(1)) 9!==t.length&&12!==t.length&&Mn.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(e)) var r=jn(t[2]),n=jn(t[3]),i={type:2,chainId:jn(t[0]).toNumber(),nonce:jn(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:jn(t[4]),to:An(t[5]),value:jn(t[6]),data:t[7],accessList:Bn(t[8])} return 9===t.length||(i.hash=V(e),qn(i,t.slice(9),Fn)),i}(t)}return Mn.throwError("unsupported transaction type: ".concat(t[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}function Vn(e){return function(e){if(Array.isArray(e))return Wn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Wn(e,t) var r=Object.prototype.toString.call(e).slice(8,-1) return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(e,t){(null==t||t>e.length)&&(t=e.length) for(var r=0,n=new Array(t);r1)){e=e.substring(1) var r=t[0] try{null==i[e]&&S(i,e,i[r])}catch(e){}null==i.functions[e]&&S(i.functions,e,i.functions[r]),null==i.callStatic[e]&&S(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&S(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&S(i.estimateGas,e,i.estimateGas[r])}}))}return ti(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&ii.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this this.signer||ii.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"}) var r=j(e||{}) return["from","to"].forEach((function(e){null!=r[e]&&ii.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"==typeof e&&(e=new bn(e,this.provider)) var t=new this.constructor(this.address,this.interface,e) return this.deployTransaction&&S(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new pi) if("event"===e)return this._normalizeRunningEvent(new di("event",null)) if("*"===e)return this._normalizeRunningEvent(new vi(this.address,this.interface)) var t=this.interface.getEvent(e) return this._normalizeRunningEvent(new mi(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0] if("string"!=typeof r)throw new Error("invalid topic") var n=this.interface.getEvent(r) return this._normalizeRunningEvent(new mi(this.address,this.interface,n,e.topics))}catch(e){}var i={address:this.address,topics:e.topics} return this._normalizeRunningEvent(new di(hi(i),i))}return this._normalizeRunningEvent(new vi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag] var t=this._wrappedEmits[e.tag] t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,i=T(t) return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var n=this if(this.provider||ii.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=n._wrapEvent(e,r,t) if(null==i.decodeError)try{var o=e.getEmit(i) n.emit.apply(n,[e.filter].concat(Vn(o)))}catch(e){i.decodeError=e.error}null!=e.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)} this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=j(i.filter) return"string"==typeof t&&Object(c.l)(t,32)?(null!=r&&ii.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1 for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0 return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this if(!this.provider)return[] if(null==e){var r=function(){var e=[] for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)})) return{v:e}}() if("object"===ri(r))return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t] r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e) return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this var r=this._getRunningEvent(e) return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return ce(e)}},{key:"getInterface",value:function(e){return Yr.isInterface(e)?e:new Yr(e)}},{key:"isIndexed",value:function(e){return Vr.isIndexed(e)}}]),e}(),bi=function(e){Kn(r,e) var t=Jn(r) function r(){return Xn(this,r),t.apply(this,arguments)}return ti(r)}(yi),gi=function(){function e(t,r,n){Xn(this,e) var i=null "0x"!==(i="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(c.l)(i)||i.length%2)&&ii.throwArgumentError("invalid bytecode","bytecode",r),n&&!yn.isSigner(n)&&ii.throwArgumentError("invalid signer","signer",n),S(this,"bytecode",i),S(this,"interface",P(this instanceof e?this.constructor:void 0,"getInterface")(t)),S(this,"signer",n||null)}return ti(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n=0&&e<=256&&!(e%1)?"1"+Ai.substring(0,e):Oi.throwArgumentError("invalid decimal size","decimals",e)}function Ri(e,t){null==t&&(t=0) var r=ji(t),n=(e=b.from(e)).lt(Si) n&&(e=e.mul(Pi)) for(var i=e.mod(r).toString();i.length2&&Oi.throwArgumentError("too many decimal points","value",e) var o=i[0],a=i[1] for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1) for(a.length>r.length-1&&Mi("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&Oi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(Ei,r,n,i)}}]),e}(),Ii=function(){function e(t,r,n,i){_i(this,e),Oi.checkNew(this instanceof e?this.constructor:void 0,e),t!==Ei&&Oi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return xi(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Oi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t) var r=Ti(this._value,this.format.decimals),n=Ti(t._value,t.format.decimals) return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".") 1===t.length&&t.push("0") var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/) return this.isNegative()&&n&&(r=r.subUnsafe(Ni.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".") 1===t.length&&t.push("0") var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/) return!this.isNegative()&&n&&(r=r.addUnsafe(Ni.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0) var r=this.toString().split(".") if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&Oi.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this var n=e.from("1"+Ai.substring(0,t),this.format),i=Di.toFormat(this.format) return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex e%8&&Oi.throwArgumentError("invalid byte width","width",e) var t=b.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString() return Object(c.h)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||function(e){return null!=e&&(b.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(c.l)(e)||"bigint"==typeof e||Object(c.j)(e))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(Ri(t,r),Ci.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed") var n=Ci.from(r),i=Ti(t,n.decimals) !n.signed&&i.lt(Si)&&Mi("unsigned value cannot be negative","overflow","value",t) var o=null n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(c.h)(o,n.width/8)) var a=Ri(i,n.decimals) return new e(Ei,o,a,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed") var n=Ci.from(r) if(Object(c.a)(t).length>n.width/8)throw new Error("overflow") var i=b.from(t) n.signed&&(i=i.fromTwos(n.width)) var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=Ri(i,n.decimals) return new e(Ei,o,a,n)}},{key:"from",value:function(t,r){if("string"==typeof t)return e.fromString(t,r) if(Object(c.j)(t))return e.fromBytes(t,r) try{return e.fromValue(t,0,r)}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT)throw e}return Oi.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),Ni=Ii.from(1),Di=Ii.from("0.5") function Bi(e){return"string"==typeof e&&(e=ye(e)),V(Object(c.b)([ye("Ethereum Signed Message:\n"),ye(String(e.length)),e]))}function Li(e,t){for(var r=0;r256||t[2]&&t[2]!==String(n))&&Fi.throwArgumentError("invalid numeric width","type",e) var i=Vi.mask(r?n-1:n),o=r?i.add(Hi).mul(zi):qi return function(t){var r=b.from(t) return(r.lt(o)||r.gt(i))&&Fi.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/) if(a){var s=parseInt(a[1]) return(0===s||s>32||a[1]!==String(s))&&Fi.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.a)(t).length!==s&&Fi.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.a)(e),r=t.length%32 return r?Object(c.c)([t,Ui.slice(r)]):Object(c.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.h)(ae(e),32)} case"bool":return function(e){return e?Wi:Gi} case"bytes":return function(e){return V(e)} case"string":return function(e){return xe(e)}}return null}function Qi(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name return e.type+" "+t})).join(","),")")}var Xi=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),S(this,"types",Object.freeze(T(t))),S(this,"_encoderCache",{}),S(this,"_types",{}) var r={},n={},i={} Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}})) var o=function(e){var i={} t[e].forEach((function(o){i[o.name]&&Fi.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0 var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1] a===e&&Fi.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),Zi(a)||(n[a]||Fi.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))} for(var a in t)o(a) var s=Object.keys(n).filter((function(e){return 0===n[e].length})) for(var u in 0===s.length?Fi.throwArgumentError("missing primary type","types",t):s.length>1&&Fi.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),S(this,"primaryType",s[0]),function e(o,a){a[o]&&Fi.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]) c.sort(),this._types[u]=Qi(u,t[u])+c.map((function(e){return Qi(e,t[e])})).join("")}}var t,r,n return t=e,n=[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[] for(var n in t){var i=Yi[n] i||Fi.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return Ki.indexOf(e.name)-Ki.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(c.c)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return V(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,u return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=j(t),a={},t.verifyingContract&&!Object(c.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(c.l)(t,20)||(a[t]="0x"),t})),o.t0=regeneratorRuntime.keys(a) case 6:if((o.t1=o.t0()).done){o.next=13 break}return u=o.t1.value,o.next=10,i(u) case 10:a[u]=o.sent,o.next=6 break case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n}) case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t) var i={},o=[] Ki.forEach((function(e){var r=t[e] null!=r&&(i[e]=$i[e](r),o.push({name:e,type:Yi[e]}))})) var a=e.from(r),s=j(r) return s.EIP712Domain?Fi.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(t)) if(e.match(/^u?int/))return b.from(t).toString() switch(e){case"address":return t.toLowerCase() case"bool":return!!t case"string":return"string"!=typeof t&&Fi.throwArgumentError("invalid string","value",t),t}return Fi.throwArgumentError("unsupported type","type",e)}))}}}],(r=[{key:"getEncoder",value:function(e){var t=this._encoderCache[e] return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=Zi(e) if(r)return r var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/) if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]) return function(e){a>=0&&e.length!==a&&Fi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e) var r=e.map(o) return t._types[i]&&(r=r.map(V)),V(Object(c.c)(r))}}var s=this.types[e] if(s){var u=xe(this._types[e]) return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]) return t._types[i]?V(o):o})) return r.unshift(u),Object(c.c)(r)}}return Fi.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e] return t||Fi.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return V(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this if(Zi(e))return r(e,t) var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/) if(i){var o=i[1],a=parseInt(i[3]) return a>=0&&t.length!==a&&Fi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e] return s?s.reduce((function(e,i){var o=i.name,a=i.type return e[o]=n._visit(a,t[o],r),e}),{}):Fi.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}])&&Li(t.prototype,r),n&&Li(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function eo(e,t){for(var r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--u)a+=this.alphabet[r[u]] return a}},{key:"decode",value:function(e){if("string"!=typeof e)throw new TypeError("Expected String") var t=[] if(0===e.length)return new Uint8Array(t) t.push(0) for(var r=0;r>=8 for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a>24&255,f[t.length+1]=h>>16&255,f[t.length+2]=h>>8&255,f[t.length+3]=255&h var d=Object(c.a)(lo(i,e,f)) o||(o=d.length,s=new Uint8Array(o),a=n-((u=Math.ceil(n/o))-1)*o),s.set(d) for(var p=1;p64)throw new Error("invalid seed") var i=Object(c.a)(lo(to.sha512,Mo,n)) return new e(Co,jo(i.slice(0,32)),null,"0x00000000",jo(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=Lo(Bo(t,n=To(n)),n),e._fromSeed(Do(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=no.decode(t) 82===r.length&&Ro(r.slice(0,78))===t||So.throwArgumentError("invalid extended key","extendedKey","[REDACTED]") var n=r[4],i=Object(c.i)(r.slice(5,9)),o=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),s=r.slice(45,78) switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(Co,null,Object(c.i)(s),i,a,o,n,null) case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break return new e(Co,Object(c.i)(s.slice(1)),null,i,a,o,n,null)}return So.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!") return Ro(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(Co,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t)) var r=this.path r&&(r+="/"+(2147483647&t)) var n=new Uint8Array(37) if(2147483648&t){if(!this.privateKey)throw new Error("cannot derive child of neutered node") n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey)) for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255 var o=Object(c.a)(lo(to.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),u=null,l=null this.privateKey?u=jo(b.from(a).add(this.privateKey).mod(Po)):l=new On(Object(c.i)(a))._addPoint(this.publicKey) var f=r,h=this.mnemonic return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new e(Co,u,l,this.fingerprint,jo(s),t,this.depth+1,f)}},{key:"derivePath",value:function(e){var t=e.split("/") if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e) "m"===t[0]&&t.shift() for(var r=this,n=0;n=2147483648)throw new Error("invalid path index - "+i) r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i) var a=parseInt(i) if(a>=2147483648)throw new Error("invalid path index - "+i) r=r._derive(a)}}return r}}])&&Eo(t.prototype,r),n&&Eo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}() function Do(e,t){t||(t="") var r=ye("mnemonic"+t,fe.NFKD) return fo(ye(e,fe.NFKD),r,2048,64,"sha512")}function Bo(e,t){t=To(t),So.checkNormalize() var r=t.split(e) if(r.length%3!=0)throw new Error("invalid mnemonic") for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var u=32*r.length/3,l=Ao(r.length/3) if((Object(c.a)(uo(n.slice(0,u/8)))[0]&l)!=(n[n.length-1]&l))throw new Error("invalid checksum") return Object(c.i)(n.slice(0,u/8))}function Lo(e,t){if(t=To(t),(e=Object(c.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy") for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3) var o=e.length/4,a=Object(c.a)(uo(e))[0]&Ao(o) return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function Fo(e,t){try{return Bo(e,t),!0}catch(e){}return!1}function Uo(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&So.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var zo=r(576),qo=r(27),Ho=r.n(qo),Vo=r(83),Wo=r.n(Vo) function Go(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(c.a)(e)}function Yo(e,t){for(e=String(e);e.length=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue return i}}return null}var Ka=Ga("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Ja="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),$a=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Za=Wa("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Qa=Wa("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Xa=Wa("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data") for(var t=[],r=0;r=0||e>=65024&&e<=65039?[]:function(e){var t=Ya(e,$a) if(t)return[e+t.s] var r=Za[e] if(r)return r var n=Qa[e] return n?[e+n[0]]:Xa[e]||null}(e)||[e]})),(r=ke(we(r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[])),fe.NFKC)).forEach((function(e){if(Ya(e,es))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(Ya(e,Ka))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")})) var n=we(r) if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen") if(n.length>63)throw new Error("too long") return n}var rs=new h.b("hash/5.6.0"),ns=new Uint8Array(32) ns.fill(0) var is=new RegExp("^((.*)\\.)?([^.]+)$") function os(e){try{for(var t=e.split("."),r=0;r0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n) var i="object"===fs(e)?e.throttleCallback:null,o="object"===fs(e)&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100 hs.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o) var a="object"===fs(e)&&!!e.errorPassThrough,s={},u=null,c={method:"GET"},l=!1,f=12e4 if("string"==typeof e)u=e else if("object"===fs(e)){if(null!=e&&null!=e.url||hs.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var d in e.headers)s[d.toLowerCase()]={key:d,value:String(e.headers[d])},["if-none-match","if-modified-since"].indexOf(d.toLowerCase())>=0&&(l=!0) if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&hs.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"}) var p=e.user+":"+e.password s.authorization={key:"Authorization",value:"Basic "+cs(ye(p))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup)}var m=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),v=u?u.match(m):null if(v)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":v[1]},body:us(v[2])},b=y.body return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(e){hs.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:ps(v[1],v[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)})) var g={} Object.keys(s).forEach((function(e){var t=s[e] g[t.key]=t.value})),c.headers=g var w,_=(w=null,{promise:new Promise((function(e,t){f&&(w=setTimeout((function(){null!=w&&(w=null,t(hs.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:ps(c.body,g["content-type"]),requestMethod:c.method,timeout:f,url:u})))}),f))})),cancel:function(){null!=w&&(clearTimeout(w),w=null)}}),k=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,s,f,d,p,m,v,y,b,w return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0 case 1:if(!(t=300)&&(_.cancel(),hs.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:ps(v,s.headers?s.headers["content-type"]:null),requestBody:ps(c.body,g["content-type"]),requestMethod:c.method,url:u})),!r){e.next=60 break}return e.prev=37,e.next=40,r(v,s) case 40:return y=e.sent,_.cancel(),e.abrupt("return",y) case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&n(new Error("retry limit reached"))) var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u))) ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var bs=r(112),gs=r.n(bs) function ws(e,t){for(var r=0;r0&&null==e[e.length-1];)e.pop() return e.map((function(e){if(Array.isArray(e)){var t={} e.forEach((function(e){t[Bs(e)]=!0})) var r=Object.keys(t) return r.sort(),r.join("|")}return Bs(e)})).join("&")}function Fs(e){if("string"==typeof e){if(e=e.toLowerCase(),32===Object(c.d)(e))return"tx:"+e if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Ls(e) if(rn.isForkEvent(e))throw Ds.warn("not implemented"),new Error("not implemented") if(e&&"object"===Is(e))return"filter:"+(e.address||"*")+":"+Ls(e.topics||[])}throw new Error("invalid event - "+e)}function Us(){return(new Date).getTime()}function zs(e){return new Promise((function(t){setTimeout(t,e)}))}var qs=["block","network","pending","poll"],Hs=function(){function e(t,r,n){Rs(this,e),S(this,"tag",t),S(this,"listener",r),S(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Cs(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":") return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":") if("filter"!==e[0])return null var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[] var t=e.split("|").map((function(e){return"null"===e?null:e})) return 1===t.length?t[0]:t})),i={} return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||qs.indexOf(this.tag)>=0}}]),e}(),Vs={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}} function Ws(e){return Object(c.h)(b.from(e).toHexString(),32)}function Gs(e){return no.encode(Object(c.b)([e,Object(c.e)(uo(uo(e)),0,4)]))}var Ys=new RegExp("^(ipfs)://(.*)$","i"),Ks=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Ys,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")] function Js(e,t){try{return _e($s(e,t))}catch(e){}return null}function $s(e,t){if("0x"===e)return null var r=b.from(Object(c.e)(e,t,t+32)).toNumber(),n=b.from(Object(c.e)(e,r,r+32)).toNumber() return Object(c.e)(e,r+32,r+32+n)}function Zs(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ds.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Qs(e){var t=Object(c.a)(e) if(t.length>32)throw new Error("internal; should not happen") var r=new Uint8Array(32) return r.set(t,32-t.length),r}function Xs(e){if(e.length%32==0)return e var t=new Uint8Array(32*Math.ceil(e.length/32)) return t.set(e),t}function eu(e){for(var t=[],r=0,n=0;n=1&&o<=75)return Gs(Object(c.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/) if(a){var s=parseInt(a[1],16) if(a[2].length===2*s&&s>=1&&s<=75)return Gs(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var u=n[1],l=n[0] if(0===l?20!==u&&32!==u&&(l=-1):l=-1,l>=0&&n.length===2+u&&u>=1&&u<=75){var f=gs.a.toWords(n.slice(2)) return f.unshift(l),gs.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16 break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de") case 5:if("0x"!==(r=t.sent)&&r!==Na){t.next=8 break}return t.abrupt("return",null) case 8:return t.abrupt("return",this.provider.formatter.callAddress(r)) case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==h.b.errors.CALL_EXCEPTION){t.next=15 break}return t.abrupt("return",null) case 15:throw t.t0 case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Ws(e)) case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21 break}return t.abrupt("return",null) case 21:return null==(i=this._getAddress(e,n))&&Ds.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",i) case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,f,h,d,p,m,v,y return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar") case 4:if(null!=(r=e.sent)){e.next=7 break}return e.abrupt("return",null) case 7:n=0 case 8:if(!(n=0?null:JSON.stringify({data:o,sender:i}),n.next=12,vs({url:c,errorPassThrough:!0},l,(function(e,t){return e.status=t.statusCode,e})) case 12:if(!(f=n.sent).data){n.next=15 break}return n.abrupt("return",f.data) case 15:if(d=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18 break}return n.abrupt("return",Ds.throwError("response not found during CCIP fetch: ".concat(d),h.b.errors.SERVER_ERROR,{url:u,errorMessage:d})) case 18:a.push(d) case 19:s++,n.next=6 break case 22:return n.abrupt("return",Ds.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a})) case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready() case 2:if(!(e>0)){t.next=20 break}case 3:if(!this._internalBlockNumber){t.next=20 break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r case 8:if(n=t.sent,!(Us()-n.respTime<=e)){t.next=11 break}return t.abrupt("return",n.blockNumber) case 11:return t.abrupt("break",20) case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18 break}return t.abrupt("break",20) case 18:t.next=3 break case 20:return i=Us(),o=M({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r var n=Us() return(t=b.from(t).toNumber())1e3)Ds.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",Ds.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n) else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i) return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e] "pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)})) r.push(i) break case"filter":if(!e._inflight){e._inflight=!0 var a=e.filter a.fromBlock=e._lastBlockNumber+1,a.toBlock=n,a.toBlock-o._maxFilterBlockRange>a.fromBlock&&(a.fromBlock=a.toBlock-o._maxFilterBlockRange) var s=o.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),o._emitted["b:"+t.blockHash]=t.blockNumber,o._emitted["t:"+t.transactionHash]=t.blockNumber,o.emit(a,t)}))})).catch((function(t){o.emit("error",t),e._inflight=!1})) r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return") case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ds.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})) case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready() case 2:return t=e.sent,e.next=5,this.detectNetwork() case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23 break}if(!this.anyNetwork){e.next=20 break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,zs(0) case 19:return e.abrupt("return",this._network) case 20:throw n=Ds.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n case 23:return e.abrupt("return",t) case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval") this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=Us() return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null)) case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e) case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5 break}return i.abrupt("return",o) case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],u=!1,c=function(){return!!u||(u=!0,s.forEach((function(e){e()})),!1)},l=function(e){e.confirmations0){var m=setTimeout((function(){c()||o(Ds.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r) m.unref&&m.unref(),s.push((function(){clearTimeout(m)}))}}))) case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0)) case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork() case 2:return e.next=4,this.perform("getGasPrice",{}) case 4:return t=e.sent,e.prev=5,e.abrupt("return",b.from(t)) case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0})) case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getBalance",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i)) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i).toNumber()) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork() case 2:return r.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(t)}) case 4:return n=r.sent,r.next=7,this.perform("getCode",n) case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(i)) case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0})) case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork() case 2:return n.next=4,M({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(c.g)(e)}))}) case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i) case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(o)) case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Ds.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0})) case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this if(null!=t&&32!==Object(c.d)(t))throw new Error("invalid response - sendTransaction") var i=e return null!=t&&e.hash!==t&&Ds.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return Ns(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o) case 6:if(null!=(a=n.sent)||0!==t){n.next=9 break}return n.abrupt("return",null) case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&Ds.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a) case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork() case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(c.i)(e)})) case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval) case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r}) case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i)) case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0 case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?b.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?Object(c.i)(e):null})))})),t.t0=this.formatter,t.next=12,M(n) case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1)) case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,M(r) case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1)) case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return Ns(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,f,d,p,m,v,y,g,w,_ return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&Ds.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:e}),i=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t}) case 4:if(o=n.sent,!(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(c.d)(o)%32==4)){n.next=31 break}for(n.prev=6,a=Object(c.e)(o,4),s=Object(c.e)(a,0,32),b.from(s).eq(i)||Ds.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),u=[],l=b.from(Object(c.e)(a,32,64)).toNumber(),f=b.from(Object(c.e)(a,l,l+32)).toNumber(),d=Object(c.e)(a,l+32),p=0;pthis._emitted.block)){e.next=10 break}return e.abrupt("return",null) case 10:return e.abrupt("return",void 0) case 11:if(!t){e.next=34 break}o=null,a=0 case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new Hs(Fs(e),t,r) return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&yu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:o}),t}function wu(e){return new Promise((function(t){setTimeout(t,e)}))}function _u(e){if(e.error){var t=new Error(e.error.message) throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function ku(e){return e?e.toLowerCase():e}var xu={},Ou=function(e){lu(r,e) var t=fu(r) function r(e,n,i){var o if(su(this,r),yu.checkNew(this instanceof r?this.constructor:void 0,r),o=t.call(this),e!==xu)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner") return S(du(o),"provider",n),null==i&&(i=0),"string"==typeof i?(S(du(o),"_address",o.provider.formatter.address(i)),S(du(o),"_index",null)):"number"==typeof i?(S(du(o),"_index",i),S(du(o),"_address",null)):yu.throwArgumentError("invalid address or index","addressOrIndex",i),o}return cu(r,[{key:"connect",value:function(e){return yu.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Eu(xu,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&yu.throwError("unknown account #"+e._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this e=j(e) var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e})) if(null==e.gasLimit){var n=j(e) n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return vu(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2 break}return t.abrupt("return",null) case 2:return t.next=4,this.provider.resolveName(e) case 4:return null==(r=t.sent)&&yu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r) case 7:case"end":return t.stop()}}),t,this)})))}))),M({tx:M(e),sender:r}).then((function(r){var n=r.tx,i=r.sender null!=n.from?n.from.toLowerCase()!==i&&yu.throwArgumentError("from address mismatch","transaction",e):n.from=i var o=t.provider.constructor.hexlifyTransaction(n,{from:!0}) return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return gu("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return yu.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval) case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e) case 5:return n=t.sent,t.prev=6,t.next=9,ys((function(){return vu(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n) case 2:if(null!==(t=e.sent)){e.next=5 break}return e.abrupt("return",void 0) case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r)) case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider}) case 9:return t.abrupt("return",t.sent) case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0 case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?ye(e):e,t.next=3,this.getAddress() case 3:return n=t.sent,t.next=6,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]) case 6:return t.abrupt("return",t.sent) case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_legacySignMessage",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?ye(e):e,t.next=3,this.getAddress() case 3:return n=t.sent,t.next=6,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]) case 6:return t.abrupt("return",t.sent) case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return vu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Xi.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)})) case 2:return i=n.sent,n.next=5,this.getAddress() case 5:return o=n.sent,n.next=8,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Xi.getPayload(i.domain,t,i.value))]) case 8:return n.abrupt("return",n.sent) case 9:case"end":return n.stop()}}),n,this)})))}},{key:"unlock",value:function(e){return vu(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress() case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null])) case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(yn),Eu=function(e){lu(r,e) var t=fu(r) function r(){return su(this,r),t.apply(this,arguments)}return cu(r,[{key:"sendTransaction",value:function(e){var t=this return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(Ou),Su={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Pu=function(e){lu(r,e) var t=fu(r) function r(e,n){var i su(this,r),yu.checkNew(this instanceof r?this.constructor:void 0,r) var o=n return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=P(i.constructor,"defaultUrl")()),S(du(i),"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(j(e))),i._nextId=42,i}return cu(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return vu(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wu(0) case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]) case 6:t=e.sent,e.next=19 break case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]) case 14:t=e.sent,e.next=19 break case 17:e.prev=17,e.t1=e.catch(11) case 19:if(null==t){e.next=28 break}return r=P(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(b.from(t).toNumber())) case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",yu.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2})) case 28:return e.abrupt("return",yu.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"})) case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new Ou(xu,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"} this.emit("debug",{action:"request",request:T(n),provider:this}) var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0 if(i&&this._cache[e])return this._cache[e] var o=vs(this.connection,JSON.stringify(n),_u).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e})) return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]] case"getGasPrice":return["eth_gasPrice",[]] case"getBalance":return["eth_getBalance",[ku(t.address),t.blockTag]] case"getTransactionCount":return["eth_getTransactionCount",[ku(t.address),t.blockTag]] case"getCode":return["eth_getCode",[ku(t.address),t.blockTag]] case"getStorageAt":return["eth_getStorageAt",[ku(t.address),t.position,t.blockTag]] case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]] case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]] case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]] case"call":return["eth_call",[P(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]] case"estimateGas":return["eth_estimateGas",[P(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]] case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=ku(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return vu(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8 break}if(!(n=t.transaction)||null==n.type||!b.from(n.type).isZero()){r.next=8 break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8 break}return r.next=6,this.getFeeData() case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=j(t)).transaction=j(n),delete t.transaction.type) case 8:return null==(o=this.prepareRequest(e,t))&&yu.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]) case 13:return r.abrupt("return",r.sent) case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",gu(e,r.t0,t)) case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),ou(pu(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]) this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null var n=Promise.resolve() return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return wu(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),ou(pu(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=j(Su) if(t)for(var n in t)t[n]&&(r[n]=!0) A(e,r) var i={} return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(c.g)(e[t]) "gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(c.i)(e[t]))})),e.accessList&&(i.accessList=Bn(e.accessList)),i}}]),r}(iu),Mu=null try{if(null==(Mu=WebSocket))throw new Error("inject please")}catch(e){var Au=new h.b("providers/5.6.4") Mu=function(){Au.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function ju(e){return(ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ru(e,t){for(var r=0;r=0&&(t.throttleRetry=!0),t}return e.result}function Yc(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response") throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var r=new Error("invalid response") throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error") throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function Kc(e){if("pending"===e)throw new Error("pending not supported") return"latest"===e?e:parseInt(e.substring(2),16)}function Jc(e,t,r){if("call"===e&&t.code===h.b.errors.SERVER_ERROR){var n=t.error if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(c.l)(i))return i Vc.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var o=t.message throw t.code===h.b.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&Vc.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Vc.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),o.match(/another transaction with same nonce/)&&Vc.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&Vc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var $c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fc(e,t)}(i,e) var t,r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=qc(e) if(t){var i=qc(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return Uc(this,r)}}(i) function i(e,t){var r return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Vc.checkNew(this instanceof i?this.constructor:void 0,i),S(zc(r=n.call(this,e)),"baseUrl",r.getBaseUrl()),S(zc(r),"apiKey",t||"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"),r}return t=i,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io" case"ropsten":return"https://api-ropsten.etherscan.io" case"rinkeby":return"https://api-rinkeby.etherscan.io" case"kovan":return"https://api-kovan.etherscan.io" case"goerli":return"https://api-goerli.etherscan.io"}return Vc.throwArgumentError("unsupported network","network",name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r] return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"" return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,r){return Hc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,c,l=this return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?Yc:Gc,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&Ss(),Promise.resolve(!0)}},u=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,vs(s,u,a||Yc) case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:T(c),provider:this}),n.abrupt("return",c) case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Hc(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network) case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return Bc(qc(i.prototype),"perform",r)}}}) return Hc(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l,f,d return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72 break case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"})) case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"})) case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag})) case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag})) case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag})) case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag})) case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Jc("sendTransaction",e,t.signedTransaction)}))) case 10:if(!t.blockTag){r.next=12 break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"})) case 12:throw new Error("getBlock by blockHash not implemented") case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash})) case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash})) case 15:if("latest"===t.blockTag){r.next=17 break}throw new Error("EtherscanProvider does not support blockTag for call") case 17:return(i=Wc(t.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0) case 23:return r.abrupt("return",r.sent) case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Jc("call",r.t1,t.transaction)) case 29:return(o=Wc(t.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0) case 35:return r.abrupt("return",r.sent) case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Jc("estimateGas",r.t2,t.transaction)) case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=Kc(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=Kc(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Vc.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"==typeof(s=t.filter.topics[0])&&66===s.length||Vc.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a) case 48:u=r.sent,c={},l=0 case 51:if(!(l0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t] e[t]=e[r],e[r]=n}return e}function Qc(e,t){for(var r=0;rt?null:(n+i)/2}function cl(e){if(null===e)return"null" if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e) if("string"==typeof e)return e if(b.isBigNumber(e))return e.toString() if(Array.isArray(e))return JSON.stringify(e.map((function(e){return cl(e)}))) if("object"===nl(e)){var t=Object.keys(e) return t.sort(),"{"+t.map((function(t){var r=e[t] return r="function"==typeof r?"[function]":cl(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+nl(e))}var ll=1 function fl(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)})) return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var hl=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],dl=["address","args","errorArgs","errorSignature","method","transaction"] function pl(e,t){var r={weight:e.weight} return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function ml(e,t,r){var n=cl switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=ul(t.map((function(e){return e.result})),2) if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber} case"getGasPrice":return function(e){var t=e.map((function(e){return e.result})) return t.sort(),t[Math.floor(t.length/2)]} case"getEtherPrice":return function(e){return ul(e.map((function(e){return e.result})))} case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=j(e)).confirmations=-1,cl(e))} break case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=j(e)).transactions=e.transactions.map((function(e){return(e=j(e)).confirmations=-1,e})),cl(e))}:function(e){return null==e?null:cl(e)} break default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={} r.forEach((function(t){var r=e(t.result) n[r]||(n[r]={count:0,result:t.result}),n[r].count++})) for(var i=Object.keys(n),o=0;o=t)return a.result}}}(n,e.quorum)}function vl(e,t){return il(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3 break}return r.abrupt("return",n) case 3:return r.abrupt("return",ys((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n})) case 4:case"end":return r.stop()}}),r)})))}function yl(e,t,r,n){return il(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?28:"getLogs"===i.t0?29:35 break case 4:return i.abrupt("return",o[r]()) case 5:if(!o.getEtherPrice){i.next=7 break}return i.abrupt("return",o.getEtherPrice()) case 7:return i.abrupt("break",35) case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=12 break}return i.next=11,vl(e,t) case 11:o=i.sent case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest")) case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=17 break}return i.next=16,vl(e,t) case 16:o=i.sent case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest")) case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=22 break}return i.next=21,vl(e,t) case 21:o=i.sent case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash)) case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=27 break}return i.next=26,vl(e,t) case 26:o=i.sent case 27:return i.abrupt("return",o[r](n.transaction)) case 28:return i.abrupt("return",o[r](n.transactionHash)) case 29:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){i.next=34 break}return i.next=33,vl(e,t) case 33:o=i.sent case 34:return i.abrupt("return",o.getLogs(a)) case 35:return i.abrupt("return",ol.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n})) case 36:case"end":return i.stop()}}),i)})))}var bl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xc(e,t)}(i,e) var t,r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 if(Reflect.construct.sham)return!1 if("function"==typeof Proxy)return!0 try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}() return function(){var r,n=rl(e) if(t){var i=rl(this).constructor r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments) return el(this,r)}}(i) function i(e,t){var r !function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),ol.checkNew(this instanceof i?this.constructor:void 0,i),0===e.length&&ol.throwArgumentError("missing providers","providers",e) var o=e.map((function(e,t){if(nn.isProvider(e)){var r=Os(e)?2e3:750 return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=j(e) null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Os(e)?2e3:750),null==n.weight&&(n.weight=1) var i=n.weight return(i%1||i>512||i<1)&&ol.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(n)})),a=o.reduce((function(e,t){return e+t.weight}),0) null==t?t=a/2:t>a&&ol.throwArgumentError("quorum will always fail; larger than total weight","quorum",t) var s=sl(o.map((function(e){return e.provider.network}))) return null==s&&(s=new Promise((function(e,t){setTimeout((function(){r.detectNetwork().then(e,t)}),0)}))),S(tl(r=n.call(this,s)),"providerConfigs",Object.freeze(o)),S(tl(r),"quorum",t),r._highestBlockNumber=-1,r}return t=i,(r=[{key:"detectNetwork",value:function(){return il(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()}))) case 2:return t=e.sent,e.abrupt("return",sl(t)) case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return il(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,c,l,f,d,p=this return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13 break}return r.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))}))) case 3:n=r.sent,i=0 case 5:if(!(i=p.quorum)){r.next=19 break}if(void 0===(d=a(h))){r.next=15 break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:d}) case 15:if(l){r.next=18 break}return r.next=18,fl(100).getPromise() case 18:l=!1 case 19:if(m=s.reduce((function(e,t){if(!t.done||null==t.error)return e var r=t.error.code return hl.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(m).forEach((function(e){var t=m[e] if(!(t.weight256)&&bf.throwArgumentError("invalid number type","type",t),n&&(o=256),r=b.from(r).toTwos(o),Object(c.p)(r,o/8)}if(i=t.match(mf)){var a=parseInt(i[1]) return(String(a)!==i[1]||0===a||a>32)&&bf.throwArgumentError("invalid bytes type","type",t),Object(c.a)(r).byteLength!==a&&bf.throwArgumentError("invalid value for ".concat(t),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=t.match(yf))&&Array.isArray(r)){var s=i[1] parseInt(i[2]||String(r.length))!=r.length&&bf.throwArgumentError("invalid array length for ".concat(t),"value",r) var u=[] return r.forEach((function(t){u.push(e(s,t,!0))})),Object(c.b)(u)}return bf.throwArgumentError("invalid type","type",t)}(e,t[n]))})),Object(c.i)(Object(c.b)(r))}function wf(e,t){return V(gf(e,t))}function _f(e,t){return uo(gf(e,t))}function kf(e){var t=ye(e) if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes") return Object(c.i)(Object(c.b)([t,Na]).slice(0,32))}function xf(e){var t=Object(c.a)(e) if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long") if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator") for(var r=31;0===t[r-1];)r-- return _e(t.slice(0,r))}var Of=new h.b("units/5.6.0"),Ef=["wei","kwei","mwei","gwei","szabo","finney","ether"] function Sf(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Of.throwArgumentError("invalid value","value",e) var r=t[0],n="" for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1) ""===r&&(r="0") var i="" for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1) for(var o=[];r.length;){if(r.length<=3){o.unshift(r) break}var a=r.length-3 o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function Pf(e,t){if("string"==typeof t){var r=Ef.indexOf(t);-1!==r&&(t=3*r)}return Ri(e,null!=t?t:18)}function Mf(e,t){if("string"!=typeof e&&Of.throwArgumentError("value must be a string","value",e),"string"==typeof t){var r=Ef.indexOf(t);-1!==r&&(t=3*r)}return Ti(e,null!=t?t:18)}function Af(e){return Pf(e,18)}function jf(e){return Mf(e,18)}var Rf="ethers/5.6.4",Tf=new h.b(Rf) try{var Cf=window null==Cf._ethers&&(Cf._ethers=u)}catch(e){}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c})) var n=r(1),i=r(3),o=r(203),a=new i.b(o.a),s=function(){if("undefined"!=typeof self)return self if("undefined"!=typeof window)return window if(void 0!==e)return e throw new Error("unable to locate global object")}(),u=s.crypto||s.msCrypto function c(e){(e<=0||e>1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e) var t=new Uint8Array(e) return u.getRandomValues(t),Object(n.a)(t)}u&&u.getRandomValues||(a.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(11))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c})) var n=r(0),i=r(2),o=r(206),a=new i.b(o.a),s=function(){if("undefined"!=typeof self)return self if("undefined"!=typeof window)return window if(void 0!==e)return e throw new Error("unable to locate global object")}(),u=s.crypto||s.msCrypto function c(e){(e<=0||e>1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e) var t=new Uint8Array(e) return u.getRandomValues(t),Object(n.a)(t)}u&&u.getRandomValues||(a.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(11))}]]) //# sourceMappingURL=vendor-b6c1985fa77fd791fa52e4512ecc5dca.map