diff --git a/ng-dist/main.js b/ng-dist/main.js index 36c48a4d..b458a736 100644 --- a/ng-dist/main.js +++ b/ng-dist/main.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"0MLR":function(n,e,t){"use strict";t.d(e,"a",function(){return a});var l=t("26FU"),r=t("K9Ia"),u=t("b/KA"),o=t("CcnG"),i=t("t/Na"),a=function(){function n(n,e){this.http=n,this.eos=e,this.selected=new l.a({}),this.lastUpdate=new r.a,this.accounts=[],this.usd_rate=10,this.fetchEOSprice(),this.eos.online.asObservable().subscribe(function(n){console.log("onlineStatus",n),n&&setTimeout(function(){},1e3)})}return n.parseEOS=function(n){return"EOS"===n.split(" ")[1]?parseFloat(n.split(" ")[0]):0},n.extendAccount=function(e){var t=0;e.tokens&&e.tokens.forEach(function(e){t+=n.parseEOS(e)});var l=n.parseEOS(e.total_resources.net_weight),r=n.parseEOS(e.total_resources.cpu_weight);return t+=l,t+=r,{name:e.account_name,full_balance:Math.round(1e4*t)/1e4,staked:l+r,details:e}},n.prototype.select=function(n){this.selected.next(this.accounts[n])},n.prototype.initFirst=function(){this.selected.next(this.accounts[0])},n.prototype.importAccounts=function(n){var e=this.eos.chainID,t={importedOn:new Date,updatedOn:new Date,accounts:n};localStorage.setItem("simpleos.accounts."+e,JSON.stringify(t)),this.loadLocalAccounts(n)},n.prototype.loadLocalAccounts=function(e){var t=this;e.length>0&&(this.accounts=[],e.forEach(function(e){t.accounts.push(e.details?e:n.extendAccount(e))}),this.refreshFromChain())},n.prototype.refreshFromChain=function(){var e=this,t=[];this.accounts.forEach(function(l,r){var u=new Promise(function(t,u){e.eos.getAccountInfo(l.name).then(function(o){e.eos.getTokens(l.name).then(function(u){e.eos.getRefunds(l.name).then(function(i){var a=null,s=0,c=0,d=0;i.rows.length>0&&(c=n.parseEOS(i.rows[0].cpu_amount),d=n.parseEOS(i.rows[0].cpu_amount),s+=c,s+=d,a=new Date(i.rows[0].request_time+".000Z")),u.forEach(function(e){s+=n.parseEOS(e)});var f=n.parseEOS(o.self_delegated_bandwidth.net_weight),h=n.parseEOS(o.self_delegated_bandwidth.cpu_weight);s+=f,s+=h,e.accounts[r].name=l.name,e.accounts[r].full_balance=Math.round(1e4*s)/1e4,e.accounts[r].staked=f+h,e.accounts[r].unstaking=c+d,e.accounts[r].unstakeTime=a,e.accounts[r].details=o,e.lastUpdate.next({account:l.name,timestamp:new Date}),t()})}).catch(function(n){console.log("Error on getTokens",n),u()})}).catch(function(n){console.log("Error on getAccountInfo",n),u()})});t.push(u)}),Promise.all(t).then(function(){e.eos.storeAccountData(e.accounts)})},n.prototype.fetchEOSprice=function(){var n=this;this.http.get("https://api.coinmarketcap.com/v2/ticker/1765/").subscribe(function(e){n.usd_rate=parseFloat(e.data.quotes.USD.price)})},n.ngInjectableDef=o.defineInjectable({factory:function(){return new n(o.inject(i.c),o.inject(u.a))},token:n,providedIn:"root"}),n}()},10:function(n,e,t){n.exports=t("zUnb")},"OHg/":function(n,e,t){"use strict";(function(n){t.d(e,"a",function(){return r}),t("0MLR"),t("b/KA");var l=t("wd/R"),r=function(){function e(n,t){this.aService=n,this.eos=t,this.openTX=e.openTXID,this.moment=l,this.actions=[],this.tokens=[],this.headBlock=0,this.fullBalance=0,this.staked=0,this.unstaked=0,this.LIB=0,this.blockTracker=null}return e.openTXID=function(n){window.shell.openExternal("https://eosflare.io/tx/"+n)},e.prototype.getInfo=function(){var n=this;this.eos.eos.getInfo({}).then(function(e){n.headBlock=e.head_block_num,n.LIB=e.last_irreversible_block_num})},e.prototype.ngOnInit=function(){var n=this;this.aService.lastUpdate.asObservable().subscribe(function(e){e.account===n.aService.selected.getValue().name&&n.updateBalances()}),this.getInfo(),this.blockTracker||(this.blockTracker=setInterval(function(){n.getInfo()},5e3))},e.prototype.ngOnDestroy=function(){this.blockTracker&&(clearInterval(this.blockTracker),this.blockTracker=null)},e.prototype.ngAfterViewInit=function(){var e=this;this.aService.selected.asObservable().subscribe(function(t){t.name&&n(function(){e.fullBalance=t.full_balance,e.staked=t.staked,e.unstaked=t.full_balance-t.staked,e.tokens=[],e.reloadActions(t.name),e.aService.refreshFromChain()})})},e.prototype.updateBalances=function(){var n=this.aService.selected.getValue();this.fullBalance=n.full_balance,this.staked=n.staked,this.unstaked=n.full_balance-n.staked},e.prototype.refresh=function(){this.reloadActions(this.aService.selected.getValue().name),this.aService.refreshFromChain()},e.prototype.registerSymbol=function(n,e){-1===this.tokens.findIndex(function(e){return e.name===n})&&this.tokens.push({name:n,contract:e,balance:""})},e.prototype.getTokenBalances=function(){var n=this;this.tokens.forEach(function(e,t){n.eos.eos.getCurrencyBalance(e.contract,n.aService.selected.getValue().name).then(function(e){n.tokens[t].balance=e[0]})})},e.prototype.reloadActions=function(n){var e=this;this.eos.eos.getActions({account_name:n,offset:200,pos:0}).then(function(n){e.actions=[];var t=["transfer","voteproducer","undelegatebw","delegatebw"];n.actions.forEach(function(n){var l=n.action_trace.act,r=n.action_trace.trx_id,u=n.block_num,o=n.block_time,i=l.account,a=l.name,s=0,c="",d="",f="",h="",p=null,m=null,g=null;"transfer"===a&&("eosio.token"===i?(s=l.data.quantity.split(" ")[0],c="EOS"):(s=l.data.quantity.split(" ")[0],c=l.data.quantity.split(" ")[1],e.registerSymbol(c,i)),h=l.data.memo,l.data.to===e.aService.selected.getValue().name?(d=l.data.from,f="received"):(d=l.data.to,f="sent")),"eosio"===i&&"voteproducer"===a&&(p=l.data.producers,m=l.data.proxy,g=l.data.voter,f="vote"),"eosio"===i&&"undelegatebw"===a&&(s=parseFloat(l.data.unstake_cpu_quantity.split(" ")[0])+parseFloat(l.data.unstake_net_quantity.split(" ")[0]),d=l.data.from,f="unstaked"),"eosio"===i&&"delegatebw"===a&&(s=parseFloat(l.data.stake_cpu_quantity.split(" ")[0])+parseFloat(l.data.stake_net_quantity.split(" ")[0]),d=l.data.from,f="staked");var v=!0;"transfer"===a&&"eosio.stake"===l.data.to&&(v=!1),t.includes(a)&&v&&-1===e.actions.findIndex(function(n){return n.id===r})&&e.actions.push({id:r,type:f,action_name:a,contract:i,user:d,block:u,date:o,amount:s,symbol:c,memo:h,votedProducers:p,proxy:m,voter:g})}),e.actions.reverse(),e.getTokenBalances()})},e}()}).call(this,t("URgk").setImmediate)},RnhZ:function(n,e,t){var l={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function r(n){var e=u(n);return t(e)}function u(n){var e=l[n];if(!(e+1)){var t=new Error('Cannot find module "'+n+'".');throw t.code="MODULE_NOT_FOUND",t}return e}r.keys=function(){return Object.keys(l)},r.resolve=u,n.exports=r,r.id="RnhZ"},ZECR:function(n,e,t){(function(e,t){var l;n.exports=function n(e,t,r){function u(i,a){if(!t[i]){if(!e[i]){if(!a&&"function"==typeof l&&l)return l(i,!0);if(o)return o(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var c=t[i]={exports:{}};e[i][0].call(c.exports,function(n){return u(e[i][1][n]||n)},c,c.exports,n,e,t,r)}return t[i].exports}for(var o="function"==typeof l&&l,i=0;i1&&void 0!==arguments[1])||arguments[1];if(u.equal(void 0===e?"undefined":(0,r.default)(e),"string","account string required"),0==t&&null!=l[e])return Promise.resolve(l[e]);if(null==n){var o=l[e];return u(o,"Missing ABI for account: "+e+", provide httpEndpoint or add to abiCache"),Promise.resolve(o)}return n.getAbi(e).then(function(n){return u(n.abi,"Missing ABI for account: "+e),i(e,n.abi)})},abi:i}}}).call(this,{isBuffer:n("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":159,"./structs":8,assert:10,"babel-runtime/helpers/typeof":16}],2:[function(n,e,t){"use strict";var l=u(n("babel-runtime/helpers/slicedToArray")),r=u(n("babel-runtime/helpers/typeof"));function u(n){return n&&n.__esModule?n:{default:n}}var o=n("assert"),i=n("bytebuffer").Long;function a(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if("number"==typeof n){if(n>Number.MAX_SAFE_INTEGER)throw new TypeError("value parameter overflow");n=i.fromString(String(n),e,t)}else if("string"==typeof n)n=i.fromString(n,e,t);else if(!i.isLong(n))throw new TypeError("value parameter is a requied Long, Number or String");return n}e.exports={ULong:a,isName:function(n,e){try{return d(n),!0}catch(n){return e&&e(n),!1}},encodeName:d,decodeName:f,encodeNameHex:function(n){return i.fromString(d(n),!0).toString(16)},decodeNameHex:function(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(i.fromString(n,!0,16).toString(),e)},DecimalString:h,DecimalPad:p,DecimalImply:function(n,e){return p(n,e).replace(".","")},DecimalUnimply:function(n,e){o(null!=n,"value is required"),n="object"===n&&n.toString?n.toString():String(n);var t=/^-/.test(n);t&&(n=n.substring(1)),o(/^\d+$/.test(n),"invalid whole number "+n),o(null!=e,"precision required"),o(e>=0&&e<=18,"Precision should be 18 characters or less");var l=e-n.length;l>0&&(n=""+"0".repeat(l)+n);var r=n.length-e;return n=n.slice(0,r)+"."+n.slice(r),(t?"-":"")+p(n,e)},printAsset:m,parseAsset:function(n){var e=n.split(" "),t=(0,l.default)(e,1)[0].match(/^(-?[0-9]+(\.[0-9]+)?)( |$)/),r=t?t[1]:null,u=n.match(/(^| )([0-9]+),([A-Z]+)(@|$)/),i=u?Number(u[2]):null,a=r?(r.split(".")[1]||"").length:null,s=null!=i?i:a,c=n.match(/(^| |,)([A-Z]+)(@|$)/),d=c?c[2]:null,f=n.split("@"),h=(0,l.default)(f,2)[1],p=/^[a-z0-5]+(\.[a-z0-5]+)*$/.test(h)?h:null,g=m({amount:r,precision:s,symbol:d,contract:p});return o.equal(n,g,"Invalid asset string: "+n+" !== "+g),null!=s&&o(s>=0&&s<=18,"Precision should be 18 characters or less"),null!=d&&o(d.length<=7,"Asset symbol is 7 characters or less"),null!=p&&o(p.length<=12,"Contract is 12 characters or less"),{amount:r,precision:s,symbol:d,contract:p}}};var s=".12345abcdefghijklmnopqrstuvwxyz",c=function(n){var e=s.indexOf(n);if(-1===e)throw new TypeError("Invalid character: '"+n+"'");return e};function d(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("string"!=typeof n)throw new TypeError("name parameter is a required string");if(n.length>12)throw new TypeError("A name can be up to 12 characters long");for(var t="",l=0;l<=12;l++){var r=lu)throw new TypeError("Invalid name "+n);t+=o="0".repeat(u-o.length)+o}var a=i.fromString(t,!0,2),s="",d=e?a.toBytesLE():a.toBytesBE(),f=!0,h=!1,p=void 0;try{for(var m,g=d[Symbol.iterator]();!(f=(m=g.next()).done);f=!0){var v=Number(m.value).toString(16);s+=(1===v.length?"0":"")+v}}catch(n){h=!0,p=n}finally{try{!f&&g.return&&g.return()}finally{if(h)throw p}}return i.fromString(s,!0,16).toString().toString()}function f(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n=a(n);var t="",l=e?n.toBytesLE():n.toBytesBE(),r=!0,u=!1,o=void 0;try{for(var c,d=l[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var f=Number(c.value).toString(16);t+=(1===f.length?"0":"")+f}}catch(n){u=!0,o=n}finally{try{!r&&d.return&&d.return()}finally{if(u)throw o}}t+="0".repeat(16-t.length);for(var h=i.fromNumber(31,!0),p=i.fromNumber(15,!0),m="",g=i.fromString(t,!0,16),v=0;v<=12;v++)m=s[g.and(0===v?p:h)]+m,g=g.shiftRight(0===v?4:5);return m.replace(/\.+$/,"")}function h(n){o(null!=n,"value is required"),n="object"===n&&n.toString?n.toString():String(n);var e=/^-/.test(n);e&&(n=n.substring(1)),"."===n[0]&&(n="0"+n);var t=n.split(".");return o(t.length<=2,"invalid decimal "+n),o(/^\d+(,?\d)*\d*$/.test(t[0]),"invalid decimal "+n),2===t.length&&(o(/^\d*$/.test(t[1]),"invalid decimal "+n),t[1]=t[1].replace(/0+$/,""),""===t[1]&&t.pop()),t[0]=t[0].replace(/^0*/,""),""===t[0]&&(t[0]="0"),(e?"-":"")+t.join(".")}function p(n,e){var t=h(n);if(null==e)return n;o(e>=0&&e<=18,"Precision should be 18 characters or less");var l=t.split(".");if(0===e&&1===l.length)return l[0];if(1===l.length)return l[0]+"."+"0".repeat(e);var r=e-l[1].length;return o(r>=0,"decimal '"+t+"' exceeds precision "+e),l[0]+"."+l[1]+"0".repeat(r)}function m(n){var e=n.amount,t=n.precision,l=n.symbol,u=n.contract;o.equal(void 0===l?"undefined":(0,r.default)(l),"string","symbol is a required string"),null!=e&&null!=t&&(e=p(e,t));var i=function(n,e){return null==n?"":null==e?"":n+e};return null!=e?i(e," ")+l+i("@",u):i(t,",")+l+i("@",u)}},{assert:10,"babel-runtime/helpers/slicedToArray":15,"babel-runtime/helpers/typeof":16,bytebuffer:45}],3:[function(n,e,t){"use strict";var l=u(n("babel-runtime/regenerator")),r=u(n("babel-runtime/helpers/typeof"));function u(n){return n&&n.__esModule?n:{default:n}}var o=n("eosjs-ecc"),i=n("fcbuffer"),a=n("eosjs-api"),s=n("assert"),c=n("./structs"),d=n("./abi-cache"),f=n("./write-api"),h=n("./format"),p=n("./schema"),m=n("../package.json"),g=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={log:(n=Object.assign({},{httpEndpoint:"http://127.0.0.1:8888",debug:!1,verbose:!1,broadcast:!0,sign:!0},n)).verbose?console.log:null,error:console.error};return n.logger=Object.assign({},e,n.logger),function(n){var e=null!=n.httpEndpoint?a(n):null;n.network=e;var t=d(e,n);if(n.abiCache=t,n.chainId||(n.chainId="cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f"),e&&function(n,e,t){n.getInfo({}).then(function(n){n.chain_id!==e&&t.error&&t.error("chainId mismatch, signatures will not match transaction authority. expected "+e+" !== actual "+n.chain_id)}).catch(function(n){t.error&&t.error(n)})}(e,n.chainId,n.logger),null!=n.mockTransactions){if("string"==typeof n.mockTransactions){var l=n.mockTransactions;n.mockTransactions=function(){return l}}s.equal((0,r.default)(n.mockTransactions),"function","config.mockTransactions")}var u=c(n),o=u.structs,i=u.types,m=u.fromBuffer,g=u.toBuffer,b=function(n,e,t){var l=n.network,r=Object.assign({},l),u=f(e,l,t,n,p);return function(n,e,t){for(var l in n)if(e[l])throw new TypeError("Conflicting methods in EosApi and Transaction Api: "+l)}(r,u),Object.assign(r,u),r}(n,a,o);return Object.assign(b,{fc:{structs:o,types:i,fromBuffer:m,toBuffer:g,abiCache:t}}),Object.assign(b,{modules:{format:h}}),n.signProvider||(n.signProvider=v(b,n)),b}(n)};e.exports=g,Object.assign(g,{version:m.version,modules:{format:h,api:a,ecc:o,json:{api:a.api,schema:p},Fcbuffer:i},Testnet:function(n){return console.error("deprecated, change Eos.Testnet(..) to just Eos(..)"),g(n)},Localnet:function(n){return console.error("deprecated, change Eos.Localnet(..) to just Eos(..)"),g(n)}});var v=function(n,e){return function(t){var r,u,i,a,c,d,f,h,p,m,g,v,b,y,_,w,C=t.sign,E=t.buf,A=t.transaction;return l.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.keyProvider){t.next=3;break}throw new TypeError("This transaction requires a config.keyProvider for signing");case 3:return u=r,"function"==typeof r&&(u=r({transaction:A})),t.next=7,l.default.awrap(Promise.resolve(u));case 7:if(u=t.sent,Array.isArray(u)||(u=[u]),(u=u.map(function(n){try{return{private:o.PrivateKey(n).toString()}}catch(e){return{public:o.PublicKey(n).toString()}}s(!1,"expecting public or private keys from keyProvider")})).length){t.next=12;break}throw new Error("missing key, check your keyProvider");case 12:if(1!==u.length||!u[0].private){t.next=15;break}return t.abrupt("return",C(E,u[0].private));case 15:if(null!=e.httpEndpoint){t.next=37;break}for(i=[],a=!0,c=!1,d=void 0,t.prev=20,f=u[Symbol.iterator]();!(a=(h=f.next()).done);a=!0)i.push(C(E,h.value.private));t.next=28;break;case 24:t.prev=24,t.t0=t.catch(20),c=!0,d=t.t0;case 28:t.prev=28,t.prev=29,!a&&f.return&&f.return();case 31:if(t.prev=31,!c){t.next=34;break}throw d;case 34:return t.finish(31);case 35:return t.finish(28);case 36:return t.abrupt("return",i);case 37:for(p=new Map,m=!0,g=!1,v=void 0,t.prev=41,b=u[Symbol.iterator]();!(m=(y=b.next()).done);m=!0)null!=(_=y.value).private?p.set(o.privateToPublic(_.private),_.private):p.set(_.public,null);t.next=49;break;case 45:t.prev=45,t.t1=t.catch(41),g=!0,v=t.t1;case 49:t.prev=49,t.prev=50,!m&&b.return&&b.return();case 52:if(t.prev=52,!g){t.next=55;break}throw v;case 55:return t.finish(52);case 56:return t.finish(49);case 57:return w=Array.from(p.keys()),t.abrupt("return",n.getRequiredKeys(A,w).then(function(n){var e=n.required_keys;if(!e.length)throw new Error("missing required keys for "+JSON.stringify(A));var t=[],l=[],u=!0,i=!1,a=void 0;try{for(var c,d=e[Symbol.iterator]();!(u=(c=d.next()).done);u=!0){var f=c.value;f=o.PublicKey(f).toString();var h=p.get(f);h?t.push(h):l.push(f)}}catch(n){i=!0,a=n}finally{try{!u&&d.return&&d.return()}finally{if(i)throw a}}0!==l.length&&(s("function"==typeof r,"keyProvider function is needed for private key lookup"),r({pubkeys:l}).forEach(function(n){t.push(n)}));var m=[],g=!0,v=!1,b=void 0;try{for(var y,_=t[Symbol.iterator]();!(g=(y=_.next()).done);g=!0)m.push(C(E,y.value))}catch(n){v=!0,b=n}finally{try{!g&&_.return&&_.return()}finally{if(v)throw b}}return m}));case 59:case"end":return t.stop()}},null,this,[[20,24,28,36],[29,,31,35],[41,45,49,57],[50,,52,56]])}}},{"../package.json":206,"./abi-cache":1,"./format":2,"./schema":7,"./structs":8,"./write-api":9,assert:10,"babel-runtime/helpers/typeof":16,"babel-runtime/regenerator":17,"eosjs-api":134,"eosjs-ecc":143,fcbuffer:152}],4:[function(n,e,t){e.exports={name:"uint64",checksum160:"fixed_bytes20",checksum256:"fixed_bytes32",checksum512:"fixed_bytes64",signature:"fixed_bytes65",public_key:"fixed_bytes33",message_type:"fixed_string16",symbol:"uint64",symbol_code:"uint64",field_name:"string",account_name:"name",permission_name:"name",type_name:"string",token_name:"name",table_name:"name",scope_name:"name",action_name:"name",time_point:"int64",time_point_sec:"time",timestamp:"uint32",block_timestamp_type:"timestamp",block_id:"fixed_bytes32",checksum_type:"fixed_bytes32",checksum256_type:"fixed_bytes32",checksum512_type:"fixed_bytes64",checksum160_type:"fixed_bytes20",sha256:"fixed_bytes32",sha512:"fixed_bytes64",sha160:"fixed_bytes20",weight_type:"uint16",block_num_type:"uint32",share_type:"int64",digest_type:"checksum_type",context_free_type:"bytes",unsigned_int:"varuint32",bool:"uint8",extensions_type:{base:"",fields:{type:"uint16",data:"bytes"}},transaction_header:{base:"",fields:{expiration:"time",ref_block_num:"uint16",ref_block_prefix:"uint32",net_usage_words:"unsigned_int",max_cpu_usage_ms:"uint8",delay_sec:"unsigned_int"}},transaction:{base:"transaction_header",fields:{context_free_actions:"action[]",actions:"action[]",transaction_extensions:"extensions_type[]"}},signed_transaction:{base:"transaction",fields:{signatures:"signature[]",context_free_data:"bytes[]"}},fields:"field_def[]",field_def:{fields:{name:"field_name",type:"type_name"}},asset:{fields:{amount:"share_type",sym:"symbol"}},producer_key:{fields:{producer_name:"account_name",block_signing_key:"public_key"}},producer_schedule:{fields:{version:"uint32",producers:"producer_key[]"}},chain_config:{fields:{target_block_size:"uint32",max_block_size:"uint32",target_block_acts_per_scope:"uint32",max_block_acts_per_scope:"uint32",target_block_acts:"uint32",max_block_acts:"uint32",real_threads:"uint64",max_storage_size:"uint64",max_transaction_lifetime:"uint32",max_authority_depth:"uint16",max_transaction_exec_time:"uint32",max_inline_depth:"uint16",max_inline_action_size:"uint32",max_generated_transaction_size:"uint32"}},type_def:{base:"",fields:{new_type_name:"type_name",type:"type_name"}},struct_def:{base:"",fields:{name:"type_name",base:"type_name",fields:"field_def[]"}},clause_pair:{base:"",fields:{id:"string",body:"string"}},error_message:{base:"",fields:{error_code:"uint64",error_msg:"string"}},abi_def:{base:"",fields:{version:"string",types:"type_def[]",structs:"struct_def[]",actions:"action_def[]",tables:"table_def[]",ricardian_clauses:"clause_pair[]",error_messages:"error_message[]",abi_extensions:"extensions_type[]"}},table_def:{base:"",fields:{name:"table_name",index_type:"type_name",key_names:"field_name[]",key_types:"type_name[]",type:"type_name"}},action:{base:"",fields:{account:"account_name",name:"action_name",authorization:"permission_level[]",data:"bytes"}},action_def:{base:"",fields:{name:"action_name",type:"type_name",ricardian_contract:"string"}},block_header:{base:"",fields:{previous:"checksum256",timestamp:"timestamp",transaction_mroot:"checksum256",action_mroot:"checksum256",block_mroot:"checksum256",producer:"account_name",schedule_version:"uint32",new_producers:"producer_schedule?"}},packed_transaction:{fields:{signatures:"signature[]",compression:"uint8",packed_context_free_data:"bytes",packed_trx:"bytes"}},nonce:{action:{name:"nonce",account:"eosio.null"},fields:{value:"string"}}}},{}],5:[function(n,e,t){e.exports={account_name:"name",action_name:"name",authority:{base:"",fields:{threshold:"uint32",keys:"key_weight[]",accounts:"permission_level_weight[]",waits:"wait_weight[]"}},bidname:{base:"",action:{name:"bidname",account:"eosio"},fields:{bidder:"account_name",newname:"account_name",bid:"asset"}},blockchain_parameters:{base:"",fields:{max_block_net_usage:"uint64",target_block_net_usage_pct:"uint32",max_transaction_net_usage:"uint32",base_per_transaction_net_usage:"uint32",net_usage_leeway:"uint32",context_free_discount_net_usage_num:"uint32",context_free_discount_net_usage_den:"uint32",max_block_cpu_usage:"uint32",target_block_cpu_usage_pct:"uint32",max_transaction_cpu_usage:"uint32",min_transaction_cpu_usage:"uint32",max_transaction_lifetime:"uint32",deferred_trx_expiration_window:"uint32",max_transaction_delay:"uint32",max_inline_action_size:"uint32",max_inline_action_depth:"uint16",max_authority_depth:"uint16"}},buyram:{base:"",action:{name:"buyram",account:"eosio"},fields:{payer:"account_name",receiver:"account_name",quant:"asset"}},buyrambytes:{base:"",action:{name:"buyrambytes",account:"eosio"},fields:{payer:"account_name",receiver:"account_name",bytes:"uint32"}},canceldelay:{base:"",action:{name:"canceldelay",account:"eosio"},fields:{canceling_auth:"permission_level",trx_id:"transaction_id_type"}},claimrewards:{base:"",action:{name:"claimrewards",account:"eosio"},fields:{owner:"account_name"}},connector:{base:"",fields:{balance:"asset",weight:"float64"}},delegatebw:{base:"",action:{name:"delegatebw",account:"eosio"},fields:{from:"account_name",receiver:"account_name",stake_net_quantity:"asset",stake_cpu_quantity:"asset",transfer:"bool"}},delegated_bandwidth:{base:"",fields:{from:"account_name",to:"account_name",net_weight:"asset",cpu_weight:"asset"}},deleteauth:{base:"",action:{name:"deleteauth",account:"eosio"},fields:{account:"account_name",permission:"permission_name"}},eosio_global_state:{base:"blockchain_parameters",fields:{max_ram_size:"uint64",total_ram_bytes_reserved:"uint64",total_ram_stake:"int64",last_producer_schedule_update:"block_timestamp_type",last_pervote_bucket_fill:"uint64",pervote_bucket:"int64",perblock_bucket:"int64",total_unpaid_blocks:"uint32",total_activated_stake:"int64",thresh_activated_stake_time:"uint64",last_producer_schedule_size:"uint16",total_producer_vote_weight:"float64",last_name_close:"block_timestamp_type"}},exchange_state:{base:"",fields:{supply:"asset",base:"connector",quote:"connector"}},key_weight:{base:"",fields:{key:"public_key",weight:"weight_type"}},linkauth:{base:"",action:{name:"linkauth",account:"eosio"},fields:{account:"account_name",code:"account_name",type:"action_name",requirement:"permission_name"}},namebid_info:{base:"",fields:{newname:"account_name",high_bidder:"account_name",high_bid:"int64",last_bid_time:"uint64"}},newaccount:{base:"",action:{name:"newaccount",account:"eosio"},fields:{creator:"account_name",name:"account_name",owner:"authority",active:"authority"}},onerror:{base:"",action:{name:"onerror",account:"eosio"},fields:{sender_id:"uint128",sent_trx:"bytes"}},permission_level:{base:"",fields:{actor:"account_name",permission:"permission_name"}},permission_level_weight:{base:"",fields:{permission:"permission_level",weight:"weight_type"}},permission_name:"name",producer_info:{base:"",fields:{owner:"account_name",total_votes:"float64",producer_key:"public_key",is_active:"bool",url:"string",unpaid_blocks:"uint32",last_claim_time:"uint64",location:"uint16"}},producer_key:{base:"",fields:{producer_name:"account_name",block_signing_key:"public_key"}},refund:{base:"",action:{name:"refund",account:"eosio"},fields:{owner:"account_name"}},refund_request:{base:"",fields:{owner:"account_name",request_time:"time_point_sec",net_amount:"asset",cpu_amount:"asset"}},regproducer:{base:"",action:{name:"regproducer",account:"eosio"},fields:{producer:"account_name",producer_key:"public_key",url:"string",location:"uint16"}},regproxy:{base:"",action:{name:"regproxy",account:"eosio"},fields:{proxy:"account_name",isproxy:"bool"}},require_auth:{base:"",action:{name:"reqauth",account:"eosio"},fields:{from:"account_name"}},rmvproducer:{base:"",action:{name:"rmvproducer",account:"eosio"},fields:{producer:"account_name"}},sellram:{base:"",action:{name:"sellram",account:"eosio"},fields:{account:"account_name",bytes:"uint64"}},set_account_limits:{base:"",action:{name:"setalimits",account:"eosio"},fields:{account:"account_name",ram_bytes:"int64",net_weight:"int64",cpu_weight:"int64"}},set_global_limits:{base:"",action:{name:"setglimits",account:"eosio"},fields:{cpu_usec_per_period:"int64"}},set_producers:{base:"",action:{name:"setprods",account:"eosio"},fields:{schedule:"producer_key[]"}},setabi:{base:"",action:{name:"setabi",account:"eosio"},fields:{account:"account_name",abi:"bytes"}},setcode:{base:"",action:{name:"setcode",account:"eosio"},fields:{account:"account_name",vmtype:"uint8",vmversion:"uint8",code:"bytes"}},setparams:{base:"",action:{name:"setparams",account:"eosio"},fields:{params:"blockchain_parameters"}},setpriv:{base:"",action:{name:"setpriv",account:"eosio"},fields:{account:"account_name",is_priv:"int8"}},setram:{base:"",action:{name:"setram",account:"eosio"},fields:{max_ram_size:"uint64"}},total_resources:{base:"",fields:{owner:"account_name",net_weight:"asset",cpu_weight:"asset",ram_bytes:"uint64"}},transaction_id_type:"checksum256",undelegatebw:{base:"",action:{name:"undelegatebw",account:"eosio"},fields:{from:"account_name",receiver:"account_name",unstake_net_quantity:"asset",unstake_cpu_quantity:"asset"}},unlinkauth:{base:"",action:{name:"unlinkauth",account:"eosio"},fields:{account:"account_name",code:"account_name",type:"action_name"}},unregprod:{base:"",action:{name:"unregprod",account:"eosio"},fields:{producer:"account_name"}},updateauth:{base:"",action:{name:"updateauth",account:"eosio"},fields:{account:"account_name",permission:"permission_name",parent:"permission_name",auth:"authority"}},user_resources:{base:"",fields:{owner:"account_name",net_weight:"asset",cpu_weight:"asset",ram_bytes:"uint64"}},voteproducer:{base:"",action:{name:"voteproducer",account:"eosio"},fields:{voter:"account_name",proxy:"account_name",producers:"account_name[]"}},voter_info:{base:"",fields:{owner:"account_name",proxy:"account_name",producers:"account_name[]",staked:"int64",last_vote_weight:"float64",proxied_vote_weight:"float64",is_proxy:"bool"}},wait_weight:{base:"",fields:{wait_sec:"uint32",weight:"weight_type"}},weight_type:"uint16"}},{}],6:[function(n,e,t){e.exports={account:{base:"",fields:{balance:"asset"}},account_name:"name",create:{base:"",action:{name:"create",account:"eosio.token"},fields:{issuer:"account_name",maximum_supply:"asset"}},currency_stats:{base:"",fields:{supply:"asset",max_supply:"asset",issuer:"account_name"}},issue:{base:"",action:{name:"issue",account:"eosio.token"},fields:{to:"account_name",quantity:"asset",memo:"string"}},transfer:{base:"",action:{name:"transfer",account:"eosio.token"},fields:{from:"account_name",to:"account_name",quantity:"asset",memo:"string"}}}},{}],7:[function(n,e,t){"use strict";var l=Object.assign({},n("./chain_types.json"),n("./eosio_system.json"),n("./eosio_token.json"));e.exports=l},{"./chain_types.json":4,"./eosio_system.json":5,"./eosio_token.json":6}],8:[function(n,e,t){(function(t){"use strict";var l=u(n("babel-runtime/helpers/slicedToArray")),r=u(n("babel-runtime/helpers/typeof"));function u(n){return n&&n.__esModule?n:{default:n}}var o=n("eosjs-ecc"),i=o.Signature,a=o.PublicKey,s=n("fcbuffer"),c=n("bytebuffer"),d=n("assert"),f={schema:n("./schema")},h=n("./format"),p=h.encodeName,m=h.decodeName,g=h.DecimalPad,v=h.DecimalImply,b=h.DecimalUnimply,y=h.printAsset,_=h.parseAsset;e.exports=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],t=function(e,t){if(new Set(["eosio","eosio.token","eosio.null"]).has(t))return a[e];var l=n.abiCache.abi(t),r=l.structs[e];if(null!=r)return r;var u=!0,o=!1,i=void 0;try{for(var s,c=l.abi.actions[Symbol.iterator]();!(u=(s=c.next()).done);u=!0){var d=s.value;if(d.name===e){var f=l.structs[d.type];if(null!=f)return f}}}catch(n){o=!0,i=n}finally{try{!u&&c.return&&c.return()}finally{if(o)throw i}}throw new Error("Missing ABI struct or action: "+e)},l=null==n.forceActionDataHex||n.forceActionDataHex,r=Object.assign({},B,D(t),I(n),T(t,l),n.override),u=Object.assign({},{name:function(){return[w]},public_key:function(){return[C(E)]},symbol:function(){return[A]},extended_symbol:function(){return[x]},asset:function(){return[k]},extended_asset:function(){return[S]},signature:function(){return[C(F)]}},n.customTypes);(n=Object.assign({override:r},{customTypes:u},n)).sort=Object.assign({},n.sort),n.sort["action.authorization"]=!0,n.sort["signed_transaction.signature"]=!0,n.sort["authority.accounts"]=!0,n.sort["authority.keys"]=!0;var o=Object.assign({},f.schema,e),i=s(o,n),a=i.structs,c=i.types,d=i.errors,h=i.fromBuffer,p=i.toBuffer;if(0!==d.length)throw new Error(JSON.stringify(d,null,4));return{structs:a,types:c,fromBuffer:h,toBuffer:p}};var w=function(n){return{fromByteBuffer:function(n){return m(n.readUint64(),!1)},appendByteBuffer:function(n,e){n.writeUint64(p(e,!1))},fromObject:function(n){return n},toObject:function(e){return n.defaults&&null==e?"":e}}},C=function(){for(var n=arguments.length,e=Array(n),t=0;t, got: "+(void 0===n?"undefined":(0,r.default)(n)));var t=e.amount,l=e.precision,u=e.symbol,o=e.contract;return d(null!=t,"missing amount"),d(null!=l,"missing precision"),d(null!=u,"missing symbol"),d(null!=o,"missing contract"),{amount:t,precision:l,symbol:u,contract:o}},toObject:function(e){if(n.defaults&&null==e)return{amount:"1.0000",precision:4,symbol:"SYS",contract:"eosio.token"};d.equal(void 0===e?"undefined":(0,r.default)(e),"object","expecting extended_asset object");var t=e.precision,l=e.symbol,u=e.contract;return{amount:g(e.amount,t),precision:t,symbol:l,contract:u}}}},F=function(n,e){var t=e.fixed_bytes65(n);return{fromByteBuffer:function(n){var e=t.fromByteBuffer(n);return i.from(e).toString()},appendByteBuffer:function(n,e){var l=i.from(e);t.appendByteBuffer(n,l.toBuffer())},fromObject:function(n){return i.from(n).toString()},toObject:function(e){return n.defaults&&null==e?"SIG_K1_bas58signature..":i.from(e).toString()}}},B={"authority.fromObject":function(n){if(a.fromString(n))return{threshold:1,keys:[{key:n,weight:1}]};if("string"==typeof n){var e=n.split("@"),t=(0,l.default)(e,2),r=t[1];return{threshold:1,accounts:[{permission:{actor:t[0],permission:void 0===r?"active":r},weight:1}]}}}},D=function(n){return{"abi.fromObject":function(n){return"string"==typeof n?JSON.parse(n):t.isBuffer(n)?JSON.parse(n.toString()):void 0},"setabi.abi.appendByteBuffer":function(e){var t=e.object,l=e.b,r=n("abi_def","eosio"),u=new c(c.DEFAULT_CAPACITY,c.LITTLE_ENDIAN);r.appendByteBuffer(u,t.abi),l.writeVarint32(u.offset),l.append(u.copy(0,u.offset),"binary")}}},I=function(n){return{"setcode.code.fromObject":function(e){var l=e.object,r=e.result;try{var u=l.code.toString();if(/^\s*\(module/.test(u)){var o=n.binaryen;d(null!=o,'required: config.binaryen = require("binaryen")'),n.debug&&console.log("Assembling WASM..");var i=t.from(o.parseText(u).emitBinary());r.code=i}else r.code=l.code}catch(n){throw console.error(n,l.code),n}}}},T=function(n,e){return{"action.data.fromByteBuffer":function(e){var l=e.object,r=e.b,u=e.config,o=""==(l.name||"")?e.fields.data:n(l.name,l.account);if(o)r.readVarint32(),l.data=o.fromByteBuffer(r,u);else{var i=r.readVarint32(),a=r.copy(r.offset,r.offset+i);r.skip(i),l.data=t.from(a.toBinary(),"binary")}},"action.data.appendByteBuffer":function(e){var l=e.object,r=e.b,u=""==(l.name||"")?e.fields.data:n(l.name,l.account);if(u){var o=new c(c.DEFAULT_CAPACITY,c.LITTLE_ENDIAN);u.appendByteBuffer(o,l.data),r.writeVarint32(o.offset),r.append(o.copy(0,o.offset),"binary")}else{var i="string"==typeof l.data?new t(l.data,"hex"):l.data;if(!t.isBuffer(i))throw new TypeError("Unknown struct '"+l.name+"' for contract '"+l.account+"', locate this struct or provide serialized action.data");r.writeVarint32(i.length),r.append(i.toString("binary"),"binary")}},"action.data.fromObject":function(e){var l=e.object,u=e.result,o=l.data,i=l.name,a=""==(i||"")?e.fields.data:n(i,l.account);if(a)if("object"===(void 0===o?"undefined":(0,r.default)(o)))u.data=a.fromObject(o);else{if("string"!=typeof o)throw new TypeError("Expecting hex string or object in action.data");var c=new t(o,"hex");u.data=s.fromBuffer(a,c)}else u.data=o},"action.data.toObject":function(l){var r=l.object,u=l.result,o=l.config,i=r||{},a=i.data,s=i.name,d=""==(s||"")?l.fields.data:n(s,r.account);if(d){if(e){var f=new c(c.DEFAULT_CAPACITY,c.LITTLE_ENDIAN);return a&&d.appendByteBuffer(f,a),void(u.data=f.copy(0,f.offset).toString("hex"))}u.data=d.toObject(a,o)}else u.data=t.isBuffer(a)?a.toString("hex"):a}}}}).call(this,n("buffer").Buffer)},{"./format":2,"./schema":7,assert:10,"babel-runtime/helpers/slicedToArray":15,"babel-runtime/helpers/typeof":16,buffer:44,bytebuffer:45,"eosjs-ecc":143,fcbuffer:152}],9:[function(n,e,t){(function(t){"use strict";var l=o(n("babel-runtime/helpers/slicedToArray")),r=o(n("babel-runtime/regenerator")),u=o(n("babel-runtime/helpers/typeof"));function o(n){return n&&n.__esModule?n:{default:n}}var i=n("assert"),a=n("eosjs-ecc"),s=n("fcbuffer"),c=n("create-hash"),d=n("eosjs-api").processArgs,f=n("./structs");e.exports=function(n,e,o,b,y){if("string"!=typeof b.chainId)throw new TypeError("config.chainId is required");var _=function(n,e,o,b){var y=function(n,e){return function(){for(var n=arguments.length,t=Array(n),l=0;l1&&"function"==typeof t[t.length-1]&&(c=t.pop()),t.length>1&&"object"===(0,u.default)(t[t.length-1])&&(s=t.pop()),i.equal(t.length,1,"transaction args: contracts, transaction, [options], [callback]"),A=t[0],!a){n.next=67;break}for(i(!c,"callback with contracts are not supported"),i.equal("function",void 0===A?"undefined":(0,u.default)(A),"provide function callback following contracts array parameter"),x=[],k=!0,S=!1,F=void 0,n.prev=50,B=a[Symbol.iterator]();!(k=(D=B.next()).done);k=!0)x.push(_(D.value,e.transaction));n.next=58;break;case 54:n.prev=54,n.t1=n.catch(50),S=!0,F=n.t1;case 58:n.prev=58,n.prev=59,!k&&B.return&&B.return();case 61:if(n.prev=61,!S){n.next=64;break}throw F;case 64:return n.finish(61);case 65:return n.finish(58);case 66:return n.abrupt("return",Promise.all(x).then(function(n){var e={};return n.forEach(function(n,t){e[a[t]]=n}),C(A,s,d?e:e[a[0]])}));case 67:if("function"!=typeof A){n.next=69;break}return n.abrupt("return",C(A,s,e));case 69:if("object"!==(void 0===A?"undefined":(0,u.default)(A))){n.next=71;break}return n.abrupt("return",E(A,s,c));case 71:throw new Error("first transaction argument unrecognized",A);case 72:case"end":return n.stop()}},null,this,[[18,22,26,34],[27,,29,33],[50,54,58,66],[59,,61,65]])}};function _(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o.abiCache.abiAsync(n).then(function(t){i(Array.isArray(t.abi.actions)&&t.abi.actions.length,"No actions");var l={};return l.transaction=e||y(t.structs,l),t.abi.actions.forEach(function(e){var r=e.name,u=e.type,o=v(t.schema,u);l[r]=w(u,o,l.transaction,n,r)}),l.fc=t,l})}function w(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"eosio.token",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e;return function(){for(var c=arguments.length,h=Array(c),p=0;pe.actor?1:n.actor0&&void 0!==arguments[0]?arguments[0]:"")+"\n"};o("CONTRACT"),o(l),o(),o("FUNCTION"),o(n),o();var i=void 0;if("eosio"===l||"eosio.token"===l)i=f(Object.assign({defaults:!0,network:t},r)).structs[n],o("PARAMETERS"),o(JSON.stringify(e,null,4)),o(),o("EXAMPLE"),o(JSON.stringify(i.toObject(),null,4));else{var a=r.abiCache.abi(l);o("PARAMETERS"),o(JSON.stringify(v(a.schema,n),null,4)),o(),i=a.structs[n],o("EXAMPLE"),o(JSON.stringify(i.toObject(),null,4))}if(null==i)throw TypeError("Unknown type: "+n);return u}(e,t,n,a,o))}}function C(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments[2];i.equal("function",void 0===n?"undefined":(0,u.default)(n),"trCallback"),i.equal("object",void 0===e?"undefined":(0,u.default)(e),"options"),i.equal("object",void 0===t?"undefined":(0,u.default)(t),"merges"),i(!Array.isArray(t),"merges should not be an array"),i.equal("function",(0,u.default)(E),"transaction");var r=[],o={},a=function(n){return function(){for(var e=arguments.length,t=Array(e),l=0;l0&&-1===n.findIndex(function(n){return"string"!=typeof n})},m=function(n){return"object"===(void 0===n?"undefined":(0,u.default)(n))?n:"boolean"==typeof n?{broadcast:n}:void 0},g=function(n,e,t){return function(l,r){l?(e.error&&e.error("error",l),n(l)):Promise.resolve(t(r)).catch(function(e){n(e)})}};function v(n,e){var t=n[e],l=t.base,r=t.fields,u={};return l&&""!==l&&Object.assign(u,v(n,l)),Object.assign(u,r),u}}).call(this,n("buffer").Buffer)},{"./structs":8,assert:10,"babel-runtime/helpers/slicedToArray":15,"babel-runtime/helpers/typeof":16,"babel-runtime/regenerator":17,buffer:44,"create-hash":119,"eosjs-api":134,"eosjs-ecc":143,fcbuffer:152}],10:[function(n,t,l){(function(e){"use strict";function l(n,e){if(n===e)return 0;for(var t=n.length,l=e.length,r=0,u=Math.min(t,l);r=0;s--)if(c[s]!==d[s])return!1;for(s=c.length-1;s>=0;s--)if(!b(n[a=c[s]],e[a],t,l))return!1;return!0}(n,e,t,o))}return t?n===e:n==e}function y(n){return"[object Arguments]"==Object.prototype.toString.call(n)}function _(n,e){if(!n||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(n);try{if(n instanceof e)return!0}catch(n){}return!Error.isPrototypeOf(e)&&!0===e.call({},n)}function w(n,e,t,l){var r;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof t&&(l=t,t=null),r=function(n){var e;try{n()}catch(n){e=n}return e}(e),l=(t&&t.name?" ("+t.name+").":".")+(l?" "+l:"."),n&&!r&&g(r,t,"Missing expected exception"+l);var o="string"==typeof l,i=!n&&u.isError(r),a=!n&&r&&!t;if((i&&o&&_(r,t)||a)&&g(r,t,"Got unwanted exception"+l),n&&r&&t&&!_(r,t)||!n&&r)throw r}d.AssertionError=function(n){var e;this.name="AssertionError",this.actual=n.actual,this.expected=n.expected,this.operator=n.operator,n.message?(this.message=n.message,this.generatedMessage=!1):(this.message=p(m((e=this).actual),128)+" "+e.operator+" "+p(m(e.expected),128),this.generatedMessage=!0);var t=n.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var l=new Error;if(l.stack){var r=l.stack,u=h(t),o=r.indexOf("\n"+u);if(o>=0){var i=r.indexOf("\n",o+1);r=r.substring(i+1)}this.stack=r}}},u.inherits(d.AssertionError,Error),d.fail=g,d.ok=v,d.equal=function(n,e,t){n!=e&&g(n,e,t,"==",d.equal)},d.notEqual=function(n,e,t){n==e&&g(n,e,t,"!=",d.notEqual)},d.deepEqual=function(n,e,t){b(n,e,!1)||g(n,e,t,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(n,e,t){b(n,e,!0)||g(n,e,t,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(n,e,t){b(n,e,!1)&&g(n,e,t,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function n(e,t,l){b(e,t,!0)&&g(e,t,l,"notDeepStrictEqual",n)},d.strictEqual=function(n,e,t){n!==e&&g(n,e,t,"===",d.strictEqual)},d.notStrictEqual=function(n,e,t){n===e&&g(n,e,t,"!==",d.notStrictEqual)},d.throws=function(n,e,t){w(!0,n,e,t)},d.doesNotThrow=function(n,e,t){w(!1,n,e,t)},d.ifError=function(n){if(n)throw n};var C=Object.keys||function(n){var e=[];for(var t in n)o.call(n,t)&&e.push(t);return e}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":204}],11:[function(n,e,t){e.exports={default:n("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":48}],12:[function(n,e,t){e.exports={default:n("core-js/library/fn/is-iterable"),__esModule:!0}},{"core-js/library/fn/is-iterable":49}],13:[function(n,e,t){e.exports={default:n("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":50}],14:[function(n,e,t){e.exports={default:n("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":51}],15:[function(n,e,t){"use strict";t.__esModule=!0;var l=u(n("../core-js/is-iterable")),r=u(n("../core-js/get-iterator"));function u(n){return n&&n.__esModule?n:{default:n}}t.default=function(n,e){if(Array.isArray(n))return n;if((0,l.default)(Object(n)))return function(n,e){var t=[],l=!0,u=!1,o=void 0;try{for(var i,a=(0,r.default)(n);!(l=(i=a.next()).done)&&(t.push(i.value),!e||t.length!==e);l=!0);}catch(n){u=!0,o=n}finally{try{!l&&a.return&&a.return()}finally{if(u)throw o}}return t}(n,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},{"../core-js/get-iterator":11,"../core-js/is-iterable":12}],16:[function(n,e,t){"use strict";t.__esModule=!0;var l=o(n("../core-js/symbol/iterator")),r=o(n("../core-js/symbol")),u="function"==typeof r.default&&"symbol"==typeof l.default?function(n){return typeof n}:function(n){return n&&"function"==typeof r.default&&n.constructor===r.default&&n!==r.default.prototype?"symbol":typeof n};function o(n){return n&&n.__esModule?n:{default:n}}t.default="function"==typeof r.default&&"symbol"===u(l.default)?function(n){return void 0===n?"undefined":u(n)}:function(n){return n&&"function"==typeof r.default&&n.constructor===r.default&&n!==r.default.prototype?"symbol":void 0===n?"undefined":u(n)}},{"../core-js/symbol":13,"../core-js/symbol/iterator":14}],17:[function(n,e,t){e.exports=n("regenerator-runtime")},{"regenerator-runtime":186}],18:[function(n,e,t){var l=n("safe-buffer").Buffer;e.exports=function(n){for(var e={},t=n.length,r=n.charAt(0),u=0;u>=8;for(;s>0;)u.push(255&s),s>>=8}for(var c=0;n[c]===r&&c0;)l.push(o%t),o=o/t|0}for(var i="",a=0;0===e[a]&&a=0;--s)i+=n[l[s]];return i},decodeUnsafe:i,decode:function(n){var e=i(n);if(e)return e;throw new Error("Non-base"+t+" character")}}}},{"safe-buffer":189}],19:[function(n,e,t){"use strict";t.byteLength=function(n){return 3*n.length/4-s(n)},t.toByteArray=function(n){var e,t,l,o,i,a=n.length;o=s(n),i=new u(3*a/4-o),t=o>0?a-4:a;var c=0;for(e=0;e>16&255,i[c++]=l>>8&255,i[c++]=255&l;return 2===o?(l=r[n.charCodeAt(e)]<<2|r[n.charCodeAt(e+1)]>>4,i[c++]=255&l):1===o&&(l=r[n.charCodeAt(e)]<<10|r[n.charCodeAt(e+1)]<<4|r[n.charCodeAt(e+2)]>>2,i[c++]=l>>8&255,i[c++]=255&l),i},t.fromByteArray=function(n){for(var e,t=n.length,r=t%3,u="",o=[],i=0,a=t-r;ia?a:i+16383));return 1===r?(u+=l[(e=n[t-1])>>2],u+=l[e<<4&63],u+="=="):2===r&&(u+=l[(e=(n[t-2]<<8)+n[t-1])>>10],u+=l[e>>4&63],u+=l[e<<2&63],u+="="),o.push(u),o.join("")};for(var l=[],r=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=o.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===n[e-2]?2:"="===n[e-1]?1:0}function c(n,e,t){for(var r,u=[],o=e;o>18&63]+l[r>>12&63]+l[r>>6&63]+l[63&r]);return u.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],20:[function(n,e,t){function l(n,e,t){if(!(this instanceof l))return new l(n,e,t);null!=n&&("number"==typeof n?this.fromNumber(n,e,t):this.fromString(n,null==e&&"string"!=typeof n?256:e))}var r=l.prototype;r.__bigi=n("../package.json").version,l.isBigInteger=function(n,e){return n&&n.__bigi&&(!e||n.__bigi===r.__bigi)},l.prototype.am=function(n,e,t,l,r,u){for(;--u>=0;){var o=e*this[n++]+t[l]+r;r=Math.floor(o/67108864),t[l++]=67108863&o}return r},l.prototype.DB=26,l.prototype.DM=67108863;var u=l.prototype.DV=1<<26;l.prototype.FV=Math.pow(2,52),l.prototype.F1=26,l.prototype.F2=0;var o,i,a="0123456789abcdefghijklmnopqrstuvwxyz",s=new Array;for(o="0".charCodeAt(0),i=0;i<=9;++i)s[o++]=i;for(o="a".charCodeAt(0),i=10;i<36;++i)s[o++]=i;for(o="A".charCodeAt(0),i=10;i<36;++i)s[o++]=i;function c(n){return a.charAt(n)}function d(n,e){var t=s[n.charCodeAt(e)];return null==t?-1:t}function f(n){var e=new l;return e.fromInt(n),e}function h(n){var e,t=1;return 0!=(e=n>>>16)&&(n=e,t+=16),0!=(e=n>>8)&&(n=e,t+=8),0!=(e=n>>4)&&(n=e,t+=4),0!=(e=n>>2)&&(n=e,t+=2),0!=(e=n>>1)&&(n=e,t+=1),t}function p(n){this.m=n}function m(n){this.m=n,this.mp=n.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&n)&&(n>>=8,e+=8),0==(15&n)&&(n>>=4,e+=4),0==(3&n)&&(n>>=2,e+=2),0==(1&n)&&++e,e}function w(n){for(var e=0;0!=n;)n&=n-1,++e;return e}function C(){}function E(n){return n}function A(n){this.r2=new l,this.q3=new l,l.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}p.prototype.convert=function(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n},p.prototype.revert=function(n){return n},p.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},p.prototype.mulTo=function(n,e,t){n.multiplyTo(e,t),this.reduce(t)},p.prototype.sqrTo=function(n,e){n.squareTo(e),this.reduce(e)},m.prototype.convert=function(n){var e=new l;return n.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),n.s<0&&e.compareTo(l.ZERO)>0&&this.m.subTo(e,e),e},m.prototype.revert=function(n){var e=new l;return n.copyTo(e),this.reduce(e),e},m.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&n.DM;for(n[t=e+this.m.t]+=this.m.am(0,l,n,e,0,this.m.t);n[t]>=n.DV;)n[t]-=n.DV,n[++t]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)},m.prototype.mulTo=function(n,e,t){n.multiplyTo(e,t),this.reduce(t)},m.prototype.sqrTo=function(n,e){n.squareTo(e),this.reduce(e)},r.copyTo=function(n){for(var e=this.t-1;e>=0;--e)n[e]=this[e];n.t=this.t,n.s=this.s},r.fromInt=function(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+u:this.t=0},r.fromString=function(n,e){var t;if(16==e)t=4;else if(8==e)t=3;else if(256==e)t=8;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return void this.fromRadix(n,e);t=2}this.t=0,this.s=0;for(var r=n.length,u=!1,o=0;--r>=0;){var i=8==t?255&n[r]:d(n,r);i<0?"-"==n.charAt(r)&&(u=!0):(u=!1,0==o?this[this.t++]=i:o+t>this.DB?(this[this.t-1]|=(i&(1<>this.DB-o):this[this.t-1]|=i<=this.DB&&(o-=this.DB))}8==t&&0!=(128&n[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==n;)--this.t},r.dlShiftTo=function(n,e){var t;for(t=this.t-1;t>=0;--t)e[t+n]=this[t];for(t=n-1;t>=0;--t)e[t]=0;e.t=this.t+n,e.s=this.s},r.drShiftTo=function(n,e){for(var t=n;t=0;--t)e[t+o+1]=this[t]>>r|i,i=(this[t]&u)<=0;--t)e[t]=0;e[o]=i,e.t=this.t+o+1,e.s=this.s,e.clamp()},r.rShiftTo=function(n,e){e.s=this.s;var t=Math.floor(n/this.DB);if(t>=this.t)e.t=0;else{var l=n%this.DB,r=this.DB-l,u=(1<>l;for(var o=t+1;o>l;l>0&&(e[this.t-t-1]|=(this.s&u)<>=this.DB;if(n.t>=this.DB;l+=this.s}else{for(l+=this.s;t>=this.DB;l-=n.s}e.s=l<0?-1:0,l<-1?e[t++]=this.DV+l:l>0&&(e[t++]=l),e.t=t,e.clamp()},r.multiplyTo=function(n,e){var t=this.abs(),r=n.abs(),u=t.t;for(e.t=u+r.t;--u>=0;)e[u]=0;for(u=0;u=0;)n[t]=0;for(t=0;t=e.DV&&(n[t+e.t]-=e.DV,n[t+e.t+1]=1)}n.t>0&&(n[n.t-1]+=e.am(t,e[t],n,2*t,0,1)),n.s=0,n.clamp()},r.divRemTo=function(n,e,t){var r=n.abs();if(!(r.t<=0)){var u=this.abs();if(u.t0?(r.lShiftTo(s,o),u.lShiftTo(s,t)):(r.copyTo(o),u.copyTo(t));var c=o.t,d=o[c-1];if(0!=d){var f=d*(1<1?o[c-2]>>this.F2:0),p=this.FV/f,m=(1<=0&&(t[t.t++]=1,t.subTo(y,t)),l.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t=0;){var _=t[--v]==d?this.DM:Math.floor(t[v]*p+(t[v-1]+g)*m);if((t[v]+=o.am(0,_,t,b,0,c))<_)for(o.dlShiftTo(b,y),t.subTo(y,t);t[v]<--_;)t.subTo(y,t)}null!=e&&(t.drShiftTo(c,e),i!=a&&l.ZERO.subTo(e,e)),t.t=c,t.clamp(),s>0&&t.rShiftTo(s,t),i<0&&l.ZERO.subTo(t,t)}}},r.invDigit=function(){if(this.t<1)return 0;var n=this[0];if(0==(1&n))return 0;var e=3&n;return(e=(e=(e=(e=e*(2-(15&n)*e)&15)*(2-(255&n)*e)&255)*(2-((65535&n)*e&65535))&65535)*(2-n*e%this.DV)%this.DV)>0?this.DV-e:-e},r.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.exp=function(n,e){if(n>4294967295||n<1)return l.ONE;var t=new l,r=new l,u=e.convert(this),o=h(n)-1;for(u.copyTo(t);--o>=0;)if(e.sqrTo(t,r),(n&1<0)e.mulTo(r,u,t);else{var i=t;t=r,r=i}return e.revert(t)},r.toString=function(n){var e;if(this.s<0)return"-"+this.negate().toString(n);if(16==n)e=4;else if(8==n)e=3;else if(2==n)e=1;else if(32==n)e=5;else{if(4!=n)return this.toRadix(n);e=2}var t,l=(1<0)for(i>i)>0&&(r=!0,u=c(t));o>=0;)i>(i+=this.DB-e)):(t=this[o]>>(i-=e)&l,i<=0&&(i+=this.DB,--o)),t>0&&(r=!0),r&&(u+=c(t));return r?u:"0"},r.negate=function(){var n=new l;return l.ZERO.subTo(this,n),n},r.abs=function(){return this.s<0?this.negate():this},r.compareTo=function(n){var e=this.s-n.s;if(0!=e)return e;var t=this.t;if(0!=(e=t-n.t))return this.s<0?-e:e;for(;--t>=0;)if(0!=(e=this[t]-n[t]))return e;return 0},r.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},r.byteLength=function(){return this.bitLength()>>3},r.mod=function(n){var e=new l;return this.abs().divRemTo(n,null,e),this.s<0&&e.compareTo(l.ZERO)>0&&n.subTo(e,e),e},r.modPowInt=function(n,e){var t;return t=n<256||e.isEven()?new p(e):new m(e),this.exp(n,t)},C.prototype.convert=E,C.prototype.revert=E,C.prototype.mulTo=function(n,e,t){n.multiplyTo(e,t)},C.prototype.sqrTo=function(n,e){n.squareTo(e)},A.prototype.convert=function(n){if(n.s<0||n.t>2*this.m.t)return n.mod(this.m);if(n.compareTo(this.m)<0)return n;var e=new l;return n.copyTo(e),this.reduce(e),e},A.prototype.revert=function(n){return n},A.prototype.reduce=function(n){for(n.drShiftTo(this.m.t-1,this.r2),n.t>this.m.t+1&&(n.t=this.m.t+1,n.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);n.compareTo(this.r2)<0;)n.dAddOffset(1,this.m.t+1);for(n.subTo(this.r2,n);n.compareTo(this.m)>=0;)n.subTo(this.m,n)},A.prototype.mulTo=function(n,e,t){n.multiplyTo(e,t),this.reduce(t)},A.prototype.sqrTo=function(n,e){n.squareTo(e),this.reduce(e)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],k=(1<<26)/x[x.length-1];r.chunkSize=function(n){return Math.floor(Math.LN2*this.DB/Math.log(n))},r.toRadix=function(n){if(null==n&&(n=10),0==this.signum()||n<2||n>36)return"0";var e=this.chunkSize(n),t=Math.pow(n,e),r=f(t),u=new l,o=new l,i="";for(this.divRemTo(r,u,o);u.signum()>0;)i=(t+o.intValue()).toString(n).substr(1)+i,u.divRemTo(r,u,o);return o.intValue().toString(n)+i},r.fromRadix=function(n,e){this.fromInt(0),null==e&&(e=10);for(var t=this.chunkSize(e),r=Math.pow(e,t),u=!1,o=0,i=0,a=0;a=t&&(this.dMultiply(r),this.dAddOffset(i,0),o=0,i=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(i,0)),u&&l.ZERO.subTo(this,this)},r.fromNumber=function(n,e,t){if("number"==typeof e)if(n<2)this.fromInt(1);else for(this.fromNumber(n,t),this.testBit(n-1)||this.bitwiseTo(l.ONE.shiftLeft(n-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>n&&this.subTo(l.ONE.shiftLeft(n-1),this);else{var r=new Array,u=7&n;r.length=1+(n>>3),e.nextBytes(r),u>0?r[0]&=(1<>=this.DB;if(n.t>=this.DB;l+=this.s}else{for(l+=this.s;t>=this.DB;l+=n.s}e.s=l<0?-1:0,l>0?e[t++]=l:l<-1&&(e[t++]=this.DV+l),e.t=t,e.clamp()},r.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()},r.dAddOffset=function(n,e){if(0!=n){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=n;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.multiplyLowerTo=function(n,e,t){var l,r=Math.min(this.t+n.t,e);for(t.s=0,t.t=r;r>0;)t[--r]=0;for(l=t.t-this.t;r=0;)t[l]=0;for(l=Math.max(e-this.t,0);l0)if(0==e)t=this[0]%n;else for(var l=this.t-1;l>=0;--l)t=(e*t+this[l])%n;return t},r.millerRabin=function(n){var e=this.subtract(l.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var r=e.shiftRight(t);(n=n+1>>1)>x.length&&(n=x.length);for(var u=new l(null),o=[],i=0;i>24},r.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.toByteArray=function(){var n=this.t,e=new Array;e[0]=this.s;var t,l=this.DB-n*this.DB%8,r=0;if(n-- >0)for(l>l)!=(this.s&this.DM)>>l&&(e[r++]=t|this.s<=0;)l<8?(t=(this[n]&(1<>(l+=this.DB-8)):(t=this[n]>>(l-=8)&255,l<=0&&(l+=this.DB,--n)),0!=(128&t)&&(t|=-256),0===r&&(128&this.s)!=(128&t)&&++r,(r>0||t!=this.s)&&(e[r++]=t);return e},r.equals=function(n){return 0==this.compareTo(n)},r.min=function(n){return this.compareTo(n)<0?this:n},r.max=function(n){return this.compareTo(n)>0?this:n},r.and=function(n){var e=new l;return this.bitwiseTo(n,g,e),e},r.or=function(n){var e=new l;return this.bitwiseTo(n,v,e),e},r.xor=function(n){var e=new l;return this.bitwiseTo(n,b,e),e},r.andNot=function(n){var e=new l;return this.bitwiseTo(n,y,e),e},r.not=function(){for(var n=new l,e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var d=new l;for(r.sqrTo(i[1],d);a<=c;)i[a]=new l,r.mulTo(d,i[a-2],i[a]),a+=2}var g,v,b=n.t-1,y=!0,_=new l;for(u=h(n[b])-1;b>=0;){for(u>=s?g=n[b]>>u-s&c:(g=(n[b]&(1<0&&(g|=n[b-1]>>this.DB+u-s)),a=t;0==(1&g);)g>>=1,--a;if((u-=a)<0&&(u+=this.DB,--b),y)i[g].copyTo(o),y=!1;else{for(;a>1;)r.sqrTo(o,_),r.sqrTo(_,o),a-=2;a>0?r.sqrTo(o,_):(v=o,o=_,_=v),r.mulTo(_,i[g],o)}for(;b>=0&&0==(n[b]&1<=0?(t.subTo(r,t),e&&u.subTo(i,u),o.subTo(a,o)):(r.subTo(t,r),e&&i.subTo(u,i),a.subTo(o,a))}if(0!=r.compareTo(l.ONE))return l.ZERO;for(;a.compareTo(n)>=0;)a.subTo(n,a);for(;a.signum()<0;)a.addTo(n,a);return a},r.pow=function(n){return this.exp(n,new C)},r.gcd=function(n){var e=this.s<0?this.negate():this.clone(),t=n.s<0?n.negate():n.clone();if(e.compareTo(t)<0){var l=e;e=t,t=l}var r=e.getLowestSetBit(),u=t.getLowestSetBit();if(u<0)return e;for(r0&&(e.rShiftTo(u,e),t.rShiftTo(u,t));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=t.getLowestSetBit())>0&&t.rShiftTo(r,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return u>0&&t.lShiftTo(u,t),t},r.isProbablePrime=function(n){var e,t=this.abs();if(1==t.t&&t[0]<=x[x.length-1]){for(e=0;e=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return l}function a(n,e,t,l){for(var r=0,u=Math.min(n.length,t),o=e;o=49?i-49+10:i>=17?i-17+10:i}return r}u.isBN=function(n){return n instanceof u||null!==n&&"object"==typeof n&&n.constructor.wordSize===u.wordSize&&Array.isArray(n.words)},u.max=function(n,e){return n.cmp(e)>0?n:e},u.min=function(n,e){return n.cmp(e)<0?n:e},u.prototype._init=function(n,e,t){if("number"==typeof n)return this._initNumber(n,e,t);if("object"==typeof n)return this._initArray(n,e,t);"hex"===e&&(e=16),l(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(n=n.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(n,r):this._parseBase(n,e,r),"-"===n[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),e,t)},u.prototype._initNumber=function(n,e,t){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(l(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),e,t)},u.prototype._initArray=function(n,e,t){if(l("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3)this.words[u]|=(o=n[r]|n[r-1]<<8|n[r-2]<<16)<>>26-i&67108863,(i+=24)>=26&&(i-=26,u++);else if("le"===t)for(r=0,u=0;r>>26-i&67108863,(i+=24)>=26&&(i-=26,u++);return this.strip()},u.prototype._parseHex=function(n,e){this.length=Math.ceil((n.length-e)/6),this.words=new Array(this.length);for(var t=0;t=e;t-=6)r=i(n,t,t+6),this.words[l]|=r<>>26-u&4194303,(u+=24)>=26&&(u-=26,l++);t+6!==e&&(r=i(n,e,t+6),this.words[l]|=r<>>26-u&4194303),this.strip()},u.prototype._parseBase=function(n,e,t){this.words=[0],this.length=1;for(var l=0,r=1;r<=67108863;r*=e)l++;r=r/e|0;for(var u=n.length-t,o=u%--l,i=Math.min(u,u-o)+t,s=0,c=t;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},u.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},u.prototype.inspect=function(){return(this.red?""};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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 f(n,e,t){t.negative=e.negative^n.negative;var l=n.length+e.length|0;t.length=l,l=l-1|0;var r=0|n.words[0],u=0|e.words[0],o=r*u,i=o/67108864|0;t.words[0]=67108863&o;for(var a=1;a>>26,c=67108863&i,d=Math.min(a,e.length-1),f=Math.max(0,a-n.length+1);f<=d;f++)s+=(o=(r=0|n.words[a-f|0])*(u=0|e.words[f])+c)/67108864|0,c=67108863&o;t.words[a]=0|c,i=0|s}return 0!==i?t.words[a]=0|i:t.length--,t.strip()}u.prototype.toString=function(n,e){var t;if(n=n||10,e=0|e||1,16===n||"hex"===n){t="";for(var r=0,u=0,o=0;o>>24-r&16777215)||o!==this.length-1?s[6-a.length]+a+t:a+t,(r+=2)>=26&&(r-=26,o--)}for(0!==u&&(t=u.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(n===(0|n)&&n>=2&&n<=36){var f=c[n],h=d[n];t="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(n);t=(p=p.idivn(h)).isZero()?m+t:s[f-m.length]+m+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}l(!1,"Base should be between 2 and 36")},u.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n},u.prototype.toJSON=function(){return this.toString(16)},u.prototype.toBuffer=function(n,e){return l(void 0!==o),this.toArrayLike(o,n,e)},u.prototype.toArray=function(n,e){return this.toArrayLike(Array,n,e)},u.prototype.toArrayLike=function(n,e,t){var r=this.byteLength(),u=t||Math.max(1,r);l(r<=u,"byte array longer than desired length"),l(u>0,"Requested array length <= 0"),this.strip();var o,i,a="le"===e,s=new n(u),c=this.clone();if(a){for(i=0;!c.isZero();i++)o=c.andln(255),c.iushrn(8),s[i]=o;for(;i=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},u.prototype._zeroBits=function(n){if(0===n)return 26;var e=n,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},u.prototype.bitLength=function(){var n=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+n},u.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,e=0;en.length?this.clone().ior(n):n.clone().ior(this)},u.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},u.prototype.iuand=function(n){var e;e=this.length>n.length?n:this;for(var t=0;tn.length?this.clone().iand(n):n.clone().iand(this)},u.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},u.prototype.iuxor=function(n){var e,t;this.length>n.length?(e=this,t=n):(e=n,t=this);for(var l=0;ln.length?this.clone().ixor(n):n.clone().ixor(this)},u.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},u.prototype.inotn=function(n){l("number"==typeof n&&n>=0);var e=0|Math.ceil(n/26),t=n%26;this._expand(e),t>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-t),this.strip()},u.prototype.notn=function(n){return this.clone().inotn(n)},u.prototype.setn=function(n,e){l("number"==typeof n&&n>=0);var t=n/26|0,r=n%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<n.length?(t=this,l=n):(t=n,l=this);for(var r=0,u=0;u>>26;for(;0!==r&&u>>26;if(this.length=t.length,0!==r)this.words[this.length]=r,this.length++;else if(t!==this)for(;un.length?this.clone().iadd(n):n.clone().iadd(this)},u.prototype.isub=function(n){if(0!==n.negative){n.negative=0;var e=this.iadd(n);return n.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var t,l,r=this.cmp(n);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(t=this,l=n):(t=n,l=this);for(var u=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==u&&o>26,this.words[o]=67108863&e;if(0===u&&o>>13,h=0|o[1],p=8191&h,m=h>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,C=0|o[4],E=8191&C,A=C>>>13,x=0|o[5],k=8191&x,S=x>>>13,F=0|o[6],B=8191&F,D=F>>>13,I=0|o[7],T=8191&I,M=I>>>13,O=0|o[8],R=8191&O,N=O>>>13,P=0|o[9],j=8191&P,L=P>>>13,q=0|i[0],U=8191&q,z=q>>>13,V=0|i[1],H=8191&V,G=V>>>13,Z=0|i[2],$=8191&Z,K=Z>>>13,W=0|i[3],Y=8191&W,J=W>>>13,X=0|i[4],Q=8191&X,nn=X>>>13,en=0|i[5],tn=8191&en,ln=en>>>13,rn=0|i[6],un=8191&rn,on=rn>>>13,an=0|i[7],sn=8191&an,cn=an>>>13,dn=0|i[8],fn=8191&dn,hn=dn>>>13,pn=0|i[9],mn=8191&pn,gn=pn>>>13;t.negative=n.negative^e.negative,t.length=19;var vn=(s+(l=Math.imul(d,U))|0)+((8191&(r=(r=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;s=((u=Math.imul(f,z))+(r>>>13)|0)+(vn>>>26)|0,vn&=67108863,l=Math.imul(p,U),r=(r=Math.imul(p,z))+Math.imul(m,U)|0,u=Math.imul(m,z);var bn=(s+(l=l+Math.imul(d,H)|0)|0)+((8191&(r=(r=r+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;s=((u=u+Math.imul(f,G)|0)+(r>>>13)|0)+(bn>>>26)|0,bn&=67108863,l=Math.imul(v,U),r=(r=Math.imul(v,z))+Math.imul(b,U)|0,u=Math.imul(b,z),l=l+Math.imul(p,H)|0,r=(r=r+Math.imul(p,G)|0)+Math.imul(m,H)|0,u=u+Math.imul(m,G)|0;var yn=(s+(l=l+Math.imul(d,$)|0)|0)+((8191&(r=(r=r+Math.imul(d,K)|0)+Math.imul(f,$)|0))<<13)|0;s=((u=u+Math.imul(f,K)|0)+(r>>>13)|0)+(yn>>>26)|0,yn&=67108863,l=Math.imul(_,U),r=(r=Math.imul(_,z))+Math.imul(w,U)|0,u=Math.imul(w,z),l=l+Math.imul(v,H)|0,r=(r=r+Math.imul(v,G)|0)+Math.imul(b,H)|0,u=u+Math.imul(b,G)|0,l=l+Math.imul(p,$)|0,r=(r=r+Math.imul(p,K)|0)+Math.imul(m,$)|0,u=u+Math.imul(m,K)|0;var _n=(s+(l=l+Math.imul(d,Y)|0)|0)+((8191&(r=(r=r+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;s=((u=u+Math.imul(f,J)|0)+(r>>>13)|0)+(_n>>>26)|0,_n&=67108863,l=Math.imul(E,U),r=(r=Math.imul(E,z))+Math.imul(A,U)|0,u=Math.imul(A,z),l=l+Math.imul(_,H)|0,r=(r=r+Math.imul(_,G)|0)+Math.imul(w,H)|0,u=u+Math.imul(w,G)|0,l=l+Math.imul(v,$)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(b,$)|0,u=u+Math.imul(b,K)|0,l=l+Math.imul(p,Y)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(m,Y)|0,u=u+Math.imul(m,J)|0;var wn=(s+(l=l+Math.imul(d,Q)|0)|0)+((8191&(r=(r=r+Math.imul(d,nn)|0)+Math.imul(f,Q)|0))<<13)|0;s=((u=u+Math.imul(f,nn)|0)+(r>>>13)|0)+(wn>>>26)|0,wn&=67108863,l=Math.imul(k,U),r=(r=Math.imul(k,z))+Math.imul(S,U)|0,u=Math.imul(S,z),l=l+Math.imul(E,H)|0,r=(r=r+Math.imul(E,G)|0)+Math.imul(A,H)|0,u=u+Math.imul(A,G)|0,l=l+Math.imul(_,$)|0,r=(r=r+Math.imul(_,K)|0)+Math.imul(w,$)|0,u=u+Math.imul(w,K)|0,l=l+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,J)|0)+Math.imul(b,Y)|0,u=u+Math.imul(b,J)|0,l=l+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,nn)|0)+Math.imul(m,Q)|0,u=u+Math.imul(m,nn)|0;var Cn=(s+(l=l+Math.imul(d,tn)|0)|0)+((8191&(r=(r=r+Math.imul(d,ln)|0)+Math.imul(f,tn)|0))<<13)|0;s=((u=u+Math.imul(f,ln)|0)+(r>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,l=Math.imul(B,U),r=(r=Math.imul(B,z))+Math.imul(D,U)|0,u=Math.imul(D,z),l=l+Math.imul(k,H)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(S,H)|0,u=u+Math.imul(S,G)|0,l=l+Math.imul(E,$)|0,r=(r=r+Math.imul(E,K)|0)+Math.imul(A,$)|0,u=u+Math.imul(A,K)|0,l=l+Math.imul(_,Y)|0,r=(r=r+Math.imul(_,J)|0)+Math.imul(w,Y)|0,u=u+Math.imul(w,J)|0,l=l+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,nn)|0)+Math.imul(b,Q)|0,u=u+Math.imul(b,nn)|0,l=l+Math.imul(p,tn)|0,r=(r=r+Math.imul(p,ln)|0)+Math.imul(m,tn)|0,u=u+Math.imul(m,ln)|0;var En=(s+(l=l+Math.imul(d,un)|0)|0)+((8191&(r=(r=r+Math.imul(d,on)|0)+Math.imul(f,un)|0))<<13)|0;s=((u=u+Math.imul(f,on)|0)+(r>>>13)|0)+(En>>>26)|0,En&=67108863,l=Math.imul(T,U),r=(r=Math.imul(T,z))+Math.imul(M,U)|0,u=Math.imul(M,z),l=l+Math.imul(B,H)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(D,H)|0,u=u+Math.imul(D,G)|0,l=l+Math.imul(k,$)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(S,$)|0,u=u+Math.imul(S,K)|0,l=l+Math.imul(E,Y)|0,r=(r=r+Math.imul(E,J)|0)+Math.imul(A,Y)|0,u=u+Math.imul(A,J)|0,l=l+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,nn)|0)+Math.imul(w,Q)|0,u=u+Math.imul(w,nn)|0,l=l+Math.imul(v,tn)|0,r=(r=r+Math.imul(v,ln)|0)+Math.imul(b,tn)|0,u=u+Math.imul(b,ln)|0,l=l+Math.imul(p,un)|0,r=(r=r+Math.imul(p,on)|0)+Math.imul(m,un)|0,u=u+Math.imul(m,on)|0;var An=(s+(l=l+Math.imul(d,sn)|0)|0)+((8191&(r=(r=r+Math.imul(d,cn)|0)+Math.imul(f,sn)|0))<<13)|0;s=((u=u+Math.imul(f,cn)|0)+(r>>>13)|0)+(An>>>26)|0,An&=67108863,l=Math.imul(R,U),r=(r=Math.imul(R,z))+Math.imul(N,U)|0,u=Math.imul(N,z),l=l+Math.imul(T,H)|0,r=(r=r+Math.imul(T,G)|0)+Math.imul(M,H)|0,u=u+Math.imul(M,G)|0,l=l+Math.imul(B,$)|0,r=(r=r+Math.imul(B,K)|0)+Math.imul(D,$)|0,u=u+Math.imul(D,K)|0,l=l+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,J)|0)+Math.imul(S,Y)|0,u=u+Math.imul(S,J)|0,l=l+Math.imul(E,Q)|0,r=(r=r+Math.imul(E,nn)|0)+Math.imul(A,Q)|0,u=u+Math.imul(A,nn)|0,l=l+Math.imul(_,tn)|0,r=(r=r+Math.imul(_,ln)|0)+Math.imul(w,tn)|0,u=u+Math.imul(w,ln)|0,l=l+Math.imul(v,un)|0,r=(r=r+Math.imul(v,on)|0)+Math.imul(b,un)|0,u=u+Math.imul(b,on)|0,l=l+Math.imul(p,sn)|0,r=(r=r+Math.imul(p,cn)|0)+Math.imul(m,sn)|0,u=u+Math.imul(m,cn)|0;var xn=(s+(l=l+Math.imul(d,fn)|0)|0)+((8191&(r=(r=r+Math.imul(d,hn)|0)+Math.imul(f,fn)|0))<<13)|0;s=((u=u+Math.imul(f,hn)|0)+(r>>>13)|0)+(xn>>>26)|0,xn&=67108863,l=Math.imul(j,U),r=(r=Math.imul(j,z))+Math.imul(L,U)|0,u=Math.imul(L,z),l=l+Math.imul(R,H)|0,r=(r=r+Math.imul(R,G)|0)+Math.imul(N,H)|0,u=u+Math.imul(N,G)|0,l=l+Math.imul(T,$)|0,r=(r=r+Math.imul(T,K)|0)+Math.imul(M,$)|0,u=u+Math.imul(M,K)|0,l=l+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,J)|0)+Math.imul(D,Y)|0,u=u+Math.imul(D,J)|0,l=l+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,nn)|0)+Math.imul(S,Q)|0,u=u+Math.imul(S,nn)|0,l=l+Math.imul(E,tn)|0,r=(r=r+Math.imul(E,ln)|0)+Math.imul(A,tn)|0,u=u+Math.imul(A,ln)|0,l=l+Math.imul(_,un)|0,r=(r=r+Math.imul(_,on)|0)+Math.imul(w,un)|0,u=u+Math.imul(w,on)|0,l=l+Math.imul(v,sn)|0,r=(r=r+Math.imul(v,cn)|0)+Math.imul(b,sn)|0,u=u+Math.imul(b,cn)|0,l=l+Math.imul(p,fn)|0,r=(r=r+Math.imul(p,hn)|0)+Math.imul(m,fn)|0,u=u+Math.imul(m,hn)|0;var kn=(s+(l=l+Math.imul(d,mn)|0)|0)+((8191&(r=(r=r+Math.imul(d,gn)|0)+Math.imul(f,mn)|0))<<13)|0;s=((u=u+Math.imul(f,gn)|0)+(r>>>13)|0)+(kn>>>26)|0,kn&=67108863,l=Math.imul(j,H),r=(r=Math.imul(j,G))+Math.imul(L,H)|0,u=Math.imul(L,G),l=l+Math.imul(R,$)|0,r=(r=r+Math.imul(R,K)|0)+Math.imul(N,$)|0,u=u+Math.imul(N,K)|0,l=l+Math.imul(T,Y)|0,r=(r=r+Math.imul(T,J)|0)+Math.imul(M,Y)|0,u=u+Math.imul(M,J)|0,l=l+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,nn)|0)+Math.imul(D,Q)|0,u=u+Math.imul(D,nn)|0,l=l+Math.imul(k,tn)|0,r=(r=r+Math.imul(k,ln)|0)+Math.imul(S,tn)|0,u=u+Math.imul(S,ln)|0,l=l+Math.imul(E,un)|0,r=(r=r+Math.imul(E,on)|0)+Math.imul(A,un)|0,u=u+Math.imul(A,on)|0,l=l+Math.imul(_,sn)|0,r=(r=r+Math.imul(_,cn)|0)+Math.imul(w,sn)|0,u=u+Math.imul(w,cn)|0,l=l+Math.imul(v,fn)|0,r=(r=r+Math.imul(v,hn)|0)+Math.imul(b,fn)|0,u=u+Math.imul(b,hn)|0;var Sn=(s+(l=l+Math.imul(p,mn)|0)|0)+((8191&(r=(r=r+Math.imul(p,gn)|0)+Math.imul(m,mn)|0))<<13)|0;s=((u=u+Math.imul(m,gn)|0)+(r>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,l=Math.imul(j,$),r=(r=Math.imul(j,K))+Math.imul(L,$)|0,u=Math.imul(L,K),l=l+Math.imul(R,Y)|0,r=(r=r+Math.imul(R,J)|0)+Math.imul(N,Y)|0,u=u+Math.imul(N,J)|0,l=l+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,nn)|0)+Math.imul(M,Q)|0,u=u+Math.imul(M,nn)|0,l=l+Math.imul(B,tn)|0,r=(r=r+Math.imul(B,ln)|0)+Math.imul(D,tn)|0,u=u+Math.imul(D,ln)|0,l=l+Math.imul(k,un)|0,r=(r=r+Math.imul(k,on)|0)+Math.imul(S,un)|0,u=u+Math.imul(S,on)|0,l=l+Math.imul(E,sn)|0,r=(r=r+Math.imul(E,cn)|0)+Math.imul(A,sn)|0,u=u+Math.imul(A,cn)|0,l=l+Math.imul(_,fn)|0,r=(r=r+Math.imul(_,hn)|0)+Math.imul(w,fn)|0,u=u+Math.imul(w,hn)|0;var Fn=(s+(l=l+Math.imul(v,mn)|0)|0)+((8191&(r=(r=r+Math.imul(v,gn)|0)+Math.imul(b,mn)|0))<<13)|0;s=((u=u+Math.imul(b,gn)|0)+(r>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,l=Math.imul(j,Y),r=(r=Math.imul(j,J))+Math.imul(L,Y)|0,u=Math.imul(L,J),l=l+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,nn)|0)+Math.imul(N,Q)|0,u=u+Math.imul(N,nn)|0,l=l+Math.imul(T,tn)|0,r=(r=r+Math.imul(T,ln)|0)+Math.imul(M,tn)|0,u=u+Math.imul(M,ln)|0,l=l+Math.imul(B,un)|0,r=(r=r+Math.imul(B,on)|0)+Math.imul(D,un)|0,u=u+Math.imul(D,on)|0,l=l+Math.imul(k,sn)|0,r=(r=r+Math.imul(k,cn)|0)+Math.imul(S,sn)|0,u=u+Math.imul(S,cn)|0,l=l+Math.imul(E,fn)|0,r=(r=r+Math.imul(E,hn)|0)+Math.imul(A,fn)|0,u=u+Math.imul(A,hn)|0;var Bn=(s+(l=l+Math.imul(_,mn)|0)|0)+((8191&(r=(r=r+Math.imul(_,gn)|0)+Math.imul(w,mn)|0))<<13)|0;s=((u=u+Math.imul(w,gn)|0)+(r>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,l=Math.imul(j,Q),r=(r=Math.imul(j,nn))+Math.imul(L,Q)|0,u=Math.imul(L,nn),l=l+Math.imul(R,tn)|0,r=(r=r+Math.imul(R,ln)|0)+Math.imul(N,tn)|0,u=u+Math.imul(N,ln)|0,l=l+Math.imul(T,un)|0,r=(r=r+Math.imul(T,on)|0)+Math.imul(M,un)|0,u=u+Math.imul(M,on)|0,l=l+Math.imul(B,sn)|0,r=(r=r+Math.imul(B,cn)|0)+Math.imul(D,sn)|0,u=u+Math.imul(D,cn)|0,l=l+Math.imul(k,fn)|0,r=(r=r+Math.imul(k,hn)|0)+Math.imul(S,fn)|0,u=u+Math.imul(S,hn)|0;var Dn=(s+(l=l+Math.imul(E,mn)|0)|0)+((8191&(r=(r=r+Math.imul(E,gn)|0)+Math.imul(A,mn)|0))<<13)|0;s=((u=u+Math.imul(A,gn)|0)+(r>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,l=Math.imul(j,tn),r=(r=Math.imul(j,ln))+Math.imul(L,tn)|0,u=Math.imul(L,ln),l=l+Math.imul(R,un)|0,r=(r=r+Math.imul(R,on)|0)+Math.imul(N,un)|0,u=u+Math.imul(N,on)|0,l=l+Math.imul(T,sn)|0,r=(r=r+Math.imul(T,cn)|0)+Math.imul(M,sn)|0,u=u+Math.imul(M,cn)|0,l=l+Math.imul(B,fn)|0,r=(r=r+Math.imul(B,hn)|0)+Math.imul(D,fn)|0,u=u+Math.imul(D,hn)|0;var In=(s+(l=l+Math.imul(k,mn)|0)|0)+((8191&(r=(r=r+Math.imul(k,gn)|0)+Math.imul(S,mn)|0))<<13)|0;s=((u=u+Math.imul(S,gn)|0)+(r>>>13)|0)+(In>>>26)|0,In&=67108863,l=Math.imul(j,un),r=(r=Math.imul(j,on))+Math.imul(L,un)|0,u=Math.imul(L,on),l=l+Math.imul(R,sn)|0,r=(r=r+Math.imul(R,cn)|0)+Math.imul(N,sn)|0,u=u+Math.imul(N,cn)|0,l=l+Math.imul(T,fn)|0,r=(r=r+Math.imul(T,hn)|0)+Math.imul(M,fn)|0,u=u+Math.imul(M,hn)|0;var Tn=(s+(l=l+Math.imul(B,mn)|0)|0)+((8191&(r=(r=r+Math.imul(B,gn)|0)+Math.imul(D,mn)|0))<<13)|0;s=((u=u+Math.imul(D,gn)|0)+(r>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,l=Math.imul(j,sn),r=(r=Math.imul(j,cn))+Math.imul(L,sn)|0,u=Math.imul(L,cn),l=l+Math.imul(R,fn)|0,r=(r=r+Math.imul(R,hn)|0)+Math.imul(N,fn)|0,u=u+Math.imul(N,hn)|0;var Mn=(s+(l=l+Math.imul(T,mn)|0)|0)+((8191&(r=(r=r+Math.imul(T,gn)|0)+Math.imul(M,mn)|0))<<13)|0;s=((u=u+Math.imul(M,gn)|0)+(r>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,l=Math.imul(j,fn),r=(r=Math.imul(j,hn))+Math.imul(L,fn)|0,u=Math.imul(L,hn);var On=(s+(l=l+Math.imul(R,mn)|0)|0)+((8191&(r=(r=r+Math.imul(R,gn)|0)+Math.imul(N,mn)|0))<<13)|0;s=((u=u+Math.imul(N,gn)|0)+(r>>>13)|0)+(On>>>26)|0,On&=67108863;var Rn=(s+(l=Math.imul(j,mn))|0)+((8191&(r=(r=Math.imul(j,gn))+Math.imul(L,mn)|0))<<13)|0;return s=((u=Math.imul(L,gn))+(r>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,a[0]=vn,a[1]=bn,a[2]=yn,a[3]=_n,a[4]=wn,a[5]=Cn,a[6]=En,a[7]=An,a[8]=xn,a[9]=kn,a[10]=Sn,a[11]=Fn,a[12]=Bn,a[13]=Dn,a[14]=In,a[15]=Tn,a[16]=Mn,a[17]=On,a[18]=Rn,0!==s&&(a[19]=s,t.length++),t};function p(n,e,t){return(new m).mulp(n,e,t)}function m(n,e){this.x=n,this.y=e}Math.imul||(h=f),u.prototype.mulTo=function(n,e){var t=this.length+n.length;return 10===this.length&&10===n.length?h(this,n,e):t<63?f(this,n,e):t<1024?function(n,e,t){t.negative=e.negative^n.negative,t.length=n.length+e.length;for(var l=0,r=0,u=0;u>>26)|0)>>>26,o&=67108863}t.words[u]=i,l=o,o=r}return 0!==l?t.words[u]=l:t.length--,t.strip()}(this,n,e):p(this,n,e)},m.prototype.makeRBT=function(n){for(var e=new Array(n),t=u.prototype._countBits(n)-1,l=0;l>=1;return l},m.prototype.permute=function(n,e,t,l,r,u){for(var o=0;o>>=1)r++;return 1<>>=13),u>>>=13;for(o=2*e;o>=26,e+=r/67108864|0,e+=u>>>26,this.words[t]=67108863&u}return 0!==e&&(this.words[t]=e,this.length++),this},u.prototype.muln=function(n){return this.clone().imuln(n)},u.prototype.sqr=function(){return this.mul(this)},u.prototype.isqr=function(){return this.imul(this.clone())},u.prototype.pow=function(n){var e=function(n){for(var e=new Array(n.bitLength()),t=0;t>>l}return e}(n);if(0===e.length)return new u(1);for(var t=this,l=0;l=0);var e,t=n%26,r=(n-t)/26,u=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(e=0;e>>26-t}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var u=n%26,o=Math.min((n-u)/26,this.length),i=67108863^67108863>>>u<o)for(this.length-=o,s=0;s=0&&(0!==c||s>=r);s--){var d=0|this.words[s];this.words[s]=c<<26-u|d>>>u,c=d&i}return a&&0!==c&&(a.words[a.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},u.prototype.ishrn=function(n,e,t){return l(0===this.negative),this.iushrn(n,e,t)},u.prototype.shln=function(n){return this.clone().ishln(n)},u.prototype.ushln=function(n){return this.clone().iushln(n)},u.prototype.shrn=function(n){return this.clone().ishrn(n)},u.prototype.ushrn=function(n){return this.clone().iushrn(n)},u.prototype.testn=function(n){l("number"==typeof n&&n>=0);var e=n%26,t=(n-e)/26;return!(this.length<=t||!(this.words[t]&1<=0);var e=n%26,t=(n-e)/26;return l(0===this.negative,"imaskn works only with positive numbers"),this.length<=t?this:(0!==e&&t++,this.length=Math.min(t,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},u.prototype.isubn=function(n){if(l("number"==typeof n),l(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(i/67108864|0),this.words[r+t]=67108863&u}for(;r>26,this.words[r+t]=67108863&u;if(0===o)return this.strip();for(l(-1===o),o=0,r=0;r>26,this.words[r]=67108863&u;return this.negative=1,this.strip()},u.prototype._wordDiv=function(n,e){var t,l=this.clone(),r=n,o=0|r.words[r.length-1];0!=(t=26-this._countBits(o))&&(r=r.ushln(t),l.iushln(t),o=0|r.words[r.length-1]);var i,a=l.length-r.length;if("mod"!==e){(i=new u(null)).length=a+1,i.words=new Array(i.length);for(var s=0;s=0;d--){var f=67108864*(0|l.words[r.length+d])+(0|l.words[r.length+d-1]);for(f=Math.min(f/o|0,67108863),l._ishlnsubmul(r,f,d);0!==l.negative;)f--,l.negative=0,l._ishlnsubmul(r,1,d),l.isZero()||(l.negative^=1);i&&(i.words[d]=f)}return i&&i.strip(),l.strip(),"div"!==e&&0!==t&&l.iushrn(t),{div:i||null,mod:l}},u.prototype.divmod=function(n,e,t){return l(!n.isZero()),this.isZero()?{div:new u(0),mod:new u(0)}:0!==this.negative&&0===n.negative?(i=this.neg().divmod(n,e),"mod"!==e&&(r=i.div.neg()),"div"!==e&&(o=i.mod.neg(),t&&0!==o.negative&&o.iadd(n)),{div:r,mod:o}):0===this.negative&&0!==n.negative?(i=this.divmod(n.neg(),e),"mod"!==e&&(r=i.div.neg()),{div:r,mod:i.mod}):0!=(this.negative&n.negative)?(i=this.neg().divmod(n.neg(),e),"div"!==e&&(o=i.mod.neg(),t&&0!==o.negative&&o.isub(n)),{div:i.div,mod:o}):n.length>this.length||this.cmp(n)<0?{div:new u(0),mod:this}:1===n.length?"div"===e?{div:this.divn(n.words[0]),mod:null}:"mod"===e?{div:null,mod:new u(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new u(this.modn(n.words[0]))}:this._wordDiv(n,e);var r,o,i},u.prototype.div=function(n){return this.divmod(n,"div",!1).div},u.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},u.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},u.prototype.divRound=function(n){var e=this.divmod(n);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(n):e.mod,l=n.ushrn(1),r=n.andln(1),u=t.cmp(l);return u<0||1===r&&0===u?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},u.prototype.modn=function(n){l(n<=67108863);for(var e=(1<<26)%n,t=0,r=this.length-1;r>=0;r--)t=(e*t+(0|this.words[r]))%n;return t},u.prototype.idivn=function(n){l(n<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var r=(0|this.words[t])+67108864*e;this.words[t]=r/n|0,e=r%n}return this.strip()},u.prototype.divn=function(n){return this.clone().idivn(n)},u.prototype.egcd=function(n){l(0===n.negative),l(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var r=new u(1),o=new u(0),i=new u(0),a=new u(1),s=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++s;for(var c=t.clone(),d=e.clone();!e.isZero();){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(c),o.isub(d)),r.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(t.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(d)),i.iushrn(1),a.iushrn(1);e.cmp(t)>=0?(e.isub(t),r.isub(i),o.isub(a)):(t.isub(e),i.isub(r),a.isub(o))}return{a:i,b:a,gcd:t.iushln(s)}},u.prototype._invmp=function(n){l(0===n.negative),l(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var r,o=new u(1),i=new u(0),a=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var s=0,c=1;0==(e.words[0]&c)&&s<26;++s,c<<=1);if(s>0)for(e.iushrn(s);s-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(a),i.iushrn(1);e.cmp(t)>=0?(e.isub(t),o.isub(i)):(t.isub(e),i.isub(o))}return(r=0===e.cmpn(1)?o:i).cmpn(0)<0&&r.iadd(n),r},u.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var e=this.clone(),t=n.clone();e.negative=0,t.negative=0;for(var l=0;e.isEven()&&t.isEven();l++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var r=e.cmp(t);if(r<0){var u=e;e=t,t=u}else if(0===r||0===t.cmpn(1))break;e.isub(t)}return t.iushln(l)},u.prototype.invm=function(n){return this.egcd(n).a.umod(n)},u.prototype.isEven=function(){return 0==(1&this.words[0])},u.prototype.isOdd=function(){return 1==(1&this.words[0])},u.prototype.andln=function(n){return this.words[0]&n},u.prototype.bincn=function(n){l("number"==typeof n);var e=n%26,t=(n-e)/26,r=1<>>26,this.words[o]=i&=67108863}return 0!==u&&(this.words[o]=u,this.length++),this},u.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},u.prototype.cmpn=function(n){var e,t=n<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(n=-n),l(n<=67108863,"Number is too big");var r=0|this.words[0];e=r===n?0:rn.length)return 1;if(this.length=0;t--){var l=0|this.words[t],r=0|n.words[t];if(l!==r){lr&&(e=1);break}}return e},u.prototype.gtn=function(n){return 1===this.cmpn(n)},u.prototype.gt=function(n){return 1===this.cmp(n)},u.prototype.gten=function(n){return this.cmpn(n)>=0},u.prototype.gte=function(n){return this.cmp(n)>=0},u.prototype.ltn=function(n){return-1===this.cmpn(n)},u.prototype.lt=function(n){return-1===this.cmp(n)},u.prototype.lten=function(n){return this.cmpn(n)<=0},u.prototype.lte=function(n){return this.cmp(n)<=0},u.prototype.eqn=function(n){return 0===this.cmpn(n)},u.prototype.eq=function(n){return 0===this.cmp(n)},u.red=function(n){return new C(n)},u.prototype.toRed=function(n){return l(!this.red,"Already a number in reduction context"),l(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)},u.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},u.prototype._forceRed=function(n){return this.red=n,this},u.prototype.forceRed=function(n){return l(!this.red,"Already a number in reduction context"),this._forceRed(n)},u.prototype.redAdd=function(n){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},u.prototype.redIAdd=function(n){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},u.prototype.redSub=function(n){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},u.prototype.redISub=function(n){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},u.prototype.redShl=function(n){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},u.prototype.redMul=function(n){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},u.prototype.redIMul=function(n){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},u.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},u.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},u.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},u.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},u.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},u.prototype.redPow=function(n){return l(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var g={k256:null,p224:null,p192:null,p25519:null};function v(n,e){this.name=n,this.p=new u(e,16),this.n=this.p.bitLength(),this.k=new u(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(n){if("string"==typeof n){var e=u._prime(n);this.m=e.p,this.prime=e}else l(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function E(n){C.call(this,n),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new u(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)}v.prototype._tmp=function(){var n=new u(null);return n.words=new Array(Math.ceil(this.n/13)),n},v.prototype.ireduce=function(n){var e,t=n;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var l=e0?t.isub(this.p):t.strip(),t},v.prototype.split=function(n,e){n.iushrn(this.n,0,e)},v.prototype.imulK=function(n){return n.imul(this.k)},r(b,v),b.prototype.split=function(n,e){for(var t=Math.min(n.length,9),l=0;l>>22,r=u}n.words[l-10]=r>>>=22,n.length-=0===r&&n.length>10?10:9},b.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var e=0,t=0;t>>=26,n.words[t]=r,e=l}return 0!==e&&(n.words[n.length++]=e),n},u._prime=function(n){if(g[n])return g[n];var e;if("k256"===n)e=new b;else if("p224"===n)e=new y;else if("p192"===n)e=new _;else{if("p25519"!==n)throw new Error("Unknown prime "+n);e=new w}return g[n]=e,e},C.prototype._verify1=function(n){l(0===n.negative,"red works only with positives"),l(n.red,"red works only with red numbers")},C.prototype._verify2=function(n,e){l(0==(n.negative|e.negative),"red works only with positives"),l(n.red&&n.red===e.red,"red works only with red numbers")},C.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)},C.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},C.prototype.add=function(n,e){this._verify2(n,e);var t=n.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},C.prototype.iadd=function(n,e){this._verify2(n,e);var t=n.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},C.prototype.sub=function(n,e){this._verify2(n,e);var t=n.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},C.prototype.isub=function(n,e){this._verify2(n,e);var t=n.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},C.prototype.shl=function(n,e){return this._verify1(n),this.imod(n.ushln(e))},C.prototype.imul=function(n,e){return this._verify2(n,e),this.imod(n.imul(e))},C.prototype.mul=function(n,e){return this._verify2(n,e),this.imod(n.mul(e))},C.prototype.isqr=function(n){return this.imul(n,n.clone())},C.prototype.sqr=function(n){return this.mul(n,n)},C.prototype.sqrt=function(n){if(n.isZero())return n.clone();var e=this.m.andln(3);if(l(e%2==1),3===e){var t=this.m.add(new u(1)).iushrn(2);return this.pow(n,t)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);l(!r.isZero());var i=new u(1).toRed(this),a=i.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new u(2*c*c).toRed(this);0!==this.pow(c,s).cmp(a);)c.redIAdd(a);for(var d=this.pow(c,r),f=this.pow(n,r.addn(1).iushrn(1)),h=this.pow(n,r),p=o;0!==h.cmp(i);){for(var m=h,g=0;0!==m.cmp(i);g++)m=m.redSqr();l(g=0;l--){for(var s=e.words[l],c=a-1;c>=0;c--){var d=s>>c&1;r!==t[0]&&(r=this.sqr(r)),0!==d||0!==o?(o<<=1,o|=d,(4==++i||0===l&&0===c)&&(r=this.mul(r,t[o]),i=0,o=0)):i=0}a=26}return r},C.prototype.convertTo=function(n){var e=n.umod(this.m);return e===n?e.clone():e},C.prototype.convertFrom=function(n){var e=n.clone();return e.red=null,e},u.mont=function(n){return new E(n)},r(E,C),E.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},E.prototype.convertFrom=function(n){var e=this.imod(n.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(n,e){if(n.isZero()||e.isZero())return n.words[0]=0,n.length=1,n;var t=n.imul(e),l=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(l).iushrn(this.shift),u=r;return r.cmp(this.m)>=0?u=r.isub(this.m):r.cmpn(0)<0&&(u=r.iadd(this.m)),u._forceRed(this)},E.prototype.mul=function(n,e){if(n.isZero()||e.isZero())return new u(0)._forceRed(this);var t=n.mul(e),l=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(l).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:25}],25:[function(n,e,t){},{}],26:[function(n,e,t){var l=n("safe-buffer").Buffer;function r(n){l.isBuffer(n)||(n=l.from(n));for(var e=n.length/4|0,t=new Array(e),r=0;r>>24]^c[p>>>16&255]^d[m>>>8&255]^f[255&g]^e[v++],o=s[p>>>24]^c[m>>>16&255]^d[g>>>8&255]^f[255&h]^e[v++],i=s[m>>>24]^c[g>>>16&255]^d[h>>>8&255]^f[255&p]^e[v++],a=s[g>>>24]^c[h>>>16&255]^d[p>>>8&255]^f[255&m]^e[v++],h=u,p=o,m=i,g=a;return u=(l[h>>>24]<<24|l[p>>>16&255]<<16|l[m>>>8&255]<<8|l[255&g])^e[v++],o=(l[p>>>24]<<24|l[m>>>16&255]<<16|l[g>>>8&255]<<8|l[255&h])^e[v++],i=(l[m>>>24]<<24|l[g>>>16&255]<<16|l[h>>>8&255]<<8|l[255&p])^e[v++],a=(l[g>>>24]<<24|l[h>>>16&255]<<16|l[p>>>8&255]<<8|l[255&m])^e[v++],[u>>>=0,o>>>=0,i>>>=0,a>>>=0]}var i=[0,1,2,4,8,16,32,64,128,27,54],a=function(){for(var n=new Array(256),e=0;e<256;e++)n[e]=e<128?e<<1:e<<1^283;for(var t=[],l=[],r=[[],[],[],[]],u=[[],[],[],[]],o=0,i=0,a=0;a<256;++a){var s=i^i<<1^i<<2^i<<3^i<<4;t[o]=s=s>>>8^255&s^99,l[s]=o;var c=n[o],d=n[c],f=n[d],h=257*n[s]^16843008*s;r[0][o]=h<<24|h>>>8,r[1][o]=h<<16|h>>>16,r[2][o]=h<<8|h>>>24,r[3][o]=h,u[0][s]=(h=16843009*f^65537*d^257*c^16843008*o)<<24|h>>>8,u[1][s]=h<<16|h>>>16,u[2][s]=h<<8|h>>>24,u[3][s]=h,0===o?o=i=1:(o=c^n[n[n[f^c]]],i^=n[n[i]])}return{SBOX:t,INV_SBOX:l,SUB_MIX:r,INV_SUB_MIX:u}}();function s(n){this._key=r(n),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var n=this._key,e=n.length,t=e+6,l=4*(t+1),r=[],u=0;u>>24)>>>24]<<24|a.SBOX[o>>>16&255]<<16|a.SBOX[o>>>8&255]<<8|a.SBOX[255&o],o^=i[u/e|0]<<24):e>6&&u%e==4&&(o=a.SBOX[o>>>24]<<24|a.SBOX[o>>>16&255]<<16|a.SBOX[o>>>8&255]<<8|a.SBOX[255&o]),r[u]=r[u-e]^o}for(var s=[],c=0;c>>24]]^a.INV_SUB_MIX[1][a.SBOX[f>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[f>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[255&f]]}this._nRounds=t,this._keySchedule=r,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(n){return o(n=r(n),this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)},s.prototype.encryptBlock=function(n){var e=this.encryptBlockRaw(n),t=l.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},s.prototype.decryptBlock=function(n){var e=(n=r(n))[1];n[1]=n[3],n[3]=e;var t=o(n,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds),u=l.allocUnsafe(16);return u.writeUInt32BE(t[0],0),u.writeUInt32BE(t[3],4),u.writeUInt32BE(t[2],8),u.writeUInt32BE(t[1],12),u},s.prototype.scrub=function(){u(this._keySchedule),u(this._invKeySchedule),u(this._key)},e.exports.AES=s},{"safe-buffer":189}],27:[function(n,e,t){var l=n("./aes"),r=n("safe-buffer").Buffer,u=n("cipher-base"),o=n("inherits"),i=n("./ghash"),a=n("buffer-xor");function s(n,e,t,o){u.call(this),this._finID=r.concat([t,r.from([0,0,0,1])]),t=r.concat([t,r.from([0,0,0,2])]),this._cipher=new l.AES(e),this._prev=r.from(t),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=n;var a=r.alloc(4,0);this._ghash=new i(this._cipher.encryptBlock(a)),this._authTag=null,this._called=!1}o(s,u),s.prototype._update=function(n){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=r.alloc(e,0),this._ghash.update(e))}this._called=!0;var t=this._mode.encrypt(this,n);return this._ghash.update(this._decrypt?n:t),this._len+=n.length,t},s.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var n=a(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(n,e){var t=0;n.length!==e.length&&t++;for(var l=Math.min(n.length,e.length),r=0;r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(n,e){var t=u[n.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var l=s(e,!1,t.key,t.iv);return f(n,l.key,l.iv)},t.createDecipheriv=f},{"./aes":26,"./authCipher":27,"./modes":38,"./streamCipher":41,"cipher-base":47,evp_bytestokey:150,inherits:158,"safe-buffer":189}],30:[function(n,e,t){var l=n("./modes"),r=n("./authCipher"),u=n("safe-buffer").Buffer,o=n("./streamCipher"),i=n("cipher-base"),a=n("./aes"),s=n("evp_bytestokey");function c(n,e,t){i.call(this),this._cache=new f,this._cipher=new a.AES(e),this._prev=u.from(t),this._mode=n,this._autopadding=!0}n("inherits")(c,i),c.prototype._update=function(n){var e,t;this._cache.add(n);for(var l=[];e=this._cache.get();)t=this._mode.encrypt(this,e),l.push(t);return u.concat(l)};var d=u.alloc(16,16);function f(){this.cache=u.allocUnsafe(0)}function h(n,e,t){var i=l[n.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=u.from(e)),e.length!==i.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof t&&(t=u.from(t)),t.length!==i.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===i.type?new o(i.module,e,t):"auth"===i.type?new r(i.module,e,t):new c(i.module,e,t)}c.prototype._final=function(){var n=this._cache.flush();if(this._autopadding)return n=this._mode.encrypt(this,n),this._cipher.scrub(),n;if(!n.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(n){return this._autopadding=!!n,this},f.prototype.add=function(n){this.cache=u.concat([this.cache,n])},f.prototype.get=function(){if(this.cache.length>15){var n=this.cache.slice(0,16);return this.cache=this.cache.slice(16),n}return null},f.prototype.flush=function(){for(var n=16-this.cache.length,e=u.allocUnsafe(n),t=-1;++t>>0,0),e.writeUInt32BE(n[1]>>>0,4),e.writeUInt32BE(n[2]>>>0,8),e.writeUInt32BE(n[3]>>>0,12),e}function o(n){this.h=n,this.state=l.alloc(16,0),this.cache=l.allocUnsafe(0)}o.prototype.ghash=function(n){for(var e=-1;++e0;e--)l[e]=l[e]>>>1|(1&l[e-1])<<31;l[0]=l[0]>>>1,t&&(l[0]=l[0]^225<<24)}this.state=u(r)},o.prototype.update=function(n){var e;for(this.cache=l.concat([this.cache,n]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},o.prototype.final=function(n,e){return this.cache.length&&this.ghash(l.concat([this.cache,r],16)),this.ghash(u([0,n,0,e])),this.state},e.exports=o},{"safe-buffer":189}],32:[function(n,e,t){var l=n("buffer-xor");t.encrypt=function(n,e){var t=l(e,n._prev);return n._prev=n._cipher.encryptBlock(t),n._prev},t.decrypt=function(n,e){var t=n._prev;n._prev=e;var r=n._cipher.decryptBlock(e);return l(r,t)}},{"buffer-xor":43}],33:[function(n,e,t){var l=n("safe-buffer").Buffer,r=n("buffer-xor");function u(n,e,t){var u=e.length,o=r(e,n._cache);return n._cache=n._cache.slice(u),n._prev=l.concat([n._prev,t?e:o]),o}t.encrypt=function(n,e,t){for(var r,o=l.allocUnsafe(0);e.length;){if(0===n._cache.length&&(n._cache=n._cipher.encryptBlock(n._prev),n._prev=l.allocUnsafe(0)),!(n._cache.length<=e.length)){o=l.concat([o,u(n,e,t)]);break}o=l.concat([o,u(n,e.slice(0,r=n._cache.length),t)]),e=e.slice(r)}return o}},{"buffer-xor":43,"safe-buffer":189}],34:[function(n,e,t){var l=n("safe-buffer").Buffer;function r(n,e,t){for(var l,r,o=-1,i=0;++o<8;)i+=(128&(r=n._cipher.encryptBlock(n._prev)[0]^(l=e&1<<7-o?128:0)))>>o%8,n._prev=u(n._prev,t?l:r);return i}function u(n,e){var t=n.length,r=-1,u=l.allocUnsafe(n.length);for(n=l.concat([n,l.from([e])]);++r>7;return u}t.encrypt=function(n,e,t){for(var u=e.length,o=l.allocUnsafe(u),i=-1;++iu)throw new RangeError("Invalid typed array length");var e=new Uint8Array(n);return e.__proto__=i.prototype,e}function i(n,e,t){if("number"==typeof n){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(n)}return a(n,e,t)}function a(n,e,t){if("number"==typeof n)throw new TypeError('"value" argument must not be a number');return L(n)?function(n,e,t){if(e<0||n.byteLength=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|n}function h(n,e){if(i.isBuffer(n))return n.length;if(q(n)||L(n))return n.byteLength;"string"!=typeof n&&(n=""+n);var t=n.length;if(0===t)return 0;for(var l=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return N(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return P(n).length;default:if(l)return N(n).length;e=(""+e).toLowerCase(),l=!0}}function p(n,e,t){var l=n[e];n[e]=n[t],n[t]=l}function m(n,e,t,l,r){if(0===n.length)return-1;if("string"==typeof t?(l=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),U(t=+t)&&(t=r?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(r)return-1;t=n.length-1}else if(t<0){if(!r)return-1;t=0}if("string"==typeof e&&(e=i.from(e,l)),i.isBuffer(e))return 0===e.length?-1:g(n,e,t,l,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):g(n,[e],t,l,r);throw new TypeError("val must be string, number or Buffer")}function g(n,e,t,l,r){var u,o=1,i=n.length,a=e.length;if(void 0!==l&&("ucs2"===(l=String(l).toLowerCase())||"ucs-2"===l||"utf16le"===l||"utf-16le"===l)){if(n.length<2||e.length<2)return-1;o=2,i/=2,a/=2,t/=2}function s(n,e){return 1===o?n[e]:n.readUInt16BE(e*o)}if(r){var c=-1;for(u=t;ui&&(t=i-a),u=t;u>=0;u--){for(var d=!0,f=0;fr&&(l=r):l=r;var u=e.length;if(u%2!=0)throw new TypeError("Invalid hex string");l>u/2&&(l=u/2);for(var o=0;o>8,r.push(t%256),r.push(l);return r}(e,n.length-t),n,t,l)}function E(n,e,t){return l.fromByteArray(0===e&&t===n.length?n:n.slice(e,t))}function A(n,e,t){t=Math.min(n.length,t);for(var l=[],r=e;r239?4:s>223?3:s>191?2:1;if(r+d<=t)switch(d){case 1:s<128&&(c=s);break;case 2:128==(192&(u=n[r+1]))&&(a=(31&s)<<6|63&u)>127&&(c=a);break;case 3:o=n[r+2],128==(192&(u=n[r+1]))&&128==(192&o)&&(a=(15&s)<<12|(63&u)<<6|63&o)>2047&&(a<55296||a>57343)&&(c=a);break;case 4:o=n[r+2],i=n[r+3],128==(192&(u=n[r+1]))&&128==(192&o)&&128==(192&i)&&(a=(15&s)<<18|(63&u)<<12|(63&o)<<6|63&i)>65535&&a<1114112&&(c=a)}null===c?(c=65533,d=1):c>65535&&(l.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),l.push(c),r+=d}return function(n){var e=n.length;if(e<=x)return String.fromCharCode.apply(String,n);for(var t="",l=0;lthis.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";for(n||(n="utf8");;)switch(n){case"hex":return F(this,e,t);case"utf8":case"utf-8":return A(this,e,t);case"ascii":return k(this,e,t);case"latin1":case"binary":return S(this,e,t);case"base64":return E(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),l=!0}}).apply(this,arguments)},i.prototype.equals=function(n){if(!i.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n||0===i.compare(this,n)},i.prototype.inspect=function(){var n="",e=t.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(n+=" ... ")),""},i.prototype.compare=function(n,e,t,l,r){if(!i.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===t&&(t=n?n.length:0),void 0===l&&(l=0),void 0===r&&(r=this.length),e<0||t>n.length||l<0||r>this.length)throw new RangeError("out of range index");if(l>=r&&e>=t)return 0;if(l>=r)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,l>>>=0,r>>>=0,this===n)return 0;for(var u=r-l,o=t-e,a=Math.min(u,o),s=this.slice(l,r),c=n.slice(e,t),d=0;d>>=0,isFinite(t)?(t>>>=0,void 0===l&&(l="utf8")):(l=t,t=void 0)}var r=this.length-e;if((void 0===t||t>r)&&(t=r),n.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");for(var u=!1;;)switch(l){case"hex":return v(this,n,e,t);case"utf8":case"utf-8":return b(this,n,e,t);case"ascii":return y(this,n,e,t);case"latin1":case"binary":return _(this,n,e,t);case"base64":return w(this,n,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,n,e,t);default:if(u)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),u=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function k(n,e,t){var l="";t=Math.min(n.length,t);for(var r=e;rr)&&(t=r);for(var u="",o=e;ot)throw new RangeError("Trying to access beyond buffer length")}function I(n,e,t,l,r,u){if(!i.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||en.length)throw new RangeError("Index out of range")}function T(n,e,t,l,r,u){if(t+l>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function M(n,e,t,l,u){return e=+e,t>>>=0,u||T(n,0,t,4),r.write(n,e,t,l,23,4),t+4}function O(n,e,t,l,u){return e=+e,t>>>=0,u||T(n,0,t,8),r.write(n,e,t,l,52,8),t+8}i.prototype.slice=function(n,e){var t=this.length;n=~~n,e=void 0===e?t:~~e,n<0?(n+=t)<0&&(n=0):n>t&&(n=t),e<0?(e+=t)<0&&(e=0):e>t&&(e=t),e>>=0,e>>>=0,t||D(n,e,this.length);for(var l=this[n],r=1,u=0;++u>>=0,e>>>=0,t||D(n,e,this.length);for(var l=this[n+--e],r=1;e>0&&(r*=256);)l+=this[n+--e]*r;return l},i.prototype.readUInt8=function(n,e){return n>>>=0,e||D(n,1,this.length),this[n]},i.prototype.readUInt16LE=function(n,e){return n>>>=0,e||D(n,2,this.length),this[n]|this[n+1]<<8},i.prototype.readUInt16BE=function(n,e){return n>>>=0,e||D(n,2,this.length),this[n]<<8|this[n+1]},i.prototype.readUInt32LE=function(n,e){return n>>>=0,e||D(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},i.prototype.readUInt32BE=function(n,e){return n>>>=0,e||D(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},i.prototype.readIntLE=function(n,e,t){n>>>=0,e>>>=0,t||D(n,e,this.length);for(var l=this[n],r=1,u=0;++u=(r*=128)&&(l-=Math.pow(2,8*e)),l},i.prototype.readIntBE=function(n,e,t){n>>>=0,e>>>=0,t||D(n,e,this.length);for(var l=e,r=1,u=this[n+--l];l>0&&(r*=256);)u+=this[n+--l]*r;return u>=(r*=128)&&(u-=Math.pow(2,8*e)),u},i.prototype.readInt8=function(n,e){return n>>>=0,e||D(n,1,this.length),128&this[n]?-1*(255-this[n]+1):this[n]},i.prototype.readInt16LE=function(n,e){n>>>=0,e||D(n,2,this.length);var t=this[n]|this[n+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(n,e){n>>>=0,e||D(n,2,this.length);var t=this[n+1]|this[n]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(n,e){return n>>>=0,e||D(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},i.prototype.readInt32BE=function(n,e){return n>>>=0,e||D(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},i.prototype.readFloatLE=function(n,e){return n>>>=0,e||D(n,4,this.length),r.read(this,n,!0,23,4)},i.prototype.readFloatBE=function(n,e){return n>>>=0,e||D(n,4,this.length),r.read(this,n,!1,23,4)},i.prototype.readDoubleLE=function(n,e){return n>>>=0,e||D(n,8,this.length),r.read(this,n,!0,52,8)},i.prototype.readDoubleBE=function(n,e){return n>>>=0,e||D(n,8,this.length),r.read(this,n,!1,52,8)},i.prototype.writeUIntLE=function(n,e,t,l){n=+n,e>>>=0,t>>>=0,l||I(this,n,e,t,Math.pow(2,8*t)-1,0);var r=1,u=0;for(this[e]=255&n;++u>>=0,t>>>=0,l||I(this,n,e,t,Math.pow(2,8*t)-1,0);var r=t-1,u=1;for(this[e+r]=255&n;--r>=0&&(u*=256);)this[e+r]=n/u&255;return e+t},i.prototype.writeUInt8=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,1,255,0),this[e]=255&n,e+1},i.prototype.writeUInt16LE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,2,65535,0),this[e]=255&n,this[e+1]=n>>>8,e+2},i.prototype.writeUInt16BE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,2,65535,0),this[e]=n>>>8,this[e+1]=255&n,e+2},i.prototype.writeUInt32LE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,4,4294967295,0),this[e+3]=n>>>24,this[e+2]=n>>>16,this[e+1]=n>>>8,this[e]=255&n,e+4},i.prototype.writeUInt32BE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,4,4294967295,0),this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n,e+4},i.prototype.writeIntLE=function(n,e,t,l){if(n=+n,e>>>=0,!l){var r=Math.pow(2,8*t-1);I(this,n,e,t,r-1,-r)}var u=0,o=1,i=0;for(this[e]=255&n;++u>0)-i&255;return e+t},i.prototype.writeIntBE=function(n,e,t,l){if(n=+n,e>>>=0,!l){var r=Math.pow(2,8*t-1);I(this,n,e,t,r-1,-r)}var u=t-1,o=1,i=0;for(this[e+u]=255&n;--u>=0&&(o*=256);)n<0&&0===i&&0!==this[e+u+1]&&(i=1),this[e+u]=(n/o>>0)-i&255;return e+t},i.prototype.writeInt8=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,1,127,-128),n<0&&(n=255+n+1),this[e]=255&n,e+1},i.prototype.writeInt16LE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,2,32767,-32768),this[e]=255&n,this[e+1]=n>>>8,e+2},i.prototype.writeInt16BE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,2,32767,-32768),this[e]=n>>>8,this[e+1]=255&n,e+2},i.prototype.writeInt32LE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,4,2147483647,-2147483648),this[e]=255&n,this[e+1]=n>>>8,this[e+2]=n>>>16,this[e+3]=n>>>24,e+4},i.prototype.writeInt32BE=function(n,e,t){return n=+n,e>>>=0,t||I(this,n,e,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n,e+4},i.prototype.writeFloatLE=function(n,e,t){return M(this,n,e,!0,t)},i.prototype.writeFloatBE=function(n,e,t){return M(this,n,e,!1,t)},i.prototype.writeDoubleLE=function(n,e,t){return O(this,n,e,!0,t)},i.prototype.writeDoubleBE=function(n,e,t){return O(this,n,e,!1,t)},i.prototype.copy=function(n,e,t,l){if(t||(t=0),l||0===l||(l=this.length),e>=n.length&&(e=n.length),e||(e=0),l>0&&l=this.length)throw new RangeError("sourceStart out of bounds");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),n.length-e=0;--r)n[r+e]=this[r+t];else if(u<1e3)for(r=0;r>>=0,t=void 0===t?this.length:t>>>0,n||(n=0),"number"==typeof n)for(u=e;u55295&&t<57344){if(!r){if(t>56319){(e-=3)>-1&&u.push(239,191,189);continue}if(o+1===l){(e-=3)>-1&&u.push(239,191,189);continue}r=t;continue}if(t<56320){(e-=3)>-1&&u.push(239,191,189),r=t;continue}t=65536+(r-55296<<10|t-56320)}else r&&(e-=3)>-1&&u.push(239,191,189);if(r=null,t<128){if((e-=1)<0)break;u.push(t)}else if(t<2048){if((e-=2)<0)break;u.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;u.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return u}function P(n){return l.toByteArray(function(n){if((n=n.trim().replace(R,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(n))}function j(n,e,t,l){for(var r=0;r=e.length||r>=n.length);++r)e[r+t]=n[r];return r}function L(n){return n instanceof ArrayBuffer||null!=n&&null!=n.constructor&&"ArrayBuffer"===n.constructor.name&&"number"==typeof n.byteLength}function q(n){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(n)}function U(n){return n!=n}},{"base64-js":19,ieee754:157}],45:[function(n,e,t){var l;l=function(n){"use strict";var e=function(n,t,r){if(void 0===n&&(n=e.DEFAULT_CAPACITY),void 0===t&&(t=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if((n|=0)<0)throw RangeError("Illegal capacity");t=!!t,r=!!r}this.buffer=0===n?l:new ArrayBuffer(n),this.view=0===n?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=n,this.littleEndian=t,this.noAssert=r};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=n||null;var t=e.prototype;Object.defineProperty(t,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var l=new ArrayBuffer(0),r=String.fromCharCode;function u(n){var e=0;return function(){return e1024&&(e.push(r.apply(String,n)),n.length=0),Array.prototype.push.apply(n,arguments)}}function i(n,e,t,l,r){var u,o,i=8*r-l-1,a=(1<>1,c=-7,d=t?r-1:0,f=t?-1:1,h=n[e+d];for(d+=f,u=h&(1<<-c)-1,h>>=-c,c+=i;c>0;u=256*u+n[e+d],d+=f,c-=8);for(o=u&(1<<-c)-1,u>>=-c,c+=l;c>0;o=256*o+n[e+d],d+=f,c-=8);if(0===u)u=1-s;else{if(u===a)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,l),u-=s}return(h?-1:1)*o*Math.pow(2,u-l)}function a(n,e,t,l,r,u){var o,i,a,s=8*u-r-1,c=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=l?0:u-1,p=l?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),(e+=o+d>=1?f/a:f*Math.pow(2,1-d))*a>=2&&(o++,a/=2),o+d>=c?(i=0,o=c):o+d>=1?(i=(e*a-1)*Math.pow(2,r),o+=d):(i=e*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;n[t+h]=255&i,h+=p,i/=256,r-=8);for(o=o<0;n[t+h]=255&o,h+=p,o/=256,s-=8);n[t+h-p]|=128*m}e.accessor=function(){return Uint8Array},e.allocate=function(n,t,l){return new e(n,t,l)},e.concat=function(n,t,l,r){"boolean"!=typeof t&&"string"==typeof t||(r=l,l=t,t=void 0);for(var u,o=0,i=0,a=n.length;i0&&(o+=u);if(0===o)return new e(0,l,r);var s,c=new e(o,l,r);for(i=0;i0&&(o.buffer=n.buffer,o.offset=n.byteOffset,o.limit=n.byteOffset+n.byteLength,o.view=new Uint8Array(n.buffer));else if(n instanceof ArrayBuffer)o=new e(0,r,u),n.byteLength>0&&(o.buffer=n,o.offset=0,o.limit=n.byteLength,o.view=n.byteLength>0?new Uint8Array(n):null);else{if("[object Array]"!==Object.prototype.toString.call(n))throw TypeError("Illegal buffer");(o=new e(n.length,r,u)).limit=n.length;for(var i=0;i>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l,r=e,u=n.length,o=u>>3,i=0;for(e+=this.writeVarint32(u,e);o--;)l=1&!!n[i++]|(1&!!n[i++])<<1|(1&!!n[i++])<<2|(1&!!n[i++])<<3|(1&!!n[i++])<<4|(1&!!n[i++])<<5|(1&!!n[i++])<<6|(1&!!n[i++])<<7,this.writeByte(l,e++);if(i>3,o=0,i=[];for(n+=l.length;u--;)t=this.readByte(n++),i[o++]=!!(1&t),i[o++]=!!(2&t),i[o++]=!!(4&t),i[o++]=!!(8&t),i[o++]=!!(16&t),i[o++]=!!(32&t),i[o++]=!!(64&t),i[o++]=!!(128&t);if(o>a++&1)}return e&&(this.offset=n),i},t.readBytes=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+n>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+n+") <= "+this.buffer.byteLength)}var l=this.slice(e,e+n);return t&&(this.offset+=n),l},t.writeBytes=t.append,t.writeInt8=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=1)>l&&this.resize((l*=2)>e?l:e),this.view[e-=1]=n,t&&(this.offset+=1),this},t.writeByte=t.writeInt8,t.readInt8=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+1) <= "+this.buffer.byteLength)}var t=this.view[n];return 128==(128&t)&&(t=-(255-t+1)),e&&(this.offset+=1),t},t.readByte=t.readInt8,t.writeUint8=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=1)>l&&this.resize((l*=2)>e?l:e),this.view[e-=1]=n,t&&(this.offset+=1),this},t.writeUInt8=t.writeUint8,t.readUint8=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+1) <= "+this.buffer.byteLength)}var t=this.view[n];return e&&(this.offset+=1),t},t.readUInt8=t.readUint8,t.writeInt16=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=2)>l&&this.resize((l*=2)>e?l:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&n)>>>8,this.view[e]=255&n):(this.view[e]=(65280&n)>>>8,this.view[e+1]=255&n),t&&(this.offset+=2),this},t.writeShort=t.writeInt16,t.readInt16=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+2) <= "+this.buffer.byteLength)}var t=0;return this.littleEndian?(t=this.view[n],t|=this.view[n+1]<<8):(t=this.view[n]<<8,t|=this.view[n+1]),32768==(32768&t)&&(t=-(65535-t+1)),e&&(this.offset+=2),t},t.readShort=t.readInt16,t.writeUint16=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=2)>l&&this.resize((l*=2)>e?l:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&n)>>>8,this.view[e]=255&n):(this.view[e]=(65280&n)>>>8,this.view[e+1]=255&n),t&&(this.offset+=2),this},t.writeUInt16=t.writeUint16,t.readUint16=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+2) <= "+this.buffer.byteLength)}var t=0;return this.littleEndian?(t=this.view[n],t|=this.view[n+1]<<8):(t=this.view[n]<<8,t|=this.view[n+1]),e&&(this.offset+=2),t},t.readUInt16=t.readUint16,t.writeInt32=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=4)>l&&this.resize((l*=2)>e?l:e),e-=4,this.littleEndian?(this.view[e+3]=n>>>24&255,this.view[e+2]=n>>>16&255,this.view[e+1]=n>>>8&255,this.view[e]=255&n):(this.view[e]=n>>>24&255,this.view[e+1]=n>>>16&255,this.view[e+2]=n>>>8&255,this.view[e+3]=255&n),t&&(this.offset+=4),this},t.writeInt=t.writeInt32,t.readInt32=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+4) <= "+this.buffer.byteLength)}var t=0;return this.littleEndian?(t=this.view[n+2]<<16,t|=this.view[n+1]<<8,t|=this.view[n],t+=this.view[n+3]<<24>>>0):(t=this.view[n+1]<<16,t|=this.view[n+2]<<8,t|=this.view[n+3],t+=this.view[n]<<24>>>0),t|=0,e&&(this.offset+=4),t},t.readInt=t.readInt32,t.writeUint32=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=4)>l&&this.resize((l*=2)>e?l:e),e-=4,this.littleEndian?(this.view[e+3]=n>>>24&255,this.view[e+2]=n>>>16&255,this.view[e+1]=n>>>8&255,this.view[e]=255&n):(this.view[e]=n>>>24&255,this.view[e+1]=n>>>16&255,this.view[e+2]=n>>>8&255,this.view[e+3]=255&n),t&&(this.offset+=4),this},t.writeUInt32=t.writeUint32,t.readUint32=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+4) <= "+this.buffer.byteLength)}var t=0;return this.littleEndian?(t=this.view[n+2]<<16,t|=this.view[n+1]<<8,t|=this.view[n],t+=this.view[n+3]<<24>>>0):(t=this.view[n+1]<<16,t|=this.view[n+2]<<8,t|=this.view[n+3],t+=this.view[n]<<24>>>0),e&&(this.offset+=4),t},t.readUInt32=t.readUint32,n&&(t.writeInt64=function(e,t){var l=void 0===t;if(l&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=n.fromNumber(e);else if("string"==typeof e)e=n.fromString(e);else if(!(e&&e instanceof n))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=n.fromNumber(e):"string"==typeof e&&(e=n.fromString(e));var r=this.buffer.byteLength;(t+=8)>r&&this.resize((r*=2)>t?r:t),t-=8;var u=e.low,o=e.high;return this.littleEndian?(this.view[t+3]=u>>>24&255,this.view[t+2]=u>>>16&255,this.view[t+1]=u>>>8&255,this.view[t]=255&u,this.view[(t+=4)+3]=o>>>24&255,this.view[t+2]=o>>>16&255,this.view[t+1]=o>>>8&255,this.view[t]=255&o):(this.view[t]=o>>>24&255,this.view[t+1]=o>>>16&255,this.view[t+2]=o>>>8&255,this.view[t+3]=255&o,this.view[t+=4]=u>>>24&255,this.view[t+1]=u>>>16&255,this.view[t+2]=u>>>8&255,this.view[t+3]=255&u),l&&(this.offset+=8),this},t.writeLong=t.writeInt64,t.readInt64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var l=0,r=0;this.littleEndian?(l=this.view[e+2]<<16,l|=this.view[e+1]<<8,l|=this.view[e],l+=this.view[e+3]<<24>>>0,r=this.view[(e+=4)+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,l=this.view[(e+=4)+1]<<16,l|=this.view[e+2]<<8,l|=this.view[e+3],l+=this.view[e]<<24>>>0);var u=new n(l,r,!1);return t&&(this.offset+=8),u},t.readLong=t.readInt64,t.writeUint64=function(e,t){var l=void 0===t;if(l&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=n.fromNumber(e);else if("string"==typeof e)e=n.fromString(e);else if(!(e&&e instanceof n))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=n.fromNumber(e):"string"==typeof e&&(e=n.fromString(e));var r=this.buffer.byteLength;(t+=8)>r&&this.resize((r*=2)>t?r:t),t-=8;var u=e.low,o=e.high;return this.littleEndian?(this.view[t+3]=u>>>24&255,this.view[t+2]=u>>>16&255,this.view[t+1]=u>>>8&255,this.view[t]=255&u,this.view[(t+=4)+3]=o>>>24&255,this.view[t+2]=o>>>16&255,this.view[t+1]=o>>>8&255,this.view[t]=255&o):(this.view[t]=o>>>24&255,this.view[t+1]=o>>>16&255,this.view[t+2]=o>>>8&255,this.view[t+3]=255&o,this.view[t+=4]=u>>>24&255,this.view[t+1]=u>>>16&255,this.view[t+2]=u>>>8&255,this.view[t+3]=255&u),l&&(this.offset+=8),this},t.writeUInt64=t.writeUint64,t.readUint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var l=0,r=0;this.littleEndian?(l=this.view[e+2]<<16,l|=this.view[e+1]<<8,l|=this.view[e],l+=this.view[e+3]<<24>>>0,r=this.view[(e+=4)+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,l=this.view[(e+=4)+1]<<16,l|=this.view[e+2]<<8,l|=this.view[e+3],l+=this.view[e]<<24>>>0);var u=new n(l,r,!0);return t&&(this.offset+=8),u},t.readUInt64=t.readUint64),t.writeFloat32=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n)throw TypeError("Illegal value: "+n+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=4)>l&&this.resize((l*=2)>e?l:e),a(this.view,n,e-=4,this.littleEndian,23,4),t&&(this.offset+=4),this},t.writeFloat=t.writeFloat32,t.readFloat32=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+4) <= "+this.buffer.byteLength)}var t=i(this.view,n,this.littleEndian,23,4);return e&&(this.offset+=4),t},t.readFloat=t.readFloat32,t.writeFloat64=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof n)throw TypeError("Illegal value: "+n+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l=this.buffer.byteLength;return(e+=8)>l&&this.resize((l*=2)>e?l:e),a(this.view,n,e-=8,this.littleEndian,52,8),t&&(this.offset+=8),this},t.writeDouble=t.writeFloat64,t.readFloat64=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+8) <= "+this.buffer.byteLength)}var t=i(this.view,n,this.littleEndian,52,8);return e&&(this.offset+=8),t},t.readDouble=t.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(n){return(n>>>=0)<128?1:n<16384?2:n<1<<21?3:n<1<<28?4:5},e.zigZagEncode32=function(n){return((n|=0)<<1^n>>31)>>>0},e.zigZagDecode32=function(n){return n>>>1^-(1&n)|0},t.writeVarint32=function(n,t){var l=void 0===t;if(l&&(t=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r=e.calculateVarint32(n),u=this.buffer.byteLength;for((t+=r)>u&&this.resize((u*=2)>t?u:t),t-=r,n>>>=0;n>=128;)this.view[t++]=127&n|128,n>>>=7;return this.view[t++]=n,l?(this.offset=t,this):r},t.writeVarint32ZigZag=function(n,t){return this.writeVarint32(e.zigZagEncode32(n),t)},t.readVarint32=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+1) <= "+this.buffer.byteLength)}var t,l=0,r=0;do{if(!this.noAssert&&n>this.limit){var u=Error("Truncated");throw u.truncated=!0,u}t=this.view[n++],l<5&&(r|=(127&t)<<7*l),++l}while(0!=(128&t));return r|=0,e?(this.offset=n,r):{value:r,length:l}},t.readVarint32ZigZag=function(n){var t=this.readVarint32(n);return"object"==typeof t?t.value=e.zigZagDecode32(t.value):t=e.zigZagDecode32(t),t},n&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=n.fromNumber(e):"string"==typeof e&&(e=n.fromString(e));var t=e.toInt()>>>0,l=e.shiftRightUnsigned(28).toInt()>>>0,r=e.shiftRightUnsigned(56).toInt()>>>0;return 0==r?0==l?t<16384?t<128?1:2:t<1<<21?3:4:l<16384?l<128?5:6:l<1<<21?7:8:r<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=n.fromNumber(e,!1):"string"==typeof e?e=n.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=n.fromNumber(e,!1):"string"==typeof e?e=n.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(n.ONE).toSigned().negate()).toSigned()},t.writeVarint64=function(t,l){var r=void 0===l;if(r&&(l=this.offset),!this.noAssert){if("number"==typeof t)t=n.fromNumber(t);else if("string"==typeof t)t=n.fromString(t);else if(!(t&&t instanceof n))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof l||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=n.fromNumber(t,!1):"string"==typeof t?t=n.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned());var u=e.calculateVarint64(t),o=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,a=t.shiftRightUnsigned(56).toInt()>>>0,s=this.buffer.byteLength;switch((l+=u)>s&&this.resize((s*=2)>l?s:l),l-=u,u){case 10:this.view[l+9]=a>>>7&1;case 9:this.view[l+8]=9!==u?128|a:127&a;case 8:this.view[l+7]=8!==u?i>>>21|128:i>>>21&127;case 7:this.view[l+6]=7!==u?i>>>14|128:i>>>14&127;case 6:this.view[l+5]=6!==u?i>>>7|128:i>>>7&127;case 5:this.view[l+4]=5!==u?128|i:127&i;case 4:this.view[l+3]=4!==u?o>>>21|128:o>>>21&127;case 3:this.view[l+2]=3!==u?o>>>14|128:o>>>14&127;case 2:this.view[l+1]=2!==u?o>>>7|128:o>>>7&127;case 1:this.view[l]=1!==u?128|o:127&o}return r?(this.offset+=u,this):u},t.writeVarint64ZigZag=function(n,t){return this.writeVarint64(e.zigZagEncode64(n),t)},t.readVarint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var l=e,r=0,u=0,o=0,i=0;if(r=127&(i=this.view[e++]),128&i&&(r|=(127&(i=this.view[e++]))<<7,(128&i||this.noAssert&&void 0===i)&&(r|=(127&(i=this.view[e++]))<<14,(128&i||this.noAssert&&void 0===i)&&(r|=(127&(i=this.view[e++]))<<21,(128&i||this.noAssert&&void 0===i)&&(u=127&(i=this.view[e++]),(128&i||this.noAssert&&void 0===i)&&(u|=(127&(i=this.view[e++]))<<7,(128&i||this.noAssert&&void 0===i)&&(u|=(127&(i=this.view[e++]))<<14,(128&i||this.noAssert&&void 0===i)&&(u|=(127&(i=this.view[e++]))<<21,(128&i||this.noAssert&&void 0===i)&&(o=127&(i=this.view[e++]),(128&i||this.noAssert&&void 0===i)&&(o|=(127&(i=this.view[e++]))<<7,128&i||this.noAssert&&void 0===i))))))))))throw Error("Buffer overrun");var a=n.fromBits(r|u<<28,u>>>4|o<<24,!1);return t?(this.offset=e,a):{value:a,length:e-l}},t.readVarint64ZigZag=function(t){var l=this.readVarint64(t);return l&&l.value instanceof n?l.value=e.zigZagDecode64(l.value):l=e.zigZagDecode64(l),l}),t.writeCString=function(n,e){var t=void 0===e;t&&(e=this.offset);var l,r=n.length;if(!this.noAssert){if("string"!=typeof n)throw TypeError("Illegal str: Not a string");for(l=0;l>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}r=c.calculateUTF16asUTF8(u(n))[1];var o=this.buffer.byteLength;return(e+=r+1)>o&&this.resize((o*=2)>e?o:e),e-=r+1,c.encodeUTF16toUTF8(u(n),(function(n){this.view[e++]=n}).bind(this)),this.view[e++]=0,t?(this.offset=e,this):r},t.readCString=function(n){var e=void 0===n;if(e&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+1) <= "+this.buffer.byteLength)}var t,l=n,r=-1;return c.decodeUTF8toUTF16((function(){if(0===r)return null;if(n>=this.limit)throw RangeError("Illegal range: Truncated data, "+n+" < "+this.limit);return 0===(r=this.view[n++])?null:r}).bind(this),t=o(),!0),e?(this.offset=n,t()):{string:t(),length:n-l}},t.writeIString=function(n,e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("string"!=typeof n)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var l,r=e;l=c.calculateUTF16asUTF8(u(n),this.noAssert)[1];var o=this.buffer.byteLength;if((e+=4+l)>o&&this.resize((o*=2)>e?o:e),e-=4+l,this.littleEndian?(this.view[e+3]=l>>>24&255,this.view[e+2]=l>>>16&255,this.view[e+1]=l>>>8&255,this.view[e]=255&l):(this.view[e]=l>>>24&255,this.view[e+1]=l>>>16&255,this.view[e+2]=l>>>8&255,this.view[e+3]=255&l),e+=4,c.encodeUTF16toUTF8(u(n),(function(n){this.view[e++]=n}).bind(this)),e!==r+4+l)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+l));return t?(this.offset=e,this):e-r},t.readIString=function(n){var t=void 0===n;if(t&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+4) <= "+this.buffer.byteLength)}var l=n,r=this.readUint32(n),u=this.readUTF8String(r,e.METRICS_BYTES,n+=4);return n+=u.length,t?(this.offset=n,u.string):{string:u.string,length:n-l}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",t.writeUTF8String=function(n,e){var t,l=void 0===e;if(l&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r=e;t=c.calculateUTF16asUTF8(u(n))[1];var o=this.buffer.byteLength;return(e+=t)>o&&this.resize((o*=2)>e?o:e),e-=t,c.encodeUTF16toUTF8(u(n),(function(n){this.view[e++]=n}).bind(this)),l?(this.offset=e,this):e-r},t.writeString=t.writeUTF8String,e.calculateUTF8Chars=function(n){return c.calculateUTF16asUTF8(u(n))[0]},e.calculateUTF8Bytes=function(n){return c.calculateUTF16asUTF8(u(n))[1]},e.calculateString=e.calculateUTF8Bytes,t.readUTF8String=function(n,t,l){"number"==typeof t&&(l=t,t=void 0);var r=void 0===l;if(r&&(l=this.offset),void 0===t&&(t=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal length: "+n+" (not an integer)");if(n|=0,"number"!=typeof l||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}var u,i=0,a=l;if(t===e.METRICS_CHARS){if(u=o(),c.decodeUTF8((function(){return i>>=0)<0||l+n>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+"+n+") <= "+this.buffer.byteLength)}var s=l+n;if(c.decodeUTF8toUTF16((function(){return l>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,o,i=t;r=c.calculateUTF16asUTF8(u(n),this.noAssert)[1],o=e.calculateVarint32(r);var a=this.buffer.byteLength;if((t+=o+r)>a&&this.resize((a*=2)>t?a:t),t-=o+r,t+=this.writeVarint32(r,t),c.encodeUTF16toUTF8(u(n),(function(n){this.view[t++]=n}).bind(this)),t!==i+r+o)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+r+o));return l?(this.offset=t,this):t-i},t.readVString=function(n){var t=void 0===n;if(t&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+1) <= "+this.buffer.byteLength)}var l=n,r=this.readVarint32(n),u=this.readUTF8String(r.value,e.METRICS_BYTES,n+=r.length);return n+=u.length,t?(this.offset=n,u.string):{string:u.string,length:n-l}},t.append=function(n,t,l){"number"!=typeof t&&"string"==typeof t||(l=t,t=void 0);var r=void 0===l;if(r&&(l=this.offset),!this.noAssert){if("number"!=typeof l||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}n instanceof e||(n=e.wrap(n,t));var u=n.limit-n.offset;if(u<=0)return this;var o=this.buffer.byteLength;return(l+=u)>o&&this.resize((o*=2)>l?o:l),l-=u,this.view.set(n.view.subarray(n.offset,n.limit),l),n.offset+=u,r&&(this.offset+=u),this},t.appendTo=function(n,e){return n.append(this,e),this},t.assert=function(n){return this.noAssert=!n,this},t.capacity=function(){return this.buffer.byteLength},t.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},t.clone=function(n){var t=new e(0,this.littleEndian,this.noAssert);return n?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},t.compact=function(n,e){if(void 0===n&&(n=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal begin: Not an integer");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,n<0||n>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+e+" <= "+this.buffer.byteLength)}if(0===n&&e===this.buffer.byteLength)return this;var t=e-n;if(0===t)return this.buffer=l,this.view=null,this.markedOffset>=0&&(this.markedOffset-=n),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(t),u=new Uint8Array(r);return u.set(this.view.subarray(n,e)),this.buffer=r,this.view=u,this.markedOffset>=0&&(this.markedOffset-=n),this.offset=0,this.limit=t,this},t.copy=function(n,t){if(void 0===n&&(n=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal begin: Not an integer");if(n>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,n<0||n>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+t+" <= "+this.buffer.byteLength)}if(n===t)return new e(0,this.littleEndian,this.noAssert);var l=t-n,r=new e(l,this.littleEndian,this.noAssert);return r.offset=0,r.limit=l,r.markedOffset>=0&&(r.markedOffset-=n),this.copyTo(r,0,n,t),r},t.copyTo=function(n,t,l,r){var u,o;if(!this.noAssert&&!e.isByteBuffer(n))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?n.offset:0|t,l=(u=void 0===l)?this.offset:0|l,r=void 0===r?this.limit:0|r,t<0||t>n.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+n.buffer.byteLength);if(l<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+l+" <= "+this.buffer.byteLength);var i=r-l;return 0===i?n:(n.ensureCapacity(t+i),n.view.set(this.view.subarray(l,r),t),u&&(this.offset+=i),o&&(n.offset+=i),this)},t.ensureCapacity=function(n){var e=this.buffer.byteLength;return en?e:n):this},t.fill=function(n,e,t){var l=void 0===e;if(l&&(e=this.offset),"string"==typeof n&&n.length>0&&(n=n.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal value: "+n+" (not an integer)");if(n|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e>=t)return this;for(;e>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=n,this},t.order=function(n){if(!this.noAssert&&"boolean"!=typeof n)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!n,this},t.LE=function(n){return this.littleEndian=void 0===n||!!n,this},t.BE=function(n){return this.littleEndian=void 0!==n&&!n,this},t.prepend=function(n,t,l){"number"!=typeof t&&"string"==typeof t||(l=t,t=void 0);var r=void 0===l;if(r&&(l=this.offset),!this.noAssert){if("number"!=typeof l||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}n instanceof e||(n=e.wrap(n,t));var u=n.limit-n.offset;if(u<=0)return this;var o=u-l;if(o>0){var i=new ArrayBuffer(this.buffer.byteLength+o),a=new Uint8Array(i);a.set(this.view.subarray(l,this.buffer.byteLength),u),this.buffer=i,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,l+=o}else new Uint8Array(this.buffer);return this.view.set(n.view.subarray(n.offset,n.limit),l-u),n.offset=n.limit,r&&(this.offset-=u),this},t.prependTo=function(n,e){return n.prepend(this,e),this},t.printDebug=function(n){"function"!=typeof n&&(n=console.log.bind(console)),n(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},t.remaining=function(){return this.limit-this.offset},t.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},t.resize=function(n){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal capacity: "+n+" (not an integer)");if((n|=0)<0)throw RangeError("Illegal capacity: 0 <= "+n)}if(this.buffer.byteLength>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,n<0||n>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+e+" <= "+this.buffer.byteLength)}return n===e?this:(Array.prototype.reverse.call(this.view.subarray(n,e)),this)},t.skip=function(n){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal length: "+n+" (not an integer)");n|=0}var e=this.offset+n;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+n+" <= "+this.buffer.byteLength);return this.offset=e,this},t.slice=function(n,e){if(void 0===n&&(n=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal begin: Not an integer");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,n<0||n>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+e+" <= "+this.buffer.byteLength)}var t=this.clone();return t.offset=n,t.limit=e,t},t.toBuffer=function(n){var e=this.offset,t=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal limit: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(!n&&0===e&&t===this.buffer.byteLength)return this.buffer;if(e===t)return l;var r=new ArrayBuffer(t-e);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(e,t),0),r},t.toArrayBuffer=t.toBuffer,t.toString=function(n,e,t){if(void 0===n)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof n&&(t=e=n="utf8"),n){case"utf8":return this.toUTF8(e,t);case"base64":return this.toBase64(e,t);case"hex":return this.toHex(e,t);case"binary":return this.toBinary(e,t);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+n)}};var s=function(){for(var n={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],t=[],l=0,r=e.length;l>2&63]),r=(3&l)<<4,null!==(l=n())?(t(e[63&((r|=l>>4&15)|l>>4&15)]),r=(15&l)<<2,null!==(l=n())?(t(e[63&(r|l>>6&3)]),t(e[63&l])):(t(e[63&r]),t(61))):(t(e[63&r]),t(61),t(61))},n.decode=function(n,e){var l,r,u;function o(n){throw Error("Illegal character code: "+n)}for(;null!==(l=n());)if(void 0===(r=t[l])&&o(l),null!==(l=n())&&(void 0===(u=t[l])&&o(l),e(r<<2>>>0|(48&u)>>4),null!==(l=n()))){if(void 0===(r=t[l])){if(61===l)break;o(l)}if(e((15&u)<<4>>>0|(60&r)>>2),null!==(l=n())){if(void 0===(u=t[l])){if(61===l)break;o(l)}e((3&r)<<6>>>0|u)}}},n.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)},n}();t.toBase64=function(n,e){if(void 0===n&&(n=this.offset),void 0===e&&(e=this.limit),e|=0,(n|=0)<0||e>this.capacity||n>e)throw RangeError("begin, end");var t;return s.encode((function(){return nthis.capacity()||n>e)throw RangeError("begin, end");if(n===e)return"";for(var t=[],l=[];n=1024&&(l.push(String.fromCharCode.apply(String,t)),t=[]);return l.join("")+String.fromCharCode.apply(String,t)},e.fromBinary=function(n,t){if("string"!=typeof n)throw TypeError("str");for(var l,r=0,u=n.length,o=new e(u,t);r255)throw RangeError("illegal char code: "+l);o.view[r++]=l}return o.limit=u,o},t.toDebug=function(n){for(var e,t=-1,l=this.buffer.byteLength,r="",u="",o="";t32&&e<127?String.fromCharCode(e):".")),++t,n&&t>0&&t%16==0&&t!==l){for(;r.length<51;)r+=" ";o+=r+u+"\n",r=u=""}r+=t===this.offset&&t===this.limit?t===this.markedOffset?"!":"|":t===this.offset?t===this.markedOffset?"[":"<":t===this.limit?t===this.markedOffset?"]":">":t===this.markedOffset?"'":n||0!==t&&t!==l?" ":""}if(n&&" "!==r){for(;r.length<51;)r+=" ";o+=r+u+"\n"}return n?o:r},e.fromDebug=function(n,t,l){for(var r,u,o=n.length,i=new e((o+1)/3|0,t,l),a=0,s=0,c=!1,d=!1,f=!1,h=!1,p=!1;a":if(!l){if(h){p=!0;break}h=!0}i.limit=s,c=!1;break;case"'":if(!l){if(f){p=!0;break}f=!0}i.markedOffset=s,c=!1;break;case" ":c=!1;break;default:if(!l&&c){p=!0;break}if(u=parseInt(r+n.charAt(a++),16),!l&&(isNaN(u)||u<0||u>255))throw TypeError("Illegal str: Not a debug encoded string");i.view[s++]=u,c=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!l){if(!d||!h)throw TypeError("Illegal str: Missing offset or limit");if(s>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,n<0||n>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+e+" <= "+this.buffer.byteLength)}for(var t,l=new Array(e-n);n255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=r}return o.limit=a,o};var c=function(){var n={MAX_CODEPOINT:1114111,encodeUTF8:function(n,e){var t=null;for("number"==typeof n&&(t=n,n=function(){return null});null!==t||null!==(t=n());)t<128?e(127&t):t<2048?(e(t>>6&31|192),e(63&t|128)):t<65536?(e(t>>12&15|224),e(t>>6&63|128),e(63&t|128)):(e(t>>18&7|240),e(t>>12&63|128),e(t>>6&63|128),e(63&t|128)),t=null},decodeUTF8:function(n,e){for(var t,l,r,u,o=function(n){n=n.slice(0,n.indexOf(null));var e=Error(n.toString());throw e.name="TruncatedError",e.bytes=n,e};null!==(t=n());)if(0==(128&t))e(t);else if(192==(224&t))null===(l=n())&&o([t,l]),e((31&t)<<6|63&l);else if(224==(240&t))(null===(l=n())||null===(r=n()))&&o([t,l,r]),e((15&t)<<12|(63&l)<<6|63&r);else{if(240!=(248&t))throw RangeError("Illegal starting byte: "+t);(null===(l=n())||null===(r=n())||null===(u=n()))&&o([t,l,r,u]),e((7&t)<<18|(63&l)<<12|(63&r)<<6|63&u)}},UTF16toUTF8:function(n,e){for(var t,l=null;null!==(t=null!==l?l:n());)t>=55296&&t<=57343&&null!==(l=n())&&l>=56320&&l<=57343?(e(1024*(t-55296)+l-56320+65536),l=null):e(t);null!==l&&e(l)},UTF8toUTF16:function(n,e){var t=null;for("number"==typeof n&&(t=n,n=function(){return null});null!==t||null!==(t=n());)t<=65535?e(t):(e(55296+((t-=65536)>>10)),e(t%1024+56320)),t=null},encodeUTF16toUTF8:function(e,t){n.UTF16toUTF8(e,function(e){n.encodeUTF8(e,t)})},decodeUTF8toUTF16:function(e,t){n.decodeUTF8(e,function(e){n.UTF8toUTF16(e,t)})},calculateCodePoint:function(n){return n<128?1:n<2048?2:n<65536?3:4},calculateUTF8:function(n){for(var e,t=0;null!==(e=n());)t+=e<128?1:e<2048?2:e<65536?3:4;return t},calculateUTF16asUTF8:function(e){var t=0,l=0;return n.UTF16toUTF8(e,function(n){++t,l+=n<128?1:n<2048?2:n<65536?3:4}),[t,l]}};return n}();return t.toUTF8=function(n,e){if(void 0===n&&(n=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal begin: Not an integer");if(n>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,n<0||n>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+e+" <= "+this.buffer.byteLength)}var t;try{c.decodeUTF8toUTF16((function(){return nc;)if((i=a[c++])!=i)return!0}else for(;s>c;c++)if((n||c in a)&&a[c]===t)return n||c||0;return!n&&-1}}},{"./_to-absolute-index":98,"./_to-iobject":100,"./_to-length":101}],56:[function(n,e,t){var l=n("./_cof"),r=n("./_wks")("toStringTag"),u="Arguments"==l(function(){return arguments}());e.exports=function(n){var e,t,o;return void 0===n?"Undefined":null===n?"Null":"string"==typeof(t=function(n,e){try{return n[e]}catch(n){}}(e=Object(n),r))?t:u?l(e):"Object"==(o=l(e))&&"function"==typeof e.callee?"Arguments":o}},{"./_cof":57,"./_wks":107}],57:[function(n,e,t){var l={}.toString;e.exports=function(n){return l.call(n).slice(8,-1)}},{}],58:[function(n,e,t){var l=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=l)},{}],59:[function(n,e,t){var l=n("./_a-function");e.exports=function(n,e,t){if(l(n),void 0===e)return n;switch(t){case 1:return function(t){return n.call(e,t)};case 2:return function(t,l){return n.call(e,t,l)};case 3:return function(t,l,r){return n.call(e,t,l,r)}}return function(){return n.apply(e,arguments)}}},{"./_a-function":52}],60:[function(n,e,t){e.exports=function(n){if(void 0==n)throw TypeError("Can't call method on "+n);return n}},{}],61:[function(n,e,t){e.exports=!n("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":66}],62:[function(n,e,t){var l=n("./_is-object"),r=n("./_global").document,u=l(r)&&l(r.createElement);e.exports=function(n){return u?r.createElement(n):{}}},{"./_global":67,"./_is-object":74}],63:[function(n,e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],64:[function(n,e,t){var l=n("./_object-keys"),r=n("./_object-gops"),u=n("./_object-pie");e.exports=function(n){var e=l(n),t=r.f;if(t)for(var o,i=t(n),a=u.f,s=0;i.length>s;)a.call(n,o=i[s++])&&e.push(o);return e}},{"./_object-gops":87,"./_object-keys":90,"./_object-pie":91}],65:[function(n,e,t){var l=n("./_global"),r=n("./_core"),u=n("./_ctx"),o=n("./_hide"),i=function(n,e,t){var a,s,c,d=n&i.F,f=n&i.G,h=n&i.S,p=n&i.P,m=n&i.B,g=n&i.W,v=f?r:r[e]||(r[e]={}),b=v.prototype,y=f?l:h?l[e]:(l[e]||{}).prototype;for(a in f&&(t=e),t)(s=!d&&y&&void 0!==y[a])&&a in v||(c=s?y[a]:t[a],v[a]=f&&"function"!=typeof y[a]?t[a]:m&&s?u(c,l):g&&y[a]==c?function(n){var e=function(e,t,l){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(e);case 2:return new n(e,t)}return new n(e,t,l)}return n.apply(this,arguments)};return e.prototype=n.prototype,e}(c):p&&"function"==typeof c?u(Function.call,c):c,p&&((v.virtual||(v.virtual={}))[a]=c,n&i.R&&b&&!b[a]&&o(b,a,c)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,e.exports=i},{"./_core":58,"./_ctx":59,"./_global":67,"./_hide":69}],66:[function(n,e,t){e.exports=function(n){try{return!!n()}catch(n){return!0}}},{}],67:[function(n,e,t){var l=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=l)},{}],68:[function(n,e,t){var l={}.hasOwnProperty;e.exports=function(n,e){return l.call(n,e)}},{}],69:[function(n,e,t){var l=n("./_object-dp"),r=n("./_property-desc");e.exports=n("./_descriptors")?function(n,e,t){return l.f(n,e,r(1,t))}:function(n,e,t){return n[e]=t,n}},{"./_descriptors":61,"./_object-dp":82,"./_property-desc":92}],70:[function(n,e,t){var l=n("./_global").document;e.exports=l&&l.documentElement},{"./_global":67}],71:[function(n,e,t){e.exports=!n("./_descriptors")&&!n("./_fails")(function(){return 7!=Object.defineProperty(n("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":61,"./_dom-create":62,"./_fails":66}],72:[function(n,e,t){var l=n("./_cof");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==l(n)?n.split(""):Object(n)}},{"./_cof":57}],73:[function(n,e,t){var l=n("./_cof");e.exports=Array.isArray||function(n){return"Array"==l(n)}},{"./_cof":57}],74:[function(n,e,t){e.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},{}],75:[function(n,e,t){"use strict";var l=n("./_object-create"),r=n("./_property-desc"),u=n("./_set-to-string-tag"),o={};n("./_hide")(o,n("./_wks")("iterator"),function(){return this}),e.exports=function(n,e,t){n.prototype=l(o,{next:r(1,t)}),u(n,e+" Iterator")}},{"./_hide":69,"./_object-create":81,"./_property-desc":92,"./_set-to-string-tag":94,"./_wks":107}],76:[function(n,e,t){"use strict";var l=n("./_library"),r=n("./_export"),u=n("./_redefine"),o=n("./_hide"),i=n("./_has"),a=n("./_iterators"),s=n("./_iter-create"),c=n("./_set-to-string-tag"),d=n("./_object-gpo"),f=n("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(n,e,t,m,g,v,b){s(t,e,m);var y,_,w,C=function(n){if(!h&&n in k)return k[n];switch(n){case"keys":case"values":return function(){return new t(this,n)}}return function(){return new t(this,n)}},E=e+" Iterator",A="values"==g,x=!1,k=n.prototype,S=k[f]||k["@@iterator"]||g&&k[g],F=S||C(g),B=g?A?C("entries"):F:void 0,D="Array"==e&&k.entries||S;if(D&&(w=d(D.call(new n)))!==Object.prototype&&w.next&&(c(w,E,!0),l||i(w,f)||o(w,f,p)),A&&S&&"values"!==S.name&&(x=!0,F=function(){return S.call(this)}),l&&!b||!h&&!x&&k[f]||o(k,f,F),a[e]=F,a[E]=p,g)if(y={values:A?F:C("values"),keys:v?F:C("keys"),entries:B},b)for(_ in y)_ in k||u(k,_,y[_]);else r(r.P+r.F*(h||x),e,y);return y}},{"./_export":65,"./_has":68,"./_hide":69,"./_iter-create":75,"./_iterators":78,"./_library":79,"./_object-gpo":88,"./_redefine":93,"./_set-to-string-tag":94,"./_wks":107}],77:[function(n,e,t){e.exports=function(n,e){return{value:e,done:!!n}}},{}],78:[function(n,e,t){e.exports={}},{}],79:[function(n,e,t){e.exports=!0},{}],80:[function(n,e,t){var l=n("./_uid")("meta"),r=n("./_is-object"),u=n("./_has"),o=n("./_object-dp").f,i=0,a=Object.isExtensible||function(){return!0},s=!n("./_fails")(function(){return a(Object.preventExtensions({}))}),c=function(n){o(n,l,{value:{i:"O"+ ++i,w:{}}})},d=e.exports={KEY:l,NEED:!1,fastKey:function(n,e){if(!r(n))return"symbol"==typeof n?n:("string"==typeof n?"S":"P")+n;if(!u(n,l)){if(!a(n))return"F";if(!e)return"E";c(n)}return n[l].i},getWeak:function(n,e){if(!u(n,l)){if(!a(n))return!0;if(!e)return!1;c(n)}return n[l].w},onFreeze:function(n){return s&&d.NEED&&a(n)&&!u(n,l)&&c(n),n}}},{"./_fails":66,"./_has":68,"./_is-object":74,"./_object-dp":82,"./_uid":104}],81:[function(n,e,t){var l=n("./_an-object"),r=n("./_object-dps"),u=n("./_enum-bug-keys"),o=n("./_shared-key")("IE_PROTO"),i=function(){},a=function(){var e,t=n("./_dom-create")("iframe"),l=u.length;for(t.style.display="none",n("./_html").appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("