From 08e9e1b3b74793198098edbb98adadee63e14db0 Mon Sep 17 00:00:00 2001 From: Avihai Cohen Date: Sat, 24 Feb 2018 03:17:37 +0200 Subject: [PATCH] improve getAccoutData speed --- work_place/models/layout/layout.js | 4 +- work_place/workers/get-account-data.js | 76 +++++++++++++++++++++----- 2 files changed, 65 insertions(+), 15 deletions(-) diff --git a/work_place/models/layout/layout.js b/work_place/models/layout/layout.js index 740671a..4488259 100644 --- a/work_place/models/layout/layout.js +++ b/work_place/models/layout/layout.js @@ -24,7 +24,7 @@ function LayoutController($scope, $http, $state, $timeout, $rootScope, $mdSidena if (msg.data.error) { console.error('getAccountData error', msg.data.error); } else { - console.log('getAccountData success', msg.data.success); + msg.data.success = JSON.parse(msg.data.success).data; $rootScope.accountData = msg.data.success; $rootScope.accountData.miBalance = iota.utils.convertUnits($rootScope.accountData.balance, 'i', 'Mi'); localStorage.setItem('AccountData', JSON.stringify(msg.data.success)); @@ -46,7 +46,7 @@ function LayoutController($scope, $http, $state, $timeout, $rootScope, $mdSidena if (msg.data.error) { console.error('getAccountData error', msg.data.error); } else { - console.log('getAccountData success', msg.data.success); + msg.data.success = JSON.parse(msg.data.success).data; $rootScope.accountData = msg.data.success; $rootScope.accountData.miBalance = iota.utils.convertUnits($rootScope.accountData.balance, 'i', 'Mi'); localStorage.setItem('AccountData', JSON.stringify(msg.data.success)); diff --git a/work_place/workers/get-account-data.js b/work_place/workers/get-account-data.js index 31be77c..e415cf2 100644 --- a/work_place/workers/get-account-data.js +++ b/work_place/workers/get-account-data.js @@ -1,18 +1,68 @@ onmessage = function(seed) { !function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(e){var r=t[a][1][e];return i(r||e)},f,f.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a-1){var n=Object.keys(e).filter(function(t){return r.indexOf(t)>-1&&e[t].length>1e3});if(n.length)return this._makeRequest.batchedSend(e,n,1e3,t)}return this._makeRequest.send(e,t)},n.prototype.attachToTangle=function(e,t,r,n,s){if(!a.isHash(e))return s(o.invalidTrunkOrBranch(e));if(!a.isHash(t))return s(o.invalidTrunkOrBranch(t));if(!a.isValue(r))return s(o.notInt());if(!a.isArrayOfTrytes(n))return s(o.invalidTrytes());var c=i.attachToTangle(e,t,r,n);return this.sendCommand(c,s)},n.prototype.findTransactions=function(e,t){if(!a.isObject(e))return t(o.invalidKey());var r=["bundles","addresses","tags","approvees"],n=!1;if(Object.keys(e).forEach(function(t){if(-1!==r.indexOf(t)){"addresses"===t&&(e.addresses=e.addresses.map(function(e){return l.noChecksum(e)}));var i=e[t];if("tags"===t)e.tags=i.map(function(e){for(;e.length<27;)e+="9";{if(a.isTrytes(e,27))return e;n=o.invalidTrytes()}});else if(!a.isArrayOfHashes(i))return void(n=o.invalidTrytes())}else n=o.invalidKey()}),!n){var s=i.findTransactions(e);return this.sendCommand(s,t)}t(n)},n.prototype.getBalances=function(e,t,r){if(!a.isArrayOfHashes(e))return r(o.invalidTrytes());var n=i.getBalances(e.map(function(e){return l.noChecksum(e)}),t);return this.sendCommand(n,r)},n.prototype.getInclusionStates=function(e,t,r){if(!a.isArrayOfHashes(e))return r(o.invalidTrytes());if(!a.isArrayOfHashes(t))return r(o.invalidTrytes());var n=i.getInclusionStates(e,t);return this.sendCommand(n,r)},n.prototype.getNodeInfo=function(e){var t=i.getNodeInfo();return this.sendCommand(t,e)},n.prototype.getNeighbors=function(e){var t=i.getNeighbors();return this.sendCommand(t,e)},n.prototype.addNeighbors=function(e,t){for(var r=0;r0))return s(o,a);setTimeout(function(){c.promoteTransaction(e,t,r,n,i,s)},i.delay)}):s(o.inconsistentSubtangle(e))}).catch(function(e){s(e)})},n.prototype.replayBundle=function(e,t,r,n){var i=this;return a.isHash(e)?a.isValue(t)&&a.isValue(r)?void i.getBundle(e,function(e,o){if(e)return n(e);var a=[];return o.forEach(function(e){a.push(l.transactionTrytes(e))}),i.sendTrytes(a.reverse(),t,r,n)}):n(o.invalidInputs()):n(o.invalidTrytes())},n.prototype.broadcastBundle=function(e,t){var r=this;if(!a.isHash(e))return t(o.invalidTrytes());r.getBundle(e,function(e,n){if(e)return t(e);var i=[];return n.forEach(function(e){i.push(l.transactionTrytes(e))}),r.broadcastTransactions(i.reverse(),t)})},n.prototype._newAddress=function(e,t,r,n){var i=u.key(c.trits(e),t,r),o=u.digests(i),a=u.address(o),s=c.trytes(a);return n&&(s=l.addChecksum(s)),s},n.prototype.getNewAddress=function(e,t,r){var n=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(t)&&(r=t,t={}),!a.isTrytes(e))return r(o.invalidSeed());var i=0;if("index"in t&&(i=t.index,!a.isValue(i)||i<0))return r(o.invalidIndex());var s=t.checksum||!1,c=t.total||null,u=2;if("security"in t&&(u=t.security,!a.isValue(u)||u<1||u>3))return r(o.invalidSecurity());var f=[];if(c){for(var l=0;l0},function(e,n){if(e)return r(e);var i=t.returnAll?f:n;return r(null,i)})},n.prototype.getInputs=function(e,t,r){function n(e){i.getBalances(e,100,function(t,n){if(t)return r(t);for(var i={inputs:[],totalBalance:0},o=!u,a=0;a0){var l={address:e[a],balance:c,keyIndex:s+a,security:f};if(i.inputs.push(l),i.totalBalance+=c,u&&i.totalBalance>=u){o=!0;break}}}return o?r(null,i):r(new Error("Not enough balance"))})}var i=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(t)&&(r=t,t={}),!a.isTrytes(e))return r(o.invalidSeed());var s=t.start||0,c=t.end||null,u=t.threshold||null,f=t.security||2;if(t.end&&(s>c||c>s+500))return r(new Error("Invalid inputs provided"));if(c){for(var l=[],d=s;d=r){var c=o-r;if(c>0&&m)w.addEntry(1,m,c,g,s),d(t);else if(c>0){for(var u=0,f=0;f0&&(e.message=h+e.message,y=!0),90===e.address.length&&!l.isValidChecksum(e.address))return n(o.invalidChecksum(e.address));e.address=l.noChecksum(e.address)}),!a.isTransfersArray(t))return n(o.invalidTransfers());if(r.inputs&&!a.isInputs(r.inputs))return n(o.invalidInputs());for(var g,m=r.address||null,b=(r.inputs,r.security||2),w=new f,_=0,k=[],S=0;S2187){x+=Math.floor(t[S].message.length/2187);for(var A=t[S].message;A;){T=A.slice(0,2187);A=A.slice(2187,A.length);for(E=0;T.length<2187;E++)T+="9";k.push(T)}}else{var T="";t[S].message&&(T=t[S].message.slice(0,2187));for(E=0;T.length<2187;E++)T+="9";k.push(T)}var B=Math.floor(Date.now()/1e3);g=t[S].obsoleteTag?t[S].obsoleteTag:"999999999999999999999999999";for(var E=0;g.length<27;E++)g+="9";w.addEntry(x,t[S].address,t[S].value,g,B),_+=parseInt(t[S].value)}if(!_){w.finalize(),w.addTrytes(k);var H=[];return w.bundle.forEach(function(e){H.push(l.transactionTrytes(e))}),n(null,H.reverse())}if(r.inputs){var j=[];r.inputs.forEach(function(e){j.push(e.address)}),p.getBalances(j,100,function(e,t){if(e)return n(e);for(var o=[],a=0,s=0;s0){a+=c;var u=r.inputs[s];if(u.balance=c,o.push(u),a>=_)break}}if(_>a)return n(new Error("Not enough balance"));i(o)})}else p.getInputs(e,{threshold:_,security:b},function(e,t){if(e)return n(e);i(t.inputs)})},n.prototype.traverseBundle=function(e,t,r,n){var i=this;i.getTrytes(Array(e),function(e,o){if(e)return n(e);var a=o[0];if(!a)return n(new Error("Bundle transactions not visible"));var s=l.transactionObject(a);if(!s)return n(new Error("Invalid trytes, could not create object"));if(!t&&0!==s.currentIndex)return n(new Error("Invalid tail transaction supplied."));if(t||(t=s.bundle),t!==s.bundle)return n(null,r);if(0===s.lastIndex&&0===s.currentIndex)return n(null,Array(s));var c=s.trunkTransaction;return r.push(s),i.traverseBundle(c,t,r,n)})},n.prototype.getBundle=function(e,t){var r=this;if(!a.isHash(e))return t(o.invalidInputs(e));r.traverseBundle(e,null,Array(),function(e,r){return e?t(e):l.isBundle(r)?t(null,r):t(new Error("Invalid Bundle provided"))})},n.prototype._bundlesFromAddresses=function(e,t,r){var n=this;n.findTransactionObjects({addresses:e},function(e,i){if(e)return r(e);var o=new Set,a=new Set;i.forEach(function(e){0===e.currentIndex?o.add(e.hash):a.add(e.bundle)}),n.findTransactionObjects({bundles:Array.from(a)},function(e,i){if(e)return r(e);i.forEach(function(e){0===e.currentIndex&&o.add(e.hash)});var a=[],s=Array.from(o);d.waterfall([function(e){t?n.getLatestInclusion(s,function(t,n){if(t)return r(t);e(null,n)}):e(null,[])},function(e,i){d.mapSeries(s,function(r,i){n.getBundle(r,function(n,o){if(!n){if(t){var c=e[s.indexOf(r)];o.forEach(function(e){e.persistence=c})}a.push(o)}i(null,!0)})},function(e,t){return a.sort(function(e,t){var r=parseInt(e[0].attachmentTimestamp),n=parseInt(t[0].attachmentTimestamp);return rn?1:0}),r(e,a)})}])})})},n.prototype.getTransfers=function(e,t,r){var n=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(t)&&(r=t,t={}),!a.isTrytes(e))return r(o.invalidSeed(e));var i=t.start||0,s=t.end||null,c=t.inclusionStates||null,u=t.security||2;if(i>s||s>i+500)return r(new Error("Invalid inputs provided"));var f={index:i,total:s?s-i:null,returnAll:!0,security:u};n.getNewAddress(e,f,function(e,t){return e?r(e):n._bundlesFromAddresses(t,c,r)})},n.prototype.getAccountData=function(e,t,r){var n=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(t)&&(r=t,t={}),!a.isTrytes(e))return r(o.invalidSeed(e));var i=t.start||0,s=t.end||null,c=t.security||2;if(s&&(i>s||s>i+1e3))return r(new Error("Invalid inputs provided"));var u={latestAddress:"",addresses:[],transfers:[],inputs:[],balance:0},f={index:i,total:s?s-i:null,returnAll:!0,security:c};n.getNewAddress(e,f,function(e,t){if(e)return r(e);u.latestAddress=t[t.length-1],u.addresses=t.slice(0,-1),n._bundlesFromAddresses(t,!0,function(e,t){if(e)return r(e);u.transfers=t,n.getBalances(u.addresses,100,function(e,t){return e?r(e):(t.balances.forEach(function(e,t){var e=parseInt(e);if(u.balance+=e,e>0){var r={address:u.addresses[t],keyIndex:t,security:c,balance:e};u.inputs.push(r)}}),r(null,u))})})})},n.prototype.isReattachable=function(e,t){var r=this;a.isString(e)&&(e=new Array(e));for(var n={},i=[],s=0;s0)){var s=[],c=i.length;if(c>1)for(var u=0;u-1&&(t[n]=e[n])}),t},getBalances:function(e,t){return{command:"getBalances",addresses:e,threshold:t}},getInclusionStates:function(e,t){return{command:"getInclusionStates",transactions:e,tips:t}},getNodeInfo:function(){return{command:"getNodeInfo"}},getNeighbors:function(){return{command:"getNeighbors"}},addNeighbors:function(e){return{command:"addNeighbors",uris:e}},removeNeighbors:function(e){return{command:"removeNeighbors",uris:e}},getTips:function(){return{command:"getTips"}},getTransactionsToApprove:function(e,t){var r={command:"getTransactionsToApprove",depth:e};return void 0!=t&&(r.reference=t),r},getTrytes:function(e){return{command:"getTrytes",hashes:e}},interruptAttachingToTangle:function(){return{command:"interruptAttachingToTangle"}},checkConsistency:function(e){return{command:"checkConsistency",tails:e}},broadcastTransactions:function(e){return{command:"broadcastTransactions",trytes:e}},storeTransactions:function(e){return{command:"storeTransactions",trytes:e}}}},{}],4:[function(e,t,r){function n(){this.bundle=[]}var i=e("../curl/curl"),o=e("../kerl/kerl"),a=e("../converter/converter"),s=e("../helpers/adder");n.prototype.addEntry=function(e,t,r,n,i,o){for(var a=0;a=0){for(;n-- >0;)for(i=0;i<27;i++)if(t[27*r+i]>-13){t[27*r+i]--;break}}else for(;n++<0;)for(i=0;i<27;i++)if(t[27*r+i]<13){t[27*r+i]++;break}}return t},t.exports=n},{"../converter/converter":5,"../curl/curl":7,"../helpers/adder":8,"../kerl/kerl":10}],5:[function(e,t,r){var n=[[0,0,0],[1,0,0],[-1,1,0],[0,1,0],[1,1,0],[-1,-1,1],[0,-1,1],[1,-1,1],[-1,0,1],[0,0,1],[1,0,1],[-1,1,1],[0,1,1],[1,1,1],[-1,-1,-1],[0,-1,-1],[1,-1,-1],[-1,0,-1],[0,0,-1],[1,0,-1],[-1,1,-1],[0,1,-1],[1,1,-1],[-1,-1,0],[0,-1,0],[1,-1,0],[-1,0,0]];t.exports={trits:function(e,t){var r=t||[];if(Number.isInteger(e)){for(var i=e<0?-e:e;i>0;){var o=i%3;i=Math.floor(i/3),o>1&&(o=-1,i++),r[r.length]=o}if(e<0)for(a=0;a0;)t=3*t+e[r];return t},fromValue:function(e){for(var t=[],r=e<0?-e:e,n=0;r>0;){var i=r%3;r=Math.floor(r/3),i>1&&(i=-1,r++),t[n]=i,n++}if(e<0)for(var o=0;o>>0},c=function(e,t){return e/Math.pow(2,t)>>>0},u=function(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255},f=function(e,t,r){var n=e+t,i=4294967295&c(n,32),o=(4294967295&n)>>>0,a=0!=i;r&&(n=o+1);var s=0!=(i=4294967295&c(n,32));return[o=(4294967295&n)>>>0,a||s]},l=function(e,t){for(var r=!0,n=0;n>>0,r);e[n]=i[0],r=i[1]}if(!r)throw"noborrow"},d=function(e,t){for(var r=e.length;r-- >0;){var n=e[r]>>>0,i=t[r]>>>0;if(ni)return 1}return 0},h=function(e,t){for(var r=!1,n=0;n0;){for(var f=e[i]+1,h=r,y=0,g=0;g>>0}y>0&&(t[h]=y,r+=1),(h=p(t,f))>r&&(r=h)}if(!v(t))if(d(n,t)<=0)l(t,n);else{var b=o(n);l(b,t),s(b),p(b,1),t=b}}a(t);for(i=0;i>31==0)h(r,n);else if(s(r),d(r,n)>0)l(r,n),i=!0;else{p(r,1);var c=o(n);l(c,r),r=c}for(var u=0,f=0;f<242;f++){u=0;for(var v=11;v>=0;v--){var y=(0!=u?4294967295*u+u:0)+r[v],g=y/3>>>0,m=y%3>>>0;r[v]=g,u=m}t[f]=u-1}if(i)for(f=0;f0)},n.prototype.squeeze=function(e,t,r){do{for(var n=0,i=r<243?r:243;n0)},n.prototype.transform=function(){for(var e=[],t=0,r=0;r0?1:r<0?-1:0}function a(e,t,r){var a=n(e,t),s=o(i(e,t),i(a,r));return[n(a,r),s]}t.exports=function(e,t){for(var r,n,i=new Array(Math.max(e.length,t.length)),o=0,s=0;s0){var a=o.trits(e.bundle[n].bundle),s=new Int8Array(243);t.initialize(),t.absorb(r),t.absorb(a),t.squeeze(s);var c=o.trytes(s);e.bundle[n].signatureMessageFragment=c+e.bundle[n].signatureMessageFragment.substring(81,2187)}},t.exports=n},{"../converter/converter":5,"../curl/curl":7}],10:[function(e,t,r){function n(){this.k=i.algo.SHA3.create(),this.k.init({outputLength:s})}var i=e("crypto-js"),o=(e("../converter/converter"),e("../curl/curl")),a=e("../converter/words"),s=384;n.BIT_HASH_LENGTH=s,n.HASH_LENGTH=o.HASH_LENGTH,n.prototype.initialize=function(e){},n.prototype.reset=function(){this.k.reset()},n.prototype.absorb=function(e,t,r){if(r&&r%243!=0)throw new Error("Illegal length provided");do{var n=r0)},n.prototype.squeeze=function(e,t,r){if(r&&r%243!=0)throw new Error("Illegal length provided");do{for(var n=this.k.clone().finalize(),i=a.words_to_trits(n.words),s=0,c=r0)},t.exports=n},{"../converter/converter":5,"../converter/words":6,"../curl/curl":7,"crypto-js":33}],11:[function(e,t,r){var n=e("../curl/curl"),i=e("../converter/converter"),o=e("../bundle/bundle"),a=e("../helpers/adder"),s=function(e,t){var r=[],i=new n;i.initialize();for(var o=0;o<27;o++){r=t.slice(243*o,243*(o+1));for(var a=e[o]+13;a-- >0;){var s=new n;s.initialize(),s.absorb(r,0,r.length),s.squeeze(r,0,n.HASH_LENGTH)}i.absorb(r,0,r.length)}return i.squeeze(r,0,n.HASH_LENGTH),r};t.exports={key:function(e,t,r){for(;e.length%243!=0;)e.push(0);var o=i.fromValue(t),s=a(e.slice(),o),c=new n;c.initialize(),c.absorb(s,0,s.length),c.squeeze(s,0,s.length),c.initialize(),c.absorb(s,0,s.length);for(var u=[],f=0,l=[];r-- >0;)for(var d=0;d<27;d++){c.squeeze(l,0,s.length);for(var h=0;h<243;h++)u[f++]=l[h]}return u},digests:function(e){for(var t=[],r=[],i=0;i0;){var c=new i;c.initialize(),c.absorb(r,0,r.length),c.squeeze(r,0,n.HASH_LENGTH)}o.absorb(r,0,r.length)}return o.squeeze(r,0,n.HASH_LENGTH),r};t.exports={key:function(e,t,r){for(;e.length%243!=0;)e.push(0);var n=o.fromValue(t),a=s(e.slice(),n),c=new i;c.initialize(),c.absorb(a,0,a.length),c.squeeze(a,0,a.length),c.reset(),c.absorb(a,0,a.length);for(var u=[],f=0,l=[];r-- >0;)for(var d=0;d<27;d++){c.squeeze(l,0,a.length);for(var h=0;h<243;h++)u[f++]=l[h]}return u},digests:function(e){for(var t=[],r=[],o=0;o0){var i=0-r,o=Math.floor(Date.now()/1e3);s.addEntry(e.securitySum,e.address,i,a,o)}if(d>r)return n(new Error("Not enough balance."));if(r>d){var c=r-d;if(!t)return n(new Error("No remainder address defined"));s.addEntry(1,t,c,a,o)}return s.finalize(),s.addTrytes(h),n(null,s.bundle)}var o=this;if(r.forEach(function(e){e.message=e.message?e.message:"",e.tag=e.tag?e.tag:"",e.address=u.noChecksum(e.address)}),!f.isTransfersArray(r))return n(l.invalidTransfers());if(!f.isValue(e.securitySum))return n(l.invalidInputs());if(!f.isAddress(e.address))return n(l.invalidTrytes());if(t&&!f.isAddress(t))return n(l.invalidTrytes());for(var a,s=new c,d=0,h=[],p=0;p2187){v+=Math.floor(r[p].message.length/2187);for(var y=r[p].message;y;){g=y.slice(0,2187);y=y.slice(2187,y.length);for(b=0;g.length<2187;b++)g+="9";h.push(g)}}else{var g="";r[p].message&&(g=r[p].message.slice(0,2187));for(b=0;g.length<2187;b++)g+="9";h.push(g)}var m=Math.floor(Date.now()/1e3);a=r[p].tag?r[p].tag:"999999999999999999999999999";for(var b=0;a.length<27;b++)a+="9";s.addEntry(v,r[p].address.slice(0,81),r[p].value,a,m),d+=parseInt(r[p].value)}if(!d)return n(new Error("Invalid value transfer: the transfer does not require a signature."));if(e.balance)i(e.balance,n);else{var w={command:"getBalances",addresses:new Array(e.address),threshold:100};o._makeRequest.send(w,function(e,t){if(e)return n(e);i(parseInt(t.balances[0]),n)})}},n.prototype.addSignature=function(e,t,r,n){var a=new c;a.bundle=e;for(var s=r.length/2187,r=o.trits(r),u=0,l=0;l255)return null;var i=n%27,o=(n-i)/27;t+="9ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i]+"9ABCDEFGHIJKLMNOPQRSTUVWXYZ"[o]}return t},fromTrytes:function(e){if("string"!=typeof e)return null;if(e.length%2)return null;for(var t="",r=0;rl[t].dp)throw new Error("Input value exceeded max fromUnit precision.");return n.times(l[t].val).dividedBy(l[r].val).toNumber()},addChecksum:d,noChecksum:h,isValidChecksum:function(e){var t=h(e);return d(t)===e},transactionObject:function(e){if(e){for(var t=2279;t<2295;t++)if("9"!==e.charAt(t))return null;var r={},n=a.trits(e),o=[],s=new i;return s.initialize(),s.absorb(n,0,n.length),s.squeeze(o,0,243),r.hash=a.trytes(o),r.signatureMessageFragment=e.slice(0,2187),r.address=e.slice(2187,2268),r.value=a.value(n.slice(6804,6837)),r.obsoleteTag=e.slice(2295,2322),r.timestamp=a.value(n.slice(6966,6993)),r.currentIndex=a.value(n.slice(6993,7020)),r.lastIndex=a.value(n.slice(7020,7047)),r.bundle=e.slice(2349,2430),r.trunkTransaction=e.slice(2430,2511),r.branchTransaction=e.slice(2511,2592),r.tag=e.slice(2592,2619),r.attachmentTimestamp=a.value(n.slice(7857,7884)),r.attachmentTimestampLowerBound=a.value(n.slice(7884,7911)),r.attachmentTimestampUpperBound=a.value(n.slice(7911,7938)),r.nonce=e.slice(2646,2673),r}},transactionTrytes:p,categorizeTransfers:function(e,t){var r={sent:[],received:[]};return e.forEach(function(e){var n=!1;e.forEach(function(i,o){if(t.indexOf(i.address)>-1){var a=i.currentIndex===i.lastIndex&&0!==i.lastIndex;i.value<0&&!n&&!a?(r.sent.push(e),n=!0):i.value>=0&&!n&&!a&&r.received.push(e)}})}),r},toTrytes:c.toTrytes,fromTrytes:c.fromTrytes,extractJson:u,validateSignatures:function(e,t){for(var r,i=[],o=0;o-1&&e%1==0&&e<=xt}function b(e){return null!=e&&m(e.length)&&!g(e)}function w(){}function _(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}}function k(e,t){for(var r=-1,n=Array(e);++r-1&&e%1==0&&ei?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n=n?e:Z(e,t,r)}function Q(e,t){for(var r=e.length;r--&&W(t,e[r],0)>-1;);return r}function ee(e,t){for(var r=-1,n=e.length;++r-1;);return r}function te(e){return e.split("")}function re(e){return lr.test(e)}function ne(e){return e.match(br)||[]}function ie(e){return re(e)?ne(e):te(e)}function oe(e){return null==e?"":$(e)}function ae(e,t,r){if((e=oe(e))&&(r||void 0===t))return e.replace(wr,"");if(!e||!(t=$(t)))return e;var n=ie(e),i=ie(t);return Y(n,ee(n,i),Q(n,i)+1).join("")}function se(e){return e=e.toString().replace(xr,""),e=e.match(_r)[2].replace(" ",""),e=e?e.split(kr):[],e=e.map(function(e){return ae(e.replace(Sr,""))})}function ce(e,t){var r={};U(e,function(e,t){function n(t,r){var n=K(i,function(e){return t[e]});n.push(r),d(e).apply(null,n)}var i,o=l(e),a=!o&&1===e.length||o&&0===e.length;if(Ct(e))i=e.slice(0,-1),e=e[e.length-1],r[t]=i.concat(i.length>0?n:e);else if(a)r[t]=e;else{if(i=se(e),0===e.length&&!o&&0===i.length)throw new Error("autoInject task functions require explicit parameters.");o||i.pop(),r[t]=i.concat(n)}}),ar(r,t)}function ue(){this.head=this.tail=null,this.length=0}function fe(e,t){e.length=1,e.head=e.tail=t}function le(e,t,r){function n(e,t,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(u.started=!0,Ct(e)||(e=[e]),0===e.length&&u.idle())return at(function(){u.drain()});for(var n=0,i=e.length;n=0&&s.splice(o,1),i.callback.apply(i,arguments),null!=t&&u.error(t,i.data)}a<=u.concurrency-u.buffer&&u.unsaturated(),u.idle()&&u.drain(),u.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var o=d(e),a=0,s=[],c=!1,u={_tasks:new ue,concurrency:t,payload:r,saturated:w,unsaturated:w,buffer:t/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(e,t){n(e,!1,t)},kill:function(){u.drain=w,u._tasks.empty()},unshift:function(e,t){n(e,!0,t)},remove:function(e){u._tasks.remove(e)},process:function(){if(!c){for(c=!0;!u.paused&&a2&&(o=i(arguments,1)),n[t]=o,r(e)})},function(e){r(e,n)})}function Le(e,t){Fe(Yt,e,t)}function Re(e,t,r){Fe(N(t),e,r)}function Me(e,t){if(t=_(t||w),!Ct(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;rn?1:0}var i=d(t);Qt(e,function(e,t){i(e,function(r,n){if(r)return t(r);t(null,{value:e,criteria:n})})},function(e,t){if(e)return r(e);r(null,K(t.sort(n),Ee("value")))})}function Ke(e,t,r){var n=d(e);return nt(function(i,o){var a,s=!1;i.push(function(){s||(o.apply(null,arguments),clearTimeout(a))}),a=setTimeout(function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),s=!0,o(n)},t),n.apply(null,i)})}function Xe(e,t,r,n){for(var i=-1,o=cn(sn((t-e)/(r||1)),0),a=Array(o);o--;)a[n?o:++i]=e,e+=r;return a}function $e(e,t,r,n){var i=d(r);tr(Xe(0,e,1),t,i,n)}function Ze(e,t,r,n){arguments.length<=3&&(n=r,r=t,t=Ct(e)?[]:{}),n=_(n||w);var i=d(r);Yt(e,function(e,r,n){i(t,e,r,n)},function(e){n(e,t)})}function Ye(e,t){var r,n=null;t=t||w,Lr(e,function(e,t){d(e)(function(e,o){r=arguments.length>2?i(arguments,1):o,n=e,t(!e)})},function(){t(n,r)})}function Qe(e){return function(){return(e.unmemoized||e).apply(null,arguments)}}function et(e,t,r){r=z(r||w);var n=d(t);if(!e())return r(null);var o=function(t){if(t)return r(t);if(e())return n(o);var a=i(arguments,1);r.apply(null,[null].concat(a))};n(o)}function tt(e,t,r){et(function(){return!e.apply(this,arguments)},t,r)}var rt,nt=function(e){return function(){var t=i(arguments),r=t.pop();e.call(this,t,r)}},it="function"==typeof setImmediate&&setImmediate,ot="object"==typeof e&&"function"==typeof e.nextTick,at=s(rt=it?setImmediate:ot?e.nextTick:a),st="function"==typeof Symbol,ct="object"==typeof n&&n&&n.Object===Object&&n,ut="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||ut||Function("return this")(),lt=ft.Symbol,dt=Object.prototype,ht=dt.hasOwnProperty,pt=dt.toString,vt=lt?lt.toStringTag:void 0,yt=Object.prototype.toString,gt="[object Null]",mt="[object Undefined]",bt=lt?lt.toStringTag:void 0,wt="[object AsyncFunction]",_t="[object Function]",kt="[object GeneratorFunction]",St="[object Proxy]",xt=9007199254740991,At={},Tt="function"==typeof Symbol&&Symbol.iterator,Bt=function(e){return Tt&&e[Tt]&&e[Tt]()},Et="[object Arguments]",Ht=Object.prototype,jt=Ht.hasOwnProperty,Ot=Ht.propertyIsEnumerable,It=x(function(){return arguments}())?x:function(e){return S(e)&&jt.call(e,"callee")&&!Ot.call(e,"callee")},Ct=Array.isArray,zt="object"==typeof r&&r&&!r.nodeType&&r,Nt=zt&&"object"==typeof t&&t&&!t.nodeType&&t,Ft=Nt&&Nt.exports===zt?ft.Buffer:void 0,Lt=(Ft?Ft.isBuffer:void 0)||function(){return!1},Rt=9007199254740991,Mt=/^(?:0|[1-9]\d*)$/,Dt={};Dt["[object Float32Array]"]=Dt["[object Float64Array]"]=Dt["[object Int8Array]"]=Dt["[object Int16Array]"]=Dt["[object Int32Array]"]=Dt["[object Uint8Array]"]=Dt["[object Uint8ClampedArray]"]=Dt["[object Uint16Array]"]=Dt["[object Uint32Array]"]=!0,Dt["[object Arguments]"]=Dt["[object Array]"]=Dt["[object ArrayBuffer]"]=Dt["[object Boolean]"]=Dt["[object DataView]"]=Dt["[object Date]"]=Dt["[object Error]"]=Dt["[object Function]"]=Dt["[object Map]"]=Dt["[object Number]"]=Dt["[object Object]"]=Dt["[object RegExp]"]=Dt["[object Set]"]=Dt["[object String]"]=Dt["[object WeakMap]"]=!1;var Pt="object"==typeof r&&r&&!r.nodeType&&r,qt=Pt&&"object"==typeof t&&t&&!t.nodeType&&t,Ut=qt&&qt.exports===Pt&&ct.process,Jt=function(){try{return Ut&&Ut.binding("util")}catch(e){}}(),Vt=Jt&&Jt.isTypedArray,Gt=Vt?function(e){return function(t){return e(t)}}(Vt):function(e){return S(e)&&m(e.length)&&!!Dt[y(e)]},Wt=Object.prototype.hasOwnProperty,Kt=Object.prototype,Xt=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),$t=Object.prototype.hasOwnProperty,Zt=L(F,1/0),Yt=function(e,t,r){(b(e)?R:Zt)(e,d(t),r)},Qt=M(D),er=h(Qt),tr=P(D),rr=L(tr,1),nr=h(rr),ir=function(e){var t=i(arguments,1);return function(){var r=i(arguments);return e.apply(null,t.concat(r))}},or=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}(),ar=function(e,t,r){function n(e,t){y.push(function(){c(e,t)})}function o(){if(0===y.length&&0===h)return r(null,l);for(;y.length&&h2&&(n=i(arguments,1)),t){var o={};U(l,function(e,t){o[t]=e}),o[e]=n,p=!0,v=Object.create(null),r(t,o)}else l[e]=n,s(e)});h++;var o=d(t[t.length-1]);t.length>1?o(l,n):o(n)}}function u(t){var r=[];return U(e,function(e,n){Ct(e)&&W(e,t,0)>=0&&r.push(n)}),r}"function"==typeof t&&(r=t,t=null),r=_(r||w);var f=H(e).length;if(!f)return r(null);t||(t=f);var l={},h=0,p=!1,v=Object.create(null),y=[],g=[],m={};U(e,function(t,r){if(!Ct(t))return n(r,[t]),void g.push(r);var i=t.slice(0,t.length-1),o=i.length;if(0===o)return n(r,t),void g.push(r);m[r]=o,q(i,function(s){if(!e[s])throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+s+"` in "+i.join(", "));a(s,function(){0===--o&&n(r,t)})})}),function(){for(var e=0;g.length;)e++,q(u(g.pop()),function(e){0==--m[e]&&g.push(e)});if(e!==f)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),o()},sr="[object Symbol]",cr=1/0,ur=lt?lt.prototype:void 0,fr=ur?ur.toString:void 0,lr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),dr="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",hr="\\ud83c[\\udffb-\\udfff]",pr="(?:\\ud83c[\\udde6-\\uddff]){2}",vr="[\\ud800-\\udbff][\\udc00-\\udfff]",yr="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",gr="[\\ufe0e\\ufe0f]?"+yr+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",pr,vr].join("|")+")[\\ufe0e\\ufe0f]?"+yr+")*"),mr="(?:"+["[^\\ud800-\\udfff]"+dr+"?",dr,pr,vr,"[\\ud800-\\udfff]"].join("|")+")",br=RegExp(hr+"(?="+hr+")|"+mr+gr,"g"),wr=/^\s+|\s+$/g,_r=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,kr=/,/,Sr=/(=.+)?(\s*)$/,xr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;ue.prototype.removeLink=function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e},ue.prototype.empty=function(){for(;this.head;)this.shift();return this},ue.prototype.insertAfter=function(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1},ue.prototype.insertBefore=function(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1},ue.prototype.unshift=function(e){this.head?this.insertBefore(this.head,e):fe(this,e)},ue.prototype.push=function(e){this.tail?this.insertAfter(this.tail,e):fe(this,e)},ue.prototype.shift=function(){return this.head&&this.removeLink(this.head)},ue.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},ue.prototype.toArray=function(){for(var e=Array(this.length),t=this.head,r=0;r=i.priority;)i=i.next;for(var o=0,a=e.length;o15&&j(z,m,e),a=!1):u.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=d(c,10,r,u.s)}else{if(e instanceof t)return u.s=e.s,u.e=e.e,u.c=(e=e.c)?e.slice():e,void(z=0);if((a="number"==typeof e)&&0*e==0){if(u.s=1/e<0?(e=-e,-1):1,e===~~e){for(i=0,o=e;o>=10;o/=10,i++);return u.e=i,u.c=[e],void(z=0)}c=e+""}else{if(!h.test(c=e+""))return C(u,c,a);u.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((i=c.indexOf("."))>-1&&(c=c.replace(".","")),(o=c.search(/e/i))>0?(i<0&&(i=o),i+=+c.slice(o+1),c=c.substring(0,o)):i<0&&(i=c.length),o=0;48===c.charCodeAt(o);o++);for(s=c.length;48===c.charCodeAt(--s););if(c=c.slice(o,s+1))if(s=c.length,a&&U&&s>15&&(e>k||e!==v(e))&&j(z,m,u.s*e),(i=i-o-1)>q)u.c=u.e=null;else if(i=0&&(u=W,W=0,e=e.replace(".",""),d=(p=new t(n)).pow(e.length-v),W=u,p.c=c(f(i(d.c),d.e),10,r),p.e=p.c.length),s=u=(h=c(e,n,r)).length;0==h[--u];h.pop());if(!h[0])return"0";if(v<0?--s:(d.c=h,d.e=s,d.s=o,h=(d=I(d,p,y,g,r)).c,l=d.r,s=d.e),a=s+y+1,v=h[a],u=r/2,l=l||a<0||null!=h[a+1],l=g<4?(null!=v||l)&&(0==g||g==(d.s<0?3:2)):v>u||v==u&&(4==g||l||6==g&&1&h[a-1]||g==(d.s<0?8:7)),a<1||!h[0])e=l?f("1",-y):"0";else{if(h.length=a,l)for(--r;++h[--a]>r;)h[a]=0,a||(++s,h=[1].concat(h));for(u=h.length;!h[--u];);for(v=0,e="";v<=u;e+=b.charAt(h[v++]));e=f(e,s)}return e}function T(e,r,n,o){var a,s,c,l,d;if(n=null!=n&&J(n,0,8,o,g)?0|n:R,!e.c)return e.toString();if(a=e.c[0],c=e.e,null==r)d=i(e.c),d=19==o||24==o&&c<=M?u(d,c):f(d,c);else if(e=O(new t(e),r,n),s=e.e,d=i(e.c),l=d.length,19==o||24==o&&(r<=s||s<=M)){for(;ll){if(--r>0)for(d+=".";r--;d+="0");}else if((r+=s-l)>0)for(s+1==l&&(d+=".");r--;d+="0");return e.s<0&&a?"-"+d:d}function B(e,r){var n,i,o=0;for(s(e[0])&&(e=e[0]),n=new t(e[0]);++or||e!=l(e))&&j(n,(i||"decimal places")+(er?" out of range":" not an integer"),e),!0}function H(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*_-1)>q?e.c=e.e=null:r=10;s/=10,i++);if((o=t-i)<0)o+=_,a=t,f=(c=l[u=0])/d[i-a-1]%10|0;else if((u=p((o+1)/_))>=l.length){if(!n)break e;for(;l.length<=u;l.push(0));c=f=0,i=1,a=(o%=_)-_+1}else{for(c=s=l[u],i=1;s>=10;s/=10,i++);f=(a=(o%=_)-_+i)<0?0:c/d[i-a-1]%10|0}if(n=n||t<0||null!=l[u+1]||(a<0?c:c%d[i-a-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(o>0?a>0?c/d[i-a]:0:l[u-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,n?(t-=e.e+1,l[0]=d[(_-t%_)%_],e.e=-t||0):l[0]=e.e=0,e;if(0==o?(l.length=u,s=1,u--):(l.length=u+1,s=d[_-o],l[u]=a>0?v(c/d[i-a]%d[a])*s:0),n)for(;;){if(0==u){for(o=1,a=l[0];a>=10;a/=10,o++);for(a=l[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,l[0]==w&&(l[0]=1));break}if(l[u]+=s,l[u]!=w)break;l[u--]=0,s=1}for(o=l.length;0===l[--o];l.pop());}e.e>q?e.c=e.e=null:e.er)return null!=(e=i[r++])};return c(t="DECIMAL_PLACES")&&J(e,0,A,2,t)&&(L=0|e),n[t]=L,c(t="ROUNDING_MODE")&&J(e,0,8,2,t)&&(R=0|e),n[t]=R,c(t="EXPONENTIAL_AT")&&(s(e)?J(e[0],-A,0,2,t)&&J(e[1],0,A,2,t)&&(M=0|e[0],D=0|e[1]):J(e,-A,A,2,t)&&(M=-(D=0|(e<0?-e:e)))),n[t]=[M,D],c(t="RANGE")&&(s(e)?J(e[0],-A,-1,2,t)&&J(e[1],1,A,2,t)&&(P=0|e[0],q=0|e[1]):J(e,-A,A,2,t)&&(0|e?P=-(q=0|(e<0?-e:e)):U&&j(2,t+" cannot be zero",e))),n[t]=[P,q],c(t="ERRORS")&&(e===!!e||1===e||0===e?(z=0,J=(U=!!e)?E:a):U&&j(2,t+y,e)),n[t]=U,c(t="CRYPTO")&&(!0===e||!1===e||1===e||0===e?e?!(e="undefined"==typeof crypto)&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?V=!0:U?j(2,"crypto unavailable",e?void 0:crypto):V=!1:V=!1:U&&j(2,t+y,e)),n[t]=V,c(t="MODULO_MODE")&&J(e,0,9,2,t)&&(G=0|e),n[t]=G,c(t="POW_PRECISION")&&J(e,0,A,2,t)&&(W=0|e),n[t]=W,c(t="FORMAT")&&("object"==typeof e?K=e:U&&j(2,t+" not an object",e)),n[t]=K,n},t.max=function(){return B(arguments,N.lt)},t.min=function(){return B(arguments,N.gt)},t.random=function(){var e=9007199254740992*Math.random()&2097151?function(){return v(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(r){var n,i,o,a,s,c=0,u=[],f=new t(F);if(r=null!=r&&J(r,0,A,14)?0|r:L,a=p(r/_),V)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(a*=2));c>>11))>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),n[c]=i[0],n[c+1]=i[1]):(u.push(s%1e14),c+=2);c=a/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(a*=7);c=9e15?crypto.randomBytes(7).copy(n,c):(u.push(s%1e14),c+=7);c=a/7}else V=!1,U&&j(14,"crypto unavailable",crypto);if(!V)for(;c=10;s/=10,c++);c<_&&(o-=_-c)}return f.e=o,f.c=u,f}}(),I=function(){function e(e,t,r){var n,i,o,a,s=0,c=e.length,u=t%x,f=t/x|0;for(e=e.slice();c--;)s=((i=u*(o=e[c]%x)+(n=f*o+(a=e[c]/x|0)*u)%x*x+s)/r|0)+(n/x|0)+f*a,e[c]=i%r;return s&&(e=[s].concat(e)),e}function r(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function i(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(o,a,s,c,u){var f,l,d,h,p,y,g,m,b,k,S,x,A,T,B,E,H,j=o.s==a.s?1:-1,I=o.c,C=a.c;if(!(I&&I[0]&&C&&C[0]))return new t(o.s&&a.s&&(I?!C||I[0]!=C[0]:C)?I&&0==I[0]||!C?0*j:j/0:NaN);for(b=(m=new t(j)).c=[],j=s+(l=o.e-a.e)+1,u||(u=w,l=n(o.e/_)-n(a.e/_),j=j/_|0),d=0;C[d]==(I[d]||0);d++);if(C[d]>(I[d]||0)&&l--,j<0)b.push(1),h=!0;else{for(T=I.length,E=C.length,d=0,j+=2,(p=v(u/(C[0]+1)))>1&&(C=e(C,p,u),I=e(I,p,u),E=C.length,T=I.length),A=E,S=(k=I.slice(0,E)).length;S=u/2&&B++;do{if(p=0,(f=r(C,k,E,S))<0){if(x=k[0],E!=S&&(x=x*u+(k[1]||0)),(p=v(x/B))>1)for(p>=u&&(p=u-1),g=(y=e(C,p,u)).length,S=k.length;1==r(y,k,g,S);)p--,i(y,E=10;j/=10,d++);O(m,s+(m.e=d+l*_-1)+1,c,h)}else m.e=l,m.r=+h;return m}}(),C=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,n=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,u){var f,l=c?s:s.replace(o,"");if(i.test(l))a.s=isNaN(l)?null:l<0?-1:1;else{if(!c&&(l=l.replace(e,function(e,t,r){return f="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=f?e:t}),u&&(f=u,l=l.replace(r,"$1").replace(n,"0.$1")),s!=l))return new t(l,f);U&&j(z,"not a"+(u?" base "+u:"")+" number",s),a.s=null}a.c=a.e=null,z=0}}(),N.absoluteValue=N.abs=function(){var e=new t(this);return e.s<0&&(e.s=1),e},N.ceil=function(){return O(new t(this),this.e+1,2)},N.comparedTo=N.cmp=function(e,r){return z=1,o(this,new t(e,r))},N.decimalPlaces=N.dp=function(){var e,t,r=this.c;if(!r)return null;if(e=((t=r.length-1)-n(this.e/_))*_,t=r[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},N.dividedBy=N.div=function(e,r){return z=3,I(this,new t(e,r),L,R)},N.dividedToIntegerBy=N.divToInt=function(e,r){return z=4,I(this,new t(e,r),0,1)},N.equals=N.eq=function(e,r){return z=5,0===o(this,new t(e,r))},N.floor=function(){return O(new t(this),this.e+1,3)},N.greaterThan=N.gt=function(e,r){return z=6,o(this,new t(e,r))>0},N.greaterThanOrEqualTo=N.gte=function(e,r){return z=7,1===(r=o(this,new t(e,r)))||0===r},N.isFinite=function(){return!!this.c},N.isInteger=N.isInt=function(){return!!this.c&&n(this.e/_)>this.c.length-2},N.isNaN=function(){return!this.s},N.isNegative=N.isNeg=function(){return this.s<0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.lessThan=N.lt=function(e,r){return z=8,o(this,new t(e,r))<0},N.lessThanOrEqualTo=N.lte=function(e,r){return z=9,-1===(r=o(this,new t(e,r)))||0===r},N.minus=N.sub=function(e,r){var i,o,a,s,c=this,u=c.s;if(z=10,e=new t(e,r),r=e.s,!u||!r)return new t(NaN);if(u!=r)return e.s=-r,c.plus(e);var f=c.e/_,l=e.e/_,d=c.c,h=e.c;if(!f||!l){if(!d||!h)return d?(e.s=-r,e):new t(h?c:NaN);if(!d[0]||!h[0])return h[0]?(e.s=-r,e):new t(d[0]?c:3==R?-0:0)}if(f=n(f),l=n(l),d=d.slice(),u=f-l){for((s=u<0)?(u=-u,a=d):(l=f,a=h),a.reverse(),r=u;r--;a.push(0));a.reverse()}else for(o=(s=(u=d.length)<(r=h.length))?u:r,u=r=0;r0)for(;r--;d[i++]=0);for(r=w-1;o>u;){if(d[--o]0?(c=s,i=f):(a=-a,i=u),i.reverse();a--;i.push(0));i.reverse()}for((a=u.length)-(r=f.length)<0&&(i=f,f=u,u=i,r=a),a=0;r;)a=(u[--r]=u[r]+f[r]+a)/w|0,u[r]=w===u[r]?0:u[r]%w;return a&&(u=[a].concat(u),++c),H(e,u,c)},N.precision=N.sd=function(e){var t,r,n=this,i=n.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(U&&j(13,"argument"+y,e),e!=!!e&&(e=null)),!i)return null;if(r=i.length-1,t=r*_+1,r=i[r]){for(;r%10==0;r/=10,t--);for(r=i[0];r>=10;r/=10,t++);}return e&&n.e+1>t&&(t=n.e+1),t},N.round=function(e,r){var n=new t(this);return(null==e||J(e,0,A,15))&&O(n,~~e+this.e+1,null!=r&&J(r,0,8,15,g)?0|r:R),n},N.shift=function(e){var r=this;return J(e,-k,k,16,"argument")?r.times("1e"+l(e)):new t(r.c&&r.c[0]&&(e<-k||e>k)?r.s*(e<0?0:1/0):r)},N.squareRoot=N.sqrt=function(){var e,r,o,a,s,c=this,u=c.c,f=c.s,l=c.e,d=L+4,h=new t("0.5");if(1!==f||!u||!u[0])return new t(!f||f<0&&(!u||u[0])?NaN:u?c:1/0);if(0==(f=Math.sqrt(+c))||f==1/0?(((r=i(u)).length+l)%2==0&&(r+="0"),f=Math.sqrt(r),l=n((l+1)/2)-(l<0||l%2),o=new t(r=f==1/0?"1e"+l:(r=f.toExponential()).slice(0,r.indexOf("e")+1)+l)):o=new t(f+""),o.c[0])for((f=(l=o.e)+d)<3&&(f=0);;)if(s=o,o=h.times(s.plus(I(c,s,d,1))),i(s.c).slice(0,f)===(r=i(o.c)).slice(0,f)){if(o.e=0;){for(i=0,p=S[a]%m,v=S[a]/m|0,s=a+(c=f);s>a;)i=((l=p*(l=k[--c]%m)+(u=v*l+(d=k[c]/m|0)*p)%m*m+y[s]+i)/g|0)+(u/m|0)+v*d,y[s--]=l%g;y[s]=i}return i?++o:y.splice(0,1),H(e,y,o)},N.toDigits=function(e,r){var n=new t(this);return e=null!=e&&J(e,1,A,18,"precision")?0|e:null,r=null!=r&&J(r,0,8,18,g)?0|r:R,e?O(n,e,r):n},N.toExponential=function(e,t){return T(this,null!=e&&J(e,0,A,19)?1+~~e:null,t,19)},N.toFixed=function(e,t){return T(this,null!=e&&J(e,0,A,20)?~~e+this.e+1:null,t,20)},N.toFormat=function(e,t){var r=T(this,null!=e&&J(e,0,A,21)?~~e+this.e+1:null,t,21);if(this.c){var n,i=r.split("."),o=+K.groupSize,a=+K.secondaryGroupSize,s=K.groupSeparator,c=i[0],u=i[1],f=this.s<0,l=f?c.slice(1):c,d=l.length;if(a&&(n=o,o=a,a=n,d-=n),o>0&&d>0){for(n=d%o||o,c=l.substr(0,n);n0&&(c+=s+l.slice(n)),f&&(c="-"+c)}r=u?c+K.decimalSeparator+((a=+K.fractionGroupSize)?u.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+K.fractionGroupSeparator):u):c}return r},N.toFraction=function(e){var r,n,o,a,s,c,u,f,l,d=U,h=this,p=h.c,v=new t(F),y=n=new t(F),g=u=new t(F);if(null!=e&&(U=!1,c=new t(e),U=d,(d=c.isInt())&&!c.lt(F)||(U&&j(22,"max denominator "+(d?"out of range":"not an integer"),e),e=!d&&c.c&&O(c,c.e+1,1).gte(F)?c:null)),!p)return h.toString();for(l=i(p),a=v.e=l.length-h.e-1,v.c[0]=S[(s=a%_)<0?_+s:s],e=!e||c.cmp(v)>0?a>0?v:y:c,s=q,q=1/0,c=new t(l),u.c[0]=0;f=I(c,v,0,1),1!=(o=n.plus(f.times(g))).cmp(e);)n=g,g=o,y=u.plus(f.times(o=y)),u=o,v=c.minus(f.times(o=v)),c=o;return o=I(e.minus(n),g,0,1),u=u.plus(o.times(y)),n=n.plus(o.times(g)),u.s=y.s=h.s,a*=2,r=I(y,g,a,R).minus(h).abs().cmp(I(u,n,a,R).minus(h).abs())<1?[y.toString(),g.toString()]:[u.toString(),n.toString()],q=s,r},N.toNumber=function(){return+this},N.toPower=N.pow=function(e,r){var n,i,o,a=v(e<0?-e:+e),s=this;if(null!=r&&(z=23,r=new t(r)),!J(e,-k,k,23,"exponent")&&(!isFinite(e)||a>k&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return n=Math.pow(+s,e),new t(r?n%r:n);for(r?e>1&&s.gt(F)&&s.isInt()&&r.gt(F)&&r.isInt()?s=s.mod(r):(o=r,r=null):W&&(n=p(W/_+2)),i=new t(F);;){if(a%2){if(!(i=i.times(s)).c)break;n?i.c.length>n&&(i.c.length=n):r&&(i=i.mod(r))}if(!(a=v(a/2)))break;s=s.times(s),n?s.c&&s.c.length>n&&(s.c.length=n):r&&(s=s.mod(r))}return r?i:(e<0&&(i=F.div(i)),o?i.mod(o):n?O(i,W,R):i)},N.toPrecision=function(e,t){return T(this,null!=e&&J(e,1,A,24,"precision")?0|e:null,t,24)},N.toString=function(e){var t,r=this,n=r.s,o=r.e;return null===o?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(t=i(r.c),t=null!=e&&J(e,2,64,25,"base")?d(f(t,o),0|e,10,n):o<=M||o>=D?u(t,o):f(t,o),n<0&&r.c[0]&&(t="-"+t)),t},N.truncated=N.trunc=function(){return O(new t(this),this.e+1,1)},N.valueOf=N.toJSON=function(){var e,t=this,r=t.e;return null===r?t.toString():(e=i(t.c),e=r<=M||r>=D?u(e,r):f(e,r),t.s<0?"-"+e:e)},N.isBigNumber=!0,null!=e&&t.config(e),t}function n(e){var t=0|e;return e>0||e===t?t:t-1}function i(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nu^r?1:-1;for(s=(c=i.length)<(u=o.length)?c:u,a=0;ao[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function a(e,t,r){return(e=l(e))>=t&&e<=r}function s(e){return"[object Array]"==Object.prototype.toString.call(e)}function c(e,t,r){for(var n,i,o=[0],a=0,s=e.length;ar-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function u(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function f(e,t){var r,n;if(t<0){for(n="0.";++t;n+="0");e=n+e}else if(r=e.length,++t>r){for(n="0",t-=r;--t;n+="0");e+=n}else t>>8^255&p^99,i[r]=p,o[p]=r;var v=e[r],y=e[v],g=e[y],m=257*e[p]^16843008*p;a[r]=m<<24|m>>>8,s[r]=m<<16|m>>>16,c[r]=m<<8|m>>>24,u[r]=m;m=16843009*g^65537*y^257*v^16843008*r;f[p]=m<<24|m>>>8,l[p]=m<<16|m>>>16,d[p]=m<<8|m>>>24,h[p]=m,r?(r=v^e[e[e[g^v]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=n.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[a/r|0]<<24),o[a]=o[a-r]^u}for(var s=this._invKeySchedule=[],c=0;c>>24]]^l[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,d,h,o);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],d=e[t+3]^r[3],h=4,p=1;p>>24]^i[f>>>16&255]^o[l>>>8&255]^a[255&d]^r[h++],y=n[f>>>24]^i[l>>>16&255]^o[d>>>8&255]^a[255&u]^r[h++],g=n[l>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&f]^r[h++],m=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&l]^r[h++];u=v,f=y,l=g,d=m}var v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[h++],y=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^r[h++],g=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[h++],m=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&l])^r[h++];e[t]=v,e[t+1]=y,e[t+2]=g,e[t+3]=m},keySize:8});t.AES=r._createHelper(v)}(),e.AES})},{"./cipher-core":26,"./core":27,"./enc-base64":28,"./evpkdf":30,"./md5":35}],26:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./evpkdf")):"function"==typeof define&&define.amd?define(["./core","./evpkdf"],i):i(n.CryptoJS)}(this,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,o=n.WordArray,a=n.BufferedBlockAlgorithm,s=r.enc,c=(s.Utf8,s.Base64),u=r.algo.EvpKDF,f=n.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:g}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),l=(n.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),d=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=l.CBC=function(){function e(e,r,n){var i=this._iv;if(i){o=i;this._iv=t}else var o=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},v=(n.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:p}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)n=o.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=o.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return v.create({ciphertext:t,salt:n})}},g=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),m=(r.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=u.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:n})}},b=n.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=g.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,g.decrypt.call(this,e,t,i.key,n)}})}()})},{"./core":27,"./evpkdf":30}],27:[function(e,t,r){!function(e,n){"object"==typeof r?t.exports=r=n():"function"==typeof define&&define.amd?define([],n):e.CryptoJS=n()}(this,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*o(),n.push(4294967296*o()|0)}return new a.init(n,t)}}),s=n.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=i/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,u=e.min(4*c,i);if(c){for(var f=0;f>>6-a%4*2;i[o>>>2]|=(s|c)<<24-o%4*8,o++}return n.create(i,o)}var r=e,n=r.lib.WordArray;r.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>8&16711935}var r=e,n=r.lib.WordArray,i=r.enc;i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};i.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(e){for(var r=e.length,i=[],o=0;o>>1]|=t(e.charCodeAt(o)<<16-o%2*16);return n.create(i,2*r)}}}(),e.enc.Utf16})},{"./core":27}],30:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./sha1"),e("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],i):i(n.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.MD5,s=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),o=i.create(),a=o.words,s=r.keySize,c=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray})},{"./core":27}],35:[function(e,t,r){!function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof define&&define.amd?define(["./core"],i):i(n.CryptoJS)}(this,function(e){return function(t){function r(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function n(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function i(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function o(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}var a=e,s=a.lib,c=s.WordArray,u=s.Hasher,f=a.algo,l=[];!function(){for(var e=0;e<64;e++)l[e]=4294967296*t.abs(t.sin(e+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var a=0;a<16;a++){var s=t+a,c=e[s];e[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var u=this._hash.words,f=e[t+0],d=e[t+1],h=e[t+2],p=e[t+3],v=e[t+4],y=e[t+5],g=e[t+6],m=e[t+7],b=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],S=e[t+12],x=e[t+13],A=e[t+14],T=e[t+15],B=u[0],E=u[1],H=u[2],j=u[3];E=o(E=o(E=o(E=o(E=i(E=i(E=i(E=i(E=n(E=n(E=n(E=n(E=r(E=r(E=r(E=r(E,H=r(H,j=r(j,B=r(B,E,H,j,f,7,l[0]),E,H,d,12,l[1]),B,E,h,17,l[2]),j,B,p,22,l[3]),H=r(H,j=r(j,B=r(B,E,H,j,v,7,l[4]),E,H,y,12,l[5]),B,E,g,17,l[6]),j,B,m,22,l[7]),H=r(H,j=r(j,B=r(B,E,H,j,b,7,l[8]),E,H,w,12,l[9]),B,E,_,17,l[10]),j,B,k,22,l[11]),H=r(H,j=r(j,B=r(B,E,H,j,S,7,l[12]),E,H,x,12,l[13]),B,E,A,17,l[14]),j,B,T,22,l[15]),H=n(H,j=n(j,B=n(B,E,H,j,d,5,l[16]),E,H,g,9,l[17]),B,E,k,14,l[18]),j,B,f,20,l[19]),H=n(H,j=n(j,B=n(B,E,H,j,y,5,l[20]),E,H,_,9,l[21]),B,E,T,14,l[22]),j,B,v,20,l[23]),H=n(H,j=n(j,B=n(B,E,H,j,w,5,l[24]),E,H,A,9,l[25]),B,E,p,14,l[26]),j,B,b,20,l[27]),H=n(H,j=n(j,B=n(B,E,H,j,x,5,l[28]),E,H,h,9,l[29]),B,E,m,14,l[30]),j,B,S,20,l[31]),H=i(H,j=i(j,B=i(B,E,H,j,y,4,l[32]),E,H,b,11,l[33]),B,E,k,16,l[34]),j,B,A,23,l[35]),H=i(H,j=i(j,B=i(B,E,H,j,d,4,l[36]),E,H,v,11,l[37]),B,E,m,16,l[38]),j,B,_,23,l[39]),H=i(H,j=i(j,B=i(B,E,H,j,x,4,l[40]),E,H,f,11,l[41]),B,E,p,16,l[42]),j,B,g,23,l[43]),H=i(H,j=i(j,B=i(B,E,H,j,w,4,l[44]),E,H,S,11,l[45]),B,E,T,16,l[46]),j,B,h,23,l[47]),H=o(H,j=o(j,B=o(B,E,H,j,f,6,l[48]),E,H,m,10,l[49]),B,E,A,15,l[50]),j,B,y,21,l[51]),H=o(H,j=o(j,B=o(B,E,H,j,S,6,l[52]),E,H,p,10,l[53]),B,E,_,15,l[54]),j,B,d,21,l[55]),H=o(H,j=o(j,B=o(B,E,H,j,b,6,l[56]),E,H,T,10,l[57]),B,E,g,15,l[58]),j,B,x,21,l[59]),H=o(H,j=o(j,B=o(B,E,H,j,v,6,l[60]),E,H,k,10,l[61]),B,E,h,15,l[62]),j,B,w,21,l[63]),u[0]=u[0]+B|0,u[1]=u[1]+E|0,u[2]=u[2]+H|0,u[3]=u[3]+j|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});a.MD5=u._createHelper(d),a.HmacMD5=u._createHmacHelper(d)}(Math),e.MD5})},{"./core":27}],36:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return e.mode.CFB=function(){function t(e,t,r,n){var i=this._iv;if(i){o=i.slice(0);this._iv=void 0}else var o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var n=e.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),r(a);var s=a.slice(0);n.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},{"./cipher-core":26,"./core":27}],42:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},{"./cipher-core":26,"./core":27}],43:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},{"./cipher-core":26,"./core":27}],44:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},{"./cipher-core":26,"./core":27}],45:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding})},{"./cipher-core":26,"./core":27}],46:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./sha1"),e("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],i):i(n.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.SHA1,s=o.HMAC,c=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=s.create(r.hasher,e),o=i.create(),a=i.create([1]),c=o.words,u=a.words,f=r.keySize,l=r.iterations;c.length>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}var r=e,n=r.lib.StreamCipher,i=[],o=[],a=[],s=r.algo.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,r=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(d=0;d<4;d++)t.call(this);for(d=0;d<8;d++)i[d]^=n[d+4&7];if(r){var o=r.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,l=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=l,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=l;for(var d=0;d<4;d++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var o=0;o<4;o++)i[o]=16711935&(i[o]<<8|i[o]>>>24)|4278255360&(i[o]<<24|i[o]>>>8),e[r+o]^=i[o]},blockSize:4,ivSize:2});r.RabbitLegacy=n._createHelper(s)}(),e.RabbitLegacy})},{"./cipher-core":26,"./core":27,"./enc-base64":28,"./evpkdf":30,"./md5":35}],48:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}var r=e,n=r.lib.StreamCipher,i=[],o=[],a=[],s=r.algo.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,r=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(n=0;n<4;n++)t.call(this);for(n=0;n<8;n++)o[n]^=i[n+4&7];if(r){var a=r.words,s=a[0],c=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=u>>>16|4294901760&f,d=f<<16|65535&u;o[0]^=u,o[1]^=l,o[2]^=f,o[3]^=d,o[4]^=u,o[5]^=l,o[6]^=f,o[7]^=d;for(n=0;n<4;n++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var o=0;o<4;o++)i[o]=16711935&(i[o]<<8|i[o]>>>24)|4278255360&(i[o]<<24|i[o]>>>8),e[r+o]^=i[o]},blockSize:4,ivSize:2});r.Rabbit=n._createHelper(s)}(),e.Rabbit})},{"./cipher-core":26,"./core":27,"./enc-base64":28,"./evpkdf":30,"./md5":35}],49:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return function(){function t(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}var r=e,n=r.lib.StreamCipher,i=r.algo,o=i.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,o=0;i<256;i++){var a=i%r,s=t[a>>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var c=n[i];n[i]=n[o],n[o]=c}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=t.call(this)},keySize:8,ivSize:0});r.RC4=n._createHelper(o);var a=i.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)t.call(this)}});r.RC4Drop=n._createHelper(a)}(),e.RC4})},{"./cipher-core":26,"./core":27,"./enc-base64":28,"./evpkdf":30,"./md5":35}],50:[function(e,t,r){!function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof define&&define.amd?define(["./core"],i):i(n.CryptoJS)}(this,function(e){return function(t){function r(e,t,r){return e^t^r}function n(e,t,r){return e&t|~e&r}function i(e,t,r){return(e|~t)^r}function o(e,t,r){return e&r|t&~r}function a(e,t,r){return e^(t|~r)}function s(e,t){return e<>>32-t}var c=e,u=c.lib,f=u.WordArray,l=u.Hasher,d=c.algo,h=f.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=f.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),v=f.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),y=f.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=f.create([0,1518500249,1859775393,2400959708,2840853838]),m=f.create([1352829926,1548603684,1836072691,2053994217,0]),b=d.RIPEMD160=l.extend({_doReset:function(){this._hash=f.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(z=0;z<16;z++){var c=t+z,u=e[c];e[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var f,l,d,b,w,_,k,S,x,A,T=this._hash.words,B=g.words,E=m.words,H=h.words,j=p.words,O=v.words,I=y.words;_=f=T[0],k=l=T[1],S=d=T[2],x=b=T[3],A=w=T[4];for(var C,z=0;z<80;z+=1)C=f+e[t+H[z]]|0,C+=z<16?r(l,d,b)+B[0]:z<32?n(l,d,b)+B[1]:z<48?i(l,d,b)+B[2]:z<64?o(l,d,b)+B[3]:a(l,d,b)+B[4],C=(C=s(C|=0,O[z]))+w|0,f=w,w=b,b=s(d,10),d=l,l=C,C=_+e[t+j[z]]|0,C+=z<16?a(k,S,x)+E[0]:z<32?o(k,S,x)+E[1]:z<48?i(k,S,x)+E[2]:z<64?n(k,S,x)+E[3]:r(k,S,x)+E[4],C=(C=s(C|=0,I[z]))+A|0,_=A,A=x,x=s(S,10),S=k,k=C;C=T[1]+d+x|0,T[1]=T[2]+b+A|0,T[2]=T[3]+w+_|0,T[3]=T[4]+f+k|0,T[4]=T[0]+l+S|0,T[0]=C},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=l.clone.call(this);return e._hash=this._hash.clone(),e}});c.RIPEMD160=l._createHelper(b),c.HmacRIPEMD160=l._createHmacHelper(b)}(Math),e.RIPEMD160})},{"./core":27}],51:[function(e,t,r){!function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof define&&define.amd?define(["./core"],i):i(n.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=[],a=t.algo.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],c=r[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var f=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=f<<1|f>>>31}var l=(n<<5|n>>>27)+c+o[u];l+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(a),t.HmacSHA1=i._createHmacHelper(a)}(),e.SHA1})},{"./core":27}],52:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],i):i(n.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib.WordArray,n=t.algo,i=n.SHA256,o=n.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o)}(),e.SHA224})},{"./core":27,"./sha256":53}],53:[function(e,t,r){!function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof define&&define.amd?define(["./core"],i):i(n.CryptoJS)}(this,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],c=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var r=2,n=0;n<64;)(function(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0})(r)&&(n<8&&(s[n]=e(t.pow(r,.5))),c[n]=e(t.pow(r,1/3)),n++),r++}();var u=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],d=r[7],h=0;h<64;h++){if(h<16)u[h]=0|e[t+h];else{var p=u[h-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=u[h-2],g=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[h]=v+u[h-7]+g+u[h-16]}var m=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&l)+c[h]+u[h];d=l,l=f,f=s,s=a+w|0,a=o,o=i,i=n,n=w+(b+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(f),r.HmacSHA256=o._createHmacHelper(f)}(Math),e.SHA256})},{"./core":27}],54:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],i):i(n.CryptoJS)}(this,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.x64.Word,s=r.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,l=0,d=0;d<7;d++){if(1&i){var h=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(E=r[i]).high^=a,E.low^=o}for(var s=0;s<24;s++){for(B=0;B<5;B++){for(var d=0,h=0,p=0;p<5;p++)d^=(E=r[B+5*p]).high,h^=E.low;var v=l[B];v.high=d,v.low=h}for(B=0;B<5;B++)for(var y=l[(B+4)%5],g=l[(B+1)%5],m=g.high,b=g.low,d=y.high^(m<<1|b>>>31),h=y.low^(b<<1|m>>>31),p=0;p<5;p++)(E=r[B+5*p]).high^=d,E.low^=h;for(var w=1;w<25;w++){var _=(E=r[w]).high,k=E.low,S=c[w];if(S<32)var d=_<>>32-S,h=k<>>32-S;else var d=k<>>64-S,h=_<>>64-S;var x=l[u[w]];x.high=d,x.low=h}var A=l[0],T=r[0];A.high=T.high,A.low=T.low;for(var B=0;B<5;B++)for(p=0;p<5;p++){var E=r[w=B+5*p],H=l[w],j=l[(B+1)%5+5*p],O=l[(B+2)%5+5*p];E.high=H.high^~j.high&O.high,E.low=H.low^~j.low&O.low}var E=r[0],I=f[s];E.high^=I.high,E.low^=I.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f>>24)|4278255360&(d<<24|d>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(d)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(d),r.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3})},{"./core":27,"./x64-core":58}],55:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],i):i(n.CryptoJS)}(this,function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s)}(),e.SHA384})},{"./core":27,"./sha512":56,"./x64-core":58}],56:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],i):i(n.CryptoJS)}(this,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib.Hasher,i=r.x64,o=i.Word,a=i.WordArray,s=r.algo,c=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=t()}();var f=s.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],d=r[7],h=n.high,p=n.low,v=i.high,y=i.low,g=o.high,m=o.low,b=a.high,w=a.low,_=s.high,k=s.low,S=f.high,x=f.low,A=l.high,T=l.low,B=d.high,E=d.low,H=h,j=p,O=v,I=y,C=g,z=m,N=b,F=w,L=_,R=k,M=S,D=x,P=A,q=T,U=B,J=E,V=0;V<80;V++){var G=u[V];if(V<16)var W=G.high=0|e[t+2*V],K=G.low=0|e[t+2*V+1];else{var X=u[V-15],$=X.high,Z=X.low,Y=($>>>1|Z<<31)^($>>>8|Z<<24)^$>>>7,Q=(Z>>>1|$<<31)^(Z>>>8|$<<24)^(Z>>>7|$<<25),ee=u[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[V-7],ae=oe.high,se=oe.low,ce=u[V-16],ue=ce.high,fe=ce.low,W=(W=(W=Y+ae+((K=Q+se)>>>0>>0?1:0))+ne+((K=K+ie)>>>0>>0?1:0))+ue+((K=K+fe)>>>0>>0?1:0);G.high=W,G.low=K}var le=L&M^~L&P,de=R&D^~R&q,he=H&O^H&C^O&C,pe=j&I^j&z^I&z,ve=(H>>>28|j<<4)^(H<<30|j>>>2)^(H<<25|j>>>7),ye=(j>>>28|H<<4)^(j<<30|H>>>2)^(j<<25|H>>>7),ge=(L>>>14|R<<18)^(L>>>18|R<<14)^(L<<23|R>>>9),me=(R>>>14|L<<18)^(R>>>18|L<<14)^(R<<23|L>>>9),be=c[V],we=be.high,_e=be.low,ke=J+me,Se=(Se=(Se=(Se=U+ge+(ke>>>0>>0?1:0))+le+((ke=ke+de)>>>0>>0?1:0))+we+((ke=ke+_e)>>>0<_e>>>0?1:0))+W+((ke=ke+K)>>>0>>0?1:0),xe=ye+pe,Ae=ve+he+(xe>>>0>>0?1:0);U=P,J=q,P=M,q=D,M=L,D=R,L=N+Se+((R=F+ke|0)>>>0>>0?1:0)|0,N=C,F=z,C=O,z=I,O=H,I=j,H=Se+Ae+((j=ke+xe|0)>>>0>>0?1:0)|0}p=n.low=p+j,n.high=h+H+(p>>>0>>0?1:0),y=i.low=y+I,i.high=v+O+(y>>>0>>0?1:0),m=o.low=m+z,o.high=g+C+(m>>>0>>0?1:0),w=a.low=w+F,a.high=b+N+(w>>>0>>0?1:0),k=s.low=k+R,s.high=_+L+(k>>>0>>0?1:0),x=f.low=x+D,f.high=S+M+(x>>>0>>0?1:0),T=l.low=T+q,l.high=A+P+(T>>>0>>0?1:0),E=d.low=E+J,d.high=B+U+(E>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=n._createHelper(f),r.HmacSHA512=n._createHmacHelper(f)}(),e.SHA512})},{"./core":27,"./x64-core":58}],57:[function(e,t,r){!function(n,i,o){"object"==typeof r?t.exports=r=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(n.CryptoJS)}(this,function(e){return function(){function t(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){for(var a=i[o]=[],s=f[o],r=0;r<24;r++)a[r/6|0]|=t[(u[r]-1+s)%28]<<31-r%6,a[4+(r/6|0)]|=t[28+(u[r+24]-1+s)%28]<<31-r%6;a[0]=a[0]<<1|a[0]>>>31;for(r=1;r<7;r++)a[r]=a[r]>>>4*(r-1)+3;a[7]=a[7]<<5|a[7]>>>27}for(var l=this._invSubKeys=[],r=0;r<16;r++)l[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,n,i){this._lBlock=e[n],this._rBlock=e[n+1],t.call(this,4,252645135),t.call(this,16,65535),r.call(this,2,858993459),r.call(this,8,16711935),t.call(this,1,1431655765);for(var o=0;o<16;o++){for(var a=i[o],s=this._lBlock,c=this._rBlock,u=0,f=0;f<8;f++)u|=l[f][((c^a[f])&d[f])>>>0];this._lBlock=c,this._rBlock=s^u}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,t.call(this,1,1431655765),r.call(this,8,16711935),r.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),e[n]=this._lBlock,e[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=a._createHelper(h);var p=s.TripleDES=a.extend({_doReset:function(){var e=this._key.words;this._des1=h.createEncryptor(o.create(e.slice(0,2))),this._des2=h.createEncryptor(o.create(e.slice(2,4))),this._des3=h.createEncryptor(o.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});n.TripleDES=a._createHelper(p)}(),e.TripleDES})},{"./cipher-core":26,"./core":27,"./enc-base64":28,"./evpkdf":30,"./md5":35}],58:[function(e,t,r){!function(n,i){"object"==typeof r?t.exports=r=i(e("./core")):"function"==typeof define&&define.amd?define(["./core"],i):i(n.CryptoJS)}(this,function(e){return function(t){var r=e,n=r.lib,i=n.Base,o=n.WordArray,a=r.x64={};a.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n1)for(var r=1;r=1.8.0",browserify:">=14.1.0",chai:"^4.0.2",del:"^3.0.0",gulp:"^3.9.1","gulp-jshint":"^2.0.2","gulp-nsp":">=2.4.2","gulp-rename":">=1.2.2","gulp-replace":"^0.6.1","gulp-uglify":"^3.0.0",jshint:"^2.9.4",mocha:"^3.2.0","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0"}}},{}]},{},[1]); - // var iota = new self.IOTA({'provider': 'http://node.lukaseder.de:14265'}); + var serializeFun = function(obj, prefix) { + var str = [], p; + for(p in obj) { + if (obj.hasOwnProperty(p)) { + var k = prefix ? prefix + "[" + p + "]" : p, v = obj[p]; + str.push((v !== null && typeof v === "object") ? + serializeFun(v, k) : + encodeURIComponent(k) + "=" + encodeURIComponent(v)); + } + } + return str.join("&"); + }; + function toObject(arr) { + var rv = {}; + for (var i = 0; i < arr.length; ++i) + rv[i] = arr[i]; + return rv; + }; var iota = new self.IOTA({'provider': 'https://node.iota-community.org'}); - iota.api.getAccountData(seed.data, function(error, success) { - try { - postMessage({ - error: error, - success: success - }); - } catch (error) { - postMessage({ - error: 'Error', - success: success - }); + var start = 0; + var end = null; + var security = 2; + var addressOptions = { + index: start, + total: end ? end - start : null, + returnAll: true, + security: security + }; + iota.api.getNewAddress( + seed.data, + addressOptions, + function (error, success) { + if(error) { + try { + postMessage({ + error: error, + success: success + }); + } catch (error) { + postMessage({ + error: 'Error', + success: success + }); + } + } + if(success) { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open( + "GET", + "https://wallet.iota-community.org/api/getAccountData?"+serializeFun( + { + reqID: new Date().getTime(), + array_of_transactions: JSON.stringify(success) + } + ) + , false + ); + xmlHttp.send(null); + postMessage({ + error: undefined, + success: xmlHttp.responseText + }); + } } - }); + ); };